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.

Widgets

Discuss SilverStripe Widgets.

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

Login widget


Reply

5 Posts   1898 Views

Avatar
malinux

9 October 2009 at 9:13am Community Member, 23 Posts

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

9 October 2009 at 10:23am Community Member, 23 Posts

In my Login.ss

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

Avatar
Nickt

29 November 2009 at 12:08pm Community Member, 43 Posts

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

Avatar
malinux

29 November 2009 at 1:59pm Community Member, 23 Posts

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

30 November 2009 at 4:12pm Community Member, 43 Posts

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