Mark Everard

Hello, I'm Mark – a PhD physicist turned technologist / architect.

ImageDataExtensions for Episerver 10

without comments

Thanks to Luc Gosso embracing the true meaning of open source software and  ‘community’ (you give back at least as much as you take, in case you’re wondering) there is now  a version of my ImageDataExtensions package compatible with Episerver CMS 10.

Why the long wait?

She's already schooling me at JavaScript....

Ignoring another small package that has entirely changed how I spend my spare time, the reason is that the ImageDataExtensions package relies on a unsupported Episerver API to deliver its core resizing functionality, and I wasn’t sure what approach to take.

As part of Episerver’s quality approach they have been reducing their surface API, that is the number of methods that are available to developers to integrate and interact with the platform. This makes entire sense as they can focus their efforts on in-depth testing and validation of key features without worrying about methods that us eager developers have reflected out and used for more than their original intention.

The ThumbnailManager class that provides the resizing capability has been marked as an internal API (and moved to the Episerver.Internal namespace). Although still available to develop against, Episerver provide no promises around its operation or signature , i.e a. change to this method /API wouldn’t be considered a breaking change to the platform (though it would be for this package).

The point to remember is “if you are using  this package / or you intend to, please be aware that this means your functionality could break with any Episerver release and make sure you are comfortable with how you will deal with that”.

What next?

Luc’s contribution got me thinking about how best to provide a way out for those of you that want to safely use and rely on this functionality.

I’ve now abstracted the resizing functionality into its own interface and made it pluggable through the IOC container, enabling you to provide your own resizing implementation (thus no longer depending on the Episerver Internal ThumbnailManager class)

I’ve also created a package that uses everyone’s favourite Asp.net Image resizing module (ImageResizer). There is already an Episerver integration allowing true dynamic image resizing of any image. The new add-on delegates the image resizing on upload to ImageResizer rather than the ThumbnailManager.

I’ve dropped this into another package Chief2moro.ImageDataExtensions.ImageResizer in case you’re interested.

Is now the right time to say that I think Image scaling and resizing should absolutely be part of the core platform. I rarely come across a project that doesn’t have that need 😉

Written by mark

March 16th, 2017 at 3:12 pm

Posted in C#,EPiServer

London Episerver Developer Meetup Spring 2017 is March 23rd

without comments

Hopefully this won’t be news to anyone, as you should have received an email direct from the Episerver developer mailing list. Wait, what do you mean you haven’t signed up? Do it now!

Where and when?

Thanks to RedWeb who are kindly hosting (and Episerver too), we’re having another Meetup on the 23rd March 2017

Help us out / lightning talks

I’m always keen to hear your ideas and feedback about our Meetups. Help me out and spend a few minutes to fill in the form below

Leave us some feedback to help make these Meetups better

I’m equally as keen to get some contributions for you all. It will always be better if you are willing to share a little of the cool stuff you’re working on. Just like last time, we’ve got a slot for some 5 minute ‘Lightning talks’. The idea being it’s a chance to……

  1. Tell us about something useful to the community (without the overhead of pulling together a presentation and slides). Why not just crack up Visual Studio and show us a demo, or talk us through a good blog post you’ve seen.
  2. Practise your presentation skills in front of a very friendly audience….

We had some good contributions last time. Hopefully we can get a few more this time. If you’re keen but don’t know what to talk about then let me (episerver@markeverard.com). I’ve got a few ideas you can use.

Don’t forget to tell us you’re coming

Please sign up on the Eventbrite page to book yourself a place. We’ve got limited space but will always try to accommodate as many of you as we can.

https://www.eventbrite.com/e/episerver-developer-meet-up-spring-london-tickets-32322422235

See you there 🙂

 

Written by mark

March 8th, 2017 at 10:29 am

Posted in Community,EPiServer

Publish all the things!

with 5 comments

If you’ve seen some of my recent posts you’ll know I’ve been playing around with WebHooks. These are simple HTTP requests to endpoints allowing services to exchange data and events.

Integration Platforms as a Service

