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

Forums / Developing with Sitefinity / Add thumbnail image in blog module

Add thumbnail image in blog module

9 posts, 0 answered
  1. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    22 Jun 2011
    Link to this post

    I want to add some new fields like author's  thumbnail image, author's description etc. when create the new blog create, which i want to display in blog details post page. How can i do the change. Please help me.

    Thanks & Regards,
    Pravat Sharma
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Jun 2011
    Link to this post
    Hi Pravat,

    You can easily do this for blog posts, but is is quite hard for blog object, because you cannot use our dynamic data. You need to create a custom data layer or just a table into the database where you associate blog ID and data for your custom fields. You can take a look at these posts to see how the view could be overridden.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    23 Jun 2011
    Link to this post
    Hi Ivan,
                Thanks for reply. Please let me know how can do this for blog posts.


    Thanks & Regards,
    Pravat Sharma
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Jun 2011
    Link to this post
    Hi Pravat,

    Take a a look at our user manual,  section Adding Custom Fields

    Greetings,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    01 Jul 2011
    Link to this post
    Hi Ivan,
                I have added custom field(author Name and thumbnail ) in Sitefinity\Admin\ControlTemplates\Blogs\PostNew.ascx.
    <!-- Start Pravat-->
              
                    <h3>
                <asp:Label ID="lblAuthorName"  runat="server">
                    <asp:Literal ID="ltrAuthorName" runat="server" Text="Author Name"></asp:Literal>*
                    <em id="Em2" runat="server"></em></asp:Label></h3>
            <fieldset class="set">
                <div class="setIn title">
                    <asp:TextBox ID="Author" Text="AuthorName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Author"
                        Display="Dynamic" EnableViewState="False" CssClass="validMessage" SetFocusOnError="True">
                        <strong>
                            <asp:Literal ID="Literal6" runat="server" Text="Author Should not be blank"></asp:Literal></strong></asp:RequiredFieldValidator>
                </div>
            </fieldset>
            <div class="bottom">
                <div>
                    <!-- -->
                </div>
            </div>
            <h3>
                <asp:Label ID="Label5"  runat="server"></asp:Label></h3>
            <fieldset class="set">
                <ol class="setIn clearfix">
                    <li class="selector">
                        <asp:Label ID="Label3" AssociatedControlID="Thumbnail" runat="server">
                            <asp:Literal ID="Literal7" runat="server" Text="Thumbnail"></asp:Literal>
                            <em id="ThumbnailLabel" runat="server"></em></asp:Label>
                        <asp:TextBox ID="Thumbnail" Text="" runat="server" MaxLength="250"></asp:TextBox>
                        <sfLib:ButtonSelector ID="ButtonSelector1" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="Thumbnail" runat="server" cssclass="pickerWrapper" ButtonText="Select Image" />
                          
                    </li>
                </ol>
            </fieldset>
            <!-- end Pravat-->
    and  add meta field in web.config file.

    <

     

    add key="Blogs.BlogsAuthor" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue=""/>

     

    <

     

    add key="Blogs.BlogsThumbnail" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />

    but when i create new blog post these custom field is not save in my database.Please help me.

    regards,
    pravat sharma.

     

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jul 2011
    Link to this post
    Hi Pravat,

    The controls ID should be same as the metakey value.

    Regards,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  7. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    01 Jul 2011
    Link to this post
    Hi Ivan,
                 Thanks. I have change the controls ID as metakey name, but still not save in db. please help.

    <h3>
             <asp:Label ID="lblAuthorName"  runat="server">
                 <asp:Literal ID="ltrAuthorName" runat="server" Text="Author Name"></asp:Literal>*
                 <em id="Em2" runat="server"></em></asp:Label></h3>
         <fieldset class="set">
             <div class="setIn title">
                 <asp:TextBox ID="BlogsAuthor" Text="AuthorName" runat="server"></asp:TextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="BlogsAuthor"
                     Display="Dynamic" EnableViewState="False" CssClass="validMessage" SetFocusOnError="True">
                     <strong>
                         <asp:Literal ID="Literal6" runat="server" Text="Author Should not be blank"></asp:Literal></strong></asp:RequiredFieldValidator>
             </div>
         </fieldset>
         <div class="bottom">
             <div>
                 <!-- -->
             </div>
         </div>
         <h3>
             <asp:Label ID="Label5"  runat="server"></asp:Label></h3>
         <fieldset class="set">
             <ol class="setIn clearfix">
                 <li class="selector">
                     <asp:Label ID="Label3" AssociatedControlID="BlogsThumbnail" runat="server">
                         <asp:Literal ID="Literal7" runat="server" Text="Thumbnail"></asp:Literal>
                         <em id="ThumbnailLabel" runat="server"></em></asp:Label>
                     <asp:TextBox ID="BlogsThumbnail" Text="" runat="server" MaxLength="250"></asp:TextBox>
                     <sfLib:ButtonSelector ID="ButtonSelector1" WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="BlogsThumbnail" runat="server" cssclass="pickerWrapper" ButtonText="Select Image" />
                      
                 </li>
             </ol>
         </fieldset>
    and metakey value is
    <add key="Blogs.BlogsAuthor" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue=""/>
    <add key="Blogs.BlogsThumbnail" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />

    Thanks,
    Pravat sharma
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Jul 2011
    Link to this post
    Hello Pravat,

    Make sure that your controls are inside ContentMetaFields which wraps all other metafields.

    All the best,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  9. Pravat
    Pravat avatar
    59 posts
    Registered:
    22 Jun 2010
    01 Jul 2011
    Link to this post
    Hi Ivan,
                 Thanks for help. Problem is solved.

    Thanks & Regards,
    Pravat Sharma
Register for webinar
9 posts, 0 answered