We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6405
    • 9 Posts
    Hi,

    Clarification:
    Friendly URL’s (MODx Revo style) operate as follows:

    • Article title links: /the-reindeer-eat-beans.html.
    • Tags list via tagLister & tagLister.toLinks: /?tag=oneRandomLabel&key=tags
    Shaun McCormick’s splittingred.com example MODx site, which is very useful (thank you, Shaun) operates this way. From posts here I’m not sure everyone understands this and "clean urls" seems to mean different things to different people (not just here but all over the internet).

    My question:
    I’d like the tags list to be ’clean’ too: /tags/oneRandomLabel.

    [EDIT]
    I’ve been away and figured this out. It’s fairly straightforward.. once you start to understand the flow of things...

    MODx is not for complete beginners.
      • 34123
      • 103 Posts
      hi,

      could you explain what you’ve done for this issue ? do you add a rewrite rule in your .htaccess file ?

      Regards Frost
        Configuration Apache + Modx + MSSQL 2008
        ===============================
        Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.8
        OS : Windows 2008 R2
        SGBDR : Microsoft SQL Server 2008 (express)
        • 15034
        • 55 Posts
        Hi, Dear Frost!

        Please, you tell more in detail, what rule in .htaccess must be added?

          Мужчина должен говорить только три слова: люблю, куплю, поедем!
          • 28215
          • 4,149 Posts
          I’ve done it before with this Chunk as the &tpl property of the tagLister Snippet:

          <li class="[[+cls]]"><a href="[[~[[+target]]]]tags/[[+tag]]">[[+tag]]</a> ([[+count]])</li>


          And then this as your htaccess rule:

          RewriteRule ^tags/([A-Za-z0-9]+)$ ?tag=$1 [L,QSA]


          Of course, you’ll need to change it if you’re wanting a different URL other than /tags/, or using a different tagKey other than ?tag.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 34123
            • 103 Posts
            Quote from: splittingred at Dec 01, 2010, 02:33 PM

            I’ve done it before with this Chunk as the &tpl property of the tagLister Snippet:

            <li class="[[+cls]]"><a href="[[~[[+target]]]]tags/[[+tag]]">[[+tag]]</a> ([[+count]])</li>


            And then this as your htaccess rule:

            RewriteRule ^tags/([A-Za-z0-9]+)$ ?tag=$1 [L,QSA]


            Of course, you’ll need to change it if you’re wanting a different URL other than /tags/, or using a different tagKey other than ?tag.

            My first attempt was, adding two rules into my .htaccess

            RewriteCond & RewriteRule

            and create a new plugin to litteraly rewrite the tag parts, but i failed.

            Thanks to splittingred, I’ll give a try for his solution !

            It works, but I need to tweak your solution splittingred, specially with accent and space.

            Edit : splittingred, i mod your code, in my .htaccess file i added this :
            RewriteCond %{REQUEST_URI} /tag/(.*) [NC]
            RewriteRule (.*) /?tag=%1&key=tags [L,QSA,NC]


            What do you think about this ?
              Configuration Apache + Modx + MSSQL 2008
              ===============================
              Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.8
              OS : Windows 2008 R2
              SGBDR : Microsoft SQL Server 2008 (express)
              • 10596
              • 18 Posts
              I solve it with what splittingred did.
              1. I use this tool for rewriting my .htaccess: http://www.generateit.net/mod-rewrite/
              2. Modify your &tpl for taglister to be friendly url for eg:

              &tv=`category` (instead of tags)

              &tpl.oftaglister:
              <li>
              <a href="[[~[[+target]]]]tag/[[+tag:lcase]]" title="[[+tag]]">[[+tag]]</a>
              </li>


              the above tpl will create a link like this: http://www.mydomain/mytarget/tag/internet

              with this rule:
              RewriteRule ^mytarget/tag/([^/]*)$ /mytarget/?tag=$1&key=category [L]

              Thanks a lot also to Frost !!

              best,
              Gee
                • 8161
                • 39 Posts
                Quote from: splittingred at Dec 01, 2010, 02:33 PM
                I've done it before with this Chunk as the &tpl property of the tagLister Snippet:

                <li class="[[+cls]]"><a href="[[~[[+target]]]]tags/[[+tag]]">[[+tag]]</a> ([[+count]])</li>


                And then this as your htaccess rule:

                RewriteRule ^tags/([A-Za-z0-9]+)$ ?tag=$1 [L,QSA]


                Of course, you'll need to change it if you're wanting a different URL other than /tags/, or using a different tagKey other than ?tag.

                Hi,

                Do you have any idea why this metod doesn't work with cyrillic symbols. I've made eveyrithing as it's described, but nothing happened.

                Thanks