Forum

Thread tagged as: Problem

Link displaying double quote mark & angle bracket on page.

I've copied the link structure from this page and just changed the label tag. But it's displaying "> on the page. Any idea what I'm doing wrong? Code below.

<a href="https://<perch:content id="url" type="text" label="Instagram link" replace="https://|" />"></a>

Mark Phoenix

Mark Phoenix 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

But it's displaying

What is "it" in this context?

The it is the double quote & angle bracket. Anything between the end of the perch content tag and the closing anchor tag is being displayed, so i have "> appearing on my web page.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Where is it being displayed?

Where the link is output.

So this...

Working Link

Becomes this...

Broken link

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does the edit form work ok?

Goodness, you're working late! No, it hasn't shown up in perch yet. Whole template below...

<footer class="main-footer">
    <div class="social-media">

        <a class="instagram" href="https://<perch:content id="url" type="text" label="Instagram link" replace="https://|" />"></a>

        <a class="twitter" title="Follow me on Twitter" href="https://twitter.com/longshot_photo"></a>
        <a class="tumblr" title="Follow me on Tumblr" href="https://kenlongshotphoto.tumblr.com/"></a>
    </div>
    <div class="legal">
        <p>&copy; Longshot Photography  <?php echo date("Y"); ?></p>
    </div>
    <div class="promo">
        <p>Built by <a href="https://pixelsmiths.co.uk">Pixel Smiths</a></p>
    </div>
</footer>

Hello Mark,

There seems to be something strange in this bit of code:

<a class="instagram" href="https://<perch:content id="url" type="text" label="Instagram link" replace="https://|" />"></a>

Viewing it in your original post of your code, the section id="url" has two differently-colored quotes. I'd expect the ensuing type="text" to have the word type colored the same as the previous id, but it's not.

Any idea what's going on there?

Hi John

I hadn't noticed that. That's the way the snippet I copied from this page in the perch docs appears.

I think the different coloured quotes are just as code editors will see you're closing off the first set of quotes i.e href=""

You have PHP in your template which shouldn't be there, not sure whether that's the issue though.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is this page code or template code? Which file is it in?

Ah, no it's the footer file in the perch/templates/layouts folder. That's why the template tag isn't working as it's not in a template... Gets coat