468,510 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

making a dynamic menu with asp

347 100+
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


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
Oct 10 '12 #1
11 2426
12,513 Expert Mod 8TB
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.
Oct 10 '12 #2
347 100+
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
Oct 10 '12 #3
12,513 Expert Mod 8TB
Can you do a mockup of what you want to accomplish? I'm having trouble visualizing what you're asking for.
Oct 10 '12 #4
347 100+
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


Oct 11 '12 #5
12,513 Expert Mod 8TB
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
Expand|Select|Wrap|Line Numbers
  1. recordset = "select * from sometable where artist = 'some artist'"
  3. if "sometype" is in recordset then
  4.    output "sometype"
  5. end if
  7. 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.
Oct 11 '12 #6
347 100+
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
Oct 11 '12 #7
12,513 Expert Mod 8TB
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.
Oct 11 '12 #8
347 100+
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?

Oct 11 '12 #9
12,513 Expert Mod 8TB
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.
Oct 11 '12 #10
347 100+
The current menu your looking at is hand codes without a database using a HTML list jquery and styles
Oct 11 '12 #11
12,513 Expert Mod 8TB
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.
Oct 11 '12 #12

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Gernot Frisch | last post: by
4 posts views Thread by Stromboli | last post: by
7 posts views Thread by zorhel | last post: by
4 posts views Thread by spx27 | last post: by
1 post views Thread by biela | last post: by
1 post views Thread by tribal boy | last post: by
reply views Thread by Oded Dror | last post: by
4 posts views Thread by SAL | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.