
Theo
Project Manager
/ Moderator

Nov 10, 2006, 2:11 PM
Post #5 of 11
(2568 views)
Shortcut
|
Thanks for posting, jeremed! Hopefully I can help make things a bit clearer about what templateCells are and what they're for.
how is $foo$ linked to the templateCell? I don't understand how it knows to replace that placeholder with the templateCell content. (Just to be clear, $foo$ isn't actually anything, it's a meaningless placeholder used as an example. That may be obvious, but some people [Damon] thought that $foo$ was an actual placeholder from the program.) $foo$ is connected to the templateCell only because the program knows it, it's hardcoded into the program logic. You don't need to do anything to tell the program to use a templateCell - in fact, you can't: the program either uses it, or it doesn't. As mentioned in the docs, the rules and use for templateCells are defined by the program. The only templateCells you have in Article Manager 2 are for: (a) your articleLists; (b) your categoryLists; and (c) any upload fields that you have. You can't make up new ones (that's what templateIf is for).
- Your articleList templates MUST have an articleRow templatecell. This is generated where you put your $articleList$ placeholder.
- Your categoryList templates MUST have a categoryRow templateCell. This is generated where you put your $categoryList$ placeholder.
- Your common/embeddedMedia template MUST have a globalDefault.embeddedMedia templateCell. This is used for any of your embedded media uploads (e.g. ***image1***). Optionally, you can also override this default format for an individual template, if necessary (see the Embedded Media section of the File and Image Uploads template docs). If you've upgraded from 1.41, most of your templates will have an templateCell that reflects your design from your version 1 templates, but it's optional and you may just want to remove them.
- Any other upload field ("Single Upload" or "List of Attached Filed") needs a templateCell called $PLACEHOLDERNAME.row$. This is generated where you put your $PLACEHOLDER$.
For example, by default Article Manager has an $article.attachments$ field, for which the templates have a corresponding templateCell : article.attachments.row.
How is the templateInsert linked to the templateCell? I don't understand what it's function there is. TemplateInsert is totally unrelated to the templateCell. It's in a comment tag, so it's invisible when you view the raw template, but when you publish, just the placeholder remains. You can wrap anything in a templateInsert, the only value to it is that it will hide the content in a comment when viewing the template directly.
3. In the code, I see this tag: $article.externalLink$ On my outputted pages, it was showing up but with a broken url. I can't say for sure what the problem is without seeing your template, but I'm guessing you need to replace this:$article.externalLink$ With this:<!-- templateIf : $article.externalLink$ ne "" --> [ <a href="$article.externalLink$">Visit Website</a> ] <!-- /templateIf -->
4. How do I make a summary page article like I used to with artman 1? This is explained in detail here: http://www.interactivetools.com/forum/gforum.cgi?post=50012#50012 I hope this all makes sense! I suspect some of what you're hoping to do with templateCells are actually done with templateIf. Or if you gave us some specifics, there might even be a better way altogether. If you need any further assistance, just let me know. Theo Wiersma Project Manager
|