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

Forums / Developing with Sitefinity / Referencing Sitefinity label from within a Widget Template

Referencing Sitefinity label from within a Widget Template

5 posts, 0 answered
  1. IanWright
    IanWright avatar
    2 posts
    Registered:
    03 Dec 2012
    18 Feb 2015
    Link to this post

    HI

    I have a normal widget template, but since this is multilingual, I would like to have a Click Here link in different languages.

     I am trying to call the label like this:

    <asp:Literal ID="Literal3" Text='<%$ Resources:Labels,InThePress-ClickHere%>' runat="server" />

    but no luck.

    The link shows an error saying: #ResourceNotFound#:Labels:InThePress-ClickHere

    Any help please?

    thank you

    Ian

  2. Eric
    Eric avatar
    3 posts
    Registered:
    19 Feb 2015
    19 Feb 2015 in reply to IanWright
    Link to this post

    Hi Ian,

     

    is the label defined in all languages? All labels can be found under Administration/Labels & Messages. Just search for "InThePress-ClickHere". You should find your label.

    If so, please check wether your ResourceFiles are available in folder ~/App_Data/Sitefinity/GlobalResources.

    Best regards,

    Eric

    _______________________________
    netmedia - the Social Workplace Experts
    http://www.netmedia.de
    https://twitter.com/netmedianer

    https://www.facebook.com/netmedianer

  3. IanWright
    IanWright avatar
    2 posts
    Registered:
    03 Dec 2012
    19 Feb 2015 in reply to Eric
    Link to this post

    Hi Eric

    Yes all of them are there.

    Is it maybe becuase I am missing something related to the Type. in the labels section it says (This is the "class-id" value used in the code)?

     

    Remember that currently I am trying to call a sitefinity label like this:

    <asp:Literal ID="Literal3" Text='<%$ Resources:Labels,InThePress-ClickHere%>' runat="server" />

  4. Eric
    Eric avatar
    3 posts
    Registered:
    19 Feb 2015
    19 Feb 2015 in reply to IanWright
    Link to this post

    Is your Label contained in the Label-Type-Section Labels or in a other one? You can see it by editing your label. On the right side there is Type. e.g. When you are editing a label for blogs, the type is 'BlogResources'. Then your code should look like

    <asp:Literal ID="Literal3" Text='<%$ Resources:BlogResources,InThePress-ClickHere%>' runat="server" />

    Or the '-' sign isn't allowed in a key name. All other label keys aren't using the '-' sign. Try to use a underscore '_'.

    Hope that helps.

    Best regards

    Eric

  5. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    23 Feb 2015
    Link to this post
    Hello,

    We have resolved the issue in the Ian support ticket. You can find information about the labels usage bellow, since it might be useful for others interested in this thread:
    In order to use the labels, you should specify the type of the resource and the key of the resource of that type. For instance:
    Copy Code
    Text="<%$Resources:PublicControlsResources,LogOutText %>"
    The Log out text label is registered under the PublicControlsResources type (the resource class) and has a key LogOutText.Note that after adding the label, you should restart the application whether the resource you are editing is not alredy edited - there is already a resource file (.resx) in the App_Data -> Sitefinity -> Global Resources. The resources are also being cached, so an immediate change to take effect, a restart is required, as well.

    You are free to share further information with the community.

    Regards,
    Nikola Zagorchev
    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
     
5 posts, 0 answered