GetSimple Support Forum

Full Version: Can we use Template engine for Get-Simple need suggestion from GS Team
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi Get Simple Team
I'm big fan of Get-Simple Cms really easy to use and implement, i like different themes we can use in it, i have one question regarding themes, in theme development GS team has use different function to call content and sections what about if we use some template engine to create theme because every designer is not programmer give more ease to designer with some theme engine smart codes, like right now we are using get_header() to create page header we can do with theme engine smart code like {$header} and we can use more smart code to create theme call different content from xml files,

i have tried GS with Rain TPL theme engine which is really small footprint and easy to use and deploy and not same like smarty or Dwoo but similar to these engine

for more features please visit
http://www.raintpl.com/Home-1

i have given try to rain tpl with GS got some good result but not 100%
Personally I think template engines merely add another layer to the process and complicate and extend the learning curve. After all, php is a templating engine.

One of the things that I find so pleasing about Get-Simple is that the presentation layer is html and css with predefined functions (your template tags) that you drop in to call the dynamic content.

What is the difference between <?php get_header(); ?> and {$header} in your template? Well, you need something to go find the {$header} tags and then execute the get_header function, then replace the {$header} tag. Doesn't that double the work to achieve the same thing?

Also, you have the ability to create your own custom functions (template tags). With a template engine, the template engine would have to be made aware of the functions and the custom variables in your template. This would be yet two more steps to perform to accomplish a single task.

You want to see what adding a template engine does to designing a website? I challenge you to build a template (theme) for wordpress in just a couple of hours.

You don't have to know a single thing about php to use the current system. All you have to do is go to the documentation on template tags, copy the tag that describes what you want for dynamic content and paste it into the template.

Remember, this is Get-Simple, not Get-Complicated.
The are many template engines. Another is smarty.

I'm sure you could use one of those template engines if you wanted to.

-Rob A>
herb Wrote:What is the difference between <?php get_header(); ?> and {$header} in your template? Well, you need something to go find the {$header} tags and then execute the get_header function, then replace the {$header} tag. Doesn't that double the work to achieve the same thing?

yes you are right but once your file is compiled with the engine it will not do the same thing again and again it will create a cache file for template will call that file next time. and things are getting more and more simpler for designers and for those also who don't know about php
I could offer mine new Template Engine called TIDEngine. I could also help to implement it. If devs are interested. Some as I didn't finish site GETSIMPLE BASED. Some basic data copy/paste from site on Localhost.

As most other Template Engines, TIDEngine have one purpose to seperate code and layout. TIDEngine take power of PHP for complete code processing, so there are no new syntax to learn. Also TIDEngine do not mix coding with design at all, means there are no loops, conditions...
That is PHP job to be done.

You just need to include reviously defined {SHORTCODE} in yours template files.

TIDEngine MAIN ASPECTS:



TIDEngine main aspect is Web Site and SEO Optimization. So complete development is based on main Web Site and SEO Optimization Rules. Means that TIDEngine gets maximum poits with Google Page Speed and Yahoo YSlow.

With optimal configuration included Test Page Results:

- 10 Javascript files in size of 300K, after processing gives 1 Javascript Cache File in size of 59K or 2 Javascript Cache Files in size of 60K.
- 2 CSS files in size 7.5K, after processing gives 1 CSS Files in size of 2K.
On Locahost Test Page gets :

* Google Page Speed = 100 points
* Yahoo YSlow = 98 points

Final page size YSlow = 62.8K.

FEATURES:

1. Optimize Javascript files with one of included Javascript packers:
* Packer
* JSmin
* JShrink
* JSminPlus
* JSminPlus

Use native Javascript and Framework minified version of files. If they do not exist TIDEngine create them.
You should expet High Server load so please use it only once and set expire headers in far future, or them on local machine.
2. Optimize CSS files with native TIDEngine CSS Files Optimizer not CSS Cleaner just removing whitespace and comments:
3. Reduces the number of HTTP requests:
* combinig all Javascript Files in one or two files (native Javascript and Framework).
* combinig all CSS Files in one file.
4. Reduces the size of the HTTP response by compressing all componets with gzip (Javacript, CSS and Template Files).
5. Use Client Caching for all Page Components (Javacript, CSS and Template Files).
6. Use Server Caching for all Optimized Page Components (Javacript, CSS and Template Files).
7. Page cache versioning and on fly page data changes check. So if any there are any data changes on page new cache file will be created.
8. Cache expiration check. If one of Cache Files expire new will be created, all other wil be in use untill they expires.
9. XHTML Code Optimization. There are 2 possibilities. You can indent XHTML or remove all whitespace and put complete XHTML in one line.
10. Browser detection TIDEngine and Browscap build in support for native get_browser() function.
just my 5 cents:

