We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25357
    • 92 Posts
    I’m guessing "no," but anyway . . .

    Revo 2.0.8, using extensionless URL’s, no alias path, all resources are at /top-level

    I get this design that’s all tabs. All tabbed content. Visualize

    topic1 | topic 2 | topic3 | topic 4

    The topics are set up as children of the parent resource. Call the parent alias "widgets".

    So the marketer comes in and says, "hey, we want all these tabs to have their own URL for landing pages." But not as different pages, still containing all the same tabs (with just the current one "active.")

    /topic-1/
    /topic2/
    /topic3/ .....

    Been playing around with rewrite rules and can get some control, thought I might be able to get away with (something like)this:

    RewriteCond %{REQUEST_URI} ^topic-1/*$
    RewriteRule ^([^.]+)$ /index.php?q=widget&sub=topic-1 [L]

    ... and pick up sub as a get value to set the active tab, but modX seems to be doing a location header to the parent resource:

    http://www.example.com/topic-1/ ## The above rule sends q=widgets&sub=topic-1 to modX

    ## Live headers then gets this from modX

    HTTP/1.1 302 Found
    Location: http://www.example.com/widgets/

    And *poof* goes my get parameter. This is even true if I send it a direct URL:
    example.com/index.php?q=widget&sub=topic-1

    Any ideas? Kill the marketer is unfortunately not an option.
      • 3749
      • 24,544 Posts
      Do your href link tags look like this (&paramName is the $_GET parameter)?

      <a href = "[[~12? &paramName=`value`]]"> Link Text</a>
        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
        • 25663 MODX Staff
        • 12,272 Posts
        Most likely, the answer is reflected here: http://modx.com/can-modx-do-this.html tongue
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 25357
          • 92 Posts
          Harrrrr harrr harrr. smiley

          @ Bob: No, we try to eliminate all query strings from links whenever possible for keyword rich extensionless URL’s.

          At any rate, using the structure above, I approached it a little differently. Wrote up a snippet working from this,

          [[!getTabContent? id=`[[*id]]`]]

          (Which I will probably revise, I know getObject()’s resource-> always references the current resource, but anyway . . . )

          ... and used each tab resource’s alias as a real URL. I get the parent ID and generate the tab content, and also set the current tab’s link as active. Unfortunately this gives duplicate content for all the tab URL’s on a given page, but we’ll use canonical tag to band aid that one. That way we don’t have to hoop jump with rewrites.