homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

This 39 message thread spans 2 pages: 39 ( [1] 2 > >     
PHP Multi-content?

 9:29 pm on Jul 1, 2005 (gmt 0)

I am attempting to get php to work content similar to how frames would work... this is the layout i have in mind, and I am running into walls trying this...

header and footer section with nav and left and right content sections.

[edited by: jatar_k at 9:37 pm (utc) on July 1, 2005]
[edit reason] removed url [/edit]



 9:38 pm on Jul 1, 2005 (gmt 0)

you could do that with includes

each included file would have that section of the html in it


 9:48 pm on Jul 1, 2005 (gmt 0)

i want to stay away from SSI. If I can do it with SSI then I can do it with PHP...Right?

also the two sides left and right, I would like different content to appear in each one of those based on what is selected on the nav.

*when pushing about I want content to go in left content
* I then choose history it goes in right // about is still present in right

similar to working with <Iframes> and naming the frames... then targeting the frames in the link from the nave


 10:14 pm on Jul 1, 2005 (gmt 0)

sorry I was refering to php includes not SSI

fairly straight forward, I usually do things like this based on the url or the pagename but you would have to look at what identifying factors would be available to have the script decide what file to include.

A good directory structure could be the key.

I usually use a single header and footer on all pages, the include a nav file somewhere, then a single content area which usually is what actually resides in each page. Then sometimes a "right side" that includes other content.

How your scripts know what to include is where you need to figure things out. I always try to stay away from get strings unless I can't design the logic with out them.

I have yet to use them. ;)


 3:06 pm on Jul 5, 2005 (gmt 0)

is there a way to target different tables similar to iframes, so i can put in new content based on whats selected from the navbar?


 4:58 pm on Jul 5, 2005 (gmt 0)

you can't target that's the thing, that doesn't mean the logic can't be designed so that it understands and performs the way you want.

Yes you can do this 100% with php

how you do it completely depends on the design and logic.

We can walk through the logic if you like but you will have to describe it to me.

How are you going to make it so php understands what you want it to do? What can php look at to decide what content to load?


 5:05 pm on Jul 5, 2005 (gmt 0)

okie... so since we are going to discuss logic, should we construct a logic flow chart? would this be the best method?

obviously I am pretty new to this, but more than willing to learn.


 5:32 pm on Jul 5, 2005 (gmt 0)

I don't know I always start by figuring out what exactly it is that I am trying to do.

design always starts with identifying the actual requirements, not what different people think the requirements might be but what they actually are. Then figuring out what is at my disposal and then going from there.

From what I can see here

we need a templating system, more or less, that will enable multiple content sections based on where the user navigates to.

I think we know a few things

we will have a header, will this be the same file for every page?

we will have a footer, will this be the same file for every page?

we will have a file for the nav

we will have 2 content sections, what is the purpose of the 2 sections? What will be in each, will one be different on every page and the other be by section? Are they both 100% different all the time?

this might be a good thread to look at also
A dynamic site in 2 minutes [webmasterworld.com]


 5:42 pm on Jul 5, 2005 (gmt 0)

I understand the basics when it comes to a dynamic site. I supose as I am attempting to draft out a logical flow chart based on priority information and userability that it comes down to making decisions.
Basically, what I want and I think this will aid in the decision making process extremely is: high priority information in the left column, lower priority in the right column. So I supose it would be a matter of teiring the content at that point!


 5:46 pm on Jul 5, 2005 (gmt 0)

sounds about right but the thing I don't get is why 2 content sections?


 5:54 pm on Jul 5, 2005 (gmt 0)

in theory it can work with a single content section, but in the original design plan, there was a call for rotating articles and several pieces of rotating content upon initial load of the page, to keep it fresh. this included advertisments, and calls to different areas of the site.

The idea from a marketing perspective was that the user could receive the information they are requesting while still being exposed to the rotational content... without actually forcing the rotational content into the hard design (template)

*since then there has been some changes based on design limitations, and new knowledge made available.

perhaps a redesign into a more dynamic format is what this icalling for.


 6:06 pm on Jul 5, 2005 (gmt 0)

also, there primary content in the left content area is information that leads the user to a form, which I have appear in the right content area


 6:09 pm on Jul 5, 2005 (gmt 0)

aahhhh, now I see

well, no problem then, use a single file for the right hand content (rotating content) and build the logic into that.

so really you have your answer, any individual pages could look something like this. Now you could have your nav in the header file or have it as an include in the header. The same goes for your right side content, I would throw the code or an include into the footer and you're off to the races.

