Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

One menu, multiple pages. Anyone good at websites?

Status
Not open for further replies.

ThermalRunaway

New Member
Hi everyone. To give you an idea of what my discussion is about, take a quick look at this website: **broken link removed**

If you look at the left, there's a news panel which gives some general news on what's happening in the author's life at any time. If you click on any of the other areas of the site using the top menu bar (personal, electronics etc) you'll find that the same news panel appears. Unfortunately, I'm not very clever at webdesign so what you're actually seeing is a completely different news panel with the same information inside it. This means that whenever I want to update the News, I have to do it for every page in which that news panel occurs. And it's the same for a couple of other bits on my site.

I'm sure it must be possible to create one news panel, and then have all the other pages jump to it so that the same panel is displayed on every page where it's included. Then, I'd only have to update the panel itself and all the other pages would contain the up to date information - that would be soooooooo much better.
I'm using dreamweaver to do the site, but I can also do the coding by hand as well - I just find a WYSIWYG program much easier. Can anyone recommend any techniques to get what I want done?

Brian
 
The easiest way is to use a language that allows you to "include" other files. Languages such as PHP, ASP, JSP, etc. all support server side includes. I'll use PHP as an example.

If you want to keep it as simple as possible, you would create a "tpl_menu.php" file with your menu HTML (just syntax, no header, body, html tags), and then in your main page (say index.php) you would just include the menu code where you want it with an "<? require_once("tpl_menu.php"); ?>" where you want the menu to appear.

You can reuse this include line on any page where you want the menu to appear. It always stays the same across the pages, because it's always loading that data from another file for you.

This is really simplistic in terms of a site template system, but you get the idea. You could reuse this concept to completely templatise a site which has the added benefit of being able to change the look and style of a site with hundreds of pages, with just a few changes in a couple files.

You can google for "php template system" to get a ton of more in-depth examples. Here's one: https://www.ibdhost.com/help/templates/
 
Thanks for your reply. I had considered looking into dynamic web pages using those kinds of languages before, but I was put off by the fact that you normally have to pay significantly more for webspace which involves dynamic content. My website is merely a personal place for me on the internet which in truth, hardly anyone is likely to visit hehe. So with that in mind I couldn't really justify the higher cost.

I'm now considering experimenting with it just for the educational value though. I'll have to look into how much it costs to get all the development software and information I'll need.

Thanks again for your reply.

Brian
 
Glad to help!

Bare metal PHP hosting can be really cheap, just look around ;) PHP is text based, open source, and free!
 
Oh right ok, in that case I'll be giving it a try! Now to find some online tutorials, or perhaps I'll buy an ebook...

I was thinking though, wouldn't it be pretty cool if WYSIWYG editors could make a feature of this? There must be loads of people who have similar news snippets which occur on multiple pages of their websites, and if they're using static webpages then they'll undoubtedly have the same problems as me in that they'll have to update every single page in which that news snippet occurs, one at a time.
But since the news snippet menu always contains exactly the same information and format throughout all of the pages in which it occurs, why could you not define this code in all of the pages and ask the WYSIWYG editor to "manage" them. In this way, you only update one of the pages with the new information, and the editor then ripples this change through the other pages where you've previously defined the same code area, therefore automatically updating them and removing the need for the poor old webmaster to go around and manually update them all.

Brian
 
you cold create a page with JUST your news panel (we will call this 'news') and then do a page for your homepage WITHOUT the news (we will call this 'index1'), then, use this code:

<html>

<head>
<title>brianhoskins.co.uk</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<frameset rows="58,*" framespacing="0" border="0" frameborder="0">
<frameset cols="112,*">
<frame target="main" src="**broken link removed**" marginwidth="4" marginheight="16" scrolling="yes" noresize name="contents">
<frame src="**broken link removed**" target="_self" scrolling="auto" name="main" marginwidth="12" marginheight="5">

</frameset>

</body>
</frameset>

</html>


You might want to copy it into dreamweaver or frontpage to edit it.
save the file on your site directory as index.html (rename your existing index to something else, i.e. index1.html or something)
I did something similar to my site, but i have the frame at the top.

Hope this helps,
Mike
 
Ah right so you can do it with frames. When I originally looked at frames I found that they were quite complex and required quite a lot of planning, and I also found that they didn't really provide me with any great advantage over not using them - so I've never used them since!

Looks like I'm going to have a use for them now afterall.

Thanks very much for the suggestion Mike!

Brian
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top