[thelist] using and presenting shared content

Burhan Khalid thelist at meidomus.com
Wed Mar 19 08:43:14 CST 2003

Hello Karen,

Wednesday, March 19, 2003, 6:26:14 AM, you wrote:

[ snip ]

klnc> Some of the content will be shared across all the sites including the parent site.  I have tried using <iframe> to pull the shared content but this is problematic as the vertical size of the
klnc> iframe will be dependant on window size.  There are also problems with some MAC browsers and display of the iframe.

klnc> I was musing over adding a string to the url link for the shared page and then using Request.Querystring to pull that value and use it to do a Document.Write in the Body OnLoad to apply the
klnc> correct style.  But I have never done anything of this order and wondered if a) it would work and b) is there a better way.

Whenever I come across a situation like yours, I always think of
creating a common data store (be it a library of functions, common
variables, routines, etc). In your case, its common elements across
the page.

I would also second Chris' recomendation about the database. It will
help solve some of your portability issues. If say you are concerned
with static values (links, css filenames, etc) I would suggest that
you write a class and then call it from the appropriate sub-site.

A quick example (PHP) :

      $myObj = new common_elements();

<img src="<?= $myObj->setHeaderGraphic(__FILE__); ?>" alt="my logo" />

Then in your common.php.inc :

     class common_elements {

           function setHeader($location) {
                    if ($location == "subsite.php") {
                       return "/subsite/subsitelogo.gif";

This approach has served me well in the past while creating complex
projects that have common elements.
[ snip ]

Best regards,
 mailto:thelist at meidomus.com

More information about the thelist mailing list