+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom Module Widget Templates

Custom Module Widget Templates

3 posts, 0 answered
  1. Byzza
    Byzza avatar
    89 posts
    Registered:
    09 Jul 2007
    03 Jul 2012
    Link to this post
    Hi,
    Is there an easy way to get the Image URL, Document URL and Document Title to reference in a Widget template for a custom Module.

    I have a module with 3 items.
    * Title (Text)
    * Image (Media -Image)
    * Document (Media - Documents)

    Simply I want my template to look like
    <a href={documentURL}>{image}{DocumentTitle}</a>
    I've tried most of the options and non seem to give me what I'm after.

    any help would be appreciated.

    here is an extract of the test template I've been messing with.

    <div class="sfitemDetails">3
                <sf:SitefinityLabel ID="mainShortTextFieldLiteral" runat="server" Text='<%# Eval("Title") %>' WrapperTagName="h1" HideIfNoText="true" CssClass="sfitemTitle" />
                <sf:FieldListView ID="PublicationDate4" runat="server" Format="{PublicationDate.ToLocal():MMM d, yyyy, HH:mm tt}" WrapperTagName="div" WrapperTagCssClass="sfitemPublicationDate" />
                <sf:DetailsViewHyperLink runat="server" DataFieldName="Document" id="link" >
                  <sf:AssetsField runat="server" DataFieldName="ImageThumb" /></sf:DetailsViewHyperLink>
                <sf:AssetsField runat="server" DataFieldName="Document" />
            </div>
            <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("document")%>' />
            <sf:SitefinityHyperLink ID="documentLink" Text="<%$ Resources:Labels, Download %>"  runat="server" CssClass="sfdownloadLink" target="_blank"  />
            <br />urlName:<sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("UrlName")%>' />
            <br />Doc<sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Document")%>' />
            <br />ImageThumb<sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("ImageThumb")%>' />
            <br />URLs <sitefinity:TextField runat="server" DisplayMode="Read" Value='<%# Eval("Urls")%>'
  2. Matt
    Matt avatar
    42 posts
    Registered:
    25 Jan 2012
    19 Dec 2013
    Link to this post
    Hey Byzza,
    Did  you ever figure this out? I need to do the same exact thing.
  3. Byzza
    Byzza avatar
    89 posts
    Registered:
    09 Jul 2007
    19 Dec 2013 in reply to Matt
    Link to this post
    Hi Matt,
    No, I haven't found a solution as of yet.  I ended up putting this change on hold for a while.

    If you would it out, I would be interested to see you solution.

    Regards
    Byron
3 posts, 0 answered