5098 Posts in 1518 Topics by 1115 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1147 Views |
-
Moving Blog widgets to my site template

23 November 2009 at 3:52am
So, i set up the blog module to manage my news entries on the frontpage.
i created my own template with a fixed sidebar defined in the Page.ss template file.i now want to move all the widgets from the blog into this sidebar section and only displaying them on the blog page or entries of the blog. (i dont want the archive box be displayed on the "about-us" page for example)
so i tried to follow this small tutorial: http://doc.silverstripe.org/doku.php?id=widgets#adding_widgets_to_other_pages
and my page.php file looked in this section like this:<?php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
"Sidebar" => "WidgetArea"
);function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->addFieldToTab("blog.Widget.ArchiveWidget", new WidgetAreaEditor("Sidebar"));
return $fields;
}}
...
And unfortunately this doesnt work. My site throws an Website error and i have not the slightest idea how to solve this.Where do i learn which path to use for a widget i want to include? The tutorial says "Root.Content.Widgets" but where are these packages?
Do i have to use the term "Sidebar"? And why does the authore make use of the term "Sidebar" and calling the object with $SideBar in the template? Isn't Silverstripe case-sensitive?
Can i use any term for this? for example could i just write "Area-to-put-all-the-blog-widgets-in" instead of "Sidebar" ? Or is it connected in some ways to other parts of the template?
-
Re: Moving Blog widgets to my site template

5 March 2011 at 2:41pm Last edited: 5 March 2011 3:05pm
Hi. I'm in middle of the development of a new SS site and have struck exactly the same problem -- my main navigation is in the Sidebar area which works fine across all page until I come the Blog module. Then I get the blog widgets (admin, tag cloud, etc) sitting on top of my navbar.
I've just added "$SideBar" beneath my Navigation pane and the blog widgets now show up in the correct place on the page - and just on the relevant Blog page (as opposed to ALL pages in the site -- which is really cool! Apart from one thing -- the Blog widgets also appear at the top of the navbar. In other words, I get them TWICE! (which just looks like overkill)
Currently looking for an .SS or PHP file that's causing this. Can anybody give me any pointers?
thanks!
| 1147 Views | ||
|
Page:
1
|
Go to Top |


