Sometimes the built-in functionality of Sitefinity doesn't quite fit the needs of your projects. I recently was looking for a way to manipulate photos or images on my website.

These were my requirements:

  • Upload one image.
  • Scale it to different sizes using the query string.
  • If the image is too large for the container, crop the image

Sitefinity has the ability to add the ?size=x parameter inside your query string, so when you would request an image like this:

The image would 'scale' down to have a width of 100.

Problem
What if the image doesn't fit the placeholder?...

For years I've always liked the idea of having the ability to develop on the road. Few who know me would ever deny that I'm a true road warrior, although I'm beginning to slow down. Whether it was taking my kids all over the world to fence, chasing storms, hiking off the trail, or even jet skiing at the lake, I often had my laptop with me. I've come up with some of my best ideas while on the road. However, the size and bulk of my various laptops always had me wishing for something else.

 

The Surface RT ...

In my last blog post, Using Generic Attached Properties to Simplify Windows 8 Settings Charm Pages , I talked about how to easily add Settings Charm pages to any Windows 8 app. If your app happens to have an AdControl, you might have an issue that you need to handle. The issue is that AdControl is hosted in a WebView Control, which causes the control to always be on top. When flyout Settings Charm pages overlap AdControl elements you get unexpected behaviors. It's a known issue but is easy to handle. I've updated the GitHub example to include a couple of ...

I’ve always liked attached properties… so much so that a couple of years ago I created a series of generic classes to simplify the process of creating custom attached properties.

Attached Properties – a review:

  • External control interactions — like the Grid.Row attached property.
  • Basic info storage — just like the Tag property.
  • Behaviors — changing properties and behaviors of the parent control.
  • Bindings — to achieve custom bindings between UI controls.
  • If you use XAML, you use attached properties whether you realize it or not.

Creating a custom attached property only takes a few lines of code. Many declarative ...

A couple of months ago I wrote a column on how to use jQuery and other JavaScript libraries in Sitefinity. It was elegant and fairly simple. The sad news is, it's no longer valid for Sitefinity 5.3. The good news is, there is always a better way !

Here's how I managed to modify my base master page class to include the JavaScript libraries as well as the built-in jQuery that comes with Sitefinity without having to worry about the fully qualified name of the resource.

public class MasterBase : System.Web.UI.MasterPage
{
    protected void Page_PreRender(object sender, EventArgs e)...

Today, I spent some time hooking up EventBoard to EventPoint, and the solution turned out to be so compact I felt a blog coming on…

EventPoint has a nice REST API that can return JSON or XML. I wanted JSON. I had a demo conference set up, and also an API Key. First, I set about exploring the API, using the Chrome HTTP Dev Client, which is my new best friend. It is kind of like Fiddler in a browser, and allows you do do GET, PUT, POST etc, set HTTP headers, see the return values in JSON, ...

I was teaching a class today at HP, and demonstrating how to implement Search suggestions for in app search. The pattern is easy: you hook an event, and in the event, return any matches. Here is an example:

