acf-typography icon indicating copy to clipboard operation
acf-typography copied to clipboard

Limit user's font-family selection

Open mujahidi opened this issue 7 years ago • 2 comments

Allow the field creator the ability to select one or more fonts from the available fonts to limit the user selection.

mujahidi avatar May 03 '18 03:05 mujahidi

Some may want to only allow 5-10 fonts, but exclude the rest.

Some may want to only exclude 5-10 fonts, but allow the rest.

With hundreds or thousands of Google Fonts available, I can't think of a clean way to accomplish this and still have a smooth/usable interface.

Only way that's hitting me right now is to have a textarea and radio button.

Radio Button - options: Exclude or Include Textarea - each line is a font_family name, one per line

That way, if you only want to exclude a handful, you select exclude, and then list those fonts in the textarea. If you only want to include a handful, you select include and list those fonts in the textarea.

That opens another world of issues with people typing the wrong font_family names, bad formatting, and so on.

The solution for that is a drag-n-drop approach, or checkboxes for each font where only checked fonts are enabled. Doing this on a per-ACF field creation basis would ruin the user interface (just my opinion).

So, instead of doing this on a per-ACF field creation basis for EVERY acf-typography field added, why not make this a new plugin option in Admin > Settings > ACF Typography, that is setup ONCE and applies to EVERY acf-typography field added. Then in each acf-typography field, add ONE single new Radio Button field where the field creator can Enable/Disable those plugin-wide settings.

Maybe I'm wrong, but I would image that anyone looking to only allow specific fonts for a typography field wants to do so site-wide in the first place. Make that the default, and a single radio button where it could be disabled on a per-ACF field creation basis.

codejp3 avatar Oct 06 '22 02:10 codejp3

Some may want to only allow 5-10 fonts, but exclude the rest.

Some may want to only exclude 5-10 fonts, but allow the rest.

With hundreds or thousands of Google Fonts available, I can't think of a clean way to accomplish this and still have a smooth/usable interface.

Only way that's hitting me right now is to have a textarea and radio button.

Radio Button - options: Exclude or Include Textarea - each line is a font_family name, one per line

That way, if you only want to exclude a handful, you select exclude, and then list those fonts in the textarea. If you only want to include a handful, you select include and list those fonts in the textarea.

That opens another world of issues with people typing the wrong font_family names, bad formatting, and so on.

The solution for that is a drag-n-drop approach, or checkboxes for each font where only checked fonts are enabled. Doing this on a per-ACF field creation basis would ruin the user interface (just my opinion).

So, instead of doing this on a per-ACF field creation basis for EVERY acf-typography field added, why not make this a new plugin option in Admin > Settings > ACF Typography, that is setup ONCE and applies to EVERY acf-typography field added. Then in each acf-typography field, add ONE single new Radio Button field where the field creator can Enable/Disable those plugin-wide settings.

Maybe I'm wrong, but I would image that anyone looking to only allow specific fonts for a typography field wants to do so site-wide in the first place. Make that the default, and a single radio button where it could be disabled on a per-ACF field creation basis.

@codejp3 This is open for discussion. I didn't see a viable option. Therefore, never proceeded with it. Although nobody has ever requested this feature. But I thought maybe this could help.

I am still not sure if it is that important.

mujahidi avatar Oct 08 '22 20:10 mujahidi