1

My question:

How can I use entry data in the craft backend?

An example for the use-case:

  1. Author creates an entry for the section "Generate item". The entry has only a title/single word.
  2. That created entry should be shown as a selectable item in a selection box.
  3. Users can upload pictures and can select this newly created item in the upload form.
  4. So pictures should get associated to the selected word.

I'm aware that I can use element queries in PHP or Twig.

My problem:

The use-case is simply that I need categories/entries should get created by authors (that have no access to real backend) and these should be relatable to another entry - but on the fly.

Thanks in advance for any kind of help!

2 Answers 2

1

You can't use entries from the control panel in other control panel fields without the use of a plugin. The only plugin I'm aware of that does this is https://plugins.craftcms.com/craft-dynamic-fields.

Depending on the use-case, which I don't totally understand, you might look at using an Entries or a Categories field too if you just want to relate an entry to another entry.

3
  • Thanks a lot for your answer. The plugin might be the thing I was looking for. The use-case is simply that I need created entries be relatable to new entries - but on the fly. The created entry should be selectable by the author.
    – Ichigo
    Jun 23, 2020 at 14:34
  • @Ichigo: assuming a user has the proper permissions, you can do all of this on the front end. Are you trying to create some sort of upload portal? Jun 23, 2020 at 21:41
  • @RitterKnight: Thanks! Not really an upload portal, but authors can upload pictures and associate/link it to an entry - created by another author. There should be only one user type that has no access to the Craft backend to create entries. They don't have access to the "real" Craft backend.
    – Ichigo
    Jun 24, 2020 at 7:42
0

Assuming a user has the proper permissions, you can do all of this on the front end. It sounds like you just need to give these users the proper permissions to post/edit in the right sections.

To clarify a few things...

The Control Panel

Conceptually, the CP is really just an admin skin, which you can more or less replicate on the front end. How you do that is up to you.

The permissions you give users on the back end (CP) are really the same as the front end, the only difference is Craft exposes a nice UI and some additional security.

Permissions

You'd probably want to give the front end users the ability to edit and create entries permissions if you need them to modify existing entries made by other users. However you might want to do some additional checks for certain conditions depending on how "open" you want things (and that will involve some plugin dev).

Ajax Editing

"On the fly" I take to mean some sort of AJAX. Behind the scenes, what you're doing is creating a new entry using a form. After it's created, Craft will give you the ID of the new entry which you can then use to populate another form which they will use to edit their entry.

From the user's perspective, it's seamless but behind the scenes, you're doing things more or less in stages.

1
  • 1
    Sorry for the late reply, have a lot of personal stress atm. Thanks for your answer! I never thought about this, but this could be the best and most convenient solution for my problem! I will have users that only download the uploaded files and authors that create and edit the entries and new items. As I'll work with a GraphQL API, will I have issues there? I only worked with RestAPIs but never with GraphQL.
    – Ichigo
    Jun 30, 2020 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.