More in this section

Forums / General Discussions / Reading documents list

Reading documents list

4 posts, 0 answered
  1. John
    John avatar
    97 posts
    Registered:
    11 Jan 2011
    26 Jan 2011
    Link to this post

    Hi

    How can the list of documents retrieved from a specific library via code in for the purpose of displaying the documents in a custom widget?

    Thanks

    Regards

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Jan 2011
    Link to this post
    Hi John,

    You can use the fluent API.

    App.WorkWith().Documents().Where(d => d.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).Get().ToList();

    Please take a look at Media Modules

    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
  3. John
    John avatar
    97 posts
    Registered:
    11 Jan 2011
    26 Jan 2011
    Link to this post
    Hi

    Many thanks.

    This one is bringing all the documents from all libraries. Any way to restrict the returned documents from "staff documents" library only?

    Also is there a way to read user friendly document filename from library or the only way is to extract file name from Media Url field?

    Thanks

    Regards
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    31 Jan 2011
    Link to this post
    Hi John,

    You can add an condition in the Where statement

    && d =>d.Title == "test"

    You can use all Document properties inside the Where query.

    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
4 posts, 0 answered