Those of you cool kids will have known about IFTTT (If This Then That) for some time. It’s a online tool that acts as a way to glue a huuuge number of online services together into simple workflow pairs called ‘recipes’. Each service can provide a number of triggers to the platform, which are then linked to actions provided by other services.

I’ve got a number of personal recipes set up, some useful some not. but all of them are good fun!

  • If somebody tags me in a picture on Facebook, then upload the picture to my OneDrive account
  • If one of my team creates a new GitHub repository then email me
  • If I arrive or leave my office then log the time in a Google Doc.
  • If an astronaut is launched into space then send me a notification

Whilst IFTTT targets individual users, other iPaaS platforms focus more towards business and enterprise. These will become increasingly useful and popular as a cheap means of system integration and data exchange. For example – if somebody submits a payment via the organisation’s payment gateway, log the entry directly into the cloud-based finance system. You won’t need development teams to set these up, just someone to configure the data exchange / webhook endpoints.

Publish your home!

I’ve been playing around with smart home devices (tado smart heating and WeMo lights and switches). I wanted to experiment a little with the API’s they offered.

One of the channels IFTTT offer is called the Maker channel. This is a user specific channel that will accept http triggers to an endpoint and can also make requests to a specified endpoint. It allows you pass up to 4 data points from a trigger or to an action.

publish-lights-on

Publish…… and there was light, and slippers.

As I’ve demonstrated before, adding webhooks to an existing ASP.NET app is straightforward. I decided I’d hook an Episerver solution up to an IFTTT maker channel, meaning when I clicked the publish button I could make all manner of amazing things happen, like turning my lights on :)

The code to do this is straightforward (see below). I’m using an Episerver initialisation module to hook a handler for the Content Published event. I’ve also built a simple helper method to call the Maker channel API. To use this you’d just have to add in your own API key that you get when you configure the Maker channel on IFTTT.


Written by mark

March 7th, 2016 at 11:00 am

Posted in ASP.NET,C#,Code,EPiServer

How exactly do you need to manage your content?

without comments

Detailed content management requirements are often overlooked in the design and build of a content managed website. This can result in an implementation that lacks flexibility and incurs higher costs over its lifetime.

Dual purpose

Web Content Management (WCM/CMS) implementations deliver two key capabilities for an organisation:

  1. A website, perhaps with a new or updated design or brand.
  2. The ability to manage the website content via a content management system

To achieve the best implementation outcome, it is important start your project with design measures and KPI’s that focus on both the success of the website as a business tool, as well as the CMS that enables it. Too often the focus is on just the website, largely because of the difficulty in measuring how well your content management system works for your organisation.

Whether your CMS is effective is rarely immediately apparent, instead it will emerge over time through your content team’s ability to operate autonomously and a reduction in future development need and cost.

A CMS is for life, not just for launch

Even after a successful implementation, it is still easy to overlook your content management requirements. Marketing and campaign-led activity often have bespoke visual needs which can challenge your existing CMS design and content flexibility. They also often come with fixed deadlines and limited opportunity to fully assess the expected campaign content usage and lifespan.

The default position may be to ‘content manage all the things’, but do you really need to?

It is all to easy to build up technical debt within your implementation by designing bespoke types that are so specialised they offer little or no opportunity for reuse. This feature bloat not only increases the size of your code-base, making the landscape more complex for your technical teams. It also makes the system more complex for editorial teams as they have to navigate additional content types. If you have many content types in your CMS that are only used in a few places then you may already be suffering.

Don’t waste time (or money)

To keep on the right track, you should always have your content editing team as a key stakeholder in any website or CMS development. After all, they are the team that will be using any functionality and be responsible for publishing campaign content / functionality on your website through your CMS. It is only sensible that their feedback is taken onboard.

The basics of content reuse requirements aren’t that difficult.:

  1. I need to reuse this content and/or design in many places across the website
  2. I may reuse this content occasionally
  3. I am unlikely to reuse this content, but I need to be able to change it at short notice
  4. I shouldn’t need to change the content. If I do I am happy to rely on techincal support

