Skip to content

Instantly share code, notes, and snippets.

@ps-team
ps-team / RegisterContentToHead
Created October 7, 2013 09:14
Registering any content to the head
''' Register any content to the head, whatever you pass in will be rendered out.
''' You could for example add a piece of script, a meta data reference or a stylesheet.
''' If the same key is used twice only the first key/script combination will be registered.
''' This ensures that you can call the routine multiple times without registering script multiple times.
Utilities.RegisterHeaderText("YourKey", "<meta http-equiv=""refresh"" content=""600"">")
@ps-team
ps-team / notes
Created November 5, 2013 10:02
Style select menus and make them look 'awesome' using only css
Add -webkit-appearance: none; to enable height values in Chrome and Firefox
for Opera you will need .styled-select select {background-color: rgba(0,0,0,0);…}
Should work in proper browsers and IE8 +
You'll probably need razor to use his in the majority of the Contensis modules.
@ps-team
ps-team / div-cells.html
Created November 8, 2013 10:30
Creating Expandable Placeholders
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>divs - tables - cells - Go</title>
<style>
h2 {
font-weight:100;
margin:0;
padding:0;
@ps-team
ps-team / GetNodeByContentId.cs
Created November 18, 2013 14:46
GetNodeByContentId
@functions
{
public Node GetNodeByContentId(int contentId)
{
var myQuery = Query.Where("Property_C_ID").IsEqualTo(contentId.ToString());
var nodes = new NodeFinder().Find(myQuery);
if (nodes.Count > 0) {
return nodes[0];
} else {
@ps-team
ps-team / Local view menu
Last active December 15, 2022 08:28
Recreating the Contensis Local View Menu in Razor
@using Contensis.Framework.Web
@using Contensis.Framework.Web.Search
<ul class="sys_menu">
@{
// Loading jQuery through the Contensis API
AppContext.Current.Page.Scripts.RegisterJQuery();
if(CurrentNode != null) {
@foreach (var newsArticle in newsList.Skip(3))
{
<a href="@newsArticle.Path">@newsArticle.Title</a>
}
@foreach (var newsArticle in newsList.Take(3))
{
<a href="@newsArticle.Path">@newsArticle.Title</a>
}
@foreach (var newsArticle in newsList.First())
{
<a href="@newsArticle.Path">@newsArticle.Title</a>
}
@foreach (var newsArticle in newsList.Last())
{
<a href="@newsArticle.Path">@newsArticle.Title</a>
}
try
{
@foreach (var newsArticle in newsList.Single())
{
<a href="@newsArticle.Path">@newsArticle.Title</a>
}
}
Catch {
}