Category

Sitefinity

On Sitefinity Custom Widget Caching

By | .NET, ASP.NET, C#, MVC, Sitefinity | No Comments

Sitefinity is Caching too Hard! If you’ve done software development for any length of time, you’ve likely run into a caching issue. Caching is difficult to get right, but it is so beneficial that we work with it in nearly everything we do. In the case of Sitefinity, it performs caching all over the place. As a result, many aspects of the Sitefinity experience are greatly improved. If you disabled caching for a Sitefinity site altogether, the site would slow down immensely. Sitefinity, by its nature of being a Content Management System, stores the bulk of its content in the…

Read More

Dynamic Content Detail Widget Templates in Sitefinity

By | .NET, ASP.NET, C#, Sitefinity | No Comments

Getting to Dynamic Content Data in Custom Code Behind In a previous post, I went over how you can easily create a custom code-behind C# class for any Widget Template in Sitefinity. Give that post a quick once-over, as this post builds upon that one. For built-in Sitefinity content items, accessing the data is pretty straightforward (see the previously-linked post): You grab the container, iterate over the items (even in the case of a single detail item), and then work with the data to make customizations to the page. For Dynamic Content Detail Widget templates, however, things work differently. You…

Read More

Sitefinity Bug in Chrome v55

By | Google, Sitefinity | No Comments

Page Editing Drag and Drop Busted On December 1st, 2016, Google pushed out a new version of its internet browser Chrome. Chrome v55 installed and automatically updated on a huge number of machines (as is the standard for silent auto-updating software) and it went off without a hitch. While Chrome was dandy, however, it turns out that it broke something in Sitefinity! A major component to Sitefinity, in fact: Dragging and dropping widgets when editing pages or page templates. Unless you are in an environment where automatic updates for Chrome are disabled, you are now susceptible to this issue if…

Read More

Advanced Sitefinity Developer class in the Silicon Valley

By | Sitefinity | No Comments

We are very pleased and excited about offering the only west coast Progress Sitefinity Advanced Developer class at our training facility in Scotts Valley, CA (25 minutes from San Jose Airport SJC) at the heart of the Silicon Valley. This class offers backend developers the ability to develop a web application using Sitefinity CMS. You will receive extensive knowledge, on-class support and be taught by Sitefinity experts with 25 years of training experience.  Each attendee will receive a certificate of completion.  This class will enable you to confidently take the Advanced Sitefinity Developer Exam. This class is an official Progress Sitefinity…

Read More

Rewriting URLs to Lowercase in Sitefinity

By | .NET, MVC, Sitefinity | No Comments

Enforcing Lowercase on URLs to Normalize URLs In any web application, it is generally a good idea to make sure that all of your content has only one way to reach them via a user’s address bar in their browser. Whether you accomplish this by using canonical URLs, strict discipline/convention (i.e. “I will never capitalize any directory or filename”, very hard!), or rewriting URLs into lowercase ones, they all accomplish the same goal. Google only sees one URL for content, and your SEO doesn’t take a hit for “duplicate content” like what may happen if you can go to www.example.com/Foo…

Read More

Multilingual Publishing in Sitefinity

By | C#, Sitefinity | No Comments

Initially Publish your Content in a Non-Default Language Sitefinity has great multilingual publishing capabilities. From the perspective of an end-user / content manager, the backend offers up a myriad of methods to create content items both in the site’s default language as well as any other languages activated/enabled in the site itself. They’re all usually just one click away, and provide a good experience. But what about the development side of things? Say we have a custom widget that creates a content item, but the language either must be something apart from the default, or is user-selectable before creation occurs?…

Read More
sitefinity-feather-designer-preload-message

Sitefinity Feather Designer Tip: Updating Fields Programatically

By | AngularJS, Sitefinity | 2 Comments

I recently needed to create a custom designer for a Sitefinity MVC Widget that would allow a property to be filled in programatically (such as clicking an option in a list).  Populating the field was simple enough using jQuery, and here is a very simple example demonstrating the desired behavior:

Clicking the button does indeed did populate the message property: However, when I saved the changes, the output of the widget message property was still blank: It turns out that this makes sense, because the widget designer is using Angular JS to bind its properties back to the widget, and…

Read More

Restoring Multilingual Translations in Sitefinity

By | Sitefinity | No Comments

Dude, Where’s my Translations? Occasionally I’ve run into an issue where enabling multilingual translations doesn’t correctly reach out to all aspects of my existing Sitefinity instance. Progress Sitefinity will allow translations to be made (under Interface Labels and Messages), and Pages and some content types will allow me to provide translations as well, but some dynamic content types will still behave as if there’s only one language available. Sledgehammer Approach My first thought would always be that maybe existing dynamic types have to be re-installed in order for translations to be made available to them. While you can uninstall a…

Read More

Enabling Email and Password Reset in Sitefinity

