2

So I have this query:

query:$home//[@@name='blogs']//[@@templatename='BlogArticle' and contains(@date, '202208')]

It works fine, but my goal is to compare the value of the @date field to the current date. Is there a way to get the current date in Sitecore?

My goal is to have something like this: query:$home//[@@name='blogs']//[@@templatename='BlogArticle' and @date >= @_currentdate - 2

I would like to be able to compare blog publishing dates to the current date and make sure they were published in the last 2 months.

Currently, Sitecore is pulling up to the RSS Feed limit of 50 and then sorting by date. (Hence not getting the most recent blogs published).

Or is there a better way? I'm open to any ideas!

1 Answer 1

0

Doesn't look like there is any default option to provide the kind of search capabilities you need. One option would be to create a custom "FeedItem" and implement the search filtering/sorting you need. You could also take advantage of the Content Search API to speed things up.

I found an article shared by a member of the community that could help.

https://www.sitecorespark.com/blog/2020/6/creating-and-customizing-an-rss-feed-in-sitecore

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.