We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    Hi there! I’ve got a question about setting the site startpage ID.

    The website I’m creating has got 4 main pages, which are linked to the seasons (spring, summer, fall, winter). I want the user to be able to manually set the sitestart to the next quarter when it’s time, but I don’t want him to see or change any other settings. So giving this user permission to change settings doesn’t work in this case.

    Is there a way to allow him to just change one setting? I followed the tutorial on changing the Manager Homepage (http://wiki.modxcms.com/index.php/Customizing_the_Manager_Homepage). Maybe I could add just this setting to the manager homepage? Or if I could add it to the context menu that pops up when right-clicking a page in the site tree, that would be great too. (like: ’make this page the site start’). I have no idea if this is possible though.
    Thanks in advance! Michèlle

      • 3749
      • 24,544 Posts
      From an SEO standpoint, I don’t think it’s a good idea to keep changing the actual home page (and its URL every three months). Also, people with bookmarks to the site won’t necessarily have them point to the right place. It would be much better, IMO, to change the *content* of the home page four times a year, without changing site_start, the pages URL, or its ID.


      How about setting things up so the page changes automatically on the appropriate dates?

      There are about 10 different ways to do that in MODx.

      I recently posted a "season" snippet around here somewhere that loads one of four different chunks depending on the season. That would be one way.

      You could also use a template variable to set the season and use that TV as a parameter to a snippet that produces the page output.

      Or the TV could let you select the appropriate chunk to insert as the page content.

      Or you could use a snippet on the home page with $modx->sendRedirect to forward the user to the desired page.


      etc., etc. smiley
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        You can use the same snippet to change the .css so that the page is styled according to the season.
          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
          • 19328
          • 433 Posts
          Thnaks for your help all! I’ve managed to get it working by making a direct database update field. I know, it’s maybe not very safe, but it works for me because only trusted admins can edit the sitestart ID.

          If you need the SQL and PHP codes, just e-mail me