We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51669
    • 4 Posts
    Hi, I have created a property set with several properties. I have also went to my template added this property set. After that I modified the template and included one of the properties as [[+someproperty]]. Saved it all, of course. However, my page does not display the property's value. What can be a problem? Thank you.

    This question has been answered by BobRay. See the first response.

      • 3749
      • 24,544 Posts
      MODX doesn't automatically set placeholders for the values in a property set. You would have to set it yourself in a snippet that gets the property set.

      This tag would go above the property placeholder tag:

      [[SetPlaceholder@myPropertySet]]


      Then create a snippet called SetPlaceholder with this code (untested):

      $value = $modx->getOption('someproperty', $scriptProperties);
      $modx->setPlaceholder('someproperty', $value);
        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
        • 51669
        • 4 Posts
        Thank you, BobRay. I did what you suggested. I created the snippet that sets placeholders for all the properties and I called the snippet with the property set in a template. However, the values are not getting through. It seems that the getOption does not retrieve values.

        Besides it not working, I am not completely happy with this way of doing what I need and maybe there is a better way. I am trying to set contact info values that are specified in one place and reused throughout the site but with different layouts. And I want my backend users to be able to modify them.
        I thought of using system settings and they did work, however, I am not sure I want the users to go to system settings to modify their info. The property sets are also not very obvious and user friendly way of doing it (besides, it is not working for me).
        I don't want to use MGIX because the presentation is different throughout and only some values are used in some places.
        Should I set a bunch of separate TVs on a contact page?.. How would I use them in other templates? I don't want to make them accessible in other templates to prevent modification anywhere but the contact page.
        Any suggestions will be greatly appreciated.
        • discuss.answer
          • 3749
          • 24,544 Posts
          System Settings are always available with a tag and if the tag is in the Template, they will only appear pages that use that Template:

          [[++settingName]]


          You also have the option of using User Settings or Group Settings, which use the same tag.

          Mark Hamstra's ClientConfig might provide a way to set them. If not, you could create a CMP (possibly using MIGX) or just a form on a web page they can visit.

          You could do it with TVs, which can be attached to specific Templates, but it would be slower. TVs have a value for each resource, but you could use the default value of the TV. Unfortunately, setting the default value of a TV is not very user-friendly, though again you could create a CMP or form to set them. You might want to hide the TV's from the user in the Create/Edit Resource form, so they couldn't override the default value.
            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
            • 51669
            • 4 Posts
            Just wanted to post an update. I ended up using Mark Hamstra's ClientConfig. It was just what I needed and works great. Thanks, BobRay.