opencart - php - page definitions
Posted: Sun Aug 26, 2012 4:16 pm
hi all,
I am pretty much novice in php, but I do modify a bit various templates by trial and error method.
I am stuck now with the following problem and desperately need some help from you guys:
1. template has a top menu with class designed outlook and hover effect. however, a completely different class is designed if the link is active.
2. so, I have managed to differ it by php if function in the header.tpl file under <ul> section, like as follows:
3. in header.php file of controller folder, I have inserted the line:
just before the line>
the result is an error with message that variable $currentpage is not defined.
if I insert the line:
before the line:
it gets me back with neither an error nor desired effect.
What am I doing wrong here?
Can anybody help with instructions how and where to name/define different pages / links in the opencart system?
Help is extremely appreciated.
Thank you!
I am pretty much novice in php, but I do modify a bit various templates by trial and error method.
I am stuck now with the following problem and desperately need some help from you guys:
1. template has a top menu with class designed outlook and hover effect. however, a completely different class is designed if the link is active.
2. so, I have managed to differ it by php if function in the header.tpl file under <ul> section, like as follows:
Code: Select all
<li<?php if($currentpage == $home) {echo " class=menu_1_active";} else {echo " class=menu_1";}?>><a href="<?php echo $home; ?>"><?php echo $text_home;?></a></li>
<li>...
Code: Select all
$currentpage = $_SERVER['REQUEST_URI'];
Code: Select all
$this->data['title'] = $this->document->getTitle();
if I insert the line:
Code: Select all
$this->data['currentpage'] = $this->$_SERVER['REQUEST_URI'];
Code: Select all
$this->data['currentpage'] = $this->$_SERVER['REQUEST_URI'];
What am I doing wrong here?
Can anybody help with instructions how and where to name/define different pages / links in the opencart system?
Help is extremely appreciated.
Thank you!