Try Now
More in this section

Forums / Developing with Sitefinity / Boolean MetaField Problem

Boolean MetaField Problem

4 posts, 1 answered
  1. Ryan
    Ryan avatar
    13 posts
    01 Dec 2010
    09 Dec 2010
    Link to this post
    Sitefinity newbie here.
    I am trying to add a featured post meta field to the blog module.  This would only be visible to an admin, and they could set it to true to include it in a featured post user control.  I have added the entry to the web config

    <add key="Blogs.Featured_Post" valueType="Boolean" visible="False" searchable="False" sortable="False" defaultValue="False" />

    I have down loaded and included 3 external templates in the project (PostEdit, PostNew, and PostList.ascx).  And I'm currently trying to edit the file PostEdit.ascx, but not getting the desired result.  Here is my addition to PostEdit:

    <h3>Featured Post</h3>
     <fieldset class="set">
      <ol class="setIn">
        <asp:Label ID="Label3" AssociatedControlID="Featured_Post" runat="server">
         <asp:Literal ID="Literal2" runat="server" Text="Set featured status">
         <em id="Featured_PostLabel" runat="server"></em>
        <asp:Checkbox ID="Featured_Post" runat="server" />                                </li></ol></fieldset></ItemTemplate> </sf:ContentMetaFields>

    Not sure what I'm doing wrong here, but I have attached an Image of the result.  Also not 100% sure that I'm doing the Checkbox/Boolean Edit correctly, but I tried changing it to a Textbox, and still nothing showed up on the page. Thanks in advance for your help!
  2. Osman
    Osman avatar
    22 posts
    04 Oct 2010
    10 Dec 2010
    Link to this post
    Hi Ryan,

    Have you downloaded External Templates from the download area. It has all(!) the templates available for overwriting. And also it has Telerik.Sitefinity.Configuration.ControlsConfig.xml in App_Data/Configuration folder.

    You need to specify your new templates in that XML first. Until then it still inherits the template you used as a base, News perhaps?

    Check out External Templates and Telerik.Sitefinity.Configuration.ControlsConfig.xml

  3. Ryan
    Ryan avatar
    13 posts
    01 Dec 2010
    10 Dec 2010
    Link to this post
    Yes, I have downloaded the external templates, and the Telerik.Sitefinity.Configuration.ControlsConfig.xml file, and modified them.  The problem is my changes to the external template PostEdit.ascx.  As you can see from image I attached.  Some of the HTML I inserted is taking effect, but the checkbox (I also tried a textbox) does not show up??
  4. Leonard
    Leonard avatar
    19 posts
    01 Dec 2005
    11 Dec 2010
    Link to this post

    Set the attribute value for "visible" to "true" in your new <metaFields> element:

    <add key="Blogs.Featured_Post" valueType="Boolean" visible="True" searchable="False" sortable="False" defaultValue="False" />
Register for webinar
4 posts, 1 answered