Skip to content

Instantly share code, notes, and snippets.

string currentLetter = A;
if (Request.QueryString["letter"] != null) {
currentLetter = Request.QueryString["letter"];
}
var allContentQuery = Query.Where("Property_IncludeInAtoZ").IsEqualTo("1");
var allContent = new NodeFinder().Find(allContentQuery);
<nav class="atozNavigation">
@for(char c = 'A'; c <= 'Z'; c++) {
var hasContentTest = from content in allContent where content.Data.Title.ToString().StartsWith(c.ToString()) select content;
if (hasContentTest.Count() > 0) {
if(c.ToString() == currentLetter) {
<a class="currentLetter" title="See content starting with @c" href="AtoZ.aspx?letter=@c">@c</a>
} else{
<a href="AtoZ.aspx?letter=@c" title="See content starting with @c">@c</a>
}
@foreach(ContentNode atozItem in allContent.Where(i => i.Title.StartsWith(currentLetter))){
//Code to output listing goes here
}
@using Contensis.Framework.Web
@using Contensis.Framework.Web.Search
@{
string currentLetter = "A";
if (Request.QueryString["letter"] != null) {
currentLetter = Request.QueryString["letter"];
}
string category = string.Empty;
if (!String.IsNullOrEmpty(Request.QueryString["category"]))
{
category= Request.QueryString["category"];
}
var newsArticleQuery = Query.Where("SC_T_ID").IsEqualTo("-1234”); // only return news articles based on template ID
var newsQuery = newsArticleQuery; //this is so we can add a subquery
if (!String.IsNullOrEmpty(category))
{
var categorySubQuery = SubQuery.Where("Md_Category").IsEqualTo(category);
newsQuery = newsQuery.AndSubQuery(categorySubQuery );
}
@ps-team
ps-team / gist:5400cca41e8205e2e60b
Created November 17, 2015 09:30
Server control
Imports CMS_API.Utilities.controls
Public Class TextBoxWithRedirect
Inherits BasePlaceHolderControl
#Region "Private Variables"
Private redirectWrapper As HTMLHelper.Div
Private redirectLabel As ContensisLabel
Private redirectTextBox As System.Web.UI.webcontrols.TextBox
Private WithEvents redirectButton As Button
<img src="image.svg" alt="image" />
if (!Modernizr.svg) {
$("img[src$='.svg']").each(function() {
var $this = $(this);
$this.attr("src", $this.attr("src").replace(".svg", ".png"));
});
}
<div class="image">
<img src="image.svg" alt="image" />
</div>
.lt-ie9 .image,
.no-svg .image {
background-image: url("image.png");
}
.lt-ie9 .image img,