Code Generation 4 Tridion - VS 2017 update

There is a new version released of the CG4T extension for Visual Studio. I found some compatibility issues with the latest version of VS 2017 and VS 2017 Community Edition. During installation, you could get the message that pre-requisites were not found and installation could not continue.

This is now fixed, so if you had this issue, please try again. This issue was also in my other extension: Image Tools for image manipulations within VS.

You can found both extensions in the VS Marketplace.

Sidewaffle templates

Sidewaffle is a Visual Studio extension that gives you more templating power. It has lots of snippets for Item templates and Project templates. You can install it via the ‘Extensions and Updates’ or by downloading the .vsix package manually. Did I already mention that is productivity tools is coming from Microsoft and is open source on GitHub?

Install:

image

New project templates are visible under each project type. Note: screenshot is created on 13 april. It’s open source, so new templates can be there after each update (notification via the standard Visual Studio window).

image

After selecting a template, a default setup is ready to go:

image

Let say you want to create a new Robots.txt. You can choose it as a template:

image

Use AngularJS template for controllers, directives, etc (with/without typescript):

image

Example code for a AngularJS controller template:

(function () {
    'use strict';
 
    var controllerId = 'controller1';
 
    // TODO: replace app with your module name
    angular.module('app').controller(controllerId,
        ['$scope', controller1]);
 
    function controller1($scope) {
        $scope.title = 'controller1';
        $scope.activate = activate;
 
        function activate() { }
    }
})();

 

Hope you now have a good overview of what SideWaflle is and how it can help you speed up your development.

Add IntelliSense for custom jQuery libraries

When you have worked with Visual Studio, you know the power of IntelliSense which helps you speed up coding. It works well with VB/C# languages, but it can also be useful for writing JavaScript / jQuery.

When writing JavaScript only basic suggestions are shown:

intellisense_without_good_suggestions

As you can see, only ajax.js, dhtml.js and ecma.js are mentioned. I have my own lib scene.dataservice.js in the VS project, but that doesn’t show up here. There is a simple trick to make this work. Just add <reference path=”<your_favourite_script>.js” /> as a comment, and see the magic:

intellisense_with_good_suggestions

Hope this helps,