Jump to content

[SOLVED] Dynamic Content Loader


mattwal

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');

?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.