/    Sign up×
Community /Pin to ProfileBookmark

How do I pull content from another page?

I’ve got about 35 pages on my site, and everytime I add/fix/whatever in my sidebar (menu, announcements, etc) I have to change it on all pages. Can’t I just have that part of my content on another page, in a text file, even if its written in html I would like to have just one place to add it.

With that in mind, is that going to undermine me as far as web ranking and pages referenced on my site, or does that stuff load into my html page before the spiders scrub it?

Thanks!!

Great site…

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@yitzleDec 08.2006 — You can. Use PHP or Perl to insert other files into the doc.

It will not affect how spiders see stuff.

Random (*cough*) example: http://jesa.skule.ca/

If you look through the various pages, the nav bar stays the same.

The nav bar gets slurped from one file and the rest of the content from a second (which is based on the ?page= in the URL)
Copy linkTweet thisAlerts:
@ray326Dec 08.2006 — If your site is on an Apache server then you can use server side includes (SSI) to assemble your pages on the fly.
Copy linkTweet thisAlerts:
@punderfulauthorDec 08.2006 — Can you give me some keywords to look up that technique (having content in a separate file)? I'm having a tough time looking up examples.

Thanks!
Copy linkTweet thisAlerts:
@yitzleDec 08.2006 — You got 3 options: Perl, PHP, SSI

I think Perl is less popular than the other two.

Does your host support PHP/SSI?

Testing:

PHP:

Make a file called test.php

Code:
[code=php]<?php
phpinfo();
?>[/code]

Make sure the file has executable permission set in addition to read (chmod 755) (not sure if read is even needed...)

Visit the file with your browser. Either you get what you typed -> no PHP, or you get other stuff.

SSI:

Stick this somewhere in your HTML file and see if it works:
[code=php]<!--#echo var="DATE_LOCAL" -->[/code]
Copy linkTweet thisAlerts:
@Elmo3883Dec 09.2006 — This may not be what your looking for but...


Copy and Paste... you dont have to deal with any extra HTML if its already written, AND you can transfer pages in a snap!!

I may not have gotten your question right but thats what might work
Copy linkTweet thisAlerts:
@ray326Dec 09.2006 — Stick this somewhere in your HTML file and see if it works:[/QUOTE]An HTML file with the extension .shtml that is.
×

Success!

Help @punderful spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...