Skip to content

Instantly share code, notes, and snippets.

View makbeta's full-sized avatar

makbeta makbeta

View GitHub Profile
@makbeta
makbeta / conditional-links.html
Created November 30, 2012 02:18
Luminate CMS: How to open a link in a new window when it links to the non-current site?
@makbeta
makbeta / homepage-test.html
Created November 30, 2012 02:19
Luminate CMS: Determine whether or not a user is on the homepage
<t:if test="path == '/''"> <!-- is home page --> </t:if>
<t:else> <!-- not homepage --> </t:else>
@makbeta
makbeta / parse-date-rss-feed.html
Created November 30, 2012 02:20
Luminate CMS: Parse date from RSS feed
<t:list id="rss.channel.item">
<t:set id="myDate" value="substring(pubDate, 5, 7)" />
<t:set id="myMonth" value="substring(pubDate, 8, 11)" />
<t:set id="myYear" value="substring(pubDate, 12, 16)" />
<t:set id="myHour" value="substring(pubDate, 17, 19)" />
<t:set id="myMinutes" value="substring(pubDate, 20, 22)" />
<p>${pubDate} or ${myDate}/${myMonth}/${myYear} ${myHour}:${myMinutes}</p>
@makbeta
makbeta / ie7-notification.html
Created November 30, 2012 02:22
Luminate CMS: Display a message to a dated browser (IE7 & below), asking users to upgrade
<t:if test="matches(header.User_Agent,'.*MSIE 7.0.*') || matches(header.User_Agent,'.*MSIE 6.0.*')">
<div class="old-browser">
<p>You're using old browser please, this website might not render properly in it. Please upgrade your browser to one of the following browsers to enjoy this website:</p>
<p><a href="http://windows.microsoft.com/en-US/internet-explorer/downloads/ie" target="_blank"><img src="http://www.microsoft.com/PressPass/ImageGallery/Images/Products/Windows/ie/logo_IE9-h_thumb.jpg" width="100" border="0" /></a>
<a href="http://www.mozilla.org/en-US/firefox/fx/" target="_blank"><img src="http://www.mozilla.org/img/covehead/firefox/brand-toolkit/identity-guidelines-mozilla-wordmark.png" width="100" border="0" /></a>
<a href="www.google.com/chrome" target="_blank"><img src="https://www.google.com/intl/en/images/logos/chrome_logo.gif" width="100" border="0" /></a>
<a href="http://www.apple.com/safari/download/" target="_blank"><img src="http://images.apple.com/safari/images/overview_safari_title.
@makbeta
makbeta / reinitialize-addThis.html
Created November 30, 2012 02:23
reinitialized addThis after the ajax load
<script type="text/javascript">
function ReinitializeAddThis(){
if (window.addthis){
window.addthis.ost = 0;
window.addthis.ready();
}
}
</script>
@makbeta
makbeta / pagination.css
Created November 30, 2012 02:26
Luminate CMS: Pagination styling
table.paginator td {
border: 1px solid #ccc;
line-height: 1.5em;
padding: 2px 7px;
background: #fff;
}
table.paginator td a{
text-decoration: none;
padding: 3px 5px;
}
@makbeta
makbeta / category-url-parameters.html
Created November 30, 2012 02:28
Luminate CMS: Add a list of categories as URL parameters
<t:if test="topic.length > 0">
<t:list id="topic">
<t:if test="index == 1">
<t:set id="tops" value="concat(tops, '?topics=')" />
<t:set id="tops" value="concat(tops, name)" />
</t:if>
<t:else>
<t:set id="tops" value="concat(tops, '&topics=')" />
<t:set id="tops" value="concat(tops, name)" />
</t:else>
@makbeta
makbeta / search-results.css
Created November 30, 2012 02:29
Luminate CMS: CSS for search results
.searchDisplayResults {
margin: 1em 0 0;
}
.searchTitle {
padding: .75em 0 0;
margin: 0;
}
.searchTitle a {font-weight: bold; }
.searchTimeStamp {
font-size: .87em;
@makbeta
makbeta / body-class.html
Last active December 11, 2015 06:09
Luminate CMS: assign a body class based on the content type we are viewing
<t:set id="bodyClass" value="toLowerCase(type)" />
<t:set id="bodyClass" value="trim(bodyClass)" />
<t:set id="bodyClass" value="replace(bodyClass, ' ', '-')" />
<t:set id="bodyClass" value="replace(bodyClass, '---', '-')" />
<t:set id="bodyClass" value="replace(bodyClass, '-', '-')" />
<t:if test="title == 'Search Results'">
<t:set id="bodyClass" value="'search')" />
</t:if>
@makbeta
makbeta / blog-archive.html
Created January 17, 2013 21:55
Luminate CMS: dynamic list of monthly archives
<t:if test="length > 0">
<t:set id="lastdate" value="15" />
<ul>
<t:list>
<t:if test="month(date) != lastdate">
<t:set id="fromMonth" value="month(date)+1" />
<t:set id="toMonth" value="month(date)+2" />
<t:set id="fromYear" value="year(date)" />
<t:if test="fromMonth == 12">
<t:set id="toYear" value="year(date)+1" />