Coder Social home page Coder Social logo

unclecheese / silverstripe-betternavigator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonom/silverstripe-betternavigator

0.0 1.0 0.0 75 KB

Front-end utility menu for SilverStripe websites featuring administration and development tools

Ruby 1.37% CSS 40.25% JavaScript 13.48% PHP 20.42% Scheme 24.48%

silverstripe-betternavigator's Introduction

BetterNavigator for SilverStripe

Diagram of module

This module is intended to replicate and expand upon the functionality provided by SilverStripe's built-in SilverStripeNavigator class. It provides a handy front-end menu for CMS users which offers these features:

For Content Authors

  • Indicates to a user that they are logged in
  • Indicates whether they are viewing draft or live content
  • Quickly edit the page you're viewing

For Developers

  • When in Dev Mode links are included for accessing most of SilverStripe's URL Variable Tools
  • Developers can access these tools on a live website by nominating themselves as a developer in the site config

Requirements

SilverStripe 4.0 (3.1+ through previous releases)

Installation

Composer / Packagist (best practice) Add "jonom/silverstripe-betternavigator" to your requirements.

Manually Download, place the folder in your project root, rename it to 'betternavigator' (if applicable) and run a dev/build?flush=1.

How to use

Just place $BetterNavigator somewhere in your template(s). If your website uses caching, make sure BetterNavigator's output is excluded.

Access developer tools on a live website You can mark certain CMS users as developers in your site's config, so they can access developer tools when logged in. Example YAML:

  BetterNavigator:
    developers:
      - '[email protected]'
      - '[email protected]'

Customisation

BetterNavigator's output is controlled by templates so it can be [easily overridden](http://doc.silverstripe.org/framework/en/topics/theme-development# overriding).

Option 1: Add some stuff

If you want to add some content (new buttons for instance) to BetterNavigator, just create a template called BetterNavigatorExtraContent.ss or BetterNavigatorExtraDevTools.ss and add your content to it. Place the template in the includes folder for your website's theme, or in mysite/templates/includes/ if you want to use it across multiple themes.

Option 2: Complete control

All content, scripts and CSS are loaded via the BetterNavigator.ss template, so you can completely customise BetterNavigator's front-end code by copying or creating your own BetterNavigator.ss template.

The BetterNavigator.ss template's scope is set to the page that is being viewed, so any methods available in your page controller will be available in the BetterNavigator.ss template. This should allow you to add custom links by page type and introduce complex logic if you want to.

Known issues

  • Probably won't work in IE8 or lower.

Bonus: better debugging tools

This module provide quick access to SilverStripe's built in URL Variable Tools but reading their output isn't much fun. You can peek under SilverStripe's hood much more conveniently using the recently released SilverStripe Clockwork by Mark Guinn. Out of the box SQL Queries and controller events are logged. It's Chrome only for now.

silverstripe-betternavigator's People

Contributors

jonom avatar 3dgoo avatar jedateach avatar andrewandante avatar anselmdk avatar undefinedoffset avatar korthjp17 avatar mellm0 avatar michalkleiner avatar sb-relaxt-at avatar bob-plastyk avatar wernerkrauss avatar

Watchers

James Cloos avatar

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.