Expand ~ Collapse ~ Invert the node teasers & titles

ica - March 29, 2007 - 01:09
Project:Javascript Tools
Version:5.x-0.6
Component:Proposed new addition
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

First of all thanks for the module. Looking through the jQuery examples i found jquery-portlets toogle/ Expand ~ Collapse ~ Invert script demo below and i though it can be nice addition to the JS Tools module to make the node titles -especially useful on the front page and when nodes presented as teaser / excerpt, you can easly vision demo/example below on a Drupal 'Home ' page.
JS tools module already provides collpsable blocks it might be extened to the node teasers

http://host.sonspring.com/portlets/

the scripts of the demo
http://sonspring.com/journal/jquery-portlets

#1

nedjo - March 30, 2007 - 14:30

Yes, this would be relatively easy to do for node teasers - comments too - and I would welcome a patch.

#2

ica - March 30, 2007 - 14:40

Unfortunatley i dont have js and php skills -if i had i would straight come up with a patch.

I also have to say I have downloaded the script and tried to integrate to a Drupal theme - as a simple top menu expand - collapse, and i admit failed to make the idea work...

-than i though it can be another feature in JS tools module as 'collapsinode' - maybe someoneelse might pickup the idea hopefully

#3

Gumugum - April 3, 2007 - 13:54

Yes, it would be interesting to see this feature implemented.

#4

NaX - May 17, 2007 - 23:03
Status:active» needs work

I have been looking into a comment spoiler system for a review site. And I am very glad to have run into this issue; it pointed me in the right direction.

My JS skills are very poor. I tend to work from example only. If somebody else has not done it yet, then I tend to get stuck.

The attached JS file is what I am hoping to use for showing and hiding comments. It seems to work fine; the only problem I am having is with the comment API.

I can’t find a way to add the relevant html to the comments with out it being ugly. So for the moment I am adding the relevant html manually to my theme.

Maybe I am missing something but I can’t find a way to add wrapping divs to the comments without getting in the way of other comment modules or messing with the theme system.

It’s all still very ruff, and I left a lot of comments in the JS file for anybody else that would want to take this further.

Here is an example comment.tpl.php (Garland) for use with this JS file.

<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; print ' '. $zebra; ?>">
  <div class="clear-block">
  <?php if ($submitted): ?>
    <span class="submitted"><?php print t('!date — !username', array('!username' => theme('username', $comment), '!date' => format_date($comment->timestamp))); ?></span>
  <?php endif; ?>

  <?php if ($comment->new) : ?>
    <a id="new"></a>
    <span class="new"><?php print drupal_ucfirst($new) ?></span>
  <?php endif; ?>

  <?php print $picture ?>

    <h3><?php print $title ?></h3>

    <div>
      <a href="#" title="Open" class="comment_open">[ + ]</a>
      <a href="#" title="Close" class="comment_close">[ x ]</a>
    </div>

    <div class="content">
      <?php print $content ?>
    </div>

  </div>

  <?php if ($links): ?>
    <div class="links"><?php print $links ?></div>
  <?php endif; ?>
</div>

Hope somebody finds this useful.

AttachmentSize
comment_toggler.js_.txt 1.56 KB

#5

tim.plunkett - July 5, 2009 - 17:01

So, any further developments on this so-called "collapsinode" feature?

#6

jamesmcd - August 3, 2009 - 12:04

Also interested in this, any progress?

#7

Roar - August 16, 2009 - 21:52

This would be really cool.

 
 

Drupal is a registered trademark of Dries Buytaert.