Giter VIP home page Giter VIP logo

silverstripe-widgets's Issues

Widgets no longer work on SS3.1

When checking out sapphire and cms 3.1-branch, widgets no longer work. When switch back to sapphire and cms 3.0-branch it works again. Error that I receive is on all widgets, for example: website.com/Widget_Controller/EditableSegment/ArchiveWidget results in 404-not-found.

WidgetHolder template seems to be clueless of loop figures

If I am not wrong the WidgetHolder.ss template is used within the WidgetArea.ss template to wrap the Widgets added to a page:
Here is the WidgetArea.ss

<% loop WidgetControllers %>
    $WidgetHolder
<% end_loop %>

and the WidgetHolder.ss:

<div class="WidgetHolder $ClassName<% if FirstLast %> $FirstLast<% end_if %>">
    <% if Title %><h3>$Title</h3><% end_if %>
    $Content
</div>

But if I add $Pos or $TotalItems to the latter the value for both position indicators is always 1 (for all Widgets added - I added 3). This came to my attention because the line

<% if FirstLast %> $FirstLast<% end_if %>

added "first last" every time (in my case for all 3 Widgets).

The documentation points out
$FirstLast: Returns a string, "first", "last", "first last" (if both), or "". Useful for CSS classes.

If it is intended like that how should the logic for
<% if FirstLast %> $FirstLast<% end_if %>
work?

WidgetAreaEditor failing to load custom widgetClasses

Problem was tracked down to AvailableWidgets();
Current declaration:

public function AvailableWidgets() {

    $widgets= new ArrayList();

    foreach($this->widgetClasses as $widgetClass) {
        $classes = ClassInfo::subclassesFor($widgetClass);
        array_shift($classes);
        foreach($classes as $class) {
            $widgets->push(singleton($class));
        }
    }

    return $widgets;
}

Raw fix:

public function AvailableWidgets() {

    $widgets= new ArrayList();

    foreach($this->widgetClasses as $widgetClass) {
        $classes = ClassInfo::subclassesFor($widgetClass);
        if(count($classes) > 1) array_shift($classes);    
        foreach($classes as $class) {
            $widgets->push(singleton($class));
        }
    }

    return $widgets;
}

History widgets

There is possible include history (versions) of changes in widgets? Like some history pages....

Change $Content template variable?

WidgetHolder.ss has a $Content variable, which is the place where the Widget template is rendered. I find this to be a bit inconsistent with the use of $Content in page templates. IE you usually expect it to be a HTMLText field.

I want to propose changing this to something else, in WidgetHolder and the corresponding function in Widget.php. The only issue I can see in causing upgrade issues is in the case where someone has implemented their own WidgetHolder.ss tempate.

I've tentatively changed $Content to $Render in my local code.

Thoughts?

UploadField doesn't work with Widget::getCMSFields()

This is the error message:

Fatal error: Call to a member function FormAction() on a non-object in /framework/forms/FormField.php on line 139

To reproduce:

public function getCMSFields() {
    return new FieldList(
        $imageField = new UploadField('Image', 'Upload image');
    ):
}

Widget report

It would be neat to a have a CMS Report that tells me which widgets are used and on which pages they are used.

Tests fail under silverstripe-framework 3 branch

Per the @wilr's comment in #85 the DB=MYSQL CORE_RELEASE=3 build is failing, at first I thought changing WidgetArea::ItemsToRender() to use filter() would solve the deprecation issues and allow the build to finish but it would seem that just moves to the next issue. Which is bellow, it would seem as though the silverstripe/framework 3 branch has a deprecation on has_one(). If it doesn't disappear the build log can be seen here https://travis-ci.org/webbuilders-group/silverstripe-widgets/jobs/56909007

WidgetControllerTest::testWidgetFormSubmission
DataObject->has_one is deprecated. Please use hasOne() instead. Called from WidgetContentControllerExtension->handleWidget.

Widget module not installing

Using SS 3.0.3, this module cloned today, and the blog module 0.6(the latest?).

I get the following error in CMS when try to select the blog holder page:

[User Error] Uncaught Exception: DataObject->getComponent(): Could not find component 'SideBar'.
GET /admin/pages/edit/show/6
Line 1324 in /var/www/vhosts/berzerkdev.com/berzerk/framework/model/DataObject.php
Source
1315 if($joinID) {
1316 $component = DataObject::get_one($class, ""$joinField" = $joinID");
1317 }
1318
1319 if(!isset($component) || !$component) {
1320 $component = $this->model->$class->newObject();
1321 $component->$joinField = $this->ID;
1322 }
1323 } else {
1324 throw new Exception("DataObject->getComponent(): Could not find component '$componentName'.");
1325 }
1326
1327 $this->components[$componentName] = $component;
1328 return $component;
1329 }
1330

