Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / moving sidebox elements to main page template

moving sidebox elements to main page template

Locked

Views: 1,851

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
17 Sep 2007, 3:42 PM
#1
ckalech avatar

ckalech

New Zenner

Join Date:
Jun 2005
Posts:
11
Plugin Contributions:
0

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?

17 Sep 2007, 3:55 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

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)

17 Sep 2007, 4:14 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.

18 Sep 2007, 7:24 AM
#4
ckalech avatar

ckalech

New Zenner

Join Date:
Jun 2005
Posts:
11
Plugin Contributions:
0

Re: moving sidebox elements to main page template

Where are you referring to by

kuroi:

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

26 Sep 2007, 10:25 AM
#5
jamie_prismart_com avatar

jamie_prismart_com

New Zenner

Join Date:
Oct 2004
Posts:
34
Plugin Contributions:
0

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

26 Sep 2007, 11:59 AM
#6
ckalech avatar

ckalech

New Zenner

Join Date:
Jun 2005
Posts:
11
Plugin Contributions:
0

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

28 Sep 2007, 9:49 PM
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: moving sidebox elements to main page template

[email protected]:

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

<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 != 1 ? 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)