Using same content on multiple pages?
04-15-2008, 05:08 PM
|
Using same content on multiple pages?
|
Posts: 4
Name: Andrew
|
Hi guys,
New to the site - have a kind of dumb question. I'm using dreamweaverMX, and I'm creating a site for a friend's startup business.
here's the scratch site under development:
www.phobos2deimos.info/lotsafishies
There's a "hot deals" section on the right hand side. That section displays on every page of the site. I'd like to be able to update the picture and text as easily as possible, without going through every page of the site and retyping it all. I suppose a simple frame is one way to do it, but I want something seamless and clean.
I can update the filename of each picture under "Hot Deals" so that the source changes, therefore updating the picture throughout the site, but I can't figure out how to update the text easily.
All help is appreciated. I haven't implemented CSS in the site as I don't know much about it, but if it is the best solution to my problem then I will be happy to learn.
THanks!!
p2d
|
|
|
|
04-15-2008, 05:15 PM
|
Re: Using same content on multiple pages?
|
Posts: 1,433
Name: Stephanie
Location: Oklahoma
|
You can do this easily with server side includes (SSI). What kind of server side language does your hosting allow (ie php, asp)
|
|
|
|
04-15-2008, 05:16 PM
|
Re: Using same content on multiple pages?
|
Posts: 1,565
Name: Stefan
Location: London, UK
|
This question comes up a lot.
Your best bet is server side includes, such as PHP or ASP.
|
|
|
|
04-15-2008, 05:31 PM
|
Re: Using same content on multiple pages?
|
Posts: 4
Name: Andrew
|
Thanks for the responses so far.
I'm using hostgator hosting, hatchling package. The checklist includes SSI, php, etc. All listed in the link. Doesn't include chilisoft asp.
I have absolutely no knowledge regarding these options or how to implement them. Any ideas where to start???
Thanks.
p2d
|
|
|
|
04-15-2008, 06:19 PM
|
Re: Using same content on multiple pages?
|
Posts: 6,109
Name: James
Location: In the ocean.
|
|
|
|
|
04-15-2008, 06:27 PM
|
Re: Using same content on multiple pages?
|
Posts: 4
Name: Andrew
|
Thanks James. I'll take a look at that - looks like it might be what I need.
Quote:
Originally Posted by joder
|
|
|
|
|
04-15-2008, 06:36 PM
|
Re: Using same content on multiple pages?
|
Posts: 1,565
Name: Stefan
Location: London, UK
|
to sum that up.....
hotdeals.php
PHP Code:
echo '<div>Hot Deals suff here</div>';
and any page you want, put this line where you want it to appear.
PHP Code:
<?php include('hotdeals.php'); ?>
don't forget to save any page containing the include in php!
eg: index.php NOT index.html
|
|
|
|
04-15-2008, 06:36 PM
|
Re: Using same content on multiple pages?
|
Posts: 6,109
Name: James
Location: In the ocean.
|
Quote:
Originally Posted by phobos2deimos
Thanks James. I'll take a look at that - looks like it might be what I need. 
|
Your welcome. I use PHP Includes on all my sites. One for the header and menu and another for the footer. I control all the formatting with CSS. So, I have to only change up to three files to change the entire site.
|
|
|
|
04-15-2008, 10:08 PM
|
Re: Using same content on multiple pages?
|
Posts: 28
Name: Shawn Lindsey
|
Hello,
Also, I noticed you said that you were using Dreamweaver, which is the best Editor IMO. But, you can hit CTRL+F in Dreamweaver, and it brings up the Find options. In here it will says Find IN (Current Documents, Site, Folder, and a couple Others) And Then ANother Box that is a drop down menu, that says (Source code, text and some others) You can then use the next box below that, and put in the original text that is there, and then the box below that and put the text or image you want to change to, and hit replace all. And as long as the SITE is waht is in FIND IN , then it will go through all your sites and fix the link, text, source code, image, whatever you had selected, Then all you have to do is upload the new files to the server, or if you are using the FTP utility inside Dreamweaver, just save the new pages and bam that is all yo have to do.
Hope this helped, if you have any other questions please feel free to ask.
__________________
**Free Tutorials, Free Tech Support, Cheap Computers, Web Hosting, Custom Computers, Web and Graphic Design.... www.shawnsitsolutions.com **
|
|
|
|
04-16-2008, 04:28 PM
|
Re: Using same content on multiple pages?
|
Posts: 4
Name: Andrew
|
Thanks a ton for the help, esp. gilligan and joder - I tinkered with it a little but within a couple of minutes I was able to get things exactly how I want. (woot!)
I'll try the Find&Replace option, Shawn - thanks for the tip.
|
|
|
|
04-16-2008, 05:23 PM
|
Re: Using same content on multiple pages?
|
Posts: 237
|
Quote:
Originally Posted by joder
|
Perfect.
I have been updating all my menu links one by one every time I change something. I can't believe I have been missing out on this!!
Thanks a lot! 
__________________
I work on Turbo'd Honda's for fun :)
|
|
|
|
04-16-2008, 05:45 PM
|
Re: Using same content on multiple pages?
|
Posts: 560
|
Yeah, PHP includes are an awesome feature. They are especially useful when first constructing a site and small changes on every page are common. Nothing more annoying then opening a billion pages and editing the same thing each time
Matt
|
|
|
|
04-16-2008, 05:55 PM
|
Re: Using same content on multiple pages?
|
Posts: 6,109
Name: James
Location: In the ocean.
|
Quote:
Originally Posted by RNPoo7
Perfect.
I have been updating all my menu links one by one every time I change something. I can't believe I have been missing out on this!!
Thanks a lot! 
|
That's how I felt when I first discovered it!
Here is a program that is also a good tool
http://www.inforapid.de/html/searchreplace.htm
|
|
|
|
04-16-2008, 06:12 PM
|
Re: Using same content on multiple pages?
|
Posts: 1,565
Name: Stefan
Location: London, UK
|
Quote:
Originally Posted by joder
|
And me, lol
|
|
|
|
04-19-2008, 08:40 AM
|
Re: Using same content on multiple pages?
|
Posts: 4
Name: Shay Jones
|
OK, now I am all excited about trying the PHP includes. (SSI includes would be fine too, I just can't tell which is better).
Either way, I can not make the .htaccess.txt file work.
Mind you, I am using CODA (for Macs) as my tool. But still, it shouldn't be hard. My host is DreamHost.
Can you all suggest a way to make htaccess work.
I don't want to rename all my files as .php or .shtml.
Did you guys rename all your files?
Thanks folks !!
|
|
|
|
04-19-2008, 08:46 AM
|
Re: Using same content on multiple pages?
|
Posts: 11,461
Location: Blackpool. UK
|
that's because it's NOT called .htaccess.txt
It's just .htaccess No filename, JUST the extension
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
|
|
|
|
04-19-2008, 11:56 AM
|
Re: Using same content on multiple pages?
|
Posts: 22
|
Quote:
Originally Posted by Shayman
OK, now I am all excited about trying the PHP includes. (SSI includes would be fine too, I just can't tell which is better).
Either way, I can not make the .htaccess.txt file work.
Mind you, I am using CODA (for Macs) as my tool. But still, it shouldn't be hard. My host is DreamHost.
Can you all suggest a way to make htaccess work.
I don't want to rename all my files as .php or .shtml.
Did you guys rename all your files?
Thanks folks !!
|
Just remove the .txt from the .htaccess.txt and it will look like .htaccess. It will then work  .
|
|
|
|
|
« Reply to Using same content on multiple pages?
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|