Development of collapsible forum containers functionality.

I think it would be cool to develop it with JS or JQuery. Michelle told me that JQuery would be the Drupal way. I will concentrate og figuring out JQuery and how to implement it with the advanced forum module.

Related resources: http://drupal.org/node/202542

CommentFileSizeAuthor
#344 advanced_forum_collapsible-slide_291084_344.patch2.9 KBWorldFallz
#340 collapsible-291084-340.patch3.71 KBa.ross
#326 advanced_forum_collapsible_fix-css_291084_326.patch802 bytesWorldFallz
#317 advanced_forum_collapisble_291084_317.patch11.01 KBWorldFallz
#269 advanced_forum_collapisble_291084_269.patch7.46 KBWorldFallz
#269 advanced_forum.js_.txt5.48 KBWorldFallz
#241 advanced_forum_collapisble_291084_241.patch7.72 KBWorldFallz
#241 advanced_forum.js_.txt5.51 KBWorldFallz
#227 advanced_forum_collapisble_291084_227.patch7.18 KBWorldFallz
#227 advanced_forum.js_.txt5.48 KBWorldFallz
#215 advanced_Forum_7_2.js_.txt3.75 KBtroky
#211 advanced_forum_7__1.js_.txt3.68 KBtroky
#202 advanced_forum.js_.txt1.11 KBWorldFallz
#198 advanced_forum_collapsible_containers_291084_198.patch5.25 KBWorldFallz
#198 advanced_forum.js_.txt1.12 KBWorldFallz
#171 advanced_forum_291084_171.patch6.95 KBWorldFallz
#170 advanced_forum_291084_170.patch1.76 KBWorldFallz
#166 advanced_forum_291084_166.patch1.14 KBWorldFallz
#148 advanced_forum_collapsible-containers_291084_148.patch4.5 KBWorldFallz
#148 minus.png2.75 KBWorldFallz
#148 plus.png2.75 KBWorldFallz
#145 advanced_forum_collapsible-containers_291084_145.patch4.54 KBWorldFallz
#144 advanced_forum_collapsible-containers_291084_144.patch4.48 KBWorldFallz
#143 advanced_forum_collapsible-containers_291084_143.patch4.48 KBWorldFallz
#143 arrows.zip4.08 KBWorldFallz
#138 advanced_forum_collapsible-containers_291084_137.patch3.95 KBWorldFallz
#129 advanced_forum-291084.patch1.36 KBapanag
#90 advf-collapse-2.patch2.01 KBcridenour
#83 advf-collapse.patch6.05 KBcridenour
#68 advanced_forum.js_.txt657 bytesgrn
#61 advanced_forum.js_.txt400 bytesgrn
#54 advanced_forum.js_.txt408 bytesgrn
#45 advanced_forum.js_.txt552 bytesgrn
#33 2008-08-29_advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch7.15 KBgrn
#8 collapsible_forum_containers-description-old.txt2.17 KBgrn
#8 advf-forum-list.tpl_.php_.txt5.01 KBgrn
#8 advanced_forum.module.txt35.99 KBgrn
#8 2008-08-20_advforumcollapcontainers.zip14.28 KBgrn
#8 advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch4.94 KBgrn
#8 2008-08-23_advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch5.46 KBgrn
#8 2008-08-24_advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch6.92 KBgrn
#8 2008-08-29_advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch7.15 KBgrn
#2 advf-forum-list.tpl_.php_.txt4.66 KBgrn
#17 2008-08-12_plusminus_bogus.jpg30.9 KBgrn
#17 advf-forum-list.tpl_.php_.plusminus_bogus.txt6.04 KBgrn
#6 minimize.gif64 bytespsicomante
#6 maximize.gif67 bytespsicomante

Comments

michelle’s picture

Thanks for doing this. :)

Michelle

grn’s picture

Version: 5.x-1.0-alpha10 » 6.x-1.x-dev
Status: Needs review » Active
StatusFileSize
new4.66 KB

The first version of the collapsible forum container can be previewed here: http://grn.dk/drupal02/forum

I have only modified the advf-forum-list.tpl.php (attached), with a comment "collapsible container" every time I have modified something. This means that this is pretty ugly at the moment and the jQuery feature is static, inline, and it's only being tested on a forum with only 0-level/depth containers. There is some inline CSS that must be moved.

Next I will add a description of what I have done and a todo list.

Any comments or improvements are always welcome :-)

psicomante’s picture

wonderful! Can we add +/- icons?

michelle’s picture

Status: Active » Needs review

Changing status so I can find it easier. It may be a bit until I can get to this, unfortunately.

Michelle

grn’s picture

Hey Psicomante

Yes.

psicomante’s picture

StatusFileSize
new67 bytes
new64 bytes

Modified the two parts of this file. Attached images. I've learned a bit of jquery to make this patch, i hope that this "patch" is not so bad :)

I'm thinkin a way to add automatic ID and function to the containers. Icons path should be dynamic also (i think drupal_path functions or similar are the correct functions...i'll see API)

<div class="name"><a href="<?php print $forum->link; ?>"><?php print $forum->name; ?></a> <?php if ($forum->is_container) print "<span id=\"containerID-".$container."\" style=\"margin:0 1em 0 0; float: right;cursor: pointer;\"><img id='toggleImage-".$container."' src='sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif'></span>";?><!--collapsible container--></div>
//collapsible container jQuery
drupal_add_js (
    
		'$(document).ready(function() {
    	$(\'#containerID-1\').click(function(){
        $(\'.forum-child-1\').toggle();
        if($(\'img#toggleImage-1\').attr("src") == \'sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif\'){
          $("img#toggleImage-1").attr("src","sites/all/modules/advanced_forum/themes/advforum/images/maximize.gif");
        }else{ 
          $(\'img#toggleImage-1\').attr("src","sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif");
        }
      });
  		return false;
		});',
		'inline'
);
grn’s picture

Hey Psicomante, it looks nice.

I tried it out.

Please validate your content at: http://validator.w3.org/

grn’s picture

I have attached a description of the patch so far.

To do list:

At all times respect the markup: Doctype: XHTML 1.0 Strict. Show how it works at a test site, currently at http://grn.dk/drupal02/forum , and adv forum settings at http://grn.dk/drupal02/admin/settings/advanced-forum.
At all times respect the development and don't make changes that ruin the current features (unless this is agreed by majority).

  • Complete: 2008-08-10: Make the jQuery dynamic by counting forum containers at the beginning.
  • Complete (Wrong assumption): 2008-08-12 Figure out how to do this with multiple container levels. I think this works pretty well at the current state. Forums at all container levels are collapsible. Containers should never collapse (correct me if it's stupid ;-) ).
  • Complete: 2008-08-17 (Added array at settings page): Setup simple initial collapsing options.
  • Complete: 2008-08-20 (Added a ZIP file with the modified files):Put the CSS in the CSS files: advanced_forum.css and advanced_forum-structure.css.
  • Put the jQuery somewhere nice?
  • Complete: 2008-08-21 (Added the advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch): Make a working patch. Apply it with patch -p0 < advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch from the sites/all/modules folder
  • Complete: 2008-08-23 (Added the 2008-08-23_advanced_forum_6.x-1.0-alpha2_collapsible_containers.patch): Remember collapse settings with cookies. This patch needs jQuery Cookie (http://plugins.jquery.com/project/cookie) which can be implemented through the Drupal module jQuery plugins (http://drupal.org/project/jquery_plugin). At this time it is required to save http://plugins.jquery.com/files/jquery.cookie.js.txt as jquery.cookie.min.js in the drupal module folder jquery_plugin.
  • Complete: 2008-08-24: Icons added (change setting in advanced forum settings), remember to add maximize.gif and minimize.gif form (#6). The container table row is clickable, thanks to (http://codex.gallery2.org/GMC:Website:Collapsible_Forum_Containers).
  • Find a nice way for users to specify which folders to collapse as default.
  • Implement further improvements.

Hmm I thought I could put this to do list at the top.... but failed. The description is not editable.

Note, the up to date files for my dev are here at comment #8.

michelle’s picture

Very nice! Don't worry about making a patch top priority. I have some client work I need to do before I can work on the module again so it'll be a while before I can get it in anyway.

Thanks!

Michelle

michelle’s picture

Ok, so I was supposed to do some client work this weekend but worked on advforum instead. So I got a bunch of stuff fixed and want to make a new set of alphas sometime this week. Any ETA on this? Do you think it will be ready to be included?

Thanks,

Michelle

grn’s picture

Hey.

I expected some more interest from others to support the development. It was intended as a kickstart. I will be working on this, but I don't think I will finish this week.

It could be included as it is. What do you need?

Thanks.

michelle’s picture

Getting others to support development beyond saying "+1" can be hard... That's why I'm excited that you took on this part. ;)

If you think it's at a usable point, I just need the current code.

Thanks :)

Michelle

grn’s picture

For forum containers at level zero it works pretty fine.

The current code is in #8 (advf-forum-list.tpl_.php_.txt). Please specify if it should be presented to you otherwise.

psicomante’s picture

did you add my patch?

grn’s picture

I will add the patch if someone makes it XHTML valid.

psicomante’s picture

done it!

<div class="name"><a href="<?php print $forum->link; ?>"><?php print $forum->name; ?></a> <?php if ($forum->is_container) print "<span id=\"containerID-".$container."\" style=\"margin:0 1em 0 0; float: right;cursor: pointer;\"><img id='toggleImage-".$container."' src=\"sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif\" alt=\"Show or hide the forum\" /></span>";?><!--collapsible container--></div>
//collapsible container jQuery
drupal_add_js (
    
		'$(document).ready(function() {
    	$(\'#containerID-1\').click(function(){
        $(\'.forum-child-1\').toggle();
        if($(\'img#toggleImage-1\').attr("src") == "sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif"){
          $("img#toggleImage-1").attr("src","sites/all/modules/advanced_forum/themes/advforum/images/maximize.gif");
        }else{ 
          $(\'img#toggleImage-1\').attr("src","sites/all/modules/advanced_forum/themes/advforum/images/minimize.gif");
        }
      });
  		return false;
		});',
		'inline'
);
grn’s picture

Nice work with the validation Psicomante.

We have an additional problem before this is applicable. We must have an intelligent way to identify which containers are collapsed or else we can get a problem with the +/- icons (attached: 2008-08-12_plusminus_bogus.jpg). The whole fun part about this patch is initially to collapse some or all containers. Your part assumes that all forums are uncollapsed.

*EDIT* I have attached advf-forum-list.tpl.php.plusminus_bogus.txt.

psicomante’s picture

i thought about it yesterday. I think there's a better way to do this: using css classes and recycle code from collapse function.

jannalexx’s picture

Version: 6.x-1.x-dev » 5.x-1.0-alpha10

#18
advf-forum-list.tpl_.php_.plusminus_bogus.txt
tested and also have the same issues/bugs

a nice implementation is here
http://gallery.menalto.com/forum

you can think some code functions to use "all shown" at the beginning or "all hidden" or "hide some individual" containers by an array of numbers for eatch container (eg 1,5,6,8...) for each forum list in that order
every new container can also follow a rule (new collapsed or shown) and then if needed, it can be included manualy in the code as (last) number in the array, just a simple idea.

grn’s picture

Version: 6.x-1.x-dev » 5.x-1.0-alpha10
Status: Active » Needs review

Gallery has a nice forum. We should spend more time studying it. We could apply some of the features as described here: http://codex.gallery2.org/GMC:Website:Collapsible_Forum_Containers

Remark, status and my latest dev files can be found at #8 (http://drupal.org/comment/reply/291084#comment-957056).

I will look into making a "real" patch now.

michelle’s picture

Yeah, the Gallery forums have long been an inspiration to me. I actually have a copy of their theme from a while back so I could look at the custom code in the forum. (Not allowed to give it out, though.)

Just so you know, I'm not ignoring this issue. Just need to get the style revamp done before I can implement this.

Michelle

grn’s picture

Version: 5.x-1.0-alpha10 » 6.x-1.0-alpha2

I have added jQuery Cookie to remember collapse states of the containers (at #8).

It works fine in Firefox 3.01, but in Opera 9.50 the cookies are lost after browser restart (probably a strange browser setting).

Please report any errors encountered and guide me in the right direction, because I think the code I have written sucks ;-)

Next I am hoping to get the adv_forum settings page to display all containers and the abillity to collapse at default (not only all collapsed or expanded). I need to get the names and number of containers from the forum list at module level. I could use a hint from Michelle here or somebody else :-)

grn’s picture

Collapsible forum Status

