eZ Community » Forums » Setup & design » How to minimize the amount of "{" and...
expandshrink

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

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

Tuesday 15 July 2008 7:51:17 am - 3 replies

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.

Modified on Tuesday 15 July 2008 7:53:35 am by Wei Dai

Tuesday 15 July 2008 11: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

Tuesday 15 July 2008 11:58:35 am

Hi,

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

Modified on Tuesday 15 July 2008 12:02:21 pm by Ɓukasz Serwatka

Tuesday 15 July 2008 1:15:48 pm

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

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from