ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Hi, thanks for starting a new thread for me, appreciate it. I'm not sure now I'm going about my problem in the right way thoughI tried what you suggested but it didn't work. I need it to work in the same way as the code in the main page common template works, ie. if it is a certain page, don't display certain sidebox for example, so my instance would be: if it is odour control page (cpath 30) display following link. Would it be the use of the GET statement that is causing issues because of the URL rewrite?
So as posted by others in the originating thread, I was told that I was wrong in stating that the GET statement was an issue. The data associated with the GET is supposed to still present as part of the page. When I had followed the link to the page provided, the link that appeared in the right side box went to the faq; however, it did not go to the address that you have described above.
When you say that this is not working, what is it that you are getting that do not expect, or not getting that you do expect?
Is anything that is within the if statement shown and it is just that the link doesn't go to where you expect? Or is there nothing that appears? (Have only seen a portion of the sidebox code, and not sure that a specific/direct link has been provided to the area of trouble.)
Is an error generated as a result of the code (that I provided the wrong statement(s))? If so, what is the error?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Ohh, maybe you did exactly as I said... :) Oops. The only portion of the line that should be replaced is everything that is in quotes not the href= part... should read:
elseif ($_GET['cPath'] == '30') {
$content = '<div class="adlink"><a href="<?php zen_href_link('faq_info', '&fcPath=4&faqs_id=5', $get_type); ?>">Odour Control</a></div>';
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Hi, Tried the code you gave me and the sidebox doesn't show at all with that. The full code from the editable sidebox is:What should happen is, when somebody is on a page other than cpath 30 or 75, the sidebox will show a link to the advice centre (which it is showing), but when the customer is on either page with cpath 30 or 75, it will show the links I have specified above, but it isn't showing them. At the moment it is ignoring those statements, and continuing to show the link to the advice centre. It worked before I installed CEON so i'm guessing its because of the URL rewrites?PHP Code:<?php
/**
* editable sidebox - allows a sidebox editable with the define pages editor to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
if ($_GET['cPath'] == '75') {
$content = '<div class="adlink"><a href="http://www.drgreens.co.uk/index.php?main_page=faq_info&fcPath=3&faqs_id=3">Summer Growing</a></div><div class="adlink"><a href="http://www.drgreens.co.uk/index.php?main_page=faq_info&fcPath=4&faqs_id=5">Odour Control</a></div>';
} elseif ($_GET['cPath'] == '30') {
$content = '<div class="adlink"><a href="http://www.drgreens.co.uk/index.php?main_page=faq_info&fcPath=4&faqs_id=5">Odour Control</a></div>';} else {
$content = file_get_contents($define_sidebox);
}
// this is where the content that you have via the Admin is pulled in.
$content .= '</div>';
?>
PHP Code:<?php
/**
* editable sidebox - allows a sidebox editable with the define pages editor to be added to your site
*
* @package templateSystem
* @copyright 2007 Kuroi Web Design
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: blank_sidebox.php 2007-08-10 kuroi $
*/
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
if ($_POST['cPath'] == '75') {
$content = '<div class="adlink"><a href="' . zen_href_link('faq_info', '&fcPath=3&faqs_id=3', $get_type) . '">Summer Growing</a></div><div class="adlink"><a href="' . zen_href_link('faq_info', '&fcPath=4&faqs_id=5', $get_type) . '">Odour Control</a></div>';
} elseif ($_POST['cPath'] == '30') {
$content = '<div class="adlink"><a href="' . zen_href_link('faq_info', '&fcPath=4&faqs_id=5', $get_type) . '">Odour Control</a></div>';
} else {
$content = file_get_contents($define_sidebox);
}
// this is where the content that you have via the Admin is pulled in.
$content .= '</div>';
?>
So, yet again I had made an error in the format of the statement; however... As you have stated, the "default" content is being shown and not replaced by the information within the if statements.
Try changing it to the above and see if the POST works, as well as the now (finally) properly formatted links..
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
It doesn't workIt's still showing the default link and not changing. I was thinking of maybe trying a different way to get it to display, by adding extra description fields to the products/categories in admin, then having the editable sidebox call the information in that field? I'm thinking that may be easier as it doesn't involve hard coding each statement into the sidebox. On this page I've added it under more information:http://www.drgreens.co.uk/Environmen...-Odour-Control And it is called in the product_info template with this statement: <?php if($extra_field!='') {
echo '<li>'.$extra_field . '</li>';
} ?> Can't figure out how to get the sidebox to call it though. Do you think that way would work better? Still not sure what is going on with the URL rewrite not allowing me to call it though. My mind is boggled![]()
Let's start by checking variables. Let's output inside the sidebox the content of some variables (so you can visible see what is populated and what is in the actual variables when browsing your site). You will not want to use / leave these code changes on a production site.
Add the stuff in red to the START of the file:
Code:<?php /** * editable sidebox - allows a sidebox editable with the define pages editor to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-08-10 kuroi $ */ $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; // Let's see what is currently in $current_page and $cPath ?><div>Current Page: <?php echo $current_page; ?></div> <div>Current cPath: <?php echo $cPath; ?></div><?php // Let's see what is currently populated in $_GET ?><pre><?php var_dump($_GET); ?></pre><?php if ($_POST['cPath'] == '75') {
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
And by the way, I used Super Globals on my own site, and saw that the $_GET is populated with cPath even though I too have the CEON URI installed... So the method recommended by lhungil should reveal the information necessary to get through this. Although I had started this response yesterday, I hadn't finished it until now... Any luck with getting your sidebox to work?
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
I havent been in the office today so ill take a look in the morning. Thanks for your help so far