Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 568 karma points
    Feb 06, 2012 @ 19:44
    Streety
    0

    Using Blog as a subordinate of Home.

    I have looked through a few posts and am rather stuck.

    If I create a new blog as a subordinate of the home page then I a few features stop working. 1) the facebook twitter google links and also the RSS feed.

    The facebook links just don't show up and RSS link shows:

     <?xml version="1.0" encoding="UTF-8" ?>Error loading MacroEngine script (file: /uBlogsy/uBlogsyRSS.cshtml)

    It seems to stem from the Model_ID not being the root. However the version of listposts.cshtml seems to have changed so I can't apply the fixes detailed on other posts.

    I can't find the variable to globally set the Model_ID for all the subsequent scripts.

     

    Any ideas?

  • Streety 358 posts 568 karma points
    Feb 06, 2012 @ 20:15
    Streety
    0

    Hmmm,

     

    Looks like the RSS issue is a bit more generic.

    XML Parsing Error: XML or text declaration not at start of entity
    Location: http://www.sample.co.uk/rss.aspx
    Line Number 2, Column 5:    <?xml version="1.0" encoding="UTF-8" ?>Error loading MacroEngine script (file: /uBlogsy/uBlogsyRSS.cshtml)
    ----^

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Feb 07, 2012 @ 10:38
    Anthony Dang
    0

    Can you paste a screen shot of your content tree here?

     

  • Streety 358 posts 568 karma points
    Feb 07, 2012 @ 11:01
    Streety
    0

    Sorry no. I have been playing with it to get it going and have put your node back at the top.

     

    The RSS still doesn't work though.

    Also. What is the reason for the empty holding masterpage (uBlogsyBase)?

    If we are stuck with the blog being the top hierarchal object then page posts will need to inherit a different masterpage. Having the home page tied to the main masterpage is a severe contraint on diplay and functionality. I need to mod where each page gets its template howver I am concerned that functionality will turn off (like Facebook buttons etc) when I move stuff.

    A truly fantastic piece of work btw, sorry for the questions.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Feb 07, 2012 @ 11:54
    Anthony Dang
    0

    The landing node does not need to go at the root.

    However, if you want to display post from a node that is higher

    eg. from a home node:

    - Home
      - uBlogsyLanding   

    Then you need to modify the scripts because the scripts assume the landing node is always going to be a search going up the tree.

    uBlogsyBase is not necessary. You can inherit from any masterpage. The rss needs to inherit from /umbraco/default.master

     

    What is happening with the rss?

     

    Regarding the social media links. This could be because the js file was not included. Do a search for "addthis" in your page source in the browser. It could also be because it was included more than once.

    Hope that helps.

     

     

     

     

     

  • Streety 358 posts 568 karma points
    Feb 07, 2012 @ 12:55
    Streety
    0

    Thanks Anthony I'll try your suggestions.

     

    The RSS is giving me the error in the post above on a yellow background.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Feb 07, 2012 @ 13:10
    Anthony Dang
    0

    This is most likely because there is some space in the start of the output.

    Make sure that the masterpages dont have any space in the start. This annoyingly also includes linebreaks.

     

  • Streety 358 posts 568 karma points
    Feb 07, 2012 @ 13:58
    Streety
    0

    The code looks exactly the same as the RSS code for an older version of ublogsy and that works OK.

  • Streety 358 posts 568 karma points
    Feb 07, 2012 @ 14:03
    Streety
    0

    You said:

     

    Then you need to modify the scripts because the scripts assume the landing node is always going to be a search going up the tree.

     

    How can I globally change the Model_ID so that all other scripts inherit from it?

     

    I can see this line in listposts:

    var posts = PostService.Instance.GetPosts(Model.Id, tag, category, author, searchTerm, commenter, page-1, count);

    Looks like its calling a bespoke method.

    Sorry I am new to Razor and just guessing. Just setting the model_id here won't change them in other scripts will it?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Feb 07, 2012 @ 14:57
    Anthony Dang
    0

    Model.Id is the id of the current page.

    GetPosts does a search up the tree.

    The easiest thing is to replace Model.Id with the landing node's id. 

     

    Regarding the rss... try removing stuff until it doesnt crash anymore...then add things back incrementally until it breaks.

     

     

  • Streety 358 posts 568 karma points
    Feb 13, 2012 @ 18:45
    Streety
    0

    I have been through the master pages and stripped it out to make sure no addtional spaces are screwing with the markup.

    I am pretty sure the problem is with the uBlogsyRSS.cshtml file. I have tried running it with the older uBlogsyRSS.cshtml file from version 1.3.6.1 which works fine. Still the error.

    Has anyone else got this RSS bug?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 04, 2012 @ 22:51
    Anthony Dang
    0

    How is this issue?

    Is it resolved?

     

  • Stephen Dougherty 23 posts 45 karma points
    Mar 08, 2012 @ 23:41
    Stephen Dougherty
    0

    I can confirm I am also getting this error. I have my own masterpage and the landing page is further down the tree.

  • Streety 358 posts 568 karma points
    Mar 09, 2012 @ 10:27
    Streety
    0

    Am going to have a look at this again today. I have a bit of time.

     

  • Streety 358 posts 568 karma points
    Mar 09, 2012 @ 18:04
    Streety
    0

    I have this script:

    @using System.Linq
    @using System.Xml.Linq
    @using umbraco.MacroEngines
    @using uBlogsy.Common.Extensions
    @using uBlogsy.Common.Helpers
    @using uBlogsy.BusinessLogic
    @{
        const int ITEMS_PER_PAGE = 20; // for testing
       
        // get item count
        int count = int.Parse(@Parameter.ItemCount);

        IEnumerable<DynamicNode> nodes;
        var posts = PostService.Instance.GetPosts(1116);
        nodes = ((IEnumerable<DynamicNode>)posts).Take(count);
            <ul>
                @foreach (DynamicNode n in nodes)
                {
                    <li>
                        <a href="@n.Url" title="@n.GetProperty("uBlogsyContentTitle").Value">
                            <span><h3>@n.GetProperty("uBlogsyPostDate").Value.FormatDateTimeOrdinal("d MMM") - @n.GetProperty("uBlogsyContentTitle").Value</h3>
                         </span> </a>
                           <p> @n.GetProperty("uBlogsyContentSummary").Value</p>
                    </li>
                }
            </ul>
      
     }

    Its lifted from your script Anthony.

    I have hard coded the blog ID root node (which is  subordinate of home) (id 1116) and it returns

    Error loading MacroEngine script (file: [RZR]LatestBlog.cshtml)

     

    any ideas or gaffs.

     

     

  • Streety 358 posts 568 karma points
    Mar 09, 2012 @ 18:21
    Streety
    0

    Ignore that previous.

     

    I figured it and its so stupid I am embarrassed to mention it again.

Please Sign in or register to post replies

Write your reply to:

Draft