Jump to content

Allow non super admin to edit a field.


activestate
 Share

Recommended Posts

Hi,

Recently i'm building small blog, and seems i'm too small to figure out how to do the following:

As admin i

I've created new field - select field which holds blog categories. Later i coded some repeater to have following fields:

title, thumb image, textarea, (CKEditor) and my select field that holds categories.

When i log as editor, everything is working fine, i can add new blog entry and select proper category. The problem is that as editor i don't have any option to add new categories if needed ....
Is there any way for editor (non super admin) to edit field somehow ?

Thank you !
Jack

Edit, as admin i've added module Page edit field permission and configured, but when i'm loogged as editor, i see no such option to edit this select field (last screensshot).
image.thumb.png.d4755a21fa913129afbac8668cb2ba19.png

image.thumb.png.e523dcf25e792afe41bae42720f7e842.png

image.thumb.png.1d0311f7aa6ff4fb0e7d8d035a9b111a.png

Link to comment
Share on other sites

I would choose a page reference field for your categories, instead of a select field. A select field is "static", i.e. you have to add/edit/remove categories yourself, and therefore need the necessary rights.

With a page reference field, you can pre-define categories, and in the field-config allow users to add new ones.

374541603_Screenshot_2020-01-03EditFieldkantonlocalhost.png.3b189be3098e7e2858e939c2ad11635c.png

In case you didn't use page reference fields until now, I suggest you learn more about them. Here's a truly epic tutorial (old, but the fundamental logic still applies all these years later...)

  • Thanks 1
Link to comment
Share on other sites

12 minutes ago, activestate said:

You think i should use "pages" as categories and seems i'm almost done. Did you think about such approach ?

Exactly. That's the preferred "PW way" to do such stuff. It may seem weird at first glance, but once you realize that in PW everything is a page (not just what you render as "page" in the frontend), you can do all kinds of stuff. Think of a PW-page as basically a container than can contain any kind of content, and can be cross-referenced and queried. Don't have time right now to point you to docs/more tutorials, sorry.

I always create a dummy template "empty" (naming is up to you; it doesn't need a physical .php file, because it doesn't need to be viewable in the frontend) just for this reason: it has only a title field and nothing else. And you can re-use it as many times as you need, without creating more templates than needed. Just create a new parent page as container for every new category / attribute or whatever you're using it for, so you can reference it in your page reference selector. And with setups like that, if you rename a category, you don't have to update all instances manually (avoid redundancy etc.etc.)

  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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