Today we will see how Sitecore Rocks can simplify the creation of Layouts and Sublayouts for developers. Without Sitecore Rocks if a developer wants to create a new layout or sublayout in Sitecore, they would log into the web interface and create one using the Content Editor. This method however doesn't create a code-behind or designer files associated with the layout or sublayout. Let's see how Sitecore Rocks simplifies this for developers.
Create a new Layout / Sublayout
To add a new layout or sublayout, right click the location in Visual Studio's Solution Explorer and select "Add -> New Item." To create a layout, navigate under the Sitecore section to Layouts and select "Layout.” To create a new sublayout, navigate under the Sitecore section to Renderings and select "Sublayout." Give your layout or sublayout a name and click the "Add" button.
After clicking the add button a new dialog will appear asking if you would like to create a Sitecore item for the new layout or sublayout. Navigate to the location in Sitecore where you would like the item created and click "OK."
We have successfully created a layout or sublayout both in Sitecore and the file system, and these are associated with one another.
Editing a Layout or Sublayout
Editing the properties of layout or sublayout items is just as easy as editing content items. This can be done in one of two ways. If you are navigating within the Sitecore Explorer you can locate the item and open it by double clicking. If you are navigating from the Solution Explorer, right click on the layout or sublayout file and under the Sitecore menu select "Edit Item."
If you have a layout or sublayout that was created in Visual Studio but doesn't have an associated item in Sitecore, you can create the item in Sitecore by right clicking the file in the Solution Explorer and under the Sitecore menu select "Create Items from Files.”
This will open a dialog prompting where in Sitecore to create the associated item for the layout or sublayout.
As you can see, Sitecore Rocks can improve even the small tasks such as creating layouts and sublayouts.
Stay tuned for more Sitecore Rocks features tomorrow!
Hi Trevor. I'm getting an error about missing the Sitecore.Rocks.Template.Wizard.dll when attempting to create a sublayout as described. I have loaded the SiteCore Rocks plug-in twice but no luck. Any tips on working through this?
I was getting an error about missing Sitecore.Rocks.Template.Wizard.dll. I was able to find the dll at c:\Users\[username]\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Sitecore\Sitecore Rocks\0.7.5\ and copy to: c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\ It fixed my problem.
After clicking the New button in add new sublayout item, the sitecore dialog doesn't appears, instead a new ascx control is created and that's basically it. I've been running vs 2010 and vs2012. Is there any configuration option that solves this? Thank you
2 John Paul and Eloy , try to right click on project -> Sitecore ->Connect... and setup connection to your Sitecore instance. Worked for me
Yes, it works! you have to connect the site with an instance of sitecore. thank you
Furthermore, you need to have your connection set up to use the "Hard Rock Web Service". I was somehow using the "Good Old Web Service", and it was unable to choose "Create Items From Files".
Error:this template attempted to load component assembly sitecore.rocks.TemplateWizard, version=184.108.40.206,Culture=neutral,PublicKeyToken=c9e2eeb5a3dd9908,processorArchitecture=MSIl.for more information on this problem and how to enable this template,please see documentation on Customizing project Templates