Skip to content

Instantly share code, notes, and snippets.

@scopevale
scopevale / ua_cool_slide_widget.vtl
Created October 14, 2016 14:44 — forked from bradrice/ua_cool_slide_widget.vtl
UA Cool Slide Player widget
#foreach($inode in $category)
#if($velocityCount == 1)
#set($catlist = "+c${inode}c:on")
#else
#set($catlist = "$catlist +c${inode}c:on")
#end
#end
#set($mySlides = $dotcontent.pull("+structureInode:9651b909-b784-4867-bfb8-03049e6269f1 +live:true +deleted:false $catlist", "0", "weightedOrder asc"))
<div class="clear"></div>
<div id="outer_wrap" style="margin-top: 20px;">
@scopevale
scopevale / ua_cool_detail.vtl
Created October 14, 2016 14:42 — forked from bradrice/ua_cool_detail.vtl
UA cool detail ajax page
#set($id = $request.getParameter('coolid'))
#if($UtilMethods.isSet( $request.getParameter('captionPosition')))
#set($captionPosition = $request.getParameter('captionPosition'))
#end
##if($UtilMethods.isSet($request.getParameter('displayCaption')))
#set($displayCaption = $request.getParameter('displayCaption'))
##end
#set($content = $dotcontent.find($id))
#if($captionPosition == "1")
<div class="content" style="height: 300px;">
@scopevale
scopevale / setsession.vtl
Created October 14, 2016 14:41 — forked from bradrice/setsession.vtl
Set session in dotcms
#set($ses = $request.getSession(true))
#set($item = $request.getParameter('courseid'))
#set($_dummy = $ses.setMaxInactiveInterval(1800))
#set($myCookie = $request.getCookies())
#foreach($cookie in $myCookie)
#if($cookie.getName().equals("JSESSIONID"))
#set($ck = $cookie)
#set($_dummy = $ck.setMaxAge(1800))
#end
#end
@scopevale
scopevale / TheTemplate
Created June 29, 2016 15:35 — forked from cfalzone/TheTemplate
dotcms template code to inspect the content that is on the page and and inject something into the context for other content to use it
#set($THEFLICKR = "")
<div> <h2>What's I got?</h2>
<ul>
#foreach($key in $context.getKeys())
#if($key.startsWith("contentletList"))
#set($cid = $key.replaceAll("contentList", ""))
<li>Container id = $cid - Contents:
<ul>
#foreach($conid in $context.get($key))
<li>$conid
@scopevale
scopevale / Enhance.js
Created May 13, 2016 16:37 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.js"></script>
<script src="https://fb.me/react-0.14.7.js"></script>
<script src="https://fb.me/react-dom-0.14.7.js"></script>
</head>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.js"></script>
<script src="https://fb.me/react-0.14.7.js"></script>
<script src="https://fb.me/react-dom-0.14.7.js"></script>
</head>
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.7.min.js"></script>
<script src="https://fb.me/react-dom-0.14.7.min.js"></script>
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.1/redux.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">