Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By brakai295 on
hi,
simple question: how come this isn't working
<?php if ((!$is_front) || (arg(0) != "travelbuddy")) echo '<div class="box">'; ?>
the div should NOT show if one of the conditions is true.
thanks!
kai
Comments
An OR statement is TRUE is
An OR statement is TRUE is if either statement is TRUE.
I am not sure what you are trying to happen.
White Paper Designs
as i said, what i'm trying
as i said, what i'm trying to achieve is:
If we are NOT on the front page [OR] if we are not in the travelbuddy section, then the DIV should be shown.
Is there any other approach to do this? My above example doesn't work.
Cheers
Kai
Webdesign Melbourne Australia
www.brizk.com
Always true...
Unless the front and travelbuddy sections are the same, every page you are on will not be one or the other. I think you mean:
if !($is_front || (arg(0) = "travelbuddy"))
I'm no PHP expert, but that seems to make more sense to me...
Michelle
--------------------------------------
My site: http://shellmultimedia.com
hey, that seems like it
hey,
that seems like it makes sense to me too, but it ain't working ;-)
Parse error: syntax error, unexpected '=' in /home/www/ausmag/australien-community/themes/ausmag/box.tpl.php on line 1
ANy other ideas? I can't believe it's so hard to connect those two conditions with an OR operator!? :o|
Webdesign Melbourne Australia
www.brizk.com
Oops
Should be == not =. I always forget PHP is picky about that.
Michelle
--------------------------------------
My site: http://shellmultimedia.com
nope, unfortunately, still
nope, unfortunately, still no luck :-/
Parse error: syntax error, unexpected '!', expecting '(' in /home/www/ausmag/australien-community/themes/ausmag/box.tpl.php on line 1
Webdesign Melbourne Australia
www.brizk.com
More typos
Sorry, I don't use PHP on a regular basis and I was trying to give a quick answer... Try:
if (!($is_front || (arg(0) = "travelbuddy"))) { ...
If that's not quite right, look at the PHP website for the exact syntax. I'm trying to go off the top of my head with a toddler screaming at my feet.
Michelle
--------------------------------------
My site: http://shellmultimedia.com
hey I think this is it! :-)
hey I think this is it! :-) it seems to be working! I just changed the = into == from your last post.
thanks very much! regards to little toddy. ;-)
kai
Webdesign Melbourne Australia
www.brizk.com