The answers will drive very different technical solutions, ranging from fully reusable content managed features to a set of static pages to be thrown away after use. The middle ground here is also useful, which allows more technically minded CMS editors and admins to standup flat HTML pages through the CMS interface (an example for Episerver – http://tedgustaf.com/blog/2011/4/publishing-plain-html-pages-in-episerver/).

The difference in cost and implementation effort can be substantial.

Why spend money and valuable time building reusable content elements for a one-off campaign if you don’t really need to?

Written by mark

February 29th, 2016 at 11:00 am

Posted in C#,EPiServer,Opinion

London Episerver Developer Meetup Spring 2016

without comments

Spring is on its way (think daffodils and lambs) and so is Episerver’s next Developer Meetup.

Zone have very kindly offered to host the meetup at their laid back offices in Kings Cross. And Episerver will be supplying the pizzas and beers – after all, it’s not a meetup without it.

We have a great line up, covering some exciting new features in Episerver and looking at what it coming too

Episerver Forms

In the Winter Release 2016, Episerver Forms were officially released! Finally, a replacement for XForms! Janaka (from Episerver) will talk through different form examples you can build, re-using them, and customized rendering for display channels, personalization, multi-language and permissions. As well as the new four elements added after Beta; Date time, Range, Rich text and URL.

Commerce Promotion engine

New UK EMVP, Jon Jones, will take us through the new promotions engine in Commerce.

ASP.NET Core 1

(AKA ASP.NET 5) There are big changes coming soon to the ASP.NET framework. We’ll be taken through some of the changes and how Episerver are redesigning the product to take advantage.

Sign up now!

As always, RSVP through our Meetup page, and please let me know if you’ve got any good ideas or want to contribute in any way. Remember, its your group!

 

 

 

Written by mark

February 15th, 2016 at 8:26 am

Posted in Community,EPiServer

RSS feeds for Episerver

without comments

I’ve released a few further tweaks to my RSS / ATOM add-on for EpiserverCHIEF2MORO.SyndicationFeeds.

Whats new in version 3.0?

On request filtering

I’ve taken another look at filtering, which is a feature included from version 2. I’ve modified the inbuilt IFeedContentFilterer to allow Feed pages to filter items by category via querystring parameters. This has caused a breaking change (and helped me understand how abstractions can help stable API design).

The feature allows editors to set up single feeds and for those feeds to provide subsets of data by responding to Category names that are passed via a comma separated querystring value. e.g. www.mysite.com/feed?categories=Alloy,Blog,Technology.

The default FeedFilterer has also been modified so that a content item has to be a member of all categories (both querystring and editor set) to appear. Previously it had to be a member of just one category filter.

Editor set cache

Each feed page now includes a new property allowing an editor to cache the feed output for a given number of seconds. This is to help performance for those feed pages on sites with a large amount of content.

Validation

I made some minor amends to help the feeds to validate, and made sure I correctly understood the RSS / ATOM specification in respect of LastUpdated and Publish dates

It’s on Nuget

The source code is available at https://github.com/markeverard/Chief2moro.SyndicationFeeds.

A package (currently v3.0.0.0) is available in the Episerver Nuget Feed – http://nuget.episerver.com/ – search for CHIEF2MORO.SyndicationFeeds

Written by mark

February 3rd, 2016 at 10:00 am

Posted in ASP.NET,C#,EPiServer

Using WebHooks in an EPiServer solution

without comments

WebHooks are a way of connecting internet / cloud services together. They allow websites to communicate with each other via HTTP callbacks. Services can subscribe (via HTTP) to receive notifications from publishers about a specific event. Publishers, manage these subscriptions and then on each event push notifcations via an HTTP Post to each receiver, at an endpoint defined during subscription.

web-hooks

ASP.NET WebHooks

Microsoft have recently released a WebHook framework for ASP.NET that gives you a pattern for:

  • Handling subscriptions from interested subscribers
  • Sending subscriptions to publishers
  • Sending published messages to subscribers
  • Handling publisher messages from subscribed services (via Receivers)

Along with the basic framework, they have also provided implementations for some very common services like Dropbox, GitHub, Instagram, PayPal, Pusher, Salesforce, Slack, Stripe, Trello, and WordPress

Webhooks in EPiServer

What would an EPiServer implementation / usage of WebHooks look like?

  • Publish content events to subscribers (system to system integration)
  • Publish Form data inputs to external systems
  • Publish / Subscribe to Catalog events and changes from integrated commerce systems (Stock control and pricing)
  • Subscribe to events from external systems (Payments)
  • Subscribe to external content events – Instagram / social

Ascend London

I was invited to talk (along with fellow EMVP Khurram Khan) at the technical track at EPiServer Ascend London 2015. You can download the slides from Slideshare.


As part of a presentation I put together a simple solution demonstrating an EPiServer site with an Instagram receiver that provided a solution to the below user story.

“As a content editor, I want images that are uploaded on a social channel (Instagram) and tagged with ‘ascend15’ to be available in my content management system so I can use them on my awesome website”

The solution contained the following elements:

  • A receiver accepting notifications from Instagram when a image with a tag of ‘ascend15’ was added (using the ASP.NET WebHook framework)
  • A Dynamic Data Store implementation to store the number of notifications received
  • A scheduled job: to request, download and import images into EPiServer as MediaData / IContent items

The solution and even the scenario was a little contrived, so I’m not going to show the code (though it you really want it just drop me a line). It did however work on the day, which when you’re trying a tech demo that relies on the cloud and external services and also your own code; is always nice :)

