Developer forum

Forum » Development » Get overridden default parameter value

Get overridden default parameter value

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

How can I get the current paragraph's overridden default parameters's value from Product Catalogue?

 

I can get Pageview.CurrentParagraph.ModuleProperties.get_Value("QueryConditions​") but then I still need to encode/decode it, and parse it to get the prover value from a specific parameter. I am sure there must be an easier way. Can you help me?

 

In other words, I am looking for the overriden value of a specific parameter form the current paragraph's module properties.

 

Best Regards,

Nuno Aguiar


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi Nuno,

You can try something like this...

var queryConditions = Dynamicweb.Frontend.Pageview.CurrentParagraph.ModuleProperties["QueryConditions"];
var isDefault = false;
var queryParameters = Dynamicweb.Indexing.Querying.QueryHelper.TransformIndexQueryParameters(queryConditions, null, ref isDefault);

Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Morten,

 

Thanks, this is just what I needed. I had to change one thing through (getting the current context). For future reference, here's the piece of code

 

var properties = Dynamicweb.Frontend.PageView.Current().CurrentParagraph.ModuleProperties;
var queryConditions = properties["QueryConditions"];
var isDefault = false;
var queryParameters = Dynamicweb.Indexing.Querying.QueryHelper.TransformIndexQueryParameters(queryConditions, null, ref isDefault);

 

Best Regards,

Nuno

 

You must be logged in to post in the forum