Forum Moderators: open

Message Too Old, No Replies

Links File Is This Possible

Anyone Know How to Do This

         

webdev

12:20 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



I have say 100 pages all with the same link code.

Now when this link changes I have to change 100 pages individually as this is all in a CMS system.

Does anyone know any what that I can have the link on all these pages point to another file with the link in so that if I change this one file all the links change.

maccas

1:06 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



I am not to sure I understand your question webdev, but I think you mean SSI

<!--#include virtual="/nav.txt" -->

If you are using a CMS surely this is template driven?

kaled

4:46 pm on Aug 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the navigation links are for the user (rather than search engine robots) consider using an IFRAME.

Kaled.

webdev

10:24 pm on Aug 7, 2004 (gmt 0)

10+ Year Member



I'll try to explain myself a little better.

On each of these 100 pages I have a piece of text say "Buy This Here"

That links to www.site1.com

Now if this link/affiliate code changes I dont want to have to change 100 pages with the new link..

So I was wondering if I could make the link on "Buy This Here" point to say link.txt

This way when the link/affiliate code changes I only have to change link.txt instead of all 100 pages individually.

kaled

12:42 am on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you want to make an indirect link. I guess you could use a page with a meta redirect to the required site. The links would all remain constant but you could edit the redirect page to send the user elsewhere.

However, I still think the IFRAME or SSI methods are tidier.

NOTE: If you use the redirect method, be aware that it can be disabled in most browsers. Other redirect methods might be more suitable (depending on whether you want to write a little cgi stuff or possibly even edit the .htaccess file - not sure about that).

Kaled.

webdev

10:03 am on Aug 8, 2004 (gmt 0)

10+ Year Member



The SSI would be good, any ideas of the syntax for pointing to a link file?

kaled

11:31 am on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming SSI can be easily enabled, simply replace every link with <!--#include virtual="/linkout.txt" -->.

Then place the required html link code in /linkout.txt
e.g. <A href="http://www.anotherdomain.com">click here</A>

However, unless you are using SSI already, this will increase server CPU load since the whole file has to be scanned to allow substitutions to take place.

If you experiment with IFRAMEs, I suspect you will choose that solution.

Kaled.

webdev

2:29 pm on Aug 8, 2004 (gmt 0)

10+ Year Member



Do IFrames not cause scroll bars etc...

kaled

3:44 pm on Aug 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Depending on what attributes you set, there need be no scrollbars or borders. If the backgrounds are the same color, the IFRAME contents will be indistinguishable from the parent. However, I'm unsure what you can do if the parent has a background image.

Kaled.

Longhaired Genius

4:05 pm on Aug 8, 2004 (gmt 0)

10+ Year Member



If these 100 pages are all static html, I think the easiest way to deal with this problem is with one of the many multiple find-and-replace tools like Multi-Replace.

webdev

9:11 am on Aug 9, 2004 (gmt 0)

10+ Year Member



Yep that would be my ideal..but I am using Mambo and you can not use tools like this on the CMS...I used to use DreamWeaver for this.

However would anyone know if it is possible to use a find and replace in SQL as this is where all the info is stored including the link URLs

webdev

6:13 pm on Aug 13, 2004 (gmt 0)

10+ Year Member



Any idea anybody :)