Documentation > CMS Template API Library > PageLink
CrownPeak.CMSAPI.PageLink
A link contained in the PaginatedLinks collection. Returned while enumerating over the paginatedLinks collection. Use the PageNumber property to get the page number associated with this link. Call ToString() to get the actual link.
Name | Description | Type |
---|---|---|
IsCurrent | Is this a link to the current page |
Method |
PageNumber | The page number of this link. |
Property |
Code Example
C#
Sample:
List<Asset> pressReleases = folder.GetFileList(); PaginateResult result = Util.Paginate(pressReleases, 10); // Print links to other pages foreach (PageLink link in result.PaginatedLinks) { if (link.IsCurrent()) { Out.WriteLine("{0}|", link.PageNumber); } else { Out.WriteLine("<a href=\"{0}\">{1}</a>|", link, link.PageNumber); } }