Can someone please help me with a script?

4 replies
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
#menu #populate #script
  • Profile picture of the author ruro
    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
    {{ DiscussionBoard.errors[1542566].message }}
  • Profile picture of the author Mr. Enthusiastic
    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
    {{ DiscussionBoard.errors[1543143].message }}
  • Profile picture of the author lisag
    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.
    Signature

    -- Lisa G

    {{ DiscussionBoard.errors[1565796].message }}
  • Profile picture of the author chaos69
    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
    Signature
    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.”
    {{ DiscussionBoard.errors[1566191].message }}

Trending Topics