You’ve got your brilliant new website, full of interesting and beautiful content, but you also want to hear from the users of your site, or to show them content based on their preferences. Maybe you need something as simple as a contact form, or something as complex as a branching survey which tailors its questions to the user’s responses. You may even want to give your users the ability to make donations or payments for products and services.
When we work with a customer to deploy a new website, we first make the website available on the internet under a different domain name for the website content to be added before going live.
The ability to categorise content is something many of our clients have a use for when managing their site. Whether it's to categorise blog posts, news articles or used to define pages that are related to each other, it's a common requirement to allow content editors to assign categories to pages and content items within the CMS.
There are some packages for tagging pages, but these are often service-based or a free-text tagging which some clients feel is a bit too informal or open to mistakes and accidental duplication. Having the ability to create a fully bespoke hierarchical tree of categories for assigning to content within their website is often just what they need.
Enter Categorisation for Umbraco. This simple package integrates the functionality which allows website administrators to define a tree of categories to be available to editors when editing their content.
Filtering pages in EPiSiteMap module for EPiServer is very simple. The module re-uses the EPiServer page filtering implementation to enable you to filter pages from the generated xml sitemap files based upon any logic that you require.
To implement your own page filters, there are two steps required.
- Create a class for the filter which implements EPiServer.Filters.IFilter.
- Decorate the class with the attribute Auros.EPiSiteMap.Filters.SiteMapFilter.
When the Sitemap job is run, the module will look for any filters using the above interface and class attribute. All pages in the site will then be passed through these filters before considered for inclusion in an xml sitemap file.
There are already a number of filters which are built into the module and run by default on the pages. These are:
- FilterPublicAccess - Filters pages which do-not have public access.
- FilterContainerPages - Filters container pages so they are not added to the sitemap.
- FilterPagesByLinkType - Filters pages which have a link type of either external, shortcut or inactive.
When creating our own page filters, we have to be aware that when the job runs on a schedule, the job will be running with no HTTP context.
An example of this is when we are required to filter secure pages from the sitemap files. We cannot use EPiServers FilterPagesForVisitor filter as this relies upon HttpContext.Current to assert the currents users access. To work around this, we can mock an anonymous visitor with 'everyone' access and assert the security check against the pages access control list.