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 |
Moving to Custom Mods.
|
this is a good one. Somebody was going to charge me $100 for this. Thank you.
|
Wow, somebody was about to rip you off :(
|
You can also split your main categories menu similarly by using the
Code:
$categories[cat_num].category} http://ifgdesignz.com.au/home.php I can post the details if you want. vixnfox |
Yes, Please post the detail.
|
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:
{section name=cat_num loop=$categories} in home.tpl find Code:
{ include file="customer/categories.tpl" } Code:
This is photomenu.tpl Code:
* $Id: photo_menu.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *} The restoration part is not a category as such, and is added to home_main.tpl as a static page. Code:
{elseif $main eq "restoration"} vixnfox |
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.
|
do you know how to make the menu title itself become a link?
|
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:
.yourlink A:link { vixnfox |
All times are GMT -8. The time now is 10:39 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.