SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Looping values inside a menu

    Hello,

    I've created a site with it's own CMS. In the CMS the admin is able to add more sections to the site. The sections are displayed as a navigation menu and also as javascript/DHTML drop down menu. The problem is that I can't actually update the sections with php for the drop down menu since it is a javascript file. Therefore the whole point of the CMS is useless since at the end someone will still have to know some html in order to add more sections to the drop down menu.

    A solution, since the javascript file is being included, would be to put the content of that file inside the page that is calling for it but then the page would look too crowded and quite hard to work on. So I was wondering if someone has had this type of problem or if know some javascript menu which could interact with php or something like that.

    Thanks.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have had problems like this too. Not with drop down menus, but similar with php and javascript. The way I got around it was if the list or menu is an array or just a list of variables, you can dynamically create that after the include statement of the javascript file? Or basically just copy/paste the javascript into the file and don't include it. Then the part where the menu is defined, take that and have your php code there. Shoudl work, if you have any more questions dont hestiate to ask.

  3. #3
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't want to use this option as the page will get to crowded even if I use an include file inside the javascript but I guess I don't have any other option.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •