Thursday, March 14, 2019

Sitecore Hackathon 2019 Experience


Its been two weeks since the Sitecore Hackathon, the competition that I wait for to come every year. I would like to write a bit about my experience participating in it.

This is the third year I participate in it with my favorite team (Vision Team) Hanin Daoud and Duaa Abu Gharbieh from Jordan. This time, I participated with them from the USA, and despite the time difference, we were able to make this happen!

Prior to the beginning of the hackathon, my friends and I had a long call discussing some potential ideas that we might be able to use if any of the categories that were going to be presented suit with one of them.

During my work with Sitecore CMS, one of the ideas that I have always wanted to implement is adding a feature to enable the user to select more than one item at a time and delete them all together.

When we received the kick off email, I was so excited that one of the categories presented is suitable with this multi selection idea.

With the great help of my team, we were able to create a multi selection feature that enables the user to select more than one item at the same time, and we implemented this functionality in both publishing and deleting.

Following is a short video explaining what we did:

Unlike the last two hackathons that I participated in, this is the first time that I actually am hopeful to win 😊 as I feel that what we did is a great feature that makes content authors’ lives much easier!

Looking forward to the results of the Hackathon..

Good luck to all participants!



Adding an SMS Link (href=sms:) to the General Link Field Type in Sitecore


In this blog, I am going to explain how to add a custom SMS Link to the General Link Field Type in Sitecore. I always use this sms functionality in my website, so I thought, why not adding it as a custom type in Sitecore so that I would be able make use of it in rendering it as Sitecore Link Field

In order to add this custom sms link, let me walk you through the steps:

1- Login into Sitecore and go to the Core Database.
2- Add a new item under the following path /sitecore/system/Field types/Link Types/General Link/Menu
In the following screenshot, it is named as "SMS".



3- Fill in a display name for this item (e.g Insert SMS Link). This field value is the text that is displayed when you add a general link field to a template and go to an item of this template to inset a link:


4- Set the message field to: contentlink:smslink(id=$Target). This is the case that would navigate the user to the InsertSMSLink Form when he clicks on "Insert SMS Link".



5- Create a class called "SMSLink". This class is going to open the SMS Link Form popup when you click on "Insert SMS Link" link. It checks for the "Message" value and opens the popup accordingly:


6- Navigate back to the Core database, and go to the following path: /sitecore/system/Field types/Link Types/General Link. Set the value of the "Control" field to : content:SMSLink.

7- Add a new customized config file in order to register the SMSLink Control:

8- Now let us add the xml of how the popup would look like when the user clicks on "Insert SMS Link". This file has to be added to the following path : "/sitecore/shell/Applications/Dialogs". Create a new folder there to place the xml file in.


9- When the user fills in the message, and clicks on Ok, the following code will be executed: Another class is created too as a processor to render the SMS link (RenderSMSLink):

10- In order for this processor to work, you need to patch a configuration for it under the pipelines section:

You are all set now!

This way, we are going to still be able to render the link as an Html Sitecore Link (@Html.Sitecore().Field(Templates.TemplateName.Fields.ItemLink,Item))

Hope this is useful :)

Happy Coding!