Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy and paste a selection to all web pages? 1

Status
Not open for further replies.

rudo

Programmer
Jul 3, 2002
72
NL
Hi,

I edit my webpages ( ) with FrontPage. A list with names is repeated on each page. Each time an element is added I must change the list on over 100 pages. I try to make a macro that would copy the new list from the index page to all others, but I cannot find the correct code. (On the HTML pages I can put a marker STARTLIST and ENDLIST to define the selection.)

Can anyone help? Thank you very much for any suggestion.
 
There's a better way than that!

1.) Save your formatted list - and your list only - as a separate HTML snippet (no html/head/body, just the list code itself)

2.) On each page where you want to display that list, put this at the respective place:
Code:
<div id="mylist"><!--#include virtual="mylist.htm" --><div>

Now you only have ONE list, that is LINKED into all your pages.
So you only have to edit one file to update your list on all places...

P.S: Instead of a div include you could also use an iframe...

;-)

Cheers,
MakeItSo

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Hi MakeItSo,

Thank you very, very much for your help. If I get this to work it will save me many hours of editing.

However, I apologize, but I must have misunderstood your explanation. I have uploaded a testpage
which includes the code you proposed and a file "mylist.htm"
( )

I must have done something wrong, because mylist.htm does not appear in the page. Can you see what I've done wrong?

Thank you very much in advance!!!
 
Sorry, forgot:
The "include" is a so-called SSI, a server side include.

For that to function, the calling page must have the extension ".shtm" rather than ".htm".

Rename it, that should do.

For further help to this topic, you'll be better off in forum215
:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Hi MakeItSo,

I have renamed as

In my firefox browser it now shows the code of this calling page.

Tonight (Paris time) I will have a look in the other forum you mentioned to see if I can make this method work.

Thank you very much for your help sofar!!!

Kind greetings,

Rudo
 
Hi MakeItSo,

It works! However, the calling page must apparently be renamed from .htm to .shtml (and not .shtm) :)

In my website there are several hundreds of internal links, but FrontPage adapts them automatically when renaming pages, so that should not cause any problems.

Redirect?

At the moment all my pages are .htm. There are quite some people out there linking to them or sending links to my articles around in newsletters. Therefor I cannot simply abandon the .htm pages. I presume I can find code to redirect visitors who look for the .htm name to the .shtml version.

Google ranking?

I still have one important question: my list contains links to websites and thanks to these links on each of my pages, those websites rank higher in Google. (This way I thank these websites for their services.) If I replace all these lists by just one on a snippet, will Google still consider them as if they were repeated on each page?

Thank you in advance for any ideas about these matters.

Kind greetings,

Rudo



 
The redirect turns out to be very simple:
<META HTTP-EQUIV="Refresh"
CONTENT="1; URL=test_page.shtml">

Unfortunately ranking issue look more problematic. The instructions for the best Google ranking say that robots must be able to crawl each page easily...

Would I need a macro afterall, to copy and past my list to all pages?

All suggestions are welcome!
 
Hi rudo,

1.) thanks for the .shtml info.
:)

2.) I would reckon all you need is a "sitemap.xml" located in your root folder:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="[URL unfurl="true"]http://www.google.com/schemas/sitemap/0.84">[/URL]
   <url>
      <loc>[URL unfurl="true"]http://www.courtfool.info/zz_ontwerp2.shtml</loc>[/URL]
      <lastmod>2011-02-09</lastmod>
   </url>
   <url>
      <loc>[URL unfurl="true"]http://www.courtfool.info/zz_ontwerp2_subpagexyz.shtml</loc>[/URL]
      <lastmod>2011-02-09</lastmod>
   </url>
   <url>
      ...
   </url>
</urlset>
See also Google Webmaster Tools:

Great that you get things going!

Cheers,
MakeItSo

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Hi MakeItSo,

I know I can add the snippet with the list to the sitemap. And of course, Google robots will find it. The question is, how do the robots consider it? When the list is on each page, I suppose that the links are considered having to do with the subject of the page. I presume that would mean that when websurfers use a keyword in Google (let's say "Afghanistan") the websites mentioned next to the article about Afghanistan are ranked higher in the search results.

I wonder, if I put the list of websites in a separate file, the robots still act as if the list were on each page. I have not found specific information about this detail, but a Google-friendly webpage is normally one that can be easily parsed.

Meanwhile I have found a few more bits of VBA code for a macro that copies the list to all pages. I will post the solution here if I succeed to make it work (and I will probably post a question if I don't.) ;-)

Kind greetings,

Rudo
 
If you fill the sitemap with the links to the pages instead of links to the snippet, the list will count for every page.

However, you should be aware
a) this link list of yours does not increase your page rank but that of the sites you link to, and
b) that excessive cross-linking can actually decrease your page rank.
See also:

These are questions that rather belong to forum828
Check it out!
:)

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Hi MakeItSo,

I presume most people care about their own ranking, but this list is intended to thank people for publishing my articles, thus to improve their ranking. Normally, these are not cross-linkings.

I am sorry, but I don't understand what you mean by filling the sitemap with the links to the pages instead of links to the snippet.
At the moment my index only mentions pages. (See /sitemap_of_courtfool_info.xlm)

Could you just give one example of what you mean?

Thank you very much in advance!

Kind greetings,

Rudo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top