Foren / Cotonti / Skins / Page-specific tpl?

Twiebie
#39368 3. April 2014, 12:31
#39366 Hodges:

*bump*

I've tried to implement what Kort has suggested, but I obviously don't know what variables are available in this context. This is my attempt:

	<!-- IF {PHP.page.id} == 22 -->
	<span style="float:right"><a href="index.php?e=page&m=add&c=members">Submit new member</a></span>
	<!-- ENDIF -->

Help! :)

Added 1 hours later:

Also how can I combine this with an if statement to check to see if the user is an admin?

You can do {PHP|dump} in the template to get all the available variables. Make sure debug mode is enabled though.

For your specific statement you could do something like this to check if the user is an admin:

<!-- IF {PHP.pag.page.id} == 22 AND {PHP.usr.isadmin} -->
<span style="float:right"><a href="index.php?e=page&m=add&c=members">Submit new member</a></span>
<!-- ENDIF -->

Here is some good documentation:

http://www.cotonti.com/docs/ext/themes/cotemplate_debug_mode
http://www.cotonti.com/docs/ext/themes/cotemplate_statements


Dieser Beitrag wurde von Twiebie (am 3. April 2014, 12:57, vor 9 Jahre) bearbeitet