Questions tagged [entry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
26 views

Linked pages can't load entry-variable

I'm a newbie with Craft CMS and just setup my templates. I got multiple .twig files for six pages. If I load my homepage "from scratch" my entries are shown as I want them to. But if I click ...
Winnie99's user avatar
1 vote
2 answers
41 views

How to change the name of an entry?

I'm new with CMS and I'm not able to change the name of an entry (single). How could I do that? Thanks in advance! Vincent
Vincent's user avatar
  • 11
1 vote
1 answer
31 views

Sort articles by seq() value

Im trying to create a view for most viewed articles. I tried with entryCount plugin as recommended here but unfortunately, when you have more than 500 articles in the last 3 weeks that I'm checking, ...
Mensur Hafizović's user avatar
0 votes
2 answers
53 views

CP / Backend: Restrict single entry only to admins (edit / delete)

I'm searching for an idea, to protect a single entry from being edited / deleted by editors (CP / backend). Of course, it's easy to do for fields or sections, but for a single entry ... hmmm ... ...
Marc 's user avatar
  • 127
0 votes
0 answers
37 views

Prioritising Paid Authors In Entry Queries - Craft 4

I have a Craft CMS 4 website with an entry query that's displaying results in order of priority (1, 2, 3 or 4) and sub priority (1, 2 or 3). I've assigned these numbers to the entries via entry fields....
George Bleasdale's user avatar
1 vote
1 answer
36 views

Getting an entry's last editor

How do I get the last editor of an entry on the front end? There are answers to this question here, but they relate to plug-ins. I'd like to access the information directly. {{ entry.author.username }}...
4midori's user avatar
  • 656
0 votes
0 answers
41 views

Error when creating new entry! HTTP 404 – Not Found – yii\web\NotFoundHttpException

Any help is appreciated! I just downloaded and setup craft using composer. I went to create my first blog entry, and as soon as I click "New Entry" I get this error. Setup went smoothly and ...
Alyx's user avatar
  • 23
2 votes
1 answer
62 views

Variable entry does not exist on blog post

We just installed the CMS and like it very much. On the other hand while following the basic tutorial we seem to get the error "Variable "entry" does not exist." on the most simple ...
Ron Cooper's user avatar
3 votes
1 answer
219 views

Eager-load entry field that is being paginated

We have this entry with a field called faq which can contain multiple faq entries. We paginate this field with this code: {% paginate entry.faq as pageInfo, pageItems %} Now Blitz Recomendations says ...
svondervoort's user avatar
1 vote
1 answer
95 views

Populate changes to a multi-select field across all entries without losing current values

Is there a way to make a change to the value of a multi-select field, leaving the labels intact, and update the field across all the entries while preserving the current selections? I have a multi-...
Eric Anderson's user avatar
1 vote
1 answer
44 views

Reuse entry form layout in custom module

I'm currently developing a custom module. I created a section called "bookings" with an entry type containing some fields. I designed the form layout as i wanted. In the CP, the Entry ...
Mathias Marrillet's user avatar
1 vote
1 answer
39 views

Why does the same code work on one page and not on another

I have a Faq page with an accordion, and it works perfectly, yet I have two identical pages in the same faq folder with the same exact code but it only works on the index.twig and not on the other two ...
user1837279's user avatar
1 vote
1 answer
49 views

Save Entry form values as Draft to translated site versions on a single submit

I have an Entry field layout where only a few Plain Text fields are translatable. Users can edit these Entries from front-end, and I'm looking for the most efficient way to let them save the ...
Romain P.'s user avatar
  • 1,808
1 vote
1 answer
46 views

Entry Query: How to load an entry with the full URL as only criterion

From PHP (Plugin), how can I load a certain entry if only the full URL is provided? I can not find Craft's logic in PHP to split the full URL into the site's baseUrl and the entry's URI. Please note ...
Matthias Redl-Mann's user avatar
1 vote
0 answers
32 views

Get query of autoinjection in case the entry is not found

Is there a way to get the element query which is/was executed by Craft to autoinject the corresponding entry into the template? (even if it fails) I would like to catch it in case of a 404 to return a ...
Matthias Redl-Mann's user avatar
0 votes
0 answers
67 views

How to join sections in craft entry query

I want to join sections foo and bar in a craft entry query. Where foo.id = bar.title. How do I query all records in one go in style like craft.entries.section...?
tenshi's user avatar
  • 101
0 votes
1 answer
45 views

Element-api get other entries by id inside a entry.json

I have few entry ids from a plugin(donkeytail), and are arranged in an array, I need to loop through that array and get title, slug, etc of each entry. $entry->pins = ["106","122&...
Prashant sharma's user avatar
0 votes
1 answer
398 views

How to display all fields belonging to current entry in Craft 4?

How to display all fields belonging to current entry in Craft 4? There is an answer to the similar question for Craft 3, but it does not work for Craft 4: {# loop through the fields in the entries ...
Alex Kuzmin's user avatar
0 votes
1 answer
46 views

Get current entry field from inside a macro

Scenario: I am creating a twig macro to display a navigation menu. Said menu will be displayed on any page (home, blog, multiple landing pages, ...) In some cases we will be visiting a specific entry ...
Álvaro Franz's user avatar
0 votes
3 answers
103 views

Get section handle of an entry inside of an EntryField

Maybe Craft 4 is playing games with me but im stuck on this problem: linkedEntry is an entry field which is limited to 1 entry. This outputs the section handle correctly {% set linkedEntry = ...
Leonardo's user avatar
  • 431
2 votes
1 answer
157 views

Dynamic entries?

My website features music releases. On the homepage, it shows the current week of releases. It also offers the ability to go back to previous weeks and see the releases e.g. mysite.com/new-releases/05-...
fxfuture's user avatar
  • 279
1 vote
1 answer
139 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 ...
Simon Søiland's user avatar
1 vote
1 answer
179 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 == '...
antdev's user avatar
  • 135
2 votes
1 answer
604 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. {% ...
Robbie Post's user avatar
1 vote
2 answers
362 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 ...
Ben's user avatar
  • 45
1 vote
2 answers
707 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
Markus Busch's user avatar
1 vote
0 answers
195 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? ...
Michael Todd's user avatar
1 vote
1 answer
200 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 ...
Honsa Stunna's user avatar
4 votes
3 answers
2k 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). ...
Paloma Martinez's user avatar
1 vote
1 answer
33 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 ...
Sean Delaney's user avatar
1 vote
2 answers
42 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 !== ...
mupoftpr's user avatar
0 votes
0 answers
73 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: ...
Nasser Ali Karimi's user avatar
1 vote
1 answer
127 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 ...
Steven Zhang's user avatar
3 votes
1 answer
532 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 ...
Mark Lloyd's user avatar
1 vote
2 answers
189 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" ...
Nick Langer's user avatar
1 vote
1 answer
207 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 ...
Leonardo's user avatar
  • 431
1 vote
1 answer
483 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('...
Kris's user avatar
  • 23
1 vote
1 answer
180 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 (...
Henrik's user avatar
  • 425
2 votes
1 answer
120 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->...
flipjms's user avatar
  • 121
1 vote
1 answer
116 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'); ...
good_afternoon's user avatar
3 votes
1 answer
189 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() ...
Matthias Redl-Mann's user avatar
1 vote
1 answer
78 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 ...
Lukas Snarskis's user avatar
0 votes
0 answers
82 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 ...
Gideon's user avatar
  • 1
1 vote
1 answer
227 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 ...
ChuckLean's user avatar
1 vote
1 answer
33 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
Paloma Martinez's user avatar
1 vote
1 answer
151 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)...
springboynick's user avatar
1 vote
1 answer
60 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....
Matthias's user avatar
  • 110
3 votes
2 answers
995 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 ...
Noah Yamen's user avatar
1 vote
1 answer
107 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 ...
4midori's user avatar
  • 656
0 votes
0 answers
42 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
CraftN00b's user avatar

1
2 3 4 5
7