By | Sitefinity | No Comments

One of the common requests I get when working on various Sitefinity projects is to enable a feature in the Sitefinity backend that, by all appearances, is already on by default. I am talking, of course, about the ability for a site administrator to reset a Sitefinity user’s password from the backend, which reveals the password to the administrator (should they wish to notify the user personally) and also send an email to the user whose password was changed. While the UI is there out of the box and Sitefinity lets you attempt a password reset, in actuality nothing will…

Read More

QuerySelectorAll Error on BeginFormSitefinity

By | ASP.NET, MVC, Sitefinity | No Comments

When developing a custom form on Sitefinity MVC widgets, the HTML helper method Sitefinity provides, Html.BeginFormSitefinity(), is a very handy resource. You wrap your form elements up inside the whole thing, along with a submit button, and you can point it at an HttpPost Action on your custom MVC widget controller with ease. When you’re putting your form widget on a master page, however, you can run into a rather vague JavaScript error that prevents your form from submitting correctly. The error in JavaScript brings up something about querySelectorAll and you’re left scratching your head as to what you did…

Read More

Enable Sitefinity Page Editing for Custom Roles

By | Sitefinity | No Comments

Page Editing: Just Assign the Right Roles. Right? I recently worked with a client that was setting up users in the Sitefinity backend under custom roles. Some users can edit one group of pages, while other users can edit other groups of pages. Setting up these groups of pages with the permissions so that group A can edit while B cannot, and vice-versa, is trivial. …But is that all we do in order to give users the page editing powers we wish to grant them? Nope! In attempting to complete this setup, the client was running into an issue: Despite…

Read More
sitefinity-config-key-value-pair

Simple Key-Value Sitefinity Configuration with NameValueCollection Property

By | News, Sitefinity | One Comment

Sitefinity allows you to easily create a custom configuration setting for storing and managing properties for your site. For the most part, you simply need to inherit from ConfigSection and add your properties. Once registered your settings will be automatically added to the backend Sitefinity Configuration page (Administration > Settings > Advanced). The documentation for this feature explains that there are several different types of properties supported, including simple types (like bool, string, etc.), as well as custom types that you can create by inheriting from ConfigElement and even collections for managing those custom types. However, one additional property type…

Read More

Widget Template Code Customized the Easy Way

By | .NET, ASP.NET, C#, Sitefinity | One Comment

Sitefinity’s Widget Templates provide a quick and easy way to change how Sitefinity renders widgets, both for built-in content types as well as custom ones. In the backend, it’s just a hop, skip, and a jump away to Design > Widget Templates to access a majority of the templates where you can manipulate the HTML used to render them. Oftentimes, though, you have to do more. Let’s say that, when iterating over a list of news items in the “Titles only” template you want to add a CSS class to some of the items, but not others. This goes beyond…

Read More
captcha-required-message

Client-side validation of Sitefinity CAPTCHA MVC Feather Form Field

By | MVC, Sitefinity | No Comments

In the current 9.1.6110 release of Sitefinity, there is a known issue with the Sitefinity CAPTCHA MVC form field that prevents it from firing the client-side validation. If the user leaves the CAPTCHA field blank, the form will still submit (either a full post-back or via AJAX, depending on the settings of the form), and the user will see a generic “Entry not valid” error message. It would probably be better to catch this right away via client-side validation. Fortunately, using Feather, we can easily override the CAPTCHA template to enable this. We simply need to change the input field…

Read More

Preserve Feather Content Block HTML Formatting

By | JavaScript, MVC, Sitefinity | One Comment

Feather widgets in Sitefinity are a significant improvement over traditional Sitefinity widgets. They are more responsive, provide better tooling, and are easier to customize (both the main area as well as designer views). However, I recently encountered an issue with one of the basic default Feather widgets included with more recent versions of Sitefinity. In this post we’re going to see how to modify this behavior, so that when working with the Feather Content Block widget we have it behave the way we would like. This post also serves a second purpose: Introducing how to modify a built-in Sitefinity Feather…

Read More

Lock Down Content Widgets with UrlKeyPrefix

By | MVC, Sitefinity | No Comments

When you’re working with your content in Sitefinity, a very common practice to display said content is to provide a list and details view. On the page (or pages) containing these views, it is often good to provide a sidebar to provide for additional navigation functionality when users are browsing your content. News articles, for example, can support Tags to help classify stories into various buckets. It’s also nice for users to see a concise list of stories on the sidebar in addition to the more fleshed-out list that the page primarily shows. To accomplish this in Sitefinity appears trivial…

Read More

Locks in Sitefinity: Keeping Content Free

By | Sitefinity | No Comments

