Author Topic: Creating Templates  (Read 22962 times)

0 Members and 1 Guest are viewing this topic.

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« on: October 17, 2002, 06:09:35 PM »
How could I create my own templates? So I could call
Code: [Select]
{Menu} or somthin like that in a template such as home.html....

Anyone?

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #1 on: October 17, 2002, 06:24:38 PM »
I think its somthing like...
Code: [Select]
$template_item = $site_template->parse_template("template_item"); And the html page would be template_item.html... But I know I'm missing some stuff.. or a lot????

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #2 on: October 17, 2002, 06:30:43 PM »
Nope I'm pretty sure that is wrong.. this is tricky for me! Hard to figure out. I keep looking through the code... and I know forsure the template item has to be included at the top for templates used... on each .php page..

linke index.php, categories.php etc. but i cant figure out exactly how to do it... someone should make a tutorial... im still new to php so i cant figure this out! :(

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Creating Templates
« Reply #3 on: October 17, 2002, 06:33:46 PM »
Code: [Select]
$template_item = $site_template->parse_template("template_item");
Will read the template into the variable $template_item. You have to register it now to the main template. Add just below this line:
Code: [Select]
$site_template->register_vars("template_item", $template_item);
You can now use {template_item} to show the content.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #4 on: October 27, 2002, 11:11:02 PM »
I got that all to work but now when I try to use template code on that individual templates.. it doesnt work.

For instance I have a template now called about_us.html and when i put:

Code: [Select]
{header} and
Code: [Select]
{footer}

on that template it doesn't display the header.html, it displays
Code: [Select]
{header}

What do I gotta do now and in what file?

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #5 on: October 27, 2002, 11:41:26 PM »
On index.php i added:

Code: [Select]
//-----------------------------------------------------
//--- About Us ----------------------------------------
//-----------------------------------------------------
$about_us = $site_template->parse_template("about_us");
$site_template->register_vars("about_us", $about_us);


and then in the templates directory I added a file called about_us.html

Then I LINK to about_us.html from the home.html template.

Now on the about_us.html template I got pretty much the same template 4images comes with so it has many
Code: [Select]
{these} things...

But my problem is on about_us.html none of them are parsing... What do I do?

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #6 on: October 27, 2002, 11:53:05 PM »
It seems like I asked this question poorly.

You gave me code to make a new
Code: [Select]
{thing} to be able to call it already in a template... I wanted to know how to make a new template altogether.

Such as about_us.html

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #7 on: October 28, 2002, 06:12:42 AM »
Help . . .  . . .    :cry:

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #8 on: October 28, 2002, 06:57:29 AM »
oh my gosh this is so impossible!!!!  :cry:

Ive looked through so many files.. EVERY FILE... and tried everything that i know to try....

SOMEONE... help me?

Jan? Please....  :oops:

Sorry... im desperate... I needa get this site up :)

Thanks so much for the support ANYONE!!!

 :D

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Vacation
« Reply #9 on: October 28, 2002, 03:28:38 PM »
FYI:

If you read the "announcements" forum, you'll note that Jan is on vacation this week.

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #10 on: October 28, 2002, 04:28:36 PM »
Oh... and thanks to all the other php coders that so eagerly want to help...

thanks for that news...

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Would if I could
« Reply #11 on: October 28, 2002, 04:44:42 PM »
Hey.  Gimme a little credit and look at the NUMEROUS posts I've made to help others.  If I had any info which I thought would help, I wouldn't hesitate to reply.  In this case, I just don't have any answers and maybe nobody else does either.  What you're trying to do isn't that straightforward and I don't recall anyone else trying this in the past.  

All I was trying to say is that this thread might just have to wait for Jan to get back.

Sorry.   :roll:

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #12 on: October 28, 2002, 04:52:24 PM »
yeah... thanks... i didnt mean to offend you or make a remark towards you personally :)

I am just so frustrated and I don't see why just placing a file in the templates directory wouldn't work... It's so wierd... I've searched all the code and although i'm a noviss php coder it looks like all the code does is read whats in that directory with a .html and parses it. So why isn't it working? I dunno.

Thanks for the information though vivid...

Offline Term

  • Newbie
  • *
  • Posts: 31
    • View Profile
Creating Templates
« Reply #13 on: October 30, 2002, 06:51:58 AM »
Since I don't understand dutch.. or german... or whatever is used on this site... I couldnt read that post Jan made about vacation.. does anyone know when he/she is returning?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Double language post
« Reply #14 on: October 31, 2002, 03:19:50 AM »
Ummm, let's see...
Quote
[German text]
-----
I'm going to vacation the next week. No question will be answered by me during this time.

Jan

He's going on vacation next week which is now, this week.  So since he won't answer questions during this week, my guess is that he's returning next week and will probably resume answering posts then.

Looks like english to me  :wink:  Okay I was being a smartass, but you should know that Jan always posts general announcements in both German and English.

 

Post your comments here