We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20761
    • 27 Posts
    hello!

    i have a question once again grin

    i have declared two template variables (document binding), that show up as content boxes. looks good.
    is there a possibility to show these two boxes ONLY when the user is visiting the home/starting page, and NOT when they’re visiting some other content pages, like galleries and stuff?

    that would be great!

    i so suck at php-programming, and my English sucks too,
    so if i just misunderstood or overlooked something, please forgive me smiley

    thanks very much in advance for your answers.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Leave the default blank when you create the TV, then when you edit your home page document, put what you want to show only on the home page in the TV editing field there.

      That is what TVs are all about. Like the document’s content, you can edit it specially for each document. Unlike the document content, you can have default values, inherited values with @INHERIT, and all sorts of other fun things.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 20761
        • 27 Posts
        but i called the TV in the template, not the home page document.

        the only solution that came to my mind is to make two different templates.
        one for the start page, and one for the content pages. right, or noob-solution? laugh

        thanks for your quick reply!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, you aren’t understanding me. You will get a textarea field for editing the TV in every document using the template, no matter where you put the TV.

          Look at it like another "Document content" field. You put that in the template, but it’s different for every document.

          What you put in the TV editing field for that document is what will show on that page. Your default TV can have anything or nothing at all, and when you edit the document it will override that, only for that page.

          Just make sure to set the Input type to "textarea" or even "Rich text" when you create the TV.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 20761
            • 27 Posts
            I GOT IT!

            Thanks a million times!
            Now i realized how it works. GREAT!

            Thanks!!