We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46448
    • 98 Posts
    Quote from: dennisleahy at Jan 22, 2015, 11:39 PM
    ...
    1.) how do I set up MODX (so far, it isn't working, so I have done something wrong)

    What I have done:


    • I made a copy of ht.access file supplied with MODX, made just one modification*, named it .htaccess, and copied it into the root of my website. *The modification was to point to the folder where MODX Revolution is installed, "revo"
    RewriteEngine On
    RewriteBase /revo/


    • I made the 3 changes in the MODX manager, changing "No" to "Yes" for automatic_alias, friendly_urls, and use_alias_path.

    • I checked the HEAD section (which is a chunk of a template) and it already had:
    <base href="[[++site_url]]" />

    so I didn't change anything. I noted something about pages loading faster if the exclamation point directive is left out, so I left it out.

    • I went into the Manage dropdown, and clicked Clear Cache.
    • I did a premature victory dance, believing I had completed setup for FURLs.

    Testing 1, 2, 3:

    • I pulled up a page (a "resource") to clone, entered potatoes into the Resource Alias field, appended a space and the word potatoes to the Page Title field, and clicked Duplicate.

    What happens: I get a new resource, but it ignores the page title change and alias, and just clones the page adding a new resource number (this is no doubt MODX designed behavior, but confusing why a clone does not pick up what is currently in the fields.) If I then take that new resource, change its page Title and Resource Alias fields, and click Save, I get a change in the resource name. When I click View, I get a blank page, and the URL shown is http://www.mywebsite.com/revo/potatoes.html

    So, the alias functionality appears to be working, but the page is not getting assembled properly. I tried the .htaccess file without the /revo/ subdirectory, but just get "Error establishing a database connection."

    Can anyone suggest what may be wrong with my attempted MODX FURL functionality?

    Dennis

      • 44580
      • 189 Posts
      To answer question 2 from earlier, you reference the resource id as follows:
      <a href="[[~2]]">Potato Page</a>
      (assuming the Potato page resource id is 2).

      Regarding the blank page - silly question, but the page you cloned 'potato' from displays as you would expect? If it does, check 'potato' to be sure it is using the same template.
        • 46448
        • 98 Posts
        Quote from: gissirob at Jan 23, 2015, 01:06 AM
        To answer question 2 from earlier, you reference the resource id as follows:
        <a href="[[~2]]">Potato Page</a>
        (assuming the Potato page resource id is 2).

        Regarding the blank page - silly question, but the page you cloned 'potato' from displays as you would expect? If it does, check 'potato' to be sure it is using the same template.

        Thanks for the heads-up on how to reference the pages in a menu link.

        As for my pages displaying...grrrrrrr none of the pages are displaying. Well, none of the pages since I messed with MODX FURL settings. I can still load the older pages, using the old format, like this http://www.mywebsite.com/revo/index.php?id=11

        ...but if I change that number to one of the new resources, I get the blank page.
          • 44580
          • 189 Posts
          Have you cleared the cache? If you have done so via the Manager menu with no change, try manually deleting everything below the core/cache directory. If that doesn't fix it, you're going to need more sage advice than mine...
            • 46448
            • 98 Posts
            Quote from: gissirob at Jan 23, 2015, 02:00 AM
            Have you cleared the cache? If you have done so via the Manager menu with no change, try manually deleting everything below the core/cache directory. If that doesn't fix it, you're going to need more sage advice than mine...
            Yes, I have cleared the cache. I just now tried logging out, then (at your suggestion) deleting everything in core/cache. No change.

            To try to isolate the problem (figuring the problem is in .htaccess, or its a problem in the HEAD directive, or its a problem in the MODX settings...)

            I started by going into the MODX settings, and changed the 3 fields back from Yes to No, cleared the cache, ran a newer page, and it displays properly.
              • 46448
              • 98 Posts
              Friendly URLs are not.
                • 44580
                • 189 Posts
                Actually, the problem could be in your template. By changing the RewriteBase to /revo/, you might have to change the path of your css files etc in <head>. Although you should still get the un-formatted html. But worth looking into...

                Furls certainly can be problematic judging by the forum posts, but they've always worked for me. Just lucky I guess.
                  • 46448
                  • 98 Posts
                  I will try using the generic template supplied by MODX and creating a new simple template without using chunks...and see if the problem is in there. I like your logic, because I am getting a "blank" (white) page with the correct FURL shown, but when I view source, I see:
                  <html>
                  <head>
                  <title>MODX Revolution - Home</title>
                  <base href="http://www.mywebsite.com/revo/" />
                  </head>
                  <body>
                  
                  </body>
                  </html>

                  (it doesn't really say "mywebsite" - it says the correct website) However, note that the page source really does say "MODX Revolution - Home" in the title, and I don't know where that (generic stuff) is coming from - my head section does identify my site in the title.

                  So, it does appear not to be finding the chunks that are part of the template. Here's the template I've been using:
                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
                  <html>
                  [[$head]]
                  <body>
                  <div id="fullheader">[[$headerimages]][[$topnavmenu]]</div><!--end of #fullheader -->
                  [[*content]]
                  [[$footer]]
                  </body>
                  </html>


                  and here's the HEAD chunk:
                  <head>
                  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                  <meta name="description" content="[[*description]]" />
                  <title>XYZ Garden Program - [[*pagetitle]]</title>
                  <base href="[[++site_url]]" />
                  <link href="/css/topnav9e2.css" rel="stylesheet" type="text/css">
                  </head>
                  
                  (now that I reexamine this code, I wonder about some lines having the XML style trailing forward slash, and some lines don't. That might cause problems, though you'd think I would have already been having problems before trying to switch over to FURLs.)

                  Quote from: gissirob at Jan 23, 2015, 05:05 AM
                  Actually, the problem could be in your template. By changing the RewriteBase to /revo/, you might have to change the path of your css files etc in . Although you should still get the un-formatted html. But worth looking into...

                  Furls certainly can be problematic judging by the forum posts, but they've always worked for me. Just lucky I guess.
                    • 44580
                    • 189 Posts
                    What you have there is not your template at all - it is the "Base Template" (effectively empty) that comes with Modx out of the box. So I would have a look at the properties of the Resource you are trying to load. I can only assume it is set to use that template.
                      • 46448
                      • 98 Posts
                      Quote from: gissirob at Jan 23, 2015, 03:54 PM
                      What you have there is not your template at all - it is the "Base Template" (effectively empty) that comes with Modx out of the box. So I would have a look at the properties of the Resource you are trying to load. I can only assume it is set to use that template.

                      Yes, that first code block is what was in page source, and is utterly generic except that it did pick up the correct base href (probably out of the .htaccess file?)

                      If you look at the second code block in my previous reply, you'll see the template I use (which includes:
                      [[$head]], [[$headerimages]], [[$topnavmenu]], and [[$footer]] - plus, the [[*content]]

                      The resource I'm trying to load uses my custom template. (It works, when I don't try to switchover to FURLs.)