We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17982
    • 6 Posts
    Hi,

    I’m really loving to play around with modx. Its quite an interesting CMS. Thanks to all that have contributed to it.

    I was wondering whether I can have different home page structure than the other pages. Actually, I’ve a slight different header for my home page. The header is like:

    <div class="my_site_header">
    <div class="common_for_all_pages"></div>
    <div class="just_for_home_page"></div>
    </div>

    So, you can see I want the following to be shown on home page only.

    <div class="just_for_home_page"></div>

    Any one knows a work around for it?

    Thanks! smiley smiley
      • 27708 MODX Staff
      • 2,502 Posts
      Like most things in MODx there are a number of ways to handle this. You can use PHx plugin to conditionally show the div (which ought to be in a chunk) when the document id is equal to that of your home page else show nothing. Additionally you could do the same thing with the If snippet.

      Both of these are in the repository.

      Hope this helps.
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 17982
        • 6 Posts
        Thanks!! Seems like I found the solution... but please can you give me the link for the plugin and the snippet please... Unable to find these...

        Thanks again! smiley
          • 27708 MODX Staff
          • 2,502 Posts
          http://modxcms.com/extras/search.html?query=PHx

          and

          http://modxcms.com/extras/package/600

          But the If snippet is actually made for Revo but it may work with Evo
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 17982
            • 6 Posts
            Thanks for the links! I managed to implement the PHx plugin and its working pretty well.

            Thanks again smiley
              • 17982
              • 6 Posts
              Hi again!

              I’m facing a little problem with the PHx plugin.

              I implemented it to my local server and it was working fine. Now I’ve uploaded my website online and whenever I make any changes to content or any thing else it changes the directory path to that of the local one in assets/cache/siteCache.idx.php

              Please tell me whats wrong... Appreciate your help as always smiley

              Here is the error:

              PHP error debug
              Error: include_once(D:/phpserv/www/clickedsol/assets/plugins/phx/phx.parser.class.inc.php) [function.include-once]: failed to open stream: No such file or directory
              Error type/ Nr.: Warning - 2
              File: /home/design4m/public_html/apps/clickedsol/manager/includes/document.parser.class.inc.php(746) : eval()’d code
              Line: 9