How to minimize the amount of "{" and "}" in template?

Author Message

Wei Dai

Monday 14 July 2008 10:51:17 pm

Hi,
I find this is really inconvenient. For example, that every time I need use "if", I need use {if ...} ... {/if}, even when I was in the { }:
Is there a way to use the following format?

  {def $variable = "hello"
      if  condition
          something
     endif
  }

Right now, I must break the previous template language tag use "}" then use the {if}..

  {def $variable = "hello"
  }
      {if  condition}
          something
       {/if}

This is really not very comfortable.

Certified eZ Publish 4 developer looking for develop information & collaboration.

Piotrek Karaś

Tuesday 15 July 2008 2:08:00 am

Wei,

Could you please explain how can that be so inconvenient?

Also, keep in mind that your code will significantly differ from what other developers are used to. This may be a reason enough not to break the conventions.

Cheers,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Łukasz Serwatka

Tuesday 15 July 2008 2:58:35 am

Hi,

This is not possible with eZ Publish template language and eZ Template component as well.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

James Stevens

Tuesday 15 July 2008 4:15:48 am

Yes i understand where you are coming from. But i haven't seen any other way of doing it.

It's kind of a tag based language, so coming from ColdFusion you may find it easier than say PHP.

At least it's neater than this...

  <cfif cgi.Remote_Addr DOES NOT CONTAIN "192.168.32.">
    Your Code
  </cfif>

So glad i don't use ColdFusion anymore, it feels like writing a book!

James

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.