Written by mark

November 11th, 2015 at 10:49 am

Posted in ASP.NET,C#,EPiServer

Chief2moro.ImageDataExtensions now available for EPiServer 9

without comments

Another short, sharp blog post to note that a version of the CHIEF2MORO.ImageDataExtensions package which is compatible with EPiServer 9 is now available in the EPiServer Nuget Feed. Fellow EMVP Marija Jemuovic did all the hard work, and I got the easy part in blogging about it.

There not much more to say, so here is a space filler…..

7d25cb66b18e1a6fbada9f630e84e2db

 

 

Written by mark

October 27th, 2015 at 9:00 am

Posted in ASP.NET,C#,EPiServer

Enhanced RSS / ATOM Feeds for EPiServer

without comments

I’ve released a new version of CHIEF2MORO.SyndicationFeeds. Along with upgrading to EPiServer 9, I’ve also taken the opportunity to add a few additional features based on some feedback and my own real usage.

Advanced Filtering

The library now contains the IFeedContentFilterer interface which provides an extension for any custom filtering you may want to achieve (for example – removing items with empty description’s). The default implementation filters via the EPiServer FilterForVisitor filters (Published status, Access rights, Has a template), though ignores the HasTemplate rule for blocks, so they can still be exposed. It also filters on EPiServer categories and ContentType, both of which are selectable by an editor on an instance of the Feed PageType.

Changing each Item’s summary in the feed.

You can now provide your own implementation of IFeedDescriptionProvider which is an interface that describes how a content item’s feed summary / description is derived. This allows you to provide your own implementation of where the items summary is stored. This may for example be from a common page property across all content types, or may be specific to each content type. By default, each item has a summary like ‘An src link to content with id = {content.ContentLink.ID} and name = {content.Name}’. The IFeedDescriptionProvider extension replaces the previous SetItemDescription delegate way of overriding the summary / description. The delegate is still available to maintain backwards compatibility but is marked as obsolete.

It’s on Nuget

The source code is available at https://github.com/markeverard/Chief2moro.SyndicationFeeds. I am happy to receive feedback and pull requests though I need to make a formal and public apology to Thomas Svensen who did indeed send me a pull request, which I ignored like an extremely bad open source steward….. Sorry :(

A package (currently v2.0.0.0) is available in the EPiServer Nuget Feed – http://nuget.episerver.com/ – search for CHIEF2MORO.SyndicationFeeds

 

 

Written by mark

