Jump to:

794 Posts in 408 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » Login widget

Discuss SilverStripe Widgets.

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

Page: 1
Go to End
Author Topic: 1875 Views
  • malinux
    Avatar
    Community Member
    23 Posts

    Login widget Link to this post

    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

  • malinux
    Avatar
    Community Member
    23 Posts

    Re: Login widget Link to this post

    In my Login.ss

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

  • Nickt
    Avatar
    Community Member
    43 Posts

    Re: Login widget Link to this post

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

  • malinux
    Avatar
    Community Member
    23 Posts

    Re: Login widget Link to this post

    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

  • Nickt
    Avatar
    Community Member
    43 Posts

    Re: Login widget Link to this post

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

    1875 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.