Jump to content
xisto Community
Johnny

Content Box -- Technical Difficulties

Recommended Posts

Okay guys, I need a bit of help with my new template. I'm kind of a noob at coding, so right now I'm using dreamweaver to help me along, but anyway, I've developed this template:

 

Posted Image

 

which you can see in use (somewhat), here:

http://forums.xisto.com/no_longer_exists/

 

and I'm having a bit of trouble with the content box. I want the content box to automatically stretch to fit whatever is in it, (and have the navigation box stay unstretched) which I've managed to do with some tricky slicing, but the problem is that with the stretching, I seem to have two choices:

 

1. The content is in a specifically sized box, with scrollbars to view the content.

2. The content is in the same box, but it has no scrollbars, which causes either cutoff content, or extra space at the end.

 

Also, I want to be able to have the navigation links change the content of that content box, without having to change to a new page entirely. I'm not sure if this can be done without some fancy flash or javascript or whatever though.

 

EDIT: Okay, I took out the iframe, and left the content box in divs/tables, but is there any way to call the content from a different file, without having to include it all in the page or use iframes? And also, I still need the last part with the navigation links.

Share this post


Link to post
Share on other sites

You could load an external file into the main content box with a PHP include, if you don't mind some very simple PHP code. The only way to actually get the content to appear without changing page is with Javascript and something called Ajax, which is what GMail uses to load the pages.You could use Javascript so that all of your content is on the page at the same time, but most of it is hidden. When you click a link you just change the properties of the different sections of text, so the current one becomes hidden and the new one is shown. This would eliminate any user that doesn't have Javascript enabled though.

Share this post


Link to post
Share on other sites

You could load an external file into the main content box with a PHP include, if you don't mind some very simple PHP code. The only way to actually get the content to appear without changing page is with Javascript and something called Ajax, which is what GMail uses to load the pages.
You could use Javascript so that all of your content is on the page at the same time, but most of it is hidden. When you click a link you just change the properties of the different sections of text, so the current one becomes hidden and the new one is shown. This would eliminate any user that doesn't have Javascript enabled though.


Thanks a lot for the php suggestion, but now I'm not completely sure I want the single-page thing...

Reasons for:
I want to have a single main template that, if edited, changes those parts of the page for the entire site.
I want to have a single content box, that I can change to reflect different pages of content, so I only have to edit a page of content, rather than a page with the template -and- content.
I want to have my content box css coded.

Reasons against:
I don't want more code than necessary.
I'm not sure if the content box would stretch properly when it loads a different content page.
I could modify the main template for each page, if needed for special cases.
One less page to deal with.
I could use a seperate css file for the whole site.

Also, I modified the template a bit (well, completely redid it, really), with a toploaded nav bar. Here's the new version, I'm not sure which one I'll use, but it'll probably be this new one:
http://forums.xisto.com/no_longer_exists/

Share this post


Link to post
Share on other sites

i did this once too except abit lamer! what i did was the content was stored as a SEPERATE html file and numbered eg 1.htm or given a proper name if i could be bothered!

using php i just did something like this:

<a href=modules.php?mod=1>item 1</a>

then in the php file it was basically:

<?$module = $_POST['mod'];$module = "$module" + ".htm"; echo "<HTML>all the html stuff goes here <start content area>";include($module);echo "<end content area> finish html stuff </html>";?>

there was more to it than that because of giving people access to only certain files but that is a basic way of doing it.

Your current html stuff from your template will go between the quotes where it says: echo" ";

and the "mod=1" will change to whatever the file name is, for example if the filename of the html file is friends.html it will be
<a href=modules.php?mod=friends>Friends</a>

i dont know if that made any sense i hope it did. its really not too complicated it might look it but thats just because its pretty untidy!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.