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

    I am using Modx Revolution newest version. I really like the Modx Sample Site Template but I want to make some simple changes. I have read thru the online docs and can’t figure out where the code lives I want to change. I want to do the following:

    1) I want to remove everything out of the Grey Sidebar and place my own content there. Currently there are several chunks which populate this bar. It starts with news, most recent, archives, tags, ect...

    I figured out how to get to all of the CSS files and all of the chunks files. But where do I actually modify the code where I can simply remove all of this from the sidebar? I know this is a noobie question. I have read the the online docs and can’t figure it out?

    Thanks,
    Joel Logan
    Commerce GA
      • 22019
      • 390 Posts
      You should probably look through a templating tutorial like this one:

      (they’re all for Evo, but you just need to change the tag syntax)
      http://net.tutsplus.com/tutorials/other/working-with-a-content-management-framework-modx/
      http://sottwell.com/how-templates-work.html
      http://codingpad.maryspad.com/2009/03/31/building-a-website-with-modx-for-newbies-part-3-working-with-templates/

      or I’d recommend the ’How to build a blog’ case study in the Revo docs:
      http://rtfm.modx.com/display/revolution20/Creating+a+Blog+in+MODx+Revolution

      The sidebar you’re looking to replace is inside the $header chunk in MODX Sample Site category. And before you ask, the main navbar is in the $footer (I spent a long time looking for that one).
        Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
        • 24946
        • 17 Posts
        Whoa, no joke, it’s really there. I looked for that for a while as well.

        How is it determined what ’News’ and ’Most Recent’ display? Where can I find the code that does that?
          • 24946
          • 17 Posts
          Also, if I delete ’Most Recent,’ it disappears in every section except ’Home.’ Why is that?
            • 22019
            • 390 Posts
            I think all you’ve done is delete the MostRecent chunk, right?

            MostRecent and NewsSidebar are mini-templates that format a row (item) called by GetResources - in this case both are called from the same parent (2) but the most recent has an explicit sort order declared.

            Both these mini-templates are called from the header chunk, which is itself a template to output the header common to both the page templates (MODXHost and BlogPost).

            So to get rid of ’Most Recent’ appearing on the sample site you need to remove the entire div ’recentdocsctnr’ from the ’header’ chunk - this it inline as it appears in the chunk:
            <div id="sidebar">
                        <h2>News:</h2>
                        [[getResources?
                            &parents=`2`
                            &limit=`2`
                            &showHidden=`1`
                            &tpl=`NewsSidebar`
                        ]]
                        <div id="recentdocsctnr">
                          <h2>Most Recent:</h2>
                          <a name="recentdocs"></a>
                          <ul class="LIn_shortMode">
                            [[getResources?
                                &parents=`2`
                                &limit=`3`
                                &showHidden=`1`
                                &tpl=`MostRecent`
                                &sortby=`editedon`
                                &sortdir=`DESC`
                            ]]
                            </ul>
                          </div>

              Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
              • 24946
              • 17 Posts
              I did that, and it did disappear from every section, but I must have been seeing the cache for home. In any case, per my previous question, how do ’news’ and ’most recent’ determine what they show?
                • 22019
                • 390 Posts
                Like I said:

                MostRecent and NewsSidebar are mini-templates that format a row (item) called by GetResources - in this case both are called from the same parent (2) but the most recent has an explicit sort order declared.

                in other words, they’re populated by the children of Resource id=2, which is the Blog folder, but using different criteria for the output. As there are only two child resources, it looks like the same output, when it is actually different.
                  Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86