In most of my content-types i don't have leech enabled, and therefore prefer to have the section "Default leech options" collapsed by default. Easy to do by changing line 574 in leech.module to

'#collapsed' => TRUE,

I'm sure this could be improved by setting the value to TRUE if leech is already enabled for this content type, but this quick way is good enough for me now.

Likes/dislikes?

Comments

AstralP’s picture

I think this is unneccesary. If you create a new node type specifically for news leeching, make your template with that you will never see any of these options in your other node types such as story, page etc... I think it would be inconvenient to have the section collapsed as it would mean an extra click where you need it.

If you haven't done so already install CCK which is excellent for creating new node types.

Andy

ray007’s picture

I have cck installed and already do use it extensively ;-)
When I select "Add content type" in the admin gui, I'm presented with a form that has an open section "Default leech options", which I don't need in most cases.

Does that behavior differ from your installation?

AstralP’s picture

I thought you meant when creating a node... It doesn't bother me personally that it's open in types as it is somewhere I rarely have to go :) Sorry for misunderstanding.

ray007’s picture

Np, that's why we're talking ;-)

I happen to be a lot in that mask due to testing various things, so I did want to have the form a bit smaller - any chance this is going in, or is it a non-issue for everybody else, then I'll do the change local to my installations.

alex_b’s picture

On node forms of content types where leech is not enabled, there should be no leech form showing up at all, does it?

ray007’s picture

We're talking about the "edit content type" form, not about the node edit form.

alex_b’s picture

gosh, ray sorry. Wasn't reading well. Ok. so the old behaviour in 4.7 was that if "enable leech" was not checked, the leech box was not expanded. If you checked it, it expanded. We should get that behaviour back.

ray007’s picture

Then replace line 574 in leech.module with

      '#collapsed' => !variable_get('leech_for_'. $node_type, 0),

that seems to do the trick.

ray007’s picture

Want a patch or is nobody interested in this?
Or something else wrong with this solution?

alex_b’s picture

ray, no need to post a patch. we're just a bit tight on the labor side here. aron will have some time to look at this early next week.

ray007’s picture

Ok, no worries, just wanted to know if you want/need something more from my side ;-)