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

    I have two questions related to blog posts:

    1. I followed the tutorial on How to create a blog https://docs.modx.com/revolution/2.x/case-studies-and-tutorials/creating-a-blog-in-modx-revolution with any problems, but know I would like to customize my template.

    In the specific I would like to display the blog posts in a row of 3 columns. Please see attachment number 1 to have an idea or ->https://imgur.com/a/ViQm7

    This is the HTML I am using https://freehtml5.co/demos/magazine/index.html

    How can I achieve this?

    2. How can I insert an image in a blog post and display Image left and post content right? Please see attachment number 2 to have an idea or -> https://imgur.com/a/C1Ig6
    I am using bootstrap as framework by the way.

    Many many thanks in advance

    [ed. note: nowords last edited this post 6 years, 2 months ago.]
      • 36613
      • 328 Posts
      For Question number one you can use getResource:
      https://docs.modx.com/extras/revo/getresources

      For Question number tow you can use:
      - html in page
      - a structure like this:
      <div class="row">
        <div class="col-4"><img src="[[*left-image]]"></div>
        <div class="col-8">[[*content]]</div>
      </div> 
      

      - or this components:
      https://www.modmore.com/contentblocks/

        • 18367
        • 834 Posts
        You mean like this

        https://hotly.com.au/secrets

        There are three areas you need to work on.

        1: Your theme. If your theme allows for three columns or whatever, then you just need to cut it up correctly and insert the right modx bits in the right places.

        2: Your post Chunk. This really only calls one post but you will call it multple time in your page.

        3: Your page. Here you just put your resources call. Mine looks like this:
          <div class='col-3 blog' id='grid'>
        
        [[!getPage@myPaging? &elementClass=`modSnippet` &element=`getResources` &sortby=`{"publishedon":"DESC"}` &tpl=`begridpost3` &parents=`303` &depth=`3` &limit=`20` &includeContent=`1` &includeTVs=`1` and &processTVs=`1` &showHidden=`0` &hideContainers=`1` &cache=`1` &pageNavVar=`page.nav` ]] 
        
        </div>


        It will be slightly different for you and each theme but hopefully that will give you some idea.
          Content Creator and Copywriter