Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Data Rule to get
dgt
#1 Posted : Wednesday, March 17, 2010 8:43:01 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/21/2010(UTC)
Posts: 69
Location: London
Hi,
I've got a text schema with a child schema. The children are pictures with a title and a comment. So I have:

Item A
Title: "Item A"
Description: "This is my Item A"
Pictures: (Subcontent)
- Pic 1
- Pic 2
- Pic 3

I've got a details page that shows the Item and all the thumbnail images. When I click on one image, I need to open another page with the picture and description. On the query string I'm passing the ItemA UserKey and the selected picture's ContentId.
I can't figure out how to create a Data Rule to retrieve the specific subcontent given the Item UserKey and the ContentId, as data rules require a Data folder and I don't have a data folder for the child schema.

Help would be appreciated.

Francesc
jifeng
#2 Posted : Wednesday, March 17, 2010 9:01:28 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,391
Location: Xiamen China
Yes, as you said. The data rule required a data folder. So you cannot get child contents through data rule. You need to use ContentService API to get sub contents. The definition for get sub contents suck like:
ContentService.GetSubContents(parentContentId, schemaName, queryStatement, orderBy, queryValues, startIndex, pageSize, cacheTime)
ContentService.GetSubContents(parentContentUUID, schemaName, queryStatement, orderBy, queryValues, startIndex, pageSize, cacheTime)

For example:

var contents = ContentService.GetSubContents(contentId, "subschema", "","", new NameValueCollection(), 1, 20, null)
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
dgt
#3 Posted : Wednesday, March 17, 2010 9:27:52 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/21/2010(UTC)
Posts: 69
Location: London
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.055 seconds.