Skip to content

Commit

Permalink
Merge pull request #17 from umbraco/sofie/members
Browse files Browse the repository at this point in the history
Changes from todays meeting.
  • Loading branch information
Jeavon authored Dec 5, 2022
2 parents 7237e0c + 03c48d3 commit e288fa3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Umbraco.Docs.Samples.Web/Views/ContentPage.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@


<section class="section">

<div class="container">
<h1><a href="">Members</a></h1>
</div>

<div class="container">
<h1><a href="https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Properties/index-v9">Cheat sheet - Standard Model Properties</a></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
@{
var startNodeId = Model.MacroParameters["startNodeId"] ?? Model.Content.Id;

var numberOfPosts = 3;
if (Model.MacroParameters["numberOfPosts"] != null)
{
int.TryParse((string)Model.MacroParameters["numberOfPosts"], out numberOfPosts);
}

var numberOfMorePosts = Model.GetParameterValue<int>("numberOfPosts");
}

@if (startNodeId != null)
Expand All @@ -35,7 +32,7 @@

//Gets all blogposts to calculate pages
var blogposts = startNode.Children.OrderBy(x => x.CreateDate).ToList();
var pageCount = (int)Math.Ceiling((double)blogposts.Count / (double)numberOfPosts);
var pageCount = (int)Math.Ceiling((double)blogposts.Count / (double)numberOfMorePosts);
//gets the page from the querystring and sets it to one if it is out of range
var page = 1;
if (httpContext != null && !string.IsNullOrEmpty(httpContext.Request.Query["page"]))
Expand All @@ -47,7 +44,7 @@
}
}
//Gets the blogposts for the current page
var pagedBlogposts = blogposts.Skip((page - 1) * numberOfPosts).Take(numberOfPosts).ToList();
var pagedBlogposts = blogposts.Skip((page - 1) * numberOfMorePosts).Take(numberOfMorePosts).ToList();

if (pagedBlogposts.Count > 0)
{
Expand All @@ -69,7 +66,7 @@
</div>
}

if (blogposts.Count > numberOfPosts)
if (blogposts.Count > numberOfMorePosts)
{
<div class="pagination">
<nav class="nav-bar nav-bar--center">
Expand Down
Binary file modified Umbraco.Docs.Samples.Web/umbraco/Data/Umbraco.sqlite.db
Binary file not shown.
Binary file modified Umbraco.Docs.Samples.Web/umbraco/Data/Umbraco.sqlite.db-shm
Binary file not shown.
Binary file modified Umbraco.Docs.Samples.Web/umbraco/Data/Umbraco.sqlite.db-wal
Binary file not shown.

0 comments on commit e288fa3

Please sign in to comment.