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

    Working on my MODx site with a CSS template that I've downloaded. I'm not a web developer by profession, but I pick up the coding fairly quickly.

    I'm looking for some help with two things:

    - Understanding the right way to design and use the template
    - Understanding the specifics of the code that I'll be writing / editing

    For my template, I want some very basic things:
    - Image as a banner across the top on all pages (same image, for now)
    - Consistent look and feel for content from one page to the next

    I have been able to create a few pages in the "Resources" area and get those to show up in Wayfinder. I've modified the menu titles versus the page titles and such. I've populated the pages with content to render.

    I want the menu built based on Wayfinder (so I will need to create "Resources"), but I -think- I want the content displayed through the template page.

    Thoughts?
      • 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
        • 42535
        • 52 Posts
        Thanks, sottwell.

        I'm actually working along-side the tutorial that you posted, and it's pretty good. But, I'm using a different template that has different layout and control properties, so translating some of the instruction is a little tricky.

        Specifically, what I was trying to do was to code the template like this:

        <div id="wrapper">
        <div id="header">
        <div id="menu">
        [[Wayfinder? &startId=`0`]]
        </div>
        </div>
        <!-- end #header -->
        <!-- end #header-wrapper -->
        <div id="content">
        [[getField? &id=`[[*id]]` &field=`content`]]
        </div>
        <!-- end #content -->
        <div id="page">
        <div id="sidebar">
        [[$MySiteSidebar]]
        </div>
        <!-- end #sidebar -->
        <div style="clear: both;"> </div>
        </div>
        <!-- end #page -->
        </div>

        The sidebar displays fine and I get nothing for the main page content. I've tried getResource, get ResourceField, and others... none seem to be doing anything for me.
        • @ember1205 Another place where you can find MODX tutorials is on CMSTricks I have a 4 part tutorial that covers pretty much everything you want to accomplish.

          Good luck.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
          • Usually for page content, you just put [[*content]] where you want it to appear. No need for snippets for that.

            You also might want to consider the Asides TV for adjustable sidebar blocks.
              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
              • 42535
              • 52 Posts
              That's a step in the right direction for me! Thank you.

              The content is left-justified, but it's there. I will now work on how to bring that content into the template and format it the way that I want.
              • The rest is all in the CSS.

                #content p{text-align:justfied;}
                  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
                  • 42535
                  • 52 Posts
                  My CSS has a "content" section only, and it's defined like this:

                  #content {
                  float: left;
                  width: 600px;
                  }


                  Here's the way the content is written:

                  <div class="post">
                  <p class="meta"></p>
                  <h2 class="title"><a href="#">Title 1 Here</a></h2>
                  <div class="entry">
                  <p> <!-- My Content Here --> </p>
                  </div>
                  </div>

                  <div class="post">
                  <p class="meta"></p>
                  <h2 class="title"><a href="#">Title 2 Here</a></h2>
                  <div class="entry">
                  <p> <!--My Content Here --> <p>
                  </div>
                  </div>


                  The formatting comes through correctly becaue the title is the appropriate size as is the content, and the "post" type forces the inclusion of a graphic (which works as well). The justification is simply "wrong".
                  • Like I said, it's all in the CSS. In this case, you should probably have

                    .entry p{text-align:justify;}


                    or whatever you want the text alignment to be.
                      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
                      • 42535
                      • 52 Posts
                      Ok... update...

                      It appears that my issue is not formatting the text within where it is displayed. The issue is controlling where on the page the blocks show up. I've clearly lost something somewhere because now, reverting back to making a call to the content from a chunk is causing it to still display in the wrong area.