Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Single sideboxes in override folders

    I've created a new sidebox that will be in the site header. I tried putting the module file in modules/sideboxes/custom_template but quickly discovered that doesn't work. A single sidebox like the search_header has to be placed in the modules/sideboxes directory.

    Is it possible to do this with a single file? The regular sideboxes work fine with one only in an override folder. I really prefer to see it in an override directory so that I can find the non-default items easily.
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    What is the code you're using in the header to "call" the sidebox so that it gets displayed? Maybe that's what needs some adjusting to allow it to work with override folders?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Single sideboxes in override folders

    It's just checking to see if certain fields are empty or not. Without any check at all (like removing the check statement from search_header), it just displays whether turned on or off. Totally different from the normal sideboxes.

    PHP Code:
    $check_query "select count(*) as count
                          from " 
    TABLE_CONFIGURATION ."
                          where configuration_group_id = "
    . (int)$smgroupid .
                          and ((configuration_key = 'BOX_LINKEDIN_URL' and `configuration_value` != '') .....)"
    ;

          
    $check $db->Execute($check_query);

          if (
    $check->fields['count'] > 0) {
            
    $show_sm_box_headertrue;
          }

     if (
    $show_sm_box_header == true) {
          require(
    $template->get_template_dir('tpl_sm_box_header.php',DIR_WS_TEMPLATE$current_page_base,'sideboxes').      '/tpl_sm_box_header.php');
          
    $title '<label>' BOX_HEADING_SOCIALMEDIA '</label>';
          
    $title_link false;
          require(
    $template->get_template_dir('tpl_box_header.php'DIR_WS_TEMPLATE$current_page_base,'common') . '/tpl_box_header.php' .      $column_box_default);
     } 
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    That extra ". $column_box_default" at the end of that last line shouldn't be there.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    Then try changing the line in tpl_header.php from this:

    Code:
    <div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
    to this:
    Code:
    <div id="navMainSearch"><?php require(DIR_WS_MODULES . zen_get_module_directory('search_header.php')); ?></div>
    (of course replacing 'search_header.php' with the name of your sidebox module)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Single sideboxes in override folders

    uh, it's a sidebox? That only looks in the module directory, not the subdirectories like sideboxes
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    Quote Originally Posted by delia View Post
    uh, it's a sidebox? That only looks in the module directory, not the subdirectories like sideboxes
    And the processing-logic to generate a sidebox is driven by a module in the modules directory. That's why I used the search_header sidebox as an example.

    Although I suppose if you've totally skipped using a module file and dropped the module's code directly into your template, then you're bypassing all of that. In which case the change I suggested is irrelevant.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,371
    Plugin Contributions
    23

    Default Re: Single sideboxes in override folders

    okay, let's go back a bit.

    All I want to do is put a sidebox into the sideboxes override directory without loading one also in the sideboxes directory. That doesn't seem possible. I changed the file as you said but it only looks in the modules directory - not the overrides. So it just looks like you have to have one in both places for the overrides directory to work for sideboxes.

    If I change the search header to the same code
    PHP Code:
    <?php require(DIR_WS_MODULES .zen_get_module_directory('search_header.php')); ?>
    I get: PHP Warning: require(includes/modules/search_header.php) So that logic doesn't work for the search_header sidebox
    The full-time Zen Cart Guru. WizTech4ZC.com
    New template for 2.0 viewable here: 2.0 Demo

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    Hmmm, will have to do some more digging ...
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Single sideboxes in override folders

    If you have a "copy" of the tpl_sm_whatever.php in the main sideboxes dir (as if it were one of the originals in core), does the override work then?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v155 Template override folder within folders question
    By oavs in forum General Questions
    Replies: 2
    Last Post: 20 Jul 2016, 12:59 PM
  2. Override folders not showing up in WinMerge
    By WhitePhantom in forum Upgrading to 1.5.x
    Replies: 7
    Last Post: 8 Mar 2012, 04:30 PM
  3. Help, I still don't understand override folders
    By paulclane in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 23 Nov 2011, 09:40 PM
  4. Custom Override Folders
    By beth99 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 9 Nov 2006, 03:12 PM
  5. Location of override folders
    By Sermonzone in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 14 May 2006, 02:17 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