Coder Social home page Coder Social logo

jzubero / silverstripe-sitetree-labels Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 55 KB

Label your Page items for better orientation in large SiteTrees :bookmark:

License: MIT License

PHP 92.94% Scheme 5.51% CSS 1.55%
silverstripe silverstripe-module sitetree-labeling labels sitetree

silverstripe-sitetree-labels's People

Contributors

jzubero avatar wernerkrauss avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

silverstripe-sitetree-labels's Issues

Add tests

It's missing some proper Behat/Codeception/Unit tests. Otherwise, looks pretty awesome!

Nested LI's not showing correctly in CMS

Hi! I am a huge fan of your module, cleans up our sitetrees very nicely, thank you for sharing!

I discovered a bug with nested sitetree items. The case I had was a root-level item, with subitems, and subsubitems. Whenever the root-level item was expanded (by clicking the little arrow and /admin/pages/getsubtree?ID=...&ajax=1 was called), the interface moved all subitem and subsubitems up one level in the interface. They weren't actually reparented (the database still showed them to be subitems of the correct parent), but the tree moved them up. I traced the origin of the bug back to a closing that apparently is not needed. So my solution was to change the LeftAndMain_TreeNode.ss to the following (basically I just removed the at the end ;-) ):

<li id="record-$ID" data-id="$ID" data-pagetype="$ClassName" class="$Classes"><ins class="jstree-icon">&nbsp;</ins>
    <a href="$Link" title="$Title.ATT"><ins class="jstree-icon">&nbsp;</ins>
        <span class="text">$TreeTitle</span>
        <% if $SiteTreeLabels %>
            <% loop $SiteTreeLabels %>
                <span class="sitetree-label" style="background-color: $Color">TT $Title</span>
            <% end_loop %>
        <% end_if %>
    </a>

This is in line with /framework/admin/template/Includes/LeftAndMain_TreeNode.ss (which also has no ending ). Could you incorporate this fix with the next version?

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.