SF5 Module builder issues
Hi
I have built a custom module using the module builder in Sitefinity 5. The aim of the module is to display a list of files that can be downloaded/viewed. This list has to be filtered by country and category. I can get the filtering to work manually ie. Using the categories widget on the page I can click the links and get the list to display the filtered files. But I need to be able to accomplish the filtering programmatically, that is I need a page to be loaded with files relevant only to the country that the logged in user entered when they registered. Also I need to programmatically build a categories menu based on the list of categories that are present in the classification ie. If I add a new category from the Sitefinity dashboard this category is added to the menu when the page loads.
I have two main problems with accomplishing the above;
Hope you can help
Thanks
Dan
You should be able to accomplish this using the TaxonomyManager in the API. This allows you to perform CRUD operations to taxonomies intuitively. For some examples check out the Hierarchical Taxonomy API
you can use this to both retrieve the Title of a category as well as batch process from say an xml file (or the EcommerceConfig countries property)
Hope this is helpful!
Hi
Thanks for your help on this and in another thread. I can now pull out nearly all the data i need. The only thing i am missing is the link to the file uploaded using the custom module. I can get file name, publication date etc but all i can get for the file is;
Telerik.Sitefinity.Model.ContentLinks.ContentLink[]
How can i resolve this to build a download link to the file?
Hope you can help
Thanks again
Hi Dan,
the data type of media content (such as videos, docs, and images) is always going to be an array of Guid for the IDs of the items, even for a single item.
The best way I've found to do this is with a helper method that uses the API to retrieve that item by ID and then I can get the remaining data (url, title, etc).
For an example, take a look at this post: Retrieving Data From Dynamic Modules Using the Module Builder API specifically the section Binding to Fields
Hope this is helpful!