We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15001
    • 697 Posts
    Hi,

    I'm developing a website on MODx Evolution where many pages are activities.
    The top-level pages using Ditto to display summaries of the miscellaneous activities, which are set in the "introtext" field.

    Each activity can have a longer "learn-more" text, which is is set in the content field and should be display on the activity page.
    Because most of the "Learn more" texts were not written yet, it would be very useful if MODx had some feature to set a default value for the [*content*] field.
    For instance, the content could be set to something like:
    <h2>[*pagetitle*]</h2>
    [*introtext*]
    

    Exactly like the default value for TVs.

    This "Default content" field could typically be integrated to the MODx Configuration section of the manager.

    Alternatively, is there some plugin to achieve this ?
    Something more straightforward than ManagerManager?

    I want as much as possible avoiding to create a new template, because this means twice more work when you change something in a template.
    • It's been ages since I worked with evo, but PHx could be useful there. In your existing template, you could check the content placeholder to see if it is empty,and if so returning the heading and intro text.

      Again though, haven't worked with evo in years so my knowledge there is very rusty.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • That would do the job, Mark, although unless things have changed I always found using PHx to be a pain. It had a nasty habit of removing any other placeholders in your template or content. I always thought something was wrong with its garbage-collection regular expression, but I'm not good enough with regular expressions to be able to figure it out.
        [*content:ifempty=`...`*]
          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