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

Forums / General Discussions / Filter blog posts control

Filter blog posts control

16 posts, 1 answered
  1. vipul patel
    vipul patel avatar
    37 posts
    Registered:
    12 Mar 2010
    16 Jun 2010
    Link to this post
    Hi,

    I am new to sitefinity and have started building a blogs website for testing. We need to have to have pages to display blog posts for each topic. Each topic has more than one author.  As sitefinity has one blog per author the work around i am thinking is to create a blog per author who can create posts for multiper topics, but dont know how to filter the blog posts depending on the topic page.  There is a filter expression property on the blog posts control but dont know how to acheive what i am looking for.  What i need is to create a page per topic to show only posts related to that topic. Please guide me how this can be achieved in sitefinity 3.7.

    Vipul Patel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Jun 2010
    Link to this post
    Hello vipul patel,

    You can categorize or tag the posts then use FilterExpression property to create filtered list of content items.
    Another option - which is the better one is creating a custom metafields where you specify the post topic which will be used as a filter key. Then create a custom control that inherits from BlogPosts and override CreateDataSource where you can use ContentFilterBilder to filter the data

    ContentFilterBuilder filterBuilder = new ContentFilterBuilder(this);
     
      if (filterBuilder.IsFilterValid)
      {
          return this.Manager.GetContent(this.GetContentStartIndex(), this.GetPageSize(), this.SortExpression, filterBuilder.ParseTagFilter(), 1, null, filterBuilder.ParseParentsFilter(), filterBuilder.ParseMetaFieldsFilter());
      }


    Greetings,
    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.
  3. vipul patel
    vipul patel avatar
    37 posts
    Registered:
    12 Mar 2010
    16 Jun 2010
    Link to this post
    Hi Ivan,

    Thanks for your prompt reply,  I am thinking for another option, We can create blogs per topic and then create a metafield for author at the blog post level. Then when displaying the blog posts we can turn off the blogs author, but can we display the author from the metafield in the blog post control? If yes please guide me how to achieve it as this we we will not need any custom filtering on the page. 

    Thanks,

    Vipul Patel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Jun 2010
    Link to this post
    Hello vipul patel,

    You could take a look at our UserManual - page 219 about how to add custom metafields. Then you can map the public templates for BlogPosts control  ListPageMaster.ascx and ListPageDetail.ascx and add a control with the same ID as the name of the custom Author metakey name that will show the value.

    You might find the posts below useful


    Greetings,
    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.
    Answered
  5. vipul patel
    vipul patel avatar
    37 posts
    Registered:
    12 Mar 2010
    17 Jun 2010
    Link to this post
    Hi Ivan,

    Thanks for the precise answer and i am working on adding a metafield for Blog Post Author already, will come back to you if i have any problem.
    Another question is regarding the Admin section, we dont want the login page to be hacked as it will be available to everyone like the website, can this pages be using SSL? or can we seperate the admin section of the website to a different location? Basically what we are looking at is how to secure the login pages.
    Please let me know how to do it.

    Thanks again.

    Vipul Patel 
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    17 Jun 2010
    Link to this post
    Hi vipul patel,

    Please take a look for some general tips on securing the Sitefinity back-end: How to secure Sitefinity’s Administrative UI. You can also enable Https for the whole Sitefinity back-end by configuring this directory to require SSL from IIS.

    All the best,
    Radoslav Georgiev
    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
  7. vipul patel
    vipul patel avatar
    37 posts
    Registered:
    12 Mar 2010
    17 Jun 2010
    Link to this post
    Hi Ivan,

    I have got most of the custom meta fields working but have one problem,  in the blog post control setting when i uncheck the checkbox for Author it still shows the label "Posted by:", is there a way to turn it off,  same happens for category if there is no category it still shows the label, it should only be showing the label if there is a value, can you help me?

    Thanks,

    Vipul Patel
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    21 Jun 2010
    Link to this post
    Hello vipul patel,

    Thank you for getting back to us.

    The problem is that the Posted by is a separate control from the one displaying the author. You will have to edit the control templates for blogs list and single item to remove the control which is displaying this.

    Regards,
    Radoslav Georgiev
    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
  9. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    17 Dec 2010
    Link to this post
    In our application we are having a set of selected blog post GUID's ,

    I want to set the Filter expression using these GUID's

    How can I acheive this. In our application we are having different pages each page displays selected blog posts.
    We are having only one blog with different categories and tags.

    Multiple pages can use same post to display.

    Thanks
    Venkat
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Dec 2010
    Link to this post
    Hi Venkat,

    Out of the box you can filter items only by Parent ID.There is a method that you can use to get a single content item by passing Its id Get content by specified ID:. You need to create a custom control where you pass the array of Guids that you have to this method and return the IContent item.

    Greetings,
    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
  11. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    17 Dec 2010
    Link to this post
    Filter expression  :

    ID in (642A8EAE-36F9-451E-A7A6-3A450463DFCD) AND ParentID IN (ffb92acc-3184-4928-8cf5-8de9a91a5de9)

    Why ID filter not working? It is showing all posts in the blog with ParentID ffb92acc-3184-4928-8cf5-8de9a91a5de9

    How can I filter blog posts by ID.

    Thanks
    Venkat
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Dec 2010
    Link to this post
    Hi Venkat,

    What is the idea to use ParentID and ID together? If you have the ID of the item you do not need to set its parent in the expression. You can show a single item by using SelectedItemId  property although it is located in Obsolete members it will work properly. When the property is set you will see only a single item in details mode.

    Kind 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
  13. Venkat
    Venkat avatar
    105 posts
    Registered:
    20 Nov 2008
    17 Dec 2010
    Link to this post
    Hi Ivan Dimitrov ,
    Thanks for your quick reply.
    I want to display more than on item, from a blog not all posts.

    SelectedItemId will work for single item.If I want to display more than one item then?

    Can you please reply me now?

    Thanks
    Venkat
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 Dec 2010
    Link to this post
    Hello Venkat,

    "There is a method that you can use to get a single content item by passing Its id Get content by specified ID:. You need to create a custom control where you pass the array of Guids that you have to this method and return the IContent item."

    Response times in forums is 72hours.

    All the best,
    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
  15. Alex
    Alex avatar
    7 posts
    Registered:
    11 Oct 2012
    24 May 2013
    Link to this post
    Hi there Ivan Dimitrov,

    I know that there has been a while since no activity on this topic but I'd like to ask you how to filter blog posts in SiteFinity 5.4.xxxx by tag. I have a list of checkboxes and each checkbox corresponds to a tag, when the user selects the tag then I want to display all blog posts which have that tag.

    Note: that its a multi-select filter

    Thanks!
  16. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    29 May 2013
    Link to this post
    Hello,

    In sitefinity 5.4 Blog posts widget have a designer option to filter the displayed blog posts by tag, here is a screenshot. Select a tag and the displayed posts will be only those with the selected tag.

    Regards,
    Stanislav Velikov
    Telerik
    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
Register for webinar
16 posts, 1 answered