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; | |
@using System.Net.Mail; | |
@if (IsPost) { | |
string EmailFrom = "[email protected]"; | |
string EmailTo = "[email protected]"; | |
MailMessage email = new MailMessage(); | |
email.IsBodyHtml = true; | |
string emailBody = ""; |
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 | |
@using Contensis.Framework.Web.Search; | |
@{ | |
var relatedContent = CurrentNode.RelatedNodes(); | |
} | |
@if (relatedContent.Count >= 1){ | |
for (var i = 0; i < relatedContent.Count; i += 3) | |
{ |
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 | |
@using Contensis.Framework.Web.Search | |
@{ | |
// Get category value from url to filter results with | |
var catFilter = Request.QueryString["TaxonomyKey"]; | |
// Get news articles | |
var newsArticlesQuery = Query.Where("SC_T_ID").IsEqualTo("-2875009").And("Property_TaxonomyCategories").Contains(catFilter).OrderBy("Property_DatePublished").Descending; | |
var newsArticles = new NodeFinder().Find(newsArticlesQuery, selectCount:8); |
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.Search; | |
@{ | |
var query = Query.Where("Property_Path").StartsWith("/connect/blog/").And("Property_AuthorID").IsEqualTo(authorId.ToString()).OrderBy("Property_Title"); | |
var nodes = new NodeFinder().Find(query, selectCount: 20); | |
string fulltagslist = ""; | |
} | |
@foreach(var node in nodes) | |
{ |
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); | |
} |
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 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
'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 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
@{ | |
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) |