Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » I wanna make a sidebar, but how?

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

Page: 1 2 3 4 5
Go to End
Author Topic: 13016 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    There is now a tutorial on creating a sidebar on SSbits.com

    http://www.ssbits.com/create-a-static-sidebar-editable-from-the-cms/

  • Happysadhu
    Avatar
    Community Member
    33 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Thanks for the helpful info.
    I couldn't get your suggestion to work -- error of unexpected ");" kept popping up -- until I removed a couple of commas after 'LinkText' => 'LinkText' and 'getCMSFields_forPopup' in LinksPage.php (See below for modified version).

    $LinkField = new HasManyComplexTableField(
    $this,
    'Links',
    'Link',
    array(
    'Link' => 'Link',
    'LinkText' => 'LinkText'
    ),
    'getCMSFields_forPopup'
    );

    Is there a way of having a drop down selection of the available internal links rather then having to manually enter in each link -- similar to your static sidebar tutorial, but also still having the "Add a link" option so that one can a number of links with only one drop down menu of links (pop-up?)

    Thanks,
    Sam

  • mindreader
    Avatar
    Community Member
    2 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Wow i have found a lot of useful info here , thanks guys

  • profimus
    Avatar
    Community Member
    8 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Hello Aram,

    How about making 2 or even 3 CMS editable blocks that appear on all pages?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Hi Profimus,

    it works exactly the same, just repeat as desired!

    Have a run through the tutorial on SSbits.com. All you need to do is create some extra fields in hte CMS and output them in your template

    Aram

  • Atragon
    Avatar
    Community Member
    2 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Hello aram,

    I've managed to add the static sidebar as you describe in your article on ssbits to my website. However, when I try to add a poll to it using the poll module (http://doc.silverstripe.org/modules:polls?s[]=poll) nothing happens.

    I know the poll module is working because if I add the $MyPoll call in the Sidebar.ss file immediately above or below the <% include StaticSidebar %> line, it works. However when I add the $MyPoll call in the StaticSidebar.ss file immediately below the <h3> line, nothing happens.

    Do you have any idea as to why this might be happening?

    My goal is to have a random poll visible on every page, not just the pages that have a dynamic sidebar.

    Thanks,
    James

    PS: Please let me know if you need more information to help solve this problem, I'm a newbie at web development in PHP, so I don't really know what additional information would be of use to you.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Hi Atragon,

    try using $Top.MyPoll

    basically as soon as you do <% control StaticSidebar %> you are now within the context of the static sidebar, which doesnt know what $MyPoll is, so you can use 'Top' to jump back to the top level page context to call your poll.

    Aram

  • Atragon
    Avatar
    Community Member
    2 Posts

    Re: I wanna make a sidebar, but how? Link to this post

    Aram,

    That did the job perfectly, thank you very much.

    James

    13016 Views
Page: 1 2 3 4 5
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.