Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 13, 2012, 12:58:19 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
149699
Posts in
21103
Topics by
7538
Members
Latest Member:
ionline
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
Upcoming: Template Engine (x_FastTemplate2 compatible)
Pages:
1
[
2
]
Go Down
Author
Topic: Upcoming: Template Engine (x_FastTemplate2 compatible) (Read 3832 times)
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #25 on:
September 23, 2009, 12:31:22 PM »
There's another update (see link above).
It's now possible to {{ :include }} other template files.
Logged
mr-fan
Offline
Posts: 1538
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #26 on:
September 28, 2009, 10:45:27 PM »
hi bianka,
started testing today/night....looks nice...i've start with a little template with the setup....and you know where i'm stuck? jes on the SM2 call....
like to see your template engine with the EM for website baker 3.0
you did a great job!
if i finished the template i will post it as a example for usage...but this takes maby two weeks (work is hard - much work in my office and homeside on my farm...
)
i want finish some tutorials for the new project, too - so time is precious!
just a feedback for you that i don't forget to test your work...
regards martin (wish you a quiet week)
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #27 on:
September 29, 2009, 09:37:30 AM »
Thank you, Martin!
There are some (unresolved) issues with many nested {{ :if }} and {{ :loop }} statements, but on the whole it seems to work pretty good.
I don't think that the Engine will be included with WB 3.0, but hey, you're still free to use it.
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #28 on:
September 29, 2009, 10:11:03 AM »
Here's a complete usage example:
Template (WB Backend):
Code:
{{ :include admin_header.htt }}
<form action="{{ action }}" method="post">
<input type="hidden" name="do" value="users" />
<table>
{{ :if users }}
<tr>
{{ :comment Suchformular }}
<td colspan="3">
<label for="search">{{ FILTER }}:</label>
<input type="text" name="search" id="search" value="{{ search }}" />
<input type="submit" value="{{ BUTTON_SEARCH }}" />
<input type="submit" id="reset" name="reset" value="{{ BUTTON_RESET }}" />
</td>
<td colspan="3">
<form action="{{ action }}" method="post">
<input type="hidden" name="do" value="users" />
<label for="limit">Anzeigen pro Seite:</label>
<select id="limit" name="limit">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<input type="submit" value="{{ SAVE }}" />
</form>
</td>
</tr>
<tr>
<th><button class="btn" id="so" name="so" value="email" type="submit">{{ EMAIL }}</button></a></th>
<th><button class="btn" id="so" name="so" value="votes" type="submit">{{ VOTES }}</button></th>
<th>{{ REG_DATE }}</th>
<th>{{ LASTVOTE_DATE }}</th>
<th>{{ LASTVOTE_ITEM }}</th>
<th></th>
</tr>
{{ :loop users }}
<tr>
<td>{{ email }}</td>
<td>{{ votes }}</td>
<td>{{ regdate }}</td>
<td>{{ last_vote_date }}</td>
<td>{{ last_vote_item }}</td>
<td><a href="{{ action }}&do=users&id={{ user_id }}">{{ HISTORY }}</a></td>
</tr>
{{ :loopend }}
<tr>
<td colspan="3">{{ prevlink }}</td>
<td colspan="3" style="text-align: right;">{{ nextlink }}</td>
</tr>
{{ :ifend }}
<!-- BEGIN template comment -->
<tr>
<td colspan="6" style="text-align: right;">
<input type="submit" name="save" class="button" value="{{ save }}" />
</td>
</tr>
<!-- END template comment -->
{{ :if nodata }}
<tr><td colspan="6">{{ nodata }}</td></tr>
{{ :ifend }}
</table>
</form>
{{ :include footer.htt }}
Code to fill and print the template:
Code:
<?php
if(!
defined
(
'WB_PATH'
)) die(
header
(
'Location: index.php'
));
// get language strings
global
$MOD_VOTES
,
$TEXT
;
// include the lib
include_once
dirname
(
__FILE__
).
'/../wblib/class.wbTemplate.php'
;
// create an instance
$tpl
= new
wbTemplate
();
// >>>>> the following instructions can be used in any order
// remove empty placeholders
$tpl
->
setBehaviour
(
'remove'
);
// set template dir
$tpl
->
setPath
(
dirname
(
__FILE__
).
'/templates'
);
// set template file to use
$tpl
->
setFile
(
'admin_users.htt'
);
// <<<<<
// get the template data
$tpldata
= array (
'action'
=>
'http://localhost/_projects/wb28/backend/admintools/tool.php?tool=voteforanything&do=users'
,
'prevlink'
=>
NULL
,
'nextlink'
=>
NULL
,
'search'
=>
NULL
,
'tabs'
=>
'<li> <a href="http://localhost/_projects/wb28/backend/admintools/tool.php?tool=voteforanything&do=overview" >Übersicht</a></li>
<li> <a href="http://localhost/_projects/wb28/backend/admintools/tool.php?tool=voteforanything&do=users" id="current" >Benutzer</a></li>'
,
'users'
=>
array (
0
=>
array (
'user_id'
=>
'6'
,
'email'
=>
'b...@....de'
,
'password'
=>
'*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'
,
'regdate'
=>
'28.09.2009 18:03:43'
,
'reg_ip'
=>
'127.0.0.1'
,
'votes'
=>
'4'
,
'lastvote'
=>
'1254155959'
,
'vkey'
=>
'UJOYtdHmfAnkhtXDJHbNLHZy0NYBaX9l'
,
'vote_history'
=>
array (
0
=>
array (
'page'
=>
'33'
,
'item'
=>
'2'
,
'timestamp'
=>
1254155168
,
),
1
=>
array (
'page'
=>
'33'
,
'item'
=>
'2'
,
'timestamp'
=>
1254155529
,
),
2
=>
array (
'page'
=>
'33'
,
'item'
=>
'2'
,
'timestamp'
=>
1254155833
,
),
3
=>
array (
'page'
=>
'33'
,
'item'
=>
'2'
,
'timestamp'
=>
1254155959
,
),
),
'locked'
=>
'N'
,
'last_vote_date'
=>
'28.09.2009 18:39:19'
,
'last_vote_item'
=>
'2<br /><span class="mod_votes_small">(Seite: VoteTest)</span>'
,
),
),
);
// print template; mix template data with language strings
$tpl
->
printTemplate
(
array_merge
(
$tpldata
,
$MOD_VOTES
,
$TEXT
) );
?>
Result: See Screenshot
Logged
mr-fan
Offline
Posts: 1538
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #29 on:
September 30, 2009, 12:50:32 PM »
hi bianka,
if made a little testtemplate for the frontend....without Page_content(); and showmenu2();
but for a short demonstration that it works at this state...
just install WBLib as module + the attached template install as template...
it's a round-box-demonstration from the web if found somewhere...
if you implement frontendtemplating functions to use showmenu or page_content i will provide to improve the demotemplate to get a basic example for creating templates...for frontend
userfriendly for useing such functions id like to see something like this ==> if this is possible! i don't know that! so it is more a question instead of a request....
in xft2 the call of a function is like this one...with capture_echo:
Code:
<?php
//nice colors mode
'pagehead'
=>
$xft2
->
capture_echo
(
"simplepagehead();"
),
'description'
=>
$xft2
->
capture_echo
(
"page_description();"
),
'keywords'
=>
$xft2
->
capture_echo
(
"page_keywords();"
)
in WBLib it could be maybe easyer to read & use own functions that set up before in the index.php
like:
Code:
<?php
//nice colors mode
'mainmenu'
=>
get_by_function
(
"showmenu2(1);"
)
with a special call
for
such
"content"
or
only
.....?
'mainmenu'
=>
capture_echo
(
"showmenu2(1);"
)
i don't know - take you some time to think in calm about it
real good work until now!
regards martin
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #30 on:
September 30, 2009, 02:03:43 PM »
Thanks for testing and sharing your work!
It's good to hear that the template engine works for you.
There are still some open points,
capture_echo()
(or something similar) is one of the more important ones. ({{ else }} is another one.)
Logged
mr-fan
Offline
Posts: 1538
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #31 on:
October 01, 2009, 06:48:35 AM »
no problem - if you've take the time (absolute
no
reason for haste only if you realy have a breach
) i will extend the demonstration...
like:
Step 1: basic engine usage
Step 2: call functions
Step 3: usage of comments
Step 4: different options for markers (like :if :else :loop)
and so on!
just send me your work per mail or write me a PM!
regards martin
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #32 on:
October 01, 2009, 10:33:09 AM »
I am working on a template showcase, or to be more exact: An
index.php
that will work with most templates I can think of. For example, it looks into the Database to see how many content blocks are on the current page, calling
page_content()
for each of them, and allocating a placeholder named
page_content_<number>
.
The benefit is that, in most cases, you will only have to create the template, add the
index.php
, and are ready to go.
The drawback is that looking into the database and maybe calling a bunch of methods not used in the current template, will cause an overhead.
But hey, you're still free to create you're own
index.php
with less "intelligence".
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #33 on:
October 01, 2009, 03:11:46 PM »
Here's the template showcase I promised. I used the Vincent03 Template. You will have to install wblib v0.6 to check this out.
http://www.websitebakers.com/pages/libs/wblib.php
Logged
Stefek
WebsiteBaker Org e.V.
Online
Posts: 4755
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #34 on:
October 08, 2009, 01:41:21 AM »
Wow, ich kann nur wow sagen.
Irgendwie ist der Post an mir vorübergezogen.
Ich werde sicher einige Fragen haben, sobald ich etwas Zeit finde. Sieht aber super aus und mit meinen recht geringen php Kenntnissen kann ich nur staunen, was so alles geht.
Viele Grüße.
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #35 on:
October 12, 2009, 02:44:19 PM »
As of V0.7, the template engine can handle combined conditionals.
Example:
Code:
{{ :if prevlink || nextlink }}
<tr>
<td colspan="4">{{ prevlink }}</td>
<td colspan="3" style="text-align: right;">{{ nextlink }}</td>
</tr>
{{ :ifend }}
In this example, the code block will be removed if neither 'prevlink' nor 'nextlink' are set.
Logged
WebBird
Guest
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #36 on:
January 28, 2010, 06:26:43 PM »
For docs in english, see
http://www.webbird.de/wblib/en
Logged
Stefek
WebsiteBaker Org e.V.
Online
Posts: 4755
Re: Upcoming: Template Engine (x_FastTemplate2 compatible)
«
Reply #37 on:
March 18, 2010, 12:42:39 PM »
Hello Bianka,
where is your Lib now?
Can't find it - no where.
Is this still work in progress or did you give it up?
I wanted to test the template engine.
Regards,
Stefek
Logged
"In a time of universal deceit, telling the truth becomes a revolutionary act."
- George Orwell, Nineteen eighty-four (1984)
Pages:
1
[
2
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
-----------------------------
English
-----------------------------
=> Help & Support
-----------------------------
General
-----------------------------
=> WebsiteBaker Website Showcase
-----------------------------
English
-----------------------------
=> Modules
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
-----------------------------
General
-----------------------------
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
-----------------------------
General
-----------------------------
=> Security Announcements
-----------------------------
Deutsch (German)
-----------------------------
=> Hilfe/Support
-----------------------------
General
-----------------------------
=> Documentation
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
=> Module & Snippets
-----------------------------
English
-----------------------------
=> Archive (posts up to 2007)
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Deutsch (German)
-----------------------------
=> jQuery
=> Tutorials
=> Templates & Design
-----------------------------
English
-----------------------------
=> jQuery
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
===> Suggestions
-----------------------------
Deutsch (German)
-----------------------------
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
===> Vorschläge
-----------------------------
English
-----------------------------
===> Software bugs
-----------------------------
Deutsch (German)
-----------------------------
===> Softwarefehler
=====> Module / Extensions
-----------------------------
English
-----------------------------
=====> Modules / Extensions
-----------------------------
Deutsch (German)
-----------------------------
===> Erfahrungs und Testberichte
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...