+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Creating a new sustainable setup of Sitefinity 8.x

Creating a new sustainable setup of Sitefinity 8.x

8 posts, 0 answered
  1. Bil
    Bil avatar
    51 posts
    Registered:
    27 Aug 2012
    11 Aug 2015
    Link to this post

    Hi guys,

    Sitefinity isn't just installing the software and running it, you have to maintain it, upgrade it, build new controls and templates, and keep this thing alive along with working (hopefully) not just in a production environment.

    I've been taking a variety of "best practices" from the Sitefinity blogs, webcasts, etc. along with my own experience so here's a Big Dummies guide to get up and running with Sitefinity. This guy gives you the step by step to get up and running locally then remotely with Sitefinity and has the following features:

    * Custom ResourcePackage that doesn't interfere with the built-in ones

    * NuGet package based so you can do a full build without worrying about blowing away the "bin" folder

    * Custom Widget project that keeps in step with the version of your site

    * Environment specific configurations with transformations so you can deploy your single project to multiple places

    This is all common sense but I found it difficult as it didn't seem to be available in a single place of reference.

    This assumes:

    * You're using SQL Server 2014 for your database (although any one supported by Sitefinity works fine)

    * You're using Visual Studio 2013 (although I think you can probably do this with 2015 without any changes)

    * You'll build the site locally then migrate/deploy it to a variety of DEV/TEST/PROD environments

    SQL Management Studio

    1. Create a blank database in SQL Server

    Project Creation

    1. Create new project in Sitefinity Project Manager (I name mine the same as the database to keep track of things)
    2. Launch wizard and connect to database you created
    3. In the Sitefinity backend select Administration > Modules & Services
    4. Find Feather module and click Install under Actions menu
    5. Close browser
    6. Remove site from Project Manager (don't delete content)
    7. Shut down Sitefinity Project Manager from system tray
    8. Copy Projects/ProjectName folder with site in it somewhere else
    9. Launch Visual Studio 2013
    10. Open SitefinityWebApp CSPROJ file
    11. Rebuild the Solution (Ctrl+Shift+B)
    12. Run site (Ctrl+F5) to make sure it comes up and is working
    13. File > Save All (this creates a missing .sln file)

    Setup NuGet

    Add the Sitefinity to your list of Package sources so it can get the NuGet packages

    1. Tools > Options > NuGet Package Manager > Package Sources
    2. Click on the + icon
    3. Edit the values to be:
    Name: Sitefinity (or whatever you want here, doesn’t matter)
    Source: http://nuget.sitefinity.com/nuget/
    4. Click Update and OK to close the dialog

    Convert the SitefinityWebApp to use NuGet packages. This allows us to do a clean build and use things like TeamCity to build our solution. Other developers can simply download the code from your backend and build it without anything else installed.

    1. Open up AssemblyInfo.cs file and copy (with quotes) the AssemblyVersion number listed (e.g. 8.1.5800.0)
    2. Open the Package Manager Console (View > Other Windows > Package Manager Console)
    3. Run Install-Package Telerik.Sitefinity.All -Version "8.1.5800.0" (or whatever the version in your AssemblyInfo.cs file is)
    4. Wait until the console comes back and everything is installed successfully (about 10 minutes)
    5. Rebuild the solution (Ctrl+Shift+B)

    At this point you should be able to completely delete the "bin" and "obj" folders and open the project and do a full compile without errors. I usually shut down Visual Studio, delete those folders, open the solution in Visual Studio, do a full rebuild, and launch the site to see if it's all still working.

    Including Additional Files

    With the SitefinityWebApp project selected in Solution Explorer, select Show All files then include the following folders in the project (Right click on folder > Include in Project)

    * App_Data\Storage
    * App_Data\Sitefinity\Configuration
    * App_Data\GeoLocation\citieslist.txt
    * App_Data\Sitefinity\Sitefinity.lic
    * ResourcePackages

    Creating a new Resource Package

    Copy the Bootstrap Resource Package folder to ProjectName and modify the following file:

    * Name and author sections in package.json

    (I'm not sure if the name of the package has to match the folder but I do anyways)

    Update Bootstrap

    Update the assets/dist folders to the latest version of Bootstrap you want to use replacing the existing files:

    Bootstrap File: js/bootstrap.min.js

    Sitefinity File: Asssets/dist/js/bootstrap.min.js

     

    Bootstrap File: Css/bootstrap.css
    Sitefinity File: Asssets/dist/Css/styles.css

     

    Bootstrap File: Css/bootstrap.min.css
    Sitefinity File: Asssets/dist/Css/styles.min.css

     

    Bootstrap File: Fonts/glyphicons-*
    Sitefinity File: Assets/fonts/glyphicons-*

     

    If you do this inside Visual Studio no additional steps are needed, if you did it in the File system then just refresh the view and make sure you include your new ResourcePackage folder in the solution.

    Verify the new ResourcePackage by going into Design > Templates > Page Templates in Sitefinity backend. You should see a four templates named "default" (1 for each of the original frameworks: Bootstrap; Foundation; Semantic UI, and 1 for your new one). Go to create a new template and click on Use template as a basis then click Select another template and you should see a new one called default in a section named ProjectName. If you see that, it means the new ResourcePackage folder is ready for you.

    Adding a Widget Project

    I like to keep my widgets in a separate assembly apart from the SitefinityWebApp project, so I can just add more widgets as needed without affecting the original system. Follow the process as described here:

    http://docs.sitefinity.com/feather-create-widgets

    The only change to the instructions I would make is to remove the references suggested and use the NuGet packages in the solution.

    Right click on the solution and select Manage NuGet Packages for Solution and reference the following NuGet packages to your Widget project:

    DLL Needed: Telerik.Sitefinity.dll

    NuGet Package: Telerik.Sitefinity.Core

     

    DLL Needed: Telerik.Sitefinity.Frontend
    NuGet Package: Telerik.Sitefinity.Feather.Core

    Now your widgets will always refer to the same version of the assemblies as the main project.

    After adding the project and package references, add a reference for your widget project to the main SitefinityWebApp project.

    Move Database Connections to web.config

    Follow the instructions here:

    http://docs.sitefinity.com/administration-move-the-database-connection-string-in-the-web-config-file

    This is needed so we can do the next step and support multiple environments.

    Add Environment Configurations

    The default project has three configurations: Debug, Release, Release Pro. I don't bother using any of them and create my own three:

    DeployDev
    DeployTest
    DeployProd

    These are all based on Release and created using the Configuration Manager in Visual Studio (Right click on solution and select Configuration Manager). You can name yours whatever you need.

    Once the configurations are created right click on web.config and select Add Config Transform to create the three new web.config files. Edit these with new connection strings and other values you want to use for each environment.

    Source Code Check In

    At this point my system is configured and ready to go. I could deploy it internally or (in my case) move to the Cloud on Azure. Everything is good to go, I have config transforms for my environment settings and I can rebuild this sucker from TeamCity if I want and deploy it with a single click. Check the source code into your source code management and you're ready to go.

    Hope this was useful to you.

    Enjoy!

  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    12 Aug 2015 in reply to Bil
    Link to this post

    Hi Bil,

    Great tutorial. I would suggest you to write this in a blogpost with screenshots.
    Nice work.

    Best,
    Daniel

  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    12 Aug 2015
    Link to this post

    Gonna throw this here as well once you get it up and running

    Checklist

     

     

  4. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    14 Aug 2015
    Link to this post
    Hi,

    Thank you for sharing this information

    Regards,
    Atanas Valchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  5. David
    David avatar
    11 posts
    Registered:
    02 Apr 2013
    25 Feb
    Link to this post

    Thanks this is really useful & fills a big gap.
    Sitefinity has a lot of documentation but it offers very little guidance. Especially for those who are new to it all. 

    While there are quite a few videos, many are for older versions 4, 5, 6, & 7x so it is hard to know what is relevant & what is superseded. 

  6. Merritt
    Merritt avatar
    31 posts
    Registered:
    11 Mar 2011
    06 Apr
    Link to this post

    RE: Project for Custom Widgets: do you keep your views in that assembly as well? What about your related javascript files? Theoretically I prefer this but in practice testing is slower because a compilation is required each time you change the view or the javascript files.

  7. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    27 Sep 2016
    11 Apr
    Link to this post
    Hello Merritt,

    This depends of the scenario you have. When the embedded resource is not obligatory it is up to you, as you mentioned - the view and js files are easily manageable, with no build action required. From other hand having them embedded the resource is a part of the assembly.

    Regards,
    Svetoslav Manchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  8. pavan
    pavan avatar
    3 posts
    Registered:
    25 May 2016
    17 Jun
    Link to this post

    Hi all,

    i am unable to get latest image dynamically in to image control can any one help on it.

    Thanks,

    pavan

     

     

8 posts, 0 answered