• TechQA.

    joomla 1.5 give every menuitem the class of its alias

    847 views Asked by eyeonu At 2011-01-28T10:17:40+00:00 28 January 2011 at 10:17 2025-12-18T00:10:09+00:00

    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 answers

    0
    Brent Friar Brent Friar On 2011-01-28T14:31:02+00:00 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 2011-01-30T14:17:43+00:00 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

    • How to use custom font during html to pdf conversion?
    • Storing the preferred font-size in localStorage
    • mp4 embedded videos within github pages website not loading
    • Is there any way to glow this bulb image like a real light bulb
    • What can I do to improve my coding on both html and css
    • Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
    • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
    • How to increase quality of mathjax output?
    • Hover animation resetting( seemingly reverting back to original CSS and then again to hover)when moving mouse horizontaly accross a part of an element
    • Storing selected language in localStorage
    • How to clip grid cell and provide scroll as well?
    • KeyboardAvoidingView makes a messy the flexbox
    • Rotate an object around another object in javascript
    • Understanding Scroll Anchoring Behavoir
    • how to use only block layout in this css code?

    Related Questions in CLASS

    • Why is this namespace unable to be found?
    • How do I initialise a class within a class
    • How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
    • Tkinter App - My Toplevel window is not appearing. App is stuck in mainloop
    • Grouping HTML elements by their class name
    • Troubleshooting object instantiation based on role in PHP app
    • Using attributes from instances of array of objects in other classes
    • Error NullPointerExeception: When trying to add Value in ArrayList & adapter.notifydatachanged
    • How to get class properties or fields using reflection in Kotlin/Native?
    • why we got same data type in two versions like "int" and "integer" in php?
    • Initializing member class with referenced inputs within parent class constructor
    • Have a script work multiple times with the same class
    • Encapsulation does not seem to work in dart
    • Page reloads on button click while event.preventDefault() is used
    • C++ - Unknown type name

    Related Questions in JOOMLA1.5

    • Update Joomla 1.5.22 to php greater than 5.4
    • BooKIT Joomla 1.5 nth-of-type Select option
    • 301 redirect from URL with GET-parameters to the homepage
    • Problem with migration Joomla 1.5.26 to 3.x with jUpgradePro
    • Why am I receiving the following error message when uploading CSV Improved? Error! Could not find a Joomla! XML setup file in the package
    • Comparing 2 tables and display missing rows
    • How to add flv video into joomla mod_custom
    • Can't install captcha plugin on Joomla 1.5.22
    • Virtue-mart products-categories move to WooCommerce
    • Disable error reporting php 5.6 Joomla 1.5
    • Apache2, FastCGI, PHP5 and urls without .php sufix
    • Allow Login from Different Domain having user login details on a single database of one particular domain - Joomla 1.5
    • Error on migrating website : Database Error: Unable to connect to the database:Could not connect to MySQL
    • Upgrading extension for Joomla 3 gives fatal php error
    • Check if a column exists in Joomla table

    Related Questions in ALIAS

    • How do I separate emails (from 1 alias) in Thunderbird from invasive websites on Firefox with file browsing scripts? Should I worry?
    • Using Aliases in a Javascript Function
    • Python unexpected non-zero returncode when checking alias command set in .bashrc file
    • Creating aliases for Github Copilot CLI (ghcs, ghce not recognised)
    • procedure/alias [a portion of] a somewhat long MySQL command?
    • Understanding class importation and alias management in Laravel 11's new directory structure
    • Drupal 9 contextual filter on url alias
    • How to access the previous value of text in Cypress that you expect to change?
    • How to time how long a bash alias took to execute (solved... maybe?)
    • SQL query in Oracle to sum up values from an alias column
    • Microsoft GraphAPI - behavior with emails received from alias email addresses
    • How to Alias `python` to Python 2 (`/usr/bin/python2`) on WSL Ubuntu?
    • How do I tell the Jackson JSON deserializer to prefer one field over another when both are present?
    • Replace dataframe with its alias in select in pyspark
    • Error: vite build in github actions - for using aliases

    Related Questions in MENUITEM

    • CSS - Change Margin of a Menu's Items..?
    • How to add a border color when Router Link is activated form the menu of menuitem in react with typescript and MUI (5.15.14)
    • Windows 11 - How to modify the title of a group of items in the Windows Explorer context menu?
    • Menuitem item style
    • Menu item of NavigationView doesn't get checked if it was the last item checked
    • MenuItem SubMenu appearing on left hand side of ContextMenu instead of default
    • MudBlazor Nested Menu Hover on nested child opens and closes that child dialog rapidly and isn't clickable
    • Detecting menu item text (and ID)
    • How to get select multiple menu items in MUI menu and return the selected value
    • Can you tie a SwiftUI Mac app's menu item to the front window like you can in AppKit
    • How to show a modal from inside a MUI Menuitem
    • Android - Navigation stack issue with bottom navigation bar
    • Remove extra menu when search view is click
    • Flutter: Drawer items reopen after being in an open window already
    • How To Add Woocommerce Product Categories To Menu Dynamically?

    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?

    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)
    • Privacy
    • Terms
    • Cookies
    • Homegardensmart
    • Aftereffectstemplates
    • Jogjafile