Try our conversational search powered by Generative AI!

smithsson68@gmail.com
Jan 24, 2010
  10209
(1 votes)

Page Rating example using Page Objects

At the EPiServer Techforum in Oslo last week, I showed a quick and dirty page rating feature for CMS 6 using Page Objects and Dynamic Content. The source code for that can be found here .

The project consists of 3 class:

  1. The Rating object. This is the Page Object that holds the rating data for the page
  2. The RatingDC which provides the IDynamicContent implementation
  3. The RatingControl which is the Dynamic Content User Interface control.

To test it out, copy the Rating assembly dll to a CMS RC1 site’s bin folder. Create a Rating folder under the site root folder and then copy the RatingControl.ascx to that. Under that folder create a folder called Images. To that folder copy the star.png file.

You will then need to register the Dynamic Content in the site’s episerver.config file as shown below:

<dynamicContent>
    <controls>
        <add description="Displays a Rating facility" name="Rating" type="EPiServer.Samples.RatingDC, Rating" />
    </controls>
</dynamicContent>
Jan 24, 2010

Comments

Björn Olsson
Björn Olsson Sep 21, 2010 10:33 AM

What happens with the cached PageData object when the page is saved using the same version? Is it left unchanged or removed from the cache?

Sep 21, 2010 10:33 AM

Hi,

At the moment all changes to page objects will involve the affected page being removed from the cache. We hope to make some small changes before CMS 6 is released so if only the actual object has changed (the item that is stored in the Dynamic Data Store) then we do not need to save the PageData and therefore the cache remains in tact.

Obviously, if new page objects are added or existing ones removed from the PageObjects collection on PageData that a save is required and the cache will still be emptied.

Paul.
/ Paul Smith

Sep 21, 2010 10:33 AM

Sounds good :) Removing the page from cache everytime someone votes wouldn't be very optimal, looking forward to the release of CMS6.

/BR
/ Björn Olsson

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog

The A/A Test: What You Need to Know

Sure, we all know what an A/B test can do. But what is an A/A test? How is it different? With an A/B test, we know that we can take a webpage (our...

Lindsey Rogers | Apr 15, 2024

.Net Core Timezone ID's Windows vs Linux

Hey all, First post here and I would like to talk about Timezone ID's and How Windows and Linux systems use different IDs. We currently run a .NET...

sheider | Apr 15, 2024