Some thing to do with side bar?

'Not Found' error on 3.1 means Widgets cannot be added

I have tried this on an old site and a fresh install.

I have tried using widgets both the old way, and using the new

Page:
extensions:
- WidgetPageExtension

method in my main config.yml file in mysite/_config

I can’t add widgets to a page using 3.1 and widgets. They have both been installed using Composer. When I click on the [+] button the CMS attempts to access url.com/WidgetController/EditableSegment/nameofWidget but gets a 404 error.

Any widgets already on the page work as expected.

If I use composer to roll back to 3.0.x everything works as expected again.

Widget wont render in Frontend

I have included the widgetArea on a vanilla SS3.0.* according the readme and integrated
$MyWidgetArea in Page.ss.
The widget i used is my fork of the loginwidget:
https://github.com/ivoba/silverstripe-widget-login

But the widget wont show.

If i integrated it directly with new LoginWidget() instead of WidgetArea it works.

Is this a problem of the widget or of this module?
Can you give me a hint where i can debug the rendering of $MyWidgetArea?

ArchiveWidget is not translatable

ArchiveWidget for blog module is not translatable. Its hardcoded to "Browse by Date".
Temporary solution (as suggested by Pyromanik on irc chat) is to add to _config.php:

ArchiveWidget::$title = "Whatever 'browse by date' is in your language";

The problem (as simon_w pointed) is Widget::Title() doesn't go through _t()

Missing Resources

Please add WidgetAreaEditor.js and WidgetAreaEditor.css into the archive as from B2 they are missing from the cms along with widget support

Personally I think its a shame widgets are now modules.

Anyway this is now the relevant function in WidgetAreaEditor.php with the js and css moved:

function FieldHolder($properties = array()) {
    Requirements::css('silverstripe-widgets/css/WidgetAreaEditor.css');
    Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
    Requirements::javascript(THIRDPARTY_DIR . '/behaviour/behaviour.js');
    Requirements::javascript('silverstripe-widgets/javascript/WidgetAreaEditor.js');

    return $this->renderWith("WidgetAreaEditor");
}

New widget shown on top, then moved at bottom after page save

When you add a new widget to the widgetarea it's put on top,
but after you save the page it's shown at bottom.

Easy fix: In /widget/javascript/WidgetAreaEditor, row 135, change:

('#usedWidgets-'+$(this).attr('name')).prepend(widgetContent);

To:

('#usedWidgets-'+$(this).attr('name')).append(widgetContent);

widget causes page ajax to not terminate correct

SS 3.0.3:
i assigned a widgetarea to a page and have 2 widgets available.

the widgets work but i cant open the page over the sitetree in admin because the ajax call wont terminate properly: just before the last the script seems to die and the json is not valid.
the server returns a 200 however!?

when reload the page or enter the url (/admin/pages/edit/show/7) i can access the page in admin!?
and the widgets tab with the widgets is shown.

any ideas?

Coding conventions

The module can be improved by following the SilverStripe coding conventions more closely.

Support lots of widgets on left hand side area editor. Scrollbar perhaps?

Original ticket: http://open.silverstripe.org/ticket/8348

When more than about 8 widgets are installed (through being on the file system), the left hand side of "available widgets" in the CMS creates a scroll bar, but you cannot drag the items to the right.

I suggest making the left and right hand side have independent scrollbars when they exceed their heights.

Secondly, if you drag the widget to any place underneath the right hand side, let it stick. Currently, you must drag it very close to an existing installed widget, which is poor usability.

Widgets not clickable or draggable

Hi,

I've got the CWP basic recipe installed and have installed a few modules. I've got the widgets module installed (currently named "silverstripe-widgets"). Widgets appear but are not clickable or dragable.

Another topic suggested I rename the folder to "widgets" (and run dev/build). After doing this I go to my widget section to find that there are no longer any widgets there.

Does anybody have any suggestions?

Thanks.

CMS Fields validation for widgets.

Is it possible to have validation for the fields found in the CMS for a specific widget.

I have tried the usual method for each Dataobject but it doesn't seem to be working.

public function getCMSValidator(){
}

