Re: Templates/Graphics/Text

From: Date: Thu, 03 May 2001 03:21:44 +0000
Subject: Re: Templates/Graphics/Text
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-51211@lists.php.net to get a copy of this message
sounds like you're wanting to do this : // get mode from url or preferences or somewhere $mode = strtolower($HTTP_GET_VARS['mode']); if ($mode == 'text') { include 'txt_template.php'; } else { include 'img_template.php'; } include 'content_page.html'; now : index.php?mode=text // loads text template index.php ... // anything else loads img template regarding friendly search-engine pages, have a look at these two tutorials : http://www.phpbuilder.com/columns/tim20000526.php3 http://www.zend.com/zend/spotlight/searchengine.php also, consider sending 'lynx' users to your text templatized pages ;-) and fyi, the above if/else can be written as follows (ternary conditional operator) : include ($mode == 'text') ? 'txt_template.php' : 'img_template.php'; regards, philip On Wed, 2 May 2001, Ashley M. Kirchner wrote: > > I'm trying to figure out what's the best way to do something that > may be simple, however I can't for the life of me envision it. > > I want to have three files as follows: > > [ NOTE: I may be thinking of this the wrong way (by thinking up > three files.) If someone has a better suggestion, please speak > up! I'm willing to entertain other solutions. ] > > -> img_template.php (which contains the full, graphical > website page, except for the content) > -> txt_template.php (which contains the full page, without > any of the bells and whistles, graphics > javascript and all) > -> content_page.html (which is the actual content) > > This is where I get stuck. What to do? To me, the easiest seems > to be one single (control) file for the whole site, which then loads > up the content based on the URI. For example: > > http://our.web.site/index.php?page_to_load > - this will grab the img_template.php file, then > - fetch 'page_to_load.html' and insert it into the template > and serve it. > > However, will this pose a problem for search engines? Or for > anything else? I don't know. Anyone? > > Now, we would also like to have the whole site be in text format > (really a slimmed down page without all the graphics, roll-overs, easy > to print and such). > > I'm thinking, add another variable: > > http://our.web.site/index.php?page_to_load&format=text > > or: > http://our.web.site/index.php?page_to_load&format=graphic > > But again, how will search engines handle this? > > And, I would also have to be able to dynamically update any anchor > links that show up in the content so it knows what it needs to link to > in terms of format. Somewhat stupid to have someone click on a > 'text only' link, and when following another link from that it drops > back to a graphic based page. > > > Call for comments. Suggestions. A blow to the head. Something. > I'd like to make this so that future site re-designs won't be as > painful as this one is turning out to be (currently all 500+ pages of > the site have everything hard coded, so changing something in say a > menu causes a real problem). > > And yes, I've looked at FastTemplates and I'm, uh, somewhat lost, > but that may be because I haven't really spent a whole lot of time > reading up on it. Also, the stuff on there dates back to 1999 - has > it not been updated recently? Or did it not need any? > > AMK4 > > -- > W | > | I haven't lost my mind; it's backed up on tape somewhere. > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:ashley@pcraft.com> . > 303.442.6410 x130 > SysAdmin / Websmith . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 > Arapahoe Ave #6 > .................. . . . . Boulder, CO 80303, USA > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#51211) next »