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

Forums / Designing & Styling / Displaying the news category field

Displaying the news category field

4 posts, 0 answered
  1. Maciej
    Maciej avatar
    2 posts
    Registered:
    17 Jan 2011
    28 Apr 2011
    Link to this post
    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.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Apr 2011
    Link to this post
    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

  3. Maciej
    Maciej avatar
    2 posts
    Registered:
    17 Jan 2011
    28 Apr 2011
    Link to this post
    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.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 May 2011
    Link to this post
    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
4 posts, 0 answered