Using the $key variable
drskitzo - April 26, 2009 - 22:04
| Project: | Custom Page |
| Version: | 6.x-1.6 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I am trying to have different banners on each page.
in page.tpl.php i was trying this code, Am i on the wrong path or is there a completely diff way I should be doing this?
<?php
if($key == "page2") {
?><?php
} else {
?><?php
}
?>Thanks in advance

#1
#2
Not sure if this has anything to do with CustomPage per se (I'd guess - no), but as a general comment you check the URL parts by looking checking them with arg([index]) function, not with a $key variable. That variable does not seem to be defined in your code.
Hope this helps.
Irakli
#3
can you be kind enough to give me an example of how I'd use the arg([index]) function for my purposes? :)
Is there a way I can get the $key defined in my code? Is there a file I need to include or whatnot?
Thanks in advance! :)
#4
Automatically closed -- issue fixed for 2 weeks with no activity.