• Resolved hpb1980

    (@hpb1980)


    Hi,

    I have a custom post type called “webinars_bar”. In this, I have a field called ‘webinar_button_icon’ which is essentially a font awesome icon and I have defined them as a simple defined list as below,

    <i class="fas fa-angle-right"></i>|Right arrow
    <i class="fas fa-arrow-circle-right"></i>|Right arrow in circle
    <i class="fas fa-play-circle"></i>|Play icon in circle
    <i class="fab fa-youtube"></i>|Youtube play
    <i class="fas fa-exclamation-circle"></i>|Exclaimation in circle
    <i class="fas fa-comments"></i>|Chat
    <i class="fas fa-headphones"></i>|Headphones
    <i class="fas fa-podcast"></i>|Podcast
    "<i class="fas fa-video"></i>"|Recording
    <i class="fas fa-mobile-alt"></i>|Mobile phone

    I have defined a pods template to display these in the front-end which is this,

    <a class="nectar-button medium regular m-extra-color-gradient-2 has-icon" style="visibility: visible;" href="{@webinar_page_link}" data-color-override="false" data-hover-color-override="false" data-hover-text-color-override="#fff"><span>{@webinar_button_text}</span>{@webinar_button_icon}</a>

    However, in the front-end the icon HTML does not get displayed. Instead I see the Label from the value|Label being displayed. How do I get it to display the whole value (which is the HTML)?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @hpb1980

    I doubt adding HTML as the value is possible like this. But if it is then you could try to add ._index or ._key to the field magic tag. Another thing you could try is to add a dummy helper method like so: {@field,trim} (not the comma separator, this means that the value will be passed through the trim functions of PHP).

    Cheers, Jory

    Thread Starter hpb1980

    (@hpb1980)

    Hi, I sort of figured this out. Instead of the full HTML, I now replace only the class in the HTML. For this I had to change the custom field value from Value|Label to only value. Hence, {@webinar_button_icon} is now the following list,

    fas fa-angle-right
    fas fa-arrow-circle-right
    fas fa-play-circle
    fab fa-youtube
    fas fa-exclamation-circle
    fas fa-comments
    fas fa-headphones
    fas fa-podcast

    This list is not very intuitive for users since they do not understand what the icons are right away. To solve this, I defined them this way – 'fas fa-arrow-circle-right'|Right arrow in circle (enclosing the value in single quotes). With this, the value would not hold in the custom post type, i.e. each time I would select a value and when the custom post type was updated, it would again go back to showing “Select a value” for the icon field. Anyway I can define this in value|Label format?

    • This reply was modified 3 years, 9 months ago by hpb1980.
    • This reply was modified 3 years, 9 months ago by hpb1980.
    Plugin Author Jory Hogeveen

    (@keraweb)

    @hpb1980

    Please remove the quotes from the value: fas fa-arrow-circle-right|Right arrow in circle

    Cheers, Jory

    Thread Starter hpb1980

    (@hpb1980)

    Just tried this and now the value retains in the custom post type field. However, I tried outputting the value of {@webinar_button_icon} and I see that the label is being outputted and not the value.

    • This reply was modified 3 years, 9 months ago by hpb1980.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Thread Starter hpb1980

    (@hpb1980)

    Adding ._index and ._key did not work. However, adding trim to {@webinar_button_icon} worked!! Thanks again.

    • This reply was modified 3 years, 9 months ago by hpb1980.
    Plugin Author Jory Hogeveen

    (@keraweb)

    Awesome, and you’re welcome! The best way to say thanks is to leave a 5 star review at https://www.ads-software.com/plugins/pods/ and (if you’re feeling especially generous) become a Friend of Pods at https://friends.pods.io/

    Cheers, Jory

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pulling custom defined list values in a pods template’ is closed to new replies.