Forums / Cotonti / Core Labs / Archive / XTemplate 2.0

<<<12

Brand new minimalistic implementation

Trustmaster
#16 2009-07-13 23:58
Fine, fixed this BOM problem in trunk and added more verbose error messages in case of wrong TPLs.
May the Source be with you!
tensh
#17 2009-07-14 21:36
That we cannot encapsulate with logical blocks other blocks is quite inconvenient. Like, I'd like the file download in pages be visible over a certain user group level... and doh: I cannot do this because of file blocks.
Trustmaster
#18 2009-07-15 01:36
Probably I will implement nesting a bit later, now we need to focus on bugfixes.
May the Source be with you!
tensh
#19 2009-07-23 18:48
In 0.0.7, I have problems with conditional tags... the below isn't working. Members don't see anything, which is correct, but whatever other usergroup logs in, the can see all links, but they shouldn't.

I tried without (), with more () and with '' quotes, still nothing. Help?

<li><a href="index.php">Home</a></li>
<!-- IF ({PHP.usr.profile.user_maingrp} = "4" OR {PHP.usr.profile.user_maingrp} = "6") -->
<li><a href="plug.php?e=link">Lista 1</a></li>
<!-- ENDIF -->
<!-- IF ({PHP.usr.profile.user_maingrp} = "4" OR {PHP.usr.profile.user_maingrp} = "7" OR {PHP.usr.profile.user_maingrp} = "6") -->
<li><a href="plug.php?e=link2">Lista 2</a></li>
<!-- ENDIF -->
<!-- IF ({PHP.usr.profile.user_maingrp} = "4" OR {PHP.usr.profile.user_maingrp} = "9" OR {PHP.usr.profile.user_maingrp} = "6") -->
<li><a href="plug.php?e=link3">Lista 3</a></li>
<!-- ENDIF -->
Trustmaster
#20 2009-07-23 19:34
  1. You must not use parenthesis () in conditions
  2. Do not quote the integers
  3. Equal is == not =
  4. If it is not in users.profile.tpl, then {PHP.usr.profile.user_maingrp} is not valid because it is defined only in users.profile.inc.php. For any template file you should use {PHP.usr.maingrp} instead which is global.
May the Source be with you!
tensh
#21 2009-07-29 18:21
Funny thing is that it worked earlier :)
Thanks for guidelines, now my conditional tags will be better :)
musiconly
#22 2009-07-29 19:17
one question..

trying to do something with comments, couldn't figure it out.

Since you can't use page.tpl tags in comments.tpl tags this condition:

<!-- IF {COMMENTS_ROW_AUTHOR} == {PAGE_AUTHOR} --> some code here <!-- ENDIF -->

isn't working.

So i need to find a global tag.

Is there any tag which will act like $usr['isowner'] or $usr['isadmin']. I tried {PHP.usr.isadmin}, {PHP.pag.page_owner} (don't know if that codes are even "the right" ones).

Basically, what I'm trying to accomplish is different display of comment if the comment author is also the author(owner) of the page they're commenting. You can see this a lot on WP powered sites.
Trustmaster
#23 2009-07-29 21:53
Try this:
<!-- IF {COMMENTS_ROW_AUTHOR} == {PHP.pag.page_ownerid} --> some code here <!-- ENDIF -->
May the Source be with you!
musiconly
#24 2009-07-29 22:29
that didn't work.

but this did
   1. <!-- IF {COMMENTS_ROW_AUTHORID} == {PHP.pag.page_ownerid} --> some code here <!-- ENDIF -->

i was so close :-) thanks Trust! :-)

<<<12