Formatting Widget Template for Custom Data Type

Posted by Community Admin on 04-Aug-2018 21:24

Formatting Widget Template for Custom Data Type

All Replies

Posted by Community Admin on 02-May-2013 00:00

I've created a custom type using the module builder. Within the custom type, two of the data fields are media types allowing multiple documents to be uploaded.  No problems here - works great.

However, in writing the widget template to display the entered data, I've run into a formatting issue. I'm using the AssetsField to retrieve the list of documents for the given data field, and when it returns a list having multiple entries, it's adding inline css (like a mini widget template) for that list of items.  How do I override or control the html returned from the AssetsField?

This is my widget template

01.<%@ Control Language="C#" %>
02.<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
03.<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
04.<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
05.<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
06.<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
07.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
08.<telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
09.    <LayoutTemplate>
10.        <table class="bidsTable">
11.            <tr class="header">
12.              <td class="awardedDate"><asp:Literal ID="cd" runat="server" Text="Date Bid Closed" /></td>
13.              <td class="awardedDesc"><asp:Literal ID="ad" runat="server" Text="Bid Description" /></td>
14.              <td class="awardedBid"><asp:Literal ID="ab" runat="server" Text="Awarded Bid" /></td>
15.              <td class="bidSpec"><asp:Literal ID="link" runat="server" Text="Bid Specifications" /></td>
16.            </tr>
17.          <asp:PlaceHolder ID="ItemsContainer" runat="server" />
18.        </table>
19.    </LayoutTemplate>
20.    <ItemTemplate>
21.        <tr class="bidItem">
22.          <sf:FieldListView ID="DueDate" runat="server"
23.          Format="DueDate.ToLocal():MM-dd-yyyy"
24.            WrapperTagName="td"
25.            WrapperTagCssClass="awardedDate" />
26.          <sf:FieldListView ID="ld" runat="server"
27.            Format='<%# Eval("Title")%>'
28.            WrapperTagName="td"
29.            WrapperTagCssClass="awardedDesc" />
30.          <sf:AssetsField ID="awardedLink" runat="server"
31.            DataFieldName="AwardedBid"
32.            WrapperTag="td"
33.            CssClass="awardedBid" />
34.          <sf:AssetsField ID="bidLink" runat="server"
35.            DataFieldName="BidSpec"
36.            WrapperTag="td"
37.            CssClass="bidSpec" />
38.        </tr>
39.    </ItemTemplate>
40.</telerik:RadListView>
41.<sf:Pager id="pager" runat="server"></sf:Pager>
42.<asp:PlaceHolder ID="socialOptionsContainer" runat="server"></asp:PlaceHolder>

Here's a sample of the html returned by the AssetsField.

01.<tr class="bidItem">
02.          <td class="awardedDate">03-04-2013</td>
03.          <td class="awardedDesc">RES TLS 13-07 Hot Mix</td>
04.          <td id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink" class="awardedBid">
05.          <div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_browseAndEditToolbar" style="display:none;"></div>
06.<div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_itemsContainer" class=" sfLargeIcns">   
07.            <ul class="sfdownloadList sfListMode">     
08.            <li id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl01_docItem" class="sfdownloadFile sfpdf">
09.                <a id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl01_documentLink" href="http://localhost:45112/DouglasCountyWA/docs/default-source/bcc/award-tls-13-07---central.pdf?sfvrsn=0" target="_blank" class="sfdownloadTitle">AWARD TLS 13-07 - CENTRAL</a>
10.                <div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl01_infoLabel" class="sfInfo">
11.            PDF, 173.04 KB
12.        </div>
13.            </li>      
14.            <li id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl02_docItem" class="sfdownloadFile sfpdf">
15.                <a id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl02_documentLink" class="sfdownloadTitle" href="http://localhost:45112/DouglasCountyWA/docs/default-source/bcc/award-tls-13-07---granite.pdf?sfvrsn=0" target="_blank">AWARD TLS 13-07 - GRANITE</a>
16.                <div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl02_infoLabel" class="sfInfo">
17.            PDF, 283.77 KB
18.        </div>
19.            </li>      
20.            <li id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl03_docItem" class="sfdownloadFile sfpdf">
21.                <a id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl03_documentLink" class="sfdownloadTitle" href="http://localhost:45112/DouglasCountyWA/docs/default-source/bcc/award-tls-13-07---mitchell.pdf?sfvrsn=0" target="_blank">AWARD TLS 13-07 - MITCHELL</a>
22.                <div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_awardedLink_ctl00_ctl00_multipleDocumentsControl_masterListView_ctl00_ctl00_documentsRepeater_ctl03_infoLabel" class="sfInfo">
23.            PDF, 919.84 KB
24.        </div>
25.            </li>   
26.            </ul>      
27.</div>
28.</td>
29.          <td id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_bidLink" class="bidSpec">
30.<div class="sfdownloadFileWrp">        
31.<a id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_bidLink_ctl00_ctl00_documentLink_ctl00_ctl00_documentLink" class="sfpdf" href="/DouglasCountyWA/docs/default-source/bcc/tls-13-07.pdf?sfvrsn=0" target="_blank">TLS 13-07</a>
32.<div id="ctl00_Content_ctl03_ctl00_ctl00_dynamicContentListView_ctrl3_bidLink_ctl00_ctl00_documentLink_ctl00_ctl00_browseAndEditToolbar" style="display:none;">
33.            </div>
34.        </div>
35.    </td>
36.</tr>


This thread is closed