Twirl-Down Front Page Catagories Twirl-Down Front Page Catagories
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Twirl-Down Front Page Catagories

Started by realeyz, August 29, 2006, 09:00:52 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

realeyz

One of the things I really loved when I first started configuring Coppermine was the admin config section twirl-down functionality.  Now what would really be cool is the ability to make the front page catagories/albums behave in the same way.  This would make it much easier and clearer to distinguish catagory nesting and album/catagory differences not to mention cut down on clutter while making things much more accessible.

Thanx for listening.
- todd

Paver

This would be a reasonable addition to the CPG_OCat plugin since it deals with similar advanced functionality to the category list. 

This request may also be reasonable for inclusion into the core (with corresponding on/off setting).  There are other requests to allow more options for organizing the category & album lists.  This might be considered as one way to do so.  I support this as a "valid" feature request.  I'm curious to see what the other devs think.

One issue with the CPG_OCat plugin is that it replaces the main sections of the core code for the category list.  What this means is that the plugin itself needs to be updated if the corresponding core code is updated.  A simple solution would be to incorporate the entire plugin into the core (along with the feature request here).  Or if not, a careful plugin hook in the category list code might help things out.  This will be discussed on the OCat board of course.  I only bring it up here to say that even if the Collapse/Expand feature is added to the plugin, it should also be considered separate as a feature request for the core since the OCat plugin has this one drawback.

Tranz

I like the idea, too. I'm just wondering how it would work out to implement it. Does this require javascript? If so, how about people who can't or won't use it? Would everything be loaded in the source, yet hidden until expanded? This might not bode well for large galleries with lots of categories and albums. Or could something like ajax be used to grab the info dynamically?

Joachim Müller

Well, Ajax needs JavaScript as well ;)

Yes, users who disabled JavaScript would in fact be locked out, as the initial view would have the CSS attribute  hidden (the workaround we use in coppermine's config by having it unhidden by default and hide it with the use of JavaScript onload would cause an unwanted visual effects). As a workaround, two options seem possible: have the blocks that are suppossed to be unexpanded in the first place twice: once inside the regular HTML code (with all the JavaScript triggers) and one within a <noscript> section.
Second option would be to store a flag in the cookie that "tells" the script if the user has enabled or disabled JavaScript and generate the output accordingly. Subsequently, on a first visit, the sub-cats would be expanded and a JavaScript detection script would run and write the results into a cookie. Subsequent page visits would be looking into the cookie and create the output as it sees fit.

Here's some pseudo code for option one:
<script type="text/javascript">
  function expand(section) {
    document.getElementById(section).style.display = 'block';
  }
</script>
[...]
<div>
  Parent category markup that is suppossed to show no matter what
  <script type="text/javascript">
    // only write the expand link into the document if JavaScript is turned on to avoid non-JavaScript users from being confused
    document.write("<a href=\"javascript:expand('subcat1');\">expand subcategory</a>");
  </script>
</div>
<div name="subcat1" id="subcat1" style="display:none">
  Child category markup
</div>
<noscript>
  <div>
    Child category markup
  </div>
</noscript>

realeyz

Hey Guys

Thanx for the thoughtful consideration of my suggestion - One of the other things I was thinking about today when I showed some of my family members the new site was some other (probably simpler) ways to distinguish catagories from albums.  A few of my family members are still having trouble identifying these two entities visually on the front page no matter how I try to simplify it with the configuration. Anyway - A couple other ideas I have are maybe some border art or generic icon art or even the ability to change the text style and size separately for albums vs. catagories.  Maybe there is a plug-in I am not familiar with that already does this, but I can't find a guide anywhere that explains what each of these separate plug-ins from the plug-in packs do.

Again - thanx very much for the time, courtesy and consideration.  You guys have done a tremendous job on Coppermine and it is much appreciated! :)

- todd

Paver

@realeyz: This is not a support thread, and please keep to one issue per thread.  The Features Request board is marked "No Support" and so you are only meant to suggest features here.  In addition, those who have code to implement them may discuss how to do so on the same thread.  Think of it as "suggest" and "report only" - no questions about specific code is allowed here.

For support requests, please post on the appropriate support board.  In your case, your question about changing the appearance of Coppermine categories & albums belongs on the themes board.