this CMS is intended to stay "simple" and template engines will unneccessarily complicate the really (mostly) transparent themes (just some template-tags )

In my experience (CMSMadeSimple with Smarty) template-engines ARE helpful, but not in "our" small and transparent environment and I do hate to have situations like

CMS <=> Template-Engine

when it comes to problems. Who will guarantee support for that?

Who will understand and tell what is GS and what is Template-Engine?

I experienced situations where I got no solution just answers "This is not our beer, do learn SMARTY ..." or total disorientation when trying to learn Smarty for my small needs, and by that I lost the reason where I started (just a little functionality which I wanted to change)

I understand your eagerness and devotion to integrate your template-engine into existing projects, but please do search other objects for your desire.

Let us stay simple!

PS:
@bogyvet,
I read the licence conditions for your template-engine at your site http://siteinfoservice.com/,
that kind of licence is not compatible with GS licence (no commercial use, no source modification etc.)
totally agree with Connie
agreed with Oleg, Connie and herb. We are NOT changing our template engine. The goal is to keep is simple, and making a new template engine does not achieve that.

WordPress uses the same exact type of template engine as we do - and after 10 years or so, if they haven't felt the need to change, i feel like they've picked the best option. As have we.
Hello,
this topic is old, but I didn't want to open the same topic again.

I agree with the above comments, that a Template Engine for the Frontend Templates is not needed, as the Templates of GetSimple CMS are easy in structure and straight forward without the need of a Template Engine (TE).

But there are benefits of working with a TE when you deal with Modules (Plugins).
I am currently working with the Blog Plugin and frankly, for a standard user, new to PHP at al it is a very dificult thing to deal with the php based template.
Another benefit is, you as Developer can provide your template and the user/designer could make a simple override of it (for example in the directory data/other or another place where it won't be overwritten once your Module is upgraded).
Another benefit is, you don't need to use the eval-function to get your template displayed.

I know that there are many different Template Engines on the Open Source Market.
Many of them are too big for a CMS like this one.
And yes, you can say PHP can be used as TE as well.
But ask yourself this question: is it easy enough for non-developers to customize the layout?
There is just a little more work for the developer in the first stage, but later on even the developer will benefit from the logic/layout separation as he has no need to handle all the HTML inside his PHP code.

If there is no future plan to implement such a Template Engine into the core, how could it be implemented as a plugin so developers could "hook" into it if wanted?

I am new to this CMS but I am willing to share my (limited) skills and knowledge regarding Template Engines. I used dozens of them and there are lots of different Engines with a different focus.
My own focus lies on simplicity.

Interestingly I used RainTPL this time, without any know of this thread.
The Thread was started by someone suggesting the same TE.
And it's true that it is very lightweight (35kB only) and easy to use.
The Templates are cached so there they are even faster than the use of EVAL.
Generally I use the TWIG TE, but this one is bigger and I didn't want to overwhelm anyone with its size (and lots of different files whereas RainTPL uses ONE File and ONE Class only to handle all the work).

And yes, I agree with all of you that there is no or little use of a TE for the GetEasy Templates itself, but lots of benefits in its use for Plugin Layouts.

Kind Regards,
Serenado
I would like to see something basic like moustache.
Someday I intended to experiment with haanga (django-style for php) and GS.
Hello.
Thanks for your reply Shawn and Carlos.
Knowing that the willingness to think about it exists, is a big step forward IMO.
Maybe we can find a good soultion with a sound balance of simplicity for developers and designers as well.
Some Template Engines are easy in Syntax for the layout but a hell of work for developers (who provide the VARs for the PLACEHOLDERs).
I like RainTPL because it's balanced (and easy to learn plus well documented) but I am not stucked to it.

Kind Regards,
Serenado
I like GS like it is: PHP is the templating language, like WordPress.

But I think it could be nice to have plugins that let people use other templating engines instead of php.
Hello Carlos,

as for many things PHP for the Layout has its Pros & Cons.

Quote:The upside of it ...

~ The full power of PHP is available
~ No compiling
~ Error reporting is handled by PHP
~ No string parsing overhead
~ No regular expression overhead (this can be pretty expensive)
~ When using short tags, it actually looks like a template language.
~ PHP is easy to learn for simple procedural things like loops and variable output.

...and the downside

~ The full power of PHP is available (you might want to restrict access to the language)
~ Output is immediate (this can be overcome with output buffering.)
~ Templates need to be evaled if they reside in a database (or text file) - making debugging difficult
~ Template writers may need to be educated and learn some simple PHP
~ There will be a temptation to put more than display logic in the templates
Source: http://thephppro.com/articles/pte.php

My idea to use a TE along with GetEasy came while working with the GS Blog Plugin.
In Blog Manager >> Settings you can provide a custom Template.
But it contains all the heavy PHP stuff (logik) and makes it very dificult to focus on layout alone. And I am used to PHP, so that's not the issue.
I agree that PHP can be used for templating (and there are even Template Engines which use PHP and PHP only for Template Files like Savant3 or PHPTemplate/Drupal ).
Of course, you can make it even without a TE at all.

I mentioned above that I usually use the TWIG Template Engine which is a little bigger than RainTPL.
Fabien Potencier from SensoLabs/Symfony Project wrote an interesting article regarding "So, you think PHP is a templating engine? So did I... for a very long time....", shortly after he picked up and reworked the TWIG TE.

There are also Benchmarks on the above page covering many different TEs (and one of my reasons I use TWIG is its speed).

Please have a look.
I am open for communication and ideas.
And as I already said, I am not interested in a TE for the GetEasy Templates, but for its Plugins.

Kind Regards,
Serenado
I do think light layouts for non programmers would help themers make components and modules.
+1

:-)
Just wanted to add half a cent here. Id honestly hate to see GS on a template engine. I personally find them tedious as you often end up having to that engines template variables which in a lot of cases is just as complicated as learning to code which defeats the purpose of being simple.

