Templating ... a simple guide

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
Michaelo
Registered User
Posts: 106
Joined: Thu Apr 01, 2004 7:56 am
Location: Dublin

Re: Templating ... a simple guide

Post by Michaelo » Sun Mar 19, 2006 7:19 pm

Read this, it may help.
http://www.webmasterworld.com/forum88/2406.htm" target="_blank (Click on first link at top left.)
and this http://www.webmasterworld.com/forum83/2201-4-10.htm" target="_blank (Click on first link at top left.)

Mike
Mods: Forum Icons Enhancement, Kiss Portal Engine
Links:
Kiss Portal Engine (dev site) Stargate Portal (archive site) ...
Styles: Technika

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: Templating ... a simple guide

Post by EXreaction » Sun Mar 19, 2006 8:15 pm

Thanks, I will look into that. :)

reekingofrandomness
Registered User
Posts: 3
Joined: Mon Mar 06, 2006 7:42 pm

Re: Templating ... a simple guide

Post by reekingofrandomness » Thu Mar 30, 2006 4:37 pm

None of teh changes i make seem to do anything?

Is there anything i need to do before the template changes show up?

User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Re: Templating ... a simple guide

Post by dhn » Thu Mar 30, 2006 6:09 pm

reekingofrandomness wrote: None of teh changes i make seem to do anything?

Is there anything i need to do before the template changes show up?
In the ACP, under General -> Server Configuration -> Load Settings, enable "Recompile stale templates". This is off by default so that we don't have to check every template for a new version with each load.
Image

reekingofrandomness
Registered User
Posts: 3
Joined: Mon Mar 06, 2006 7:42 pm

Re: Templating ... a simple guide

Post by reekingofrandomness » Thu Mar 30, 2006 9:49 pm

now everything goes blank when i select a different style

User avatar
dhn
Registered User
Posts: 1518
Joined: Wed Jul 04, 2001 8:10 am
Location: Around the corner
Contact:

Re: Templating ... a simple guide

Post by dhn » Thu Mar 30, 2006 10:11 pm

reekingofrandomness wrote: now everything goes blank when i select a different style
Well, are you sure that you installed the new style you are working on correctly?
Image

reekingofrandomness
Registered User
Posts: 3
Joined: Mon Mar 06, 2006 7:42 pm

Re: Templating ... a simple guide

Post by reekingofrandomness » Thu Mar 30, 2006 10:17 pm

i copied all the files from subsilver, changed teh .cfg files and then installed all teh seperate parts on the acp.

I then changed cellpic2.gif so that it was blue.....and hey presto the whole lot went white...but it worked before i changed the image

CodeFX
Registered User
Posts: 1
Joined: Wed Feb 09, 2005 8:39 pm

Re: Templating ... a simple guide

Post by CodeFX » Sun Apr 02, 2006 3:31 am

Quick question...

What file or files are absolutely needed by the templating engine, other than includes/template.php? I'm looking to hack the system so that I can use the engine without the forum. It was easy to do it to the 2.0 system, but it looks like it's a bit more difficult for this one. I noticed the includes/functions_template.php file says it contains functions needed for compiling the templates... are there any other files that are needed too?

Thanks in advance.

Franklin
Registered User
Posts: 15
Joined: Wed Apr 12, 2006 12:19 pm

Re: Templating ... a simple guide

Post by Franklin » Fri Apr 14, 2006 7:07 pm

psoTFX wrote: Variables

The basic syntax for simple (non-block) vars remains the same as with 2.0.x. That is variables take the form {X_YYYYY} with the data being assigned from the source. Note that unlike 2.0.x most language strings are not assigned from the source. When a language variable is found {L_YYYYYY} phpBB first looks if an assigned variable exists with that name. If it does, it uses that. If not it looks if an exsting string defined in the language file exists. This should reduce the need to assign loads of new lang vars in Mods.
I didn't understand something and I want to explain my problems with an example: ucp_profile_avatar.html

At Line 12 there is a code

Code: Select all

<tr>
		<td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
		<td class="row2" align="center"><br /><!-- IF AVATAR -->{AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --><br /><br /><input type="checkbox" name="delete" />&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span></td>
	</tr>
At
{L_CURRENT_IMAGE}
phpBB looks for $lang['CURRENT_IMAGE'] and it founds it in the language-file ucp.php in Line 116

Code: Select all

	'CURRENT_IMAGE'				=> 'Current Image',
But at Line 8 there is a code

Code: Select all

	<tr>
		<td class="row3" colspan="2" align="center"><span class="gensmall" style="color:red">{ERROR}</span></td>
	</tr>
and at
{ERROR}
phpBB looks for a variable $error?!

Where is the variable set?
I'm German, so I can't speak English very well...

User avatar
jojobarjo32
Registered User
Posts: 164
Joined: Wed Jun 22, 2005 7:38 pm
Location: France

Re: Templating ... a simple guide

Post by jojobarjo32 » Fri Apr 14, 2006 7:51 pm

No :) phpBB checks for an assigned template variable ERROR.
These assigned variables are made by the $template->assign_vars() method.

Post Reply