-
- 24 Posts
I have a set of news I wish to publish at one of my pages using Ditto.
With Ditto installed I set content of the page to [[!Ditto? &parents=`12`!]], and everything works like a charm.. but..
I want to style the results myself, and found out how to do this, but after adding the chunk in &tpl=´mychunktemplate´ I get this result on my page..
&tpl either does not contain any placeholders or is an invalid chunk name, code block, or filename. Please check it.
Whats wrong? Here are my chunk and ditto call..
[[!Ditto? &parents=`12` &tpl=`mychunktemplate` !]]
Chunk code (html):
<h3><a href="[~[+id+]~]">[+pagetitle+]</a></h3>
[+introtext+]
<a href="[+url+]"> read more...</a>
Hope someone can help me with this.. Thanks
Chunk names are case sensitive (ie someThing is not the same as something).
You also seem to be mixing up Evo & Revo syntax.. Evolution uses [[Snippet]] or [!Snippet!] uncached, whereas Revolution uses [[Snippet]] or [[!Snippet]] uncached. Perhaps that is confusing the parser.
Are you also using the right backticks (``) in your content? You seem have used other ones in your post, so that’s worth triple checking.
-
- 24 Posts
Hmm, Ive been over everything now, I kinda knew something was an Evo/Revo issue, as I read a tutorial for Evo, and using Revo... But doing everything you pointed out, I still have the same issue.. As for the backticks, Im using (`), not (’ or ´).. Any other tips?
-
- 24,544 Posts
This is what it would look like in Revolution (Ditto is deprecated and replaced by getResources):
[[!getResources? &parents=`12` &tpl=`mychunktemplate`]]
Chunk code (html):
<h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
[[+introtext]]
<a href="[[~[[+id]]]]"> read more...</a>
Be sure your Tpl chunk is called mychunktemplate and not myChunkTemplate -- it has to be exactly the same as the name in the tag.
If you’re using Revolution (which version?) you should seriously consider using getResources instead - Ditto will break at 2.1 and was only ported to Revo to provide a faster (and thus cheaper) migration.
I think if you install getResources, you will be able of simply replacing Ditto with getResources and it should work.
Though you will need to modify your chunk - you are using Evolution syntax again
Placeholders are [[+name]] in Revo.
Some links to look at:
http://rtfm.modx.com/display/revolution20/Tag+Syntax
http://rtfm.modx.com/display/ADDON/getResources
-
- 24 Posts
Great! Thanks alot, I just started using Modx a few days ago, so this helps alot!
-
- 24 Posts
Hmm, sorry guys, I still cant get this to work.. Could FURLS have anything to do with it? Do I have to set up getResources in any way?
This is how it looks now.:
Page content:
[[!getResources? &parents=`12` &tpl=`NyheterTemplate`]]
Chunk: (NyheterTemplate)
<h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
[[+introtext]]
<a href="[[~[[+id]]]]"> read more...</a>
Nothing is now displayed on the page, in the content area...
Did you install getResources through the Package Manager?
(System -> Package Manager, Download Extras, find getResources, hit Download, go back to the main screen and click Install and go through the prompt)
(I actually spend a while figuring out why getResources wouldn’t output anything before I realized I forgot to install it, this afternoon)
-
- 607 Posts
Apart from making sure you have getResources installed, you should be aware that:
1. By default getResources will not show documents that are hidden from the menu. So if your news items are hidden from the menu you need to add &showHidden=`1`.
2. Since you want to show the introtext, you also need to add &includeContent=`1`.
-
- 24,544 Posts
Quote from: einsteinsboi at May 01, 2011, 11:40 PM
Apart from making sure you have getResources installed, you should be aware that:
1. By default getResources will not show documents that are hidden from the menu. So if your news items are hidden from the menu you need to add &showHidden=`1`.
2. Since you want to show the introtext, you also need to add &includeContent=`1`.
Good point. It also won’t show unpublished docs by default.