Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default Custom menu with PHP variables

    Hi, thanks for all the tips I previously had from this forum. I have now one question about a custom menu in my store.
    So far all is ok, you can see here: www.pawanpatsilver.com What I wish to do is set a 2nd language and there I have a problem...
    The menu tabs in the shop was built using Sliding Doors of CSS, I then saved it in: templates/MY_TEMPLATE/common/menu1.php
    Inserted a line in templates/MY_TEMPLATE/common/tpl_header with: <?php include_once("tpl_menu1.php") ?> to show the menu.
    I customized: language/english/MY_TEMPLATE/header, to show the correct tag using the zen call system: define('MENU_ONE', 'Earrings');, menu two..ecc.

    If I want to add a new language I can customize all except the most important for a menu.. the destination link!

    My idea was to insert a php variable to call a new file with a new menu and different links according to the language in use.
    [FONT=Arial, Helvetica, sans-serif][FONT=Arial]Something like...
    [/FONT]
    [/FONT]If (<language id en>) {
    <echo menu_one>
    } else {
    <echo menu...>
    } I don't know if that is possible, anyway I am not sure about the correct sintax because I am new to all this. I will apreciate any help in this matter.
    Also few more things.. Adding new files can be some how dangerous in terms of security?!?
    Is there any way to have a different style for the active tab?
    Thank you again for your time

  2. #2
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: Custom menu with PHP variables

    Just to say that I find the answer inside a previous post, and is working!
    So I want to share, in case someone is looking for the same answer.

    Example to call a different file according to language session:

    <div id="menu">
    <?php
    if ($_SESSION['language'] == "english"){
    include_once("tpl_menuxxx.php") ;
    }
    else {
    include_once("tpl_menuyyy.php");
    }
    ?>
    </div>


    This will give you the chance to customize all the links...
    I assume can be used for banners too, but not sure how.

    Regards

  3. #3
    Join Date
    Jan 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Custom menu with PHP variables

    Dude, thanks a lot for this hint! I used it! ;)

 

 

Similar Threads

  1. Single products with drop down menu variables
    By lapitis in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 2 Dec 2014, 08:18 PM
  2. Dropdown Menu Variables
    By Skyland in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Feb 2014, 01:55 PM
  3. My Custom Menu not displyed on PHP 5.3
    By solo_400 in forum General Questions
    Replies: 2
    Last Post: 6 Feb 2010, 02:57 PM
  4. Problem with custom drop down menu
    By christianpatrick in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Jan 2009, 05:42 PM
  5. Want to replace navMainWrapper with custom css menu
    By canemasters in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Aug 2008, 06:45 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