• Resolved jnikolas

    (@jnikolas)


    Is it possible in the pods template to hide a custom field heading if no information is entered in it?

    I found a website which suggested that there is a magic tag for that, but is this true?

    For example, you will print your content field inside a container div element if the field has data, else, do nothing you code will be like this:

    {@content,,<div class=”item-container”>,</div>}

    That trick saves my day so I want to share with you, if you are looking for it also.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jnikolas

    (@jnikolas)

    Or field label is maybe the correct term. So what I meant was if the label can be hidden if there is no data entered in the field?

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @jnikolas

    Not sure I understand. How are you outputting the field label at the moment? Field labels cannot be output by magic tags as far as I know.

    Cheers, Jory

    Thread Starter jnikolas

    (@jnikolas)

    This was poorly communicated by me. the [if] statement was what I was after and now it’s working.

    To avoid, this the each loop can be placed inside of if conditionals, so that no
    thing is outputted if there are no chapters to output:

    
    [if chapters]
        <h3>Chapters</h3>
        <ul>
        [each chapters]
            <li>{@post_title}</li>
        [/each]
        </ul>
    [/if]
    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @jnikolas

    No problem, thank you for letting us know!
    Closing topic.

    Cheers, Jory

    Hello, Can someone help me with this conditional?
    I only want that if there is information in the field write it, but write me that there are no approvals, it turns out that when there is write there are no approvals above and below what is in the field.
    It is worth emphasizing that the faithful is of the multiple image type. This is my code
    [before] <div class “approvals-wrap”> [/ before]
    [if approvals]
    [each approvals]
    <div class = “approvals-item”> {@_ img.medium} </div>
    [/ each]
    [else]
    <p class “no-images”> NO approvals </p>
    [/ if]
    [after] </div> <! -. book-wrap -> [/ after]

    Plugin Author Jory Hogeveen

    (@keraweb)

    I see spaced after each closing tag: [/ if] instead of [/if] for example. Is this because of copy/paste or is this your actual template? Please remove the spaces.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide empty field in Pods’ is closed to new replies.