 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 28th, 2004, 03:21 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
dynamically generated pop up menus...
I am an asp developer that just started to use dreamweaver mx - I wanted to use pop up menus...the problem is the items for the menu are dynamically generated from my database, can I combine that with the menu generator and if so how???
if not what is my other option...
Adina
|
|

July 28th, 2004, 05:11 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Adina,
Yes, this is certainly possible. The easiest way is to create a Dreamweaver menu with a few dummy items in it. Make sure you cover at least all the levels you intend to use.
Next, examine the menu, and see what you have to make dynamic.
Then create a recordset that retrieves your menus from the database, and generate the menu items dynamically.
Take a look at this thread: http://p2p.wrox.com/topic.asp?TOPIC_ID=6623 for more ideas and sample code.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 28th, 2004, 05:22 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks, I have tried that - but I ran in to two problems....first - if I ever go back to the pop up menu editor to edit this menu or even to a new pop up menu - all my asp code disappears....
and second it works with the first menu but not with the second one (which is using a different recordset to populate the menu...) and I am not sure why...any ideas...
Adina
|
|

July 29th, 2004, 12:51 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, that is correct. Dreamweaver tries to reconstruct the menu dialog from the code, so when you reopen the menu dialog, it will dump all your ASP code. That's why you should design and create the menu first and once you're happy, add the ASP code.
You could save a copy of the menu which you can later change, and then manually copy back the changes to your dynamic code.
You can also look into third-party (some of them commercial) menu solutions.
Not sure I understand your second question. Are you talking about two menus, or about one menu with different levels?
Maybe you should post the relevant parts of your code so we can take a look at it.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 30th, 2004, 10:06 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Imar for your help - they work! I also figured out how to use the code to change appearances so I dont have to use the editor anymore - there is just one thing I havent figured out - maybe you can help me - since the menu is dynamic I dont know the length of the menu items, and the menu box is not expanding to fit the largest items. I know how to set the box width - but I want to know if there is a way to set it so it expand to fit the largest item on the list...any ideas...
Thanks
|
|

July 31st, 2004, 03:03 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Adina,
This is going to be tricky. The menu code that Dreamweaver generates expects the width of the menu as one of its parameters.
Since the width is used to perform a couple of calculations inside the mm__menu file, you can simply pass a 100% value to make the menu as large as necessary. Rewriting the menu to accommodate for this situation is probably not a trivial task.
Also, measuring string length to find out how large the text is, is not very easy. In .NET this is quite simple, but with classic ASP or PHP this is much harder.
I think the easiest way to do this, is to limit the size od the menu text column in the database to, say, 50 characters. Then calculate the average width of a menu item text with 50 characters, and use that as the width of the menu. Since iiiii is much smaller than wwwww you need to look at "an average string".
Not a beautiful solution, but it may be the only one you can implement in a reasonable amount of time.
You could also look into third party menus; menu they support this. I can also imagine that doing this in Flash is possible as well....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 31st, 2004, 05:31 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
As someone who knows quite a bit about Flash, I will tell you that this IS possible. This does require a bit of XML programming outside of Flash but I have heard numerous places that it can be done.
Quote:
quote:Originally posted by Imar
I can also imagine that doing this in Flash is possible as well....
|
Ben Horne
Madison Area Technical College - Truax
3550 Anderson Street
Madison, Wisconsin 53704-2599
-------------------------
http://www.acidplanet.com/artist.asp?AID=290705
"There are two kinds of people in the world: Those who claim to be Flash junkies and those who actually are Flash junkies"
|
|

August 1st, 2004, 03:31 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Can you elaborate a bit about this, and possibly give a code example?
How would you put "XML programming outside of Flash" to use to measure string length, or to dynamically size menu widths? Can you give an example?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |