Questions tagged [entry]
The entry tag has no usage guidance.
316
questions
1
vote
2
answers
37
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
1
vote
1
answer
28
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, ...
0
votes
2
answers
42
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 ...
...
0
votes
0
answers
32
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....
1
vote
1
answer
30
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 }}...
0
votes
0
answers
36
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 ...
2
votes
1
answer
50
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 ...
2
votes
1
answer
140
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 ...
1
vote
1
answer
72
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-...
1
vote
1
answer
36
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 ...
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 ...
0
votes
0
answers
96
views
Programmatically enable an entry for all sites if Enabled in one site
In a multi-sites setup, I have a Channel where Entries are not enabled by default.
When a CP user review them, I would like that they are automatically enabled in all sites without having to enable ...
1
vote
1
answer
46
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 ...
1
vote
1
answer
40
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 ...
1
vote
0
answers
30
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 ...
0
votes
0
answers
65
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...?
0
votes
1
answer
40
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&...
0
votes
1
answer
309
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 ...
0
votes
1
answer
41
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 ...
0
votes
3
answers
75
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 = ...
2
votes
1
answer
138
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-...
1
vote
1
answer
122
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 ...
1
vote
1
answer
147
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 == '...
1
vote
1
answer
467
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.
{% ...
1
vote
2
answers
336
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 ...
1
vote
2
answers
606
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
1
vote
0
answers
182
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? ...
1
vote
1
answer
186
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 ...
4
votes
3
answers
1k
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).
...
1
vote
1
answer
31
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 ...
1
vote
2
answers
37
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 !== ...
0
votes
0
answers
72
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: ...
1
vote
1
answer
113
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 ...
3
votes
1
answer
474
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 ...
1
vote
2
answers
175
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"
...
1
vote
1
answer
190
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 ...
1
vote
1
answer
432
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('...
1
vote
1
answer
157
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 (...
2
votes
1
answer
107
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->...
1
vote
1
answer
114
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');
...
3
votes
1
answer
180
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() ...
1
vote
1
answer
73
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 ...
0
votes
0
answers
81
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 ...
1
vote
1
answer
200
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 ...
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
1
vote
1
answer
129
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)...
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....
3
votes
2
answers
913
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 ...
1
vote
1
answer
88
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 ...
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