We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48586
    • 78 Posts
    I am working on a site that has divisions in several regions, and each region has its own special offers and contact information, etc. Is there a way to have a drop down at the top of the site that a user could select a region which would dynamically populate the chunks on the homepage with each of the special offers, and store that variable when going to a contact page (for example), and get the contact details for the selected region. I am new to ModX, so still learning about it, but I was wondering if there was something in the TVs to create a checkbox for the region that could connect to a table to pull in the data either in a resource or chunk.

    Thank you very much for any help you can provide.
    • Well, just to get started, yes, there are several ways you could handle this.

      It all depends on how you are planning to organize the information. If each region has its own resource, with TVs for the data then it would be easy enough to have getResources or pdoResources snippets fetch the filtered data.

      But that would only be one way of doing it, although it's probably what I would do. I can think of at least three other ways.
        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
        • 48586
        • 78 Posts
        Hello, thank you very much for your reply, I am new to ModX (but have 8 years experience with Joomla, 3 years with Drupal and WordPress), so I apologize if I am not using the terminology correctly. I would really like to minimize the number of resources (pages/articles, right?), and not have one for each region if possible.

        The site currently has an IP detection script that would display the customized version of the website if you fell into that range. There is also a drop down at the top of the site that says "Select your region:" with the options Florida/Texas/California (for example). The homepage would display a featured deal specific to that region, and the content would be slightly different per region. The selection in the drop down would have to be persistent, so if the user selects Florida, then every other menu item would have to contain the Florida information, and if they select Texas then every other page would have to contain the Texas data.

        What I am hoping to do is have one Homepage resource, one Packages resource, one Contact resource, etc, and be able to dynamically populate the chunks on those pages with values specific to the region selected. Again, I apologize if I am not using the terminology correctly. The current site has several custom Joomla components, one for Packages, one for Homepage Content, etc. Each component has a text entry field for each of the regions to tweak the copy as needed for the landing page. Would a TV be used to accomplish something similar to this?

        I'm just thinking out loud now, would it be best to have the menu dynamically generate based on selected region, so the values would change to /florida/packages, /california/contact-info, etc? The second part to this question is that the region selected has to remain persistent across the entire site until they select another region.

        I really appreciate any help you could provide as I continue to learn this CMS/F
          • 4172
          • 5,888 Posts
          perhaps migxMultiLang could handle that.

          Different informations for each region would be translations of specific fields.

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!