EllisLab text mark
Advanced Search
     
Auto Collapse Empty Custom Fields
Posted: 08 January 2007 08:44 AM   [ Ignore ]
Avatar
Joined: 2002-02-05
462 posts

What does this extension do?

- automatically hide Custom fields that are empty
- automatically show Custom fields that have data

This extension overrides the custom field’s “Show this field by default?” setting.

This version (1.1) works with Mark Huot’s custom field extensions, except for the Geo extension.
(I might add that later but I never really got that extension to work yet)

Download link.

EDIT: updated to version 1.1.1

 
Posted: 02 May 2008 05:33 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-03-05
130 posts

Just found this.

Great!

 
Posted: 03 May 2008 06:12 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Inspired, simply inspired!! wink

Awesome add-on thankyou!! grin

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 08 May 2008 04:48 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2008-03-05
130 posts

Although I love this extension, it appears that there is a known issue with expanding and collapsing GoogleMaps divs, and I’m using Mark Huot’s geo plugin.

Expanding that CP field in Entry view results in a partial load of the Google Map. 

So, I can’t use this one. Sad face here.

 
Posted: 04 June 2008 01:02 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-02
982 posts

Hi Cocoaholic,

Auto Collapse Empty Custom Fields extension if used together with Required Category extension causes a javascript error.

To replicate this error you these steps are needed:
1) install Required category extension
2) set categories to be required for one particular weblog
3) try to post an entry to that weblog without assigning to a category.

Firebug shows this error

el_name has no properties
   
if (el_name.substring(0,8)=='field_id'


It is the line from the script which Auto Collapse Empty Custom Fields extension injects:

//<![CDATA[
form_elements document.getElementById('entryform').elements;
var 
id_arr = new Array();
for(
i=0i<form_elements.lengthi++) {

el 
form_elements[i];
el_name el.name;
toggle 0;

if (
el_name.substring(0,8)=='field_id'
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

 
Posted: 04 June 2008 01:56 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 posts

Hi Laisvunas,

The problem seems to be a combination of both extensions and Firefox!

1 - The Required Category extension shows the Error message using a <fieldset> tag (standard EE behaviour)
2 - The Auto Collapse extension loops through all form elements to fetch the name of each element (the fieldset doesn’t have one)
3 - Firefox treats a fieldset as a form element (which I am not sure it actually is). Safari for instance does not do this and works fine.

If you are on a Windows machine, could you quickly test if this also happens in IE?

I’m looking into a way to prevent the behaviour you are seeing.

 
Posted: 04 June 2008 02:20 PM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 posts

Ok, I found a workaround here and updated the extension to version 1.1.1

Please download again and let me know if this works for you.

 
Posted: 04 June 2008 03:43 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-02
982 posts

Hi Elwin,

Just downloaded and installed updated version of Auto Collapse Empty Custom Fields extension, but Firebug still shows exactly the same error.

I have also checked with IE on Windows - also the same error.

P.S. Updated extension’s version number still is 1.1 build 20070108, so I’m not very sure I really tested updated version.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

 
Posted: 04 June 2008 03:48 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 posts

Well, must be a browse cache thing, I just downloaded it myself and it’s definitely version 1.1.1 build 20080604.

 
Posted: 04 June 2008 04:10 PM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-02
982 posts

Hi Elwin,

Just downloaded the true file, tested and found that everything works correctly.

Thank you very much for excellent extension and superfast debugging!

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

 
Posted: 04 June 2008 04:52 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-12
241 posts

Perfect, thanks for clarifying this Elwin!

 Signature 

gridonic | Twitter


URL Field Extension
Required Category Extension
DC FreeForm GeoIP Extension
DC Template Manager

 
Posted: 04 June 2008 07:56 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-03
162 posts

I think I know the answer, but ... is there any way to get this to work just on the Edit screen, and not the Publish one? I’d like all my custom fields open when I enter data; but once a entry is made, if a field is empty, I’d like it closed.

Thanks,
Nathan

 
Posted: 05 June 2008 05:04 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2002-02-05
462 posts
walpow - 04 June 2008 11:56 PM

is there any way to get this to work just on the Edit screen, and not the Publish one?

Sure Nathan, I don’t have time to make that a setting right now, but here is a quick version that does what you want.

Auto Collapse Edit version.

 
Posted: 05 June 2008 10:55 AM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2008-04-03
162 posts

Wow, that’s great. Just what I wanted.

Thanks a million,
Nathan

 
Posted: 12 November 2008 11:38 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2002-03-31
146 posts

Just found this, and wanted to say ‘Thanks’, Elwin. Great extension(s).

 Signature 

Les McKeown