We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25619
    • 5 Posts
    right, i’m not a very experienced modx user, but i’ve created and now manage more than a couple of sites. In my latest site i tried implementing a "simple" blog as per this tutorial here. http://www.modxcms.com/blog-tutorial.html

    Now maybe i’m on my own on this one, but i’ve rarely come accross a more convoluted mixture of snippets that those of newspublisher and ditto and whatever else you need to make this "relatively simple" blog work.
    i’m not looking to use comments, or pre registered users.. all i need is 1 content entry form which updates one blog, and a news page which shows the latest 3 blog entries

    Ok i’ll try and calm down, but i’ve been trawling the forums and blogs trying to find any real documentation for these snippets, other than just a list of parameters of their parameters.
    Newspublisher for example, seems to use a default template for the blog form, which includes
    Page title:
    Long title:
    Description:
    Published date:
    Unpublished date:
    Summary:
    Content:

    great! now I’ve been trying figure out how to simplify this form, (all i need is Title and Content), I hoped there would be parameters for controlling the visual elements in this form.. but that doesn’t seem to be the case. It appears that you can reference your own custom tempalte, which you create in a chunk, but I can’t seem to find any documentation on how to best layout this form template?

    Anyway thats just problem number 1.
    What really gets me confused is when viewing an actual blog entry, that is the full page just showing the contents of 1 blog item.. it doesn’t even have the title above it! Which is very frustrating.. Now i’ve been trying to find out what i’m doing wrong, maybe i’m just having one of those days where nothing makes sense, but please! if you’ve successfully implemented a simple blog in this way, could you let me know?
    Before my head breaks open and my brain crawls away..
      • 3749
      • 24,544 Posts
      Quote from: rross at Aug 21, 2007, 09:53 AM

      right, i’m not a very experienced modx user, but i’ve created and now manage more than a couple of sites. In my latest site i tried implementing a "simple" blog as per this tutorial here. http://www.modxcms.com/blog-tutorial.html

      [snip]

      What really gets me confused is when viewing an actual blog entry, that is the full page just showing the contents of 1 blog item.. it doesn’t even have the title above it! Which is very frustrating.. Now i’ve been trying to find out what i’m doing wrong, maybe i’m just having one of those days where nothing makes sense, but please! if you’ve successfully implemented a simple blog in this way, could you let me know?
      Before my head breaks open and my brain crawls away..


      I’m sure others can give you a better answer than I can, but maybe this will get you started:

      I do something similar (in fact, almost exactly what you’re planning, although it’s not a blog but a set of news stories). Here’s my basic setup.

      The page for adding a new post just has this line:

      [!NewsPublisher? &folder=`8` &clearcache=`1` &canpost=`NewsAdmins` &postid=`1`  !]
      

      Folder 8 is just a MODx document that’s a container for the posts. Be sure you specify it as a container when you create it. When you create a new document, it gets a number. This one got number 8.

      On the main page (where the three post summaries appear), I have this call to Ditto:

      [!Ditto?startID=`8` &display=`3` &dateFormat=`%d-%b-%y %I:%M %p` &tpl=`MyNewsItemChunk` &extenders=`summary` &debug=`0`!]
      

      Notice the reference to MyNewsItemChunk. It’s a custom chunk that determines how each item is formatted.

      Here’s MyNewsItemChunk:

      <item>
         <div class="ditto_summaryPost">
            <h3>[+title+]</h3>
            <div class="ditto_summary">[+summary+]</div>
            <div class="seemore"> <a href="[+id+]" title="[+title+]">See more about this story . . .</a> </div>
            <div class="postedby">» Posted by [+author+] on [+date+]</div>
        
      </div>
      <hr/>
      </item>
      

      Create it by going to manage resources / chunks. Select "New Chunk" and paste in the code above. You can modify it after you get things working.

      In my .css file, I specify how each of the classes will look. Here’s part of it:

      div.ditto_summaryPost a:hover {
      color:#000000;
      background-color:#bbbbbb;
      }
      div.ditto_summary {
      color:#000000;
      font-family:"Times New Roman", Times, serif;
      font-size:16px;
      font-weight:normal;
      }
      
      div.ditto_summaryPost h3 {
      	text-decoration:none;
      	text-transform:uppercase;
      	font-size:14px;
      	color:#336699;
      }
      div.postedby {
      	font-family:Arial, Helvetica, sans-serif;
      	color:#000000;
      }
      div.seemore {
      	margin-top:0px;
      	padding-top:0px;
      	margin-bottom:10px;
      	text-align:right;
      	font-style:italic;
      	color:#000066;
      }
      
      

      I use the default Newspublisher template. Like you, I don’t need all the fields, but it’s ok to just leave them blank when you’re entering a new post and, so far, I’ve been too lazy to customize it. Consider, also, that you might want to write entries ahead of time and have them show up one per day or something similar. You might also want some posts to expire eventually. The published and unpublished dates will come in handy if you ever decide to do this. The summary might also be useful. On mine, the summary is usually a duplicate of the first paragraph of the post but for some longer posts or posts where the first paragraph doesn’t really make it clear what the post is about, it’s worth having a custom summary. You can have the summary appear on your main page rather than a truncated post.

      Folder 8, btw, could be an unpublished, blank container document, but I have a link to it in my menu and use it to show ALL the posts. It just has the following ditto call:

      [!Ditto?startID=`8` & display=`all` &extenders=`summary` &dateFormat=`%d-%b-%y %I:%M %p` &tpl=`MyNewsItemChunk` &debug=`0`!]


      Hope this helps,

      Bob

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22548
        • 58 Posts
        Hi rross!
        Above Bob’s full explanation I just want to tell you that I’m also very new to MODx and know the beginning is not as easy as with Joomla or other customized CMS applications wink. But that is exactly what will give you a lot more flexibility with your sites without REAL good php knowledge (which I don’t have at all)!
        And as others have stated before, the best way to get a kickstart might not always be the documentation (for as it seems to me NewsListing and UserComments are a little outdated for the job), but the example settings in your full installation. So make sure you get the full install and have a look at the Ditto call in the blog container and the chunk called there. That will probably turn a lot of lights on and make you want to know all the parameters you can use to produce WHATEVER you want with MODx.
          • 25619
          • 5 Posts
          Thats been a big help bob!
          Thanks guys.
            • 4775
            • 47 Posts
            What I found helpful while implementing my blogs was the MODx demo site at opensourcecms.com You can log into the manager and get a feel for how its setup (snippet calls, chunks, TV’s etc). It’s pretty good stuff.