More in this section

Forums / Developing with Sitefinity / Error with News Header in Unicode font

Error with News Header in Unicode font

9 posts, 0 answered
  1. lam huynh
    lam huynh avatar
    8 posts
    Registered:
    08 Sep 2009
    01 Jul 2010
    Link to this post
    I got error when view News Detail when I try to typst news header in unicode,
    The website can see the URL with Unicode ecoding :(
    please look at attach file
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Jul 2010
    Link to this post
    Hello lam huynh,

    Please create a new metakey ( check UserManual page 219) and use this metakey to set the title of your content item. You should keep using the default metakey for the title and enter the item name in English chars

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. lam huynh
    lam huynh avatar
    8 posts
    Registered:
    08 Sep 2009
    02 Jul 2010
    Link to this post
    Sorry, but I can't find
    \Sitefinity\Admin\ControlTemplates\News\NewsItemEdit.ascx
    \Sitefinity\Admin\ControlTemplates\News\App_LocalResources\NewsItemEdit.ascx.resx
    in my project
    Where can I find them?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Jul 2010
    Link to this post
    Hello lam huynh,

    You have to map the external templates How to map a template

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. lam huynh
    lam huynh avatar
    8 posts
    Registered:
    08 Sep 2009
    02 Jul 2010
    Link to this post
    Sorry, but I don't know how to set Metakey to show as Title or fill tiltle by metakey data
    please help me more
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Jul 2010
    Link to this post
    Hi lam huynh,

    Have you created an additional metakey ? What is the problem you are facing ?

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. lam huynh
    lam huynh avatar
    8 posts
    Registered:
    08 Sep 2009
    02 Jul 2010
    Link to this post
    I checked UserManual page 219, and I can create new field like sample (Subtitle).
    But I don't know how to set Title = Subtitle.
    I want to show News Title is Subtitle because I can make Title in Unicode encoding
  8. lam huynh
    lam huynh avatar
    8 posts
    Registered:
    08 Sep 2009
    03 Jul 2010
    Link to this post
    please help me to solve this problem step by step
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Jul 2010
    Link to this post
    Hello lam huynh,

    In the default metakey for news Title you should write your item title in English chars ( you should not use special characters . Then in the textbox of the newly create metakey write the title in the language you prefer.
    In ListPageMaster template of the public control - NewsView add a HyperLink control which has the same ID as the newly added metakey.
    Create a custom class that inherits from NewsView. Override SetItemContent method and find the default title control - you should set Visible="false" for it and set the NavigateUrl property value of this control to NavigateUrl of the newly added control.

    sample code

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.News.WebControls;
    using System.Web.UI.WebControls;
    using System.Web.UI;
    using Telerik.Cms.Engine;
    using Telerik.Cms.Web;
    using Telerik.Cms.Web.UI;
    using Telerik.Cms.Engine.ContentViewFiltering;
    using Telerik.Libraries;
    using System.ComponentModel;
    using System.Collections;
     
    /// <summary>
    /// Summary description for NewsViewCustomControl
    /// </summary>
    public class NewsViewCustomControl : NewsView
    {
     
        private BehaviorModes behaviorMode;
     
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx";
            }
     
        }
     
        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx";
            }
     
        }
     
        public override Type LocalizationAssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.LocalizationAssemblyInfo = value;
            }
        }
     
        public override Type AssemblyInfo
        {
            get
            {
                return this.GetType();
            }
            set
            {
                base.AssemblyInfo = value;
            }
        }
     
     
        protected override void SetItemContent(Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
        {
            base.SetItemContent(itemContainer, contentItem);
     
            for (int i = 1; i < 6; i++)
            {
                HyperLink ctrl = (HyperLink)itemContainer.FindControl("fullContent" + i);
                if (ctrl != null)
                {
                    // find our custom control that we will use as a title.
                    HyperLink customCntrl = (HyperLink)itemContainer.FindControl("customTitle" + i);
                    if (customCntrl != null)
                    {
                        ctrl.Visible = false;
                        customCntrl.NavigateUrl = ctrl.NavigateUrl;
                        customCntrl.Text = (string)contentItem.GetMetaData("customTitle");
                    }
                }
            }
        }
    }


    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
9 posts, 0 answered