GS in its current state is excellent because if you want the main content in a certain place you just add a "Simple" php call that is not 2 paragraphs of code. You dont have to add a bunch of if's and's or but's to a template like you do with the various template engines and Wordpress. I use GS for everything just because of that simple feature. Being able to deploy a web site design in GS quickly was the critical point of my choosing it for nearly every web site I do. If every CMS took a note from how GS handles its self I would be alot more flexible in my CMS choices. The most complicated I will even use is Web Site Baker. If it wasnt for GS, sNews and Baker id just stick to static html for everything.
I hate Smarty and all that stuff, I remember writing templates for CMSMadeSimple

We should stay where we are: clear and simple AND a good WIKI and documentation

these template machines take the processing from the CMS to the template, that is not good.

Stay clear! Be Simple! GetSimple!
It would be nice if there was some plugin that lets you use some templating engine in your theme (or/and components).
But as a plugin, not in the core.
(I don't know if it can be done without patching GS, I still have not experimented with this.)
I meant a light templating system like mustache or underscore.
definetly not something like smarty.
will we be able to support all that?
I think so, they are fairy lightweight.
Ad would let people make reusable
Modules for blogs and news articles and lists of stuff.
These are known as logic less templates.
And they should be able
To be mixed in with normal HTML and php files.

if you need to output a list of something you do not need to handle the loops yourself, you just use the list template syntax and all the looping and logic is handled for you.

Of course I haven't really used them
Before so a test would be needed
in the plugin i'm developing i'm adding a vey simple and php based template engine.

it's about twenty lines of code, and it just "imports" variables from an arrays and makes them available in the local context of he plugin. i'd like to see it added to GS code base when the plugin is finished.
there is no search and replace going on. the template is interpreted by php as a php file.

it's main use is to get a better separation (and an interface) between the logic and the presentation.
this can be done also without a template engine, but it's harder to make sure that the two contexts don't get mixed.
(2013-02-11, 04:59:48)ale Wrote: [ -> ]there is no search and replace going on. the template is interpreted by php as a php file.

I'd love the check it out when/if you release it, good work!
(2013-02-07, 01:45:00)Carlos Wrote: [ -> ]It would be nice if there was some plugin that lets you use some templating engine in your theme (or/and components).
But as a plugin, not in the core.
(I don't know if it can be done without patching GS, I still have not experimented with this.)

You can run a Template Engine like RainTPL or TWIG without the need for patching the CORE of GS.
I rewrote 1 file in the GS Blog Module, uploaded RainTPL and now I can use Templates for the overview and single blog post comfortably.
It's really simple and RainTPL is very fast and easy to use (and small in size, ca 35kB).
More information here:
http://www.raintpl.com/Quick-Start/

Kind regards,
Serenado
Pages: 1 2