• Resolved pasamike

    (@pasamike)


    I have created a custom attribute: #_ATT{Registration}
    The value will be a URL.

    Because I do not want an empty hyperlink on any event without registrations URL, I need to hide the HTML if the value is blank.

    I can get the link to display with the following:
    <a href='#_ATT{Registration}' target='_blank'>Register Now!</a>

    The link displays / works as intended. If I use
    {has_Registration}<a href='#_ATT{Registration}' target='_blank'>Register Now!</a>{/has_Registration}

    or

    {has_att_Registration}<a href='#_ATT{Registration}' target='_blank'>Register Now!</a>{/has_att_Registration}

    The link is hidden regardless of whether the value is filled or not. I know this has to be a simple syntax error on my part, but I can’t seem to figure this one out. Please Help, I’ll be your best friend! Unless you don’t want to be best friends, then I’ll just play it cool and say thanks! ??

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Try without the single quotation marks.

    @pasamike
    This will require a bit of custom PHP coding as there are no conditional placeholders for custom attributes as standard.

    Something based on the following thread will need to be added to eg your child theme functions.php. If you don’t have a child theme, there’s a bit of learning to do before you get to this.

    Conditional place holder for custom attribute
    The first coded answer should do as you want.

    As always, it is best to test this on a staging site as it’s easy to break your site if you make a small mistake. Make a full backup first as well.

    Gerry

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Event Manager – Conditional Custom Attribute’ is closed to new replies.