How to have full content of a page imported from another file

Is there a way to import the full contents of a central column froma nother file in the way images are imported?

I am updating many files and come upon a number that have identical content, but different sidebars. Repeating content is not seem in good light bt SEO.

I wonder if I could have my different sidebars and simply place a link in the middle section that would display the content.

See for instance: http://pintotours.net/Asia/Indonesia/insuranceJkt.html

is this possible with html/css?

Thank you

What server side language do you use?

Do you mean Apache? 2.2.29

That page that I mentioned above used to be in one directory and be fetched by the different main pages as a separate file. Now, under my new system… I have to repeat it for each country,

It’s alreday in the Barcelona, Bali; Jakarta and Punta Cana, with more to come.

Thre’s something about php PHP version 5.5.21 in the Home page of the Host. is that what you asked?

I tried this but nothing happened whwn I opened th apge…

<html> 
  <head> 
    <script src="jquery.js"></script> 
    <script> 
    $(function(){
      $("#includedContent").load("/Pinto/insurance.html"); 
    });
    </script> 
  </head> 

  <body> 
     <div id="includedContent"></div>
  </body> 
</html>

See http://pintotours.net/Mork/OLDTEST3/DUPE.html

Is something like this what you want?

Thanks Ryan

I need a fresh head (or two…) to go though that and see how it could get not just a few lines of text, but a whole article with images and all.

if you think the total contents of my midlle section (#box4) in the link I left above could be imported by this method, then YES that 's what I need.

Thanks

ONE QUESTION:

Would I have to change the calling files from html tp php?

Hi Ryan

I think I followed the instructions but nothing…

http://pintotours.net/Mork/SSS/insurancePunta.php should connect with index.php on the same directory that has the content to be included in the main page.

If you have time…

Hi Ryan

Partial success!

I’ll leave the polishing for tomorrow morning.

Good night and thanks!

@qim, if I’ve understood your concern correctly, then PHP includes are not going to solve the problem.

Includes are great in terms of allowing you to update a section once and have the updated version appear on multiple pages (think headers, footers, etc.). But the PHP engine on the server renders the page, with the includes, and then sends the output to your browser - or to a search engine spider. So the spider will see the full content of that page, including the duplicate content. (If you “View Source” on the page with the includes, you won’t see the PHP include commands; you’ll see the rendered HTML.)

Hope that makes sense. (I know what I mean, but I’m not sure I’ve explained it very well. )

Hi TechnoBear

yes, I’d already come to that conclusion! The php include worked beuatifully and I learbned something new, but it is not the solution, like you wrote.

I have a few other options:

  1. rewrite new text for each page (it’s like getting a different result for the same football match!)
  2. leave those pages like they were before, all linking to the same page. Not sure how to marry the 2 systems
  3. allow these pages to repeat themselves and place a nofollow on them. Not very efficient if I want visitors!

Plenty to think about. if you ahve any ideas, they will be very welcome.

Look at the new system in

http://pintotours.net/Asia/Indonesia/bali.php and http://pintotours.net/Asia/Indonesia/indonesia.php

and the old system in http://pintotours.net/Oceania/Australia/Sydney.html based on “pop-ups”

In partucular look at the button for Travel Insurance (twice in each page: in the right sidebar and when the screen narrows it goes to the left sidebar)

Regards

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.