掲示板

i want to add one portlet in vm

15年前 に Abdur rasheed によって更新されました。

i want to add one portlet in vm

Junior Member 投稿: 71 参加年月日: 08/09/26 最新の投稿
i want to add one portlet(sign in-portlet) in my portal normal.vm .plz give me one example code.

thanks&advance
Rasheed.
thumbnail
15年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
$theme.runtime("58")
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Samuel Kong:
$theme.runtime("58")


Hi Samuel,

I would like to replace the dock with the sign-in portlet. Would the above do this? And how exactly does that work and where do i make that change?

Thanks
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
in portal_normal.vm, the line that includes the dock is
#parse ("$full_templates_path/dock.vm")
. Just replace this line with
$theme.runtime("58")
(Note: you will need to also update the css if you want to position the sigin in portlet in the same location as the dock.
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
I have tried the above code and that placed the portlet on the banner. The portlet took up all the space of the banner i.e. from teh right to the left of the screen.

I need to resize to be just a small box at the right hand side of the screen. I also need to remove the buttons (close, minimum, maximu) around the portlet. I just need a normal box around the portlet. Which file will i need to edit?
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
Take a look at this page for info on removing the border. Then just use css to position, resize or add a custom border.
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Hi Samuel,

Which css files do i need to modify? portlet.vm and portlet.css are global so any changes in these files will affect all portlets and i only want to affect this one portlet.
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
You should modify custom.css. In custom.css, you should use

#portlet-wrapper-58
to target the sign in portlet.
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Hi Samuel,

I cant find any documentaiton on how to use the portlet-wrapper tag. Could you show me an example please?

Thanks
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
It's just a HTML tag with id="portlet-wrapper-58". Take a look a www.w3schools.com/css/ if you need to brush up on your CSS.
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
So that means i can do something like this on the sign in portlet?

login.jsp

<div id="portlet-wrapper-58">
Test string
</div>


_diffs/custom.css

#portlet-wrapper-58{
 color:blue;
}


What would happen if i want to have several divs in the login.jsp class with different styles? This cant be done with an id as that has to be unique on a page.

Thanks
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
I tried this, but it didnt work.

I added the following in custom.css


#portlet-wrapper-71{
border: 2px solid #000;
}


What i want to do is to put a border on the navigation portlen only (id=71). I dont want a border on any of the other portlets. I thought if i add teh above in custom.css it would work but it doesnt.

What can i do to add a border a specific portlets without affecting other portlets?

Thanks
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
The id attribute of the navigation portlet is a little different because it's instanceable (i.e. the navigation portlet can appear on a page multiple times). So the id attribute will looking something like #portlet-wrapper-71_INSTANCE_Pd1c (where pd1c will be different for different instances of the portlet). Since your themes won't really know what instance id of the portlet you'll actually need to do something like:

.portlet-navigation {
    border: 2px solid #000;
}

Note: there's a CSS class for all of Liferay's build in portlets and they all have the form portlet-{PORTLET_NAME}. So the Hello World portlet is portlet-hello-world and the Sign in portlet is portlet-login.
thumbnail
14年前 に Ziggy R によって更新されました。

RE: i want to add one portlet in vm

Expert 投稿: 293 参加年月日: 08/06/08 最新の投稿
Hi thanks Samuel.

Just so that i understand what you meant, if the porltlet is instantiable then the instance id needs to be specified if i want to target a specific instance of a portlet (i.e. a specific portlet in a specific page).

And if the portlet is instantiable but i want to target all portlet of the same type on all pages then i dont have to specify the instance id but i could just refer to it using portlet-[portletName]?
thumbnail
14年前 に Samuel Kong によって更新されました。

RE: i want to add one portlet in vm

Liferay Legend 投稿: 1902 参加年月日: 08/03/10 最新の投稿
that's correct