Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > WHERE Clause in Query RSS Feed - Wont accept variable View modes: 
User avatar
Member
Member
stradle - 12/5/2013 10:10:28 AM
   
WHERE Clause in Query RSS Feed - Wont accept variable
I am trying to take all our blog posts and create a separate feed for a variety of different bloggers on our site.
So using one template, create a dynamic Query RSS Feed what would filter is blog posts by the author, which is also the NodeOwnerUserName

So on their individual pages, the button will generate an RSS feed based on the NodeOwnerUserName.

I created a Macro in the WHERE clause which was :

NodeOwnerUserName = '{%NodeOwnerUserName%}'

But when it goes to the "?rss=Blogger-Feed" feed page, it obviously doesnt have the "NodeOwnerUserName" anymore.

Any ideas how I might do this?

User avatar
Member
Member
kentico_sandroj - 12/5/2013 8:49:48 PM
   
RE:WHERE Clause in Query RSS Feed - Wont accept variable
Hello,

Creating a custom macro may be an option but you could also generate the link to the feed with a querystring appended, then use a querystring macro to get the value in your WHERE condition. Would one of these approaches work for you?

Best Regards,
Sandro

User avatar
Member
Member
stradle - 12/6/2013 5:49:51 AM
   
RE:WHERE Clause in Query RSS Feed - Wont accept variable
I have tried it as a webpart initially but couldnt get that to work, but now I am building it in to a transformation in the hope I can manipulate it a bit better.

Adding a query string isnt really possible, which property would you put that in? That would be the approach I would be most happy with.

The "FeedName" property is used to build the URL so I was hoping to tag another query string on the end, but it is being stripped out....

THIS WORKS....

FeedName='<%# "BloggerFeed-" + Eval("NodeOwnerUserName")%>'

BUT THIS DOESNT......

FeedName='<%# "BloggerFeed-" + Eval("NodeOwnerUserName") + "&blogger=" + Eval("NodeOwnerUserName") %>'

It strips out the "&" and the "=" and just exports it as.....

?rss=BloggerFeed-Isaac-blogger-Isaac


User avatar
Member
Member
kentico_sandroj - 12/6/2013 5:39:17 PM
   
RE:WHERE Clause in Query RSS Feed - Wont accept variable
Hello,

Thank you for your reply.

Would it be possible to try the following code to see if it works the same way in your instance?
test={%CurrentDocument.Owner.UserName%}&rss
I have added this to the Feed querystring key property in the RSS feed Web part and I am able to filter the results with this configuration, by using the querystring macro {%test%}. Please let me know if this works as expected in your instance.

Best Regards,
Sandro

User avatar
Member
Member
stradle - 12/10/2013 4:38:29 AM
   
RE:WHERE Clause in Query RSS Feed - Wont accept variable
Thanks for getting back to me Sandro,
We are making progress, that worked, but only issue is the '&' is showing as & in the query string for the second parameter.

e.g. ?test=isaac&rss=Blogger-Feed

User avatar
Member
Member
stradle - 12/10/2013 5:25:42 AM
   
RE:WHERE Clause in Query RSS Feed - Wont accept variable
Actually it was a problem elsewhere and this is now working, many thanks for your help.