Sitecore tips and tricks and community news !

Post Top Ad

Post Top Ad

Thursday, August 31, 2017

9:16 AM

InfoMEET Conference

June 10th I had a pleasure to be the speaker on InfoMEET conference in Wroclaw. InfoMEET is a place where many people from IT world can share their experiences and get to know more with others specializations in wide IT world.



Because of very large scope of technologies on this conference, I've prepared topic:

"Sitecore – Example of Digital Marketing Platform"

SoftServe picture

My main goal was to encourage other IT guys like students or .Net developers into Sitecore. I have described client needs and solution which Sitecore gives them on to that.



I hope for every participant this was a valuable time :)

Sunday, August 6, 2017

7:37 PM

WFFM Action add contact to contacts list, extend conditions

All of us know WFFM very well and made there a lot of things. We would like today focus on particular action - "Add Contact To Contact List"

In general, this action is used to adding some contact data gathered from form and push this information as a contact to some list in List Manager. More details information is available in documentation here.

This action has very useful things - conditions:


It provides ability to create conditions based on fields you have in your form to add contact to the list. Developer see list of checkboxes what is userfriendly. 

List of checkboxes works as an 'OR' condition, so first true statement return true for whole list.

What in case when we want to have 'AND' condition and check if all selected checkboxes give true? Is it possible?

Sure, it is ! :)

I had already custom action which has been inherited from default action "Add Contact To Contact List". If you don't have this situation it's good to make it in this same way.

When we decompile this action we see:


Highlighted area on red show us part of code responsible for checking our conditions. To change it we have to take a look how it's working currently and how we can change it. Hence, during digging we see:





Selected area shows exactly, when some condition return true, the whole method return true as well. Right now, we have to think how to change it to AND condition ? I propose to create an array of results per each condition, then check if all of them return true. Since we will have that information we can decide if whole method should return true or false.





Later we have to only use our method implementation in our custom action. That's all ! It's working perfectly :)

Make conditions in that way and give content editors more possibilities :)