Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Bidding Directory   1,000 Directory Submissions   V7N Directory

Reply
 
LinkBack (1) Thread Tools Display Modes
Old 10-03-2004, 07:39 PM   1 links from elsewhere to this Post. Click to view. #1 (permalink)
Inactive
 
downtroden's Avatar
 
Join Date: 06-19-04
Location: Illinois
Posts: 149
iTrader: 0 / 0%
Latest Blog:
None

downtroden is liked by many
Send a message via AIM to downtroden
Making a dynamic menu that changes according to page, coldfusion maybe?

I'm doing a site... and it has a left menu with main section links. I have a style for the current page and one for other links. What I would like is the current page style to get applied to whatever the main page is currently with appropriate 'sublinks'. The site is using ColdFusion as a dynamic page language, so anything using that would be appreciated, but other suggestions are welcome as well.

To further clarify (i can't provide any photos)
you see a list of links:
main page
page 1
page 2

you click on 'another page', it goes to a page and the menu looks like:

main page
page 1
-sublink 1
-sublink 2
-sublink 3

page 2

right now i'm using a cfinclude tag for the left menu and have 2-4 versions for appropriate pages. would like to cut this down and maybe have something like
if on this page
then this info shows
elseif on this page
then this info shows
etc...

i would appreciate any help.
downtroden is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 10-03-2004, 07:57 PM   #2 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,149
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
Much the same as php - you could set a variable to the pagename and then use the <cfif $variable == 'pagename'>
<cfinclude $variable></cfif>
I'm not too up on the cf nomenclature (been awhile) but you get the picture I hope.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-04-2004, 07:26 PM   #3 (permalink)
Inactive
 
seonewbee's Avatar
 
Join Date: 05-12-04
Posts: 520
iTrader: 0 / 0%
Latest Blog:
None

seonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really nice
You need to know server variables in PHP.

Need to know all the files you want in the menu - full urls I guess

Create a file containing the information for creating a link - one pair per line

Read file in that has information into an array

Subtract current page from array

Print results to page

I am sure that others can tell you in great detail how to do each step.
seonewbee is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-06-2004, 11:48 AM   #4 (permalink)
Inactive
 
downtroden's Avatar
 
Join Date: 06-19-04
Location: Illinois
Posts: 149
iTrader: 0 / 0%
Latest Blog:
None

downtroden is liked by many
Send a message via AIM to downtroden
Well... hatchet, I kinda wanted to only have 1 include file with the complete menu, but thanks. Seonewbee, vague... but thanks .

I found this script on another site and it does EXACTLY what I want only on the same page and immediately after click... which isn't what I want. Any of you Javascripters out there... could you explain what this is doing? I know it's hiding the elements outside of the div, but how?

---- top code ----

<script type="text/javascript">

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.left_nav_subcurrent{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsBy TagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="left_nav_subcurrent") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}

</script>


---- body code ----


<!-- Keep all menus within masterdiv-->
<div class="left_nav_current" onclick="SwitchMenu('sub1')"><a href="#">Sunday</a></div>
<span class="left_nav_subcurrent" id="sub1">
<a href="#">morning show</a><br>
<a href="#">late morning show</a><br>
<a href="#">noon show</a><br>
<a href="#">afternoon show</a><br>
<a href="#">late night with...</a><br>
<br>
</span>

<div class="left_nav_current" onclick="SwitchMenu('sub2')"><a href="#">Monday</a></div>
<span class="left_nav_subcurrent" id="sub2">
<a href="#">Usage Terms</a><br>
<a href="#">DHTML FAQs</a><br>
<a href="#">Scripts FAQs</a><br>
<br>
</span>
</div>
downtroden is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-06-2004, 06:25 PM   #5 (permalink)
Inactive
 
seonewbee's Avatar
 
Join Date: 05-12-04
Posts: 520
iTrader: 0 / 0%
Latest Blog:
None

seonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really niceseonewbee is just really nice
Sorry, I was too vague, but I am just learning PHP. Nice script, but I would not trust it. What if the person doesnot have javascript turned on? Second question, how will search engines follow your links and index your site? Have a nice day!
seonewbee is offline  
Add Post to del.icio.us
Reply With Quote
Old 10-06-2004, 09:25 PM   #6 (permalink)
Inactive
 
downtroden's Avatar
 
Join Date: 06-19-04
Location: Illinois
Posts: 149
iTrader: 0 / 0%
Latest Blog:
None

downtroden is liked by many
Send a message via AIM to downtroden
well.... hmmmm, search engines... oh YEEEAAAaaahhhhhh. Well... maybe this is because I don't know what's possible or don't understand how they work, but if the entire menu is in a include file with the links and only certain parts are getting shown and hid during navigation, do search engines really care whether the link is hard coded to the page?

I guess when I'm saying dynamic, I'm wanting it to show and hide 'sub' menus or divs when on pages no pertaining to those choices, and I don't want to have to fake it by either setting up include files for all options or setting up the menu on every page.

ps. you're right about js not being turned on... i don't want to use that.
downtroden is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply


LinkBacks (?)
LinkBack to this Thread: http://www.v7n.com/forums/coding-forum/14188-making-dynamic-menu-changes-according-page-coldfusion-maybe.html
Posted By For Type Date
dynamicdrive dhtml menu This thread Refback 10-08-2006 09:36 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to make dynamic Adsense parking page? Comenius Web Design Lobby 2 04-07-2007 07:18 AM
Align Pages Menu? Like that page link first etc! Klaas Koopman Blogging Forum 4 07-22-2006 10:52 AM
Information architecture : dynamic or static home page ? JoeWall Web Design Lobby 4 04-12-2006 03:10 PM
Google indexing this type of dynamic page JoeLloyd Google Forum 6 01-05-2004 07:55 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 04:36 AM.
© Copyright 2008 V7 Inc