Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » using widgets on normal pages

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

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

Page: 1
Go to End
Author Topic: 3158 Views
  • iop
    Avatar
    Community Member
    6 Posts

    using widgets on normal pages Link to this post

    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...

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: using widgets on normal pages Link to this post

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

  • iop
    Avatar
    Community Member
    6 Posts

    Re: using widgets on normal pages Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: using widgets on normal pages Link to this post

    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>

  • iop
    Avatar
    Community Member
    6 Posts

    Re: using widgets on normal pages Link to this post

    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?

  • PhilQ
    Avatar
    Community Member
    3 Posts

    Re: using widgets on normal pages Link to this post

    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?

  • macsepp
    Avatar
    Community Member
    5 Posts

    Re: using widgets on normal pages Link to this post

    Any solutions so far?

    3158 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.