Filip Huysmans
Filip Huysmans

Reputation: 1341

Sitecore - how can I work with the 'sublayout parameter helper'?

i'm new in the sitecore/C# story and need some help with a helper.

I downloaded the sublayout parameter helper from "http://marketplace.sitecore.net/en/Modules/Sub_Layout_Parameter_Helper.aspx"

This gets me 2 .cs files with their own namespace: Sitecore.Sharedsource.Web.UI.Sublayouts

How can I implement these in my own solution so that I can use them?

Thanks in advance!

Upvotes: 1

Views: 206

Answers (1)

Jens Mikkelsen
Jens Mikkelsen

Reputation: 2712

You need to make your Sublayout codebehinds inherit from the SublayoutBase (which inherits from UserControl). In that way you can use the properties in that class. For instance you can access DataSourceItem etc.

So you should include the files in your project and then in your sublayouts have something like this:

public partial class LatestNewsSpot : SublayoutBase

And then you can do stuff like:

Item datasourceItem = DataSourceItem;

Upvotes: 3

Related Questions