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

    i want to use my own design in the articles template. This is my free template: http://www.freecsstemplates.org/preview/terrafirma2/

    Here you can see my first steps: http://modx.martin-brehme.de/index.php?id=3

    OK, i must modify something. I have to make this changes ...

    My problem: In the original sample.ArticlesContainerTemplate are this line
    [[*content]]


    MODx generates this HTML-Code:

    <div class="post">
        <h2 class="title"><a href="index.php?id=4">der erste Artikel</a></h2>
        <p class="post-info">Gepostet von <a href="index.php?id=3author/admin">admin</a> </p>
    
        <div class="entry">
    	    <p>Pellentesque facilisis condimentum nunc, at ...</p>
        </div>
        <p class="postmeta">
          <span class="links">
            <a href="index.php?id=4" class="readmore">Lesen Sie mehr</a>
            | <a href="index.php?id=4#comments" class="comments">Kommentare (0)</a>
    
            | <span class="date">Mar 06, 2012</span>
          </span>
        </p>
    </div>


    But i want to use my own design. How can i modify this output? And weher can i find an overview of the placeholders ( ++articles.... ). Is there somewhere a tutorial

    Martin
      • 35985
      • 33 Posts
      http://rtfm.modx.com/display/ADDON/Articles.Theming+Articles

      I think this is what you are looking for. I am not 100% what you are asking... [[*content]] pulls the content from your article. sample.ArticlesContainerTemplate will have coding using place holders like
      <div class="post">
          <h2 class="title"><a href="[[*id]]">[[+pagetitle]]</a></h2>
          <p class="post-info">Gepostet von <a href=[[~3]]>admin</a> </p>
       
          <div class="entry">
              <p>[[+content]]</p>
          </div>
          etc... etc.
      </div>


      Dont take this and try and use it, im just giving an example and as a new modx user myself, i may have taken the intent of the piece out of context and used the wrong references with bad syntax.

      I would also suggest looking at http://codingpad.maryspad.com/beginner-tutorials/ great tutorial that walks you through taking a template as you have and sliding it into modx.

      The Html that is displayed is just following the template, if you want to modify it i would start by looking at the template itself. As it provides the layout and CSS the formatting. It will simply duplicate the output for all the entries you have.



      Hope that helps smiley

      • http://rtfm.modx.com/display/ADDON/Articles.Theming+Articles

        The format of the listings of posts displayed on the main Articles page is controlled by a chunk tpl used by getResources. It's a little bit more complicated since Articles also uses the getPages snippet, which is a wrapper for getResources to provide for paging of long lists of post summaries.

        http://rtfm.modx.com/display/ADDON/getResources
        http://rtfm.modx.com/display/ADDON/getPage

        What you want to do to change that listing tpl is to create a new chunk tpl.

        http://rtfm.modx.com/display/revolution20/Chunks

        Go to the Templates tab of your Articles resource and see what chunk it says it's using in the Article Row Chunk field. Now open that chunk and copy/paste its content into your new chunk, and change the chunk name in the Article Row Chunk field to the name of your new chunk. The site shouldn't change at all at this point, since your new chunk tpl is the same as the sample one.

        Now, open your new chunk and edit it to have the structure you want each row of post summaries to have.

        Articles will automatically change the settings for the getRows and getResources snippets that it uses in the background.

        If you're careful to keep the same ID and classname attributes in your chunk tpl you won't have to change the CSS, but if you do make radical changes in the tpl you'll need to edit the Article's CSS to properly style your summary rows.

        Don't just edit the existing sample chunk, as that will be replaced any time you upgrade Articles. Create a new one and tell Articles to use your new one instead. [ed. note: sottwell last edited this post 12 years, 2 months ago.]
          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
          • 38948
          • 15 Posts
          Quote from: sottwell at Mar 08, 2012, 05:12 AM
          ...

          Go to the Templates tab of your Articles resource and see what chunk it says it's using in the Article Row Chunk field. Now open that chunk and copy/paste its content into your new chunk, and change the chunk name in the Article Row Chunk field to the name of your new chunk. The site shouldn't change at all at this point, since your new chunk tpl is the same as the sample one.

          Now, open your new chunk and edit it to have the structure you want each row of post summaries to have.

          Thank you, That's exactly what I was looking for.
            • 38948
            • 15 Posts
            Quote from: Shopcoop at Mar 08, 2012, 04:50 AM

            I would also suggest looking at http://codingpad.maryspad.com/beginner-tutorials/ great tutorial that walks you through taking a template as you have and sliding it into modx.

            Yes, those are really good tutorials. I have read the tutorials in the last three days smiley