Coder Social home page Coder Social logo

silverstripe-betternavigator's People

Contributors

3dgoo avatar andreaslang50 avatar andrewandante avatar anselmdk avatar bob-plastyk avatar chrispenny avatar edwilde avatar howardgrigg avatar jedateach avatar jonom avatar korthjp17 avatar mellm0 avatar michalkleiner avatar purplespider avatar sb-relaxt-at avatar thebnl avatar undefinedoffset avatar wernerkrauss avatar xini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverstripe-betternavigator's Issues

[Question] How does one add extra dev tool links in 5.4.1

I noticed that in the latest release (v6) that the template paths/namespaces were updated. But I am still using Silverstripe 4 and so I'm stuck with version 5.4.1 and cannot seem to figure out how to add extra links to the developer tools section

I have tried templates/JonoM/BetterNavigator/Includes/BetterNavigatorExtraDevTools.ss, templates/BetterNavigator/Includes/ BetterNavigatorExtraDevTools.ss and templates/BetterNavigator/BetterNavigator/Includes/ BetterNavigatorExtraDevTools.ss without any effect (and I made sure to flush after updating the template).

Am I using the wrong paths? Or does this have something to do with me trying to overwrite the template from my own module rather then the theme template folder?

Odd little line next to view draft

image
Left-top of the eye has an... interesting little line, which has confused me quite a few times, thinking my screen was dirty/having broken pixels

Version numbering?

Any chance we can start seeing some version numbering to be used with composer?

Semantic versioning would help to understand things about the module by just looking at the number. I've been trying to get in the habit with my modules. It pretty much comes down to creating a new tag on nearly each commit - unless you intentionally make a bunch of commits.

Template customisation namespace is wrong

Docs advise using e.g. templates/JonoM/BetterNavigator/Includes/ BetterNavigatorExtraContent.ss but code calls ->renderWith('BetterNavigator\\BetterNavigator'), so in fact if the templates are in a JonoM directory they get ignored.

Includes JS even if not rendered

afterCallActionHandler's check of DBHTMLText means there are multiple reasons BetterNavigator might not be rendered, and the js still included.

Not included on form response rendered with ->renderWith()

I'm likely doing something wrong but I have a form "InfusionInputsForm" that gets filled out, the FormAction function (calculateInfusion) then does a bunch of calculations and then returns return $arrayData->renderWith(['Infusion']);. That template is rendered correctly but the navigator isn't displayed.

I have defined a BetterNavigatorEditLink() in that pages controller that looks at the ID passed into the form and returns a URL to edit that object directly (i.e. not the page). I note that the URL remains the name of the form function localhost/page/InfusionInputsForm after submitting the form.

Just not sure where to go from here with regards to getting the navigator displayed. Thanks.

Make CMS Link work for Data Objects

Is there an easy way to make the "Edit in CMS" link work for a page displaying a DataObject? e.g. to take you to editing that DataObject in the existing ModelAdmin/GridField? (Currently, it just takes you to editing the page).

Conflicting template variables

I was recently working on a project that would break with better navigator because I had a member controller action. This is also a variable that the better navigator looks for in the global template variable space.

Can I suggest that the data rendered here be wrapped inside another ArrayData variable like BetterNavigatorData? The template will need to be adjusted accordingly.

This will ensure that BetterNavigator doesn't pick up controller/model functions/fields that users have defined.

I can't imagine this will break backwards compatibility because the BetterNavigator template is the one looking for these variables.

Isn't working?

Hi added this and did a build but doesn't appear to be working?

composer require jonom/silverstripe-betternavigator dev-master

Add locale parameter (e.g. ?l=de_DE) to "Edit in CMS" button for working better with the fluent module

Hi @jonom
thanks for the great work. While implementing your module for a client the question arised if it would be possible to directly send the user to the CMS with the correct locale set when working in conjunction with the fluent module. It would need to append the locale to the url as an l parameter. I know it's currently using the $EditLink call in the template, but I am unsure if it makes sense to overload that method (could it have other implications?) or do a conditional in the template directly. Perhaps you have more insights or thoughts on this. Thanks.

Position and translucent config feature

Hi Jono,

I have created a fork and a branch of this module for myself with some minor features. I thought I would share the changes with you in case you were interested in merging in any of these.

This is the branch:
https://github.com/3Dgoo/silverstripe-betternavigator/tree/feature/navigator-location-config

When I use the better navigator I usually drop it down to the bottom right of the site so it doesn't clash with the site navigation. I also make it semi-transparent when not active.

I've created this branch that allows us to set the position (left-top, right-top, right-bottom or left-bottom) through the config. If the config value is not set it defaults to right-top.

