Developer forum

Forum » Templates » Advanced Templates

Advanced Templates


Reply

Hi everyone, i would like to know if there are any plans for the templates to beable to handle IF and or loops?


 


so you would be able todo like this:


if(@ParagraphImage != "")


{


 



 


 



}


 


something like that.



If there are no plans of making this, how come? And would you consider implanting it?


Replies

 
Reply
jed@dkis.dk wrote:





Hi everyone, i would like to know if there are any plans for the templates to beable to handle IF and or loops?




so you would be able todo like this:








if(@ParagraphImage != "")


{



}


something like that.



If there are no plans of making this, how come? And would you consider implanting it?










Hi all




 




I would ofcouse be a nice feature, but i guess i also would make templates much more complicated to user for those there not are "Nerds".




 




A better solution in my mind would be giving us the posibility to choose between the classic way, with html-templates, or with xml/xsl transformations




 




Then we would have the best of both worlds.




Easy and fast implementation in classic, and all all posibilities with xml/xsl.




 




 




You can achive a lot of what you want, by using clientside javascript, and with todays browsers and computers, i dont think thats a problem, unless you have some information you absolutly do not want responded to the user.




 




/Kenneth

 
Reply


I'd like to see an {IF} block possibility as well. For instance, now in the default ecommerce templates the productlist always shows a "next" and "previous" link for the paging.



It's done with:



>Forrige

>Næste



If there is no previous page, the "Ecom:ProductList.PrevPage" value is just an empty string. But it still shows a previous page link on the website. (logical)



It would be nicer to see that it is somehow possible to not have the
For instance a nice syntax could be:





   

   
>Forrige

   





   

    >Næste

   





Maybe the Dynamicweb developers can think of something.



For now, we work around these issues by using the ProductListExtenders and PageTemplateExtenders of the Dynamicweb Ecommerce Extensibility API.



A bad example would be using javascript to hide some block of html code from the page. For instance you could do:





   





   











This works quite well, but it's an awfull waste of data. (for smaller sites not a problem, but think of huge high traffic websites, when u might want to keep the amount data transferred from webserver to client as small as possible).

In that case it would be nicer if the server would have already made the decision which parts of (html) code to render or not.



Hope you enjoyed the story ;-)






 
Reply

#1 - It doesent complicate things for people with "less" coding experiences it just makes our lifes alot easier, you can eigther choose to use the statment or not, just like every other tag , but i agree that XSLT rederings would be nice, but that would change the system completely instead of making the template system more flexsible.

 

You must be logged in to post in the forum