Hi,
As part of the collapsible container feature I required a need for configuring the default state also: Collapsed/normal for forums/Container and based on that initial page load should display the forums.
(http://drupal.org/node/291084#comment-4062936)
@Torky responded:
Configuring default state per forum/container complicates code in way I don't like and I am not eager to do it in current phase of development.
My idea to do this would be creating multiselect listbox on config page with list of all forums/containers and then in preprocess function add 'collapsed' class to selected container variable and adjusting template file to use it. I think javascript doesn't need to be altered in this case.
Based on Torky's suggestion I made changes to advanced_forum 6.x-2.x-dev (March 30th release). It works fine with the list of containers as Im using 'forum_containers' .
If required the same can be enhanced for forums but wondering how to go about.
Attached is the patch for this. Any feedback/review on this please let me know.
Thanks.
Comments
Comment #1
Anonymous (not verified) commentedgreat work
applied and tested on my site
Comment #2
mcdruid commentedHi vidu_ram, sorry for the long delay in getting this looked at.
I've attached a patch of your changes which I fixed up to apply to the latest 2.x dev release.
However, as I fixed up your patch I noticed that you're doing the checking of containers against the advanced_forum_default_collapsed_list in the JS, rather than the preprocess function as suggested by troky.
Could you explain why you've done it this way (and your initial_load implementation) rather than through preprocess? I can think of some reasons, but would like to understand your thinking.
AFAICS this does work, and I'd like to get the functionality committed.
Comment #3
vidu_ram commentedHi Mcdruid,
Thanks for the response and sorry from my end too for the little delay in responding.
The patch works pretty fine.
Reason for going in with changes in js is first time I want the listing (collapsed or non collapsed) based on the default configuration and later on wanted to remember the status of the list and list accordingly, this way the user is benefited as it lists the way the user was browsing the forum list.
Let me know your thoughts on the same.
Thanks
vidu_ram
Comment #4
michelleThe question was answered. Setting back to needs review to move things along.
Comment #5
mcdruid commentedPatch rolled again to apply to latest dev - needs to be reviewed.
Comment #6
mcdruid commentedThanks for this vidu_ram, and sorry it has taken such a long long time to get in.
Committed to 6.x-2.x-dev
Comment #7
mcdruid commentedJust committed a small tweak to this, as it was causing in an error on the settings page:
Comment #8
vidu_ram commentedThanks for the update.
Will the same be put forth in 7.x also?
Comment #9
troky commentedPatch adapted for 7.x... Please test.
Comment #10
vidu_ram commentedThanks troky.
Tested it. It works fine.
Note: When applying patch using git apply af7_1121208_1.patch
got error as fatal: patch with only garbage at line 5
So tried applying patch with patch -p1 < af7_1121208_1.patch
went through fine.
Comment #11
troky commentedCommitted. Thanks for the patch.
Comment #13
vidu_ram commentedHi Troky,
When will this feature get added up in the release version?
Thanks
vidu_ram
Comment #14
troky commentedit is in dev already. 2.1 release soon.
Comment #15
vidu_ram commentedThanks Troky. Saw it in dev version but wanted to know when it will be part of release version.