October 26th, 2015 at 9:00 am

Posted in ASP.NET,C#,EPiServer

Adding GA tracking to Emails delivered using Adobe Campaign

with one comment

Adobe Campaign contains a formula that is executed in the delivery preparation phase which parses a delivery template and modifies all links, so that they are passed through a tracking server. This allows links to be individually tracked to a both an email recipient and a specific delivery.

Example
A link to the BBC news site, http://www.bbc.co.uk/news is changed to https://t.adobe-campaign.server/r/?id=hcc970,436a07,436a08. The latter url eventually resolves to BBC news, but first is passed through the tracking server, that issues a redirect and records that the link has been followed.

Google Analytics Tracking

Google Analytics can track inbound links to a site and attribute them to a source and an associated campaign. It does this in a number of ways, either via cookies, or for cross-domain links by checking querystring parameters. The following parameters are recognised

  • utm_content
  • utm_source
  • utm_medium

See the following link for further information about each parameter and the ‘meaning’ – https://support.google.com/analytics/answer/1033867?hl=en

Modifying the Click Tracking Formula

The click tracking formula in Adobe Campaign can be modified to include additional query string parameters within the forwarding record. This is achieved by modifying the NmsTracking_ClickFormula contained in Administration > Platform > Options

Warning
You should very carefully test the click tracking formula after making any modifications. Be very sure that the record you enter doesn’t include any spurious white space or line-breaks. Adobe Campaign is very ‘fussy’ about character encoding! As an example, when I first modified the below we discovered that modified outbound links were rendering incorrectly in Hotmail / Outlook.com email clients.

Links within the rendered email body had a line break before and after the URL which Hotmail interpreted as a link without a protocol and so added an additional protocol to the start of the url, so our links looked like https://https://t.adobe-campaign.server/r/?id=hcc970,436a07,436a08 . I’m sure this type of functionality is intentional from Hotmail / Outlook so they can turn www.bbc.co.uk entries in text into a fully-formed hyperlink. Regardless, it does show the complexity and why its vital to test your deliveries in a tool like Litmus – test email rendering.

Be very careful about cutting and pasting this as I’ve deliberately added line-breaks and white space to make it readable!

<% if( typeof strPurlTrackingServer!="undefined" && strPurlTrackingServer.toString() ) { %>
<%= strPurlTrackingServer %>
<% } else { %>

<%@ include option='NmsTracking_ServerUrl' %><% } %>/r/?id=<%= type.substr(0, 1) + (message.id<0 ? (message.id+4294967296) : message.id).toString(16).toLowerCase() %>,
<%@ value object="delivery" xpath="@idTracking" %>,<%= escapeUrl("$(urlId)") %>&utm_campaign=<%= variables.utm_content%>&utm_medium=email&utm_source=adobe_campaign
<%
if (document.mode == "forward")
{
 var d = message.getParameter("d")
 if( d )
 d = d.split(",")
%>
&ap_visitorId=<%=message.getParameter("visitorId") != '' ? message.getParameter("visitorId"):0 %>&ap_category=<%= d[0]?d[0]:'' %>&ap_deliveryId=<%=d[1]?parseInt(d[1],16):0%><%
} %>
<%
if( typeof proposition != "undefined" && proposition.length == undefined )
{ %>&ap_oid=<%= proposition.offer.id %>
<% } %>

The utm_medium and utm_source variables are hardcoded to be ’email’ and ‘adobecampaign’. These parameters are used by marketing analysts to understand the channel and source system that a visit can be attributed to.

Adding a variable to a delivery template

The above tracking formula depends on the delivery template having a variable named utm_content added into its context. If a template does not have this variable defined then the delivery will fail at the html compilation stage, and that’s always a pain to debug!

A good practise is to have the variable’s value taken from the internal delivery Id. This means your Google Analytics will be able to easily identify inbound links coming from specific emails sent from Adobe Campaign. It’s straightforward to set this within the delivery template as shown below.

 

add-delivery-template

Written by mark

October 8th, 2015 at 10:00 am