This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@* | |
* FILE : /App_Code/HtmlHelpers.cshtml | |
*@ | |
@using System.Collections.Specialized | |
@helper RenderPagination(int pageNumber, int pageCount) | |
{ | |
@* | |
* HELPER : RENDER PAGINATION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@* | |
* FILE : /App_Code/StringFunctions.cshtml | |
*@ | |
@functions | |
{ | |
@* | |
* FUNCTION : ENCODE STRING | |
* ************************ | |
* Description : takes an input string and returns it lower-cases and url-encoded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
htmlheader.text += "<link rel=""apple-touch-icon"" href=""img/apple-touch-icon.png"" />" | |
htmlheader.text += "<link rel=""apple-touch-icon-precomposed"" href=""img/apple-touch-icon.png"" />" | |
htmlheader.text += "<link href=""http://fonts.googleapis.com/css?family=Ubuntu:400,500,700,400italic,700italic|Roboto+Slab:400,700"" rel=""stylesheet"" type=""text/css"" />" | |
htmlheader.text += "<link href=""http://fonts.googleapis.com/css?family=Zeyada"" rel=""stylesheet"" type=""text/css"" />" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if variable("MD_AlternativeTitle") isnot nothing then | |
Me.TitleBar = variable("MD_AlternativeTitle") | |
end if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
int lastUpdatedOnDay = CurrentNode.Data.DateModified.Day; | |
string lastUpdatedOn = lastUpdatedOnDay + GetDaySuffix(lastUpdatedOnDay) + CurrentNode.Data.DateModified.ToString(" MMMM yyyy"); | |
} | |
<span>Last updated on @lastUpdatedOn</span> | |
@functions { | |
//Gets suffix for current day (st, nd, rd or th) | |
string GetDaySuffix(int day) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Collections.ObjectModel | |
@using Contensis.Framework.Web | |
@using Contensis.Framework.Web.Search | |
@{ | |
@* | |
- assuming the site structure has been setup so that all content for each language | |
- is contained in a language folder that sits under the website root, we target the | |
- current pages' language folder and create a dynamic path variable which we tie into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Jquery reference code | |
Dim js = From file In Javascript.Files | |
Where file.Key = "jquery" | |
if js.count > 0 then | |
Javascript.Files.Remove(js.First()) | |
end if | |
Javascript.Files.Insert(0, New CMS_API.Utilities.Javascript.UrlJavascriptFileReference("/SiteElements/Scripts/jquery.js")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Contensis.Framework.Web | |
@{ | |
@* | |
- Sometimes meta data does not always become instantly available when building/previewing templates/pages, | |
- or if the preview database is cleared and is in the process of rebuilding itself. | |
- | |
- Depending on how you access the meta data, this can cause a razorview to fall over: | |
- ERROR: 'Cannot perform runtime binding on a null reference' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Contensis.Framework.Web | |
@{ | |
@* | |
- this is more of a 'maintenance' razorview | |
- displays an alphabetical list of all used template types in a site with a page count for each template | |
*@ | |
<h2>List of all used templates with page count</h2> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Data; | |
@using Contensis.Framework.Web; | |
@using Contensis.Framework.Web.Search; | |
@using Contensis.Core.Utilities.DataAccess; | |
@{ | |
var relatedContent = CurrentNode.RelatedNodes(); | |
var dal = new SqlDataAccess(Contensis.Framework.Web.AppContext.Current.Server.ConnectionString); | |
} |