• Resolved mungbean

    (@mungbean)


    I’m collecting URLs using the Website form field and printing them to the screen using a template.

    The Website field accepts formats as https://example.com, and in my template I am using this syntax <a href = "{@website_link}"> {@post_title} </a> but when it renders rather than the post title being a clickable link to the URL, it is displayed as "https://example.com/"> Post Title and the Post Title is not a hyperlink, rather the URL fragment is a hyperlink, but incorrect. It points to an nonexistent internal <a href=" path.

    There is some corruption or syntax issue. I have other template URLS that work as expected in conjunction with other pod references.

    Please advise

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Paul Clark

    (@pdclark)

    This worked for me in testing, but if I had another required field that wasn’t filled out, the website field would look like it saved when it didn’t, resulting in an empty template as described.

    Do you by chance have another required field that’s being left empty?

    In the website field Edit options, is “Output as a link” unchecked?

    There also should not be spaces around the equals sign between href and “{@website_link}"

    Thread Starter mungbean

    (@mungbean)

    Thanks for the tips, but it doesn’t seem to have resolved it. All of the fields in my custom post type are optional, so there’s no required fields left empty. I’d assume it’d be impossible to save/publish a post with incomplete required fields anyways though?

    The field is also set to “output as a link” and “open in a new window.”

    And whilst there were spaces in my href code, I removed them in the template, but that didn’t fix it either.

    The exact same syntax is used in the same template for a relationship link, and it works fine too. I’m left staring at the code confused haha.

    • This reply was modified 2 years, 11 months ago by mungbean.
    Thread Starter mungbean

    (@mungbean)

    Marking as resolved! I’ve figured it out.

    So having the Website field with the “output as a link” checked, and then wrapping that Pod reference in an href in the template confuses Pods, or something like that. I unchecked the “output as a link” option and the href works now.

    I suppose my other hrefs in the template worked because the referenced Pod field were relationship/.guid Pod references, which I don’t think have a “output as a link” option.

    It might be helpful to include some contextual helper text on the Pod or the template about the “output as a link” option.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Thanks for letting us know @mungbean !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘a href Pod Reference broken’ is closed to new replies.