Closed (fixed)
Project:
Advanced Forum
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2008 at 19:47 UTC
Updated:
16 Nov 2011 at 00:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
michelleThanks for doing this. :)
Michelle
Comment #2
grn commentedThe 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 :-)
Comment #3
psicomante commentedwonderful! Can we add +/- icons?
Comment #4
michelleChanging status so I can find it easier. It may be a bit until I can get to this, unfortunately.
Michelle
Comment #5
grn commentedHey Psicomante
Yes.
Comment #6
psicomante commentedModified 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)
Comment #7
grn commentedHey Psicomante, it looks nice.
I tried it out.
Please validate your content at: http://validator.w3.org/
Comment #8
grn commentedI 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).
patch -p0 < advanced_forum_6.x-1.0-alpha2_collapsible_containers.patchfrom the sites/all/modules folderHmm 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.
Comment #9
michelleVery 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
Comment #10
michelleOk, 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
Comment #11
grn commentedHey.
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.
Comment #12
michelleGetting 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
Comment #13
grn commentedFor 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.
Comment #14
psicomante commenteddid you add my patch?
Comment #15
grn commentedI will add the patch if someone makes it XHTML valid.
Comment #16
psicomante commenteddone it!
Comment #17
grn commentedNice 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.
Comment #18
psicomante commentedi thought about it yesterday. I think there's a better way to do this: using css classes and recycle code from collapse function.
Comment #19
jannalexx commented#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.
Comment #20
grn commentedGallery 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.
Comment #21
michelleYeah, 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
Comment #22
grn commentedI 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 :-)
Comment #23
grn commentedCollapsible forum Status
Settings:
New features:
At #8 (http://drupal.org/node/291084#comment-957056).
Comment #24
psicomante commentedGreat 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?
Comment #25
grn commentedHey.
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.
Comment #26
michellegrn - Sorry, I missed your question. The forum container names can be gotten with variable_get('forum_containers', array());
Michelle
Comment #27
grn commentedThanks, I will look into it.
Comment #28
michelleJust 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
Comment #29
psicomante commentedThe 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?
Comment #30
grn commentedMichelle 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).
Comment #31
grn commentedFind 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.
But I am missing something here..... (not $container.. but something like $container->name).
Comment #32
michelleI'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
Comment #33
grn commentedThis is the latest patch.
Comment #34
jannalexx commentedwhat about 5.x ?
Comment #35
grn commentedYou could check out the patch, and try to implement the same changes to 5.x. I won't support 5.x...
Comment #36
michelleOk, 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
Comment #37
michelleOk, 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:
<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
Comment #38
michelleActually, 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
Comment #39
grn commentedHey.
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.
Comment #40
michelleOk, 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.
<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
Comment #41
grn commentedThats 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.
Comment #42
michelleSounds 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
Comment #43
psicomante commentedThanks 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.
Comment #44
grn commentedHmm, 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:
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");
Comment #45
grn commentedI have attached a hardcoded .js. Collapsing works fine as far as I can test. The cookie function is not working.
Comment #46
michelleI 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
Comment #47
cridenour commentedWell 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.
Comment #48
neclimdulyuck... cookies everywhere? your users have to send those to the server on every request.
There's got to be a better way.
Comment #49
grn commentedHmm 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.
Comment #50
cridenour commentedgrn:
You asked how you could avoid hard-coding each collapse/expand call. I suggest making it a static function.
Comment #51
grn commentedcridenour - 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.
Comment #52
michelleI'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
Comment #53
cridenour commentedMichelle:
That is exactly how I would have approached.
I'll look into the jQuery later this evening.
Comment #54
grn commentedThanks 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
With the attached js file, we should have some functionality.
Please feedback on this when you get the time :-)
Comment #55
michelleI 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
Comment #56
grn commentedThe 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.
Comment #57
michelleWell, 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
Comment #58
jannalexx commentednice approach..
can you please point a delicate way to load the javascript "advanced_forum.js" on 5.x (and 6.x if different)?
Comment #59
michelle@jannalexx - It's loaded via drupal_add_js.
@grn - Ok, so here's the "to do" as I see it:
Anything I'm missing? Are you able to tackle these?
Thanks!
Michelle
Comment #60
grn commentedMichelle: 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
and not an img?
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).
Comment #61
grn commentedTwo 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..Comment #62
grn commentedI found the path thing: drupal_get_path('module', 'advanced_forum')
Comment #63
jannalexx commentedfunction 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?
Comment #64
grn commentedjannalexx: 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.
Comment #65
grn commentedAdd 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.
Comment #66
michelle@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
Comment #67
cridenour commentedSorry 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).
Comment #68
grn commentedIn
advanced_forum_init() {addjquery_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
looking like this:
This of course assumes initially expanded containers.
EDIT: The onclick:
<?php print 'onclick="jq_collapse(\''.$child_id.'\', \''.drupal_get_path('module', 'advanced_forum').'\')"';?>Comment #69
michellejquery_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
Comment #70
grn commentedThe jQuery plugins module must be installed.
The jQuery Cookie must be manually installed in jQuery plugins. The problem is stated at #30.
Comment #71
michelle@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
Comment #72
grn commentedYou 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 ;-)
Comment #73
michelleNo, 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
Comment #74
grn commentedWe 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.
Comment #75
michelleOk, 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
Comment #76
michelleNote 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
Comment #77
grn commentedA) 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");infunction 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?
Comment #78
michelleA) 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
Comment #79
grn commentedA) Yes it worked that way in the early versions of my inline jQuery.. the image src changed every time a toggle was initiated.
Comment #80
cridenour commentedWith 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.
Comment #81
michelle@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
Comment #82
cridenour commentedI 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.
Comment #83
cridenour commentedAttached 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 :)
Comment #84
cridenour commentedHmm 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.
Comment #85
michelleYeah, 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:
<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
Comment #86
cridenour commented@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 :)
Comment #87
michelle@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
Comment #88
michelleOk, patch in #83 comitted. Thanks for jumping in, cridenour.
Remaining issues:
I can do #2 and probably #3 but I need help with #1.
Thanks,
Michelle
Comment #89
michelleOk, #2 is done. Still need help with #1.
Michelle
Comment #90
cridenour commented#1 done.
Comment #91
michelleWhen I apply this, the icon changes, which is great, but the states stop getting saved, which is not good. :(
Michelle
Comment #92
cridenour commentedOn 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.
Comment #93
michelleYes, 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
Comment #94
grn commentedUser 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!
Comment #95
halkeye commentedOn 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.
Comment #96
michelle@halkeye - Whoops. Missed that. No need to make a patch. I can fix it. Thanks for letting me know.
Michelle
Comment #97
michelle@cridenour - any progress on this? We're almost there. :)
Thanks,
Michelle
Comment #98
cridenour commentedIn 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. :)
Comment #99
michelleAt 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
Comment #100
cridenour commentedEvery 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.
Comment #101
michelleI 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
Comment #102
michelleShould 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
Comment #103
michelleAnd 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
Comment #104
cridenour commentedSorry 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
Comment #105
michelleI 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
Comment #106
michelleNow 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
Comment #107
akiecs commentedWill 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
Comment #108
michelle@akiecs - This won't work on either version until someone writes it.
Michelle
Comment #109
grn commentedHi.
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?
Comment #110
michellegrn - 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
Comment #111
grn commentedOK
Comment #114
michelleComment #115
NeoID commentedFor 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)
Comment #116
michelleJust 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
Comment #117
andrewsuth commentedGood 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.
Comment #118
michelle@andrewsuth: No, they won't be sortable because they aren't created with theme_table.
Michelle
Comment #119
michelleNotes 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
Comment #121
apanag commentedHello,
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.
Comment #122
michelleI 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
Comment #123
apanag commentedI 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
Comment #124
apanag commentedDo we have any feedback on this?
apanag
Comment #125
merlinofchaos commentedThis commit should fix that: http://drupal.org/cvs?commit=261180
Comment #126
apanag commentedYes 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.
Comment #127
michelleAwesome, thanks!
Michelle
Comment #128
apanag commented@merlinofchaos
I have some problems with the last version of the ctools.
We have an html structure with a table:
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
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
Comment #129
apanag commentedHello 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.
Comment #130
michelleThanks. 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
Comment #131
SamanthaV commentedAny 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
Comment #132
michelle@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
Comment #133
michelleWith regret, moving this to D7.
Michelle
Comment #134
khaji00 commentedI could test this for D6, i also have a need for this.
Comment #135
michelle2.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
Comment #136
WorldFallz commentedpatch 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.
Comment #137
michelleThanks, 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
Comment #138
WorldFallz commentedwell-- thats turned out to be WAY easier than I thought! Patch attached.
Comment #139
WorldFallz commentedAnd as a bonus the patch included two fixes for php notices i'd forgotten I added ;-)
Comment #140
michelleAwesome, thanks! I'm just about to head out but will try to look at this soon.
Michelle
Comment #141
WorldFallz commentedno worries-- whenever. I'm going to add a collapsed/expanded indicator also so there will be at least one more patch before you commit.
Comment #142
WorldFallz commentedbah, crosspost
Comment #143
WorldFallz commentedOK, 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.
Comment #144
WorldFallz commentedAnd now with less spelling errors (it still doesn't work though).
Comment #145
WorldFallz commentedI 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. ;-).
Comment #146
WorldFallz commentedI'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?
Comment #147
WorldFallz commentedJust had another thought-- do you want this to be always active, or should it be an option at admin/settings/advanced-forum?
Comment #148
WorldFallz commentedHere'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.
Comment #149
michelleYou'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
Comment #150
WorldFallz commentedyeah -- 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.
Comment #151
michelleI 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
Comment #152
trickli commentedHi
There is no includes/advanced_forum_preprocess_forum_list.inc file anymore, so how to change? Using 6.x-1.1.
Thanks,
Comment #153
michelleThat 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
Comment #154
WorldFallz commentedno worries ;-)
Comment #155
michelleOk, 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
Comment #156
ericduran commented@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.
Comment #157
WorldFallz commentedi should have time to look at this today and reroll as necessary....
Comment #158
michelleI 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
Comment #159
michelleI 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
Comment #160
WorldFallz commentedok 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.
Comment #161
WorldFallz commentedduh... boy i'm slow today, lol.
ctools_add_js("collapse-div");needs to bectools_add_js("collapsible-div");;-)Comment #162
michelleWell, 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
Comment #163
WorldFallz commentedok, 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)
Comment #164
WorldFallz commentedand cross posted, this is just not my day , lol.
Comment #165
michelleNo 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
Comment #166
WorldFallz commentedhappy i can finally help out on af!
here's tiny patch that fixes the missing backgrounds.
Comment #167
michelleNot 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
Comment #168
WorldFallz commentednope--- 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?
Comment #169
michelleIt 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
Comment #170
WorldFallz commentedah.... 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.
Comment #171
WorldFallz commentedok, all encompassing patch that fixes all the little issues-- against current dev.
Comment #172
MasterChief commentedI 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.
Comment #173
michelleI 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
Comment #174
MasterChief commentedI am agreeing with Michelle.
Subscribe.
Comment #175
greywolfsspirit commentedMaybe 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.
Comment #176
michelleAh, 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
Comment #177
greywolfsspirit commentedOkay 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.
Comment #178
michelleChanging the status because this introduced a serious regression that needs to be fixed before alpha 4.
Michelle
Comment #179
michelleI 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
Comment #180
michelleDecided 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
Comment #181
WorldFallz commentedwow-- 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?
Comment #182
michelleThat'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
Comment #183
michelleShoot, 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
Comment #184
michelleJust 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
Comment #185
pawi81 commented@Michelle sorry for my language :-)
Comment #186
michelle@pawi81: No need to apologize. You write English better than I write Polish. ;) What I said was to clarify, not criticize.
Michelle
Comment #187
greywolfsspirit commentedI 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.
Comment #188
WorldFallz commentedone 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.
Comment #189
pawi81 commented@WorldFallz I think that I already reported that to Michelle. Thjs is really annoying :)
Comment #190
michelle@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
Comment #191
WorldFallz commentedexcellent -- 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.
Comment #192
WorldFallz commentedi'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.
Comment #193
greywolfsspirit commentedMaybe 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
Comment #194
pawi81 commented@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.
Comment #195
WorldFallz commentedThe 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.
Comment #196
greywolfsspirit commented@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." :-)
Comment #197
WorldFallz commentedActually 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.
Comment #198
WorldFallz commentedok-- 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.
Comment #199
WorldFallz commentedalso, it doesn't remember between page loads but I can always add that if desired.
Comment #200
michelleCustom 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
Comment #201
WorldFallz commentedno 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!
Comment #202
WorldFallz commentedok this one works for more than one toggle, I have no clue what's wrong with the other one-- probably a typo somewhere.
Comment #203
greywolfsspirit commentedTried 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.
Comment #204
WorldFallz commentedawesome -- 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.
Comment #205
greywolfsspirit commented@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
Comment #206
troky commentedI'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
Comment #207
WorldFallz commented1. 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!
Comment #208
troky commented1. 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
to advanced-forum.naked.style.css
2, 3 & 4. Agreed.
Comment #209
WorldFallz commentedah --- i misunderstand what you were recommending. Agreed on #1 as well. ;-)
Comment #210
michelleSorry, 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
Comment #211
troky commentedAttached 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">Comment #212
WorldFallz commentedawesome troky-- i'll tweak this for d6 and should have a patch rolled later today.
Comment #213
troky commentedPlease 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:
Comment #214
greywolfsspirit commented@WorldFallz: Just give me a heads-up when you need it tested on D6.
Comment #215
troky commentedHere is new version that saves all data to one cookie and works with modifications in #213.
Available in D7 cvs.
Comment #216
pawi81 commentedI hope that it will be implemented in D6 soon in ;)
Comment #217
troky commentedYou can check current functionality HERE
Comment #218
WorldFallz commentedvery 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.
Comment #219
michelle@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
Comment #220
WorldFallz commentedagreed!
Comment #221
pawi81 commented@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!
Comment #222
greywolfsspirit commented@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
Comment #223
michelleTagging because this should really get sorted before Alpha.
Thanks for all the hard work on this. I appreciate it. :)
Michelle
Comment #224
WorldFallz commentedI'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.
Comment #225
WorldFallz commentedSUCCESS!!!!!!!!!!!
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...
Comment #226
michelleYay! I've got a couple other things I'm working on and then I should be able to do alpha 4. :)
Thanks!
Michelle
Comment #227
WorldFallz commentedok, 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.
Comment #228
troky commentedFew 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. :)
Comment #229
WorldFallz commentedthanks 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!
Comment #230
fugazi commentedSorry 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
Comment #231
pawi81 commented@fugazi this is an issue which the programmers here workin on it :) be patient please :)
Comment #232
WorldFallz commented@troky...
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.
Comment #233
troky commentedEach 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.
Comment #234
michelleI 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
Comment #235
WorldFallz commentedahhhh... ok ... so you mean change $container_number to $forum_id in the actual advanced_forum.naked.forum-list.tpl.php file?
Comment #236
troky commentedExactly.
Maybe I had to write that $forum_id is actually TID for better understanding.
Comment #237
WorldFallz commentedawesome-- 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.
Comment #238
greywolfsspirit commented@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
Comment #239
michelleNo, 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
Comment #240
greywolfsspirit commentedOk, 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
Comment #241
WorldFallz commentedHere'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.
Comment #242
WorldFallz commentedI forgot to mention this assume the js file is located in an advanced_forum/js subdirectory.
Comment #243
WorldFallz commentedThere's also an alert line in the js file you'll probably want to remove, lol. Sorry about that.
Comment #244
crispinbailey commentedSubscribing
Comment #245
michelleI 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
Comment #246
greywolfsspirit commentedI'll take a look at it in a couple minutes, Michelle.
Comment #247
greywolfsspirit commented@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.
Comment #248
DoubleT commentedSubscribing
Comment #249
vidu_ram commentedsubscribing
Comment #250
Andrew Gorokhovets commentedsubscribing
Comment #251
michelleSorry 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
Comment #252
sansui commentedI 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:
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
Comment #253
WorldFallz commentedi'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 ;-)
Comment #254
sansui commentedAfter 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"> </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?
Comment #255
sansui commentedI 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
Comment #256
michelleI 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
Comment #258
WorldFallz commentedThat's weird-- i'll get a fresh checkout and reroll.
Comment #261
vidu_ram commentedI 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.
Comment #262
troky commentedConfiguring 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.
Comment #263
Слава Юдаков commentedhow to disable this annoying collapsable containers?
Comment #264
michelleEdit the template and remove the classes that trigger it.
Michelle
Comment #265
vidu_ram commented@torky: Thanks for the response. I will explore the idea putforth for Configuring default state per forum/container.
Comment #266
pawi81 commented@Michelle could you tell us where can we find it? I'm not a good coder;)
Comment #267
Слава Юдаков commented@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.
Comment #268
michelleThanks, Слава Юдаков.
Michelle
Comment #269
WorldFallz commentedok, 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.
Comment #270
meustrus commentedOK 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).
Comment #271
WorldFallz commentedthe 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.
Comment #272
michelle@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
Comment #273
WorldFallz commentedwow, 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.
Comment #274
michelle#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
Comment #275
greywolfsspirit commentedI 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
Comment #276
greywolfsspirit commentedYou'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.
Comment #277
meustrus commentedI 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?
Comment #278
michelleNot 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
Comment #279
greywolfsspirit commentedAnd 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
Comment #280
michelleThanks 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
Comment #281
greywolfsspirit commentedWell, 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
Comment #282
michelleThanks, I appreciate it. :)
Michelle
Comment #283
a.ross commentedNice 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!
Comment #284
jen.c.harlan commentedWell, 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. :)
Comment #285
michelleSorry, 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
Comment #286
pawi81 commentedI 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?
Comment #287
greywolfsspirit commentedif 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.
Comment #288
__Sander__ commentedIt 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
Comment #289
meustrus commentedI'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.
Comment #290
michelleThere 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
Comment #291
WorldFallz commentedTry 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.
Comment #292
__Sander__ commentedI 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
Comment #293
MasterChief commentedI tested on firefox 3.6.13, Opera 11.01 and IE 8.0.6001 and i don't have problems.
Comment #294
meustrus commentedI 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.
Comment #295
michelleWorks fine for me on FF 3.6.13, IE 8, Opera 11, and Chrome 9.0.597.98 all on Windows 7.
Michelle
Comment #296
MasterChief commentedI don't say in #293 that i was on Vista :)
Comment #297
__Sander__ commentedDoes not it feel like the bug takes place on *nix environments? I've got Ubuntu
Comment #298
MasterChief commentedNo 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 ?
Comment #299
a.ross commentedI tested (Ubuntu) and my containers completely disappear when I collapse them.
Comment #300
__Sander__ commentedOne 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.
Comment #301
__Sander__ commentedOk, let's give it a try.
Please have a look at my forum.
http://help.sander.su/
Can you collapse and then uncollapse back?
Comment #302
a.ross commentedHmm, upper and lowercase? This has got to do with the filesystem. ext has case sensitive file names, while FAT/NTFS don't.
Comment #303
a.ross commentedSame problem there Sander. If I collapse, container completely disappears.
Comment #304
michelle@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
Comment #305
a.ross commentedWell, 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... yetEDIT: 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.
Comment #306
michelleI 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
Comment #307
a.ross commentedSorry, 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.
Comment #308
a.ross commentedAs 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.
Comment #309
WorldFallz commentedi 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.
Comment #310
WorldFallz commentedand i just checked the version of jquery on sander's site and it's 1.2.6 -- definitely looks like that's the problem.
Comment #311
a.ross commentedGood luck mate!
Comment #312
pawi81 commentedI have same problem like Sanders. When I will collapse it, containter dissapears totaly. I can uncollapse it.
http://sky-watcher.pl/forum
Comment #313
__Sander__ commentedFunctions proprrly after installing jquery_update 6.x-2.0-alpha1 (the 6.x-1.0 did not help) and flushing the caches
Nice work :)
Comment #314
pawi81 commented@__Sander__
it works for me - thank you very much :-)
Comment #315
meustrus commentedIt 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?
Comment #316
michelle@a.ross: thanks for figuring this out.
@WorldFallz: Great, thanks. It's not a critical feature so that would be fine.
Michelle
Comment #317
WorldFallz commentedOk 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.
Comment #318
__Sander__ commentedAfter applying the patch, the collapsible containers are gone.
Is it what it was supposed to do?
Comment #319
michelle#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
Comment #320
MasterChief commentedThe '+' icon doesn't show in the latest dev version, only '-' icon is showing.
Comment #321
michelleOh, 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
Comment #322
michelleThe 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:
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
Comment #323
michelleOk, 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.
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
Comment #324
WorldFallz commentedah 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).
Comment #325
michelleYeah, 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
Comment #326
WorldFallz commentedhere'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.
Comment #327
michelleI 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
Comment #328
__Sander__ commentedIs there any testing that has to be done now?
Should I download the latest dev and run this patch to test it?
Comment #329
michelle@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
Comment #330
__Sander__ commentedI 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
Comment #331
grootte commentedI 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.
Comment #332
WorldFallz commentedthanks so much for testing grootte-- i'll have to take another look at the code on a fresh site without jquery update.
Comment #333
michelleOk, finally, patch with the changed HTML over here: http://drupal.org/node/720118#comment-4157344
Thanks!
Michelle
Comment #334
WorldFallz commentedawesome! 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.
Comment #335
michelleOk, 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
Comment #336
__Sander__ commentedSomething 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
Comment #337
michelle@Sander: WorldFallz hasn't put up the new patch, yet. Don't worry, I won't roll Alpha 4 without it.
Michelle
Comment #338
a.ross commentedOk, 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.
Comment #339
a.ross commentedFixed, 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.
Comment #340
a.ross commentedThere we go :)
Comment #341
WorldFallz commentedhey 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.
Comment #342
__Sander__ commentedWorks now woth the patch!
And it all looks much better now by the way :)
Comment #343
michellePatch 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
Comment #344
WorldFallz commentedand here's a patch that adds the slide option to current 2.x dev
Comment #345
michelleOk, 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
Comment #346
WorldFallz commented2.5+ years and 344 comments... whew. awesome work everyone!
Comment #347
michelleI'm guessing you didn't mean to set it active...?
Michelle
Comment #348
WorldFallz commentedomg of course not, stupid cross posting. ;-)
Comment #349
michelleGood. :) 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
Comment #350
michelleOh, 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
Comment #351
a.ross commentedNice one WorldFallz, I thought you meant to entirely replace the fade effect by the slide effect, but this is a much better idea!
Comment #352
troky commentedCollapsible containers in 7.x are done a long time ago (even slide-up/down effect). Porting is not needed :)
Comment #353
michelleThey are? Goodness, you're quicker even than I realized! Thanks! :)
Michelle
Comment #354
__Sander__ commentedWow! The slide effect is cool!
Comment #356
tommy290 commentedI 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?
Comment #357
a.ross commentedYou 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.
Comment #358
meustrus commentedWho 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.
Comment #359
a.ross commentedYeah, 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...