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.

Archive /

Our old forums are still available as a read-only archive.

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

the future of widgets


Go to End


3 Posts   2163 Views

Avatar
Nicolaas

Forum Moderator, 224 Posts

7 April 2008 at 10:41am

Hi Silverstripers

Widgets are a fantastic idea, but in the documentation they are listed as if the widgets were part of the blog module perse. In the documentation, I have added a section "how to add widgets to other pages": http://doc.silverstripe.com/doku.php?id=widgets#adding_widgets_to_other_pages

What is the philosophy on widgets - should all loaded widgets be available to all pages - or should widgets only be available to blog holders or ....?

For me, I would like to see the following:

Class MyPage extends Page {

static include_widgets = Array(
"mywidget1",
"mywidget2",
}
}

Cheers

Nicolaas

Avatar
asfahaan

Community Member, 6 Posts

7 April 2008 at 10:46am

Hi Thanks for this!

I was looking for a solution to add widgets to normal pages other than Blog!

Can you please tell me which file iam suppose to change "class Page extends SiteTree {}"?

Cheers,
Asfahaan

Avatar
Willr

Forum Moderator, 5523 Posts

7 April 2008 at 3:11pm

class Page extends SiteTree {}

that would be the Page.php file in your code. Each class has its own File and all the code for your site is located within mysite/code