Is there any plan to port this module to drupal 8?

CommentFileSizeAuthor
#2 jquery_expander.zip10.55 KBkarens

Comments

bloomt created an issue. See original summary.

karens’s picture

StatusFileSize
new10.55 KB

I wanted to try this out for a Drupal 8 site, so I did a D8 port of this module. I've attached it if anyone else wants to try it out or the maintainer wants to use it. It's identical to the D7 version except I added a couple more setting from the library to allow you to control the classes on the Expand and Collapse links.

karens’s picture

Status: Active » Needs review

Marking this "Needs review"

karens’s picture

I moved the code to Github so it can be updated if necessary until some action is taken here. There is no intention to maintain it there, just to make the code available until this module is ported. See https://github.com/karens/jquery_expander.

karens’s picture

With the additional settings, it is possible to style the expand/collapse links as buttons, add icons, etc. For instance, using Bootstrap, you can use the following settings for fancy buttons:

Expand text:
Expand <span class="icon glyphicon glyphicon-plus"></span>

Collapse text:
Collapse <span class="icon glyphicon glyphicon-minus"></span>

More link class:
btn btn-lg btn-primary

Less link class:
btn btn-lg btn-primary
jeffschuler’s picture

Status: Needs review » Reviewed & tested by the community

This is working great KarenS. Thanks!
It'd be great to have the library installation done with composer, but it works fine manually. RTBC; let's get this up.

mattjones86’s picture

Status: Reviewed & tested by the community » Needs work

I'm seeing lots of warnings in my logs because this theme hook is not defined in the module file:

https://github.com/karens/jquery_expander/blob/master/src/Plugin/Field/F...

Is it supposed to be? Or is it supposed to be using a different theme hook?

jeffschuler’s picture

@mattjones86: You can remove that line:'#theme' => 'jquery_expander', as the render array is just using #markup.

jeffschuler’s picture

Status: Needs work » Reviewed & tested by the community

Moving back to RTBC, in case a maintainer has an eye on this queue.

Looks like these are other module options: