Jump to content
Latest News: (loading..)

rebelsheep

Members
  • Content count

    28
  • Joined

  • Last visited

  1. rebelsheep

    Creating New Navbar above Existing Navbar

    YES!! That works. Thank you for your help JcMagpie. I think I have just written my first (very simple) OSCommerce module. :-)
  2. rebelsheep

    Creating New Navbar above Existing Navbar

    And the parameters for NBRMenu will then be created.
  3. rebelsheep

    Creating New Navbar above Existing Navbar

    I think I know the problem. Install() hasn't run to create the parameters. Because I installed it with the breadcrumb parameters. So I need to unistall it them install it again so Install runs.
  4. rebelsheep

    Creating New Navbar above Existing Navbar

    I tried the Megamenu but it wouldn't work - installed ok in Amin, enabled it - but doesn't show in front end. Also it doesn't do what I want - it replicates the Category structure which I don't want to do. ... I still get blank SortOrder and blank parameters with cm_header_nbrmenu.php
  5. rebelsheep

    Creating New Navbar above Existing Navbar

    Thank you. See attached. Just one file - cm_header_nbrmenu.php in catalog\includes\modules\content\header. Not sure if I need other supporting files. cm_header_nbrmenu.zip
  6. rebelsheep

    Creating New Navbar above Existing Navbar

    So I am assuming something is wrong in function install()
  7. rebelsheep

    Creating New Navbar above Existing Navbar

    It worked when I changed the code in execute - and without further editing it was using the parameters from BREADCRUMB (because this was the file I copied). So now tried to give it it's own parameters - just enabled/disabled, SortOrder. But in Admin these values remain blank. What else do I need to do so values/parameters for this module are stored in the database? Here is the code: class cm_header_nbrmenu { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = "Notebook Repair Menu"; $this->description = "Notebook Repair Custom"; if ( defined('MODULE_CONTENT_HEADER_NBRMENU_STATUS') ) { $this->sort_order = MODULE_CONTENT_HEADER_NBRMENU_SORT_ORDER; $this->enabled = (MODULE_CONTENT_HEADER_NBRMENU_STATUS == 'True'); } } function execute() { global $oscTemplate; $mymenu = "<nav class='navbar navbar-expand-lg navbar-light bg-light'>"; $mymenu .= "<div class='collapse navbar-collapse' id='navbarSupportedContent'>"; $mymenu .= "<ul class='navbar-nav mr-auto'>"; $mymenu .= "<li class='nav-item dropdown nr-nav'>"; $mymenu .= "<a class='nav-link dropdown-toggle' href='#' id='navbarDropdown' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>"; $mymenu .= "Autocab"; $mymenu .= "</a>"; $mymenu .= "<div class='dropdown-menu' aria-labelledby='navbarDropdown'>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab PDAs</a>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab Phones</a>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab Radios</a>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab Mobile Data Terminals</a>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab Tablets</a>"; $mymenu .= "<a class='dropdown-item nr-nav' href='#'>Autocab Accessories</a>"; $mymenu .= "</div>"; $mymenu .= "</li></ul></div></nav>"; $oscTemplate->addContent($mymenu, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_HEADER_NBRMENU_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header NBRMenu Module', 'MODULE_CONTENT_HEADER_NBRMENU_STATUS', 'True', 'Do you want to enable the NBRMenu content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_NBRMENU_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_HEADER_NBRMENU_STATUS', 'MODULE_CONTENT_HEADER_NBRMENU_SORT_ORDER'); } }
  8. rebelsheep

    Creating New Navbar above Existing Navbar

    Cool. That works - kind of. Just need to get my head around parameters etc. for the install.
  9. rebelsheep

    Creating New Navbar above Existing Navbar

    $oscTemplate->addContent($mymenu, $this->group);
  10. rebelsheep

    Creating New Navbar above Existing Navbar

    And I put my custom code in execute() global $oscTemplate; $mymenu = "<nav class='navbar navbar-expand-lg navbar-light bg-light'>"; $mymenu = $mymenu . " <div class='collapse navbar-collapse' id='navbarSupportedContent'>"; $mymenu = $mymenu . " <ul class='navbar-nav mr-auto'>"; $mymenu = $mymenu . "<li class='nav-item dropdown nr-nav'>"; $mymenu = $mymenu . "<a class='nav-link dropdown-toggle' href='#' id='navbarDropdown' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>"; $mymenu = $mymenu . "Autocab"; $mymenu = $mymenu . "</a>"; $mymenu = $mymenu . "<div class='dropdown-menu' aria-labelledby='navbarDropdown'>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab PDAs</a>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab Phones</a>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab Radios</a>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab Mobile Data Terminals</a>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab Tablets</a>"; $mymenu = $mymenu . "<a class='dropdown-item nr-nav' href='#'>Autocab Accessories</a>"; $mymenu = $mymenu . "</div>"; $mymenu = $mymenu . "</li></ul></div></nav>"; $oscTemplate->addContent($mymneu, $this->group);
  11. rebelsheep

    Creating New Navbar above Existing Navbar

    Actually will use the breadcrumb as the template - in \includes\modules\content\header
  12. rebelsheep

    Creating New Navbar above Existing Navbar

    So i just copy an existing module in includes/modules. So for example I copy nb_currencies.php And then when I edit it - it needs all the functions: function __construct() function getOutput() function isEnabled() function check() function install() function remove() function keys() ? And in which of the functions would I put the custom code? Thank you for your help, still learning.
  13. rebelsheep

    Creating New Navbar above Existing Navbar

    Ok, thanks, I will give it a go.
  14. rebelsheep

    Creating New Navbar above Existing Navbar

    Or should I be inserting my custom code in to the website by creating my own modules?
  15. rebelsheep

    Creating New Navbar above Existing Navbar

    Is it possible to insert this code for this dropdown menu further down the page? Underneath the crumb?
×