We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17227
    • 6 Posts
    Hi,
    I have set up a web server on my machine and installed MODx. All went well.
    I have one file of my own in the root of my htdocs called index.html.

    All OK so far.

    I want to be able to make modifications to this file.
    I’ve created a template using the HTML code from index.html and a temlpate variable called [*home_preamble*] for the part of the screen I want to edit.

    I inserted [*home_preamble*] into template and I’m able to edit and save it.
    It even shows up in the preview window, so I’m satisfied that I’m on the right track.
    My problem occurs when I click ’Launch Site’. The new window displays the index.html that’s present in the root as the old version. I do not understand how I can link this file in MODx so changes to the [*home_preamble*] variable are displayed in to root html file. I hope this makes sense. I think I’m still very new to this and I’m reading through support documentation to work out what it is I’m not understanding.

    Some pointers from the community would be very much appreciated to get me up and running with this excellent CMS. I’m very impressed and eager to start exploring it further.

    Thank you
    LiquidEyes


    System Info:
    apache_2.0.55-win32
    php-4.3.11-Win32
    mysql-3.23.38
    OS: Win XP Pro SP2

      • 22303 MODX Staff
      • 10,725 Posts
      You need to remove the index.html file. This, minus page specific content (e.g. like home_preamble and the rest of the content unique to the home page), should become your Template for the site, which you need to save under the Manage Resources area of the MODx manager. Each virtual document you then create via the manager using that template will have it’s own [*content*] region where the main content for that page is edited.

      Now, template Variables are for additional areas of editable content linked directly to a template. In the case of home_preamble though, since that sounds like something that will only appear on the home page, unless you might have a separate home page template from the other pages, I’d just use a chunk which is a static, editable, re-usable area of HTML content, called home_preamble and include it in the home-page content region (e.g. {{home_preamble}}) . Either way will work however, just want to point out though that with Template Variables, these editable regions will appear as an additional editable region on every page using the template it is assigned to.

      The reason you are not seeing the site is because most Apache installations are setup to look for index.html first, instead of the main MODx URL at index.php which controls all MODx requests.

      Cheers
        • 17227
        • 6 Posts
        That was very helpful, index removed and site working wonderful.
        Love the way you can edit from front end smiley

        I’ll obviously need to experiement more as this is so new!
        I’m now trying to work out how the menu in the template works.
        Should I create a seperate template and variables for each page?

        How do links work in something like this?

        MODx is really something special.
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: LiquidEyes at Nov 26, 2005, 11:31 PM

          I’ll obviously need to experiement more as this is so new!
          I’m now trying to work out how the menu in the template works.
          Should I create a seperate template and variables for each page?
          That really depends on the site you are planning. I’ve developed dozens of sites with MODx and very few have more than 2 or 3 templates, and on many I used one single template. The freedom of MODx can be overwhelming, but once you start using your imagination to explore all the possible approaches you can take when structuring your sites, you’ll realize the power. Check out more in our online documentation at http://modxcms.com/documentation.html. Here are some specific links relevant to some of your questions:

          All about MODx tags --> http://modxcms.com/modx-tags.html

          Designers Guide --> http://modxcms.com/designer-guide.html
          DropMenu usage and configuration --> http://modxcms.com/snippet-dropmenu.html

          Quote from: LiquidEyes at Nov 26, 2005, 11:31 PM

          How do links work in something like this?
          See the link about MODx tags above... but you can create links to internal MODx documents by using the syntax [~id~] where id is the actual document ID shown in the manager.

          Quote from: LiquidEyes at Nov 26, 2005, 11:31 PM

          MODx is really something special.
          I sure think so, and glad you’ve decided to give it a try.

          Cheers... wink
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You use the same template for pages; you can assign templates in the form when you create a document in Manager; you set a default template for the whole site in Manager’s Administration/System configuration. Documents are set to this template by default.

            You can change the template the front-end NewsPublisher system uses in the options given to the snippet:

            [[NewsPublisher? &template=`NewTemplate`]]
            


            The best way to learn is to read the Documentation, and to look at the documents and templates used in the installation.

              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
              • 17227
              • 6 Posts
              Thanks for all your help.
              It’s starting to make sense and MODx is so intuitive once you’re off the ground.

              I’ve only been working with it for about 20 hours including install, reading docs and playing around and already I’m realizing the freedom and power it provides.

              I’ll read through the links you’ve supplied and thank you very much for your prompt replies.

              Regards
              LE