| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to Add a Simple Custom Menu | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to Add a Simple Custom Menu
Might be worthy of a sticky considering all the requests *tap tap mods? *
Adding A Custom Menu Add a basic menu tab to LH menu structure. Here is what I "created" for jewellery store. I know the end result could have been achieved using static pages, but I needed the challenge! I wanted a "Jewellery FAQs" Menu Decide on names: Jewellery FAQs - Menu name Swarovski Crystals - Menu Entry Create: admin Languages lbl_faqmenu_content name FAQ Menu Content, Value Jewellery FAQs lbl_faqmenu_swarovski name Swarovski FAQ, Value Swarovski Crystals Create a folder "ourpages" under skin1 (just to keep all your own stuff together) We need 4 files all up, 2 for xcart setup, then 2 for each menu entry skin1\ourpages - faqs.tpl, faqs_menu.tpl, swarovski.tpl xcart root - swarovski.php ( I tried putting the .php file in xcart\customer, but every time I used the link, it changed all the other menu links from "xcart\" to "\xcart\customer" until I hit the back button or clicked "Home". Any Ideas why???) 1. Files to modify: skin1\customer\home.tpl add this line above or below the include help.tpl line {include file="ourpages/faqs.tpl" } skin1\customer\home_main.tpl add this line somewhere {elseif $main eq "swarovski" } {include file="./ourpages/swarovski.tpl" } 2. faqs.tpl in ourpages. This is the menu {capture name="menu"} {include file="ourpages/faqsmenu.tpl"} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_faqmenu_content menu_content=$smarty.capture.menu } 3. faqs_menu.tpl in ourpages. These are the menu entries (one here only) {* $Id: faqs_menu.tpl *} {$lng.lbl_faqmenu_swarovski} 4. swarovski.php in xcart root (see why above) <?php # $Id: swarovski.php # require "./auth.php"; require $xcart_dir."/include/categories.php"; $smarty->assign("main","swarovski"); $location[] = array(func_get_langvar_by_name("lbl_faqmenu_swarovski", "")); # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?> 6. swarovski.tpl in ourpages. This is the content. Good Idea to save an "Empty" one to use as a dummy template for other entries. {* $Id: swarovski.tpl *} {include file="page_title.tpl" title=$lng.lbl_faqmenu_swarovski} <!-- this table just adds an image and description of the page and is optional <TABLE cellpadding="5"> <TR> <TD>[img]{$ImagesDir}/swarovski.jpg[/img]</TD> <TD> {$lng.txt_swarovskiheader} </TD></TR> </TABLE> --> {capture name=dialog} First a link to Swarovski Crystals ---- its in German !!!</h6> <a href = "http://www.swarovski.com/index/" target="_blank">Swarovski Crystals</a> etc ............................ {/capture} {include file="dialog.tpl" title=$lng.lbl_faqmenu_swarovski content=$smarty.capture.dialog extra="width=100%"} There. I hope someone finds this information useful. vixnfox
__________________
V 4.3.1 Live: Developing on PHP 5.3.0 MySQL server 5.0.75-community-log MySQL client 5.1.36 Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 Windows 7 64bit on a Toshiba Satellite P500 ADELAIDE, SOUTH AUSTRALIA |
|||||||
#2
|
|||||||
|
|||||||
Moving to Custom Mods.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
this is a good one. Somebody was going to charge me $100 for this. Thank you.
__________________
x cart 4.4.3 gold Unix U.S.A |
|||||||
#4
|
|||||||
|
|||||||
Wow, somebody was about to rip you off
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
You can also split your main categories menu similarly by using the
Code:
http://ifgdesignz.com.au/home.php I can post the details if you want. vixnfox
__________________
V 4.3.1 Live: Developing on PHP 5.3.0 MySQL server 5.0.75-community-log MySQL client 5.1.36 Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 Windows 7 64bit on a Toshiba Satellite P500 ADELAIDE, SOUTH AUSTRALIA |
|||||||
#6
|
|||||||
|
|||||||
Yes, Please post the detail.
__________________
x cart 4.4.3 gold Unix U.S.A |
|||||||
#7
|
|||||||
|
|||||||
Splitting the category menu
Following on from above:
If you follow the link, here is how I made the photography menu. Add the category as usual using Admin, it appears in the main category menu on the left. Exclude the Photography and Restoration menus from categories.tpl Code:
in home.tpl find Code:
Code:
This is photomenu.tpl Code:
The restoration part is not a category as such, and is added to home_main.tpl as a static page. Code:
vixnfox
__________________
V 4.3.1 Live: Developing on PHP 5.3.0 MySQL server 5.0.75-community-log MySQL client 5.1.36 Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 Windows 7 64bit on a Toshiba Satellite P500 ADELAIDE, SOUTH AUSTRALIA |
|||||||
#8
|
|||||||
|
|||||||
thank you very much. I have already shared this code with other newbies. We were frustrated of not being able to add things on to the menu in the beginning.
__________________
x cart 4.4.3 gold Unix U.S.A |
|||||||
#9
|
|||||||
|
|||||||
do you know how to make the menu title itself become a link?
__________________
x cart 4.4.3 gold Unix U.S.A |
|||||||
#10
|
|||||||
|
|||||||
you can make the label a link in Languages ie:
Photography but you might want to make the <a> tag a css class and make the visited link the same colour as the link itself. eg: Photography Code:
vixnfox
__________________
V 4.3.1 Live: Developing on PHP 5.3.0 MySQL server 5.0.75-community-log MySQL client 5.1.36 Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 Windows 7 64bit on a Toshiba Satellite P500 ADELAIDE, SOUTH AUSTRALIA |
|||||||
|
|||
X-Cart forums © 2001-2020
|