Comments

joachim’s picture

I'm very busy on a D5-based project at the moment -- for which I coded this -- so I don't have time to work on a D6 version right now.
If someone makes a patch and it's tested I'll gladly do a D6 release!

ckidow’s picture

Maybe here is a starting point for a port... don't know... I've got no coding expertises but need a D6 verion at all. :)

http://drupal.org/node/363067

joachim’s picture

I'm not going to use that monster chunk of JS...

A module port to D6 involves:
- updating the .info file
- checking the API functions. There are only panel hooks here, so that's just checking the panels API docs.
- checking the JS works with the most recent Jquery -- it's very basic so that should be ok.

tsi’s picture

subscribing

joachim’s picture

This comment from from one of the panels maintainers: http://drupal.org/node/317523#comment-1229357 has details about the current status of panels...
Based on that, I'd say:

- Panels2 for D6 -- shouldn't be too complex like said above. But as Panels2 will be dead-ended I don't know how much point there is.
- Panels3 for D6 -- don't know how stable the API is for this right now.

I'll consider patches for both and I'm happy to branch twice. Sorry I don't have any time to work on this myself.

witzel’s picture

Just want to thank you for the work you did on the D5 module and encourage you to work on a module for Panels 3 D6. Unfortunately im not a coder and can't offer my help.

tim.plunkett’s picture

+1

joachim’s picture

Panels 3 is out now, so there's a stable base to build on.
However, I have no time to devote to this module at the moment. Patches will be accepted! :)

pimousse98’s picture

subscribing

robbertnl’s picture

Subscribing, I am using http://drupal.org/project/collapsiblock (Drupal 6.14 & Panels 3) in panels right now but I prefer using collapsing panels

srsbl’s picture

Subscribing.
In the case of the use of panels to display views, what I am doing is using a Viewfield placed within a group with fieldset-collapsible. When adding content to a panel select Node and then Field group. In "Field group label" choose Above and in "Field group format" then set to Fieldset-collapsible.

Daniel A. Beilinson’s picture

Status: Active » Needs review
StatusFileSize
new8.58 KB

Okay, I made a 6.x version. It's working, but very badly. There is some problems with this jQ code:

$(document).ready(function(){ 
    $('div.panel-display div.panel-pane-collapsible').each(function() {  
	  $(this).find('h2.pane-title').addClass('collapsed').next('.pane-content').css('visibility', 'hidden');													
      $(this).find('h2.pane-title').click(function() {
          $(this).toggleClass('collapsed').next('.pane-content').slideToggle('slow').css('visibility', 'visible');
		});
    });
  });

It's showing collapsible block when the page loading and then hide it.

Daniel A. Beilinson’s picture

And, of course, there is no problems if you want to make it non-collapsed by default, you need to change jq:

 $(document).ready(function(){ 
    $('div.panel-display div.panel-pane-collapsible').each(function() {  
	  $(this).find('h2.pane-title').addClass('collapsible').next('.pane-content').css('visibility', 'visible');													
      $(this).find('h2.pane-title').click(function() {
          $(this).toggleClass('collapsed').next('.pane-content').slideToggle('slow').css('visibility', 'visible');
		});
    });
  });

I can make it optional if you want.

joachim’s picture

Status: Needs review » Needs work

Thanks for working on this!

It works nicely, but I'm trying to figure out if we can have the initial state as a setting.

Interestingly, the hook_panels_style_info isn't being used by Panels' own style plugins, but it's getting called nonetheless via cTools.

Looking at includes/list.inc I can see how to define settings. I may try and figure those out, but anyone feel free to beat me to it :)

josepvalls’s picture

#13 worked fine for me too using Firebug, can't wait to see the proper module implementation.
I was just trying to figure out the layout plugins and I'll give it a try myself.

ManyNancy’s picture

Thank you all so much for working on this.

fuerst’s picture

G Gavitt’s picture

