New (free) expand/collapse block

After all the funny discussions about paid addons. Here's another free block:

Post some feedback on my blog and send me your layouts. I'll then submit the block/package to the marketplace.. I'd just like to get some feedback and more layouts first!


View Replies:
mario replied on at Permalink Reply
i'll check it out. :)
SeanBrogan replied on at Permalink Reply

Thanks Remo, excellent work. It is working well on one of my sites...
Just goes to prove my point about this fantastic growing community.
matogertel replied on at Permalink Reply
Hi Remo, funny I'm working on the new Area Splitter and the first thing I did yesterday is to add the templates menu to the edit form! It makes much more sense... that was actually one of the first feature requests I had when I started using c5.
Good to see there are people still releasing free stuff :-)
Remo replied on at Permalink Reply
Yeah, selecting the templates while adding blocks would be nice for a few blocks..

When you look at my code you'll see that I had to use two different methods. getBlockObject is unfortunately not available when adding a new block.
matogertel replied on at Permalink Reply
This is the code I use:
$bt = BlockType::getByHandle('matogertel_area_splitter');
$templates = $bt->getBlockTypeCustomTemplates();
Remo replied on at Permalink Reply
that's probably better..

Wanted to use the API for all the stuff without using a hardcoded handle but I guess your code is better anyways (:
matogertel replied on at Permalink Reply
$bt = BlockType::getByHandle($this->btHandle);
$templates = $bt->getBlockTypeCustomTemplates();
Remo replied on at Permalink Reply
btHandle was not available for me..

But it might be worth checking where it gets fetched.
nbruley replied on at Permalink Reply
Thanks for the useful block!

Is there an easy way to expand/collapse all blocks on a page?

Also, do you know if search engines pick up content if it is collapsed by default?

Remo replied on at Permalink Reply
Unfortunately there's no way to collapse other or several blocks at the moment. I had that idea a while ago but I just couldn't find enough time to do this.

The content is just hidden, but it's still there, even if it's collapsed. Search engines can easily see this content!

By the way: I created a google code project today where I'll manage the future development of this add-on. Don't expect any changes soon but it's not dead and I still have some ideas I want to implement.

Also, if someone wants to contribute on this add-on, drop me a message and I'll give you access to the subversion repository.
nbruley replied on at Permalink Reply
Good to hear. Thanks for the update and info.
nbruley replied on at Permalink Reply
Another question:
I tried to copy one instance of the block to my scrapbook and place another instance on the page and it didn't work. Instead, when trying to edit the new instance it disappears and leaves extra code hanging that you can't see or get rid of...

Is there a way to duplicate the block so that multiple instances may be created easily with the same formatting? What I might end up doing is just copying the contents of the block into the next block. I don't have a ton of settings to the block itself so maybe that won't be too difficult.


Edit: Putting more than one on the same page with default open seems to make it so you cannot close any of them...
Remo replied on at Permalink Reply
I can't reproduce any of this. Scrapbook works fine so do different settings.

Can you please try:
- To use the default theme to see if something in your theme causes the conflict
- Make sure you use the latest version found here
nbruley replied on at Permalink Reply
Thanks for checking into this.

I have version 1.0.1 so I think that's the latest, although I can't be positive.

I tried it on a new page and it seems to work fine without using the scrapbook, apart from the fact that using plus/minus and concrete5 versions at the same time messes up the formatting of the concrete5 button, which isn't really an issue because I wouldn't use both formats anyway.

Try this (I tested in default theme):

1. Add a regular expand block
2. Add another regular expand block
3. Copy the second expand block to the global scrapbook. Alias original.
4. Paste a third copy from the global scrapbook. It disappears.
5. Click on the second copy again and paste it to admin scrapbook instead.
6. Add another copy from admin scrapbook.
7. Publish page. The third copy again disappears.

I ended up doing something different, so if no one else has this issue maybe it isn't worth your time. If you want me to continue working on this to locate the problem for you I'm happy to try.

I also tried it on a different C5 installation and theme and it did the same thing.

Remo replied on at Permalink Reply
Nathan, thanks for the detailed feedback. However, this is not an issue with my block but rather a general scrapbook limitation. Try the same with the content block and you'll have the same problem.

Check this page:

NOTE: Because you're aliasing the original block, if you try to place the same block many times in the same page only the first one will actually stay when you save your changes. This is admittedly annoying problem if you've got a block that needs to be repeated inside the same page a lot. It's just the product of the way this feature has matured and not a brilliant plan you don't understand. Best advice, use the personal scrapbook for this type of problem where every block you make is a new instance.
nbruley replied on at Permalink Reply
Ah, OK. It does seem to do it when I use the personal scrapbook also, but that undoubtedly is still a scrapbook issue.

jaline replied on at Permalink Reply
This add-on is super useful. Thanks, Remo.

Is there a way to have the content slide upwards instead of down? I don't want to break the content. I looked at the view.php file and played around with that, but I'm hoping there's a solution where I can just move the DIVs around.

*EDIT* figured it out:

echo '<div id="ccm-remo-expand-content-'.$bID.'" class="ccm-remo-expand-content"'.$contentCss.'>';
   $content = $controller->getContent();
   echo $content;
   echo '</div>';   
   echo '<a href="" id="ccm-remo-expand-title-'.$bID.'" class="ccm-remo-expand-title '.$className.'"><span class="ccm-background"><span class="ccm-icon">' . $controller->title . '</span></span></a>';
Remo replied on at Permalink Reply
Great! Glad you figured it out on your own!
thecaen replied on at Permalink Reply
I am trying to publish an expandable top ten list to my homepage each day, keeping old lists in blog format.

I would like to have had this inside the blog and update the top ten each day - then push it to the homepage each day, but that's not possible.

Any suggestions?

Do i need to get a custom build to make that happen?
Remo replied on at Permalink Reply
I don't know about all the add-ons in the marketplace but my add-on can't do that without some customization!

I'd check the marketplace but you quite likely have to build something on your own! You don't have to create a completely new add-on, a template for the page list block might work as well.

If you look at this code from Kino you'll get a good impression about it:
ranxem replied on at Permalink Reply 1 Attachment
Hi Remo,

I recently upgraded for new version on C5 and permissions got really messed up.
It also deactivated the following Add Ons:

'Advanced Guestbook Comment' is not working, 'Simple Blog Post' is not working, 'Popup Menu' is not working.

Please see attachment.

Thank you in advance!!
Remo replied on at Permalink Reply
I'm sorry, but I don't see how this is related to my add-on?
Do you mean that only permissions on expand blocks are messed up?