Custom Module Data Fields Not Appearing in Template "Common data" list
When attempting to edit a template for a custom content module type, the "Common Data" list on the top right corner of the Edit Template screen only lists the "UrlName" field, not all of the fields for the custom content type. (See screenshot)
Additionally, if I have a "media" field defined as an image and want to pull that image into my display template, how do I reference it? For example, I have a custom module called "professionals" that I am using to create the directory of professionals page on our website. Within the professionals module, I have a field called "BioPhoto" that is set to a media/image field. Upon creating an item in this content type, I selected a photo already uploaded into a SF album. Now I want to edit a template for this content and pull in a field to display the BioPhoto. I have attempted to reference the BioPhoto field via <%# Eval("BioPhoto")%>, as have successfully with other varchar type fields such as "FirstName", but I receive an error (see screenshot 2). How can I use an image field in my template?
Thanks
Hi Craig Brown,
Yes, unfortunately this is a known issue. We will try to get this issue resolved as soon as possible.
As, for your second problem, there are two things:
a) you are getting the syntax error; in the alt tag you are missing the closing "%>" tag
b) this however, won't help you a lot. What you need to do is actually following (as we do not store the url in the image field, but information about the image from the libraries module)
<sitefinity:AssetsField id="bioPhoto1" runat="server" DataFieldName="BioPhoto" />
make sure you include the Telerik.Sitefinity.Web.UI.Fields namespace (with tag prefix "sitefinity") for the above code to work.
A bit of background on the AssetsField. It works with single document, multiple documents, single image, multiple images, single video and multiple videos. The control will autoconfigure itself based on the type of the field designated through the DataFieldName.
Hope this helps.
Thanks for the help, Ivan! Will the datafield fix be released in a hotfix or do I have to wait until 4.5 in February?
Hello Craig Brown,
This will part of our upcoming release in February. By default the widget template includes all fields part of your module in a specific order depending on the field type, so the template should already possess all available fields. Please let us know if that doesn't work for you.
Greetings,I realize this is an older thread, but I'm having the same issue as the original poster of custom fields not appearing in the common data list in the current version of Sitefinity (6.1.4600). Should this issue be resolved in this version and if so, can you direct me toward what might be causing it in a particular case?
Hi Maria,
If you share some details about your Dynamic module and the created fields I will try to reproduce the problem on my test project. At this time I have difficulties to reproduce it.
Regards,
Kaloyan
Telerik