Skip to content

Instantly share code, notes, and snippets.

View farmerbradllc's full-sized avatar

Bradley Wood farmerbradllc

View GitHub Profile
@farmerbradllc
farmerbradllc / Liferay.md
Created April 4, 2013 22:48
Great One Liners

Get URL of Theme Image Folder in Web Content Template .VM

#set($theme_image_path = $request.get("theme-display").get("path-theme-images"))

#24 Hour Webcast 6:00pm PST - Bradley Wood Watch Webcast

  1. Demo 3rd level Navigation with Dropdown and CSS
  2. Show how to use assets.json with the Resources Importer
  3. Show Localized Web Content being used with resources importer
@farmerbradllc
farmerbradllc / index.html
Created March 29, 2013 22:22
A CodePen by Bradley Wood. Infinite Carousel Phase #3 - Lets there be 2+ carousels. Dynamic based off of image width
<div class="carousel">
<div class="clear"></div>
<div id="slides">
<ul>
<li><img src="http://placehold.it/300x240&text=Image 1" width="300" height="240" alt="Slide 1"/></li>
<li><img src="http://placehold.it/300x240&text=Image 2" width="300" height="240" alt="Slide 2"/></li>
<li><img src="http://placehold.it/300x240&text=Image 3" width="300" height="240" alt="Slide 3"/></li>
<li><img src="http://placehold.it/300x240&text=Image 4" width="300" height="240" alt="Slide 1"/></li>
<li><img src="http://placehold.it/300x240&text=Image 5" width="300" height="240" alt="Slide 2"/></li>
<li><a href="http://randombrad.com"><img src="http://placehold.it/300x240&text=Image 6" width="300" height="240" alt="Slide 3"/></a></li>
@farmerbradllc
farmerbradllc / index.html
Created March 28, 2013 21:37
A CodePen by Bradley Wood. Infinite Carousel Phase #2 - Lets there be 2+ carousels. Dynamic based off of image width
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>A Simple Carousel</title>
</head>
<body>
<div class="carousel">
<div id="buttons">
@farmerbradllc
farmerbradllc / main.js
Last active December 14, 2015 16:08
Replace Page Names with localized name
var navPortlet = A.one('.nav-menu');
var checkLanguage = false;
if (Liferay.ThemeDisplay.getLanguageId() != Liferay.ThemeDisplay.getDefaultLanguageId()) {
var checkLanguage = true;
}
if(navPortlet && checkLanguage){
var links = navPortlet.all('a');
@farmerbradllc
farmerbradllc / Sample Content.xml
Last active December 14, 2015 13:48
Add Localized Web Content using Resources Importer
<?xml version="1.0"?>
<root available-locales="en_US,es_ES">
<static-content language-id="es_ES"><![CDATA[<p class="small">
<span class="attention">holla</span><br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta aspernatur earum saepe. Quaerat voluptate debitis. Eius accusantium quis voluptatibus delectus nesciunt voluptatem facilis ipsam incidunt quisquam itaque assumenda explicabo dolorum consequatur nobis impedit perspiciatis illo? Vitae ea dignissimos illum reiciendis numquam voluptate repudiandae laborum non dolor pariatur quidem aliquam reprehenderit.</p>
<p class="small">
<span class="attention">Duis Enum Turpis</span><br />
Praesentium labore iusto quod vitae at eveniet eligendi accusantium porro perferendis dignissimos quasi natus asperiores inventore reprehenderit optio voluptatem alias quo tempora quia similique rerum magnam dicta quidem aliquid exercitationem aliquam earum aspernatur sunt ad hic? Dolores asperiores quaerat vitae pariatur itaque eveniet atque ea est sit mi
@farmerbradllc
farmerbradllc / view.jsp
Created March 2, 2013 01:14
Get Document Library Image
<%
DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.getFileEntry(scopeGroupId, 0, imageName);
//TODO replace folderid
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(scopeGroupId, 0, imageName);
String previewURL = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, "");
%>
{
"portletId": "simpleimage_WAR_simpleimageportlet",
"portletPreferences": {
"groupId": "${groupId}",
"name": "house_pic",
"width": "524",
"height": "162"
}
}
@farmerbradllc
farmerbradllc / liferay-plugins.md
Last active December 14, 2015 08:29
Liferay Portlets and their Preferences

##6.1.x Liferay Plugins Portlets and preferences

calendar-portlet

  • defaultDuration
  • defaultView
  • enableRss
  • isoTimeFormat
  • rssDelta
  • rssDisplayStyle
@farmerbradllc
farmerbradllc / custom.css
Created February 19, 2013 16:29
reset styles on pop-ups
body {
background: #000;
}
body.portal-popup {
background: none;
}