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

    is there a way i can remove articles url container alias?.

    ex:

    http://www.domain.com/article/post/

    change to

    http://www.domain.com/post/

    i am aware that i can change Articles URL Format on advanced settings tab, but i cannot find any solution to remove articles container alias from URL.

    any help would be appreciate.

    Thank's
      • 486
      • 4 Posts
      Any one please... i am really stuck here!.
      • There is no easy solution to this. It's done in the core/components/articles/model/articles/article.class.php file, around line 286

        $uri = rtrim($containerUri,'/') .'/'. rtrim($furlTemplate);


        The furlTemplate refers to the setting in the Advanced Configuration that you mentioned, the containerURI is the part from the Articles container's URI; it's either taken from the database field or the alias. [ed. note: sottwell last edited this post 11 years, 8 months ago.]
          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
          • 486
          • 4 Posts
          Hi Susan,

          Thank you for your help, for now i think i can do this with your solution..
          $uri = rtrim($furlTemplate);


          i hope this feature will be on the next version of Articles addon.

          Appreciate for your help.

          Thank's
          • Articles has a lot of "helpful" features hard-coded into it. Sort of like the original ATT telephones, you could have any color you liked as long as you liked black. I'm working on that wink
              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
              • 37131
              • 111 Posts
              Why do you want to remove it ?
                ---
                Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding
              • Not everybody wants to have a path-type URL. Just domain and page URI.

                If you have been in the web development field for any time at all, I'm sure you've learned that any three clients will want at least five different ways of doing things. That's the beauty of MODx, its flexibility. Articles, not so flexible.
                  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
                  • 37131
                  • 111 Posts
                  Well, don't let the clients get too much freedom wink
                  I was asking because there could be reasons which can be solved in other ways.

                  PS. What you mean "I'm working on that."? smiley
                    ---
                    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding
                  • I'm working on a more generic Container custom resource type. Will be good for all kinds of groups of resources; product catalogs, user-produced content, stuff like that. I'll also have an accompanying CMP for creating new Containers easily, with a menu item like "New Product". This will create a new Container as well as a new folder in the file system for the new product's images and files. It will also be possible to do all this programmatically, for example when a new user registers he'll automatically have his own container and image/file folders. Eventually I'll be able to include media sources and other permissions in the automatic creation process.
                      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
                      • 37131
                      • 111 Posts
                      Sounds tasty, I hope it's for Revo smiley
                        ---
                        Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Martin Golding