Jump to content

Recommended Posts

Posted

I'm building a module where I need to set a field to locked, but not collapsed.

I can set it to collapsed/locked like so:

$field->collapsed = Inputfield::collapsedLocked;

But looking for a way to do the same thing, but have the field default to open.

There currently isn't an option for "openLocked".

Any ideas on how to get around this? 

I'm feeling a little dense here at the end of the week.

:)

  • Like 1
Posted (edited)

According to Inputfield.php, collapsedLocked should be exactly what you're looking for: visible, but not editable. Is the description there outdated or am I missing something here? :)

Edit: right, "otherwise same as collapsedYes".. that's a bummer. Sorry, can't see an obvious way to do this without some custom hooks right now.

Edited by teppo
  • Like 1
Posted

Ok, first take off your mask and try some harder. :P

Collapsed sound more like well collapsed , not?

  • Like 1
Posted

Steve,

Exactly. I need this to be a locked field, but it needs to default to open. CollapsedLocked defaults to (obviously) collapsed.

Posted

i was wondering this same thing a few days ago, have a template where the title field is changed on page save, so don't want it editable, but needs to be visible...

Posted (edited)

I managed to add this functionality to my local copy of PW. Will make a pull request out of it this evening and submit it to Ryan for his consideration.

Update: PR submitted.

Edited by netcarver
  • Like 5
Posted

Cool!  Thanks Steve.

Perhaps eventually changing $field->collapsed to something like $field->state might simplify the naming?

Posted

Cool. Thanks Steve! I made the changes locally after you posted them last week. Seems to be working great.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...