Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Widgets /

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Login widget


Go to End


5 Posts   2956 Views

Avatar
malinux

Community Member, 23 Posts

9 October 2009 at 9:13am

Hi

I have made some changes to the login widget and I'm including it on all pages with mysite/code/Page.php

function MyLogin() {
$widget = new LoginWidget();
}

It is working fine but I want to exclude this widget from the forum page. How can I do that?

-- Martin

Avatar
malinux

Community Member, 23 Posts

9 October 2009 at 10:23am

In my Login.ss

<% if ClassName = ForumHolder %>
<% else %>
do login etc...
<% end_if %>

Avatar
Nickt

Community Member, 43 Posts

29 November 2009 at 12:08pm

could you please explain in detail how you put the login widget in all the pages? this would be much appreciated.

Avatar
malinux

Community Member, 23 Posts

29 November 2009 at 1:59pm

I think I did something like this...

I used the Log In Widget from http://www.silverstripe.org/Log-in/

Then you need to add something like this to end of mysite/code/Page.php
---------------
function MyLogin() {
$widget = new LoginWidget();
return $widget->renderWith("WidgetHolder");
}
---------------

Then you need to call this somewhere in your theme. It could be theme/blackcandy/templates/Pages.ss
---------------
<div id="BgContainer">
<div id="Container">
...
...
<div id="Sidebar">
$MyLogin
</div>
...
...
---------------

I also think you need to call http://yoursite.com/dev/build

Avatar
Nickt

Community Member, 43 Posts

30 November 2009 at 4:12pm

Thanks so much!
i added the code into the "leftcolumn.ss" under /themes/lazydays/templates/includes/leftcolumn.ss
it works like a charm