Developer forum

Forum » Templates » UPDATE: Performance optimization

UPDATE: Performance optimization


Reply

Hello my fellow frontend geeks.

 

We have made a small performance optimization regarding navigation tags in Dynamicweb CMS that you might wanna know about.

 

This performance optimization can have an effect on how your @If Defined() tags might work, or not ;)

 

To optimize the performance of the CMS, we have changed so that navigationtags not used in a template are not created/defined by our code.

 

The effect of this are that, if you have an @If Defined(MyMenu) but you don't use @MyMenu in your template, then your @If tag will not work.  It will see it as if the tag is NOT defined.

 

Hope this will clear thing out ...

 

// Sebastian


Replies

 
Reply

Does the menutag need to be in the if defined "loop" or just somewhere on the page?

 

 

 
Reply
Sebastian,
Can you confirm that is only regarding navigationtags as you described?
We had a lot of "funny" issues regarding if defined() on solutions updated to DW7.


/Morten
 
Reply
Example from a not-custom solution:

This used to work:

<!--@If Defined(Ecom:Product:Field.myCustomField.Value)-->
    Show my text
<!--@EndIf(Ecom:Product:Field.myCustomField.Value)-->

<!--@If Not Defined(Ecom:Product:Field.myCustomField.Value)-->
    Show this text
<!--@EndIf(Ecom:Product:Field.myCustomField.Value)-->

But if we're not actually using the tag without If Defined the statement fails:
So now we had to update all templates with a hidden tag like this:

<!--@If Defined(Ecom:Product:Field.myCustomField.Value)-->
    Show my text <span style="display:none;"><!--@Ecom:Product:Field.myCustomField.Value--></span>
<!--@EndIf(Ecom:Product:Field.myCustomField.Value)-->

<!--@If Not Defined(Ecom:Product:Field.myCustomField.Value)-->
    Show this text
<!--@EndIf(Ecom:Product:Field.myCustomField.Value)-->

This is indeed a huge problem. Of course this could be solved with an xslt-template instead. Some of our solutions are setup years ago, and we are not using time monitoring them. But now we have to ... !?

/Morten




 

You must be logged in to post in the forum