Skip to content

Instantly share code, notes, and snippets.

@rotty3000
Created September 21, 2011 20:12
Show Gist options
  • Save rotty3000/1233151 to your computer and use it in GitHub Desktop.
Save rotty3000/1233151 to your computer and use it in GitHub Desktop.
Extremely Flexible and Light Portal Customization
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="fast-flexible-theme" basedir="." default="deploy">
<import file="../build-common-theme.xml" />
<property name="theme.parent" value="classic" />
<property name="theme.type" value="ftl" />
<target name="compile">
<mkdir dir="docroot/WEB-INF/classes"/>
<copy todir="docroot/WEB-INF/classes">
<fileset dir="docroot/WEB-INF/src" />
</copy>
<antcall target="build-common-theme.compile" />
</target>
</project>
show-breadcrumb=Show Breadcrumb
portal-main-color=Main Background Color
<?xml version="1.0"?>
<!DOCTYPE
look-and-feel PUBLIC
"-//Liferay//DTD Look and Feel 5.0.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_5_0_0.dtd">
<look-and-feel>
<compatibility>
<version>6.1.0+</version>
</compatibility>
<theme id="fast-flexible" name="Fast And Flexible">
<template-extension>ftl</template-extension>
<settings>
<setting configurable="true" key="show-breadcrumb" type="checkbox" value="true" />
<setting
configurable="true" key="portal-main-color" type="text" value="#EEF0F2"
>
<![CDATA[
AUI().ready(
'aui-color-picker-base',
function(A) {
var target = A.one('#[@NAMESPACE@]portal-main-color');
target.attr('readonly', 'readonly');
var currentValue = target.val();
target.ancestor(
'.aui-field-element').append("<div id='[@NAMESPACE@]PortalMainColorPicker'></div>");
setTimeout(function() {
var [@NAMESPACE@]PortalMainColorPicker = new A.ColorPicker(
{
hex: currentValue
}
).render('#[@NAMESPACE@]PortalMainColorPicker');
[@NAMESPACE@]PortalMainColorPicker.on( 'colorChange',
function(event) {
var hex = [@NAMESPACE@]PortalMainColorPicker.get("hex");
target.val('#' + hex);
}
);
}, 0);
}
);
]]>
</setting>
</settings>
<layout-templates>
<custom>
<layout-template id="home" name="Home">
<template-path>/layouttpl/custom/home.tpl</template-path>
<wap-template-path>/layouttpl/custom/home.tpl</wap-template-path>
<thumbnail-path>/layouttpl/custom/home.png</thumbnail-path>
</layout-template>
</custom>
</layout-templates>
</theme>
</look-and-feel>
#
# Set this property to true to allow directly invoked JSPs to be
# overridden by a different version of the JSP that exists in a theme.
#
theme.jsp.override.enabled=true
<!DOCTYPE html>
<#include init />
<html class="<@liferay.language key="lang.dir" />" dir="<@liferay.language key="lang.dir" />" lang="${w3c_language_id}">
<head>
<title>${the_title} - ${company_name}</title>
${theme.include(top_head_include)}
</head>
<#assign portal_main_color = theme_display.getThemeSetting('portal-main-color') />
<body class="${css_class}" <#if (portal_main_color != '')>style="background-color:${portal_main_color};"</#if>>
${theme.include(body_top_include)}
<#if is_signed_in>
<@liferay.dockbar />
</#if>
<div id="wrapper">
<a href="#main-content" id="skip-to-content"><@liferay.language key="skip-to-content" /></a>
<header id="banner" role="banner">
<hgroup id="heading">
<h1 class="company-title">
<a class="logo" href="${company_url}" title="<@liferay.language key="go-to" /> ${company_name}">
<span>${company_name}</span>
</a>
</h1>
<h2 class="site-title">
<a href="${site_default_url}" title="<@liferay.language key="go-to" /> ${site_name}">
<span>${site_name}</span>
</a>
</h2>
<h3 class="page-title">
<span>${the_title}</span>
</h3>
</hgroup>
<#if !is_signed_in>
<a href="${sign_in_url}" id="sign-in" rel="nofollow">${sign_in_text}</a>
</#if>
<#if has_navigation>
<#include "${full_templates_path}/navigation.ftl" />
</#if>
</header>
<div id="content">
<nav class="site-breadcrumbs" id="breadcrumbs">
<h1>
<span><@liferay.language key="breadcrumbs" /></span>
</h1>
<@liferay.breadcrumbs />
</nav>
<#if selectable>
${theme.include(content_include)}
<#else>
${portletDisplay.recycle()}
${portletDisplay.setTitle(the_title)}
${theme.wrapPortlet("portlet.ftl", content_include)}
</#if>
</div>
<footer id="footer" role="contentinfo">
<p class="powered-by">
<@liferay.language key="powered-by" /> <a href="http://www.liferay.com" rel="external">Liferay</a>
</p>
</footer>
</div>
${theme.include(body_bottom_include)}
</body>
${theme.include(bottom_include)}
</html>
<#assign liferay_util = PortalJspTagLibs["/WEB-INF/tld/liferay-util.tld"] />
<@liferay_util["buffer"] var="html">
<@liferay_util["include"] page="/html/portlet/asset_publisher/display/title_list.jsp" strict=true useCustomPage=false />
</@>
<div style="border: 4px solid red; padding: 4px;">
${html}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment