You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees
when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.
IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.
You are not logged in.
I want to have a 'new.tpl' file to show up in the header only whenever a certain page.tpl.php is called. What would the php code be?
Offline
Well, you can`t specifically know when a tpl file is loaded, but you can check it using the url and then work around that.
So, lets say you wanted to load a link in the header, but only when the contact page is visible. You would add the following somewhere in the header tpl file:
if (isset($_GET['cmd']) && $_GET['cmd']=='contact') {
// show link..
}
Offline
What if I want to have a div block shows only when the contact page is loaded?
I tried wrapping your code in a div but get error. Do I need to enclosed it with '<?php ?>'?
if (isset($_GET['cmd']) && $_GET['cmd']=='contact') {
<div>
something......
</div>
}
I am using this method but prefer this one since it is much cleaner.
Offline
You need to break out of php mode when using code like you are doing. PHP code must be between php tags.
<?php
if (isset($_GET['cmd']) && $_GET['cmd']=='contact') {
?>
<div>
something......
</div>
<?php
}
?>
Offline
Got it. Thx.
Offline
Great. ![]()
Offline