We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18436
    • 135 Posts
    Hi Guys, thank goodness for @INHERIT, it’s made life a crap load easier but was wondering if it’s possible for a subpage to inherit it’s parent TV value and then append extra data defined afterwards i.e.

    TV named contentFooter contains @INHERIT plus <div>extra string etc</div>

    The reason for this is that I’d like to setup a standard content footer with the page-trail, related links etc as well as some page specific content that the parent doesn’t contain.

    I could add an extra tv called customContentFooter or something but using a single TV for this would earn a Gold Star, any ideas anyone?
    • But then it would no longer be a pure "inherit" feature. I can see where it might be nice, but I think "inherit" should mean just that, and if you want more, as you mentioned, add another TV for the extra content on a per-page basis. I am a firm believer in the KISS principle.
        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
        • 18436
        • 135 Posts
        Me too - but disagree to a point - @INHERIT with additional tags would still retain the principal of inheritance, using a real world metaphor - if my children inherited my blue eyes, it doesn’t mean they have to inherit my eye lashes.

        I tend to wrap most of my output in div’s and would either have to write a snippet to not output the wrapping element if the tv is empty or include the wrapping divs when entering values into the TV field. Either way is not an elegant approach or keeping with KISS.

        I’ll have to try a few options out over the weekend.
          • 32241
          • 1,495 Posts
          Quote from: Marschant at Mar 08, 2006, 01:37 PM

          Me too - but disagree to a point - @INHERIT with additional tags would still retain the principal of inheritance, using a real world metaphor - if my children inherited my blue eyes, it doesn’t mean they have to inherit my eye lashes.

          I tend to wrap most of my output in div’s and would either have to write a snippet to not output the wrapping element if the tv is empty or include the wrapping divs when entering values into the TV field. Either way is not an elegant approach or keeping with KISS.

          I’ll have to try a few options out over the weekend.

          That’s might be true, so my suggestion will be to use another TV to inherit from your first TV.
          Let say TVa has inheritence, then all you need to do is create TVb that will contain default data as [*TVa*]. With this, all you need to do is to use [*TVb*], and it will automatically inherit from TVa. In case if you need to append something, all you need to do is overwrite TVb on specific doc, instead of having default value of [*TVa*], you can have "bla bla bla [*TVa*] bla bla bla".

          Hope that solve your problem.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 18436
            • 135 Posts
            Smart thinking!!! This might be the solution after all, aaaaah boy, inherit inherit inherit, the options are endless!
              • 22221
              • 283 Posts
              Is this behavior is normal huh :

              I have published documents in a unpublished directory with @INHERIT TV. I’ve change the default value in the directory’s TV but the value is not propagated to its children. If I publish the directory that works correctly ?
                • 32241
                • 1,495 Posts
                Quote from: OncleBen31 at Apr 26, 2006, 12:49 PM

                Is this behavior is normal huh :

                I have published documents in a unpublished directory with @INHERIT TV. I’ve change the default value in the directory’s TV but the value is not propagated to its children. If I publish the directory that works correctly ?

                I think it’s normal, because when you unpublish document, you don’t want your data to be visible at all. So all the child docs/folders will not be able to retrieve the data. The unusual behaviour is allowing user to publish subdocs/subfoders under unpublish folders.

                But after all it all depends on preference. So we might need to discuss this further. Any thought on this from all our advanced users in this forum?
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                • I would prefer that @INHERIT works whether the parent is published or not.
                    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
                  • That does indeed make sense Susan ... maybe we need @OMNINHERIT tongue
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me