I have an asset listing to display staff name and their social media links. The data was uploaded as csv data source record. Some staff members don't have facebook links and some don't have twitter accounts and so on. I would like to filter the empty fields out but don't know how. Is anybody able to help please?
Conditional keywords for CSV data source record
If you just want to conditionally display some values depending if they have anything in them or not, you could just use a keyword modifier use use the begin/else/end format: http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/conditional-keywords
Is that what you are after?
Yes, I did try begin/else/end format, however, it didn't work. An example of the codes is like <a href="%ds__linkedin%"><i class="fa fa-linkedin-square"></i></a>. I tried %begin_metadata_ds_linkedin%<a href="%ds__linkedin%"><i class="fa fa-linkedin"></i></a>%end_metada_ds_linkedin% but perhaps the codes weren't quite right.
By the way, the link that you gave in your reply doesn't work any more.
By the way, the link that you gave in your reply doesn't work any more.
The forum sometimes adds a space at the end of the URL. It should be:
http://manuals.matrix.squizsuite.net/keyword-replacements/chapters/conditional-keywords
So Sobeweb, did you find out how to do this? I've tried using the ^empty modifier, but it doesn't work.
Can someone please send in the answer?
Yes, I did try begin/else/end format, however, it didn't work. An example of the codes is like <a href="%ds__linkedin%"><i class="fa fa-linkedin-square"></i></a>. I tried %begin_metadata_ds_linkedin%<a href="%ds__linkedin%"><i class="fa fa-linkedin"></i></a>%end_metada_ds_linkedin% but perhaps the codes weren't quite right.
By the way, the link that you gave in your reply doesn't work any more.
That keyword format doesn't look quite right, the metadata part should probably not be there, also missing double underscore. Should probably be
%begin_ds__linkedin% <a href="%ds__linkedin%"><i class="fa fa-linkedin"></i></a> %end_ds__linkedin%
I did this and it worked.
%ds__linkedin^replace_keywords:notempty:%
For some reason the post won’t let me display the whole line of codes but the not empty command did work.