We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17499 ☆ A M B ☆
    • 872 Posts
    Hello,

    I’ve understand how to use friendly alias in document. But i wonder if it’s possible to generate alias dynamically.
    In the case that i’ve one documents and i want it to generate alias depending on what i asking in a custom db table.

    Let’s say document with index (6) and alias "book-start.html" and when the user click on a link on the page, it’s "reload" the page on the same document (6) but with a different alias like "book-whatever.html" and another content fetched from the database.

    Is that kind of behaviour possible with modX?
      • 22303 MODX Staff
      • 10,725 Posts
      You could easily use a plugin to transform the actual url generated by makeUrl() or the link tags, i.e. [~1~], based on the the query string parameters, which I assume you would also be using for your custom rewrite rules.
        • 17499 ☆ A M B ☆
        • 872 Posts
        Ok, thank you.
        I was not sure that the makeurl() functin was the right solution.
        I should have tried before asking!
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: lossendae at Mar 09, 2009, 05:07 AM

          Ok, thank you.
          I was not sure that the makeurl() functin was the right solution.
          I should have tried before asking!
          Actually, what I was suggesting was doing string replacement in the output after the page was generated, i.e. after makeUrl() and the link tags were processed and were showing the partial friendly urls without your customization. So you would look for your specific parameters in the query strings and simply replace those according to your custom rules in the page output.
            • 17499 ☆ A M B ☆
            • 872 Posts
            Quote from: OpenGeek at Mar 09, 2009, 09:23 AM

            Quote from: lossendae at Mar 09, 2009, 05:07 AM

            Ok, thank you.
            I was not sure that the makeurl() functin was the right solution.
            I should have tried before asking!
            Actually, what I was suggesting was doing string replacement in the output after the page was generated, i.e. after makeUrl() and the link tags were processed and were showing the partial friendly urls without your customization. So you would look for your specific parameters in the query strings and simply replace those according to your custom rules in the page output.

            Do you have quick exemple on how to do that?