We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19701
    • 4 Posts
    Hello, I’m a newbie. First cms I have ever used, its a bit bewildering. I understand css and html. I’ve just installed MODx and used the http://wiki.modxcms.com/index.php/Beginner%27s_Guide_to_MODx#Start_with_a_complete_functional_webpage
    to create a tutorial page. Followed all the instructions to create the template and css. Then when I click on Site>Preview, I get:

    - the "install successful! (etc.)" content (kind of expected as that seems to be the default content)
    - no css formatting huh :-

    • is this a base_url problem?
    • if it is where do I get a good explanation of what should go in this field?
    • where do I go to change the base_url address - maybe site>file manager>file manager path?
    - the footer I created works ok (at least something is working).


    I hope someone will be so kind to get me past this stumbling block. Thanks.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Do a "view source" in your browser and see where it thinks its css file is supposed to be according to the <link...> tag in your template’s head.
        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
        • 16680
        • 73 Posts
        Do you have a link for your installation? Then it would be alot easier determing where the error might be

        larsb
          Signature on it&#39;s way
          • 19701
          • 4 Posts
          Thanks, Susan Otwell - it seems easy when you know how! laugh
          I have confirmed that the error is in my base_url. I can get the css to work when I replace the relative path <link rel="stylesheet" type="text/css" href="[(base_url)]assets/templates/tutorial/css/Style.css" /> with an absolute path in the tutorial template. My problem is that I can’t find where to correct the value of base_url which I entered incorrectly during the install. I’ve search the MODx manager, I’ve looked in config.inc.php - just can’t find where to correct it. Can you help?

          Thanks, LarsB for your offer to look at my installation. I’m still a learner-developer, and am a little nervous of publishing the path to my installation on a forum. I’ve installed MODx a level above my domains, and I’m not sure of the implications of publishing the pathname, which includes the server name and my hosting account name. So until I know what I’m doing a bit better, I hope you understand my reluctance to disclose it. At the same time I appreciate your offer of help!

          There are some errors in the wiki beginners tutorial http://wiki.modxcms.com/index.php/Beginner%27s_Guide_to_MODx#Start_with_a_complete_functional_webpage which must frustrate a lot of beginners ... the html code references style.css and cixlogo-tropic.png, but when you follow the links to download these items, you end up downloading Style.css and Cixlogo-tropic.png (with first letters capitalized). Not much fun for beginners!

          As per the first paragraph, my remaining issue is where to correct the value in base_url variable? Thanks, everyone!
            • 7231
            • 4,205 Posts
            I think that the [(base_url)] is dynamic, I don’t think it needs a setting. If it does it would in the site configuration section.

            1) Make sure that you have a directory names tutorial in your assets/templates folder.

            2) Make sure to use the <base href="[(site_url)]"/> in your site header section.

            3) take a look at the source code and see where the css file is pointing to.

              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              By "link" we mean a URL, so we can view the page and see what it’s actually producing.

              That value is never entered, it is calculated at each run dynamically, in manager/includes/config.inc.php. It is very rare to be wrong, although sometimes if you are using a CGI version of PHP it can be.

              What did the "view source" show to be the expected url to your css file?

                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
                • 19701
                • 4 Posts
                Problem resolved with your help.

                Thanks everybody! Its so good to get your support. With your help and encouragement I’ve found the problem. As you may remember, I’m an newbie to MODx and a beginner developer. Sometimes we all make silly mistakes and keep looking for bigger issues without seeing whats right in front of us. Guess what, I made a typo. I typed "[base_url)]" omitting a starting parenthesis in the stylesheet link tag. Sorry.

                It would seem that base_url had the correct value all the time (as you wisely pointed out dev_cw thank you). It was simply my typo. Just to fill you in on the link values, Susan Sotwell, when I viewed the source generated while I had the typo, it said:
                <link rel="stylesheet" type="text/css" href="[base_url)]/assets/templates/tutorial/css/Style.css" />

                after the correction, it now says:
                <link rel="stylesheet" type="text/css" href="/my-user-name/modx-0.9.6.1//assets/templates/tutorial/css/Style.css" /> Not sure why it has the two slashes before assets, but it works. laugh

                All I can say is thank goodness for people like yourselves with goodwill! Its a great help. Bye.
                  • 19701
                  • 4 Posts
                  Excuse my typing Susan, should have said Ottwell.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Get rid of the / after the [(base_url)] in your template. It has the trailing slash already.
                    <link rel="stylesheet" type="text/css" href="[(base_url)]assets/templates/tutorial/css/Style.css" /> 


                    and don’t feel bad, I just spent about five hours fighting some AJAX code, only to finally realize it was an error in my backend php script when building the mysql query. <sigh>
                      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