Dear Sitecore Family,
The previous post, was about Configuring a Datasource in a Presentation Component and my friend Nikki Punjabi suggested that it doesn’t feel complete without showing the steps to add a datasource to a component. In a way, I agreed to his point, that the post seemed incomplete.
So this post is about the steps to add a Datasource in a Presentation Component – in our case a Sublayout. And as we are talking about Page Editor Experience, I’ll present the steps for adding via Page Editor.
- Login to Sitecore and open the Page Editor.
- Next, from the Page Editor Ribbon Click on the button Add a New Component.
- If the above shown button is disabled then it either means you don’t have rights or the Designing Checkbox is unchecked. Hence, go to the View Tab on the Ribbon and check the Designing Checkbox. Next, On clicking that button, We get the option of adding a new Component as below.
- These “Add to here” buttons show the location where we can add components, in the specific placeholders – in our case – sidebar and content. Click this button and we get an option of selecting a rendering. Select the Featured Posts component, check the checkbox “Open the Properties dialog box immediately.” and click select.
- And the component is added. Now, the Properties dialog will open.
- Next, click on Browse, and Select the Datasource from the Select the Associated Content Dialog.
- Now, Click Ok and the Item ID of your Datasource Item will appear in the Properties Window Datasource Field.
- Click on Ok and the component is rendered on the Page as below.
Hope this post was helpful and that it now completes the previous one!