Technical support This forum is closed.
Version 1.x > Technical support > Setting attributes of the CMSDataList View modes: 
User avatar
Member
Member
trint99 - 8/22/2006 12:16:18 AM
   
Setting attributes of the CMSDataList
I am using a CMS datalist to display cms.product objects. I have the following tree structure...

/
- Account
- Product (Folder)
- - Products (MenuItem that uses my products page template)
- - Product A
- - Product B
- - Product C
- Store

I have manipulated the folder object to allow products and menu items as children so that I can have a better organization within my tree. I have also done some customization of the product object.

The issue I have is this. If I set the attributes of the CMSDataList in the ASPX markup of my template, the attributes do not have any affect on the control.

<cms:CMSDataList ID="CMSProductList" runat="server"
SelectNodesPath="/Product/%"
SelectNodesPathType="AliasPath"
SelectNodesClassName="CMS.Product"
TransformationName="cms.product.default"
/>

When I Response.Write the SelectNodesPath of this control in the Page_Load method, it always comes back as the path of the current page. If I navigate to the Products page, the SelectNodesPath is set to Product/Products/% which finds no products and the control is empty. If I navigate to the template itself, the SelectNodesPath is /% which finds all products, not just those in the /Product/% path.

If I set the attributes within the code behind they do seem to take affect.

CMSProductList.SelectNodesPath = "/Product/%";
CMSProductList.SelectNodesPathType = TreePathTypeEnum.AliasPath;

With this, the products are rendered correctly.

Why do the attributes not work in the ASPX page? I would rather have it there in uncompiled code than in the compiled .cs code behind page.

User avatar
Guest
admin - 8/22/2006 10:11:59 PM
   
Re: Setting attributes of the CMSDataList
Hello,

Thank you for your message. Unfortunately, I'm not sure why the path specified in the page doesn't work as expected. Could you please send me the source code of the page template to support@kentico.com and write me which version of Kentico CMS (build number, programming language, .NET version) you are using?

Thank you.

Best Regards,