19

I have tried multiple different things, but cannot get the URL to appear as /item like I want it to. I know that everything else is functioning correctly because if I simply replace {{item}} with a string, it works fine. Am I missing something here?

Here is the code section where the problem lies:

<div class="person_images_group">
    {% for item in names %}
        <div class="personlist">
            <a href={{ url_for('name', name = {{item}} ) }}>
                <img id={{ item }} src="" alt={{ item }} width="40" height="40">
            </a>
        </div>
        <script>
            document.getElementById("{{ item }}").src = getName("{{ item }}");
        </script>
    {% endfor %}
<div>

Thank you

0

1 Answer 1

32

You try use {{}} in {{}} block. So right usage is {{ url_for('name', name=item) }}.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! I could have sworn that I tried this. Must have had something else incorrect at the time. Muchas gracias!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.