Jump to content

Recommended Posts

Hello everyone,

 

I am currently developing a blog site for myself. I've been looking into template engines but i'm not sure that's what I need?

 

Using the template system:


<?php // Index Page

// Define Page TITLE
define('TITLE', 'MWDesigns: Home');

// Address ERROR Handling
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

include ('./pages/functions.php');

require ('./assets/header.php');


// Sart of Main Content //

// End of Main Content //

require ('./asstes/footer.php');

?>

 

The main content area is the only part of my template that needs to change dynamically. I could just make multiple files and use include to import the right content file for each page. But this is not really working for me. I need to somehow figure out how to write a script that:

 

[*]Depending on what link is clicked. Load the page into the content area

[*]Only use as few files as necessary but can load many different content files

 

I'm still learning PHP and such I don't know how I could even go about this or if its worth looking into?

 

If anyone has any idea's or examples that might be usful I would really appreciate it. I'm not looking for a handout or code just given to me. I just need some guidance and a few examples to base it off of

Link to comment
https://forums.phpfreaks.com/topic/150262-solved-dynamic-content-loader/
Share on other sites

The content area I'm speaking of is the main text, images, etc of my template. In other words the main bulk of information. E.G. You have a blog - the main content area is where it would show the title and post? 

 

Maby this would explain it better.

<?php // Index Page

// Define Page TITLE
define('TITLE', 'MWDesigns: Home');

// Define SECTION
define('SECTION', 'Frontpage');

// Define PAGE
define('PAGE', 'Blog Index');

// Address ERROR Handling
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Include MySQL info
include ('./assets/connect.php');

// Include header information
require ('./assets/header.php');


// Sart of Main Content Area //
include ('./pages/content.php');
// End of Main Content //

//Include Footer information
require ('./assets/footer.php');

?>

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.