We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21417
    • 486 Posts
    Hello,

    (Webserver: Apache / no idea on tech stuff // MySQL version: 5.0.45 // MODx version: 0.9.6.1p2. // Browser: Firefox 2, XP, Windows)

    I am new to MODx and am on struggle street with template variables and chunks in my footer and need a little assistance from a MODx guru.

    I have been looking through the Documentation and the WIKI but just can’t get TV’s working (probably =’s I just can’t get my head around it).

    Anyway, I have one template which looks fine.

    This template contains a footer which is the same on every page except for the home page.

    The home page footer should contain an extra link - lets call in Help!

    This is what I have done so far:

    a. I created a (container style) chunk called footer which looks like this:

    <!-- footer -->
    <div id="ftbox">

    <div id="ft" class="t2">
    <p>
    [*footerHelpTV*]
    {{footerLinks}}
    </p>
    </div>

    </div>
    <!-- end footer -->

    c. I created a chunk called footerLinks which looks like this:
    <a href="#" class="t2">Home</a> |
    <a href="#" class="t2">Site Map</a> |

    b. I created a chunk called footerHelp which looks like this:
    <a href="#" class="t2">Help</a> |

    d. I created a TV called footerHelpTV which looks like this:
    id = [*footerHelpTV*]
    caption = [*footerHelpTV*]
    input type = text
    Input Option Values = (left blank)
    default value = @CHUNK footerHelp
    widget = (none - left blank)
    template = normal (the one I have created)

    e. I created a link to the footer chunk in the template which looks like this:
    {{footer}}


    What happens is that the footerHelp chunk appears on every page, rather than just the home page.

    I tried adding @DOCUMENT 13 in the default value (13 is the id of the home page) but that appears on every page too, rather than just the home page.

    So my question is how on earth do I include the Help link only on the home page using TV’s and with only 1 template?

    Please help.

    Or am I just better off creating 2 different (but basically identical) templates and inserting different footer chunks (without variables)?

    Thanks in advance.
      Web design Adelaide
      http://gocreate.com.au
      • 4971
      • 964 Posts
      The TV is assigned to one or more templates. You should choose where it will appear.

      If you only have on template, it will appear in all the pages with that template.

      Open each page you do not want the TV to appear and remove the text from the footerHelpTV template variable.

      There are other ways to do this... but the above is how it will work with your code.
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 29076
        • 615 Posts
        These could hopefully give you some answers. smiley
          I think, thererfor I am! But what I am, and why...?
          • 34017
          • 898 Posts
          Nick,

          TV’s took some time for me to understand too. Don’t pay any attention to the ’widgets’ until you realize a TV is just an additional content box. You call it the same as [*content*], just replace ’content’ with the name of your tv like [*mytemplatevariable*]. Widgets are just how the TV is shown in the manager (image button, radio list, checkbox list, etc.)

          Here’s some info I’ve put up about TV’s
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg159009
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008

            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • 21417
            • 486 Posts
            Hello All,

            Thank you so much for your assistance.

            Chuck - That info that you wrote and referred me to absolutely helped to clarify things for me. Very eloquent and right on the money. Thank you so much.

            CharlieZ - Once I had the info down from Chuck, your post made it a piece of cake - I was trying to use TV’s with only one Template - the name should have given it away - oh well - thank you kindly.

            Now its working an absolute treat - Love your work!! smiley

            (ps. Sylvaticus - I tried all those links - thats why I posted)
              Web design Adelaide
              http://gocreate.com.au