Settings:

  • Choose collapse state: All collapsed (default); None collapsed
  • Use icons?: Yes (default); No
  • New features:

  • Icons added.
  • Container table row is clickable.
  • At #8 (http://drupal.org/node/291084#comment-957056).

    psicomante’s picture

    Great work! Are you sure to make jquery_plugin Module a "dependence" (i'm not sure this is the correct term)?

    Are there the last patched files?

    grn’s picture

    Hey.

    1) jQuery plugin module is required to get jQuery cookie to work. I am not sure I have answered your question?

    2) I am not providing patched files anymore only patches. I am thinking of the unnecessary traffic.

    michelle’s picture

    grn - Sorry, I missed your question. The forum container names can be gotten with variable_get('forum_containers', array());

    Michelle

    grn’s picture

    Thanks, I will look into it.

    michelle’s picture

    Version: 6.x-1.x-dev » 6.x-1.0-alpha2

    Just want to say thanks for your continuing work on this. I don't want you to get discouraged that it's not in, yet. I will add it. Just getting time to work on advforum has been rough lately. :(

    Michelle

    psicomante’s picture

    Find a nice way for users to specify which folders to collapse as default.

    The only way that i find is: save on profile or in other table a array of collapsed forum for every users. Mmmm is this so necessary?

    @grn. I saw the todo list, but i haven't tried the patch yet. Is there something doesn't work?

    grn’s picture

    Michelle don't worry about that :-) I just needed this for my own benefit ;-)

    Psicomante - I will add an option for admin to customize wich containers to collapse from the settings page. The latest version of the patch should work pretty well. I don't know about the cookies in some browsers. The adv forum will depend on jQuery plugins if this is implemented as it is. The big problem is that jQuery isn't quite ready for this yet. jQuery Cookie isn't implemented in jQuery plugins (http://drupal.org/node/298847). jQuery plugins will implement jQuery Cookie if the jQuery module is merged with jQuery plugins. The jQuery Cookie module won't answer my request. The status is random ;-) (http://drupal.org/node/298962).

    grn’s picture

    Find a nice way for users to specify which folders to collapse as default.

    I am trying to get the forum container names from forum_containers.

    $containers = variable_get('forum_containers', array());
      foreach ($containers as $container)echo $container." <br />";
    

    But I am missing something here..... (not $container.. but something like $container->name).

    michelle’s picture

    I'm getting close to being ready to tackle this but I'm confused on which code I should be using. Could you add a new comment with the latest code when you get a chance?

    Michelle

    grn’s picture

    This is the latest patch.

    jannalexx’s picture

    what about 5.x ?

    grn’s picture

    You could check out the patch, and try to implement the same changes to 5.x. I won't support 5.x...

    michelle’s picture

    Status: Needs review » Needs work

    Ok, I spent quite some time tonight trying to work this patch in. Unfortunately, I can't use it as is so I've been trying to understand how it all works and put the pieces in the proper spots. I ran out of time tonight and don't want to commit my half done mangled mess but I wanted to let you know that I am at least working on it. :)

    Michelle

    michelle’s picture

    Ok, I've spent about two hours on this and I can't afford to take any more time for it right now. I appreciate your work, but this patch just isn't usable as is. Part of that is my fault as I've changed the .tpl so it doesn't apply but even besides that there are too many issues:

    • The code doesn't conform to Drupal's coding standards
    • Adding an option just for whether they want to use icons in this one spot isn't going to work. That should be handled in the theming. Also, image paths can't be hardcoded.
    • There is a huge chunk of code being added to the top of the .tpl. Template files should have minimal amounts of code. This needs to be worked into the preprocess code as much as possible or into the existing foreach array in the template for anything that can't be put in the preprocess.
    • jquery code is normally put in a seperate .js file. I don't know jquery so maybe there's some reason why this needs to be inline but, if at all possible, it should be separated out.
    • <a onclick="event.cancelBubble = true" doesn't appear related to this issue.

    I realize you did this for your own use and I understand if you don't want to take the time to fix it up for general use, but it would be great if you could since this is a feature I'd like to have included.

    Thanks,

    Michelle

    michelle’s picture

    Actually, hold that thought. I was thinking about this in the shower and I think I have a much easier way to do this. My knowledge of jquery is rudimentary but I think it will work. I can't try it out until later today, though.

    Michelle

    grn’s picture

    Hey.

    I didn't know the Drupal coding standards, so it isn't the way it should be. One standard that annoys me is the "two space" tab, which I will fix in the future with search and replace. It's cool to have standards, but what it is the reason for this (out of topic - ignore ;-) )?

    I put the jQuery inline because I didn't/don't know how to include it otherwise.

    The goal is to implement this feature in the official advanced forum release, so it will be easier for me to maintain ;-)

    I can work on the issues you mentioned if you like.

    michelle’s picture

    Ok, I worked on this some more during nap time. I don't know jquery, but I have a general understanding of how it targets things so hopefully the changes I made will be helpful.

    • Added advanced_forum.js. You can put your functions in here and they will be included.
    • Added your icons as container_close.gif and container_open.gif in the naked style.
    • Added a class to each container of "container-N" where N is the TID of the container. I used the TID rather than its position so settings will still work even if they get moved around. Plus it will make it easier to specify a list of open/closed containers in admin at some point.
    • Added a class to each forum of "in-container-N" where N is the TID of the containing container. There is a bug at the moment where you end up with just "in-container-" for forums at root. I plan to change that to "in-container-none".
    • Added <span id="collapse-toggle-N"> where N the TID of the containing container. This is for adding the +/- like you have in your class.

    These changes are in CVS and will be in the tarball in about 3 hours. I haven't added any of the jquery at this point. I'm hoping you can use these classes to target your jquery. If you're willing, I'd like to work together on this and have you write the jquery and just tell me what you need in the PHP end and I will make it happen. If you need more classes to be able to target things better, just let me know.

    BTW, I read the Gallery page and figured out what that bubble bit was for. :)

    Thanks again for your work on this. My intent isn't to just discard all your work. In fact, I've spent quite a bit of time studying it and trying to figure out what you did but the jquery is just beyond me at this point.

    Michelle

    grn’s picture

    Thats Cool.

    I don't have a personal relationship with my code. I just wan't things done :-)

    I would be happy to work together with you on this. I think I will have some time tomorrow to work on this.

    By the way, the icons (and most icons code) are provided by Psicomante.

    michelle’s picture

    Sounds great. I'll make sure to add credit for the icons to Psicomante. I've got a second issue about documenting icon sources so it will be taken care of with that.

    Michelle

    psicomante’s picture

    Thanks grn, but my work was very simple related to yours. Anyway i'm thinking about providing better icons for minimize and maximize. When they will be ready, i'll attach them here.

    grn’s picture

    Hmm, I have been working on this issue today.

    I am not sure I have the right solution for this.

    I figure that I we will need "something" to generate the dynamic jQuery code.

    At first we could make something like this in advanced_forum.js:

    $("#forum-list-N").click(function() {
      $(".in-container-N").toggle()
      if($.cookie("cookie_container-N") !== "collapsed") {
        $.cookie("cookie_container-N", "collapsed");
      }
      else {
        $.cookie("cookie_container-N", "expanded");
      }
    });
    

    Where N should be the tid, but how can I fetch that from the javascript file? Or should the jQuery functions be fetched by the php code somehow in the preprocess?

    An other issue is to get jQuery cookie included. How do we plan to do that? In the old version it was handled by: jquery_plugin_add("cookie");

    grn’s picture

    StatusFileSize
    new552 bytes

    I have attached a hardcoded .js. Collapsing works fine as far as I can test. The cookie function is not working.

    michelle’s picture

    I tried rustling up someone on IRC that can help with this. No luck so far. Will try again this afternoon. I'm headed out of the house for a while.

    Michelle

    cridenour’s picture

    Well you could generalize the function and set an event listener on the elements you want for the onclick (meaning it doesn't have to be a link/image - things like table rows should work)

    I think to create that function for each topic would be bad, bad, bad.

    neclimdul’s picture

    yuck... cookies everywhere? your users have to send those to the server on every request.

    There's got to be a better way.

    grn’s picture

    Hmm I am not folowing you?

    We aren't working on a function for each topic, it is bound to each container ID and every forum in that container as a CLASS.

    It's cool that you think it's bad and yuck and you think there is a better way. Nobody has done it here before, but all suggestions are welcome.

    By the way, the php working with javascript could be done with ajax, but i haven't worked with that yet.

    cridenour’s picture

    grn:

    You asked how you could avoid hard-coding each collapse/expand call. I suggest making it a static function.

    grn’s picture

    cridenour - I don't know how this should work when the containers are dynamic. I think i am focusing in the wrong direction and this blinds my imagination.

    michelle’s picture

    I'm rather working in the dark because I only have a theoretical knowledge of jquery, but...

    How about if I put some sort of "onclick" code on each container's TR/TD that sends the TID to a jquery function? Since all the forum TRs are classed with in-container-TID you can to target them from that.

    We'd also need a function on page load that will set up the collapsed state according to 1st the user's cookie and 2nd, if no cookie, the states set up by the admin. On the admin side, I can store a set of TIDs that should be collapsed. Assume any not in that set are uncollapsed. I don't know how jquery cookies work but it seems like you should be able to do the same there. So the onload jquery code would just read the set of collapsed containers and hide them.

    Seems simple enough but, then, I don't know how to execute it so maybe I'm way off base. LOL

    Thanks,

    Michelle

    cridenour’s picture

    Michelle:

    That is exactly how I would have approached.

    I'll look into the jQuery later this evening.

    grn’s picture

    StatusFileSize
    new408 bytes

    Thanks for clearing my mind :-)

    I hope the folowing is going in the right direction.

    In adv-forum-list.tpl.php add this code in the container

    element:
    <?php print 'onClick="jq_collapse(\''.$child_id.'\')"';?>
    

    With the attached js file, we should have some functionality.

    Please feedback on this when you get the time :-)

    michelle’s picture

    I can't get that to work... Can you have a look at http://6dev.shellmultimedia.com/forum and tell me if I put the jquery in the right spot?

    Michelle

    grn’s picture

    The collapsing is working here in Opera and Firefox (very buggy at the moment). It's just a test case.

    You must click on the row twice.

    michelle’s picture

    Well, color me confused. It is working for me, now, too. I can open and close them with just one click. So we just need something for the +/- icons, then. Awesome work!

    Michelle

    jannalexx’s picture

    nice approach..
    can you please point a delicate way to load the javascript "advanced_forum.js" on 5.x (and 6.x if different)?

    michelle’s picture

    @jannalexx - It's loaded via drupal_add_js.

    @grn - Ok, so here's the "to do" as I see it:

    • Add a function to set the initial collapsed state. This should look first at cookies and, if no cookies, at a list stored in a Drupal variable.
    • When you click on a link in the container, it opens/closes the container. I believe that's what that "bubble" thing was meant to fix.
    • Add the +/- icons and have them change depending on the container's collapsed state.

    Anything I'm missing? Are you able to tackle these?

    Thanks!

    Michelle

    grn’s picture

    Michelle: This should be simple. The right approach is a bit trickier....

    We have an extra </div> at line 94.

    Why do we want a span

    <span id="collapse-toggle-<?php print $forum->container_id;?>"></span>
    

    and not an img?

    <img id="collapse-toggle-<?php print $forum->container_id;?>" src="images/container_close.gif" alt="Show or hide the forum" />
    

    What is the path to container_close.gif?

    I am still having problems with two click enabling the collapse function after page reload (browser cache could be preventing this bug from appearing).

    grn’s picture

    StatusFileSize
    new400 bytes

    Two click bug is now fixed.. why didn't anybody see this??? ;-)

    We don't need: $('#forum-list-' + container_id).click(function() { when the function is called by onclick html. By the way it should be "onclick" not "onClick" my bad..

    grn’s picture

    I found the path thing: drupal_get_path('module', 'advanced_forum')

    jannalexx’s picture

    function advanced_forum_js_load() {
    drupal_add_js(drupal_get_path('module', 'advanced_forum') .'/advanced_forum.js');
    }

    or
    drupal_add_js("sites/all/modules/advanced_forum/advanced_forum.js", 'module');

    But js can't be loaded
    error: jq_collapse is not defined

    (file is in the directory), whats the code in your side?

    grn’s picture

    jannalexx: in advanced_forum.module the you can add:

    drupal_add_js(drupal_get_path('module', 'advanced_forum') . '/advanced_forum.js');

    to function advanced_forum_init() {

    Have a look at the latest dev release.

    grn’s picture

    Add a function to set the initial collapsed state. This should look first at cookies and, if no cookies, at a list stored in a Drupal variable.

    Hmm I reckon that this function should be loaded at dom.onload or something similar (http://www.geekdaily.net/2007/07/27/javascript-windowonload-is-bad-mkay/). I am struggling to find a way to send the php information to an onload javascript function? It was easy with the onclick, when my mind got cleared.

    The initial collapse state is saved in cookies with jQuery.. maybe this should be handled by php...

    By the way, I think the easiest approach will be to set cookie states for all the containers initially, only overriding user settings if they aren't set.

    michelle’s picture

    @jannalexx - If you're curious about how this is being implemented, please just look at the code so we can keep the issue on topic.

    @grn - I used a span instead of an image for the +/- because that is how you had it in your original code and I thought it needed to be that way. I changed it. You'll need to add the javascript to change from close to open as needed.

    Setting cookies for the initial states sounds fine.

    I have no idea how to send PHP to javascript. I'll see if I can rustle up some help for that.

    Changes so far committed.

    Thanks,

    Michelle

    cridenour’s picture

    Sorry I disappeared the past few days!

    I think grn is on the right approach. Have the JS read from the cookie. Have PHP set the cookie from the DB if one doesn't exist.

    This way, you have the option of talking both ways (anything the JS does could eventually be read by the PHP).

    grn’s picture

    StatusFileSize
    new657 bytes

    In advanced_forum_init() { add jquery_plugin_add("cookie");.

    I have attached a new js file. This will change the image appropriately.

    In the list.tpl.php you should have the Only local images are allowed. looking like this:

    <img id="collapse-toggle-<?php print $forum->container_id;?>" src="<?php print
                	 drupal_get_path('module', 'advanced_forum') . '/styles/naked/images/container_close.gif';?>" alt="Show or hide the forum" />

    This of course assumes initially expanded containers.

    EDIT: The onclick: <?php print 'onclick="jq_collapse(\''.$child_id.'\', \''.drupal_get_path('module', 'advanced_forum').'\')"';?>

    michelle’s picture

    jquery_plugin_add("cookie"); is undefined.

    Heading out for a couple hours. If you can tell me how to fix that part, I'll commit the latest when I get back.

    Thanks,

    Michelle

    grn’s picture

    The jQuery plugins module must be installed.

    The jQuery Cookie must be manually installed in jQuery plugins. The problem is stated at #30.

    michelle’s picture

    @grn - Oh... Hrm... I missed that when I read through. Is that the only way to do it? If so, I guess I'll just wrap the call in a functon_exists so it doesn't fail for people who don't have the plugin.

    Michelle

    grn’s picture

    You could make a duplicate of the jQuery Cookie js file and put it in the adv forum module.. but that's not the way it should be done ;-)

    michelle’s picture

    No, I don't want to do that. I was wondering if there was any way to do it with the jquery available in core. If not, I guess I'll need to include instructions for adding this if people want it. Is there any way to make the +/- change on click so at least that's accurate without cookies?

    Michelle

    grn’s picture

    We probably need the jQuery Cookie to communicate between php and jQuery. Without cookies and initial collapse function the container states are a mess. Unless we state that on every pageload, the containers are all collapsed or all expanded. Then the collapse function looses it's value.

    michelle’s picture

    Ok, so how about this for a plan:

    1) Initially assume all containers are open
    2) I will put in the code to use jquery cookie but will check for the presense of the function. If it's there, the code will run to read the state of the forums from the cookie. If it's not there, this step will be skipped.
    3) If the code to read the cookie exists but the cookie itself does not, prefill the cookie with the states from the Drupal variable.
    4) When a user clicks to open/close a container, attempt to write it to the cookie and also target the icon to change it. This way the icon will change whether the cookie code is there or not. Of course, this won't be maintained between page refreshes if there is no cookie code.

    Does this sound like a plan to you? If so, I believe all that I need from you is the code to change the icon on click. I think you have the rest of it working with the cookie if jquery cookie is installed, correct? Also, could you provide instructions for getting jquery cookie working with D6? You said something about copying the code to jquery plugins but I'm not sure what code and where it goes. It looks like the jquery plugins maintainer may be open to adding it but I need to test this in the mean time as I want to do an alpha in the next day or so and this is one of the last remaining issues.

    Thanks,

    Michelle

    michelle’s picture

    Note to self: I also need to finish the work of making collapsable containers optional so I don't have to endure the wrath of Morbus. ;)

    Michelle

    grn’s picture

    A) The icon change is in the js at #68... this should work when cookies are enabled, without the cookies the jQuery does not have a chance on figuring out the collapse state.

    B) The major issue is getting the collapse state initially on page refresh. I don't know how to get the container_id's in the jQuery...

    jQuery cookie:
    1) get the jQueryCookie code: http://plugins.jquery.com/project/cookie
    2) put it in the jquery_plugin folder and rename it to "jquery.cookie.min.js"
    3) in advanced_forum.module put jquery_plugin_add("cookie"); in function advanced_forum_init() {

    This should be it. This is not ready for alpha in my opinion.... primarily because of B).

    Please let me know if you need more information. Sorry that I can't figure out the php/jQuery voodoo. I figure we need ajax or something, but I don't know much about it. Maybe some gurus could give us a hint... are we going in the right direction?

    michelle’s picture

    Version: 6.x-1.0-alpha2 » 6.x-1.x-dev

    A) I admit I don't know jquery but I know enough about it that I don't think it's impossible to toggle between two icons on click without using cookies. I'll see if I can find someone to help with that.

    B) I don't, either. Let's see if I can rustle up some more help.

    Thanks for the tips on getting the cookie working. Hopefully we can get this sorted. I can't keep holding off on this alpha. The last alpha was in June and that's way too long between.

    Michelle

    grn’s picture

    A) Yes it worked that way in the early versions of my inline jQuery.. the image src changed every time a toggle was initiated.

    cridenour’s picture

    With this new info - I would suggest setting up a new page in your hook_menu to handle AJAX requests. So instead of cookies, you are just speaking to your database. Then on initial load, you can pull the data from the db and populate that into the .tpl file.

    The only reason I suggest this route now is I was unaware (aka didn't read) that using cookies required an additional module. This is unacceptable for such a menial feature.

    michelle’s picture

    @cridenour - Is this something you're able to help with? I know what hook_menu is but I'm really just out of my league with jquery/ajax. As much as I'd love to work through how to do it and learn how to use them, it's just not possible for me right now. Too much on my plate and I really need to get this working ASAP to replace the buggy alphas we have now. If you have the time to swoop in with a patch that makes this work without relying on jcookie or tons of code packed into the .tpl, that would be really awesome. I think we're close in the direction we're going but I just don't have the knowledge to push the rest of the way there.

    Thanks,

    Michelle

    cridenour’s picture

    I likely won't be able to write anything until the weekend. If that changes, I'm sure I'll be in IRC but have a presentation on Friday.

    I'll check back here if my schedule opens up in the evenings.

    cridenour’s picture

    Assigned: grn » cridenour
    Status: Needs work » Needs review
    StatusFileSize
    new6.05 KB

    Attached patch goes against 6--1 Branch.

    Basically we have an onload AJAX call and AJAX calls after each toggle. It sends it to PHP which handles the cookie (or creates on if it does not exist).

    I still need to create the menus to allow the admin to set defaults. However - this could also be done by others - just need to pull down current categories, some checkboxes, serialize the results in a [category_id] => [boolean for collapsed] format :)

    cridenour’s picture

    Hmm just noticed I still have some debug comments in there as well...

    And Michelle I will talk with you tomorrow on D5 roll - some of the jQuery changes I believe. I'll need to do some research during lunch.

    michelle’s picture

    Status: Needs review » Needs work

    Yeah, I can handle the settings page. I was just waiting until this got sorted before adding it.

    The patch looks good. I only have a few nits:

    1. I think the path should be advanced_forum/collapse rather than advf/collapse
    2. The variable should be advanced_forum_collapse_defaults rather than advforum_collapse_defaults
    3. As you said, debugging code needs to be removed
    4. I don't understand the reason for dropping the last div in <div class="num num-topics"><?php print $forum->num_topics ?></div>

    I can take care of the first 3 myself later today if you don't get to it first. The last one needs your input, though. Thanks very much for doing this. :)

    Michelle

    cridenour’s picture

    @2
    I was following the advforum_topic_pager_max variable name ... any reason that isn't advanced_form?

    @4
    I wanted Eclipse to stop telling me there was an unclosed div... I meant to ask you about that. There is a mismatched # of divs in that section - there was no collapse reason for it, I just wanted the errors to go away :)

    michelle’s picture

    @2 - That's an error, then. The rest are all advanced_forum. I'll fix that. A lot of those variables just got created on the fly when I decided something should be optional as I wrote it and I must have goofed with that one.

    @4 - Interesting... There should be a closing div there so it's messed up somewhere else. I'll look thru it, thanks.

    Michelle

    michelle’s picture

    Ok, patch in #83 comitted. Thanks for jumping in, cridenour.

    Remaining issues:

    1. Icon doesn't change between +/-
    2. Need to add admin settings for initial states
    3. Forum header jumps sideways when opening/closing containers

    I can do #2 and probably #3 but I need help with #1.

    Thanks,

    Michelle

    michelle’s picture

    Status: Needs work » Active

    Ok, #2 is done. Still need help with #1.

    Michelle

    cridenour’s picture

    StatusFileSize
    new2.01 KB

    #1 done.

    michelle’s picture

    When I apply this, the icon changes, which is great, but the states stop getting saved, which is not good. :(

    Michelle

    cridenour’s picture

    On what browser? The fox? And I also noticed another little bug in my patch. Not seeing the problems you are though.

    Will re-roll tonight.

    michelle’s picture

    Yes, on FF3. All I did was apply the patch and clear the cache. The icon changed back and forth but as soon as I went to another page and came back, all containers were open again. Reverting the patch made it go back to remembering the container state.

    Thanks,

    Michelle

    grn’s picture

    User collapse states are forgotten at page refresh, confirmed in Opera 9.50 and FF 3.01. This is the cookie thing, didn't realize that this was implemented here.

    Nice to see there is progress here :-) Keep up the good work!

    halkeye’s picture

    On the admin page (admin/settings/advanced-forum) the $options array was not reset after the theme selector dropdown.

    Line 190 (approx) needs an:
    $options = array();

    before the loop before $form['advanced_forum_collapse_defaults'] = array(

    It is currently:

    Default collapsed containers:
    [ ] naked
    [ ] blue_lagoon
    [ ] cat 1
    ...

    I'll try to checkout the cvs version tonight and make a patch.

    michelle’s picture

    @halkeye - Whoops. Missed that. No need to make a patch. I can fix it. Thanks for letting me know.

    Michelle

    michelle’s picture

    @cridenour - any progress on this? We're almost there. :)

    Thanks,

    Michelle

    cridenour’s picture

    In the last few lines, where it pulls the initial state - try chaning container_id to tid (the correct variable name in that function) That might be the problem here.

    Sorry school started up and am organizing a Cincy drupal meetup tonight. :)

    michelle’s picture

    At this point, collapsable containers are totally broken. I'm sure it's my fault. I applied a bunch of E_ALL notice patches from another issue and something in them broke it. But I don't know what happened or how to fix it. I need someone with jquery knowledge to go in and fix the goof and get this all working. Since this isn't likely to happen tonight, I'm going to hold this one over until after the alpha.

    Michelle

    cridenour’s picture

    Every time I sat down with it, I got pulled away two-five minutes later. Not sure when my schedule will clear. But this is sitting up near the top when it does.

    I agree on waiting though.

    michelle’s picture

    Priority: Normal » Critical

    I am going to be releasing a new alpha with just bugfixes as soon as I can get a hold of John Albin and fix the Zen subtheme problem. I need to either have these containers working or I'll need to pull the code out. I've had a couple of people complaining that the unfinished code is causing problems.

    Is anyone going to have time to work on it this week?

    Thanks,

    Michelle

    michelle’s picture

    Should link to the issues I'm duping for this to make sure all problems get fixed...

    #317371: Advanced Forum error on page
    #317008: Fatal error related with collapsible containers

    I really could use help on this issue. I'm waiting on John's help with the Zen subtheme issue this week. Soon as we get that fixed, I'll be rolling a bugfix alpha. If no one has time to get this fixed, I'm just going to take all the code out until someone has time.

    Michelle

    michelle’s picture

    Assigned: cridenour » Unassigned
    Priority: Critical » Normal

    And another issue caused by this: #318256: Something is wrong with sitewide pager links

    I've removed all of the code from both branches for collapsable containers. The work isn't lost as it's there in the CVS history. I don't have the js/ajax skills to do this. If someone wants to do this, I'm open to a patch provided it works, follows Drupal coding guidelines, and doesn't cause any of the issues that caused me to remove all the code.

    Thanks to those of you who worked on the code. I do appreciate the effort but I can't leave code in there that causes problems, especially since the code wasn't yet to a working point.

    Michelle

    cridenour’s picture

    Sorry I was pulled away from this. Considering I am unable to reproduce any of the errors on my site with the code I wrote against, like you said earlier, something was broken later on.

    The pager links problem is even more confusing to me as it looks like it is appending the cookie to the URL. Maybe once school dies down again, I can approach the problem vs the latest build and find out what went wrong. This one seems to be an issue that might be in core as I'm not doing anything fancy with the cookie but that will have to wait for my schedule to die down.

    Again, I apologize for being pulled away from this lately. As you can tell by my absence in IRC / groups.drupal etc, I am not just ignoring this :)

    Chris

    michelle’s picture

    Category: task » feature
    Status: Active » Postponed

    I understand. Real life gets in the way of fun coding a lot. TBH, I don't see this as a critical feature. It's nice, sure, but we can live without it until we have a solid solution. The code is all out of the dev. If anyone is still having pager issues, be sure to clear your cookies.

    I'm going to set this as a postponed feature request until you or some other jquery person can step up and take this home. :)

    Thanks for all the time you folks have put into it.

    Michelle

    michelle’s picture

    Status: Postponed » Active

    Now that I have alpha 13 out, AF is open to new features again. If anyone wants to work on getting this into alpha 14, feel free. :)

    Michelle

    akiecs’s picture

    Will this work on drupal 5?
    I installed alpha 13 on my Drupal 5.12, but I didn't see the option "Default collapsed containers".

    Thanks

    michelle’s picture

    @akiecs - This won't work on either version until someone writes it.

    Michelle

    grn’s picture

    Hi.

    If someone wanted to continue the development of this feature, where should that person begin?

    Is it possible to do further work on the buggy code you removed?

    michelle’s picture

    grn - Sure. The code is all either in this issue or in cvs. You can use it as a starting point. I need to be firm on this one, though, because this issue sucked up far too much of my time for such a tiny feature. I'm only willing to look at completed, working patches that follow Drupal's coding standards so I can just apply, test, and commit. Normally I'm willing to spend time helping patches along but I've already spent that time on this one.

    Michelle

    grn’s picture

    OK

    michelle’s picture

    Version: 6.x-1.x-dev » 6.x-2.x-dev
    NeoID’s picture

    For you still interested in this, I found a nice site about solving this issue: http://www.tobypitman.com/multiple-collapsable-panels-with-cookies/
    I've almost managed to get it to work on the forum, but there are still some problems with it, so I can't release my code-snippet yet.

    I really like the approach, but I'm still struggling on how to access the right ul to hide for each container.
    (See for yourself on the menu to the left on that site)

    michelle’s picture

    Just an FYI: Now that each container is its own table, that may help with this. Now is a good time if anyone wants to have another go at a patch as I'm actively working on 2.x. I still don't know any javascript / jquery so this feature is relying on the community stepping up. :)

    Michelle

    andrewsuth’s picture

    Good idea to give each container a table - might this also open the door to making them sortable?

    I will happily test any collapsible patches once 2.x is a little more stable.

    michelle’s picture

    @andrewsuth: No, they won't be sortable because they aren't created with theme_table.

    Michelle

    michelle’s picture

    Notes from IRC:

    [10:53] $output = theme('ctools_collapsible', $title, $content, $collapsed);
    [11:02] So it's still just a case of taking what's in theme_ctools_collapsible and re-organizing as you like. The handle is the clickable part, the content is the part that will go away. You'd want to provide a different toggle icon but that's doable with CSS easily enough.
    [11:02] The javascript adds the toggle icon so it won't appear if .js isn't available.

    Michelle

    apanag’s picture

    Hello,

    i am trying to create a patch for this feature. I tried ctools_collapsible, but that the theme function required a div element, but in the forum containers there is a table element.Thus it's not possible to use the ctools_collapsible unless it supports other html elements. So i think we have to write custom jquery code to support such a feature.

    michelle’s picture

    I would prefer to use the CTools code since it's already a dependency. merlinofchaos is currently on vacation but I can talk to him about it after Drupalcon.

    Thanks for looking at it,

    Michelle

    apanag’s picture

    I believe too, that using CTools is a much better solution than writing custom code. But unless ctools_collapsible supports table elements is not possible to use this function.

    Thanks for your quick reply,
    apanag

    apanag’s picture

    Do we have any feedback on this?

    apanag

    merlinofchaos’s picture

    This commit should fix that: http://drupal.org/cvs?commit=261180

    apanag’s picture

    Yes i think its perfect for now.
    I think i ll be able to provide a patch for the collapsible blocks.

    Thank you merlinofchaos, for your work.

    michelle’s picture

    Awesome, thanks!

    Michelle

    apanag’s picture

    @merlinofchaos
    I have some problems with the last version of the ctools.

    We have an html structure with a table:

    table
     thead
     tbody
    

    We want the thead to be the $handle area and tbody to be the $content area. If we use the theme function theme_ctools_collapsible_remembered, we will be having a div area inside a table and that's not valid.
    Finally the collapsible-div.js is looking always for div

    Drupal.behaviors.CToolsCollapsible = function(context) {
      $('div.ctools-collapsible-container:not(.ctools-collapsible-processed)', context)
        .each(Drupal.CTools.bindCollapsible)
        .addClass('ctools-collapsible-processed');
    }
    

    Is it possible to check only for the classes and if there are the correct classes to provide the functionality?
    For example if i manually wrote

    <table class="ctools-collapsible-remember ctools-collapsible-container"> 
     <thead class="ctools-collapsible-handle">
      <tr><th class="forum-icon"><span class="ctools-toggle"></span></th></tr>
     </thead>
     <tbody class="ctools-collapsible-content">
       <tr><td><td></tr>
     </tbody>
    
    apanag’s picture

    StatusFileSize
    new1.36 KB

    Hello guys,

    after working: http://drupal.org/node/558918 with merlinofchaos on ctools collapsed functionality, i created a patch to integrate collapsed areas into advanced_forum.module.
    This is my first attempt and i am waiting your feedback. There is still one issue left for display correctly the table.
    You have to use the latest dev release of ctools.

    Many kudos to merlinofchaos for his hard work.

    apanag

    PS:
    The patch is for naked style only.

    michelle’s picture

    Status: Active » Needs review

    Thanks. I'll check this soon as I can. Going to be a very busy weekend and then I'm traveling so will likely be later next week.

    Michelle

    SamanthaV’s picture

    Any ETA on when this will be working. We have over 10 containers with approximately 15 forums in each. We seriously need collapsable containers to clean up the look and feel of advanced forums.
    Many Thanks
    Samantha

    michelle’s picture

    @SamanthaV : Well, you can always test the patch. The more eyes on it the better. I don't have any personal need for this so it would be great if people who do have a need stepped up to help. :)

    Michelle

    michelle’s picture

    Status: Needs review » Postponed
    Issue tags: +Drupal 7.x

    With regret, moving this to D7.

    Michelle

    khaji00’s picture

    I could test this for D6, i also have a need for this.

    michelle’s picture

    2.x isn't final, yet. If someone provides a patch that works well, I'll apply it. So far, I haven't seen one. I don't have containers on my site so it's not something I am going to spend time trying to do at this point.

    Michelle

    WorldFallz’s picture

    patch in 129 works! You need to explicitly load collapsible-div.js (unless there's some other way, i'm still finding my way around ctools), but once you do it works great. The only issue is, when the container is collapsed the headings (forums, topics, posts, last post) resize. I'm not sure what the best to address that is-- Ill noodle on it a bit and see if I can figure something out.

    michelle’s picture

    Status: Postponed » Active

    Thanks, WorldFallz. It's been so long I don't remember what issue I had with the patch anymore. I'll set this back active again since you're looking at it. Would love to get this into 2.0. :)

    Michelle

    WorldFallz’s picture

    Status: Active » Postponed
    StatusFileSize
    new3.95 KB

    well-- thats turned out to be WAY easier than I thought! Patch attached.

    WorldFallz’s picture

    Status: Postponed » Needs review

    And as a bonus the patch included two fixes for php notices i'd forgotten I added ;-)

    michelle’s picture

    Awesome, thanks! I'm just about to head out but will try to look at this soon.

    Michelle

    WorldFallz’s picture

    Status: Needs review » Postponed

    no worries-- whenever. I'm going to add a collapsed/expanded indicator also so there will be at least one more patch before you commit.

    WorldFallz’s picture

    Status: Postponed » Needs review

    bah, crosspost

    WorldFallz’s picture

    OK, here's what I have so far. Includes two graphics for the expanded and collapsed states. I cannot figure out what css magic I need to do to get the graphic to toggle when expanded. Maybe some css/js guru can figure it out.

    WorldFallz’s picture

    And now with less spelling errors (it still doesn't work though).

    WorldFallz’s picture

    I always post too soon-- here it is with functioning toggles. You need the graphics from #143 and to load up collapsible-div.js from ctools and you'll have collapsy goodness. ;-).

    WorldFallz’s picture

    I'm thinking the best way to make sure collapsible-div.js is loaded it to add a drupal_add_js in the preprocess page function-- but how does that work with other modules? Since ctools is a library, there could be lots of other modules that load collapse-div.js as well. Does drupal_add_js take that into account?

    WorldFallz’s picture

    Just had another thought-- do you want this to be always active, or should it be an option at admin/settings/advanced-forum?

    WorldFallz’s picture

    StatusFileSize
    new2.75 KB
    new2.75 KB
    new4.5 KB

    Here's another version with a much more subtle plus/minus graphic I recolored to match the colors of your folder icons. This is probably better for a 'generic' style.

    michelle’s picture

    You've been busy. :) I wasn't at the computer much last night so haven't gotten to look at this, yet. As for making it a setting, I don't think that's necessary. I've gotten a lot more stingy on what I make an option since I started this. If it can be changed in theming or with a hook, I avoid making it an option. Trying to get away from the jet cockpit look on the settings page. :)

    Michelle

    WorldFallz’s picture

    yeah -- when I get it in my head to do something I'm pretty much obsessed until it's done, lol. I like the minimal options philosophy and you can easily theme this out by removing the ctools classes in the tpl.php.

    michelle’s picture

    I get that way, too, but I only have a couple of kid-free hours most days and about 50 different things clamoring for my attention so I can't really stick with one thing for as long as I'd like. :(

    Michelle

    trickli’s picture

    Issue tags: -Drupal 7.x +Drupal 6.x

    Hi

    There is no includes/advanced_forum_preprocess_forum_list.inc file anymore, so how to change? Using 6.x-1.1.

    Thanks,

    michelle’s picture

    Issue tags: -Drupal 6.x

    That file exists in 1.x, just with a slightly different name. I don't remember exactly what it was off the top of my head but it's similar enough it should be obvious. I doubt you'll be able to use this as is since the code has changed but maybe you can adapt it.

    Sorry for never getting to this, WorldFallz. Tagging it as an alpha 4 blocker and will try to get it in before then.

    Michelle

    WorldFallz’s picture

    no worries ;-)

    michelle’s picture

    Status: Needs review » Needs work

    Ok, I tried applying the patch and it actually did apply which surprised me considering how old it is. The only thing it rejected was a bit in style.inc that doesn't appear to have anything to do with this issue anyway.

    Unfortunately, I can't get it to work. I added in the js via ctools_add_js("collapse-div"); and confirmed it was there in the page source. I don't know where else to look at this point since I don't know js. Any suggestions?

    Thanks,

    Michelle

    ericduran’s picture

    @michelle, I didn't test this patch but I would try adding ctools_add_js('collapsible-div') and ctools_add_css('collapsible-div'). I think as long as the classes are there that should work.

    WorldFallz’s picture

    i should have time to look at this today and reroll as necessary....

    michelle’s picture

    I added the js... Not the css. Will give that a shot this evening if WF doesn't come up with something before then.

    Thanks,

    Michelle

    michelle’s picture

    I accidentally mixed this in with another change so just went ahead and committed both. That'll make it easier for you to see exactly what I have and maybe see what I messed up to make it not work. :) Will be in the dev in a few hours or just grab from CVS.

    Michelle

    WorldFallz’s picture

    ok this actually still works with the commits you just made to the current 2.x dev. I had to add <?php drupal_add_js('sites/all/modules/ctools/js/collapsible-div.js','theme','footer'); ?> to the top of the advanced_forum.naked.forum-list.tpl.php file. I have no clue why the ctools_add_js in the preprocess function isn't doing it.

    There's also some issues with layout when the divs get collapsed-- i'm looking at it now.

    WorldFallz’s picture

    duh... boy i'm slow today, lol. ctools_add_js("collapse-div"); needs to be ctools_add_js("collapsible-div"); ;-)

    michelle’s picture

    Well, lookie there. Works great when I've got the right js file. :) Thanks! Filename change committed.

    Removing this as a blocker since the layout glitch is pretty minor. But there's still time to get fixes in before alpha 4.

    Michelle

    WorldFallz’s picture

    ok, i fixed a problem with the backgrounds not persisting, now I'm just trying to figure out how to keep the table cell width from changing when forums are collapsed.

    (originally posted this in the wrong issue, lol)

    WorldFallz’s picture

    and cross posted, this is just not my day , lol.

    michelle’s picture

    No worries. I'm just grateful that you are doing this. I have no js skills at all and this is something that just can't be done without it.

    Michelle

    WorldFallz’s picture

    StatusFileSize
    new1.14 KB

    happy i can finally help out on af!

    here's tiny patch that fixes the missing backgrounds.

    michelle’s picture

    Not sure if I'm doing something wrong... I can't seem to click the +/- now without actually going to that container. Are you seeing that on your end?

    Michelle

    WorldFallz’s picture

    nope--- functionally nothing changed with the patch here. The only difference I see is that the background image works now-- i'm using cloudless day atm, but I'll look at the themes as well. maybe clear the cache?

    michelle’s picture

    It might be a firefox thing, too. If I move the pointer just to the left of the +/- it gets out of the link. Maybe add a little space in there outside of the <a></a> ?

    Michelle

    WorldFallz’s picture

    StatusFileSize
    new1.76 KB

    ah.... I misunderstood the issue. And yep, I'm getting this too-- i'll have to figure out another way to fix the bg problem.

    In the meantime here's a possible fix for the table layout.

    WorldFallz’s picture

    Status: Needs work » Needs review
    StatusFileSize
    new6.95 KB

    ok, all encompassing patch that fixes all the little issues-- against current dev.

    MasterChief’s picture

    I confirm the problem spotted by Michelle in Firefox, otherwise i am not sure the column chosen to collapse containers it's the better for design, the first or last column (at the right of last post for example) will be more nice.

    michelle’s picture

    Status: Needs review » Active

    I committed the patch and it works but it is still very touchy with accidentally going to the container instead of collapsing it. If possible, I'd really like to see the +/- moved all the way to the far right. I think people would usually expect it there because that's where Vb has it and it would also get it away from the link to avoid accidental clicking.

    Thanks!

    Michelle

    MasterChief’s picture

    I am agreeing with Michelle.

    Subscribe.

    greywolfsspirit’s picture

    Maybe I missed something, Michelle.. But on my patched version (using patch from #171), I see the collapse feature on the main page, but, I now have lost the subforums from being listed under the main forums on the main forum page. Ie:

    The Moonlight Way Complaint Department
    Bug report, Feature Request

    It just has
    The Moonlight Way Complaint Department

    Is there a new hidden setting somewhere or did something get overlooked in the recent patch/changes? Just trying to figure out if I have an internal system bug again or not.

    Jim

    *Edit*

    Just spotted one other thing, total posts is not pulling the totals from subforums in it's count either. I have 2 posts in a subforum PC under my forum Video Games.. and the totals on Video Games show 0 Topics, 0 Posts.

    michelle’s picture

    Ah, you're right, we lost subforums in there. I missed that. That will need to get fixed.

    The post count never pulled in from subforums. That's a feature request in another issue.

    Michelle

    greywolfsspirit’s picture

    Okay on both parts. I just wanted to double check on the subforums not being listed. I'm in the process of rebuilding my site (had a major failure here and corrupted something or other) and that's when I noticed it missing on the current dev.

    And that would tie into where my posts stats went, as the previous build showed everything for me. Thanks, Michelle for checking on it.

    michelle’s picture

    Category: feature » bug
    Priority: Normal » Critical

    Changing the status because this introduced a serious regression that needs to be fixed before alpha 4.

    Michelle

    michelle’s picture

    I went through the template and cleaned it up a bit so it's easier to follow so make sure you grab the latest if you work on this. I also removed some code your patch added that made no sense. It had a test to see if we were on a container when we're already in the container section and an else that would never happen.

    I haven't figured out why the subforums disappeared and can't see anything in this patch that could have caused it. It's possible something else I was working on caused it but I don't know what. It's really late here... Will dig into this more tomorrow.

    Michelle

    michelle’s picture

    Category: bug » task
    Priority: Critical » Normal

    Decided to have one last look and I found it. In this patch you stuck an isset around an if test that breaks it. Removing that fixes it and doesn't seem to have anything to do with collapsible containers as they still work fine without it. Removed and committed that so downgrading the issue settings off of red alert. :)

    Ok, looks like the only thing left here is to move the + over to the far right if that's possible. 2.5 years later, we've nearly got it. Thanks, WorldFallz! :)

    Michelle

    WorldFallz’s picture

    wow-- i was away from the computer for a while. sorry the patch caused such upheaval!

    Ill install fresh and give the icons some breathing room. are all your tweaks in the current dev?

    michelle’s picture

    That's ok. It's easy for unrelated stuff to slip into a patch. I think I have it all cleaned up so only the stuff related to collapsing containers is there. It's working great in my testing aside from needing to move the icon. Everything I've done is committed. I'm going to switch over to working on the Page Manager integration issues so I'll be out of this bit of code for a while and won't collide with anything you're doing.

    Thanks!

    Michelle

    michelle’s picture

    Category: task » bug

    Shoot, there's another bug reported in #1028342: Sorting with topic works not good . That issue is hard to read so, to summarize, when you click to go to a forum, the container it is in collapses as well.

    Michelle

    michelle’s picture

    Just noticed another one. If you go to a forum that has subforums, the forum starts out collapsed.

    Sigh... I thought we almost had this one.

    Michelle

    pawi81’s picture

    @Michelle sorry for my language :-)

    michelle’s picture

    @pawi81: No need to apologize. You write English better than I write Polish. ;) What I said was to clarify, not criticize.

    Michelle

    greywolfsspirit’s picture

    I was just getting set to report this myself, Michelle. But, on the positive side, the changes you made did bring back the subforums being shown as they had been. From what I can see, it appears that the method being used for the initial view setting (collapsed vs. expanded) needs to be flipped is all. Sounds like it should be a quick and simple fix on that. I am not at my coding system currently so I don't have the source code in front of me, but if it's set up like a basic C++ on condition, then the check for the collapse is just reversed.

    something like:
    on enter_forums
    display_collapsed_containers
    else
    display_expanded_containers

    instead they need to be flip-flopped. But this not being C++, it may not be as clear cut as that. Maybe it at least gives you an idea where to check for it.

    WorldFallz’s picture

    one thing that might be related -- i currently have it setup so that the collapsible state is remembered from page load to page load. I can turn that off if you think it's confusing. that could be the issue here since i don't set the initial state-- that's done in merlin's js.

    pawi81’s picture

    @WorldFallz I think that I already reported that to Michelle. Thjs is really annoying :)

    michelle’s picture

    @WorldFallz: Remembering the setting is fine as long as it only remembers changes you made and on the page you made them. These are the two problems:

    * You're on the main /forum page and all containers are expanded.
    * You click on a forum (not a container) that has subforums.
    * The new page that loads has the forum collapsed at the top even though you've never collapsed it.

    Or
    * You're on the main /forum page and all containers are expanded.
    * You click on a forum (not a container) to go to that forum
    * You go back to the main /forum page and the container that holds the forum you just went to is collapsed.

    Neither of these are expected behavior. If fixing them requires turning off the remembering, I think that's a better way to go. I'd rather have it not remember the setting than having things collapsing when you don't tell them to.

    Michelle

    WorldFallz’s picture

    excellent -- i can now replicate what you're seeing. I'm playing around with it now-- i think it's just a matter of what the js is bound to.

    WorldFallz’s picture

    i'm still pulling my hair out with this, lol. Removing the "ctools-collapsible-remember" class does make it function as expected, but I think remembering the state between page refreshes is sort of critical behavior as well.

    greywolfsspirit’s picture

    Maybe it's just my thoughts on this, but, wouldn't it make more sense to have the collapse on the sub forum structure rather than the container themselves? As the code is right now, if we enter into a forum, the container currently collapses, goes to the selected forum, then it opens with everything collapsed, where we now have to open the forum up, then if we want a sub forum selection, select that sub forum, it again collapses everything again, switches to that sub forum. I guess, personally, I don't really see the need for the collapse of the forums myself. If it's something that is perhaps wanted by some people, make it an administrator selectable element for their sites? I'm not meaning to come across negatively on the idea, just give us the option of using it or not.

    Jim

    pawi81’s picture

    @greywolfsspirit
    And maybe the default option should be "No". On my forum thiss collapsing has no sense. But of course on some forums this is great thing.

    WorldFallz’s picture

    The js we are using at the moment is from ctools and it limits how the collapse functionality works. There's not much I can do if use the ctools js-- I'm just trying to find a way to get it to work on the tables the way it would be expected which is nothing more than playing with what elements get certain classes.

    i may end up having to use some custom js unless i can figure this out-- i keep thing I'm just missing something in the config.

    And you can always turn it off with a your own preprocess function and/or tpl.php file (just remove the extra classes). Though once I figure it out it probably makes sense to make it an option-- but that's really up to michelle.

    greywolfsspirit’s picture

    @WorldFallz: I understand how that goes. Been there a few times over the years programming, and that one line of code that eludes us. You'll get it, I'm sure. Don't get me wrong in my earlier statement, I like the idea, it's a nice feature, but was just pointing out what would seem to be a more logical location for the collapsing to take place was all. I'm not familiar with the code of course, but if the variables are different from a container and a forum inside the container, are you coding it to use the forum variable and not the container's variable in the collapse routine?

    My way of thinking on how this would be effective is something along these lines:

    Forum Container
    + Forum Name 1
    + Forum Name 2

    then if you click on one of those forums, it opens say, Forum 1 Expanded view of all sub-forum names under there at the top of the page, then under it, the list of topics in the forum 1 main forum. Kind of like this:
    Forum 1
    + Sub forum 1
    + Sub forum 2

    Messages of Forum 1
    (forum messages begin here)

    If this is the concept you're going for, I think that would function a lot nicer for everyone. Where whatever forum you go to, it shows the branches available under that forum. But as Dennis Miller would say, "That's just my opinion, I could be wrong." :-)

    WorldFallz’s picture

    Actually the problem is I'm not coding it-- i'm trying to get the collapse-div.js code from ctools to work with tables. I've tried putting the classes all over the place. The main problem is that in order for that script to work with tables (as opposed to divs) you must use the 'ctools-no-container' class which has the effect of making the entire table the toggle (see the comments in collapse-div.js for more info). So, when you click the link to go to that container it also collapses the div. I've even tried hacking the code in the hopes I could turn it into something I could submit as a patch to ctools.

    I got it working with custom jquery in just a few minutes, so I'm not sure why I can't get the ctools code to work.

    WorldFallz’s picture

    ok-- i've got this working GREAT with custom js. I've also made it an option at admin/settings/advanced-forum-- including the ability to choose the type of animation (toggle or fade).

    i'm crying uncle with using the ctools script to do this-- take a look and let me know what you think.

    WorldFallz’s picture

    also, it doesn't remember between page loads but I can always add that if desired.

    michelle’s picture

    Custom js is fine. Thanks for doing this! If you can make it remember the state that would be great. Some sites have a bazillion containers and someone might collapse the ones they aren't interested in and like to have it stay that way each visit.

    I'm probably not going to get to this until tomorrow. It's my son's birthday and I've got a ton of stuff to do.

    Michelle

    WorldFallz’s picture

    no problem-- that'll give me some time to add the cookie support. Also, for some reason, it only expands and contracts once, lol. I'll need to figure out what I did to add that feature, lol.

    happy bday to him!

    WorldFallz’s picture

    StatusFileSize
    new1.11 KB

    ok this one works for more than one toggle, I have no clue what's wrong with the other one-- probably a typo somewhere.

    greywolfsspirit’s picture

    Tried this with the fading and toggles, and it appears to work just fine for me. Granted, I only use one container, but I tried collapsing one of the forums with sub-forums, and upon going back to that forum, the sub-forums did not remain collapsed as expected. But the patch went in without a problem as long as you remember to put the .js file in the root advanced forum directory.

    WorldFallz’s picture

    awesome -- thanks for testing greywolfsspirit! And what you saw is the current correct behavior-- it doesn't remember status at the moment. I'm working on that part now.

    greywolfsspirit’s picture

    @WorldFallz: Not a problem.. I'm currently rebuilding my site anyhow, so I can afford to test the modules out at the moment on my test/development system.

    Jim

    troky’s picture

    I've ported this patch to D7.

    Few suggestions:
    - move <img> style from JS to CSS
    - jQuery selector $('thead th:first-child') is too general and it can break other tables on page. Consider using $('thead.collapsible th:first-child') selector and add 'collapsible' class to forums' <thead>
    - I would also like to see collapse/expand button on the far right side by default
    - put advanced_forum.js into js/ sub-folder to keep files structure clean

    WorldFallz’s picture

    1. i thought about that but then i'd have to add an empty span to attach it to-- i prefer the current method, but it's really up to michelle.

    2. good point! I can grab onto what's already there though: table.forum-table thead th:first-child {

    3. up to michelle

    4. up to michelle

    Thanks for testing-- You should attach your patch!

    troky’s picture

    1. Why empty span? My suggestion is to change
    handleHeader.prepend('<img style="margin-right: 10px;" src="' + collapse + '"alt="Toggle" />');
    to
    handleHeader.prepend('<img class="collapse-img" src="' + collapse + '"alt="Toggle" />');
    and add

    .collapse-img {
      margin-right: 10px;
    }
    

    to advanced-forum.naked.style.css

    2, 3 & 4. Agreed.

    WorldFallz’s picture

    ah --- i misunderstand what you were recommending. Agreed on #1 as well. ;-)

    michelle’s picture

    Sorry, got a bit distracted from this...

    I'd like to see the +- button on the far right. That's where it is in other forum software I've used and seems to be the most intuitive place.

    js subdirectory is a good idea. I don't like having a lot in the root. I'm big on compartmentalizing things. :)

    The other two I don't have an opinion on. Whatever you think is best. :)

    Michelle

    troky’s picture

    StatusFileSize
    new3.68 KB

    Attached is my version (D7!) of javascript with per-page remembered collapse settings. This code should work on D6 with minor adjustments in Drupal.behaviour.advanced_forum.

    In order to get this JS working advanced-forum.naked.forum-list.tpl.php needs to be patched:
    <thead class="forum-header"> to <thead id="forum-header-<?php print $forum_id;?>" class="forum-header">

    WorldFallz’s picture

    awesome troky-- i'll tweak this for d6 and should have a patch rolled later today.

    troky’s picture

    Please wait with tweaking for D6. Code above has one big flaw: it uses one cookie per page and usual browser cookie limitation is 20 (I think) per domain. Currently, I am changing code to use only one cookie.
    Also, I've removed markup from javascript (<img> and hardcoded image paths) and moved it to tpl and css using <span>. It makes code much cleaner and simpler (toggling is done by adding/removing span class) and it is completely themeable. This code is already in function so I just need to finish cookie stuff and I will release it.

    To get a picture:

    in forum-list.tpl.php add the following code where you want +/- icon:
    
    <?php if ($collapsible): // $collapsible is set in preprocess function ?>
      <span id="forum-collapsible-<?php print $forum_id;?>" class="forum-collapsible">&nbsp;</span>
    <?php endif; ?>
    
    in images.css add the following code:
    
    span.forum-collapsible {
      width: 9px;
      height: 100%;
      text-indent: -9999px;
      display: block;
      margin-left: 10px;
      float: right;
      background: transparent url(images/container_collapse.png) no-repeat center center;
    
    }
    
    span.container-collapsed {
      background: transparent url(images/container_expand.png) no-repeat center center;
    }
    
    greywolfsspirit’s picture

    @WorldFallz: Just give me a heads-up when you need it tested on D6.

    troky’s picture

    StatusFileSize
    new3.75 KB

    Here is new version that saves all data to one cookie and works with modifications in #213.
    Available in D7 cvs.

    pawi81’s picture

    I hope that it will be implemented in D6 soon in ;)

    troky’s picture

    You can check current functionality HERE

    WorldFallz’s picture

    very nice troky. The only hold up on the d6 stuff is the fact that d6 doesn't include the jquery cookie plugin. I need to either write the js to do it or we depend on that plugin. For d6, I think I should just write the cookie handling stuff without a dependency on the plugin.

    @pawi81 - i'm sure you mean well, but I can't think of anything less motivating than someone saying 'hurry up' when you're volunteering doing something in your spare time. :-( I hope to get to this later today.

    michelle’s picture

    @WorldFallz: If you're up for it, I'd prefer not to have the dependency. People complain enough about having to install stuff for AF. :(

    Thanks!

    Michelle

    WorldFallz’s picture

    agreed!

    pawi81’s picture

    @WorldFallz I'm sorry, that wasn't my intention :) I'm calm down and waiting for new rls, no hurry. I know the volunteering thing well.

    by the way you are all doing great job!

    greywolfsspirit’s picture

    @WorldFallz: I agree, take your time and get it right. :-) It's a work in progress and I'm sure we all agree that with the work you and Michelle have done so far is appreciated.

    Jim

    michelle’s picture

    Tagging because this should really get sorted before Alpha.

    Thanks for all the hard work on this. I appreciate it. :)

    Michelle

    WorldFallz’s picture

    I'm actively working on trying to get troky's code working on d6. From what I can tell there should be little if any changes necessary but I can't seem to get it working. The js loads, there are no errors, the handles appear, but they don't actually do anything. Hopefully I'll get it sorted soon.

    FYI I'm trying first using the jquery cookie plugin (so I actually haven't changed any of the code yet). THen once I can confirm it's working in d6, I can remove the dependency on the plugin.

    WorldFallz’s picture

    SUCCESS!!!!!!!!!!!

    I finally got it working on d6-- seems you also used the jquery 'once' plugin which I had to change to the core 'one' function. Now to get cookies working...

    michelle’s picture

    Yay! I've got a couple other things I'm working on and then I should be able to do alpha 4. :)

    Thanks!

    Michelle

    WorldFallz’s picture

    Status: Active » Needs review
    StatusFileSize
    new5.48 KB
    new7.18 KB

    ok, finally. Here we go.

    Sorry troky-- due to all the cookie handling involved, I ended up taking merlin's ctools collapsible js and simply modifying it for af. He had already done all the heavy lifting of the cookie handling so I didn't have to rewrite it. It can also be used almost unchanged for d7 (i'll post the d7 patch later or tomorrow).

    I've made myself cross eyed staring at and testing this thing-- please test it before you commit to make sure I didn't miss anything, lol.

    troky’s picture

    Few remarks:
    - use $forum_id instead $container_number to build collapsible element id because if you reorder forums and reload page it will collapse wrong containers
    - use span.advanced-forum-toggle-collapsed instead of span.advanced_forum-toggle-collapsed.
    - I don't see per-page remembered collapse settings is implemented yet?

    Anyway, nice job. I tried to port my code to D6 but after I found out that it uses old jQuery and no plugins (relevant to my patch) I quit. :)

    WorldFallz’s picture

    thanks for the review-- i'll make the changes you recommend.

    Also, yep-- i still need to add the per page settings.

    And I know what you mean-- i tried to convert your code first but it ended up being easier to just take merlins, lol. D7 will be much nice to do js with!

    fugazi’s picture

    Sorry for my bad english,

    when I click on a Forum, is there forum automatically folded. This is not very useful, it is possible to disable the fold. How can I make this.
    It would be nice if you add this to the admin area as a selection.

    I thank you for the wonderful work

    pawi81’s picture

    @fugazi this is an issue which the programmers here workin on it :) be patient please :)

    WorldFallz’s picture

    @troky...

    $forum_id instead $container_number

    I thought i knew what you meant by this, but since looking at the code to implement it i'm not sure. How can i use the forum id-- there can be multiple forum ids per table? If you could be a little more specific that would be great.

    troky’s picture

    Each forum container (that is actually collapsible) has different forum_id that is unique.

    Collapsible element id should be unique and persistent... container_number is just counter and gives you partial uniqueness per page but it isn't persistent.

    michelle’s picture

    I see what he's saying and I thought that's where the ID was coming from but it's not. Now I'm not sure if I was remembering wrong or if merlinofchaos changed that when he redid that template. At any rate, I'd be just fine with putting the actual TID of the container in the CSS ID for the container.

    Michelle

    WorldFallz’s picture

    ahhhh... ok ... so you mean change $container_number to $forum_id in the actual advanced_forum.naked.forum-list.tpl.php file?

    troky’s picture

    so you mean change $container_number to $forum_id in the actual advanced_forum.naked.forum-list.tpl.php file?

    Exactly.

    Maybe I had to write that $forum_id is actually TID for better understanding.

    WorldFallz’s picture

    awesome-- ok the first 2 items are done. Just working on the per page cookie using the format from your code. Then I think we'll be gtg.

    greywolfsspirit’s picture

    @Michelle & @WorldFallz: Is the current dev updated with the current patch in #227? Just trying to see if it's ready to test out. Been busy for a few days and been away from my system so I didn't know what the current status is yet. Thanks.

    Jim

    michelle’s picture

    No, I was a lazy bum last night and watched American Idol. :) Now WF is working on some other stuff so I'm waiting until she has it ready. :)

    Michelle

    greywolfsspirit’s picture

    Ok, thanks, Michelle. Not trying to rush anyone. Just since I have a site I can work with to test on, figured I'd offer to guinea pig it for ya :-)

    I was just checking, as I saw there was a dev update that came out the other day, and I didn't see the .js file that was created in the previous patch, so I held off installing until I checked in with you all to see what was going on, just in case. I'll hold until given the nod to test again.

    -Jim

    WorldFallz’s picture

    Here's the most recent patch (including troky's review comments above). This is 95% done if you want to test it out. The only left to do is make the cookie settings per page (its currently per container). I should get that done today or tomorrow.

    WorldFallz’s picture

    I forgot to mention this assume the js file is located in an advanced_forum/js subdirectory.

    WorldFallz’s picture

    There's also an alert line in the js file you'll probably want to remove, lol. Sorry about that.

    crispinbailey’s picture

    Subscribing

    michelle’s picture

    I likely won't get to this until Sunday. My son's birthday party is tonight and tomorrow I will be photographing all day. If anyone else can test this, that would be great. Thanks!

    Michelle

    greywolfsspirit’s picture

    I'll take a look at it in a couple minutes, Michelle.

    greywolfsspirit’s picture

    @WF: Which version is this being patched against? The dev version or the last release version? I tried installing it and the + for the collapse didn't show up (granted I tried just making the changes against the one patch to the one you just posted, and also got a warning that it couldnt find a file but it didnt show what file it was, perhaps that's the warning you are referring to in the js file? I just re-installed the vanilla dev copy that is current and will try it again in a bit.

    DoubleT’s picture

    Subscribing

    vidu_ram’s picture

    subscribing

    Andrew Gorokhovets’s picture

    subscribing

    michelle’s picture

    Sorry for the lack of action on this. My dev site is currently mired in mess from the legend background problem and I don't want to mix this in. Looks like greywolfsspirit had issues with it... Anyone have this working? Would be great to have an RTBC patch waiting for me when I'm ready to commit. :)

    Thanks,

    Michelle

    sansui’s picture

    Status: Needs review » Needs work

    I went ahead and applied the patch on my current dev install. Looking at configuration I see new options for collapsible options for none/toggle/fade. Did get a small reject file from the patch:

    ***************
    *** 19,24 ****
        variable_del('advanced_forum_topic_pager_max');
        variable_del('advanced_forum_get_new_comments');
        variable_del('advanced_forum_use_topic_navigation');
      }
      
      function advanced_forum_update_5000() {
    --- 19,25 ----
        variable_del('advanced_forum_topic_pager_max');
        variable_del('advanced_forum_get_new_comments');
        variable_del('advanced_forum_use_topic_navigation');
    +   variable_del('advanced_forum_collapsible_containers');
      }
      
      function advanced_forum_update_5000() {
    

    I had to create the js folder manually and move the javascript file into it, however the collapsible forum containers don't seem to work. There is no collapsible icon, and the headers simply act like the normal links.

    The only difference I'm seeing between having toggle on or off, is I get a javascript alert that displays the page location when the collapsible option is enabled.

    Seems like it needs more work

    WorldFallz’s picture

    i've been run over by the flu truck so i haven't had a clear enough mind for this the few days, but the patch should work against the current dev (don't think they're have been any commits since I rolled it). Though it would be good for if someone else could try.

    hopefully i'll be able to finish up the per page cookies once the haze of flu meds clears ;-)

    sansui’s picture

    After looking through the patch files for a while, as well as Troky's earlier comments, it seems like there's something missing in advanced_forum.naked.forum-list.tpl.php.

    It looks like the javascript file is supposed to find the last TH in the row and add the "span" snippet, but it doesn't add this span tag. I added the snippet below in the table heading manually.

    if ($collapsible): // $collapsible is set in preprocess function
    <span class="advanced-forum-toggle">&nbsp;</span>
    endif;

    After adding that, two little icons show up, and only one works (the one that is supposed to be created by the javascript file, which now shows up after modifying the tpl... weird?).

    Edit: After adding the span manually the first time, which caused the real one to show up, I removed the code and the javascript-created one still remains. Is that because of the cookie code?

    I guess the reason it seems to work on your end is that you already had the span generated, whereas when we are attempting the first patch without it, nothing shows up?

    sansui’s picture

    I cleared the cookies for the site, and the collapsible icon still shows up now. Really weird.. after first patching it definitely did not show up. Wasn't until I added the toggle span manually that is showed up. And now it shows up even after deleting my cookies, so I have no idea... but maybe this info will help you debug it further 0.o

    michelle’s picture

    I wiped out the mess I had and got a clean checkout. When I tried applying the patch, I got "patch: **** strip count o is not a number". Haven't a clue what that means and there's way too much to that patch to do it all manually. Sounds like there's some issues there, anyway, from what Sansui is reporting. Going to tackle the image stuff again and will wait on this.

    Michelle

    WorldFallz’s picture

    That's weird-- i'll get a fresh checkout and reroll.

    vidu_ram’s picture

    I also applied the patch in my dev site. It works fine for me except for that javascript alert (Also tried with deleting the cookies, clearing cache etc).
    As part of the collapsible container feature I have a need for configuring the default state also: Collapsed/normal for each forum and based on that initial page load should display the forums.
    Will this feature also be considered as part of the module if developed?
    As I need to see how to implement it for my requirement. Any comment on this front?.
    Thanks.

    troky’s picture

    Configuring default state per forum/container complicates code in way I don't like and I am not eager to do it in current phase of development.

    My idea to do this would be creating multiselect listbox on config page with list of all forums/containers and then in preprocess function add 'collapsed' class to selected container variable and adjusting template file to use it. I think javascript doesn't need to be altered in this case.

    Слава Юдаков’s picture

    how to disable this annoying collapsable containers?

    michelle’s picture

    Edit the template and remove the classes that trigger it.

    Michelle

    vidu_ram’s picture

    @torky: Thanks for the response. I will explore the idea putforth for Configuring default state per forum/container.

    pawi81’s picture

    @Michelle could you tell us where can we find it? I'm not a good coder;)

    Слава Юдаков’s picture

    @Michelle could you tell us where can we find it? I'm not a good coder;)

    you had to copy 'advanced_forum.naked.forum-list.tpl.php' to your theme folder and remove all classes 'ctools-collapsible-*' in it.
    then flush all caches.

    michelle’s picture

    Thanks, Слава Юдаков.

    Michelle

    WorldFallz’s picture

    ok, after much nyquil and codeine I'm back. ;-)

    I have no clue what could have been wrong with the previous patch, but I just rerolled it. I completely deleted advanced_forum, made a new checkout of the current dev, manually made the changes, and rerolled the patch with cvs diff -up. Hopefully this one applies correctly.

    I'm still working on the per page cookie settings-- but the rest is done.

    meustrus’s picture

    OK this whole issue is a big tl;dr but it's probably the right place to voice my concern. I've installed the latest dev version and there have been some troubles with this new "feature." Containers are collapsing when any link is clicked on inside them (including the links to the contained forums) and then on the next page view they remember that they were collapsed. It also seems that the container links that *should* be doing the collapsing are still causing a normal link to direct the user to the category page. I'm just wondering if this patch should be rolled back in the dev version until it works properly, or at least add an option to turn it off (which should probably be added anyway in the long term).

    WorldFallz’s picture

    the thread is getting long, so it's a bit hard to follow, but yes the current dev has problems (that's the whole point of dev releases afterall). And yes, this patch fixes those problems. The only thing remaining after applying the patch in 269 is to make the collapsible state per page instead of per container.

    The patch also add the config option to turn off the collapsible behavior completely.

    michelle’s picture

    @meustrus: Yes, it's broken. That's why she posted a new patch. And, honestly, if you could have been bothered to read the issue, you would have seen that turning it off is a simple matter of removing the classes from the template. This is the development head of an alpha branch. If you're going to be on the bleeding edge and then complain about something not working, tl;dr really doesn't cut it.

    Michelle

    WorldFallz’s picture

    wow, i'm behind on my geek slang-- i thought tl;dr was some sort of typo, lol. Had I known what it meant I wouldn't have been so polite in my reply. In the future, if you can't be bothered to read a thread then please don't feel entitled to post to it.

    michelle’s picture

    Category: bug » task
    Status: Needs work » Active

    #269 Looks good on my brief testing. The only thing is that the very first time I clicked the -, I could have sworn there was no + but then I clicked the blank spot and now it's working fine. So I'm not sure if there's a bug there or if I imagined it. LOL! Noting it here in case anyone else sees it.

    Changing the category since it's not buggy anymore but leaving it active to get that per page patch. Otherwise, this seems pretty good. I'll give it more than a 1 minute work out later and see if I see anything else.

    Thanks!

    Michelle

    greywolfsspirit’s picture

    I just did the patch here (by hand), and worked fine for me, but I too saw the strange non-appearance at first of the +, but like you, once I did it the first time, it works fine again.. shrugs.. damn drupal gremlins are hungry I guess, Michelle lol.

    Great work WF! Glad you're feeling better BTW!

    Confirming the patch does work so far.
    -Jim

    greywolfsspirit’s picture

    You're not the only one lost on the geek slang on that.. in fact.. I still am lol... but not important.

    *edit* nevermind, I got it now.

    meustrus’s picture

    I think that when it reaches 270 posts, it's perfectly valid for it to be tl;dr (too long; didn't read). Anyway I'm glad it's been fixed. I await the next -dev release; I'm in it for some features but obviously not this one and unless it's going to be weeks I think I can wait for it.

    As for complaining about being on the bleeding edge, I remember being leery about coming off of alpha3 for dev but deciding it was necessary because of x many features that I just couldn't have otherwise. I think it would be nice if there wasn't such a long wait between alpha releases. Is alpha4 coming pretty soon?

    michelle’s picture

    Not reading the entire issue, I could excuse. Not even bothering to read the very last post in the issue with the patch or the handful above that explain the current problem and how to get around it? No, not really.

    I never intended there to be such a gap between alphas but there were some pretty major changes that I wanted to get in all at once so subsequent upgrades weren't so painful. Pretty close, now. This was one of the major blockers.

    Michelle

    greywolfsspirit’s picture

    And also, keep in mind, nothing is guaranteed to anyone. These modules are updated and enhanced by people on THEIR time, so don't complain that something is 'taking too long'. These -dev or development versions are exactly that, modules being developed. Sure there will be bugs and glitches that come with them, along the way. Now, they could rush a release, then you would be here complaining, "this don't work right, or I get this error." or, you can give the developers the time they need to get as many of the bugs out, while also working to make the features work, give us all the best update that they can come up with along the way. Being a former software coder, I know personally what happens along the way of developing a module. You work on it, you get it working, someone has a suggestion that makes sense to add, then you have to work around to get it to work in the code you already have written. Along the way, other external modules get updated, such as views, for example. Now you have to go back and make sure that what you have written will work now with these unforseen updates. It's never simple to update your work when it is sometimes co-dependent on other modules. The work that Michelle, WorldFallz and various other contributors and testers have been doing is greatly appreciated by a lot of us out here, and if you can't take the time to read the posts (even if it's like the last 10 posts) to see what is the current status of the development, and see what issues are still happening, then that is your own fault. Next time before complaining, do a little reading. It would have saved a lot of this.

    Now, Michelle and WF, I apologize for my long-winded response about this. The work so far is coming together pretty well now. I've been playing with the current patch, and so far it was just the initial time that the +/- didnt show up when I went to the forums. Since then, it has been working as it should, so I call this patch dev worthy. Just make sure users clear their system caches out.

    -Greywolf

    michelle’s picture

    Thanks greywolfsspirit. Part of the problem is that I'm picky about alpha releases. While my dev snapshots are typically a mess, I do my best to make alphas actually usable in production. So I don't release them until I'm as sure as I can be. And development on AF goes in fits and starts... It's been harder and harder for me to keep going on it now that the forum it was created for is basically dead. Pushing myself to keep working on a module that I don't have much use for is hard. The passion is gone... I'm running in "don't want to disappoint the Drupal community" mode now.

    Michelle

    greywolfsspirit’s picture

    Well, I can't speak for everyone, Michelle, but I can speak for myself and I thank you for all the work you have put into this over the past few years. It is a nice addition to the basic forums in Drupal 6. Oh, I did finally get my navigation working (using the prev/next module). Never did get it working with the straight AF method. But I do appreciate your trying to help with that in the past. I know in my past writings of code, I seldom got thanks for the efforts I put forth, but I do thank those that help me along the way. So, again, Thank you for all the work you have put forth to the Drupal community. Okay, enough of the sappy sentiments, going back to my corner to keep an eye on further issues that come along that need to be tested.

    -Jim

    michelle’s picture

    Thanks, I appreciate it. :)

    Michelle

    a.ross’s picture

    Nice to see alpha 4 coming closer! I would love to help test, but unfortunately I don't have the time :( just had a daughter :).

    Thanks a bunch and keep up the good work!

    jen.c.harlan’s picture

    Well, this is scary. This is the exact functionality that my users have asked me for, and I hopped on here tonight to research how to collapse my subforums.

    I did have a question, and unlike the person complaining about it being too long to read, I did read as much of this discussion as I could. I didn't understand a lot of it, but I did read it. Is the final structure going to resemble comment #196? This is what my forums would like to be once we have a collapsible
    capability.

    Thank you all for all your great work. I can see how much work went into just this small thing. It's amazing to watch, I only wish I understood how to code this stuff so I could help. I am still at the level of learning to USE drupal, but one day, I will be able to help. :)

    michelle’s picture

    Sorry, no, we're not completely changing how the main page works, just making the containers collapsible. This is useful if you have a ton of forums and the user isn't interested in all of them and would like to collapse the containers s/he isn't interested in. The page already loads quite slowly. Adding in all the topics would be a mess unless some sort of ajax was used but that's beyond my skills.

    Michelle

    pawi81’s picture

    I saw that in newest dev version (6.2) is issue like this - when you click into the (-) at right corner to collapse forum you can unhide it - do you see it? ;-)

    how can uncollapse it?

    greywolfsspirit’s picture

    if it's the first time running the collapse, click where around the end of the forum block header line (where the [-] was) it's a known glitch that seems to happen the first time after installation, after that it should work like it is designed to.

    __Sander__’s picture

    It worked strange for me.
    After collapsing everything I could not uncollapse anything any longer.
    Had to switch this thing off...
    It's the latest dev.
    Do you need any extra information?
    And yes, I tried the built-in styles

    meustrus’s picture

    I'm having the same problem as #288. I was able to get them back with Firebug - it would seem that the <thead> element is also having its style.display toggled.

    In response to rant #279, thanks but I consider myself one of the people helping to develop this module. At least, for now. I want to go back to a stable release on my production site but I really need the features that are only in the dev release. I'm willing to deal with the dev release and help it along, but I'm frustrated when a large number of features that I didn't know were alpha 4 blockers are holding us up from getting a new stable release out. Maybe I just need to see the release plan to understand why so many things keep coming up before alpha 4? I can't find the roadmap anywhere.

    michelle’s picture

    Category: task » bug

    There is no roadmap. I've tried a couple of times but I never follow it so it was pointless. What gets added when is somewhat driven by what I need on my site, though not so much anymore since my site is pretty well dead, and somewhat based on what I feel like working on at any given moment. When someone comes along and offers to work on a feature like this one, I do my best to get it in because I don't get help all that often and it's really nice having something get added that I didn't have to do myself.

    Getting back on topic... Sounds like there's still some issues here. Setting this back to a bug report. I'm not a whole lot of help since I don't know js so I'm leaving this one up to WorldFallz and I'm going to spend some time working on the other alpha blockers.

    Michelle

    WorldFallz’s picture

    Try as I might, I can't seem to replicate any of the bugs reported here. I only have access to firefox 3.6.13 and IE 7.0.5730 in winxp -- i've tried with both using the various core af themes and everything seems to work fine.

    Also-- there's no way thead should be changed at all with the current code (that was happening in a previous version when using the ctools collapse js code).

    When testing this you need to make sure all vestiges of the previous code are gone (delete the advanced_forum folder and get a fresh copy as well as clear browser caches).

    it would be helpful if those testing could make sure to do that and report the exact os and browser version that has the bugs. thanks.

    I'm still working on the per page cookies, just having trouble getting it right.

    __Sander__’s picture

    I use this: Chromium 9.0.597.94 (73967)
    I'll try to reproduce it once again. However, I need to find a moment. I am doing it on a living site, so I don't want to disable it by my experiments

    MasterChief’s picture

    I tested on firefox 3.6.13, Opera 11.01 and IE 8.0.6001 and i don't have problems.

    meustrus’s picture

    I completely removed the AF files and installed the latest -dev, and also refreshed the JS combined file, and I'm still having the problem. Firefox 3.6.13 on OS X 10.6.6.

    michelle’s picture

    Works fine for me on FF 3.6.13, IE 8, Opera 11, and Chrome 9.0.597.98 all on Windows 7.

    Michelle

    MasterChief’s picture

    I don't say in #293 that i was on Vista :)

    __Sander__’s picture

    Does not it feel like the bug takes place on *nix environments? I've got Ubuntu

    MasterChief’s picture

    No problems with Safari 5.0.3 on Vista, someone have problems on Windows ?

    Seems to have only problems on OS X and Unix environments.

    PS :

    Meutrus is it working for you on OS X with Safari ?

    a.ross’s picture

    I tested (Ubuntu) and my containers completely disappear when I collapse them.

    __Sander__’s picture

    One possible reason that something works under Windows and does not work under *nix are big and small letters in names of whatever. In Windows they mean nothing.

    __Sander__’s picture

    Ok, let's give it a try.
    Please have a look at my forum.
    http://help.sander.su/
    Can you collapse and then uncollapse back?

    a.ross’s picture

    Hmm, upper and lowercase? This has got to do with the filesystem. ext has case sensitive file names, while FAT/NTFS don't.

    a.ross’s picture

    Same problem there Sander. If I collapse, container completely disappears.

    michelle’s picture

    @Sander: Not working on your site for me, either.

    It's working fine on http://shellsn.com/forum which is running the dev snapshot, not my CVS checkout for development. So it's not something uncommitted breaking this. I have no idea what it might be but maybe someone can take Firebug to my site and Sander's site and see what's different.

    Michelle

    a.ross’s picture

    Well, Sander's page has the exact same problem my local site has (which has a fresh install of the latest DEV snapshot). Whereas yours is, I presume, updated regularly?

    thead is being hidden, and I can remove the style="display: none;" with firebug, so it will be correct. I don't know how the JS is different... yet

    EDIT: Hmmmm, it toggles BOTH thead and tbody visibility independently. I have manually UNhidden the thead of a container, then uncollapsing shows the forums again but makes thead invisible once again.

    michelle’s picture

    I don't know why you'd presume that... I said it was running the dev snapshot.

    Given that we're all running the same code, my guess is a theme incompatibility. Try changing to Garland and see if that helps. Don't forget to flush the cache.

    Michelle

    a.ross’s picture

    Sorry, I figured it could have been a file, which is removed from CVS now.
    My local site is using Garland, so that rules that out.

    I noticed that on my and Sander's forums, the tables all have the advanced-forum-collapsed class, as opposed to your site. Removing this class doesn't make a difference though. But why would the classes differ?
    Edit: never mind, that's got to do with the stored cookie.

    a.ross’s picture

    As I suspected.

    Michelle, I noticed you have jQuery_update installed on your site. It made sense that an old, incompatible version of jQuery was the culprit. So, I installed jQuery update on my page at localhost, and it works properly now.

    This is tricky though, either jQuery_update must be a dependency for that feature, or the current code must be patched to work with the version jQuery that comes with D6.

    WorldFallz’s picture

    i only have a sec-- but I have jquery_update as well. Thanks for tracking this down guys. I'll remove it and see if I can get it working with stock d6 jquery. Otherwise I should be able to check the version of jquery in use and disable the toggle control if incompatible.

    WorldFallz’s picture

    and i just checked the version of jquery on sander's site and it's 1.2.6 -- definitely looks like that's the problem.

    a.ross’s picture

    Good luck mate!

    pawi81’s picture

    I have same problem like Sanders. When I will collapse it, containter dissapears totaly. I can uncollapse it.
    http://sky-watcher.pl/forum

    __Sander__’s picture

    Functions proprrly after installing jquery_update 6.x-2.0-alpha1 (the 6.x-1.0 did not help) and flushing the caches

    Nice work :)

    pawi81’s picture

    @__Sander__
    it works for me - thank you very much :-)

    meustrus’s picture

    It works now with jquery_update installed. Is it possible to only allow this feature to be enabled if that module is installed, and provide an explanatory message?

    michelle’s picture

    @a.ross: thanks for figuring this out.

    @WorldFallz: Great, thanks. It's not a critical feature so that would be fine.

    Michelle

    WorldFallz’s picture

    StatusFileSize
    new11.01 KB

    Ok here we go-- and we're back to troky's code ported to d6, lol.

    This should be the complete feature-- including per page cookies and should also fix the jquery version problem. I haven't had a chance to test it without jquery_update yet and I need to call it a night. I'll test it tomorrow, but I wanted to at least post it in case anyone wanted to have a go at it.

    __Sander__’s picture

    After applying the patch, the collapsible containers are gone.
    Is it what it was supposed to do?

    michelle’s picture

    #317 works fine for me with jquery update. I haven't tested it without, yet. I committed the patch to make it easier for others to test. Please do so. I have a couple other issues I really need to focus on so leaving this up to you folks again.

    Michelle

    MasterChief’s picture

    The '+' icon doesn't show in the latest dev version, only '-' icon is showing.

    michelle’s picture

    Oh, sure enough. It's so tiny I can barely see the difference between them and missed that. The functionality is fine. Just doesn't change the icon.

    I'm going to be immersed in #720118: Better handling of containers, forums, and subforums for a while and not in a position to commit anything new without having to go thru the hassle of saving off that work and getting a fresh checkout. So you folks will have to work off of patches for a while and I'll do a commit once I get that other stuff in. I'm working in the same file as this issue so the final patch may need a little bit of adjustment but nothing major.

    Thanks!

    Michelle

    michelle’s picture

    The work I'm doing in the other issue is restructuring things a bit. I currently (uncommitted and may change) have a structure that looks like this:

    <div class="table-wrap">
      <div class="container-name">The Whoniverse</div>
      <table class="forum-table forum-table-forums" id="container-1">
        <thead class="forum-header">
          <tr>
            <th class="forum-icon">Icon</th>
    

    I'm wondering if it's possible to move the +/- up to where the container name is and have it collapse the outside div down to just showing the name and not the table? Please don't spend time trying to actually do this yet as everything is still in flux. I just want to get a handle on weather or not it even can be done that way.

    To see visually what this would look like, see http://community.mybb.com/index.php . Not the underlying HTML, though. I don't like how they handled table headers and was concerned about accessibility with that method so I've done it with the wrapping div instead. At least for now... Still trying to get this all working right.

    Thanks,

    Michelle

    michelle’s picture

    Ok, I should have waited a bit before posting. This markup, now, is fairly likely to stay as is since it looks like it's working the way I want it.

      <div class="forum-table-wrap">
        <div class="forum-table-superheader">
          <div class="container-name"><?php print $table_info->name; ?></div>
          <?php if ($collapsible): ?>
            <span id="forum-collapsible-<?php print $table_info->tid; ?>" class="advanced-forum-toggle">&nbsp;</span>
          <?php endif; ?>
        </div>
        
        <table id="container-<?php print $table_info->tid; ?>" class="forum-table forum-table-forums">
          <thead class="forum-header">
            <tr>
              <th class="forum-icon"><?php print t('Icon');?></th>
              <th class="forum-name"><?php print t('Forum');?></th>
              <th class="forum-number-topics"><?php print t('Topics');?></th>
              <th class="forum-posts"><?php print t('Posts'); ?></th>
              <th class="forum-last-post"><?php print t('Last post'); ?></th>
            </tr>
          </thead>
    

    I moved the +/- code up to the new superheader and it works fine visually. But, of course the js doesn't work anymore. The effect I want is for the table to get hidden completely with just the superheader remaining. Is that possible to do? I don't know js at all so I don't know if I'm asking for a simple change or something that will make you hate me. :( Once these two issues are settled, though, that's the last of the major changes to this template. So you won't need to be redoing it yet again. :)

    Thanks!

    Michelle

    WorldFallz’s picture

    ah nice... i prefer the new layout. i'm not at my dev system atm, but i don't see anything obvious that won't work with the js (i won't know for sure though until i get a chance to try it out a little later).

    michelle’s picture

    Yeah, I do, too. This is something I've been considering doing for a very long time but never got around to it. Then I found that this layout made other stuff on that issue easier to do and I decided to go for it. I think it works better both in looks and functionality. Glad to hear that it doesn't sound like it will mess you up. :)

    Thanks,

    Michelle

    WorldFallz’s picture

    here's a tiny patch that fixes the image toggle not toggling.

    Also, i'm trying to get the js ready for the new tpl.php file but I'm mangling it somehow (probably not matching divs properly or something), if you could post the patch for it that would help, lol. Thanks.

    michelle’s picture

    I was hoping to have a patch for you to work against by now. Been putting quite a few hours into this trying to get it done but not quite there, yet. Just hang on... I'll have something for you ASAP.

    Thanks,

    Michelle

    __Sander__’s picture

    Is there any testing that has to be done now?
    Should I download the latest dev and run this patch to test it?

    michelle’s picture

    @Sander: Not yet, sorry. I got sidetracked by having to test/learn git before the changeover and some personal issues and haven't been able to finish up the patch that is holding up this one. Unfortunately, we're at a point right now that everything remaining before Alpha 4 needs my attention so there's not much there I can delegate. If anyone wants to help, the best thing I can ask for is to give the latest dev snapshot a thorough test and see if there's any bugs not already covered by issues. There's not very many people using it so there could be many bugs that I'm not aware of just because it hasn't gotten heavy use, yet. Once Alpha 4 comes out, there's nearly 2K sites on previous alphas that could be upgrading so I want to be sure it's solid.

    Michelle

    __Sander__’s picture

    I installed it, for the moment I see nothing wrong.
    The only things I keep carrying from one template to another are the moderator lists at forum-list.tpl.php and the image in css - now left only for comment_prune

    grootte’s picture

    I have tested the latest dev with the CSS fix and can confirm that this is working with jquery_update and is NOT working without jquery_update enabled.
    Which is a problem because CIVICRM is not working WITH jquery_update enabled.

    WorldFallz’s picture

    thanks so much for testing grootte-- i'll have to take another look at the code on a fresh site without jquery update.

    michelle’s picture

    Ok, finally, patch with the changed HTML over here: http://drupal.org/node/720118#comment-4157344

    Thanks!

    Michelle

    WorldFallz’s picture

    awesome! so you figured out git-- i'm still working on that one, lol. i should be able to look at this today or tomorrow. whoohoo... approaching the home stretch. af ftw, lol.

    michelle’s picture

    Ok, I committed / pushed the other stuff including a last minute change suggested by Troky to wrap the table in a div to make collapsing easier. If you need any more HTML tweaked, let me know. Otherwise, I think that one is all settled for the time being.

    Thanks!

    Michelle

    __Sander__’s picture

    Something is broken again or should I use some patch?
    Got the latest dev. I am not modifying forum-list.tpl.php
    The collapsibe containers are not working.

    P.S. Not that I need them much, but just for the sake of fixing everything before the alpha4

    michelle’s picture

    @Sander: WorldFallz hasn't put up the new patch, yet. Don't worry, I won't roll Alpha 4 without it.

    Michelle

    a.ross’s picture

    Ok, I've been having a go at jQuery anyway for my module (and have been successful), so let me have a look at that. To be continued.

    a.ross’s picture

    Fixed, including the icon, but cookie stuff doesn't seem to work and all containers start collapsed. Working WITHOUT jQuery_update though :)
    I'll do some more troubleshooting to see if I can get the cookie stuff to work again. I fancy a tasty cookie at this point anyways...

    EDIT: ok scrap that, cookie stuff is working. My cookie had too much yeast though, so it became immense. And because the cookie code is utterly evil at this point, that caused problems and I had to correct them using FireBug. Patch will follow next.

    a.ross’s picture

    StatusFileSize
    new3.71 KB

    There we go :)

    WorldFallz’s picture

    hey that's awesome a.ross-- only one thing I would suggest. Since we can now animate a div (as opposed to parts of a table), we can add a slide animation (using jquery slideToggle), which I suspect is probably the most common one people want and has been in jquery since v1.0.

    Thanks for updating the patch-- i seem lost in the bowels of git hell atm, lol.

    __Sander__’s picture

    Works now woth the patch!
    And it all looks much better now by the way :)

    michelle’s picture

    Patch in #340 looks good. Committed & pushed. Thanks, a.ross!

    Leaving this active for the moment because I didn't do any extensive testing. If no one reports any problems, I'm going to mark this fixed. Yay!

    Michelle

    WorldFallz’s picture

    and here's a patch that adds the slide option to current 2.x dev

    michelle’s picture

    Status: Active » Fixed

    Ok, added the patch in #344, put the option in the correct fieldset, fixed the capitalization, committed, and pushed. :)

    I did some more testing and this is looking pretty good. Tentatively marking it fixed, though feel free to re-open if I missed a problem.

    Thanks everyone for your hard work on this! I couldn't have done it without you.

    Michelle

    WorldFallz’s picture

    Status: Fixed » Active

    2.5+ years and 344 comments... whew. awesome work everyone!

    michelle’s picture

    Status: Active » Fixed

    I'm guessing you didn't mean to set it active...?

    Michelle

    WorldFallz’s picture

    omg of course not, stupid cross posting. ;-)

    michelle’s picture

    Good. :) I'm hoping this is it and this monster issue is fixed for good. LOL! Once an issue goes to page 2, it's such a PITA.

    Thanks again for getting this moving, finally. :)

    Michelle

    michelle’s picture

    Version: 6.x-2.x-dev » 7.x-2.x-dev
    Category: bug » task
    Status: Fixed » Patch (to be ported)

    Oh, bah, I forgot this can't be marked fixed, yet. Still needs to get finished in D7. Thankfully troky is awesome about getting that stuff done so this should be really, really fixed soon. :)

    Michelle

    a.ross’s picture

    Nice one WorldFallz, I thought you meant to entirely replace the fade effect by the slide effect, but this is a much better idea!

    troky’s picture

    Status: Patch (to be ported) » Fixed

    Collapsible containers in 7.x are done a long time ago (even slide-up/down effect). Porting is not needed :)

    michelle’s picture

    They are? Goodness, you're quicker even than I realized! Thanks! :)

    Michelle

    __Sander__’s picture

    Wow! The slide effect is cool!

    Status: Fixed » Closed (fixed)

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

    tommy290’s picture

    I read through this and do not understand how I can implement this for my Drupal 6 forums. Is it only for Drupal 7? Is there a way to get collapsible forums in Drupal 6?

    a.ross’s picture

    You need the development version (6.x-2.x-dev)! I'm not sure if even alpha4 has it.

    EDIT: on second thought, 6.x-2.x-alpha4 also has it. But you'd probably be better off using 6.x-2.x-dev in the case of this module.

    meustrus’s picture

    Who says you're better off with -dev? Unless there's a specific feature you want that isn't in the latest alpha, I've found it's really annoying to have some half-baked features popping up and needing to update every couple of weeks. Besides, I'm sure he wants something that's OK for a live website, not something that's supposed to be for dev only.

    a.ross’s picture

    Yeah, whatever you say. Ask the module developers and then come back to me. If you dare. And let's stop reviving this issue that's been closed for ages, thanks...

    Oh, and if you don't want new features, you better not update anything...