Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 24th Dec 2009, 05:24 PM   #1
HyperActive Warrior
War Room Member
 
Dixiebelle's Avatar
 
Join Date: 2008
Location: Tennessee
Posts: 329
Thanks: 103
Thanked 27 Times in 18 Posts
Arrow
Can someone please help me with a script?
Share on: 
fb share twitter share gplus share more share

I have built quite a few sites, but never had this come up before. This is my problem...

One of my sites has 62 pages. I have added a new category page to the site, named it and uploaded it to the server. I need to add this page name to my menu, and link it to the new page on the server. I want buyers to be able to access the new page from all other pages.

I know there is a way to insert a script into a page and have it populate all 62 pages, but I can't seem to find clear instructions on this forum or in Google search. I would appreciate any help anyone can give me, so that I won't have to spend all of Christmas day adding the new category name to each page's menu.

I need to know how to write the script and where to place it in the source file.

Thanks a million, and Merry Christmas to all.

Dixie
Dixiebelle is offline  
Unread 26th Dec 2009, 07:21 PM   #2
Warrior Member
 
Join Date: 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Can someone please help me with a script?
Share on: 
fb share twitter share gplus share more share

Hey Dixiebelle,

Since apparently I can't PM here because of my post count, you can reach me via MSN(patrickejameson@live.com) if you still need help.

-ruro
ruro is offline  
Unread 26th Dec 2009, 11:43 PM   #3
Enthusiastic Warrior
War Room Member
 
Join Date: 2009
Posts: 800
Thanks: 201
Thanked 213 Times in 166 Posts
Blog Entries: 4
Default
Re: Can someone please help me with a script?
Share on: 
fb share twitter share gplus share more share

Boy, this would be so much easier with a content management system such as Wordpress. When you add a page or category, it automatically changes the menu accordingly on all other pages.

Without a tool like that, your best bet would be to put the menu's html code into a separate include file. Then use the include directive to include that menu into each page. If you need to change the menu, you only need to change it once in the menu file.

I'm surprised you made it to 62 pages doing this all by hand! You must have a lot of patience for detail work, Dixie.

Chris
Mr. Enthusiastic is offline  
Unread 2nd Jan 2010, 09:08 AM   #4
Lisa Dozois
War Room Member
 
lisag's Avatar
 
Join Date: 2006
Location: Florida, USA.
Posts: 608
Thanks: 107
Thanked 254 Times in 118 Posts
Default
Re: Can someone please help me with a script?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Dixiebelle View Post

I have built quite a few sites, but never had this come up before. This is my problem...

One of my sites has 62 pages. I have added a new category page to the site, named it and uploaded it to the server. I need to add this page name to my menu, and link it to the new page on the server. I want buyers to be able to access the new page from all other pages.

I know there is a way to insert a script into a page and have it populate all 62 pages, but I can't seem to find clear instructions on this forum or in Google search. I would appreciate any help anyone can give me, so that I won't have to spend all of Christmas day adding the new category name to each page's menu.

I need to know how to write the script and where to place it in the source file.

Thanks a million, and Merry Christmas to all.

Dixie
Hi Dixi,

If you are using PHP or ASP, you can convert your menu to an include file. You would have to edit all of your template pages once to remove the existing menu structure and add the code to call the 'include'. This would be a lot of work for this new category, but almost 0 work for the next time you add something.

An alternative would be to use an editor that would enable you to open all of your pages at once and then do a global search and replace to add your new category.

You would need to search for the last menu item and replace it with that and the new one.

For example:

if your menu is laid out like this, and 'blah' is your last menu item:

HTML Code:
<tr>
<td>blah</td>
</tr>
then your search and replace statement would have you looking for:
HTML Code:
blah</td>
</tr>
and the replace statement would be:
HTML Code:
blah</td>
</tr>
<tr>
<td>Blah Blah</td>
</tr>
MAKE A BACKUP FIRST!

Boxer is a good editor for this and it has a free trial: TEXTEDITOR.COM - Boxer Text Editor for Windows

There are other solutions including converting to WP or a CMS. PM me if you want to discuss other options.

-- Lisa G
lisag is offline  
Unread 2nd Jan 2010, 11:28 AM   #5
HyperActive Warrior
War Room Member
 
Join Date: 2009
Location: U.K
Posts: 197
Thanks: 5
Thanked 39 Times in 36 Posts
Default
Re: Can someone please help me with a script?
Share on: 
fb share twitter share gplus share more share

Hi Dixie,

Rather than have to rely on using include files all over the place - which after 62 different places might get confusing, your best bet would be to use a simple script to read in the data you require automatically.....

It would mean the next time you have to add another one, you dont need to bother with the nonsense of adding yet another include to read in which will just slow down the loading of your page.

[It has been said by Mr enthusiastic that - really - a CMS should be used here, and this i agree with - you may want to look into converting... its not worth spending money on a custom app, as has been suggested above since you can do this for free pretty much.....]

If you create a new folder put any extra category you need in there, you can read it in automatically. You may want to look into adding a 'safe list' of files to read in where you will have to add one each time but its worth it in the long run - but the security of it all is down to you at the end of the day.

feel free to PM if you require any further advice

Best Ways To Make Money Online

Eight bytes walk into a bar. The bartender asks, “Can I get you anything?”
“Yeah,” reply the bytes. “Make us a double.”
Luke Graham is offline  
Closed Thread


Bookmarks

Tags
menu, populate, script


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

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




All times are GMT -6. The time now is 07:25 AM.