• DEVHIDE
    • Home (current)
    • About
    • Contact
    • Cookie
    • Home (current)
    • About
    • Contact
    • Cookie
    • Disclaimer
    • Privacy
    • TOS
    Login Or Sign up

    joomla 1.5 give every menuitem the class of its alias

    844 Views Asked by eyeonu At 28 January 2011 at 10:17 2025-12-03T08:33:56.661000

    Is there a way to render the alias e.g. 'hidden' of a menu item in the list output of the menu. (Joomla 1.5)

    <ul class="topnav">
    <li class="item1 menualias">link</li>
    <li class="item2 parent active menualias">link</li>
        <ul class="sublevel01">
        <li class="item1 menualias">link</li>
        <li class="item2 active menualias">link</li>
        <li class="item3  menualias">link</li>
        <li class="item4 menualias-is-hidden">link</li>   <- this item should not be visible but its childs
          <ul class="sublevel03">
            <li class="item1 menualias">link</li>
            <li class="item2 menualias">link</li>
            <li class="item3 menualias">link</li>
           </ul>
    
        </ul>
    <li class="item3 menualias">link</li>
    </ul>
    

    Best Regards Nico

    css class joomla1.5 alias menuitem
    Original Q&A
    2

    There are 2 best solutions below

    0
    Brent Friar Brent Friar On 28 January 2011 at 14:31

    It's technically possible to add the menu alias as a class to each menu item, it can be done with an override by editing JOOMLA/modules/mod_mainmenu/tmpl/default.php and saving it as JOOMLA/templates/YOUR TEMPLATE/mod_mainmenu/default.php. The example you indicated above would not work however, there is an error in your code. The way unordered lists work, a child list is contained within the parent list item. You have:

    <li class="item4 menualias-is-hidden">link</li>   <- this item should not be visible but its childs
      <ul class="sublevel03">
        <li class="item1 menualias">link</li>
        <li class="item2 menualias">link</li>
        <li class="item3 menualias">link</li>
       </ul>
    

    It should be:

    <li class="item4 menualias-is-hidden">link   <- this item should not be visible but its childs
      <ul class="sublevel03">
        <li class="item1 menualias">link</li>
        <li class="item2 menualias">link</li>
        <li class="item3 menualias">link</li>
       </ul>
    </li>
    

    If you make the parent hidden, then all of it's children will be hidden as well. Not really sure the purpose of adding the menu alias because the item# is unique to a menu item. Anything you would apply to the class menualias could also be applied to item# with the added advantage that the there are no duplicates. Menu alias does not have to be unique so you could run in to problems.

    0
    eyeonu eyeonu On 30 January 2011 at 14:17

    thanks for youre answwer. You're right usally the submenu will disapear if I display:none the parent. But if I use a Splitmenu (what I do) it works.

    And you're right, I could use the itemid do disable the menuitem but if someone alter the strukture of the Menu I have to go into css file again. So I thought its better to use some information I can attach to the menuitem in the backend. (like alias).

    multiple aliase shouldnt be a problem because I use them as class

    Related Questions in CSS

    • CSS Class is not applying to element (border width,color,and style attributes)
    • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
    • Positioning child at bottom of parent with scroll
    • Play multiple audio files in a slider
    • How to set text over image?
    • Website zoomed out on Android default browser
    • Writing/Overwriting to specific XML file from ASP.NET code behind
    • My navbar is not expanding after collapse
    • when a checkbox is checked how to display a different hidden element using javascript
    • Gaps Vertically Using Dividers
    • CSS: Preventing a property to affect on element until the end of transition
    • Polygon Button with pure CSS
    • transform-origin doesnt apply in safari
    • show/hide multiple div tags at once and change the size of the remaining div tag
    • Mask the image/maps/div (circle) using css and jquery

    Related Questions in CLASS

    • Access objects variable & method by name
    • Pass variables to extended class
    • Threading Segfault when reading members
    • __PHP_Incomplete_Class Object even though class is included before session started
    • How to declare a class with a constructior outside of a function C++
    • ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
    • Java: set and get methods for strings
    • Allow extension of class by injection of user-made subclass, while preserving accessibility
    • Efficiency penalty of initializing a struct/class within a loop
    • Possible to add a new class that can be cast to an existing final class?
    • introduce c++ into html
    • how can Object class in ruby be an instance of it's subclass, class "Class"
    • Class enumerator values cannot be passed as parameters to another class's function
    • Passive Objects in C++
    • open class or implicit class in java

    Related Questions in JOOMLA1.5

    • Google ReCaptcha reload button does not work in Joomla 1.5
    • Joomla 1.5, Virtuemart 1 - Products are not being added to the cart if they have attributes set in the "product status" section
    • Small images getting behind the left module of the web site product page
    • Joomla UTF-8 encoding fails on opening the mail
    • Joomla - Updating a table field with variable from another SELECT query
    • Getting Encoding Issue Even when Header to Set UTF-8 is Used
    • Joomla 1.5 : How to find number of concurrent / active users in my joomla based intranet system
    • Using opendir with PHP Pages Component for Joomla 1.5
    • Joomla plugins get regularly disabled
    • what is the use of access column in joomla1.5
    • how to get image-reflection in joomla?
    • joomla 1.5 give every menuitem the class of its alias
    • how to send email in joomla if my webpage is run on localhost?
    • HTML code not working correctly in Joomla1.5
    • Joomla and Movable Type API

    Related Questions in ALIAS

    • Why are the aliases for string and object in lowercase?
    • bash shell: Avoid alias to interpret $!
    • SQL Join Views - Duplicate Field
    • referencing mySQL query components
    • Open current directory in TotalCommander from CMDER (creating alias)
    • Bash alias to script generating shebang text
    • How to replace numeric values of a column of a SQL table view with text aliases?
    • How to change the value with a select in SQL?
    • Create a git alias to show files marked as --assume-unchanged?
    • WSGIScriptAlias Apache in MAC Yosemite
    • Refer to a column name alias in the WHERE clause
    • Tmux breaks zsh aliases
    • How to check and create dynamic email aliases with flurdy and php?
    • A Perl one-liner into a bash function?
    • issues in table alias in codeigniter

    Related Questions in MENUITEM

    • wxPython Menu - deselect all Radio Buttons (wx.RADIO_ITEM)
    • Disable a MenuItem when TextBox of UserControl is empty
    • How can i reference a MenuItem?
    • Android support:design NavigationView checked menu sub items
    • Android: how to make transition animations on toolbar's menu icons?
    • Context Menu ShortcutKeys do not work C#
    • How to add menu items separators programmatically on Windows?
    • How add a single menu item left to the toolbar in android?
    • I am unable to set a submenu item as checked
    • how to add menu items to action bar in more than 30 activities
    • Android - The 3-dot dropdown menus does not appears if the device has a menu hardware button
    • Hide menuitem in MainActivity if Listview in Android ListFragment is empty
    • Menu Icons not showing up when using AppCompat Theme
    • How to set the minimum height and icon with of a text menu or context menu item?
    • How to get IEditorOperations from IVsTextView?

    Trending Questions

    • UIImageView Frame Doesn't Reflect Constraints
    • Is it possible to use adb commands to click on a view by finding its ID?
    • How to create a new web character symbol recognizable by html/javascript?
    • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
    • Heap Gives Page Fault
    • Connect ffmpeg to Visual Studio 2008
    • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
    • How to avoid default initialization of objects in std::vector?
    • second argument of the command line arguments in a format other than char** argv or char* argv[]
    • How to improve efficiency of algorithm which generates next lexicographic permutation?
    • Navigating to the another actvity app getting crash in android
    • How to read the particular message format in android and store in sqlite database?
    • Resetting inventory status after order is cancelled
    • Efficiently compute powers of X in SSE/AVX
    • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

    Popular # Hahtags

    javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

    Popular Questions

    • How do I undo the most recent local commits in Git?
    • How can I remove a specific item from an array in JavaScript?
    • How do I delete a Git branch locally and remotely?
    • Find all files containing a specific text (string) on Linux?
    • How do I revert a Git repository to a previous commit?
    • How do I create an HTML button that acts like a link?
    • How do I check out a remote Git branch?
    • How do I force "git pull" to overwrite local files?
    • How do I list all files of a directory?
    • How to check whether a string contains a substring in JavaScript?
    • How do I redirect to another webpage?
    • How can I iterate over rows in a Pandas DataFrame?
    • How do I convert a String to an int in Java?
    • Does Python have a string 'contains' substring method?
    • How do I check if a string contains a specific word?

    Copyright © 2021 Jogjafile Inc.

    • Disclaimer
    • Privacy
    • TOS
    • Homegardensmart
    • Math
    • Aftereffectstemplates