Questions tagged [entry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 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'); ...
1
vote
1answer
27 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 ...
1
vote
1answer
11 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
1answer
255 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> ...
1
vote
2answers
84 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 ...
1
vote
2answers
257 views

Get entries after a certain time

I am trying to get all entries from my events section in Craft 3 that occur after 17:00. My current code is: {% set events = craft.entries.section('events').eventStartTime('>= ' ~ '17:00'|time )....
1
vote
2answers
380 views

How can I set an entires status via ajax from a front-end form?

I am trying to set an entires status to disabled from a front-end form. Here is the click event listener I am using: $(document).on('click', '.delete', function (event) { let $this = $(event....
1
vote
1answer
183 views

Setting a default entry for the entry field

I have an entry field that is a selector tool for the page call to action at the bottom. I have a channel of four or five entries and I'd like one of them to be the default selection so it's one less ...
1
vote
1answer
38 views

How do I target the 3rd entry and only that entry?

I am trying to build an Index page and assign a specific card template to the 3rd entry and only the 3rd entry. {% set items = craft.entries.section('posts').all() %} {% for cardC in items.offset(2)...
1
vote
2answers
638 views

Craft 3 multi site publish options

If a user has permission to publish on multiple sites, he by default publishes to all of them. If he wants to exclude some sites, he needs to go in each one and turn off the post for that site. This ...
1
vote
1answer
319 views

How Do I Add a rel=“canonical” HTTP Header to Embedded PDF Files?

I'm working on project where I would like to directly embed PDFs onto web pages. We'll be using Google's PDF viewer as the embed tool and implementing via a macro. Here is the macro as it stands now: ...
1
vote
1answer
203 views

Changing first matrix block

I'm trying to target the first matrix block and changing the structure of the HTML, but nesting an IF statement within the loop but it's actually not doing anything, instead it's just displaying both ...
1
vote
2answers
460 views

Saving new entry via Ajax then immediately showing it

I’ve created a very simple comments system whereby comments are set us a channel, with each (comment )entry related to a main entry from another section. Works fine. I’ve set up editing and deleting ...
1
vote
2answers
555 views

Craft entries won't save (new or edits)

So I am trying to create a new entry, but every time I click save, nothing is actually saved. (see gif) THINGS I HAVE TRIED: Overwriting the app folder with a freshly downloaded one (I am already ...
1
vote
1answer
482 views

Is it possible to include category slugs in the entry URL format?

Is it possible to include category or tag slug in the entry URL format? Would you please let me know the tags that make it, if possible?
1
vote
1answer
37 views

Upload assets to location based on category if entry isn't saved yet?

I'm building a gallery system and on the entry page I have fields for gallery category (category field) as well as gallery photos (assets field). When creating this entry, I would like to upload the ...
1
vote
1answer
471 views

How do I set my siteURL instead of having http://localhost:8888/?

I downloaded and installed Craft Personal on my computer and choose /websitetest/ as my website name. I used MAMP and phpMyAdmin to create a database. Still to access my website the url is http://...
1
vote
1answer
329 views

Random posts displayed but exclude current entry ID

I am brand new to Craft and can't find much support on this problem online. I have my entry pages and at the bottom of them, I have a div with the code below in it which randomly links to any entry. ...
1
vote
2answers
1k views

How to limit the amount of entries that is output when limit doesn't work

I'm trying to limit the amount of entries on my page. Currently I want 1 news entry (based on if the checkbox is ticked, there could be 10 entries with the checkbox ticked but I only want to show 1 (...
1
vote
1answer
258 views

Disabled entries showing up

On the following screenshot the image on the right called Crown Wood - Plot 1 is disabled in the CMS, so I'd like it not to show up in the results. Below is my code. I added .status('live') to the ...
1
vote
1answer
58 views

Conditionals and outputting tables

Need a hand on a conditional to see if my table has any data, and if it does, output the table. The second thing I need help is the code to output the table. When I look at tutorials, they always ...
1
vote
1answer
154 views

Tags via AJAX actionTrigger

I pretty much followed this and the answer there really helped me a lot so far. Currently I'm stuck with either a 500 (Internal Server Error) or a 400 (Bad Request) Error. My craft/storage/runtime/...
1
vote
1answer
876 views

Comparing current date to multiple entry matrix date fields

I need to display an entry only if the date fields within its Matrix are current. So, only display if the startDate is greater than or equal to today and the endDate is less than or equal to today. ...
1
vote
1answer
229 views

Inline help text for entries

As a content strategist, I'm trying to take the memory and guesswork out of my client's experience while updating the site (check out this great article, "Training the CMS"). Field instructions are ...
1
vote
1answer
155 views

Template backend entry form

Can the backend entry form be adjusted by a template. It's not a very compressed view. See this image It would look a lot better if I can add some float:left; to parts. See this image
1
vote
1answer
303 views

Listen to onSetStatus event

I wanted to listen to the onSetStatus event of the SetStatusElementAction and used the same code like in the EntryElementType class: $setStatusAction = craft()->elements->getAction('SetStatus');...
1
vote
2answers
921 views

Conditional logic to add class for specific section entries

I'm trying to create a conditional logic so that the class 'white-nav-bg' is added to the element on the 'blog' section entries only. Below is the code I'm currently using to try and achieve this ...
1
vote
1answer
138 views

Handling Endless Recursion in saveEntry?

I'm trying to update the expiry field—based on an existing field (in this case classDate)—as soon as an entry is saved. Based on this answer, the clever recursion code in carlcs' Auto Expire plugin, ...
1
vote
2answers
88 views

Comments being overwritten on save

I am trying to save comments using the core method "entries/saveEntry", but every time I submit the form the last comment is overwritten, is there a simple way of submitting this information to insert ...
1
vote
1answer
569 views

Output tags from matrix fields related to an entry

Using the code below, Craft was able to get related tags to an entry, before I decided to move TagFieldType to MatrixFieldType. {% set entries = craft.entries %} {% for entry in entries %} <...
1
vote
1answer
672 views

How to create entry from external app webhook?

I want to create an entry in an existing channel via a webhook from zoho crm. It's pretty straightforward. Like many apps, Zoho's webhook allows you to specify destination url, the method (get or post)...
1
vote
1answer
104 views

Protect entry so that only a “relatedTo” user can see it

I would like to protect the viewing of an _entry.html page so that only a user related to that entry can view it.
1
vote
1answer
203 views

is it possible to edit an entry from the front-end when you're not logged in?

I'm working on a checkout process for a takeaway restaurant where anonymous visitors can place orders using guest entries. In this stage the order is saved with a status of "unpaid". Once a visitor ...
1
vote
2answers
25 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
1answer
21 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
1answer
40 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 (...
1
vote
1answer
40 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
1answer
19 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
1answer
21 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....
1
vote
1answer
53 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?
1
vote
1answer
69 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 - ...
1
vote
1answer
51 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 ...
1
vote
1answer
28 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 ...
1
vote
1answer
67 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 ...
1
vote
1answer
163 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 ...
1
vote
1answer
495 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:...
1
vote
1answer
50 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',...
1
vote
1answer
76 views

Get entries related to selected category only and not it's ancestors

The following is using commerce product entries, but I'm reasonably sure it could be any entry. With the following category taxonomy: - Category 1 - Category 1A - Category 2 - Category 3 ... If ...
1
vote
1answer
28 views

Pulling blog entries related to a structure entry field type

fairly new to craftCMS. I've wrestled with this now for hours and exhausted all research avenues. I have three main "service pages" (Web Design, Digital Marketing, Hosting & Analytics) These are ...
1
vote
1answer
50 views

When I try to edit an entry: “Unable to find 'craft\services\EntryRevisions'”

I have just moved my site onto the live server and imported my local db. It is a multi-site setup. In the Entries section of the CP, when I click on an entry to edit it I get the following error page:...