We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49312
    • 61 Posts
    Hey guys... Ive got a TV on one of my templates like so:

    <h2 id="related">Related Products</h2>
    [!multiTV? &tvName=`relatedProds`!]
    


    If the user does not enter any value into the relatedProds TV how can I make it so the <h2> above it does not show up?

    Thanks!
    Steve

    This question has been answered by Jako. See the first response.

      • 49312
      • 61 Posts
      Figured it out:

      [[if? &is=`[*relatedProds*]:isempty` &then=`` &else=`<h2 id="related">Related Products</h2>`]]
        • 49312
        • 61 Posts
        Well I thought I had it figured out. I have two things I want to hide. The Related Products hid fine, but this one wont output the empty part no matter what I try.

        [[if? &is=`[*files*]:isempty` &then=`` &else=`<h2>Product Downloads</h2>`]]
        [[multiTV? &tvName=`files`]]
        


        If files is empty or not it is always outputting the &else value. The code is the same as the relatedProds so I'm scratching my head on that one.
          • 49771
          • 16 Posts
          If you want to avoid using the IF package, you can use a output filter into one sweep.

          [[*files:!empty=`<h2>Product Downloads</h2>`]]

          (When files is not empty, inject <h2>Product Downloads</h2>)

          I'm also assuming this would give you the best performance, without too much performance degradation.
            • 49312
            • 61 Posts
            That looks like a great way to do it brandon, but unfortunately it is not working for me. It just makes it go away all the time, evern when there is date entered. sad
              • 13226
              • 953 Posts
              This may or may not be the answer:

              Look at your calls:

              [[if? &is=`[*relatedProds*]:isempty` &then=`` &else=`<h2 id="related">Related Products</h2>`]]
              [!multiTV? &tvName=`relatedProds`!]

              [[if? &is=`[*files*]:isempty` &then=`` &else=`<h2>Product Downloads</h2>`]]
              [[multiTV? &tvName=`files`]]


              Notice the difference ?

              In the second call both snippets are being called cached, whereas the first call one cached the other uncached.

              Change your second MultiTv call to uncached and give it a go.

              @brandonhim

              The output filters don't work with Evo out of the box
                • 49312
                • 61 Posts
                They are all the same in the code now, I've tried all the different variations of cached and not.

                So if the output filters don't work out of the box in Evo, how does one get them going? smiley Still fairly new at this.
                  • 13226
                  • 953 Posts
                  So if the output filters don't work out of the box in Evo, how does one get them going?

                  You don't, unless you use "IF" or "PHX"
                    • 13226
                    • 953 Posts
                    Are you using this in a Ditto call ?
                      • 49312
                      • 61 Posts
                      No, this is just inside a template.

                      This works how I want:
                      [[if? &is=`[*relatedProds*]:isempty` &then=`` &else=`<h2 id="related">Related Products</h2>`]]
                      [[multiTV? &tvName=`relatedProds`]]
                      


                      This does not:
                      [[if? &is=`[*files*]:isempty` &then=`` &else=`<h2>Product Downloads</h2>`]]
                      [[multiTV? &tvName=`files`]]
                      


                      Haha, makes no sense to me. Here is the full template code:

                      {{header}}
                      <section id="rotator" style="background-image: url(/images/innerHeader1.jpg);">
                      			<div class="wrap">
                      				<h1>[[GetField? &field=`pagetitle` &parent=`1` &parentLevel=`1` ]]</h1>
                      				<h2>[*subtitle*]</h2>
                      			</div> <!-- wrap -->
                      		</section> <!-- rotator -->
                      		<section id="content" class="wrap prodetail">
                      			[!Breadcrumbs!]
                      			<aside>
                      				<a class="contentButton small" href="">Request a Quote</a>
                      				
                      				[[if? &is=`[*files*]:isempty` &then=`` &else=`<h2>Product Downloads</h2>`]]
                      				[[multiTV? &tvName=`files`]]
                      				
                      				[[if? &is=`[*relatedProds*]:isempty` &then=`` &else=`<h2 id="related">Related Products</h2>`]]
                      				[[multiTV? &tvName=`relatedProds`]]
                      				
                      			</aside>
                      			<article>
                      				<h3 id="prodTitle">[*pagetitle*]</h3>
                      				[*content*]
                      			</article>
                      			{{questions}}
                      			</section> <!-- content -->
                      			{{footer}}