making a dynamic menu with asp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinod
    Contributor
    • Nov 2007
    • 347

    making a dynamic menu with asp

    i am trying to make a menu that has 4 sections and all the information comes from my database

    i have main sections UK Accents, Ages, Styles, World Accents, Foreign Languages.

    in these there will be links to various pages.
    the links are called voicetype in my database and also have a setting for type which includes a reference to the sections

    i.e. the age 40's has a voicetype of 40 and a type of Ages

    i am trying to find a way of listing these depending on whether a person on our site is in the voicetype catagory?

    Hope this make sense

    the site can be seen at

    Yakety Yak is a leading Voice Over Agency based in London. We specialise in Voice Casting, Celebrity Voiceovers as well as English and International voices.


    unfortunately i have no page to show on an attempt at this all i ahve is the artists pages that have text links on them in 1 list but i want to seperate them out in the seperate catagories

    i hope i have the right section for this

    many thanks
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I must not understand what you're looking for because I'm looking at that site and it seems to filter the list just fine when clicking on different categories.

    Comment

    • colinod
      Contributor
      • Nov 2007
      • 347

      #3
      Hi rabbit

      It's not that it does not work I think it works fine but we have had users not realise that the text links take them to other versions of the artists pages so I have been asked to make a version of what is on the previous page to the right of the biography on the artist page so that is why I am trying to do this

      Silly I think but have been asked to do it

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Can you do a mockup of what you want to accomplish? I'm having trouble visualizing what you're asking for.

        Comment

        • colinod
          Contributor
          • Nov 2007
          • 347

          #5
          Hi Rabbit

          try looking at this



          although sizing is not as i want it the idea is there.

          I want to be able to only have the main button appear if the artist is any of the catagories in it, and obviously just the buttons for the catagories relevant to the artist

          thanks

          colin

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            It sounds like you have all the data you need in the database about what types the artist specializes in. You can check against the recordset you're returning from the database and if the type is in the recordset, then output it, otherwise don't. In pseudocode, it would be something like this
            Code:
            recordset = "select * from sometable where artist = 'some artist'"
            
            if "sometype" is in recordset then
               output "sometype"
            end if
            
            repeat for other types
            The exact syntax you end up using will be different, but the logical idea is there.

            Another option that you have is to reuse your existing code if you have any. You are either hard coding that menu on my left or you are doing it dynamically from data in the database. If it's the latter, you can use the same code, just use a different recordset.

            Comment

            • colinod
              Contributor
              • Nov 2007
              • 347

              #7
              Thanks for that i suppose it it just be a long list of if then and if else statements like i do to get the text in, the thing i can figure out is how to seperate out the things into seperate sections i.e. the ages under the ages button etc and also how i would not show a main section if they were not in it, like USA World accents etc

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                It doesn't have to be a long list of if statements. That was just to get the logical idea across. As I don't know how you currently code that menu, it's hard to make any definitive suggestions.

                You would "seperate out the things into seperate sections" the same way you do it now. I don't know how you're doing it currently but just do it the same way and it will be in the correct section.

                As for the main section, you would do a check just like you would for the subsections.

                Without any code, it's difficult to say say specifically what has to be done. Once you have some code, we can get into specifics, but until then, I can only offer generic suggestions on approach.

                Comment

                • colinod
                  Contributor
                  • Nov 2007
                  • 347

                  #9
                  Ok i only have the main sections set agains the things in the sperate sections so i suppose the best way would be to add that information to the database.

                  At the moment my code for the text loops through with an if then that changes certain sections to add spaces and characters if needed so i can cope with that

                  can i do an if loop and say something like if 'sometype' is in recordset and is in 'maintype' then show it?

                  thnaks

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    That's one way of doing it. A more efficient way would be to build a menu from any given set of records without having to check if it's in there. But that might be more work. I can't say if it would be more work without knowing how it's currently done.

                    Comment

                    • colinod
                      Contributor
                      • Nov 2007
                      • 347

                      #11
                      The current menu your looking at is hand codes without a database using a HTML list jquery and styles

                      Comment

                      • Rabbit
                        Recognized Expert MVP
                        • Jan 2007
                        • 12517

                        #12
                        Then it would be more work to create it dynamically. And if you're looking for a fast turn around, then I would just jury rig it with a bunch of checks that you can just copy and paste and change the type. But if you have the time to work it out, I would create the menu dynamically in code so maintenance and flexibility is improved.

                        Comment

                        Working...