Thank you fuerst. I am using your example module with panels 3. I am using it for a collapsible embedded view with out any problems. Great tutorial as well.. powerful stuff.

joachim’s picture

That tutorial looks great.

If someone could take the time to integrate it with the work already here, I'll commit it.

chien_fu’s picture

...is excited. subscribing.

joachim’s picture

Well, I said if 'someone' does it. Until someone actually steps up and does it, it's not going to happen. I haven't time to work on this myself. If anyone wants to co-maintain this module that would be great too.

nigelcunningham’s picture

Status: Needs work » Needs review
StatusFileSize
new30 KB

I've just been working on this, and have a version that needs review, please.

I'd really rather implement this as an extra attribute in the Panels Stylizer module, but haven't done that yet (I'm not sure if it's possible yet).

nigelcunningham’s picture

Oh, I should have mentioned: this version uses cookies to record what is expanded/collapsed.

bryancasler’s picture

StatusFileSize
new288.25 KB

NigelCunningham, gave your module a shot but it had malformed output.

The fieldset titles were all printed together, even the ones that didn't have content.

Then below that the fieldsets with their titles *again* and their content were printed.

Attached is a screen shot.

bryancasler’s picture

Nigel I found the following ctools plugin that works out of the box.

http://manueg.okkernoot.net/blog/200910/how-create-panels-style-plugin

File: http://manueg.okkernoot.net/sites/default/files/ctoolsplugins.tar.gz

It works perfect except that it displays fieldset headers even when the fieldset content is empty. I don't know if you would be able to do anything about that, but that addition would make this work perfectly.

bryancasler’s picture

Sorry for so many post, this will be the last one.

I think around line 57 in collapsible.inc would be the place to make it not print anything if the content is empty

nigelcunningham’s picture

That plugin didn't work for me, and my one works perfectly :) Perhaps we're running different versions of Panels and Ctools? I have Ctools 6.x-1.x-dev (2010-Nov-02) and Panels 6.x-3.8.

bryancasler’s picture

Thanks for your response NigelCunningham

I upgraded ctools to (6.x-1.x-dev Nov-02) and panels to (6.x-3.8) tonight.

The solution I was using in #25 no longer works, just like you mentioned in #27.

