I'm making templates to Etomite and I just started to use Etomite last week, so need some basic help..
I'd like to include documents longtitle to certain area of the template if, and only if document has something in long title. What's the correct way to check in the template that does the current document actually have a longtitle.
When doing just "<h1>[*longtitle*]</h1>" there will be an empty <h1></h1> if document has no longtitle and the page will have an empty area at the top of the page which just looks stupid..
Can I put php code straight to the template? or do I have to wrap it around php tags? In what point f.ex. [*longtitle*] in the template has been actually converted to the data?
What I'm thinking that can I just do something like: if([*longtitle*] != "" || [*longtitle*] != null)
Or do I have to use the api to first get the current doc and then check if it has something in longtitle? Something like:
$doc = $etomite->getDocument() (but this requires the id of the document, so not actually working like this)
if ($doc['longtitle'] != "" || $doc['longtitle'] != null)...
And do I have to put this check and the return to a snippet, or can I do it straight to the template?
And what's the place to look this kind of basic stuff? I know about the wiki and the api-listing, but could not find this kind of stuff in there.. are there any "tutorials" about making templates/snippets other than the ones that are in wiki?
Thanks!










