Questions tagged [elementtype]

The tag has no usage guidance.

14 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
203 views

How do I traverse relationships when populating models from queries?

I have three models / records - Journals, Issues, and Articles. Articles each BELONG_TO an Issue. Issues each BELONG_TO a journal. Issues have a date on which they've been published, and I am trying ...
3
votes
0answers
275 views

Trouble saving custom fields onto custom element type

Im working on a plugin with a custom element type and i have most things working but i haven't been able to get custom fields to save with my elements using setContentFromPost. I have the record and ...
2
votes
0answers
33 views

Using multiple elementTypes in Element API

I am currently trying to create an autocomplete search with the element-api. I need results from two different elementTypes: Product::class Entry::class How do I get results out of both elementTypes ...
1
vote
0answers
39 views

Custom Element Reference Tags

I have created a custom element type and cant get the reference tags to parse correctly, I've set the refHandle and the action to copy reference tag which seems to be correct format when I copy a ...
1
vote
0answers
83 views

Element type vs. Field type - or: Element type without database storage?

I have already searched for information on this topic but I did not find much. I hope I did not overlook something. My problem is the following: I want to try to write a plugin that lists entries ...
1
vote
0answers
27 views

Product in nested navigation

I'm currenty running Craft (v3) Commerce (v2) and have a difficult structure. This is my menu now: single home page. single about page. channel blog page. It has to be with the products in the menu,...
1
vote
0answers
46 views

Save or efficiently query a count from a related table

I have two custom element types, Event and Booking. They are related via the eventId column on the Booking record which is a FK to the Event record. The Booking record also has a seats column. A ...
1
vote
0answers
42 views

Redirect from element action

I'm trying to process multiple elements in a custom element action, and then redirect the CP user to a url. How would I do that?
1
vote
0answers
84 views

Relating entries/users with a custom element (or custom database table)

Let's say I have a bunch of Craft entries and Craft users that I need to relate to another custom database table. How would one approach this? Would I be correct in thinking that my plugin will need ...
1
vote
0answers
283 views

Getting type of element inside of a matrix field using plugin hook

I've been trying to deal with saving matrix fields to an external API by hooking onto the craft()->on('entries.saveEntry) function in a custom plugin I made. Matrices are nice for content authoring,...
1
vote
0answers
49 views

Ordering elementtype by custom field throws an error

In my plugin, when I go to the elementtype index page with the search bar and the dropdown for ordering by certain fields, when I choose a field which has been added through the fieldLayout, the ...
1
vote
0answers
64 views

Entries fieldtype

Is there scope for updating the Entries fieldtype so that only sections editable by the user are shown in the pop-up modal? Obviously don't want to go changing the core files, but some digging ...
1
vote
0answers
124 views

FieldElement Solr

for the last few hours im trying to come up with a way to use the craft field select in combination with SOLR, all my entries are in solr and i i want to keep using that. ive made it so that solr can ...
0
votes
0answers
30 views

How to add an Element sortOption to sort by number?

I have an Element. It's a Structure, with one level (not sure if that is relevant). I'd like to add a Sort Option that allows a user to sort the Element Index page for this Element by a number. The ...