Contents
How to deploy MVC code to Sitecore project?
To deploy your Sample MVC code to Sitecore you need a publish profile. Right click on your Visual Studio project and click Publish…. Select Custom for Select a publish target and enter a profile name. I typically name my publish profiles after their project, so I put SampleMvc.
Do you need web config file for Sitecore?
Sitecore comes with a Web.config and it’s considered best practice never to modify it directly. Visual Studio needs a web.config file for Intellisense to work properly, so we’ll leave it in the project but instruct Visual Studio not to copy it to the output folder on build/publish.
How to install Sitecore rocks in Visual Studio?
Download the Sitecore Rocks .vsix file, launch it, and follow the installation instructions. Open Visual Studio with administrator privileges, and you should see the “Sitecore” tab in the menu bar. In order to work with the Sitecore content tree using Visual Studio, we need to first ensure that they are both connected.
How do I publish Sitecore to IIs site?
Click Local IIS in the Target Location box and select your Sitecore instance under IIS Sites. Click Open and then click Next. On the final screen select Debug as the Configuration. Click Close and click Yes to save your publish profile. We will need to reference a few Sitecore dlls in this project.
What kind of renderings do you use in Sitecore?
Sitecore has two types of renderings for MVC components: controller renderings and view renderings. Holy wars have been fought (and are still being fought) in the Sitecore community about which is better. As a general rule of thumb, go with a controller rendering for components that have business logic; otherwise, go with a view rendering.
How to delete a sublayout in Sitecore?
Switch back over to the Content Editor. Right click on the original Sample Sublayout item under /sitecore/layout/Sublayouts and click Delete. When you get the Broken Links dialog, select Link to another item, and select the Sample MVC Sublayout rendering created above.
Where to find Sitecore sublayout.ascx in web root?
Navigate back to the web root for your Sitecore install (e.g., C:inetpubwwwrootSampleMvcWebsite) and open layoutsSample Sublayout.ascx in your favorite text editor. This is the Web Forms control referenced by the Sample Sublayout that comes with Sitecore out of the box.