In the branch, we can also toggle the semi-transparent styling on and off through the config too.

Let me know if you're keen on using any of this. If not, all cool. Feel free to close this issue either way.

Thanks.

Navigator doesn't render on SS 4.1.0

The BetterNavigatorExtension->isAPage() function introduced in #27 doesn't return return true when $this->owner is a subclass of SiteTree.

Changing the function like so seems to work

 protected function isAPage() {
     return $this->owner
-        && $this->owner->dataRecord
-        && $this->owner->dataRecord instanceof SiteTree
-        && $this->owner->dataRecord->ID > 0;
+        && $this->owner instanceof SiteTree
+        && $this->owner->ID > 0;
 }

However, this causes another error

Emergency] Uncaught TypeError: Argument 1 passed to SilverStripe\CMS\Controllers\SilverStripeNavigator::__construct() must implement interface SilverStripe\ORM\CMSPreviewable, null given

Not sure what has changed between SS3 and SS4 with the functionality of extensions, but

protected function isAPage() {
    echo get_class($this->owner->dataRecord);
    exit;
    //...
}

prints JonoM\BetterNavigator\Extension\BetterNavigatorExtension

Newest release breaks links for sites in subfolder

In 2.1 if I had a site in e.g. locahost/foo, if I click on any of the links this is run on the subfolder. However on 3.0 it removes this, so instead of e.g. localhost/foo/dev/build it gets localhost/dev/build.

Empty templates $val .= '';

BetterNavigatorExtraContent.ss and BetterNavigatorExtraDevTools.ss are empty, so they render $val .= ''; on the page.

I realise this is really a bug in framework, but its kind of annoying when you just want to install the module.

PHP7: Methods with the same name as their class will not be constructors

Silverstripe 3.6 just released which supports php7. Running this module with php7 throws this deprecation error:

[Deprecated] Methods with the same name as their class will not be constructors in a future version of PHP; BetterNavigator has a deprecated constructor

Changing the BetterNavigator method to getBetterNavigator fixes this issue and does not break anything in template files.
Want me to do a PR?

Error on page controllers that don't have a model

Some controllers don't have an associated model, such as when registering for an event using the eventregistration module. It constructs a controller with no associated page.
The navigator breaks in these cases.

Mind you, this appears to be an issue with the default SilverStripeNavigator.

Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /...../cms/code/controllers/SilverStripeNavigator.php on line 28
Call Stack
#   Time    Memory  Function    Location
1   0.0006  283848  {main}( )   ../main.php:0
2   0.0521  9456776 Director::direct( ) ../main.php:176
3   0.0569  10344664    Director::handleRequest( )  ../Director.php:153
4   0.0594  10546192    ModelAsController->handleRequest( ) ../Director.php:367
5   0.1307  16381000    ContentController->handleRequest( ) ../ModelAsController.php:78
6   0.1389  17450936    ContentController->handleRequest( ) ../ContentController.php:179
7   0.1463  18214624    ContentController->handleRequest( ) ../ContentController.php:179
8   0.1468  18220160    Controller->handleRequest( )    ../ContentController.php:198
9   0.1666  18515784    RequestHandler->handleRequest( )    ../Controller.php:153
10  0.1810  19350520    ContentController->handleRequest( ) ../RequestHandler.php:222
11  0.1832  19358920    Controller->handleRequest( )    ../ContentController.php:198
12  0.1885  19362800    RequestHandler->handleRequest( )    ../Controller.php:153
13  0.1900  19500856    ContentController->handleRequest( ) ../RequestHandler.php:222
14  0.1922  19507400    Controller->handleRequest( )    ../ContentController.php:198
15  0.2557  24304960    RequestHandler->handleRequest( )    ../Controller.php:153
16  0.2561  24307456    Controller->handleAction( ) ../RequestHandler.php:200
17  0.2561  24308800    RequestHandler->handleAction( ) ../Controller.php:194
18  0.2561  24309152    EventRegisterController->index( )   ../RequestHandler.php:288
19  0.3099  26044984    SSViewer->process( )    ../EventRegisterController.php:92
20  0.3734  29543016    SSViewer->includeGeneratedTemplate( )   ../SSViewer.php:1064
....
29  0.5139  29965032    ViewableData->obj( )    ../ViewableData.php:403
30  0.5139  29965080    ContentController->SilverStripeNavigator( ) ../ViewableData.php:363
31  0.5159  30270368    SilverStripeNavigator::get_for_record( )    ../ContentController.php:307
32  0.5159  30270864    SilverStripeNavigator->__construct( )   ../SilverStripeNavigator.php:81
33  0.5159  30326696    __construct ( )

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.