We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8141
    • 2 Posts
    I have just started playing with ModX and I think its a great idea! Ajax content editing is just what I have been looking for.

    But as I try some templates out, it appears a lot of them don’t use proper code tags or their relative path is way off.

    Now, the themes I’m trying are from popular professional template makes like andreas and sottwell. So I’m thinking I must be doing something wrong but here goes.

    On Greenery from sottwell. The [(base_url)] tag is missing from the template code. She has:

    <link rel="stylesheet" type="text/css" href="/assets/templates/greenery/css/screen.css" media="screen, print" />

    but that should be:


    <link rel="stylesheet" type="text/css" href="[(base_url)]/assets/templates/greenery/css/screen.css" media="screen, print" />

    so that it knows to look in my Modx subdirectory.

    Also, with Andreas02,

    All the content, and images, and style sheets are referenced by relative paths.


    <link rel="stylesheet" type="text/css" href="andreas02.css" media="screen" title="andreas02 (screen)" />

    which I had to change to:


    <link rel="stylesheet" type="text/css" href="[(base_url)]/assets/templates/andreas02/andreas02.css" media="screen" title="andreas02 (screen)" />

    in order to see it.

    Am I doing something wrong? or is there something I am missing? I couldn’t find any docs on how to install templates. So I assume you have to copy the code from the html or tpl files they give you and somehow fathom a naming convention with the core title of the file and paste it in manually.

    Am I doing this right?
      • 30546
      • 46 Posts
      <link rel="stylesheet" type="text/css" href="assets/templates/greenery/css/screen.css" media="screen, print" />
      (please note I took the slash away from infront of the path of assets)

      This should work as well. No need to add the base URL unless you have a different setup.

      The slash infront would point you to a totally different path than you want to go.

      Hope that helps
      • There are several ways to approach this actually. You can use [(site_url)] or [(base_url)] in front of every path in your template, or you can add a <base href="[(site_url)]" /> inside your template’s HEAD tag (this was done automatically before 0.9.1 when using friendly alias paths, and I believe will be a new option in the next release to have automatically this base tag added to your templates automatically when using friendly alias paths option).

        But you are correct, there is some inconsistency in the template implementations here, most likely based on variations in designers’ local testing environments. Having some official add-on submission and approval guidelines in the near future should help reduce these inconsistencies, and I’ll try and make sure that happens as soon as possible, based on our current team priorities.