Jump to content

Search the Community

Showing results for tags 'joomla php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I am very new to php, so would appreciate any advice with this probably very noob question. I need to moderate - make an alternate - joomla module menu php file which adds a <span> tag to the output. I have added the <span> but it is not in the right position. I can only get it either before or after the anchor tag, not in between as needed. The HTML output for the menu and one menu item is: <ul id="mainNav" class="nav menu "> <li class="item-435"> <span></span> <a href="/testserver/joomla/dev">Development</a> </li> </ul> I need the <span> tag inside the anchor tag in order for my background hover and link function to work correctly, like this: <ul id="mainNav" class="nav menu "> <li class="item-435"> <a href="/testserver/joomla/dev">Development<span></span></a> </li> </ul> Can anyone help me?? This is the current php code for the module (which gives the wrong <span> placement): <?php /** * @package Joomla.Site * @subpackage mod_menu * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; // Note. It is important to remove spaces between elements. ?> <?php // The menu class is deprecated. Use nav instead. ?> <ul class="nav menu <?php echo $class_sfx;?>"<?php $tag = ''; if ($params->get('tag_id') != null) { $tag = $params->get('tag_id').''; echo ' id="'.$tag.'"'; } ?>> <?php foreach ($list as $i => &$item) : $class = 'item-'.$item->id; if ($item->id == $active_id) { $class .= ' current'; } if (in_array($item->id, $path)) { $class .= ' active'; } elseif ($item->type == 'alias') { $aliasToId = $item->params->get('aliasoptions'); if (count($path) > 0 && $aliasToId == $path[count($path) - 1]) { $class .= ' active'; } elseif (in_array($aliasToId, $path)) { $class .= ' alias-parent-active'; } } if ($item->type == 'separator') { $class .= ' divider'; } if ($item->deeper) { $class .= ' deeper'; } if ($item->parent) { $class .= ' parent'; } if (!empty($class)) { $class = ' class="'.trim($class) .'"'; } echo '<li'.$class.'><span></span>'; // Render the menu item. switch ($item->type) : case 'separator': case 'url': case 'component': case 'heading': require JModuleHelper::getLayoutPath('mod_menu', 'default_'.$item->type); break; default: require JModuleHelper::getLayoutPath('mod_menu', 'default_url'); break; endswitch; // The next item is deeper. if ($item->deeper) { echo '<ul class="nav-child unstyled small">'; } // The next item is shallower. elseif ($item->shallower) { echo '</li>'; echo str_repeat('</ul></li>', $item->level_diff); } // The next item is on the same level. else { echo '</li>'; } endforeach; ?></ul> I have tried messing around with the <span> tags but just can't make it work.. I would really appreciate any help. Thanks in advance!!! /Soren
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.