Hi,
So I’ve manage to work out how to get a blog style list of summary’s using a couple of chunks and...
[!Ditto? &tpl=`blog` &summarize=`10` &paginate=`1` &sortBy=`pub_date` &sortDir=`DESC` &paginateAlwaysShowLinks=`1` &tplLast=`paginate`!]
What I can’t work out is that once you click through to an individual article, how do you define what appears in that template? I can only think of doing it with another page template but I don’t want the admin user to have to update the default template every time the write a news item.
Any ideas/insights welcome.
Cheers.
I’m not sure I understand your question. It sounds like you want the individual articles to have their own template that’s different from the main site template. I’m assuming that all the individual articles could share the same template.
If your blog article documents are all in (below) a container document, you can create a new blog article template and assign it to that container document. Then, any new posts created under that container will inherit that template rather than the site’s default template.
Hope that makes sense.
Quote from: velocity at Nov 21, 2008, 04:13 AM
Yeah you’ve got the idea. The problem with the method you describe is that I don’t want the individual document templates to be the same as the container template. At container level I just want to output [*content*] which contains the ditto call and at document level I want the title, date and author and content of the individual article.
The only way around this I can think of is to add some sort of logic; if you’re at container level process Ditto, else if you’re in a child document output X chunk.

I see your problem. It might be cleaner to just create a plugin triggered by saving a document that checks to see if the parent is the container and, if so, changes the template to the one you want. Someone else may suggest an easier way, but that’s all I can think of at the moment.
You could just put the documents in a different container altogether (Ditto would still find them), but it would probably mess up your menus.
You could use a snippet to do some logic and display one output if container and another if not. I have done this before, the isfolder parameter makes it easy to identify if the document is a container. Then you can either load a chunk or simply process the output directly in the snippet.
Another option is to use 2 templates and use a plugin to determine that the children use template x. I have done this as well and there are a few plugins available that allow you to predetermine templates by parent.