Pages

Thursday, October 11, 2018

Replacing HTML strings with Dojo TemplatedMixin

I've been playing around with Dojo a bit recently, modifying some Episerver widgets, and extending functionality, and I ran into a scenario I wasn't really satisfied with. In one situation I encountered, I needed to supply an HTML string for a widget to utilize when rendering data for an object, but the HTML markup had some conditions to it based on the object I was on at the time. Another situation involved looping through items and adding them to a list for display in a widget, again needing to include data from the object in the markup.

I searched online for how to parse HTML strings to include object data or conditions in it, but I didn't find the kind of answer I wanted. Many of the examples online show HTML strings in the Dojo script using concatenation for adding the variables, and others involved multiple lines of node creation and dom manipulation using "dojo.place" and "domConstruct". If you want easily adjustable markup using a template approach, avoiding modifying your dojo JS, these techniques are not the most user friendly. However, I did discover a solution.

Tuesday, October 2, 2018

DefaultValue in PropertyList

When Episerver brought out PropertyList support in 9.0 and showed the world how to utilize it (read the article here) it rocked the Episerver developer community and changed the way we utilize the CMS to this day! Okay, that's obviously an exaggeration, but it did introduce a different property type to the community, and brought about a different way of supporting lists or collections of data, that didn't require a bunch of blocks added to a ContentArea.

As interesting as it is, however, there are some shortcomings to this functionality. After all, it's mentioned in the linked article that it is a "pre-release API that is UNSTABLE." It's expected to have some quirks and shortcomings. Thankfully, as has already been demonstrated by Grzegorz, in his PropertyList with Images article, the PropertyList, or more importantly the CollectionEditor, can be extended to modify the functionality to fit different needs.

In this article I am taking a similar approach to Grzegorz to extend the functionality, but instead of supporting images in the list, I needed to support a default value specified through code.

Thursday, April 19, 2018

Rendering Options for DateTime (and other) Properties in Episerver

The question has been brought up to me more than a couple times in the past few weeks about how to properly format a DateTime property in a View and still allow In-Page Editing to work. Since I have answered it with mostly the same information each time it has come up, I figured it was time to put something out in cyberspace that I can point people to, or even help them find when the situation arises.

I am a huge fan of In-Page Editing in Episerver, and part of my goal when teaching people techniques working with Epi is to keep that In-Page Editing experience in place for users and editors so they can get the most enjoyable experience out of their site and CMS.

The nice thing about the approaches in this article is that while the article is centered around the DateTime property, most of these techniques apply to any property where you need to display something different than the actual property value.

Ultimately, then, this article is about the various techniques to render a property in a view while keeping the In-Page Editor working. I'm just using a DateTime property as an example.

Monday, December 18, 2017

Configure Roles and Permissions for Episerver ServiceAPI

Episerver has a nice ServiceAPI package that grants you access to some CMS and Commerce functionality using a RESTful approach. It installs via Nuget, and is a pretty painless process... when you have all the information in front of you. After a few hang ups and "gotcha" moments, I eventually got it configured. However, the documentation from Episerver could benefit from a few fillings, and I finally found someone who took care of that for me.

Wednesday, September 14, 2016

A CSS-only Approach to Tooltip Icons for Help Text in Episerver

I was working through cleaning up the interface for my latest Episerver project the other day - clearly defining names, adding icon attributes to pages, adding helpful descriptions - and I saw a Tweet buzz across the wire for an article on adding icons to properties with Help Text (Description). The article is actually really good, and it got picked up by a couple colleagues of mine who implemented the solution in it. It's by Ted Nyberg and you should check it out here: https://tedgustaf.com/blog/2016/icon-for-property-help-texts-in-episerver/.

It sparked a memory for me, though, of another article I had bookmarked a short while back by Alf Nilsson, on how to expose the Help Text (Description) alongside the property name in the UI, eliminating the need to hover. Again, it's another good article and you should read it as well: https://talk.alfnilsson.se/2014/12/18/display-help-text-in-on-page-editing/.

Both of these articles touch on a pain point of mine, and various other Episerver developers, around how the Help Text (Description) is displayed for properties in the UI, and it got me thinking of another approach to address this issue, essentially combining these two ideas.

Monday, June 27, 2016

SelectionFactory fun in Episerver - Part 1

Drop Down lists are a common request and question in the Episerver world, for anyone fairly new to the platform. That's because Drop Down lists are a great way to provide users with a straight forward interface for providing a value to a property; the options for values are right in front of them. They also make it easier for a developer working with those property values, because they know what the possible values are that they will be working with. Unfortunately, someone new to the Episerver platform might not know the best way to start creating properties with Drop Down lists.

Linus Ekstrom (http://world.episerver.com/blogs/Linus-Ekstrom/Dates/2013/12/SingleMultiple-selection-in-EPiServer-75/) blogged about the basic approach of using SelectOne and SelectMany with predefined values in 7.5, and Joel Abrahamsson (http://joelabrahamsson.com/enum-properties-with-episerver/) and Anders Nordby (https://andersnordby.wordpress.com/2014/10/16/enum-properties-with-selectone-and-selectmany/), along with several others, have written good blog articles about working with SelectOne and SelectMany properties sourced by Enums.

Aside from linking to those articles to familiarize you with the people (they're pretty cool) and the approaches, this article is to help provide additional methods for building out lists for SelectOne and SelectMany properties you want to use Drop Down lists for.

Monday, June 13, 2016

Good products don't save bad service: From building a house to building a website

Last night I was sitting around a small bond fire with some friends chatting about our houses. We just moved into our house last October, after having it newly constructed in this new neighborhood. My friends moved in several months prior to us, and watched the construction of our house, which seemed like it was never going to end. We had the same builder, who provides a 1 year touch-up service as part of their warranty to address any "settling", or shrinkage, and my friends just completed their 1 year follow-up.

The difficulties we both had during construction, and post-closing, were the topic of conversation when one of them asked, "would you build another house with them?" I thought about the question for a minute, because the quality of the house and the layout is something we all agreed was above average. But I replied with, "No, I don't think so. A good product won't save bad service."

After the fire I went home, and the similarities between the construction process of our house, and what customers, developers, and agencies go through for websites prompted me to write this. This is my list of issues you might face, along with some pointers for you when starting a new project, or a new relationship with a customer.