Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Changing classnames via a filter View modes: 
User avatar
Member
Member
Rich - 6/10/2013 8:14:55 AM
   
Changing classnames via a filter
Hello,

It's possible to change the where condition of a Documents Data Source web part by using a Filter web part and using: "this.WhereCondition = myCondition;" in the filter code file. ( as per this Knowledge Base article )

Is it possible to change the Path or the Document Types (ClassNames) property of the data source in a similar way?

Thanks

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/10/2013 12:23:11 PM
   
RE:Changing classnames via a filter
They would all fall under the same this.WhereCondition property. For instance if you wanted to change the class from cms.news to cms.event it would simply be
 ClassName = 'cms.event'
Or to change a path, you can set it like so
NodeAliasPath = '/Your/New/Path'
The queries (views) used for documents types start with View_Content_<classname>_Joined. So you could take a look at the returned values for a simple query like so
SELECT * FROM View_CONTENT_Faq_Joined
and see that ClassName and NodeAliasPath are columns returned in the query.

User avatar
Member
Member
Rich - 6/11/2013 10:27:15 AM
   
RE:Changing classnames via a filter
Thanks, however I don't seem to have access to the same fields using this method.

SELECT * FROM View_CONTENT_File_Joined 

The results of the above query would indicate I have access to the FileAttachment, FileID and FileName properties.

When setting the Document types property within the repeater web part settings, I am able to display these properties using the Eval() method in a transformation.

When setting the Document type using the Where condition as suggested above i.e.
this.WhereCondition = "ClassName='cms.file' "

I am not able to access FileAttachment, FileID or FileName properties.



User avatar
Member
Member
Rich - 6/11/2013 11:19:24 AM
   
RE:Changing classnames via a filter
I have sorted this by using both. In the repeater web part settings I have entered all of the class names I will need into the Document types field, and then filtered them using the where condition. This has given me access to all fields for these class names.