By werushka on
I am trying to put a if statement to the page.tpl.com in which if the current page is "exaple" print something on the screen
my path is like this mydomain.com/test-php
so if the page is /test-php print something like this
if (!(arg(0) == 'test' && arg(1) == 'php' )) {
print "Hello World"; }
?>
Comments
If you have /test-php It
If you have /test-php
It measn arg(0)=test-php
and arg(1)=EMPTY
Your if statement works for path:
/test/php
thank you very much for your
thank you very much for your fast reply
I have this in page.tpl.php
but it prints Hello World in every-page and does not care about the arg
It will not print the Hello
It will not print the Hello world on the page: /test-php
Your condition is wrong, it should be:
thanks for your reply
thanks for your reply ionut.alexuc
well you are right I forgot the ! infront of the arg but this code still does not work but it should work
actually it should be like
actually it should be like this
I want to print Hello world only in test-php but still it does not work :(
Try to print arg(0) and see
Try to print arg(0) and see the value.
Are you sure you edit the right file?
it just prints node ??
it just prints node ??
yeah :) your /test-php is a
yeah :)
your /test-php is a node page.
It has an internal path like: node/100
you have to print arg(1) and see the node ID.
then change your condition as:
yep I got it it is 130 put
yep I got it it is 130 put when I put this
it still does not work :((
i got the logic :) <?phpif (
i got the logic :)
works perfectly
damn it actually shows in
damn it actually shows in every taxonomy/term/ page and it does not care about the taxonomy/term/130
:(
damn I think I am sooo sleepy
damn I think I am sooo sleepy
I typed arg 3 in the previous post
here's a cleaner
here's a cleaner version: