Recent Bloggers

Nate Cavanaugh

Staff
37 Mensagens
17 de Setembro de 2014

Vicki Lea Tsang

Staff
5 Mensagens
11 de Setembro de 2014

Martin Yan

Staff
6 Mensagens
10 de Setembro de 2014

Angela Wu

Staff
3 Mensagens
8 de Setembro de 2014

Máté Thurzó

Staff
3 Mensagens
8 de Setembro de 2014

Mohit Soni

Staff
2 Mensagens
4 de Setembro de 2014

Matti Tahvonen

4 Mensagens
2 de Setembro de 2014

Jorge Ferrer

Staff
57 Mensagens
29 de Agosto de 2014

Olaf Kock

Staff
78 Mensagens
26 de Agosto de 2014

Ronald Sarayudej

Staff
151 Mensagens
25 de Agosto de 2014

Use Custom URL Variables to Display certain Paginated Web Content

Technical Blogs 24 de Julho de 2014 Por Bradley Wood

Ever wanted to explicitly define what page to display on the current pagination content from a url password?

This code should aim you in the right direction. Logic: -Get url variable ("page") value.
-set $total to the size of the pagination repeatable structure.
-If $pageId is set and is less than or equal to $total then use $pageId; else use the latest item.

#set ($friendlyURL = $request.get('attributes').get('CURRENT_COMPLETE_URL'))
#set ($pageId = $httpUtil.getParameter($friendlyURL, 'page"))

#set ($total = $image.siblings.size())

#if($pageId != "" && $getterUtil.getInteger($pageId) <= $total)
     #set($targetPage = $pageId)
#else
     #set($targetPage = $total)
#end

#foreach($image in $image.siblings)
     <img src="${image.data}" />
#end

Pagination JS that can be included in the velocity file
- define page: to be $targetPage

<script type="text/javascript">

AUI().ready('aui-paginator', function(A) {

	var pgA = new A.Paginator({
		page: ${targetPage},
		containers: '.paginatorA',
		total: 10,
		maxPageLinks: 10,
		rowsPerPage: 1,
		circular: true,
		rowsPerPageOptions: [ 1, 3, 5, 7 ],
		on: {
			changeRequest: function(event) {
				var instance = this;
				var newState = event.state;
				var page = newState.page;
				// newState.total = 100;

				if (newState.before) {
					var lastPage = newState.before.page;

					A.one('.contentA .page' + lastPage).setStyle('display', 'none');
				}

				A.one('.contentA .page' + page).setStyle('display', 'block');

				// IMPORTANT!
				// we need to .setState(newState) or .set(STATE, newState)
				// to update the UI
				instance.setState(newState);
			}
		}
	})
	.render();

});

</script>


*note: Have the Pagination JS code in the same template velocity file as the web content.

Embedding Navigation Portlet into Layout using Custom Settings

General Blogs 24 de Julho de 2014 Por Bradley Wood

Special thanks to atul patel's forum post displays how to embed a navigation portlet into a layout using custom settings.
With Custom Settings Basic display styles: There are 6 different basic views (source wiki):

  1. looks like breadcrumbs; shows parent page and current page but not siblings
  2. current page only?
  3. shows parent page and all subpages (siblings). The current page is bold. This seems to be the most valuable normal setting.
  4. shows subpages (siblings), no parent
  5. ? looks like 4
  6. Is a full community/org nav. Shows all pages in tier
$velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
$velocityPortletPreferences.setValue("root-layout-type", "absolute")
$velocityPortletPreferences.setValue("bullet-style", "main")
$velocityPortletPreferences.setValue("header-type", "none")
$velocityPortletPreferences.setValue("root-layout-level", "0")
$velocityPortletPreferences.setValue("included-layouts", "all")
$velocityPortletPreferences.setValue("display-style", "")
$theme.runtime("71_INSTANCE_MAIN", "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()

 

Add Responsive Layouts to Liferay 6.1

General Blogs 6 de Junho de 2014 Por Bradley Wood

One issue has come up time and time again with 6.1, There isn't a built in responsive grid system for Liferay 6.1. Version 6.2 uses twitter bootsrap. Here are 10 pure css layouts that overwrite the default layouts that are provided in Liferay. When the screen is resized all of the columns stack. This is a simple solution to instantly get a responsive website for liferay 6.1.

PURE CSS RESPONSIVE LAYOUTS in Marketplace

 

Overwrite Liferay Logo in Theme

General Blogs 9 de Maio de 2014 Por Bradley Wood

In every theme that I write I always put this snippet of code in my theme's init_custom.vm file.

## ---------- Logo ---------- ##
#if (($company.getLogoId() == 0) && $use_company_logo)
     #set ($site_logo = "${images_folder}/custom/logo.png")
     #set ($site_logo_height = 69) #set ($site_logo_width = 403)
#end 

Gist Link

What this snippet will do is display the site logo if one has been set, If a company logo has been set it will use that, if there isn't a company or site logo, then it uses the logo.jpg in the theme and displays it instead of the default liferay logo.

 

Please leave a comment below if this was helpful, thanks.

 

Bradley Wood
Woodbench Media
80W. Sierra Madre Blvd, #109
Sierra Madre, CA 91024

www.woodbenchmedia.com

How to enable PACL for marketplace apps.

General Blogs 9 de Maio de 2014 Por Bradley Wood

Here is a quick refereance for the PACL how to documentation. It was a little hidden, so here is the link for setting it up for 6.1.2 GA3

 

https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen11-developing-plugins-with-security-in-mind-0

 

Bradley Wood
Woodbench Media
www.woodbenchmedia.com

Mostrando 5 resultados.