By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

making a dynamic menu with asp

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

http://www.yaketyyak.co.uk

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
Share this Question
Share on Google+
11 Replies


Rabbit
Expert Mod 10K+
P: 12,369
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

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

Rabbit
Expert Mod 10K+
P: 12,369
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

100+
P: 347
Hi Rabbit

try looking at this

http://www.yaketyyakallmouth.com/pag...&voicetype=All

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
Oct 11 '12 #5

Rabbit
Expert Mod 10K+
P: 12,369
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'"
  2.  
  3. if "sometype" is in recordset then
  4.    output "sometype"
  5. end if
  6.  
  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

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

Rabbit
Expert Mod 10K+
P: 12,369
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

100+
P: 347
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
Oct 11 '12 #9

Rabbit
Expert Mod 10K+
P: 12,369
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

100+
P: 347
The current menu your looking at is hand codes without a database using a HTML list jquery and styles
Oct 11 '12 #11

Rabbit
Expert Mod 10K+
P: 12,369
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.