London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

smithsson68@gmail.com
Jan 24, 2010
  10522
(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
Natural Language Q&A in Optimizely CMS Using Azure OpenAI and AI Search

In Part 2, we integrated Azure AI Search with Azure Personalizer to build a smarter, user-focused experience in Optimizely CMS. We used ServiceAPI ...

Naveed Ul-Haq | Apr 25, 2025 |

Identifying Spike Requests and Issues in Application Insights

Sometimes within the DXP we see specific Azure App Instances having request spikes causing performance degredation and we need to investigate. I fi...

Scott Reed | Apr 25, 2025

Optimizely Frontend Hosting Beta – Early Thoughts and Key Questions

Optimizely has opened the waitlist for its new Frontend Hosting capability. I’m part of the beta programme, but my invite isn’t due until May, whil...

Minesh Shah (Netcel) | Apr 23, 2025

Developer Meetup - London, 21st May 2025

The London Dev Meetup has been rescheduled for Wednesday, 21st May and will be Candyspace 's first Optimizely Developer Meetup, and the first one...

Gavin_M | Apr 22, 2025