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

    /*** (not so) short introduction

    Firstly, I wanted to say that MODx is really brilliant. While I am not a specialist of any CMS I have used and developed some simpler websites for Wordpress and Joomla. Now, I needed to do something more complex and wanted to try different solutions. Found what I needed in Movable Type but after realising that Pro version is required for Custom Fields (Template Variables) I ran off as fast as possible smiley
    After being almost ready to start learning Drupal (because of CCK) I found MODx by accident and I love it! I’ve done more in 4 hours today than I would have in a week using Joomla. Great, great features. Thank you developers and community! Even greater to: http://codingpad.maryspad.com/ for solid introduction to the software.

    ***/

    I am using version 1.0.3 of MODx Evolution.

    As I could not have found any help on that subject I wanted to ask if there is possibility to have TV that will be used on few pages (Resources) using few different templates but will keep once entered value throughout all of them.
    To be more specific, let’s have a situation with 3 Resources:

    Resource (1) - Template A
    Resource (2) - Template A
    Resource (3) - Template B

    Now, user edits Resource (1) in which there is a custom field with an URL and enters "http://whatever.com".
    He opens the preview and link works perfectly.
    He edits Resource (2) and there is very same custom field with very same URL already there. Same thing with Resource (3).

    So, basically the point is to have a field in which one can enter value but this value can be edited from any assigned template (and kept throughout them, not as separate value on every resource). Does that make sense?

    Typically, I would have done that using chunks - however, there is need to get it edited by non-tech user and I do not want to get access to chunks/variable to anyone who is not an admin (i.e. me).


    I presume it can be done that way:
    TV is created for a template that is assigned to only one Resource (3 in our case) and there is a field with that URL. User enters it and it is parsed to the chunk which is then applied to any other template needed. However, it destroys option to edit on any other page that is not using the template. And, going further - assigning second Resource to that template (B) will mess things up.


    So, sorry for long description but I wanted to get it understood in the first shot (hope I did not overdo it tongue).
    Also, please do not be angry if I missed appropriate forum section or anything else. The help is highly appreciated, thank you in advance everybody smiley
      • 26016
      • 561 Posts
      First, glad you’re enjoying the system! Friends don’t ever let friends use Joomla. Ever.

      That’s a tough question, and you’ve clearly done a lot of good investigation. You’ve hit on a permanent conundrum - the fact that clients are technically incapable of entering content, or actually dangerously inept.

      You can use a default value of "@INHERIT" for a TV, and this will cause a value in a document to be included automagically in any children of that document. Very handy, but I’m guessing this won’t be sufficient for what you’re intending.

      I also thought of chunks. ManagerManager is great, but it doesn’t work on chunks, I think. I was going to suggest dropdown values to help the client, but this is not infinitely flexible.

      I just don’t know, without writing custom code. Maybe somebody else will have an idea.
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 4172
        • 5,888 Posts
        you can try something like this little plugin. You can modify a chunk, when editing resources on the same form:
        http://modxcms.com/forums/index.php/topic,46781.msg275383.html#msg275383
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 3749
          • 24,544 Posts
          In MODx Revolution, this would be a perfect use for a custom property set.

          The users would see all the values in a grid and editing any value would affect any element with that property set attached. Maybe even easier, you could also use the default properties grid of the template.

          If you really want the values available *everywhere* you could make them system settings.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 26016
            • 561 Posts
            BobRay always has the coolest ideas. smiley

            There’s a fairly easy other way to do this, I’ve used it before lots, and I don’t know why I didn’t think of it. Not enough caffeine, most likely. Just have a Ditto call that populates that spot, and it pulls in content from a particular document. Then the user could just edit that "small content document".

            If one doc won’t work, you could have, say, 5 doc numbers available in a dropdown list in a TV. Then you have your choice of 5 sources for data to pull in. Your Ditto call would have this TV as one of its parms. That’s how I would do it... I usually take the non-coding approach, because you others are better PHP coders that I am. smiley

            Cheers, Dave
              MODx and Wordpress development
              Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
              • 8323
              • 14 Posts
              Thank you Dave, BobRay and Bruno!

              Sorry for leaving the topic with no response for so long.

              Nonetheless, I have used Dave’s method. I made a Ditto call in a footer chunk I have:
              [[Ditto? &documents=`6` &tpl=`minimalistic`]]

              Where document 6 is resource using template that has only default rich text area. Static link, text, image, whatever is placed there.

              Onto that, simple chunk (Ditto template) named "minimalistic" is created:
              [+content+]

              I have placed all those ’static’ resources in folder (container) called "GLOBAL" and it works like a charm. It’s very simple and straight forward for the user and even easier to code.

              Once more, great thanks.