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

Forums / General Discussions / Custom module images not displaying after adding a secondary frontend language

Custom module images not displaying after adding a secondary frontend language

14 posts, 0 answered
  1. Sean
    Sean avatar
    5 posts
    Registered:
    26 Mar 2015
    10 Sep 2015
    Link to this post

    I used the following Sitefinity documentation to add multilingual functionality to a site that already had content.

    Persist multilingual fields in separate tables for each language

    http://docs.sitefinity.com/administration-persist-multilingual-fields-in-separate-tables-for-each-language
    Checked both Use Split Tables and Use Fetch Strategy

    Language Settings

    http://docs.sitefinity.com/administration-language-settings
    Added French as a language
    Set URL structure to use directories i.e. domain.com/es

    After doing some, any images for custom modules (built with Module Builder) are not displaying or being pulled through onto the frontend for either language.

     

    Below is an example of a template that is being used. All information is displaying correctly apart from any image related property (i.e. Background and Image) which appears to have no data. When editing the custom module item for either language I can see that both properties have an image.

    <%@ Control Language="C#" %>

    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.DynamicModules.Web.UI.Frontend" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sf" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>

    <%@ Import Namespace="SitefinityWebApp.Common" %>
    <%@ Import Namespace="Telerik.Sitefinity.Web.UI" %>

    <sf:DynamicDetailContainer id="detailContainer" runat="server">
        <LayoutTemplate>        
            <div class='flexslider-hero flexslider-<%# Eval("UrlName") %>'>
              <asp:Repeater runat="server" runat="server" DataSource='<%# Eval("SliderItems") %>'>
                <HeaderTemplate>
                  <div class="flexslider">
                  <ul class="slides">
                </HeaderTemplate>
                <FooterTemplate>
                  </ul>
                  </div>
                </FooterTemplate>
                <ItemTemplate>
                  <li>
                    <a href='<%# Eval("ButtonUrl") %>'>
                      <picture>
                        <!--[if IE 9]><video style="display: none;"><![endif]-->
                        <source media="(min-width: 768px)" srcset="<%# Eval("Background.MediaUrl") %>">
                        <source media="(min-width: 480px) and (orientation: landscape)" srcset="<%# Eval("Background.MediaUrl") %>">
                        <source srcset="<%# Eval("Image.MediaUrl") %>">
                        <!--[if IE 9]></video><![endif]-->
                        <img class="img-responsive center-block" src="<%# Eval("Background.MediaUrl") %>" alt="<%# Eval("Background.AlternativeText") %>" />
                      </picture>
                    </a>
                  </li>
                </ItemTemplate>
              </asp:Repeater>
        </LayoutTemplate>
    </sf:DynamicDetailContainer>

    Any ideas on what might be happening?

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    25 May 2017
    15 Sep 2015
    Link to this post
    Hello Sean,

    Can you please make sure that you have translated the images in the specified language? If the image is not translated in a particular language version it will not be displayed when browsing this language version of the page.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Mitra
    Mitra avatar
    3 posts
    Registered:
    07 Mar 2013
    16 Sep 2015 in reply to Sabrie Nedzhip
    Link to this post
    Replying to Sabrie Nedzhip comment
  4. Mitra
    Mitra avatar
    3 posts
    Registered:
    07 Mar 2013
    16 Sep 2015
    Link to this post
    Replying to First comment
  5. Mitra
    Mitra avatar
    3 posts
    Registered:
    07 Mar 2013
    16 Sep 2015
    Link to this post
    Reply to Sean
  6. Sebastian
    Sebastian avatar
    5 posts
    Registered:
    23 Jan 2014
    18 Sep 2015
    Link to this post

    Does that mean I have to have a image available for each language?

    Is it possible to show the EN language per default? Because it is not doable for us to change that many pictures.

    I am currently trying to add an image to my list-template and it is not showing after I installed two more languages.

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend" TagPrefix="sf" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Import Namespace="Telerik.Sitefinity.Web.UI" %>
    <%@ Import Namespace="Telerik.Sitefinity.Modules.Comments" %>
    <sf:SitefinityLabel id="title" runat="server" WrapperTagName="div" HideIfNoText="true" HideIfNoTextMode="Server" CssClass="sfitemFieldLbl" />
    <telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <ul>
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li>
              <a href="<%# Eval("Link")%>">
                <img src='<%# Eval("Image.MediaUrl")%>' alt='<%# Eval("Image.AlternativeText")%>' title='<%# Eval("Image.Title") %>' />
                <h2><%# Eval("Title")%></h2>
                <p><%# Eval("SubTitle")%></p>
              </a>
             </li>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>

  7. Stos
    Stos avatar
    9 posts
    Registered:
    26 Jul 2012
    30 Mar in reply to Sebastian
    Link to this post
    Was there any answer to this or did support just let it die? Still an issue in 9.2. Has anyone found a useful workaround?
  8. Sean
    Sean avatar
    5 posts
    Registered:
    26 Mar 2015
    31 Mar in reply to Stos
    Link to this post

    Hi Stos

    We had to re-publish the images in the relevant languages.

  9. Stos
    Stos avatar
    9 posts
    Registered:
    26 Jul 2012
    31 Mar in reply to Sean
    Link to this post

    Thanks for the reply, Sean.

    That's unfortunately not a sustainable model, especially when we're trying to manage hundreds of partner logos for three languages and dozens of regions. Hopefully our Progress friends have some ideas. I'll post back here if we find a work around. Or maybe Progress will post their ideas too. ;-)

  10. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    09 Apr in reply to Stos
    Link to this post

    Hi Stos,

    In my mind i have this idea:

    Subscribe to IDataEvent (http://docs.sitefinity.com/for-developers-idataevent), check if it is image and it is newly created image, then automatically create another translations for this image

  11. Stos
    Stos avatar
    9 posts
    Registered:
    26 Jul 2012
    10 Apr in reply to Victor Leontyev
    Link to this post

    Thanks Victor. That's an interesting solution, but, for our particular situation, we have almost constant updates to these images so I would also need to extend that to replace/delete when appropriate. I suppose we could extend what you suggested to those actions, although I don't know if it would work unless we tried it. 

    For now, we're going to try a different custom module that will call the default language object and it's related image URL, and then use that to display the image in the other languages. Sort of creating a custom language fallback. We'll see if it works!

     

    I know it might not be appropriate in this forum but I want to give a shout out to petracoredesign.com who have been my Sitefinity partner of choice for many years. They don't know I'm posting this, but they are the ones coming up with innovative solutions to these issues. I would be lost without them.

  12. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    10 Apr in reply to Stos
    Link to this post

    You don't need to handle update operation, because image blob by default is common for all languages (if you will update image in EN, it will affect other languages as well). And you still need to handle delete.

     

    My solution will have better performance and very easy to implement. And it's working perfectly with different storages (for ex. CDN).

    If you have difficulties with that, let me know, i will write some code sample how to do that

  13. Victor Leontyev
    Victor Leontyev avatar
    65 posts
    Registered:
    01 Jul 2014
    26 Apr
    Link to this post
    Here the working sample https://github.com/vleontyev/sitefinity-image-auto-translation
  14. Stos
    Stos avatar
    9 posts
    Registered:
    26 Jul 2012
    26 Apr
    Link to this post
    Thanks. We're all set. Not sure details of what my guys did, but it works well for what we need. Thanks again for your suggestions.
14 posts, 0 answered