掲示板

Left-Side Navigation to customise and add in a theme [SOLVED]

thumbnail
12年前 に lou cat によって更新されました。

Left-Side Navigation to customise and add in a theme [SOLVED]

Regular Member 投稿: 196 参加年月日: 12/01/26 最新の投稿
Hi all!

I've seen many other posts regarding left-side navigation but they didn't seem "solved", so why not trying to understand the problem once and for all? emoticon

Here's is my issues regarding it, any suggestion will be useful:

1. I've added the left-side navigation from the available portlets, but I'd like to add it to my theme and the fact that it's an instanceable portlet confuses me: if I add its instance ID, would it be created dynamically and in the proper way in every page I assign my theme to?

2. I'd like to insert it in the content area, in a normal 2 columns 30-70 layout, on the left column... how to specify this inside portal_normal.vm?

3. I'd like to modify better its CSS but I think I miss some classes, for example the first page node is my parent page so it's inside an h2 element, but it doesn't seem to have the attribute "selected" if we are in that page (and I need to modify its style only if we are inside that page, not just because it's the parent page...).
It would be easier to do it if I had a velocity template such as navigation.vm, but when I created it I couldn't find a way to positionate it in the correct column of the content area, that's why I'm using the out-of-the-box portlet....

I hope it's not confusing and someone can give me a hint... thanks!!

lou
thumbnail
12年前 に David H Nebinger によって更新されました。

RE: Left-Side Navigation to customise and add in a theme

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
The theme contains an area dedicated to the portal contents, and anything that you put into the theme is going to be outside of that content area.

So if you didn't want to use the area below the navigation, your theme could have one div on the left side where a navigation.vm clone would generate the nav items, then the div on the right side would be your content area.

If you needed some portlets on the left side, you'd have to embed them into the theme to get them there, but it is still doable.

Your layout for this particular theme would then be 1 column, since you'd be simulating the 30/70 w/ your theme.
thumbnail
11年前 に Kamesh Sampath によって更新されました。

RE: Left-Side Navigation to customise and add in a theme

Regular Member 投稿: 158 参加年月日: 10/05/27 最新の投稿
Hey David,

I am trying to do as suggeted by you , but what happening in my case is that I am able to see the nav in left and content in the right, but then i see the content is being generated on the right below the navigation div and not in parallel to it. infact i had set 10% , 90% width for left-nav-bar and content respectively.

Ideally this is wasting lots of space the column parallel to the Navigation bar on the left .

I have put down the code I am using inside my portal_normal.vm.



<div id="left-nav-bar">
	#** Navigation **#
	#if ($has_navigation || $is_signed_in)
	   #parse ("$full_templates_path/navigation.vm")
	#end
    </div>
	
    <div id="content">
		
    		#if ($selectable)
    			$theme.include($content_include)
    		#else
    			$portletDisplay.recycle()
    
    			$portletDisplay.setTitle($the_title)
    
    			$theme.wrapPortlet("portlet.vm", $content_include)
    		#end
    </div>


Any thoughts how we could fix my issue ?
thumbnail
12年前 に Ram Manusani によって更新されました。

RE: Left-Side Navigation to customise and add in a theme

Regular Member 投稿: 124 参加年月日: 11/10/27 最新の投稿
Well, you can either use theme or layout for achieving your requirement...

Adding a Navigation portlet to a theme as theme.runtime("portlet_id_instance") or you can tweak the navigation velocity code in navigation.vm to look alike tabs at the left.
The portlet is added during runtime of the theme.

Adding a Navigation Portlet to a custom page template should solve the purpose too. You can probably have a 30/70 layout and add the Navigation portlet as part of 30 layout and let the 70 be portlet content part. You might have set some velocityPreferences and tweak css to make the navigation portlet look alike tabs.

Depends on your requirement, but both should help you. Let me know if you need more information.
thumbnail
12年前 に lou cat によって更新されました。

RE: Left-Side Navigation to customise and add in a theme

Regular Member 投稿: 196 参加年月日: 12/01/26 最新の投稿
thank you very much to both of you, I think I have the ideas clearer.
First of all I'll try to edit portal-normal.vm as David was suggesting, then I'll decide if adding the navigation portlet or clone navigation.vm...