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

Forums / Developing with Sitefinity / Localisation of News Summary and Title

Localisation of News Summary and Title

15 posts, 0 answered
  1. eva hermes
    eva hermes avatar
    12 posts
    Registered:
    09 Aug 2009
    04 Sep 2009
    Link to this post
    Hello,
    I enabled localisation for the news in my site, but notice now that the summary and title fields are shared across languages. I need these to be different - any idea how to achieve that?
    I also looked into adding custom fields to the news section, the information in the FAQ (http://www.sitefinity.com/sf3/faq.html#40)  tells me to modify the files ControlPanelEdit.ascx and ControlPanelInsert.ascx, but these don't exist in my install or in the external templates. Does this info relate to sitefinity 3.2 only? Does anyone know how to add custom fields in 3.6?
    Eva
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    04 Sep 2009
    Link to this post
    Hello eva hermes,

    summary and title fields are get from the database since they are metakeys. They are recognized as string. To add custom metakeys first you should map the external templates - How tp map an external template. Then add your custom metakeys. For more detailed information you can take a look at User Manual section "Adding custom Meta fields"

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. eva hermes
    eva hermes avatar
    12 posts
    Registered:
    09 Aug 2009
    04 Sep 2009
    Link to this post
    Hello Ivan,
    This is what I was looking for, but now that I have mapped the news edit to 'newsItemEdit.ascx', i get the following compiler error:
    CS1061: 'Telerik.Cms.Web.CmsPageBase' does not contain a definition for 'ResolveCmsUrl' and no extension method 'ResolveCmsUrl' accepting a first argument of type 'Telerik.Cms.Web.CmsPageBase' could be found (are you missing a using directive or an assembly reference?)
    Do you know what I'm missing here?
    Thanks for helping,
    Eva
  4. eva hermes
    eva hermes avatar
    12 posts
    Registered:
    09 Aug 2009
    04 Sep 2009
    Link to this post
    Hi again,
    I managed to map the external template for editing the news now, and added the meta key to web.config and a text field with the same id to the UI newsItemEdit.aspx.
    The new field doesn't seem to save though.
    Probably something I don't understand yet... Any help would be very much appreciated!
    Eva
  5. eva hermes
    eva hermes avatar
    12 posts
    Registered:
    09 Aug 2009
    05 Sep 2009
    Link to this post
    Now i figured out why the meta fields weren't saving - i hadn't added them to the correct section of the control, <sf:ContentMetaFields/>.Having done this now, the saving works!

    I ran into the next problem though in my frontend control (ListPageMaster.aspx).
    I want to now check if the page is german or english, and if it is english, replace my default german news title and summary with the english ones. I can retreive my new english title, but can't figure out how to change the text of the Literal ("Title") in the repeater from code.

    i try the function below - calling it from the repeater OnItemDataBound.

    protected void translate(object sender, RepeaterItemEventArgs e)
     {
     //some check for current language to go here

    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {

    foreach (RepeaterItem item in this.repeater.Items)   
    {
    Literal myLiteral = (Literal)e.Item.FindControl("Title");
    myLiteral.Text = "English Text";                                     
    // later to be replaced with the text from new metafield  holding the english title - this doesn't work to change the literal at all
    }  
    }
    }


     

    does anyone know if i am at all trying to do this the right way, or if there is a better way to achieve localization of a metafield?
    and if this the right way, what would be the code to update the literal within the repeater?
    hope this makes any sense at all, as i am completely new to .net!
    Eva

     

     

     

     

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    06 Sep 2009
    Link to this post
    Hi eva hermes,

    ListPageMaster.aspx is not a control it is a template for NewsView control. Also I suggest that you should use localization for News provider instead of hacking the NewsView repeater. More information can be found under Localization section our our User Manual.
    However to get the current culture you can use CultureInfo class.

    string info = CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName; 

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. eva hermes
    eva hermes avatar
    12 posts
    Registered:
    09 Aug 2009
    06 Sep 2009
    Link to this post
    Hi Ivan,
    I still have the feeling that I'm missing something very basic here.
    I have enabled localization for the news module, and that works as well as outlined on page 76 of the user manual. But the fields 'Title' and 'Summary' are shared between both languages, and I couldn't find information in the manual on how to change this. There is a link in the user manual to 'Multilingual Content Management > Module Localization' but this sends me to the end of the pdf (page 231 on the online user manual). There is no information on the subject on this page, or anywhere else in the pdf as far as I can see. I came across references to pages in the User Manual that were above no. 231 before, so I wonder now if I possibly look at a wrong version of the user manual. If this is the case, could you let me know where I can find the complete manual?
    Thanks!
    Eva
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 Sep 2009
    Link to this post
    Hi eva hermes,

    There is a boolean property - localizable, that you can set under metakey declaration.

    Example:

    <add key="News.Title" localizable="True" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. john mirzaei
    john mirzaei avatar
    13 posts
    Registered:
    06 Oct 2009
    10 Oct 2009
    Link to this post
    Hi Eva
    When trying to map the newsItemEdit.ascx i get this error just as u did:
    'Telerik.Cms.Web.CmsPageBase' does not contain a definition for 'ResolveCmsUrl' and no extension method 'ResolveCmsUrl' accepting a first argument of type 'Telerik.Cms.Web.CmsPageBase' could be found (are you missing a using directive or an assembly reference?)
    Can u help with solving this problem?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 Oct 2009
    Link to this post
    Hello john mirzaei,

    I am not able to reproduce any problem with mapping this template. Which version of Sitefinity and Telerik.Cms.dll you use. ResolveCmsUrl method is implemented from Sitefinity 3.6. Make sure that you do not have reference to an old version of  Telerik.Cms.dll

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. john mirzaei
    john mirzaei avatar
    13 posts
    Registered:
    06 Oct 2009
    11 Oct 2009
    Link to this post
    Hi ivan
    thank you
    you are right i'm using sitefinity 3.6 , i'm needing the external templates version 3.6  can you help me how can i download the external templates versiob 3.6? in the site i can only see external templates 3.7.
    thank you very much
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Oct 2009
    Link to this post
    Hello john mirzaei,

    There are not any download associated with your account and you are not allowed to download other Sitefinity versions that Sitefinity 3.7 SP1. If you tell us the exact version you use we could make exceptional attachment.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. john mirzaei
    john mirzaei avatar
    13 posts
    Registered:
    06 Oct 2009
    12 Oct 2009
    Link to this post
    Hi ivan
    Thank you very much for your help
    i'm using this version of sitefinity: 3.6.1936.2
    thank you again
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Oct 2009
    Link to this post
    Hello john mirzaei,

    Please find attached templates for Sitefinity 3.6 1936.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  15. john mirzaei
    john mirzaei avatar
    13 posts
    Registered:
    06 Oct 2009
    13 Oct 2009
    Link to this post
    Thank you ivan
    Great Help
    my problem solved

Register for webinar
15 posts, 0 answered