Skip to content

Instantly share code, notes, and snippets.

View farmerbradllc's full-sized avatar

Bradley Wood farmerbradllc

View GitHub Profile
*{
box-sizing: border-box;
}
body {
background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}
.clock {
@farmerbradllc
farmerbradllc / index.html
Last active December 24, 2016 02:47
Search Files
<div class="search">
<input id="searchInput" type="text" class="form-control input-md" maxlength="64" placeholder="Search by name, title, email or phone">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
</div>
@farmerbradllc
farmerbradllc / adt.vm
Created August 5, 2016 14:37
Web Content Document URL in ADT
#if (!$entries.isEmpty())
#foreach ($curEntry in $entries)
#set ($docXml= $saxReaderUtil.read($curEntry.getAssetRenderer().getArticle().getContent()))
#set ($docUrl = $docXml.valueOf("//dynamic-element[@name='Attachment']/dynamic-content/text()"))
$docUrl
#end
#end
<#assign aui = taglibLiferayHash["/WEB-INF/tld/aui.tld"] />
<#assign liferay_portlet = taglibLiferayHash["/WEB-INF/tld/liferay-portlet.tld"] />
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
<#assign MBCategoryLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBCategoryLocalService")>
<#assign MBMessageLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBMessageLocalService")>
<#assign MBStatsUserLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBStatsUserLocalService")>
<#assign userLocalService = serviceLocator.findService("com.liferay.portal.service.UserLocalService")>
@farmerbradllc
farmerbradllc / template.vm
Last active July 18, 2016 14:09
ADT for Message Boards
#set ($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
#set ($assetTagLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetTagLocalService"))
#set ($assetCategoryLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService"))
#set ($currentPlid = $getterUtil.getLong($themeDisplay.get('plid')))
#set ($pageName = $layoutLocalService.getLayout($currentPlid).name)
#set ($pageName = $themeDisplay.getLayout().getName($locale))
#set ($MBCategoryLocalService = $serviceLocator.findService("com.liferay.portlet.messageboards.service.MBCategoryLocalService"))
#set ($MBThreadLocalService = $serviceLocator.findService("com.liferay.portlet.messageboards.service.MBThreadLocalService"))
#set ($MBMessageLocalService = $serviceLocator.findService("com.liferay.portlet.messageboards.service.MBMessageLocalService"))
@farmerbradllc
farmerbradllc / init_custom.vm
Last active May 18, 2016 12:52
Target User Segments for Navigation.vm
## -------- Audience Targeting Section -------- ##
#set ($userSegmentLocalService = $serviceLocator.findService("content-targeting-api","com.liferay.content.targeting.service.UserSegmentLocalService"))
#set ($assetCategoryLocalService = $serviceLocator.findService("com.liferay.portlet.asset.service.AssetCategoryLocalService"))
#set ($userSegmentIds = $request.getAttribute("userSegmentIds"))
LayoutSetLocalServiceUtil.updateLookAndFeel(groupId, "myThemeName", null, null, false);
myThemeName: That could be in portal-ext.properties as you can see bellow.
default.regular.theme.id=myThemeName
@farmerbradllc
farmerbradllc / sitemap.json
Created December 8, 2015 14:44
Blog Sitemap.json Snippit #1
{
"layoutTemplateId": "1_column",
"publicPages": [
{
"friendlyURL":"/home",
"name":"Home",
"title":"Home"
}
]
}
@farmerbradllc
farmerbradllc / gist:3f7d4aaab4ea0ea28919
Created September 18, 2015 13:10
Add Web Content Liferay Link
$request
$themeDisplay.getPathMain()
action='<%= themeDisplay.getPathMain() + "/portal/update_layout?p_auth=" + AuthTokenUtil.getToken(request) + "&p_l_id=" + plid + "&p_v_l_s_g_id=" + themeDisplay.getSiteGroupId() %>' method="post" name="addApplicationForm">
<aui:input name="doAsUserId" type="hidden" value="<%= themeDisplay.getDoAsUserId() %>" />
<aui:input name="<%= Constants.CMD %>" type="hidden" value="template" />
<aui:input name="<%= WebKeys.REFERER %>" type="hidden" value="<%= refererURL.toString() %>" />
<aui:input name="refresh" type="hidden" value="<%= true %>" />
@farmerbradllc
farmerbradllc / blog.md
Last active March 12, 2019 15:14
Using Resources Importer to build Demo Site

##Using Resources Importer to build Demo Site

Resources Importer is a tool that Liferay build to contain the raw content files and to be able to consistanly create site content along with a theme. If you have downloaded a 6.2 version of liferay and selected to include sample data, then you've seen the results of the resources importer. The Welcome Theme is included with the bundle: https://github.com/liferay/liferay-plugins/tree/6.2.x/themes/welcome-theme

The Resources Importer is a web plugin for liferay that will take content structured a particular way and create ether a site template or site based on that content.

Useful for Development

Let's say you are working on a Proof of Concept project for a client and there are several team memebers working to build out the site and make sure the Theme and UI work and look great. When developming locally