Figuring out the logic of how it rotates, or doesn't show at all, can be defined inside that file based on specific pages or for sections of the site.

<added>jsut saw your other post

>> which I have appear in the right content area

I might rethink that functionality and show the form in the main content area if possible, or maybe a new window if it is required to keep the content in the main area.


 6:14 pm on Jul 5, 2005 (gmt 0)

hehe, another funny thought

>> The idea from a marketing perspective

marketing requirements are not always the best thing for the site, oft times they aren't even possible. ;)

I try to understand what they need then provide them a solution within the existing architecture. We always need to find the middle ground between the many perspectives to keep a functional, powerful, easily maintained and user friendly site.

I wish it was as easy to do as it is to type.


 6:32 pm on Jul 5, 2005 (gmt 0)

it works beaqutifully with <ifames> but it limits the SEO thats the real concern


 6:35 pm on Jul 5, 2005 (gmt 0)

I supose i could always build the teired content into two columns in one table based on what is selected.... just kind of makes the design really un original and poopy


 6:46 pm on Jul 5, 2005 (gmt 0)

>> just kind of makes the design really un original and poopy

hehe, unfortunately those are sometimes the things we have to do.

>> limits the SEO

that's really the primary concern


 7:17 pm on Jul 5, 2005 (gmt 0)

ok so new question.... I got it looking tight and nice now, but I have the nav built into each page, it would make more sense to put it in the header?


 7:59 pm on Jul 5, 2005 (gmt 0)

I would think so, but that is going under the assumption that it is the same on all of those pages


 9:11 pm on Jul 5, 2005 (gmt 0)

yeah it would be the same, the only concern I have would be the layout... i mean regardless, everything has to reload again...whether it be in the header or the body...
its all text navigation....


 9:13 pm on Jul 5, 2005 (gmt 0)

>> everything has to reload again

that's right

the only reason to put it in the header would be ease of maintenance, another option is to have the include for it in the individual files and maintain it in a single file.


 9:51 pm on Jul 5, 2005 (gmt 0)

thats an idea!

include nav.html;


require ('templates/nav.html');


 3:22 pm on Jul 6, 2005 (gmt 0)

would this work?
require ('templates/nav.html');
require ('about.html');
require ('FAQ.html');


 3:30 pm on Jul 6, 2005 (gmt 0)

ok that worked... is that going to affect the SEO?


 3:41 pm on Jul 6, 2005 (gmt 0)

from the seo side the bots just see html, there are no inherent problems created from that setup


 3:45 pm on Jul 6, 2005 (gmt 0)

the only one I could see is... since its relying on the header.html for the keywords... they will differ slightly from the content... but I supose given this template method, I am going to run into this problem.

each html file in the last example will be able to contain their own keywords/description, which could be useful, but I run into the same problem I saw with using frames, that being the search engine only locating that page and not the entire site.



 3:57 pm on Jul 6, 2005 (gmt 0)

well my pages often look like this

$keywords = 'rank me, make me number 1, these keywords rock';
$title = 'Look at my awesome title';
$description = 'this would be the description for the page';
include '/stuff/header.php';
<td>look a bunch of content that is loctaed in each file</td>
include '/stuff/footer.php';

so each file would look like that, having it's cointent actually located in the file, then including header and footer. I set the 3 vars for keywords, title and description before including the header file.

in the header I would have some type of default.

if (!isset($title)) {
$title = 'this is my default super title for the site';

and do the same for the other 2 vars. This means any page I forget or if I haven't gotten to them yet will still carry the default title etc. Once I customize each page then they each have their own.


 4:01 pm on Jul 6, 2005 (gmt 0)

and the bots will pick up $keywords=


 4:23 pm on Jul 6, 2005 (gmt 0)

well I guess that is an unfinished thought, sorry

in the header after checking to see if they are set and setting the defaults if not then I do this

<title><?= $title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="<?= $description?>">
<meta name="keywords" content="<?= $keywords?>">

soemthing like that, and then they are output to the browser right where they should be

make sense?


 4:46 pm on Jul 6, 2005 (gmt 0)

Something like this in the header:?


if (!isset($title)) {
$title = 'site - the main title for this site';

if (!isset($keywords)) {
$keywords = 'muh, blah, words, yes';

if (!isset($description)) {
$description = 'A description of the site.';

This 39 message thread spans 2 pages: 39 ( [1] 2 > >
Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved