4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: Term on October 17, 2002, 06:09:35 PM
-
How could I create my own templates? So I could call
{Menu}
or somthin like that in a template such as home.html....
Anyone?
-
I think its somthing like...
$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????
-
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! :(
-
$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:
$site_template->register_vars("template_item", $template_item);
You can now use {template_item} to show the content.
Jan
-
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:
{header}
and {footer}
on that template it doesn't display the header.html, it displays {header}
What do I gotta do now and in what file?
-
On index.php i added:
//-----------------------------------------------------
//--- 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 {these}
things...
But my problem is on about_us.html none of them are parsing... What do I do?
-
It seems like I asked this question poorly.
You gave me code to make a new {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
-
Help . . . . . . :cry:
-
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
-
FYI:
If you read the "announcements" forum, you'll note that Jan is on vacation this week.
-
Oh... and thanks to all the other php coders that so eagerly want to help...
thanks for that news...
-
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:
-
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...
-
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?
-
Ummm, let's see...
[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.
-
I swear I seen that post.. read it... and it was ONLY in german.... I guess I looked to quick.
-
Hey...
Anyone got a cure for my problem yet? I really need help here :cry: :(
Thanks anyone.. someone... you! :)
-
Maybe you're looking for that: http://www.4homepages.de/forum/viewtopic.php?p=5103#5103
Jan
-
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 {these}
things...
But my problem is on about_us.html none of them are parsing... What do I do?
I think this would take care of what you're trying to do. Just supply the template name in the URL of your link in home.html like so:
http://www.YourDomain.com/index.php?template=about_us
4images accepts the "template=" and takes care of adding ".html" to about_us and looks for a file called "about_us.html" in the current template directory. If it's found, it's processed.
-
This is what I always do and is very helpful to maintain it organize
open includes/page_header.php
before the
?>
add this
//---------------------------------------------------------------------------------------------
//---- New template {these} --------------------------------
//---------------------------------------------------------------------------------------------
$these = $site_template->parse_template("these");
$site_template->register_vars(array(
"these" => $these
));
unset($these);
now you can add {these} to any template
and you need to create a these.html template
-
usingin v1.7 dont you?
since v1.7.1 your method will not work, the template parsing must be done AFTER registering the tags ;)
-
im using 1.7.2 :) and it works perfectly :) :D
-
usingin v1.7 dont you?
since v1.7.1 your method will not work, the template parsing must be done AFTER registering the tags ;)
^
stupid :oops:
overlooked what was actualy registering as a tag...
-
i can offer people template creation to fit with your existing site all i need is a copy of the default templates or the modified ones your using (header and footer only)
and a copy of one of your standard site pages with out any main content just a word like content where u wish the gallery stuff to be in relation to other elements on the screen etc
Michael