Copied to clipboard

Flag this post as spam?

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


  • Martin Ågren 7 posts 26 karma points
    Nov 19, 2009 @ 14:27
    Martin Ågren
    -1

    Top 10 list with 10 most clicked pages

    Hi anyone who can help with an xlst list with top 10 most clicked pages on website?

     

    Using Umbraco 3 with umbracostats

     

    Br

     

    Martin

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Nov 19, 2009 @ 17:26
    Chris Houston
    0

    Hi Martin,

    As SaphuA has pointed out in his little down thumb... it would be good to know what you have tried so we can help you :)

    If you've never used XSLT before, then it's worth googling a bit for a few examples.

    Cheers,

    Chris

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Nov 19, 2009 @ 21:39
    Dirk De Grave
    0

    I don't see why you should downvote Martin's post. Agree that the question is far from complete. Reminds me again how much I detest the voting down option.

    Anyway, Martin, I presume you'd like to have - based on the stats build by umbracostats - to list a top ten list of most visited pages? Can't really help you on this one, as I'm not experienced in umbracoStats, Have you tried fiddling with the database? Can you find some sort of table that would hold the info you're looking for. Do you need help generating a top ten from that info? Do you have problems integrating the top ten list from sql using xslt? Let us know what you're looking for and - as others pointed out already - what have you tried already.

     

    Looking forward to your info.

    Cheers,

    /Dirk

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Nov 19, 2009 @ 22:39
    Chris Houston
    0

    P.s. I agree about the down thumbs.. not a very nice welcome for a new forum member.

    We are a friendly bunch here Martin, so help us by giving us a bit more info and we will do our best to help you :)

    Cheers,

    Chris

  • SaphuA 124 posts 87 karma points
    Nov 19, 2009 @ 23:05
    SaphuA
    0

    I didn't like the post for obvious reasons and provided critisism so the author could do something about it. Why would I need to post a reply for that? If that isn't what the downvoting is for then I don't know why else we would need it at all. Especially if it immediatly leads to a discussion on the vote instead of the post itself.

    I do agree that downvoting might not be the best welcome for some. If I had known that this was his first post perhaps I would've reacted differently. On the other hand, though, I do think we can expect most developers to have some experience on forums these days. I'm pretty sure that simply asking for stuff is frowned upon pretty much everywhere.

  • Martin Ågren 7 posts 26 karma points
    Nov 20, 2009 @ 08:47
    Martin Ågren
    0

    Thanks all for your replies.

    I for now have a top ten list built in xlst wich sorts the post on @updateDate

    and the list works just fine but now i need to find a way to sort after the pages who has been most viewed and cant find out how.

     

    Here is the code i use:

     

    <xsl:variable name="source" select="1062"/>

    <xsl:template match="/">

    <div class="divPush">

    <h2>Läsartoppen</h2>

    <ol>

    <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/descendant::node [string(data [@alias='umbracoNaviHide']) != '1'][@nodeTypeAlias = 'AOB-Contents Page']">

    <xsl:sort select="@updateDate" order="descending" />

    <xsl:if test="position() &lt; 11">

    <li>

    <a href="{umbraco.library:NiceUrl(@id)}">

    <xsl:value-of select="@nodeName"/>

    </a>

    </li>

    </xsl:if>

    </xsl:for-each>

    </ol>

    </div>

     

    Thanks again

    Br

    Martin

     

     

  • Martin Ågren 7 posts 26 karma points
    Nov 23, 2009 @ 10:05
    Martin Ågren
    0

    I found this anyone who can explain how to use that in an xlst file ?

    Br

    // Get the ten most popular pages from the whole website last week as an ordered html list and append it to a literal control SortedList results;

    results = umbracoStat.Businesslogic.Library.GetMostPopular(-1, 10, DateTime.Now.AddWeeks(-1), DateTime.Now);

    // Loop through results and display as an orderedList
    IDictionaryEnumerator ide = results.GetEnumerator();
    System.Text.StringBuilder sb = new System.Text.StringBuilder();
    sb.Append("<ol>");
    while (ide.MoveNext())
    {
     umbracoStat.Businesslogic.StatItem statItem = (umbracoStat.Businesslogic.StatItem) ide.Value;

     sb.Append("<li><a href=\"" + umbraco.library.NiceUrl(statItem.Id) + "\">" + statItem.Name + "</a>: " + statItem.Hits + "</li>\n\r");
    }

    sb.Append("</ol>");
    LiteralStatList.Text = sb.ToString();

    Martin

Please Sign in or register to post replies

Write your reply to:

Draft