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

Forums / General Discussions / How to create a New content type with related icon

How to create a New content type with related icon

13 posts, 0 answered
  1. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    30 Aug 2010
    Link to this post
    Hello All,

    I wanted to create a new content type called as "Must read". the default icon for all the items in this content type should be an exclamation mark. I am not sure how I can create a new content type.

    I have already gone through http://www.sitefinity.com/blogs/gabesumner/posts/10-07-09/how_to_create_new_content_types_using_generic_content_modules_ndash_webinar.aspx. using this article I was able to create another content type udner Generic Content. But I couldn't assign a specific icon for these items.

    Please help.
  2. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    31 Aug 2010
    Link to this post
    Please help me on this as this is very urgent for us to implement.

    Thanks.
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Aug 2010
    Link to this post
    Hi Nagendra,

    The default image is set in ~/Sitefinity/Admin/Themes/Default/global1.css stylesheet. There is a class that you can set a new image directly or create a custom rule

    .itemInfo .itemExtension {
    background:url("Images/default.gif") no-repeat scroll 0 0 transparent;
    display:block;
    padding-bottom:5px;
    padding-left:20px;
    }


    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
  4. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    06 Sep 2010
    Link to this post
    Hello Ivan,

    Thanks for your reply. I wanted to access this image at the time of getting the content items. For example:
    when I do :: when I do :
    ContentManager manager = new ContentManager();
            IList list = manager.GetContent(0, max);

    I get some Content Items in list. Is there any property using which I can access the corresponding image from these list items?

    Thanks,
    Nagendra
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hello Nagendra,

    The IContnet object does not have a property of type image . You can use a metakey to store the image and then call GetMetaData("key") method of IContent object.

    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
  6. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    06 Sep 2010
    Link to this post
    Hello Ivan,

    Can you please tell me how can I use the meta key to store the value?

    Please let me know more in detail. I am all new to Sitefinity:(

    Thank,
    Nagen
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hello Nagendra,

    You can take a look at page 214 - Adding Custom Fields of our UserManual 

    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
  8. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    06 Sep 2010
    Link to this post
    Hello Ivan,

    Thanks for the information. Can you tell me which Key I can assign and also what would be its Value Type.
    Can you please provide a sample for the same?

    Thanks,
    Nagendra
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hi Nagendra,

    Could you attach a screenshot on the section you want to modify so I can guide you. Do you want to change the backend or front end. Are you creating a custom control? The backend list view uses RadGrid that is client side bound and you cannot just use server side code as you showed in one of your previous replies.

    Sincerely yours,
    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
  10. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    06 Sep 2010
    Link to this post
    Hi Ivan,

    Thanks for your concern on my problem. Here is the Big Picture of my problem:

    I am building an ASP.Net application which will show some articles from Sitefinity. I will be having 4 types of Content types each having a specific/unique icon attached to it. Lets say these are CT1, CT2, Ct3 and CT4.

    When I provide some tags and search for content, I will have to search from all the above 4 sections and should get the items. If my content item is coming from CT1, i should be also able to retrieve the corresponding image attached and show to the user. In the other words, I want the content type logo/image to be driven from Sitefinity.

    I have created a Web service to do all these actions.

    Answering your question, for example, if I see any items from generic Content in the Sitefinity web site, I will see an icon (almost like a Notepad icon) attached to each item. in your earlier you replied to me as of how to set this from CSS.

    Now, please guide me in 2 things:
    1. What would be the best way I can store my articles. Like should I create different sections for each Content type or shall I create categories under Generic Content?
    2. How can I access the icon associated with the Corresponding section.

    Please let me know in case if i am not clear because this is very important for me.

    Thanks,
    Nagendra
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hello Nagendra,

    Create a new metakey of type ShortText- say "ContentType". Then inside this metakey you have to type the content item type - Ct1, Ct2, Ct3 or Ct4. Then when get a list of all content items you can access the custom metakey and get the content type by using GetMetaData method - contentItem.GetMetaData("ContentType"). Depending on the returned type ( add switch block) you can set an image.

    You can create another metakey that uses ButtonSelector to reference an image from Image and Documents module to a given content item ( like Thumbnail) in News. Then you can retrieve the image ID and path to it.

    <asp:TextBox ID="ImageBox" runat="server"/>
     
    <sfLib:ButtonSelector ID="ButtonSelector2" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="ImageBox" runat="server" CssClass="pickerWrapper" ButtonText="Select" />


    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
  12. Nagendra
    Nagendra avatar
    28 posts
    Registered:
    07 Jun 2010
    06 Sep 2010
    Link to this post
    Hello Ivan,

    Thanks for the reply.
    I can't use a ButtonSelector selector as I am using these functions in a web service. More over I don't want to upload any images from the Images & Documents folder.

    All I want is to gain the access on icon corresponding to the section I have created. I have attached an image for your reference herewith (images.PNG).

    Thanks,
    Nagendra
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hi Nagendra,

    By default these icons are not explicitly related to the content item and the screenshot that you have attached and this appearance is not coming with the default set up.  Somehow you have to connect the connect the content item and the image. The easiest way is using metakeys.

    Sincerely yours,
    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
13 posts, 0 answered