Displaying the news category field - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Displaying the news category field

  • Displaying the news category field
  • Hi there, im using siteifnity 4.0 and im creating a page with standard news control. I wish to create Template for List of posts which would be displaying such fields as author, date of creation and category. First two are easy to put into, its enough to paste  

    <%# Eval("Author")%></a> on <sf:FieldListView ID="PostDate" runat="server" Format=" PublicationDate.ToLocal():MMM dd, yyyy" />



     something like that. I have no idea how to put category field in that or similar way, any suggestions?

    Thanks.
  • Hello Maciej,

    You should add the following control in the template

    <sitefinity:HierarchicalTaxonField ID="HierarchicalFieldControl" runat="server" TaxonomyId="E5CD6D69-1543-427b-AD62-688A99F5E7D4" DisplayMode="Read" WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" Expanded="false" TaxonomyMetafieldName="Category" ExpandText="ClickToAddCategories" BindOnServer="true" />


    Best wishes,
    Ivan Dimitrov
    the Telerik team

  • Mhm, thanks for fast answer, buti already knew this way.
    I need to put all of this in one line. Look at that:

    <div class="post-info" !important>
                  <p class="post-meta" !important> Posted by <a href="#"> <%# Eval("Author")%></a> on <sf:FieldListView ID="PostDate" runat="server" Format=" PublicationDate.ToLocal():MMM dd, yyyy" /> <sitefinity:HierarchicalTaxonField ID="HierarchicalFieldControl" runat="server" TaxonomyId="E5CD6D69-1543-427b-AD62-688A99F5E7D4" DisplayMode="Read" WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" Expanded="false" TaxonomyMetafieldName="Category" ExpandText="ClickToAddCategories" BindOnServer="true" />
                </p>
              </div>

    Author and Date are in the same line, but category seems like it would be outside the <p> and <div> and its displaying under them.
  • Hi Maciej,

    You can use css to change the appearance of the result.

    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