Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Mason Stein
Hardcode login portlet into theme
12. Dezember 2012 14:39
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Hey guys,

is it possible to place the login portlet into a theme?
I want to place it instead the "sign in" link, so the email and password fields will be visible.. (like www.swisher.com =))

The thing is, I can place it into every page but only by moving it into the page area where the "content" div is.

I need a little help to understand :

 1<div id="content">
 2        ...
 3        #if ($selectable)
 4            $theme.include($content_include)
 5        #else
 6            $portletDisplay.recycle()
 7            $portletDisplay.setTitle($the_title)
 8            $theme.wrapPortlet("portlet.vm", $content_include)
 9        #end
10    </div>


Is there a way to write the code from the login protlet into a different div that I place ..lets say, instead of
1#if (!$is_signed_in)
2            <a href="$sign_in_url" id="sign-in" rel="nofollow">$sign_in_text</a>
3        #end


many thx!!!
Anonym
RE: Hardcode login portlet into theme
12. Dezember 2012 14:51
Antwort

Anonym

Try to embed the login portlet in the theme
1
2#if (!$is_signed_in)
3            $theme.runtime($login_portlet_id, $queryString, $velocityPortletPreferences.toString())
4        #end


replace $login_portlet_id with the actual portlet id
Mason Stein
RE: Hardcode login portlet into theme
12. Dezember 2012 15:30
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Bradley! Many THX"
That was exactly what I was looking for...
I left $queryString blank....thats ok, right?
Hitoshi Ozawa
RE: Hardcode login portlet into theme
12. Dezember 2012 15:42
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

Or pass an empy string
e.g.
$theme.runtime(portletId, '', $velocityPortletPreferences.toString())
Anonym
RE: Hardcode login portlet into theme
12. Dezember 2012 15:48
Antwort

Anonym

Make sure if you set any portlet preference to clear those out.


#set ($VOID = $velocityPortletPreferences.setValue('display-style', '1'))
#set ($VOID = $velocityPortletPreferences.setValue('portlet-setup-show-borders', 'false'))
#set ($instanceId = 'E3j7')
#set ($myPortletId = "73_INSTANCE_${instanceId}")
$theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())
Mason Stein
RE: Hardcode login portlet into theme
12. Dezember 2012 15:49
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Hey Hitoshi,

yeah, thats what I ment..
works!

THX
Mason Stein
RE: Hardcode login portlet into theme
12. Dezember 2012 15:51
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

THX Bradley,
I will do that!

Thanks again for your help!!
Mason Stein
RE: Hardcode login portlet into theme
17. Dezember 2012 10:57
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Hey again,

I did all as you told me and it´s excactly what I want.
Still I am facing a problem and I absolutly don´t know what to do....

My Login Portlet is now visible in the upper right side on every page (as long as the user is not logged in), ok, but when I click on "create account" or "forgot password" the portlet is visible two times:
i) still in the upper right side
AND
ii) inside the content div

How can I regulate this?
I mean, can I put the login portlet with "email" and "password" in one position and hide it, if someone wants to sign up (and put this into content div)?

Many many thx!!
Anonym
RE: Hardcode login portlet into theme
17. Dezember 2012 11:06
Antwort

Anonym

What you could do is add a css class to a div wrapping the embedded login portlet. then you could do a display:none in the css targeting the one that you don't want those to show up.
Mason Stein
RE: Hardcode login portlet into theme
18. Dezember 2012 05:03
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Hey Bradley,

thx for help! I did that already to position my login portlet in the upper side...
It is wrapped into a div.

What I don´t understand: Why does it appear in the content when I press "register"..
I do understand what you mean by css and "display: none" ... I used that for hiding the head/titel of portlet.

But how can I differentiate between login portlet in initial state and login portlet in "I pressed the register or forgot my password" state...=(
Anhang

Anhänge: Foto.JPG (82,4k)
Anonym
RE: Hardcode login portlet into theme
18. Dezember 2012 08:12
Antwort

Anonym

when it shows in the content it should be in the maximized view. so look at the css class on the portlet for login-portlet and portlet-maximized. then you can target it not to show. or write a hook to change how the login portlet work. another area to look is under portal settings, under authentication, there are some checkboxes that can change hoe the login portlet looks as far as what button options you have.
Mason Stein
RE: Hardcode login portlet into theme
19. Dezember 2012 09:14
Antwort

Mason Stein

Rang: Junior Member

Nachrichten: 47

Eintrittsdatum: 5. Dezember 2012

Neue Beiträge

Hey,

really, I am sorry to bother you...
I´d love to write a hook and change that.

But honestly I can´t find the right place to hook on...
I looked at
\html\portlet\login\create_account.jsp --> did´t find =(
\html\portlet\login\navigation.jsp --> did´t find =(
\html\portlet\login\login.jsp --> did´t find =(

My idea was to
wrap login into <div id= "myLoginVersionLogin"> and
wrap create_account into <div id= "myLoginVersionCreateAccount"> ...
to be able to control them with css..

Please help me with this one...
And still I dont know what makes my login portlet be written into content..=(


Many many thx, again and again...!!