- Moderated by:
- Support
-
- rank:
-
Freshman
- registered:
- June 2003
- Status:
- offline
- last visit:
- 05.09.05
- Posts:
- 25
Is it possible to have conditions in a XTE template ?
In life before XTE, I changed some of the code in /modules/News.php such that only administrators saw the article count on the homepage & in article.php for the article itself.
With XTE, I removed the lines completely from the template, but this is obviously global, irrespective of user. So what I want is
If user is administrator
write article count
Can this be done ?
As a related question - would I be correct in saying that the coding layout in the xxxxx.php file, is 'overridden' buy the XTE template ? -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
Condidtionally statements can be done easily within xte templates - see, for example, the if construct. The main problem will be that, at the moment, we don't have a decent way of performing a permissions check within the template - the underlying API pnSecAuthAction isn't the easiest to transfer into a plugin.
Not sure what you mean by your last question.... A theme (in this case xanthia) only wraps output of a module it doesn't replace it. However we are gradually introducing fully templated modules (.760 is about 50% of the modules). This is the pnRender component of XTE - pnRender for modues & blocks, xanthia for themes.
-Mark
