Retrive Posts of Blog

Posted by Community Admin on 04-Aug-2018 14:36

Retrive Posts of Blog

All Replies

Posted by Community Admin on 27-Jun-2011 00:00

Hello
How to retrive Posts of perticular Bolgs which contains Name of Post , AutherName(custom Field), Thumbnail Image (custom Field) , PublicationDate

I have used in following way ... But im getting error as

Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.




IQueryable

 

 

<BlogPost> allPosts =
App.WorkWith()

 

.BlogPosts()

.Where(bP => bP.Parent.Title == "BlogName" && bP.Status ==

 

ContentLifecycleStatus.Live)

 

.Get();


What is the problem ... Please Help !

Thanks :)

Posted by Community Admin on 27-Jun-2011 00:00

Hello Anu,

I executed the code you pasted without problems. Do you use the latest version of Sitefinity? The error shows that the query to the database is not valid which might be a result of passing wrong data in the query.
Can you replicate this issue on a new installation?

Regards,
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

Posted by Community Admin on 28-Jun-2011 00:00

Hello Admin,

im using Sitefinity 4.0.1210.0 version ... i have fired following Query

BlogsManager

manager = BlogsManager.GetManager();  

IQueryable<BlogPost> allPosts = manager.GetBlogPosts()
.Where(p => p.Parent.Title ==
"SEM").Where(s => s.Status == ContentLifecycleStatus.Live);
 

Where SEM is the name of my Blog and i want to retrive all the post of Blog "SEM" ... is it right ?

im getting following attached Error ...

Please Help ...

Posted by Community Admin on 28-Jun-2011 00:00

Hi Anu,

Please upgrade to the latest official release which is 4.1 1501 and let me know whether you experience problems. You can also install a new project with the project manager which will take no more than 1 minute and execute the same code to see if there will be any progress.

Regards,
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

Posted by Community Admin on 30-Jun-2011 00:00

Hello Admin,

BlogsManager

manager = BlogsManager.GetManager();  

 

BlogPost allPosts = manager.GetBlogPost(guid);

from the above query how to retrive Value of Custom Fields  from allPosts  ?
I have added "Meta_Description" Custom Field in Blog Post n i want to retrive its value.

Please tel me.

Thanks and Regards
Anu.

 

Posted by Community Admin on 30-Jun-2011 00:00

Hi Anu,

Here is a sample

allPosts. GetValue("name of your field);

GetValue is a method of DataExtensions class, so please add reference to it.

Best wishes,
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

Posted by Community Admin on 30-Jun-2011 00:00

Hello Admin,

Thanks a lot ... tht solved my issue ... :)

This thread is closed