Search

Contents

Revindex Storefront

Export Print

How to edit template in Visual Studio

The Storefront comes with its own basic template editor that should be sufficient for minor design changes. If you need to perform complex changes, you might choose to perform the work using Microsoft Visual Studio. The following steps are intended for advanced users with some basic knowledge of programming.

Setting up Visual Studio

  • Run a local copy of the Web site on your machine using IIS.
  • Download and install the free Microsoft Visual Studio. During the installation, if you get prompted for features to install, make sure you select C# and Web development features.

Editing templates in Visual Studio

  • From Visual Studio, open the template file located at

    \DesktopModules\Revindex.Dnn.RevindexStorefront\Portals\0\Display\Cart\NAME\Display.cshtml

    where "0" is your portal number or "_default" if running the standard templates and where NAME is the template name.
  • You should not edit the Standard templates directly and instead make a copy of the folder under the portal number. All custom templates must belong under a portal number and not under the "_default" folder. Custom templates names should not begin with the word "Standard". For example, if you wish to edit the Cart template, you should copy the contents of the folder from:

    \DesktopModules\Revindex.Dnn.RevindexStorefront\Portals\_default\Display\Category\StandardTree

    and paste to (where "0" is the portal number and "MyCustomTree" is the new template name):

    \DesktopModules\Revindex.Dnn.RevindexStorefront\Portals\0\Display\Category\MyCustomTree

    You can then edit and work on the custom template without affecting the standard templates that get overridden on each upgrade.

  • You can deploy the changes by FTP to your server following the same folder path convention.

Debugging the template

  • To inspect the data, you can attach the Visual Studio debugger to a running process. Make sure to run Visual Studio as Administrator. From a browser, visit your Web site first to kick off the Web process. 
  • From the Visual Studio menu, click on Debug > Attach to Process menu. Select the w3wp.exe process and click Attach. In your template code, click on the left hand vertical bar to place a breakpoint (red dot) next to any line with C# code where you want the debugger to pause.
  • From your browser, simply reload the desired Web page that is used by the template. At this point, Visual Studio will stop at the breakpoint allowing you to view the data at that line. To inspect the data, place your mouse over the variable and right mouse click on QuickWatch.
  • To debug the next line, click on F10. To resume code, click on F5. To stop debugging, click on Debug > Detach All.

Comments

Add comment

Powered by Revindex Wiki