Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default CEON URI with custom sidebox , embedded links not "working" but did

    This thread was started to move conversation away from the originating thread as the issue does not apply specifically to the originating thread.

    Quote Originally Posted by kitten091182 View Post
    Hi, thanks for all your suggestions. I'm not saying that there is anything wrong with the CEON module, just that because CEON is rewriting the URL it has caused me a problem with that line of code. I am fully aware that my code needs to be changed to suit how CEON works, but as I do not know that much about coding I thought this would be the best place to ask as somebody may know how CEON is interpreting the statement so I may find a solution. There is nothing wrong with the module it is referring to either, the code was placed there by myself. I have an editable sidebox which shows on all my category and product pages. I placed a link in that sidebox to point to a different page of my knowledgebase depending on which category/product is being shown. That link is in this line of code: elseif ($_GET['cPath'] == '30') {
    $content = '<div class="adlink"><a href="http://www.drgreens.co.uk/index.php?...qs_id=5">Odour Control</a></div>'; One of my pages is here: http://www.drgreens.co.uk/Grow-Media/Coco You can see the sidebox on the right (advice centre) All i'm asking for is some help as to what the correct line of code would be now that the URL is being re-written? I'm not criticizing the CEON module, i'm just trying to figure out how to overcome its feature when it comes to calling up pages that have had the URL re-written. I'm not a coder, i'm not even sure how the code I have got used to worked, all I know is it used to work and now it doesn't.
    Quote Originally Posted by mc12345678 View Post
    Where you have the text: href= "http://www drgreens co uk/index.php?main_page=faq_info&fcPath=4&faqs_id=5" (periods replaced with spaces for website formatting) replace with:
    "<?php zen_href_link('faq_info', '&fcPath=4&faqs_id=5', $get_type); ?>"
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    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 though I 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?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    Quote Originally Posted by kitten091182 View Post
    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 though I 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...

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    Quote Originally Posted by kitten091182 View Post
    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 though I 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?

    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...

  5. #5

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    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:
    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>';
    ?>
    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?

  6. #6
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    Quote Originally Posted by kitten091182 View Post
    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:
    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>';
    ?>
    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 (
    $_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...

  7. #7

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    It doesn't work It'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

  8. #8
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    Quote Originally Posted by kitten091182 View Post
    It doesn't work
    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

  9. #9
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    Quote Originally Posted by lhungil View Post
    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') {
    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...

  10. #10

    Default Re: CEON URI with custom sidebox , embedded links not "working" but did

    I havent been in the office today so ill take a look in the morning. Thanks for your help so far

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Ceon URI Mapping (SEO) with Custom Pages
    By p-plater in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 31 Mar 2014, 04:42 PM
  2. v150 "Ceon URI Mapping": show the manufacturer name on urls of products pages
    By matteoraggi in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Oct 2012, 02:16 PM
  3. Lite red template not showing "important links" sidebox
    By ambitn in forum Addon Templates
    Replies: 7
    Last Post: 7 Jun 2010, 03:19 PM
  4. Custom "Add To Cart" button not working with attributes in product listing
    By DrLivingston in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 7 Dec 2009, 10:09 PM
  5. The "Home" links not working
    By bluealice in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 25 Sep 2007, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg