Re: #categories li a.cat-selected-text but for EZPAGES
It would not require touching any additional files, just more code in the one. I think the Smart Backgrounds code would serve as a starter, with sub-tests... maybe need to include a specific line for each possible pagename, or maybe there is a universal way I can phrase it that will work with all names. I have this thread bookmarked now, and will look into it.
Re: #categories li a.cat-selected-text but for EZPAGES
Hi Glenn,
Have you ever figured out how to style selected link in ezpages sidebox? I'd really love to know how to do that. Could you help?? This is quite urgent.. Thank you!
Re: #categories li a.cat-selected-text but for EZPAGES
I haven't worked on the "internal link" highlighting, but the code I gave above should already work for ez-page links.
Re: #categories li a.cat-selected-text but for EZPAGES
Glenn,
The situation is I don't have any sidebox other than ezpage sidebox. I have home page, contact us page , etc. set up in ezpage sidebox, so the code you mentioned doesn't help..
Do you have any idea when you'll be able to look into it (internal links)?
Thank you in advance!
Re: #categories li a.cat-selected-text but for EZPAGES
OK, I see your predicament. I'll take a quick look at it now to really see what kind of a job it is. If it's simple enough, I'll post some code for you to test.
Re: #categories li a.cat-selected-text but for EZPAGES
It looks like I should have the ez-pages header version ready to test in a few minutes. If that works, it shouldn't be hard to translate into the sidebox.
Re: #categories li a.cat-selected-text but for EZPAGES
Please test this to see how it works.
/includes/templates/your_template/templates/tpl_ezpages_bar_header.php
Style the classes
.activeEZPage {}
and
.activeILPage {}
in your stylesheet to see effects.
PHP Code:
<?php
/**
* Page Template
*
* Displays EZ-Pages Header-Bar content.<br />
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_ezpages_bar_header.php 3377 2006-04-05 04:43:11Z ajeh $
*Modified for Ezpages Active Header by Glenn Herbert (gjh42) 2010-08-20
*/
/**
* require code to show EZ-Pages list
*/
include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_header.php'));
?>
<?php if (sizeof($var_linksList) >= 1) { ?>
<div id="navEZPagesTop">
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$active = '';
if($current_page_base == 'page') {
$active = ($_GET['id'] == $var_linksList[$i]['id'])? ' class="activeEZPage"': '';
}elseif ($var_linksList[$i]['altURL']) {//check for current page in alturl
$active = (strstr($var_linksList[$i]['altURL'],'main_page=' . $current_page_base))?' class="activeILPage"': '';
} ?>
<a href="<?php echo $var_linksList[$i]['link']; ?>"<?php echo $active; ?>><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i < $n ? EZPAGES_SEPARATOR_HEADER : '') . "\n"; ?>
<?php } // end FOR loop ?>
</div>
<?php } ?>
Re: #categories li a.cat-selected-text but for EZPAGES
Thank you very much for your help, Glenn.
It works for certain page but not all. Please see link below:
http://tinyurl.com/2c4jabc
"testimonials" works, but for "home" and "about us", it doesn't. Any clue why??
Thanks again for your effort. I really appreciate it!
Re: #categories li a.cat-selected-text but for EZPAGES
The home link is easy - that doesn't include a "main_page=" part, so is not being picked up. I can add a special check for that case.
The about us is puzzling, as it is an ez-page and essentially the same code apparently worked for Shane78. It would be helpful if you could add some debug code so we can see exactly what is happening there.
PHP Code:
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
$active = '';
if($current_page_base == 'page') {
$active = ($_GET['id'] == $var_linksList[$i]['id'])? ' class="activeEZPage"': '';
Change to
PHP Code:
<?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
echo ' $i='.$i.' current page='.$current_page_base;//debug
$active = '';
if($current_page_base == 'page') {
echo ' id='.$_GET['id'].' listid='.$var_linksList[$i]['id'];//debug
$active = ($_GET['id'] == $var_linksList[$i]['id'])? ' class="activeEZPage"': '';
This will output a line of text above the ez-page bar. Let me know when you have activated the debug code and I will look at it.
Re: #categories li a.cat-selected-text but for EZPAGES
Change
PHP Code:
}elseif ($var_linksList[$i]['altURL']) {//check for current page in alturl
$active = (strstr($var_linksList[$i]['altURL'],'main_page=' . $current_page_base))?' class="activeILPage"': '';
} ?>
to
PHP Code:
}elseif ($var_linksList[$i]['altURL']) {//check for current page in alturl
$active = (strstr($var_linksList[$i]['altURL'],'main_page=' . $current_page_base) or ((strstr($var_linksList[$i]['altURL'],'/index.php') == '/index.php') and ($current_page_base == 'index')))?' class="activeILPage"': '';
} ?>
This may still be subject to false positives with certain kinds of custom page names, so I will work on tightening it up; meanwhile this should work for common pages.