Option to remove/disable "From Library" button on the Link field type (Expanded View)

Background: We love using modular content to structure our page content. However, sometimes blocks can become complex, and we therefore opt to reference a model record. In this case, we use the Link field with Expanded View.

The main reason is that the record editor opens in a modal, isolating the content and separating the concerns.

We would like the ability to disable the “From Library” button, allowing only new records to be created or the currently selected record to be edited. The reason for this is that some content editors do not understand the consequences of editing a record that is used in multiple places.

Screenshot:

I’m familiar with the Plugin SDK and have explored options to make this possible. However, it wouldn’t be achievable unless I used the overrideFieldExtension, which seems excessive in this case, as I would need to re-implement the field logic and styling.

Keen to hear some feedback, and/or possibilities.

Thanks

Hello @developers,

I understand what you’re saying here, but unfortunately I don’t think we have a clean solution to this…

At first I thought “maybe you can limit it with permissions… what if you let them create new Multi Table records but not view them?”

Hey, waddya know… that made the “From Library” button disappear!

But… this is actually broken :frowning: If they try to create a new record…

They can edit it and click save, but then they get this error:

Because, well, we explicitly told the permissions system they cannot view any records… not even the one they just created :sweat_smile:

So that won’t fly. (The field error is a separate bug that I’ll report, but even if we fixed that, it still wouldn’t work the way you need it to.)

And even if we could just hide the button somehow without affecting their permissions, well, they’d still be able to use the drop-down menu to simply choose a record:


I think overall, trying to do it this way would be deliberately fighting the system design, and it’s going to cause you trouble at every turn :frowning:

It’s ultimately a lifecycle thing, and there’s no easy way to change that… a Link is ultimately, as you say, a reference to:

a record that is used in multiple places

We cannot change that fundamental behavior without breaking a lot of other systems. Even if we prohibited them from being able to link to existing records in the UI, that limitation means that if they ever accidentally un-linked the record in that field, they’d have to re-create it from scratch. And then you’d end up with a bunch of duplicate and orphaned records…

So we’d have to have a system that says "this record can only link to new records, not existing ones, and then once created, that linked record cannot be linked from anywhere else and cannot be independently destroyed "… which sounds, well, a lot like a block :frowning:

A block IS the system’s intended solution to this scenario, by tightly coupling those fields to the to parent record. The block doesn’t have its own lifecycle outside of that record, and cannot be referenced by other records.

I don’t know that there is any easy workaround to fixing that inherent difference in these systems’ intents…

However… is there anything we can at least try to improve from the UI side to make blocks easier for your editors to use in this configuration?

Like:

That is a very interesting suggestion, the ability to open a block (or a fieldset, prehaps) in a separate modal for clarity and ease of editing. If we focused the suggestion on that aspect, could that be sufficient for your editors?

(And you already do have some limited versions of this, like being able to at least open text and structured text fields in a popup modal)

I hope this doesn’t come across as argumentative. It’s just that record relationships are such a fundamental part of the current system design that drastically changing their behavior to accommodate this particular use case would probably be quite difficult and cause all sorts of unintended consequences — especially when blocks already exist and are already designed for this use case. If we could make blocks better, instead of overhauling how record relationships work, would that be good enough? What do you think?

There is one small thing that might help for now, the “Unique field” validation on the link field:

That would at least prevent multiple source records from linking to the same destination. Your editors could still TRY to link to it with the From Library button or the dropdown list, but the validator will tell them it’s not allowed.

And in the Presentation tab, you can add some help text to explain to the editor why you made that rule:

Hi Roger,

Thank you for your extensive look into this for me, much appreciated.

  • I acknowledge that adding record permissions idea was close, but not quite the solution.

  • I’d also note that the “Unique” option on the Link fieldType is only available when adding the field to a Model rather than a Block. The Block in my example lives in the Modular Content fieldType.

In summary, after finding no solutions, the best course of action would be to create a feature request. As you suggested, this request would involve enabling the ability to edit a block’s respective fields in a modal. The most useful application of this feature would be when editing content within the Modular Content area.


Thanks,
Nathan

Hmm, good catch. I didn’t know this, sorry about that. I’ll check with the devs about whether this is intentional (maybe a system limitation?) or a possible oversight.

But you’re right:

For clarity and better tracking (just to ensure that doesn’t get lost in the discussion), let me split that into a new, separate feature request topic for you. It’ll just take a moment.

@developers I made a new feature request for you at Ability to edit blocks in a pop-up modal and also let our UX designer know about it. You should see any further updates in that thread, and you’ll also get an email notification on replies (if you have them enabled for the forum).

Thank you again!

Also confirming that, unfortunately, the inability to require the “Unique” validation on a Link field inside a block is indeed a technical limitation. So I think our best bet would still be that other feature request (modal for blocks), unless someone has better ideas.