We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20079
    • 49 Posts
    Is there a way you can assign a speciffic chunk in TV to all the documents that are under certain folder?
    I have a 2 Blogs and want posts have certain chunks included depending on their root folder (just basic stuff-- Latest news and PrewPost | NextPost links)

    This is the idea:

    [tt]if (rootFolderID = 1) {
    @CHUNK Blog_1_chunkThing
    }
    if (rootFolderID = 2) {
    @CHUNK Blog_2_chunkThing
    }[/tt]

    Hopefully you get the point, i very little knowledge of programming.

    http://streetshop.lv is the project
      • 1764
      • 680 Posts
      Hey, the site looks great! It’s really cool to see such high quality sites being produced in MODx.

      What you want to do should be very simple with the @INHERIT binding (documentation)

      Basically you just need to put @INHERIT in the default content of your TV and then edit the TV in folder 1 and folder 2 with the appropriate content. You can enter the content directly or just use {{Blog_1_chunkThing}}.
        • 34162
        • 1 Posts
        Very nice site indead.
        In the right side it misses no more than a shopping-cart in ajax and the protected payment for being fully wesh fashion laugh

        A link in the site showcase? wink
          • 20079
          • 49 Posts
          Quote from: aNoble at Jan 26, 2006, 01:14 PM

          Hey, the site looks great! It’s really cool to see such high quality sites being produced in MODx.

          What you want to do should be very simple with the @INHERIT binding (documentation)

          Basically you just need to put @INHERIT in the default content of your TV and then edit the TV in folder 1 and folder 2 with the appropriate content. You can enter the content directly or just use {{Blog_1_chunkThing}}.



          1) created a Template Variable




          2) Placed the TV in the Default template




          3)Change the value of TV for Folder A ( 3 sub pages)




          4) TV is changed for the parent folder and shows the entered value (Folder A)




          BUT--

          children documents under Folder A are unaffected =/

          I read http://modxcms.com/forums/index.php/topic,2080.0.html, but it did not make much sense to me.
          What am i doing wrong?

            • 1764
            • 680 Posts
            Well, you don’t need to put @INHERIT in the actual TV content in step 3. You can just put "Folder A" in there like you would normally if you were just editing that page. I’d imagine that is what is causing the problem.

            You can put @INHERIT in the content of your TV and it will inherit from it’s parent or you can put it in as the default. But if you have it as the default on a page with no content, that default is triggered and it would then look at it’s parents for content. If @INHERIT finds another @INHERIT then all of the sudden there isn’t anything to inherit anymore. Does that make sense?

            Bottom line, in step 3 change "@INHERIT Folder A" to just "Folder A".
              • 20079
              • 49 Posts
              Quote from: aNoble at Jan 26, 2006, 04:53 PM

              Bottom line, in step 3 change "@INHERIT Folder A" to just "Folder A".

              It works!! Thanks!

              I am using MODx and making money out of it. I feel like giving back. Is there a way i can help? I would like to help grow the tutorial section, as it is what i miss the most.
                • 1764
                • 680 Posts
                Were not the types to turn down help around here. If you’re interested in working on tutorials you should ask Susan (profile) she pretty much heads up the documentation team.