We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46448
    • 98 Posts
    Revo v2.3.2

    So, in ModX, every page has a resource number. If you use the Modx built-in menu system, each menu item is referenced by its resource number, not by URL.

    For example:

    Home/About might use www.mydomain/revo/index.php?a=3 (if that page's resource identifier is "3")

    instead of my more typical way of calling a url, such as: www.mydomain/revo/about.php

    If I do not use the built-in menu system, I'd like to create a navigation menu system that uses URLs (like the second example), not resource numbers.

    Can I do that?

    I realize pages will be assigned resource numbers, but do I have to use them? Will I still be able to pick pages from the resource tree on the left, and edit them, publish them, and have the (URL-style) menu system point to the edited/published page?

    Thanks!

    Dennis
      • 44580
      • 189 Posts
      Can I do that?

      Most certainly - using Friendly URLs (FURLs). Here is the official doco: http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls and here is a blog post I wrote about it: http://rgissing.com/blog/modx-revo-friendly-urls/ (you can ignore the references to the Articles add-on).
        • 46448
        • 98 Posts
        Thank you very much, gissirob!

        -Dennis

        Quote from: gissirob at Jan 20, 2015, 05:34 AM
        Can I do that?

        Most certainly - using Friendly URLs (FURLs). Here is the official doco: http://rtfm.modx.com/revolution/2.x/administering-your-site/using-friendly-urls and here is a blog post I wrote about it: http://rgissing.com/blog/modx-revo-friendly-urls/ (you can ignore the references to the Articles add-on).
        • Thank you! Perfect for a MODX Cookbook recipe. http://modxcookbook.com/add-ons/menus/friendly-urls.html
            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
            • 44580
            • 189 Posts
            Susan, I love what you are doing with your Cookbook. Thank you for your efforts.
              • 46448
              • 98 Posts
              error establishing database connection
                • 46448
                • 98 Posts
                2 problems (I think I see so far)

                1.) MODX revolution is installed in www.mysite/revo

                so I changed the .httaccess file to show that
                RewriteEngine On
                RewriteBase /revo/

                That "fixed" the database connection error, (the error does not come up), but a blank page comes up, with .html appended to the URL

                2.) I input a name for an alias "MyTestPage.php", a blank page comes up, with .html appended to the URL MyTestPage.php.html
                  • 46448
                  • 98 Posts
                  I'm going to start over, and ask for help again. I don't think I gave enough info, and what MODX calls "friendly URLs" may not be the same as what I am thinking it means.


                  • I want to use friendly URLs. I want site visitors to be able to go to http://www.Mysite.com/potatoes.php and see and bookmark that page URL, not http://www.MyWebsite.com/index.php?id=12
                  • I want to use fully qualified URLs. example: http://www.MyWebsite.com/MyPage.php (unless someone can let me know why NOT to use fully qualified URLs.)
                  • I am not using the MODX menu system. I created a navigation menu using the fully qualified URLs like I would do at a static site. I now assume that is wrong, that because MODX dynamically assembles pages from chunks and templates, that the menu needs to reference URLs something like http://www.MyWebsite.com/index.php?id=12, and not http://www.MyWebsite.com/potatoes.php
                  • MODX Revolution is installed in a subdirectory (revo), but I want to save pages to the root (I don't want http://www.MyWebsite.com/revo/MyPage.php, I do want http://www.MyWebsite.com/MyPage.php, but suspect that there will only be index.php - but still, I want it in the root, not in /revo/ subdirectory)
                  • All pages on the website will be PHP. I do NOT want to append .html to the end of URLs. How do I instruct MODX to do that?
                  • The root of my website currently contains website pages ending in .html - it is a working site. I want to create all of the new .php pages for the entire site, also in the root, and when everything is ready, then have the main URL to the site point to the index.php (instead of pointing to index.html, as it is now.)

                  Q: A content creator wants to create a new "potatoes" page on the website, (called potatoes.php to a site visitor.) Where does the content creator input that name? Title? Resource alias? (or both?) I assume they want to enter "potatoes", and not enter "potatoes.php", and MODX will append the .php to the end when it assembles the pages. We need to both create a php page and to let MODX internally know that this is a resource (so it shows up in the list of resources, and can be edited again and again. I realize that MODX "assembles" pages from chunks and templates, so it is not really saving potatoes.php as a page with header, navigation, footer, etc. It is saving the content as a resource.

                  If my understanding (sketchy as it is) is correct, there will only be a single php file stored at my web host, "index.php", and MODX will really be (internally) doing the same thing it defaults to doing (such as www.MyWebsite.com/index.php?id=12), but then showing to site visitors as an alias, such as www.MyWebsite.com/potatoes.php

                  I know I have over-explained what I am trying to do, but thought that was better than under-explaining it.

                  Thank you in advance for any help on this!

                  Dennis

                    • 44580
                    • 189 Posts
                    Ok. I'd started to answer before you posted your 'over-explanation' smiley. You've got a lot going on, so let's take it in stages. I understand why you are wanting to use .php extensions in order to differentiate between your existing .html pages and your migrated pages, but it sounds like your existing site is not using Modx. If that is so, the 'Modx' version will be hidden until the cutover and so you can leave the pages with their current identifiers ie potatoes.html.

                    By setting up furls, you are changing from this: mysite.com/index.php?id=2 to this: mysite.com/potatoes.html. The id=2 part refers to the resource id. In order to turn this into 'potatoes', you need to edit the resource - specifically the resource alias field and add 'potato'. Once you have done that, and cleared your cache, you should be able to access the page as mysite.com/potato.html - which you don't want.

                    To remove the "html" extension, go to Content/ Content Types and edit the HTML content type (by blanking out ".html"). Again, after clearing the cache, you will be able to access the page as mysite.com/potato.

                    If you really want mysite.com/potato.php, then I suggest you change the resource alias from potato to potato.php. However, I have no idea whether Modx will like this.

                    Hopefully that also answers your question about Content creators, although I think still think it is a bad idea to have to append .php to all your aliases in perpetuity.
                      • 46448
                      • 98 Posts
                      Thank you for your reply, gissirob!

                      It is becoming clear to me that the "php" extension does not matter, because really, MODX is assembling php pages dynamically from bits and pieces, (MODX is the only one that ever "sees" the entire page assembled into a php file), and then MODX runs the php page and what results is actually a static (HTML), rendered view of a page for site visitors to see. So, let's forget any "need" for php pages.

                      The existing site already has an "index.html" page, so hopefully, MODX won't create a page with that name.

                      2 questions remain:
                      1.) how do I set up MODX (so far, it isn't working, so I have done something wrong)

                      2.) how do I set up my links in my menu (non-MODX menu) that I made?
                      The "usual" way, like this:
                      <a href="http://www.MyWebsite.com/potatoes.html">Potato Page</a>

                      or some other way?

                      Thanks in advance!

                      Dennis
                      (I need a "MODX NEWBIE" T-shirt!)