Adding a depth option to subpglist

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Adding a depth option to subpglist

McBride, Ian S.
This adds a depth setting to the subpglist node, which can be either 1 (previous default) or 2. This also adds section_prefix, title_prefix, title_suffix, and section_suffix formatting options to the node form to allow those lines to be different than a standard <li>.

This allows the subpglist to be used to display items in categories within the list, provided the site hierarchy is set up this way. I added this to allow subpglist to be used for things like:
http://www.middlebury.edu/students
http://miis.babywhale.net/templates/list_of_subpages.php
(note: unlike those two examples, the section headers are still links to their pages in this implementation)

I also made a minor change to the column algorithm to ensure that all children of a section are kept in the same column.

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=450372
or send a blank email to [hidden email]

monster_menus.20090913.patch (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Adding a depth option to subpglist

Dan Wilga-2
At 10:44 AM -0400 8/13/09, McBride, Ian wrote:
>This adds a depth setting to the subpglist node, which can be either
>1 (previous default) or 2. This also adds section_prefix,
>title_prefix, title_suffix, and section_suffix formatting options to
>the node form to allow those lines to be different than a standard
><li>.

I have reviewed this, and am having some problems. Perhaps it works
for you in your particular case, but for me it gives some
less-than-great results. These are the suggested changes/fixes:

1. Reduce the hook_update number by one. (See previous message.)

2. Add a line to the hook_update to set the correct default of 1 for
the "depth" field in any existing rows.

3. The last grouping is missing its section_suffix.

4. I'm seeing something odd, in that the section title is repeated as
the first subtitle:

   [col_prefix][title_prefix]American Studies[title_suffix][section_prefix]
   [row_prefix]American Studies[row_suffix]
   [row_prefix]Courses[row_suffix]
   [row_prefix]Faculty & Staff[row_suffix][section_suffix]

5. I think you also happen to have the correct number of items in
each column to keep them from being ragged. In my test, I ended up
with the section heading and one subpage in the first column, and the
remaining subpages at the top of the second column. This is not very
easy to read.

6. You're going to hate me for saying this, but I really think this
code should be reworked to handle any value for "depth", not just 1
or 2. By applying the correct CSS styles, nested <ul> tags can be
very useful for this sort of thing. The section/title pre/suffix
fields are also not needed if your CSS selectors are done correctly.
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=450446
or send a blank email to [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Adding a depth option to subpglist

McBride, Ian S.
In reply to this post by McBride, Ian S.
Dan,

Thank you for the feedback on this. I've rerolled the patch to address your concerns.

1. The update hook is now monster_menus_update_6408

2. The update hook now sets the value of the depth column to 1

3-6. The loop that handles printing has been wholly reworked with the idea that this will created nested lists (or nested section_prefix's with row_prefix items, so I guess that would support dl/dt as well). I have removed the "title_prefix" and "title_suffix" fields that were in the previous patch and will rely on CSS selectors to handle styling as you suggest. The default columns_prefix and column_suffix values have been changed, but this will not affect subpglists that have already been created, since those all have depth=1. The column_prefix default is now "<td>" with a section_prefix default of "<ul>". I've changed the depth field to accept values of 1-10.

I did additional testing on this with lists of different sizes and am more confident in it than the handling from the previous patch.

-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Thursday, August 13, 2009 2:36 PM
To: Monster Menus Development
Subject: Re: Adding a depth option to subpglist

At 10:44 AM -0400 8/13/09, McBride, Ian wrote:
>This adds a depth setting to the subpglist node, which can be either
>1 (previous default) or 2. This also adds section_prefix,
>title_prefix, title_suffix, and section_suffix formatting options to
>the node form to allow those lines to be different than a standard
><li>.

I have reviewed this, and am having some problems. Perhaps it works
for you in your particular case, but for me it gives some
less-than-great results. These are the suggested changes/fixes:

1. Reduce the hook_update number by one. (See previous message.)

2. Add a line to the hook_update to set the correct default of 1 for
the "depth" field in any existing rows.

3. The last grouping is missing its section_suffix.

4. I'm seeing something odd, in that the section title is repeated as
the first subtitle:

   [col_prefix][title_prefix]American Studies[title_suffix][section_prefix]
   [row_prefix]American Studies[row_suffix]
   [row_prefix]Courses[row_suffix]
   [row_prefix]Faculty & Staff[row_suffix][section_suffix]

5. I think you also happen to have the correct number of items in
each column to keep them from being ragged. In my test, I ended up
with the section heading and one subpage in the first column, and the
remaining subpages at the top of the second column. This is not very
easy to read.

6. You're going to hate me for saying this, but I really think this
code should be reworked to handle any value for "depth", not just 1
or 2. By applying the correct CSS styles, nested <ul> tags can be
very useful for this sort of thing. The section/title pre/suffix
fields are also not needed if your CSS selectors are done correctly.
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=450446
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=452252
or send a blank email to [hidden email]

monster_menus.20090918.patch (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Adding a depth option to subpglist

McBride, Ian S.
In reply to this post by McBride, Ian S.
Scratch that. I found a place where it's broken. I'll send another update when I've done more testing. This can serve as an example of the direction I'm aiming for, just with hopefully fewer nesting errors when I'm done.

-----Original Message-----
From: McBride, Ian [mailto:[hidden email]]
Sent: Tuesday, August 18, 2009 5:15 PM
To: Monster Menus Development
Subject: RE: Adding a depth option to subpglist

Dan,

Thank you for the feedback on this. I've rerolled the patch to address your concerns.

1. The update hook is now monster_menus_update_6408

2. The update hook now sets the value of the depth column to 1

3-6. The loop that handles printing has been wholly reworked with the idea that this will created nested lists (or nested section_prefix's with row_prefix items, so I guess that would support dl/dt as well). I have removed the "title_prefix" and "title_suffix" fields that were in the previous patch and will rely on CSS selectors to handle styling as you suggest. The default columns_prefix and column_suffix values have been changed, but this will not affect subpglists that have already been created, since those all have depth=1. The column_prefix default is now "<td>" with a section_prefix default of "<ul>". I've changed the depth field to accept values of 1-10.

I did additional testing on this with lists of different sizes and am more confident in it than the handling from the previous patch.

-----Original Message-----
From: Dan Wilga [mailto:[hidden email]]
Sent: Thursday, August 13, 2009 2:36 PM
To: Monster Menus Development
Subject: Re: Adding a depth option to subpglist

At 10:44 AM -0400 8/13/09, McBride, Ian wrote:
>This adds a depth setting to the subpglist node, which can be either
>1 (previous default) or 2. This also adds section_prefix, title_prefix,
>title_suffix, and section_suffix formatting options to the node form to
>allow those lines to be different than a standard <li>.

I have reviewed this, and am having some problems. Perhaps it works for you in your particular case, but for me it gives some less-than-great results. These are the suggested changes/fixes:

1. Reduce the hook_update number by one. (See previous message.)

2. Add a line to the hook_update to set the correct default of 1 for the "depth" field in any existing rows.

3. The last grouping is missing its section_suffix.

4. I'm seeing something odd, in that the section title is repeated as the first subtitle:

   [col_prefix][title_prefix]American Studies[title_suffix][section_prefix]
   [row_prefix]American Studies[row_suffix]
   [row_prefix]Courses[row_suffix]
   [row_prefix]Faculty & Staff[row_suffix][section_suffix]

5. I think you also happen to have the correct number of items in each column to keep them from being ragged. In my test, I ended up with the section heading and one subpage in the first column, and the remaining subpages at the top of the second column. This is not very easy to read.

6. You're going to hate me for saying this, but I really think this code should be reworked to handle any value for "depth", not just 1 or 2. By applying the correct CSS styles, nested <ul> tags can be very useful for this sort of thing. The section/title pre/suffix fields are also not needed if your CSS selectors are done correctly.
--
Dan Wilga                                 [hidden email]
Web System Administrator/Programmer             http://www.amherst.edu
Amherst College                                      Tel: 413-542-2175
Amherst, MA  01002

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=450446
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685439.7e7cbccf9bb225cf8471bffe1cb67503&n=T&l=monster_menus&o=452252
or send a blank email to [hidden email]

---
You are currently subscribed to monster_menus as: [hidden email].
To unsubscribe click here: http://lists.middlebury.edu/u?id=685503.6b071f880fe6a965a128164e6d09ea81&n=T&l=monster_menus&o=452254
or send a blank email to [hidden email]
Loading...