Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • hetaurhet 245 posts 267 karma points
    Mar 23, 2012 @ 06:51
    hetaurhet
    0

    uBlogsyRSS : category rss

    hello..

    Using ublogsy we can create Rss feed for category with following url

    http://test.mydomain.org.gall.arvixe.com/blog/rss?category=Website+Updates

    This works fine. but when we click on post title in feed, it doesnot show page. Actually link url become as follows and so not showing page.

    http://test.mydomain.org.gall.arvixe.com/blog/rss/blog/2012/march/e-cards-on-website/ .

    It should be http://test.mydomain.org.gall.arvixe.com/blog/2012/march/e-cards-on-website/ ;

    here is uBlogsyRSS.cstml ...

    @{
        /* RSS FEED */

    @using System.Linq
    @using System.Xml.Linq
    @using umbraco.MacroEngines
    @using uBlogsy.Common.Extensions
    @using uBlogsy.Common.Helpers
    @using uBlogsy.BusinessLogic
    @{
        // get all posts
        // get tag, category, or author from query string
        var tag = Request.QueryString["tag"];
        var category = Request.QueryString["category"];
        var author = Request.QueryString["author"];
        var searchTerm = Request.QueryString["search"];
        var commenter = Request.QueryString["commenter"];
       
        IEnumerable<DynamicNode> posts = PostService.Instance.GetPosts(Model.Id, tag, category, author, searchTerm, commenter, 0, int.MaxValue);
          
        string lastPubDate;
        if (posts.Count() == 0)
        {
            lastPubDate = DateTime.Now.ToString();
        }
        else
        {
            lastPubDate = posts.FirstOrDefault().GetProperty("uBlogsyPostDate").Value;
        }


       
      
        // get landing page
        var landing = DataService.Instance.GetLanding(Model.Id);

        string qs = Request.QueryString.ToString();
       
        // get blog url
        string blogUrl = Request.Url.AbsoluteUri.Replace(Model.NiceUrl(), string.Empty).TrimEnd("/".ToCharArray());

        if (!string.IsNullOrWhiteSpace(qs))
        {
            blogUrl = blogUrl.Replace(qs, string.Empty).Replace("?", string.Empty);
        }

       
        <rss version="2.0">
            <channel>
                <title>@landing.uBlogsyRssTitle</title>
                <description>@landing.uBlogsyRssDescription</description>
                <copyright>@landing.uBlogsyRssCopyright</copyright>
                @*<image>@landing.uBlogsyRssImage</image>*@
                <link>@blogUrl</link>
                <lastBuildDate>@lastPubDate.FormatDateTime("ddd, dd MMMM yyyy HH:mm:ss")</lastBuildDate>
                <pubDate>@lastPubDate.FormatDateTime("ddd, dd MMMM yyyy HH:mm:ss")</pubDate>

                @foreach (var p in posts)
                {
                    <item>
                        <title>@p.GetProperty("uBlogsyContentTitle").Value</title>
                        <author>@p.GetProperty("uBlogsyPostAuthor").Value</author>
                        <comments>@[email protected]</comments>
                        <description>@p.GetProperty("uBlogsyContentBody").Value.StripHtml().Trim()</description>
                        <link>@[email protected]</link>
                        <guid>@[email protected]</guid>
                        <pubDate>@p.GetProperty("uBlogsyPostDate").Value.FormatDateTime("ddd, dd MMMM yyyy HH:mm:ss") </pubDate>
                    </item>
                }
            </channel>
        </rss>
    }

    So, what is wrong in this?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 26, 2012 @ 01:21
    Anthony Dang
    0

    Strange

    I cant replicate this. Try deleting your /app_data/umbraco.config then republish.

     

    Although I did notice a related issue...

    replace

    string qs =Request.QueryString.ToString();

    With

    var qs = Request.QueryString.ToString().Replace("+", "%20");

     

     

     

     

     

  • hetaurhet 245 posts 267 karma points
    Mar 26, 2012 @ 05:57
    hetaurhet
    0

    hello...

     

    everything was proper.. it was just that I was using rss instead of rss/ in url

Please Sign in or register to post replies

Write your reply to:

Draft