I went ahead and installed your module (#22) to give it a try, but its not working either. The option for "Collapsing" is showing up under the style menu for me to apply, but when I view the node nothing has changed. Unfortunately I'm not getting any error output, so I can't offer much more feedback than that. Have you had any problems?

bryancasler’s picture

So it's late and I was editing the wrong panel :) No wonder there was no effect.

Now I have updated the correct panel, and it's still not working. It is however having an effect on the output.

<div class="panel-pane-collapsible">
<div class="panel-pane pane-node-body">
<div class="pane-inner">
<h2 class="pane-title">Event Description</h2>
<div class="pane-content">
...
</div></div></div></div>

It's also adding panels_collapse.css, collapse.js and panels_collapse.js

Here is a 18 second screencast showing the output.
http://www.screencast-o-matic.com/watch/c6XTQl68H

nigelcunningham’s picture

It looks like you still don't have the style applied. If I do the same thing with a pane on http://crca.org.au, I see that the heading has classes 'collapsible collapsed', whereas yours doesn't.

bryancasler’s picture

Double checked everything and I'm still not certain what could be causing the dysfunction.

Are you sure you are using exactly what you uploaded in #22? Didn't happen to make any changes on it?

Also I'm running jQuery Update 1.3.2 and jQuery UI 1.7.3, not sure if that would have an impact.

bryancasler’s picture

I was able to get everything working by removing cookie support in panels_collapse.js

$(document).ready(function() { 
  $('div.panel-display div.panel-pane-collapsible').each(function() {
    $heading = $(this).find('h2.pane-title');

    $collapsed = 1;
	
    $heading.addClass('collapsible').next('.pane-content').css('visibility', 'visible');

    if ($collapsed)
      $heading.toggleClass('collapsed').next('.pane-content').hide();

    $heading.click(function() {
      $(this).toggleClass('collapsed').next('.pane-content').slideToggle('slow').css('visibility', 'visible');
    });
		
  });
});
elektrorl’s picture

#22 + #32 JS code: working. Thanks a lot !

nigelcunningham’s picture

Hmm. Without the cookie support, it won't remember your settings between sessions.

joachim’s picture

If someone can roll all this as a patch, I'll start a 6--1 branch, commit it, and roll a dev release, so it's easier for everyone to try the code and continue working on it.

ayalon’s picture

StatusFileSize
new4.83 KB

I made a patch for Drupal 6.

I had to change the css class to something general. I'm using the fusion theme, and the div.panel-display class is not available there. Additionally, I better integrated the javascript in th Drupal way.

I expect now a new re-roll from the maintainer as promised above.

joachim’s picture

Status: Needs review » Needs work

Patch doesn't apply I'm afraid -- I'm getting most of the hunks failing.

===================================================================
--- sites/all/modules/panels_collapse/panels_collapse.css	(revision 3561)

Remember to roll patches from the module base folder.

+++ sites/all/modules/panels_collapse/panels_collapse.css	(working copy)
@@ -1,15 +1,15 @@
-div.panel-display div.panel-pane-collapsible h2.title {

Hmmm... what does Fusion do that removes the class we're expecting? I'm inclined to say it's not our problem.

+++ sites/all/modules/panels_collapse/panels_collapse.info	(working copy)
@@ -1,11 +1,8 @@
-; Information added by drupal.org packaging script on 2009-02-01
-version = "5.x-1.1"
...
+version = "6.x-1.0"
+project = "panels_collapse"
\ No newline at end of file

You don't need to reproduce this part.

+++ sites/all/modules/panels_collapse/panels_collapse.js	(working copy)
@@ -1,12 +1,17 @@
+Drupal.behaviors.panels_collaps = function() {

Missing 'e'.

+++ sites/all/modules/panels_collapse/panels_collapse.module	(working copy)
@@ -1,34 +1,40 @@
+ * Implementation of hook_panels_style_info().
  */
 function panels_collapse_panels_styles() {

Hooks documentation doesn't agree with declaration.

+++ sites/all/modules/panels_collapse/panels_collapse.module	(working copy)
@@ -1,34 +1,40 @@
-      'render pane'      => 'panels_collapse_style_render_pane',
+      'render pane'      => 'panels_collapse_style_render_pane',	  ¶

Watch out for whitespace.

+++ sites/all/modules/panels_collapse/panels_collapse.module	(working copy)
@@ -1,34 +1,40 @@
 /**
+ * Render callback.
+ */
+ ¶
+ /**

Here too.

+++ sites/all/modules/panels_collapse/panels_collapse.module	(working copy)
@@ -41,14 +47,17 @@
  */
+ // Private functions.
+
+/**
+ * Adds the .js file only once per page load.
+ */
 function _panels_collapse_add_js() {

Not sure what is going on here.

Powered by Dreditor.

bryancasler’s picture

This is a working version I cobbled together a while back.

http://min.us/mvoiXGY

bryancasler’s picture

If anyone is able to, I'm starting a D7 discussion over here.

#1108620: Drupal 7.x version?

joachim’s picture

StatusFileSize
new3.65 KB

The code from #38 looks okay, but it needs a few things fixing:

- JS variables should not have an initial $
- I don't understand why you're doing this: $heading.addClass('collapsible')
- some module functions are missing headers
- we're missing a hook_theme -- surely it won't work without that? Or does Panels register it for us? If that's the case, the code needs a comment to prevent a WTF.
- please watch for Windows line endings!

Since I've got the code, I've stuck it on top of the current 6.x and made it into a patch, attached here.

Now if people could move this forward to something I can commit that would be great.

amitaibu’s picture

just note there's the module -- http://drupal.org/project/panels_dashboard

Tafa’s picture

okay, i just tried it and it works perfect so far...so thanks for the hint...
t

chriszz’s picture

Version #38 works for me. I did not find a way of using the dashboard in mini panels, so I preferred the simple Style Plug. Eventually I am going to test the patch in #40.

Regards
Christian

ann_meredith’s picture

sub

pbfleetwood’s picture

+1

djg_tram’s picture

At the beginning of the JS, there is a line:

$('div.panel-display div.panel-pane-collapsible').each(function() {

The div.panel-display is wrong, it should be removed:

$('div.panel-pane-collapsible').each(function() {

It is not necessary, the second div finds the tag all right. But the real problem is that it breaks the module on custom flexible panels, it only works on the stock panels. With it removed, it works in both cases all right.

djg_tram’s picture

StatusFileSize
new579 bytes

A simple approach to make the default state selectable. The default is initially expanded. For all panes that need to be collapsed by default, use the CSS settings of the pane (right corner gear icon) and assign the class name pane-collapsible-collapse-default.

wxman’s picture

Just adding my 2 cents. I've been trying out ways to improve my mobile version of my site, including collapsing DIV's to save space. I first tried one from this article: http://manueg.okkernoot.net/blog/200910/how-create-panels-style-plugin. It works, but it causes warnings about version problems. Next I tried using #38 along with #47 and I'm getting better results and no errors. It works perfectly on my Android phone.

nirvanajyothi’s picture

subscribing

WorldFallz’s picture

Issue summary: View changes
StatusFileSize
new1.93 KB

I also used http://manueg.okkernoot.net/blog/200910/how-create-panels-style-plugin to get this going. Seems to be working fine without any error or warnings. Attached for anyone who wants to use. If you're willing to consider a patch for it (it's completely different than the way this module works by rolling its own js), let me know and I'll roll one.

kenorb’s picture

Status: Needs work » Closed (won't fix)
WorldFallz’s picture

Status: Closed (won't fix) » Active

imo the maintainer should make that call. And also, I'm willing to take over maintainership of the module if need be.

kenorb’s picture

Status: Active » Needs review

The module is 3 major versions behind (most of the modules are now implementing 8.x core), so I don't know even if it would be possible to have version 6.x (which is already depreciated), or it should be version for 8.x first. If there was no progress for over 3 years, I don't think it will going to happen. So I think people should use some alternative modules.

But you actually attached 6.x version in #50, so I think people should review it then.

WorldFallz’s picture

D6 is not deprecated yet-- and there is talk about keeping around partially supported even after d8. D8 isn't released yet, but even if it was I don't think it's reasonable to expect contrib maintainers to first create d8 branches before doing anything for previous versions. If there was a d8 branch, then yes, it's usually done at the newest point first and then back ported.

And there is progress-- I just just created and posted a working module. I'm stuck with a d6 site likely unless d8 comes out so I regularly maintain d6 modules I use.

joachim’s picture

Attached zipfile looks good, apart from just one formatting issue:

/**
  * Implementation of hook_ctools_plugin_directory().
  */

@WorldFallz: I've granted you maintainer access. Feel free to start a D6 branch, commit your code, make a D6 release, and update the project page :)

WorldFallz’s picture

awesome... thanks joachim! That's great. I'm in the process of adding an additional style option use this awesome jquery plugin. Once that's done I make a d6 dev branch.

WorldFallz’s picture

Assigned: Unassigned » WorldFallz

  • WorldFallz committed 6464d40 on 6.x-1.x
    Issue #365519 by WorldFallz, Daniel A. Beilinson, NigelCunningham,...
WorldFallz’s picture

Status: Needs review » Fixed

In the interests of getting something committed asap, I've gone ahead and committed the code from #50. I'll add the jquery plugin version as a different style when it's ready.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.