Copied to clipboard

Flag this post as spam?

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


  • Hayden Tomas 6 posts 77 karma points
    Dec 01, 2020 @ 14:56
    Hayden Tomas
    0

    Umbraco not displaying up to date news on website

    Hi guys

    So we have an umbraco 7 website hosting on Azure

    We have a news feed on the home page of the website.

    It's not displaying the most recent articles, it used to but not anymore :(

    I think it might be something to do with Azure, as we had it hosted elsewhere and this wasn't an issue.

    The website is Here I have used a bit.ly link so the client won't see!

    I am thinking it may have something to do with syncing, something needs indexing? I am not great with Umbraco unfortunately!

  • Amir Khan 1199 posts 2567 karma points
    Dec 01, 2020 @ 16:33
    Amir Khan
    0

    The first thing I would do is go to the very top content node > republish entire site, to rebuild the cache. Though I see the latest news pulling on the news page so that might not do it.

    Are you querying the news articles differently on the news page vs the homepage besides limiting the query to the latest?

  • Hayden Tomas 6 posts 77 karma points
    Dec 02, 2020 @ 10:59
    Hayden Tomas
    0

    Hi Amir

    So below is the code I managed to dig out for the homepage. i am not sure if this is useful!

    <div class="two-blocks intro-blocks">
    @if (Model.Article != null)
    {
        <div class="left">
            <div class="inner-grid">
                <a class="latest-news-wrapper" href="@Model.ArticleLink">
                <div class="inner latest-news">
                    <span class="top-title">@umbraco.library.GetDictionaryItem("Home.IntroductionAndSearch.LatestNews")</span>
                    @if (!string.IsNullOrEmpty(Model.ArticleTitle))
                    {
                        <label>@Model.ArticleTitle</label>
                    }
                    @if (!string.IsNullOrEmpty(Model.ArticleText))
                    {
                        <p>
                            @Model.ArticleText
                        </p>
                    }
                    @if (Model.ArticleDate != null && Model.ArticleDate > DateTime.MinValue)
                    {
                        <span><i class="ico icon-calendar-white"></i>@Model.ArticleDate.ToString("dd MMMM yyyy")</span>
                    }
                    @if (!string.IsNullOrEmpty(Model.ArticleLink))
                    {
                        <a href="@Model.ArticleLink" class="read-more">@umbraco.library.GetDictionaryItem("Home.IntroductionAndSearch.ReadMore")
                        </a>
                    }
                </div>
                </a>
            </div>
        </div>
    
    enter code here
    
  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 02, 2020 @ 11:48
    Steve Morgan
    0

    Hi,

    Go through and check each article has a "link" - there is probably a custom field that's not set on one of the articles that is making it blow up.

    You can also try replacing that code above with:

        <div class="two-blocks intro-blocks">
    @if (Model.Article != null)
    {
        <div class="left">
            <div class="inner-grid">
                <a class="latest-news-wrapper" href="@(!string.IsNullOrEmpty(Model.ArticleLink) ? Model.ArticleLink : "#")">
                <div class="inner latest-news">
                    <span class="top-title">@umbraco.library.GetDictionaryItem("Home.IntroductionAndSearch.LatestNews")</span>
                    @if (!string.IsNullOrEmpty(Model.ArticleTitle))
                    {
                        <label>@Model.ArticleTitle</label>
                    }
                    @if (!string.IsNullOrEmpty(Model.ArticleText))
                    {
                        <p>
                            @Model.ArticleText
                        </p>
                    }
                    @if (Model.ArticleDate != null && Model.ArticleDate > DateTime.MinValue)
                    {
                        <span><i class="ico icon-calendar-white"></i>@Model.ArticleDate.ToString("dd MMMM yyyy")</span>
                    }
                    @if (!string.IsNullOrEmpty(Model.ArticleLink))
                    {
                        <a href="@Model.ArticleLink" class="read-more">@umbraco.library.GetDictionaryItem("Home.IntroductionAndSearch.ReadMore")
                        </a>
                    }
                </div>
                </a>
            </div>
        </div>
    

    If you have access to the file system try looking in the logs (App_data\logs - look for the most recent file, refresh the page and then look at the last error).

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 02, 2020 @ 11:49
    Steve Morgan
    0

    Sorry to highlight - I think the error is in the first outer hyperlink - it's trying to use the link which might be empty.

  • Amir Khan 1199 posts 2567 karma points
    Dec 02, 2020 @ 12:24
    Amir Khan
    0

    I'm confused now, is it erroring out or just pulling the wrong article?

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 02, 2020 @ 12:34
    Steve Morgan
    0

    I read it as (and it appears to be the case from the link) there is a block / grid item that's erroring and it's a single partial view.

    The site is just skipping that latest articles section. If I'm wrong my answer is likely incorrect!

  • Amir Khan 1199 posts 2567 karma points
    Dec 02, 2020 @ 12:45
    Amir Khan
    0

    I could definitely be confused as well but I was looking at latest news are on the homepage and noticed its pulling a March article vs the latest ones in the full news page.

  • Hayden Tomas 6 posts 77 karma points
    Dec 02, 2020 @ 14:14
    Hayden Tomas
    0

    Hi guys. The error is that the latest article is not being pulled in, its from March. Thats is the issue

  • Amir Khan 1199 posts 2567 karma points
    Dec 02, 2020 @ 15:25
    Amir Khan
    0

    Yep, that's what I thought. So I think the code you've found isn't what actually picks the article, but what renders the abstract of the article because it doesn't show how the article is actually picked or sorted. Is there a news article picker on the homepage? Are you using the grid editors? A screengrab of your setup would be helpful.

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 02, 2020 @ 16:38
    Steve Morgan
    0

    Yes Amir is correct.

    We can't see what is populating Model.Article. It could be: 1) A picker 2) Set in a controller 3) Some other weird and wonderful thing I've not thought of.

    It's most likely a picker - but if you show the code that's above this segment we can likely advise.

  • Hayden Tomas 6 posts 77 karma points
    Dec 02, 2020 @ 16:49
    Hayden Tomas
    1

    Hi guys.

    Thank you for youe help, it has actually helped me get to the bottom of it!

    Our client was adamant it was autopopulating so we went in looking for code that would do that.

    So I started to make a video to show you our setup on the backend, and as I was making it, there it was. A picker!

    So yes, not automatic, but you choose the document or url I guess!

    Thank you once again!

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 03, 2020 @ 10:26
    Steve Morgan
    0

    Well - it would be trivial to change it if you wanted to.

    In my experience clients say "We want it to be the latest article".. then they create an article they don't want to highlighted (imagine it's an apology for something or other) and then revert back to a picker ;)

    Steve

  • Amir Khan 1199 posts 2567 karma points
    Dec 03, 2020 @ 20:06
    Amir Khan
    0

    With you on that, they'll end up with a random post about someone's birthday stuck there for a month :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies