Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Posts
    12
    Plugin Contributions
    0

    help question moving sidebox elements to main page template

    I want to move languages and search so that they are not in the side column, but at the top of the tpl_main_page (not header).

    I tried copying the code from sideboxes/tpl_search.php but it is ignored - what should I do?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: moving sidebox elements to main page template

    If you take a look at the language/currency links in header mod, this explains how to put content from those sideboxes in the header. The same approach will work for putting this content in the main area of the page. And a similar approach should also work for the search bar (though putting this in the main body of the page sounds a little odd).
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: moving sidebox elements to main page template

    ... you can also turn on the search bar in the header by enabling search_header in Admin->Tools->Layout Boxes Controller.
    Granted, this assumes that your template contains the code that can be thus enabled. Some "purchased" templates are missing that component, in which case you'll have to do manual coding.
    .

    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.

  4. #4
    Join Date
    Jun 2005
    Posts
    12
    Plugin Contributions
    0

    Default Re: moving sidebox elements to main page template

    Where are you referring to by
    Quote Originally Posted by kuroi View Post
    the language/currency links in header mod
    Can you give me a full pathname? I saw no header module in /includes/modules/

    The only aspect of the header with whih I am familiar are in /templates/[templatename]/common/tpl_header.php and I saw no references to language/currency links there

  5. #5

    Default Re: moving sidebox elements to main page template

    Hi,

    I'm looking to move my currencies and shopping basket out of their sideboxes and into the Header, but I've searched and searched but can't find out how to do the 'includes' coding.

    Please help...
    Jamie
    Jamie

  6. #6
    Join Date
    Jun 2005
    Posts
    12
    Plugin Contributions
    0

    Default Re: moving sidebox elements to main page template

    Here's what I found out so far


    link to english:
    <a href="<? echo zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=en&currency=USD', $request_type); ?>">english</a>

    link to hebrew:
    <a href="<? echo zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=he&currency=ILS', $request_type); ?>">hebrew</a>

    these links change both the language and currency, if you want to change one, just omit the part you don't want like "&currency=XXX" part

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: moving sidebox elements to main page template

    Quote Originally Posted by [email protected] View Post
    I'm looking to move my currencies and shopping basket out of their sideboxes and into the Header, but I've searched and searched but can't find out how to do the 'includes' coding.
    Here's a snippet of code that I have used recently on a site to place the shopping cart in the header
    PHP Code:
    <ul id="cart">
    <?php
      
    // replace by image
      
    echo '<li><a class="imgButton" href="' zen_href_link(FILENAME_SHOPPING_CART'''NONSSL') . '">' HEADER_TITLE_CART_CONTENTS '</a></li>' "\n";
      
    $num_items $_SESSION['cart']->count_contents();
      echo 
    '<li>' $num_items . ($num_items != HEADER_CART_ITEMS HEADER_CART_ITEM) . '</li>' "\n";
         
    $header_cart $currencies->format($_SESSION['cart']->show_total());  
        echo 
    '<li>' $header_cart '</li>' "\n";
      if (
    $num_items 0) {
          echo 
    '<li class="button"><a href="' zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL') . '">' HEADER_TITLE_CHECKOUT '</a></li>';
      }
    ?>
    </ul>
    You would need to style the items to have them appear as you wish. In the above example I used a background image for the shopping cart and styled the checkout link to look like a button.

    To put language links in the header there is an add-in module available.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 

Similar Threads

  1. v150 Trying to create a single PHP page with ajax without template elements
    By ailtait in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Aug 2012, 05:07 PM
  2. Removing Elements on Main Page Only
    By Craig Robbo in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 11 Dec 2008, 04:55 AM
  3. Moving Elements on Product Page
    By Giro26 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Aug 2008, 05:45 PM
  4. Changing Main Nav Elements, Template Monster Template
    By maland in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Apr 2007, 11:01 PM
  5. Header overlapping main page elements...?
    By LloydDobbler in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 2 Apr 2007, 04:10 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