Exclusive locks are nothing new. It is a basic concept that tons of multi-user programs, tools, and systems use so that users don’t step on each other’s toes when they’re trying to work on something. It would be awful if you spend 30 minutes editing an article only to find that someone else stepped in and blew away your edits because they saw a typo and jumped in to quickly fix it. Sitefinity is no different in this regard: Pages, built-in content, and custom content all have built-in locking functionality. If you’ve worked with other content editors on a Sitefinity…

Read More

Using HandleUnknownAction in MVC Widgets

By | .NET, ASP.NET, C#, MVC, Sitefinity | No Comments

Sitefinity’s MVC widgets are fantastic. They allow untold amounts of customization and enable you to create an MVC framework as complex or as simple as you need. There is a caveat to using them, however: Because the controllers are typical ASP.NET MVC controllers, going to particular pages on your site might make them disappear! There is a simple workaround for this problem, and with this information you can ensure that your Sitefinity MVC widgets consistently display no matter what current state your web site is in. The Problem Say you have a simple custom MVC widget that has a single…

Read More

Accessing Sitefinity Roles in Code

By | .NET, C#, Sitefinity | No Comments

When developing custom solutions in your Sitefinity application, you may need the ability to work with Sitefinity roles. As a developer, you would reach out to the RoleManager that Sitefinity provides, and access the roles from there. However, you may run into an issue where some roles, verified to be a part of your site, are not represented when working with the RoleManager. This post goes into this issue, and shows how to access all Sitefinity roles to work with. Basic Role Access Let’s say you want to list all available Sitefinity roles on your web site. The natural idea…

Read More
sitefinity-status-page-200

Sitefinity Status Page HTTP Response Codes

By | Sitefinity | No Comments

When working with the new Web Services module or WCF services in Sitefinity, you want to be able to allow the requesting clients to properly respond to and handle a failed request. This is generally simple enough, as a failed request would usually be accompanied by an HTTP status code that indicates something went wrong. The status can be reviewed by the client and handled appropriately based on the status code (such as 404 for not found or 500 for a server error). To demonstrate this let’s look at this sample code, which uses the Web Services module API to…

Read More

Customizing Search Result URLs in Sitefinity

By | .NET, C#, Sitefinity | No Comments

One of Sitefinity’s many features is its search capabilities. Using Lucene under the hood, Sitefinity indexes your site content, both built-in content types and dynamic content types, along with static HTML, and allows you to present organized results to the user. You can customized what is and isn’t indexed among other things. Most of the time, Sitefinity is smart enough to create search result URLs that take you directly to the content in question. If you have “/my-news” as your news page, for instance, a particular article URL might look something like “/my-news/2015/1/1/my-article-url”. The search indexer automatically takes the page…

Read More
Sitefinity 9 for Developers Book

Sitefinity 9 for Developers

By | Sitefinity | No Comments

We at Falafel Software are excited to announce the release of the updated Sitefinity 9 for Developers book, available for immediate purchase in the Falafel Store. This update includes an exclusive new chapter covering the new Web Services module introduced in Sitefinity 9, useful for building and managing API services for your Sitefinity content. As a result of this new update, the Web Services chapter has been entirely rewritten to offer a developer-focused look at its use, configuration, as well as helpful tips and tricks and even gotchas to watch out for when getting started. Despite the introduction of this…

Read More

Working with Hybrid Forms in Sitefinity Widgets

By | .NET, C#, MVC, Sitefinity | No Comments

Throughout the course of web development, you often find yourself in a situation where you need data input from your user. Scenarios range from a simple contact form, to something as complex as a multi-part job application. In either case, Sitefinity offers multiple solutions. The easiest solution, for the simpler forms such as the aforementioned contact form, is to use Sitefinity’s built-in Forms capabilities. Much like with their pages, Sitefinity Forms provide a very simple, powerful way to create and customize even more complex forms for your site. The resulting data is then stored in Sitefinity, and can be set…

Read More

Relating Data in Sitefinity Content

By | .NET, C#, Sitefinity | One Comment

In my previous post discussing properties on custom content, I delved into some of the more complex types that can be properties, including classifications and related media. This post will get into the most complex type to work with: Related Data. This is taking existing custom content types and allowing other content types to have a property that relates one to the other. Relating data can happen with built-in content types (e.g. News), extend across other module builder modules, and even be self-referential! On top of all that, you can even create a custom content type that is the parent…

Read More

Complex Custom Properties for Sitefinity Content

By | .NET, C#, Sitefinity | No Comments

In my previous post I talked about basic access of custom properties in Sitefinity. Namely, strings and numbers. Those alone cover a lot of what you’d use when it comes to custom fields on built-in content types and custom content types. In this post, however, we’re delving into some of the more complex custom properties that can be associated with Sitefinity content. Like in the previous post, we’ll cover both how to query by a complex property (where applicable) and how to fetch the content of the complex property. Classifications (Tags, Categories, Custom) Fetching Tags and Categories within Sitefinity are…

Read More