• Resolved wpress2010

    (@wpress2010)


    I’m trying to figure out the syntax in a Pods template to display the information in a Pods field that is set to the type “website.” I can see how to use that field to display a linkable version of the actual URL. But what I want to show is something like this, which doesn’t work, as the syntax is not correct:

    Visit site
    – which just results in a link to the current page on which the template is referenced.

    Can’t seem to puzzle out how to render the contents of a Pods field as a string, I guess.

    Ideas?

    TIA!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wpress2010

    (@wpress2010)

    Actually, the problem is more accurately stated here:

    If I use this syntax, naturally, I only retrieve the URL if the Pod in question has an entry in that field:

    [if visit_site]<p>Site</p>[/if]

    The resultant display, however, is this:

    https://www.mysite.com”>Site

    So, I believe that something here needs to be escaped in order for the link to function as expected.

    Plugin Contributor Jim True

    (@jimtrue)

    Unfortunately, you’re not encoding your template with the code tag in the editor here, so we can’t see what you’re doing.

    If you have the Website field configured with ‘include link’, it’s going to output your website already as a linked field. Uncheck that in Additional Options and just create the HTML output yourself using the Pods Template:

    
    [if visit_site]
    <p><a href="{@visit_site,esc_url}">Site</a></p>
    [/if]
    
    Thread Starter wpress2010

    (@wpress2010)

    Thanks for your help. I ended up doing this:

    [if web]

    • Web listing: Click
    • [/if]

      which is what you suggested. The @web field has the entire URL in it with the appropriate HTML.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘field type of “website”’ is closed to new replies.