where can I edit / add ID's to the genrated menu lists?

Hi,

I need to assign id's to the
    tags that are created on the fly when ZP generates the menu lists in order to get a bit of jquery working.

    Can anyone tell me where they are? I specifically need to edit the News, Albums and Pages opening
    .

    Anyone help me out here? Be appreciated!

    Thanks, Simon

Comments

  • If by IDs you mean the database ID field, then it is generated automatically. If you need something else, you will need to be more specific.
  • Thanks for the reply, allow me to clarify, and sorry for the confusion:

    I want to assign a CSS ID to the opening `
      ` of the html lists that are created when the navigation menus are generated. Example: `
        ` By Default they do not have id's assigned.

        I specifically need to assign id's to the News, Albums, Pages and Archive menus opening `
          ` so that I can control their behavior.

          I am assuming I can edit this directly in one of the .php files, I am hoping someone can tell me where to look. Hope this is a but clearer?

          Thanks in advance, Simon
  • Please review the functions guide. Generally speaking each of these functions which output HTML will allow you to pass an ID as an optional parameter.
  • Thanks for the pointers! Got it. All good.

    S
  • acrylian Administrator, Developer
    It is also possible to put something like `` around all those list and address them by `#menu ul`, `#menu ul li` etc., in case all should look the same.
  • Yes, true, that could have been a solution but i'm pretty sure it wouldn't validate.

    But I discovered that the empty value in the passed parameters of the function was the ID, which was exactly what i needed!

    Example: `<?php printAllNewsCategories("All news",TRUE,"expandNews","menu-active");` will output an unordered list with the following opening tag `<ul id="expandNews" class="menu-active">`

    (which in my case allows me to apply a bit of jquery that writes a class to the specified `
      ` contextually, according to what ID I have specified, which sets my menu to expand or not).
  • acrylian Administrator, Developer
    Yes, we added these parameters for that purpose..;-) Also if you need a full customized function you can also use the "get" variants that nearly every "print" function has to build yourown.

    Regarding validation, my suggestion should validate as well as `
      ` is actually allowed witin ``.
  • Sure ul is allowed in div! But not vice versa (actually it might be allowed i would have to check to be certain i might have to eat my words..) but either way, in the context i am using it, it would be semantically incorrect :) - I'm building a set of nested menus that slide open and closed.
  • acrylian Administrator, Developer
    `div` is also allowed within `li` but that would require customized functions anyway. And of course I don't know what you doing, so if it works for you everything is fine..;-)
Sign In or Register to comment.