  var sp = SearchPane.GetForCurrentView();
  sp.SuggestionsRequested += OnSearchPaneSuggestionsRequested;

// ...  



void OnSearchPaneSuggestionsRequested(object sender, SearchPaneSuggestionsRequestedEventArgs args) { args.Request.SearchSuggestionCollection.AppendQuerySuggestions( (from t in App.ViewModel.ConferenceInfos where t.Name.StartsWith(args.QueryText, StringComparison.CurrentCultureIgnoreCase) select t.Name).Take(5)); }

Sitefinity leaves a lot to be desired with the REST services. For example, take a look at the returned data from Sitefinity's news service out-of-the-box:

{
   "Context":[
      {
         "Key":"String content",
         "Value":"String content"
      }
   ],
   "IsGeneric":true,
   "Items":[
      {
         "Author":"String content",
         "AvailableLanguages":[
            "String content"
         ],
         "CommentsCount":2147483647,
         "DateCreated":"/Date(928164000000-0400)/",
         "DateModified":"/Date(928164000000-0400)/",
         "DefaultPageId":"1627aea5-8e0a-4371-9022-9b504344e724",
         "ExpirationDate":"/Date(928164000000-0400)/",
         "Id":"1627aea5-8e0a-4371-9022-9b504344e724",
         "IsDeletable":...

In some of my previous WP7 blogs, such as Basic XNA Graphics for the WP7, I go over how to build basic 3D models for your applications. What happens when you want something more complex? You need a good 3D tool to generate those models for you. I started exploring Google SketchUp as a possibility for generating 3D models for the WP7. I found Jim’s Blog on how to load a Google SketchUp model into a XNA game. Jim used the DirectX/XNA Exporter Plugin. So I installed the plugin and started playing around. I thought it would ...

Update:  Find more of these tips and tricks in our Foundations of Sitefinity 5.1 class, where you'll learn how to use JavaScript, KendoUI and ASP.NET MVC + Razor in Telerik's Sitefinity CMS. Sign up for Foundations of Sitefinity 5.1.

 Creating a JavaScript application on top of ASP.NET MVC is becoming more common these days. Rightfully so, especially with the new Web API addition to MVC 4. The clear separation between client-side and server-side is an elegant architecture indeed!

Retrieving collections and objects from MVC is simply a matter of calling the REST URL via AJAX. The result will give you ...

Ever since Sitefinity 4 was released, developers were coming up with new approaches to include JQuery libraries and plugins in their Sitefinity websites.  The unpleasant fact is that their JavaScript code did not work under all circumstances.

To make your plugins or libraries load in good order, your JavaScript code has to work when:

  • You are anonymously browsing the Sitefinity website.
  • You are editing your website in the back-end.
  • You are browsing the website in Edit mode.

Sitefinity makes heavy use of JQuery and other Javascript libraries in its own administrative UI. Sitefinity loads jQuery when you are working inside ...

There are some instances where the the obstructive Silverlight Toolkit BusyIndicator might not be the right choice for your application. BusyIndicator pops up a control on top of all other controls that shows a message and a graphical animation. I wanted to create a more passive control that doesn’t pop up a control but it still disables all the controls on the page and shows a message on the page.

First I started by creating a User Control. Within this control I added a TextBlock and an Image that I’ll use to set some busy text and an animated image. ...

Mobile applications and web sites provide the perfect platform for proximity-based services so users can find the nearest X to their current location.  I will demonstrate some code that will allow you to find the closest location in a list when compared to a current latitude and longitude.

While latitude and longitude provide precise coordinates, we can't use a Euclidean distance formula because latitude and longitude are not on a cartesian plane, but on a sphere (technically, an ellipsoid, but we don't need to be so precise here).  There are several pages that describe the differences between using the Haversine ...

There has been many features released in Sitefinity within the last year, but one of my most favorite is Module Builder! If you have read my previous blog post about migrating modules from Sitefinity 3.7 to 4.0, you must have been overwhelmed with the 8000+ lines of code it took to create a module in Sitefinity 4. And most of the it was cookie-cutter code from module to module.

Now with Sitefinity 4 and 5's Module Builder, you can create modules without writing any code! If you have manually created modules for Sitefinity 4, you should be asking ...

I’ve been looking at several alternate reality application ideas and how to best show the real world on the phone. It’s easy to get the camera preview to show up in a WP7 application, but sometimes you want to maximize the camera preview in the screen. One problem is that the camera preview is a different size and aspect ratio than the WP7 screen. The size differences are illustrated below.

 

The WP7 screen is 480x800 and the camera preview is 480x640. If you want to show controls, then you can use the extra space at the top and bottom. ...

If you missed my blog about showing the WP7 magnetometer in 3D with an XNA/Silverlight application, you can read about it by clicking here. We are in the process of putting this application in the Marketplace so you’ll be able to check it out on your phone shortly. One of the steps in the Marketplace process is coming up with screenshots of the application. You can always use the screen capture option in the Windows Phone Emulator; however, in this case it was going to take some code to emulate the magnetometer sensor. Figuring out how to take screen ...

In this video, I wish to demonstrate the ability of changing the default workflow in Sitefinity using Windows Workflow Foundation 4.0.  The video is based on the code provided by the Sitefinity SDK here

In the following video, I will demonstrate the ability to do the same from a class library referenced from outside of the Sitefinity Project file system as well.

 

Please let us know if this video was useful to you and if you would like to see more information and demos on Custom Workflows in the future.

While working with all the content modules in Sitefinity, we have got several templates to choose from to display list items on our pages. When we have a long list to expose, the pager control that is shipped with Sitefinity allows us to specify how many items to display per page, which is great. However, we have all experienced the beauty and flexibility of the RadDataPager control and to this day I am still wondering why the Sitefinity team did not use this control instead of the custom pager that they built specifically for Sitefinity. 

After I stumbled upon this post ...

With Christmas coming up soon, what better blog can a nerdy geek come up with than to explain how to draw a Santa hat on the WP7 using the XNA Graphics Framework.

 

I’ve been working with computer graphics on and off for most of my 20+ year career. For me, it all started with OpenGL in the early 90’s. Since then I’ve worked with DirectX and now XNA. It’s amazing how little things have changed over that time. All those frameworks are based on triangles and arrays of vertices and normals. When you learn one of those frameworks, you ...

The “Email Campaign” module of Sitefinity 4 is what you would use to create email campaigns, manage lists of subscribers, and test AB campaigns. If you haven’t used this module, you can get more information on the Sitefinity website by clicking this link:

http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-working-with-email-campaigns.html

While this is a very useful module in Sitefinity 4 out of the box, I’m going to show you how you could add some additional functionality to this module. For the purposes of this Blog, let’s assume you would like to be able to export your Mailing Lists to a csv file. The way we will ...