Second widget on one page doesn't work

I use Silverstripe 3.0.3 stable release with the widgetmodule.
I've created several widgets wich function properly when used on a page.
But when I add several widgets to the same page the second widget fails.
I found out the functions are not being called of the second widget or that the objects not exist.

On this forum I also found this forum item:
http://www.silverstripe.org/widgets-2/show/20989
this seem to be the same problem.

Next to puting 2 widgets into one widgetarea, I also tried putting 2 widgetareas (each with one widget).
But that doesn't help.

It seems like 2 or more widgets on a page aren't possible.

Please! Make it work!!!!

DataObject error with Blog and Widgets modules

Alright, just did a clean install of SS 3.0.2 with the Blog (v0.6) and Widgets (v0.1) modules installed. Both modules were downloaded from the most recent master branch on GitHub. After that, if I attempt to edit a blog holder page, I get the following error while in dev mode:

Error at line 1304 of /framework/model/DataObject.php

Also, it appears that the Widgets module doesn't work at all. Not sure which module is the culprit but, either way, it's definitely a problem. :/

what about 3.0?

I see this is for 3.1.. can we still get to the 3.0 branch?

Need Help to Render the Widgets in frontEnd

Widgets are not showing on my page.
I have installed the Widget Modules
Created the flickerWidget and the widget added to Default Sidebar widgetArea
flickerfleds like PhotSet,UserID is set.

page.ss
<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
<article>
<h1>$Title</h1>
<div class="content">$Content</div>
</article>
$Form
$PageComments
<% loop $WidgetArea("Sidebar") %>
$WidgetHolder
<% end_loop %>
</div>
it is not showing the Flicker widget.

Translatable support: Widget's added to homepage don't have correct Locale

Migrated from http://open.silverstripe.org/ticket/6470

Adding widgets to the homepage in one language are not recognized in the non-default language. Fix is to add this code to sapphire/widgets/Widget.php . See http://www.silverstripe.org/widgets-2/show/11375

function onBeforeWrite() {

  parent::onBeforeWrite();

  // Set locale from the currently choosen language locale 
if ($this->Locale != Translatable::get_current_locale()) $this->Locale = Translatable::get_current_locale();
}

Insert Widgets into Footer

Sorry im new here - how would i allow widgets in footer?

I have my widgets created ie latest blog posts and gallery which work in sidebar...but stuck on footer?

Stef

Translations

They are sadly missing? I'm willing to start a german translation, trouble is: I have no idea how to do that. Some pointers in that direction would be appreciated.

Pages with widgets that have been duplicated generate notice on draft delete, breaks CMS hierarchy until browser cache flush

SS3.1.2-rc2
widgets - master branch, last commit: 2c08c17

To reproduce:
-Clean install w/ widgets module only, add generic Page extension
-Duplicate any page (not necessary to actually add any widgets)
-Delete draft (or save & publish, unpublish, delete draft)
*Notice appears, CMS SiteTree hierarchy controls disappear until browser cache flush (which often requires closing the tab or whole browser)

Maybe related to versioning?

Trace:
https://gist.github.com/clyonsEIS/1062e28c596ef6980ec0

UnsavedRelationList Error with ItemsToRender when no items to return

I get the following error when there are no widgets to return

[User Error] Uncaught LogicException: filter can't be called on an UnsavedRelationList

Trace
UnsavedRelationList->filter(Enabled,1) 
WidgetArea.php:59
WidgetArea->ItemsToRender() 
WidgetArea.php:33
WidgetArea->WidgetControllers() 
ViewableData.php:402

Using SS 3.2.3 and widgets 1.2.*@dev

Doest support has_many relationship

If you have a has_many relationship, it fails to work and show a tab to select from existing data object. Even if you try to add it "manually" in getCMSFields(), it still doesnt work, throwing errors like: Fatal error: Call to a member function FormAction() on a non-object in .... framework\forms\FormField.php on line 161

Suggestions for improvement/potential bugs

The project we are working on, we stop working on upgrading the SS on the old site, but keen on build a new one with latest SS and then move all content from the old site. Everything works fine, but when I implement the widgets module for blog by following the instruction below:

https://github.com/silverstripe/silverstripe-blog/tree/2.0.4
https://github.com/silverstripe/silverstripe-widgets/tree/1.1

it does not work well, it shows every widget but not managable. It should be dragable, dropable and managable. And my feeling tells me maybe the JavaScript is not running. But I have no idea how to fix it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.