We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15550
    • 12 Posts
    I know we can use the following to GET a pagetitle
    $modx->documentObject['pagetitle']


    Is it possible to SET this variable in a snippet?



      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You would need to use a plugin for it to be of any practical use.
        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
        • 15550
        • 12 Posts
        Hi Susan

        How would I do that? Is that the best way to achieve the following:

        At the minute I have a page called ’Event’. This page is passed an id via the querystring and a snippet running on that page fetches the details for the event with that id from an events table in the database.

        At the minute [*pagetitle*] is being used in the template.

        In the case of this page it would show ’Event’ for every event in the database.

        What I want to do is make it dynamic by replacing it with the title of the event from my event table in the database.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Use a TV instead, with @SELECT binding.
            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