2022 Developer Survey is open! Take survey.

Questions tagged [entry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

Programatically add new neo blocks without overwriting manually made one

I am trying to programatiacally add two new neo blocks to an entry. It works, but it overwrites any manual added blocks that already exists in that entry. For context: I have an entry with three neo ...
user avatar
1 vote
1 answer
23 views

Get all entries by structureId

It is possible to get all entries by structureId ? If yes how ? For now i use something like this: {% if entry.parent %} {% set relatedEntries = entry.parent.children()|filter(v => v.type == '...
user avatar
  • 53
1 vote
1 answer
21 views

Exclude 2 entries from a query

I know this question has been asked before but I'm still not able to solve the issue in this particular situation. I want to remove one fixed(#95) entry id and the current entry.id from the query. {% ...
user avatar
1 vote
2 answers
60 views

Sort Entries by Field in Category

I have entries from a section 'title' which all have an associated category 'author'. Category has an associated field 'sortName'. Essentially, I am trying to sort a bunch of books by author last name ...
user avatar
  • 45
0 votes
0 answers
14 views

Commerce - Language-Switch / Search - Problem with "entry"

We use Commerce - and there we have the problem with the search or e.g. the language changer, because we work with "entry" and Commerce does not know that. Does anyone know how we can solve ...
user avatar
1 vote
2 answers
58 views

Split a list of entries in two parts

How do I split a list of 10 entries into two parts - one part with 4 entries, followed by an image section, and then the second part with 6 entries. Thanks for your help. markus
user avatar
1 vote
0 answers
39 views

How to save custom field for asset field in entry form

I have an entry form that includes an asset field called photoHalfBlock. The asset field has its own custom field called photoType. Can I set a custom field on the asset as part of my entry form? ...
user avatar
1 vote
1 answer
80 views

DOM hash url in entry slug

I try to set the slug of an entry to a url using a hash. https://url.spec.whatwg.org/#dom-url-hash However it seems not possible by default, craftcms changes the hash to a dash. I need that as ...
user avatar
4 votes
2 answers
384 views

Get array of titles instead of whole collection of entries' attributes

I know that to get the entries I can do: craft.entries.all() but instead of getting the whole collection of entries, I would like to get an array of titles from those entries (or any other field). ...
user avatar
1 vote
1 answer
17 views

Assign category to entry using a plugin

Feel like I'm going crazy here... I've got this snippet of code. I find my entry based on title key/value. I find my category ids based on alcohol key/value. I attempt to set the entry category ...
user avatar
1 vote
2 answers
23 views

Update parent entry `dateUpdated` on child entry save

I got a bit of help with this from Discord. Here is what I have: Event::on(Entry::class, Element::EVENT_AFTER_SAVE, function (ModelEvent $e) { $entry = $e->sender; if ($entry->sectionId !== ...
user avatar
0 votes
0 answers
41 views

how to retrieve any/all related entries?

I have list of banks(institutions) that each one has branches. I'm using GraphQL API. By the bellow code I can get the branches with associated bank(institutions): query branches { entries(limit: ...
user avatar
1 vote
1 answer
38 views

Entries not being related

I am trying to query all entry elements related to a category but I am only able to get some of the entries to show up when I run craft.entry().relatedTo(category) I have a matrix field in the entries ...
user avatar
2 votes
1 answer
156 views

'and' & 'or' in the same entry query

I've been attempting to create an entry query that queries the same custom field twice. Basically I want to check if a custom field is between 2 numbers OR if it is empty. Currently I'm using this to ...
user avatar
1 vote
2 answers
51 views

Display entry data dynamicly in textfield

i have some data in my entry like productnames "Nike", "Puma" etc. which are headings i diplay in my template. {{ productnames1 }} "some text the contenteditor maybe wants do add" ...
user avatar
1 vote
1 answer
79 views

Query Entry where number field is conditional to value

I am trying to get entries where a specific number field is bigger than the given value. But Craft is giving me the following response: Am i missing something or is this not supported for number ...
user avatar
  • 359
1 vote
1 answer
184 views

Entry query returns all fields with NULL

When trying to query a specific single entry in a section I get back a result but all the fields inside that result are nulled. This {% set kundenmeinungen = craft.entries.section('unterseiten').slug('...
user avatar
  • 23
1 vote
1 answer
55 views

get next entry with entry.getNext(), based on a multiple category filter

I have a section, where i display a list of entries from a structure. The section is an overview page, where the entries are listed with a picture and title. If the user clicks on an image, a detail (...
user avatar
  • 197
2 votes
1 answer
68 views

Retrieving entry just after saving it returns null

I'm having this issue where when I save an Entry and try to fetch right away I get a null. Example: $entry = new Entry([stuff here]); $entry->title = 'foo'; if (!Craft::$app->elements->...
user avatar
  • 121
1 vote
1 answer
49 views

Validation not running on empty custom fields on an entry (when creating programmatically)

I'm trying to save an entry via a controller. They are contact form submission. A few of the fields are required. $section = Craft::$app->sections->getSectionByHandle('contactSubmissions'); ...
user avatar
2 votes
1 answer
54 views

Override entry.url / entry.getUrl() Method

For certain entries I would like to be able to override how Craft generates the URLs to them. So I create an Entry Model in my module extending from \craft\elements\Entry and override the getUrl() ...
user avatar
1 vote
1 answer
38 views

Getting average of number field values

I'm getting close to finishing my first project on Craft CMS but I have one problem. I'm using number fields to rate items in my entries. It looks like this: I will have around 6-7 fields and I need ...
user avatar
0 votes
0 answers
56 views

Entry URLs are not returning URL with locale in the path

I set up 2 sites (locally) running Craft 3.6.7: English (Handle: english, Base URL: '/en/') German (Handle: german, Base URL: '/de/') I've made a blog section that is enabled for both languages with ...
user avatar
  • 1
1 vote
1 answer
79 views

Why the entry-Variable doesn't exists after search?

I created a search form in my navigation and as it is described in the documentation, I created an search/results.html. And actually it works so far. Now comes the problem: The results.html extends ...
user avatar
1 vote
1 answer
22 views

Dates for entries are in different language

When the user wants to edit the Post Date or Expiry Date of an entry (channel/structure), the calendar is in Welsh language. I have no clue how this happened. How can I change this? Thank you
user avatar
1 vote
1 answer
28 views

Output loop position number

Good Evening, This is probably something really simple, but I need to output the position of the entries in a query within the loop {% set relatedEntries = craft.entries().section('memories').limit(10)...
user avatar
1 vote
1 answer
32 views

How to display an asset (pdf) from both site languages on both sites?

How do I display an asset (PDF) from both site languages on both sites? I would like to offer both German and English versions of a PDF on both the English and German sites. I now have {{ entry.PDF....
user avatar
2 votes
2 answers
386 views

Send email notification to admins when a new entry is created

Anyone written a simple plugin that does this out there? When a user submits a form on the frontend, it creates a new entry (with the default status set to disabled). I'd like to set it up so that the ...
user avatar
1 vote
1 answer
53 views

Viewing Assets (PDFs) associated with an entry directly from that entry screen

I have a channel with an Assets field, designed to hold PDF files. It works fine to select one or more files, and/or upload files and select them. However, I'm wondering if there is a way to view a ...
user avatar
  • 684
0 votes
0 answers
40 views

Craft 3.x Menu : Entry URLs are set by the entry

I can't change the URL? How can I use a custom URL? Here is the link to the image: https://ibb.co/bz9BYnL
user avatar
1 vote
1 answer
476 views

Input and Use Twig Variable in External JS Script Across Different Pages

I have created a _layout.twig file which acts as my base to hold content on the page -> _layout.twig: <!DOCTYPE html> <html lang="{{ craft.app.language }}"> <head> ...
user avatar
  • 111
0 votes
0 answers
72 views

Create a New Entry with Fields Populated from an Existing Entry Table

I am still learning how to work with craft on the back end but so far I can see it is a very powerful platform! I was wondering if there is a way that within an existing entry channel say "foo&...
user avatar
  • 111
1 vote
1 answer
61 views

Where does Craft store HTML Templates?

I have recently been given access to a Craft site's control panel. I need to edit the homepage to add data in the footer. As I didn't create the Craft website, how can I access the HTML I need to add ...
user avatar
1 vote
1 answer
267 views

orderBy title, but remove the word "The" from titles

If I have a huge list of TV shows and Movies, many of them have "The" in the title, meaning they all get grouped together if you order by title. Is it possible to "filter out" a ...
user avatar
  • 85
1 vote
1 answer
55 views

Help with an Entries field to an array I can use elsewhere

I have an Entries field so I can select a number of posts to feature in a "Hero" section on the home page, as well as a "most popular" section underneath it. However, the Hero ...
user avatar
  • 85
2 votes
1 answer
574 views

Send entry as HTML email

Looking to build a hybrid news service that publishes to a website but also sends an entry to a mailing list. Has anyone done anything similar?
user avatar
1 vote
1 answer
65 views

Use sequential numbers for entry title

I have a channel where I need each entry's Title include a sequential number, like this: 10003 - Entry Title Is there a way to prepend a sequential number to the entry title?
user avatar
  • 205
0 votes
0 answers
62 views

Add additional entry fields to backend search

The search field in the craft backend entry section searches the title and slug field by default. Is it possible to add custom entry fields to this search function (in my case e.g. a custom item ...
user avatar
  • 1
2 votes
3 answers
513 views

How to create a new Entry model in Craft 3?

I want to create a new entry for a section named 'drinks'(having section id= 6). The namespace of the file having this code is namespace putyourlightson\userguide\controllers;.I copied this code from ...
user avatar
1 vote
1 answer
156 views

Impossible to access an attribute on a null variable - on the one() method - all() works!

First question - but I think this is a bug (not my fault). I have entries/pages (a structure) - one parent (product overview) with children (products) I have one category group with categories - ...
user avatar
  • 11
1 vote
1 answer
84 views

What causes an entry's field to be marked as "modified" when the entry is saved?

When an entry is saved, what causes the entry's individual fields to be marked as "modified" in the POST request? I'm trying to troubleshoot an issue where a modified Redactor field that is a child ...
user avatar
3 votes
2 answers
146 views

Exclude most recent entry type from a loop

Hey everyone I am trying to output entries on the homepage. My goal is that the most recent entry is styled differently. I achieved this by calling the loop too times: {% for entry in craft....
user avatar
1 vote
1 answer
35 views

entry / asset url integrity check

Is there any mechanism in Craft (or a plugin) which protects entries or assets from being deleted, if they are used in an asset / entry field used in an entrytype, global, ...? Or is there a way to ...
user avatar
1 vote
1 answer
117 views

how to output all images in an entry's loop

Unfortunately I'm still very new to Craft, but I have a question to which I haven't found an answer here or in the Docs or the ones I found don't seem to work in my case. I want to output all the ...
user avatar
0 votes
0 answers
29 views

Images won‘t display in an entry loop

Unfortunately I'm still very new to Craft, but I have a question to which I haven't found an answer here or in the Docs or the ones I found don't seem to work: Why doesn't this entry-loop output a ...
user avatar
1 vote
0 answers
55 views

Craft Table/Tabular static entry input field

Is there a way to set up a Craft CMS entry field to have a table with predefined rows and columns? I have tried with the native Craft Table field, but it allows users to add rows or edit default ...
user avatar
1 vote
1 answer
233 views

Fetch Entries with Tags Only

I'm trying to get all the entries which have tags associated with them. At the moment I'm doing: $entries = Entry::find()->with('tags')->all(); and then filtering the results in PHP as ...
user avatar
  • 123
1 vote
1 answer
845 views

Select specific fields from query

I'm trying to get tags out of the underlying craft DB and serve it as a REST endpoint - however, I'm only interested in exposing the tag id and title, so my data should look like this: {id: 1, title:...
user avatar
  • 123
1 vote
1 answer
57 views

How html title is generated in entry index page in CP

I am trying to find out how HTML title is generated in entry index page in Control Panel. i know it is generated in src/templates/_elements/element.html file by $this->hook('cp.elements.element',...
user avatar
  • 467
1 vote
2 answers
159 views

Specific entry type in entry field

This seems like an easy question to answer but I can't seem to figure it out... I'm sure we could do it in Craft 2. Anyway, I'm trying to figure out how to only display a certain entry type in an ...
user avatar
  • 133

1
2 3 4 5 6