Jump to content

php tpl include


dannzegos

Recommended Posts

Here is my question...

 

I've added a new entry (Custom Web Development) in homepage.tpl (using portal template) and I've added the link to "CustomWebDev.php". When you click on the link it shows the page, but it does not have the portal template header and footer. I know how to do the include if it was in php, but not sure about tpl. How do I make my page to include the header.tpl and footer.tpl files?

 

You help would be greatly appreciated.

 

Thanks in advance,

 

DannZegos

Link to comment
Share on other sites

I read the link you sent me, but with only two sentences to explain it, I'm really not sure what I'm looking at.

 

Here is the code...

 

<?php

 

require("dbconnect.php");

require("includes/functions.php");

 

$pagetitle = $_LANG['clientareatitle'];

$pageicon = "images/support/clientarea.gif";

$breadcrumbnav=''.$_LANG['globalsystemname'].'';

 

require("init.php");

 

if ($_SESSION['loggedinstatus']=="true") {

# User is Logged In - put any code you like here

}

 

# Define the template filename to be used without the .tpl extension

$templatefile = "homepage";

 

/*

To assign variables in Smarty use the following syntax.

$smarty->assign('variablename', $value);

This can then be used as {$variablename} in the template

*/

 

include("display.php");

 

?>

 

If I want the file CustomWebDev.php to have the header and footer, where would I put the file in the above code?

 

Thanks, Jay.

Link to comment
Share on other sites

I added "include("customwebdev.php");" right below init.php (also tried require instead of include) and it just puts my php page above the header, homepage, and footer. I removed the homepage in that code and replaced it with my php page (using include) and it does the same thing minus displaying homepage. I would like my page to display where homepage.tpl would normally be displayed once I click on the link from homepage.tpl.

 

please help,

 

DZ

Link to comment
Share on other sites

You put the whole code you put above, into a new page called customwebdev.php, then make a page called customwebdev.tpl in the template folder which contains your html code, then where it says:

 

# Define the template filename to be used without the .tpl extension

$templatefile = "homepage";

 

Replace "homepage" with "customwebdev"

Link to comment
Share on other sites

Thanks so much guys and gals... I appreciate the example Lynnette, sometimes seeing helps a ton.

 

I do have a new question that arose implementing this code, and that is of the breadcrumbnav in the code...

 

It shows my breadcrumb as "You are here: Home" and Home is not linked, just plain text. I would like it to read "You are here: Home > Custom Web Development".

 

What do I need to do to this code to get it to say that and be clickable (linked)?

 

Thanks,

 

DZ.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated