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

using widgets on normal pages


Go to End


7 Posts   4561 Views

Avatar
iop

Community Member, 6 Posts

9 September 2008 at 9:53pm

Hello!

I want to use widgets on normal pages (for example widgetHtmlContentWidget-1.0.0.tar.gz). So until now
1.) I copied the folder into my root silverstripe folder,
2.) changed the files like here: http://doc.silverstripe.com/doku.php?id=widgets
3.) run "mysite.de/db/build/?flush=1"
4.) drag the widget into the widget field and edited the content (some text and a link)
5.) save&publish

But I can't see any changes. First when I create a "virtual Page" the "htmlWidget" is being displayed under the "virtual Page" link.

So what am I doing wrong? Its the same problem with other widgets too. Can someone help me please? I'm totally confused...

Avatar
Willr

Forum Moderator, 5523 Posts

11 September 2008 at 6:30pm

Im not sure you can add widgets to a virtual Page? What about a normal Page?

Avatar
iop

Community Member, 6 Posts

11 September 2008 at 10:16pm

First of all thanks for the answer!

I don't add the widgets to the virtual Page, I want to add them to a normal Page.

The Problem is, that I can't see the widget on my site. I see it first, when I add a virtual Page to this site.

Here is a site with a virtual Page, you can see the widget too:
http://muppet.9dd.de/silverstripe/

Here is a site without a virtual Page but you can't see the widget (even though you should see a widget):
http://muppet.9dd.de/silverstripe/about-us/

So I think there is a variable or something like that what I have to turn on (and what turns on automatically by using a virtual Page)... am I right?

Avatar
Willr

Forum Moderator, 5523 Posts

11 September 2008 at 11:37pm

No sorry you confused me with virtual pages.. your issue isnt related to virtual pages at all. The thing is that on the home page you have a sub page called Contact us. Now because you have a subpage it automatically adds the menu to the page. On the About us page though you dont have any subpages under it so it doesnt include the menu section on the right.

What you want to do then is change the theme so instead of detecting whether there is a submenu or not you want it always to display that left hand side. So edit this file - themes/blackcandy/templates/Layout/Page.ss

to something like this

<div class="typography">
		<% include SideBar %>
		<div id="Content">
			
	<% if Level(2) %>
	  	<% include BreadCrumbs %>
	<% end_if %>
	
		<h2>$Title</h2>
		
		$Content
		$Form
		$PageComments
	
		</div>
</div>

Avatar
iop

Community Member, 6 Posts

12 September 2008 at 12:18am

Thanks, that worked!

But now I have another widget problem. I can't remove a widget I set before. Clicking on save or save&publish lets the animation on the save button rotate endlessly.

So I put the line
Director::set_environment_type('dev');
into mysite/_config.php file and there comes a bunch of messages.....

##############################################
FATAL ERROR: i18n::include_by_class: Class not found
At line 1258 in /var/www/silverstripe/sapphire/core/i18n.php

user_error(i18n::include_by_class: Class not found,512)
line 1258 of i18n.php

i18n::include_by_class()
line 132 of Core.php

_t(TITLE,Title (optional))
line 23 of HtmlContentWidget.php

HtmlContentWidget->getCMSFields()
line 64 of Widget.php

Widget->CMSEditor()

call_user_func_array(Array,Array)
line 404 of ViewableData.php

ViewableData->XML_val(CMSEditor,,1)
line 26 of .cache.var.www.silverstripe.cms.templates.WidgetEditor.ss

include(/var/www/silverstripe/silverstripe-cache/.cache.var.www.silverstripe.cms.templates.WidgetEditor.ss)
line 197 of SSViewer.php

SSViewer->process(HtmlContentWidget)
line 763 of ViewableData.php

ViewableData->renderWith(WidgetEditor)
line 58 of Widget.php

Widget->EditableSegment()

call_user_func_array(Array,Array)
line 404 of ViewableData.php

ViewableData->XML_val(EditableSegment,,1)
line 92 of .cache.var.www.silverstripe.cms.templates.WidgetAreaEditor.ss

include(/var/www/silverstripe/silverstripe-cache/.cache.var.www.silverstripe.cms.templates.WidgetAreaEditor.ss)
line 197 of SSViewer.php

SSViewer->process(WidgetAreaEditor)
line 763 of ViewableData.php

ViewableData->renderWith(WidgetAreaEditor)
line 15 of WidgetAreaEditor.php

WidgetAreaEditor->FieldHolder()

call_user_func_array(Array,Array)
line 404 of ViewableData.php

ViewableData->XML_val(FieldHolder,,1)
line 72 of .cache.var.www.silverstripe.sapphire.templates.TabSetFieldHolder.ss

include(/var/www/silverstripe/silverstripe-cache/.cache.var.www.silverstripe.sapphire.templates.TabSetFieldHolder.ss)
line 197 of SSViewer.php

SSViewer->process(TabSet)
line 763 of ViewableData.php
##############################################

..ok, something is really wrong here I think... do you have a suggestion for me what I can do?

Avatar
Phil Quinn

Community Member, 3 Posts

19 September 2008 at 2:31pm

I am having a similar issue. It seems to be related to the HtmlContentWidget. It seems to be the "sticky" widget that will not delete. Other widgets, like the RSS widget, WILL delete for me.

I noticed this after doing a bunch of other customization around how Widgets were displayed on my site. I was afraid it was something I did, so I tried this with a vanilla install, and only added:
- Blog module (0.1)
- HtmlContentWidget (1.0.0)

When I do this, I can add the HtmlContentWidget to the Blog, edit it, but not delete it.

The other Widgets will delete just fine.

The HtmlContentWidget is pretty straightforward, so I am not sure what it can be. Perhaps it is a conflict with tiny_mce? Maybe the page is not really getting submitted?

Avatar
macsepp

Community Member, 5 Posts

1 December 2008 at 5:54am

Edited: 01/12/2008 5:55am

Any solutions so far?