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