Questions tagged [entries]

Entries hold the content that you want to display on your web pages. Each entry has an Author, a Post Date, an Expiration Date (if desired), a status (enabled or disabled), and, of course, content.

Filter by
Sorted by
Tagged with
1
vote
2answers
20 views

Associating multiple FreeForm entries with a single Craft entry

I have a Freeform which collects information on item(s) to be converted from analog to digital (VHS tape 16mm film, etc). The form requires the user to be logged in. There may be cases where the user ...
1
vote
1answer
246 views

Filter entry query by a custom field value

I have a channel, 'pages'. Within that channel is a dropdown 'navigation'. The values in the dropdown are 'mainNavigation' and 'hidden'. I'm trying to set an entry query that only pulls entries where ...
0
votes
0answers
35 views

Why aren't my images displayed on the homepage

Our homepage.twig is a section Our Matrix is called "angebote" (it's german don't ask :D) We created two entries for our matrix This is our Code inside the homepage.twig file for including ...
1
vote
2answers
72 views

How to build a web page using different sections created in Craft

I am a beginner in Craft. I have a Craft website. There is an HTML design with me. From admin, I divided the HTML into sections and created entries based on that. All the coding related to each ...
1
vote
1answer
54 views

Query for multiple date ranges on a date field

I'm able to successfully query a date field for a date range using this syntax: {% set entries = entries.startsOn(['and', '>= '~firstDay, '< '~ lastDay]) %} What I would like to do however is ...
1
vote
2answers
2k views

Ordering entries by custom field (integer)

I'm new to craft so may it be a basic question, however I can't find an answer for it :-/ I have custom field 'width' in my entry type defined as integer. What I need to achieve is quite simple: {% ...
0
votes
0answers
25 views

What's the best way to add a copy to clipboard button to the Preview / View button group in the entry editing UI?

View and Preview buttons work fine, but I want editors to be able to easily share links to drafts with others. The nicest solution would be a Copy button which would copy the preview URL to the ...
1
vote
1answer
33 views

no entries or files visible

I got given a db dump using Craft 3.5.16. After installing all the dependencies using composer and npm I can login to the admin section. However, I do not see any entries or any files in the admin ...
2
votes
1answer
238 views

How to output a Rich Text Link to an Entry as a tooltip?

I have a Glossary channel on my site, with Term and Definition fields. I would like Terms to display their definitions throughout the site...whenever so assigned by the content editor. I currently ...
2
votes
1answer
43 views

Getting entries excluding the first

I'm trying to set up having the first entry pull in and then later down the page pull in the remaining posts (as I need to break the loop with other content). I'm a little unsure how to set up pulling ...
3
votes
1answer
261 views

Rendering pages from Craft CMS as static HTML

Has anyone tried creating a process whereby the pages/entries generated from Craft could be presented as static HTML? I am keen to know what different approaches have been taken in the past as we are ...
1
vote
2answers
80 views

Convert string to date format that can be used in a craft.entries tag

I've got a date string from the url in this format: "2021-06-01" (year-month-day) and I want to find entries that have a date in the year and month from that string. The date is a date field ...
0
votes
0answers
69 views

Manually sort entries related to a category in the admin

Is anyone familiar with a way (in the admin) to manually sort the order of entries related to a category? For example, a "Software" entry gets assigned to multiple categories during entry. ...
12
votes
4answers
8k views

What is the best way to exclude an array of entries?

I have done a "Is featured" switch on articles which works great. I can list the latest 4 featured articles but after that I would like to list the others (Of course they may be featured too)...
3
votes
2answers
698 views

Order grouped entries

I need to group and order member profiles alphabetically but I can't get it to work. Have a look here: http://ffsd.de.w0129b45.kasserver.com/mitglieder (It's german but you should get the idea :)) In ...
2
votes
1answer
18 views

Passing null values to queries, Sprout Reports

In Sprout Reports, I am creating a list of users in my settings file. I first need an option with value of null. {% set options = [] %} {% set options = options|merge([{ label: 'All users', value: ...
1
vote
1answer
38 views

Pull Matrix Block from Multiple Entries without Showing Duplicates

I have a set of entries I am pulling ID. (group) Each of those entries has a Matrix Block. (people) That Matrix Block Type (person) has an entries field. In some cases the same entry (person) is ...
1
vote
1answer
63 views

Fetch pending entries with GraphQL

I'm setting up Craft to be used headlessly with a mobile app, and content will be created several days before it is published. I want app admins to be able to see upcoming/pending entries. Is there a ...
1
vote
1answer
11 views

Order entries by DATEDIFF

I'm trying to order the results of an entries query by the difference between two date fields but I can't seem to get it to work. Here is my query: {% set todaysStreamsParams = { section : 'films', ...
9
votes
2answers
2k views

Exclude multiple entries by their IDs

I have a structure people that I need to grab entries from. However, I need to exclude certain entries as some are already displayed on the page in a different manner. I know that you can exclude a ...
4
votes
3answers
1k views

Display Entries in a calendar

I have a section for holding calendar entries stored by postDate in the CMS. On the front end I want to basically display these in a calendar. I have code which displays the calendar looping through ...
1
vote
1answer
54 views

Performance issues in CP with +60k articles database

We are are working with a large dataset of over 60k articles. The craft control panel has a very hard time loading the entries list tables. Using debug I see that the queries that takes up the longest ...
1
vote
1answer
53 views

Parent are not set anymore after saveElement()

In this code I try to create a new Entry and set a Parent to it. The sectionId and the typeId are actually the same. $navigationItem = new Entry(); $navigationItem->typeId = 4; $navigationItem->...
0
votes
1answer
58 views

if statement in a template not working

I am making a condition to use a certain template for a specific article category, but it's not working and giving me an error. {% extends "_layout" %} {% set title = category.title %} {% block ...
2
votes
1answer
71 views

"Single" Entry page gives 404, even though it's enabled

I added a new Single Entry on my site and populated it with content. When I try to access it at the URL I set, it only returns a 404 error, as if the page were disabled. It's not disabled, though. I ...
1
vote
2answers
112 views

How to temporarily disable entries of one site version within a site group?

A client asked me to temporarily disabled all of its entries of one of its Site in a specific language. This entries should not be accessible anymore from their URL. The quickest and cleanest way to ...
1
vote
1answer
44 views

Update entry title for all sites

I'm working on a Craft project that has 3 sites. The content for one section is pulled from an API using a console script which runs every 5 minutes. This has been working fine but I've discovered a ...
5
votes
3answers
2k views

Is it possible exclude an entry type from result of craft.entries?

I would like to fetch all entries apart from those of a specific type: 'chapter'. How do I achieve this with a standard call to 'craft.entries'? {% set results = craft.entries({ 'search': query, '...
1
vote
2answers
20 views

Getting an zero index and count for an entry list

I currently have an entries field which outputs a list of related entries on page. I'm trying to find a way to display two values for these entries. The first would be a zero index. I'm trying to ...
1
vote
3answers
1k views

Contact Form Setup on Craft CMS

I am just getting to grips with Craft CMS and am finding the Contact Form plugin tricky to use. I have built a reasonable site structure, figured how fields, sections, etc work at a relatively basic ...
1
vote
2answers
61 views

How to loop through multiple entries fields

I'm creating a dynamic side navigation where pages can choose which sidebar it wants to use. This is selected by an entries field called 'sidebar' - called in line 2. To create this I've made a ...
1
vote
2answers
40 views

Limiting entries object when using as json_encode

I'm building a JSON array of several thousand entries using the following entries query: {% set services = craft.entries.section('services').asArray().all() %} The problem is there some private info ...
1
vote
1answer
171 views

adding a block of matrix field from a front end entry form

I am trying to add a form to the frontend in which a registered user will be able to create and publish new block in a matrix field. I have read the documentation about it but am still failing ...
1
vote
2answers
44 views

Use dropdown field to add a class to the body tag

I have a website where I want to be able to use different background colors on different project pages. The way I want to achieve this is by having a dropdown field in Craft to select from a set of ...
1
vote
3answers
131 views

Order Entries Query by a Featured Light Switch

I have a case studies filter that allows you to filter case studies by category. I've attached a light switch field called 'featured' to the entries that allow you to set it as featured. The idea is ...
2
votes
1answer
369 views

Why is $DEFAULT_SITE_URL appearing in entries URL?

I have an entry loop on my homepage that uses {{ entry.url }} that links to the full entry. When I click on the entry, the url looks like this mydomain.com/$DEFAULT_SITE_URL/the-entrys-slug Even ...
0
votes
0answers
54 views

Still no way to filter by category in Control Panel?

I'm wondering if, with the release of Craft 3.5, there is a way to filter by category in the control panel. I see this request goes back several years. The only workaround I can find is to use a ...
1
vote
1answer
70 views

How to automatically remove entries after a certain time?

I haven't found anything similar to this. But I was wondering if it's possible to delete certain entries after a certain time? For example: User fills in form and adds contact entry - after 2 weeks ...
1
vote
1answer
34 views

Looping on the User Field added to Entry

I am fetching the fields of an entry in a block but can not draw through a user field named as eventHost. I get error 'Variable "name" does not exist.' What is wrong with my loop? {% set ...
18
votes
3answers
26k views

How to return a specific entry?

Hopefully this is a simple question but I couldn't find a clear answer anywhere - I just want to be able to pull in data from a specific entry, where I know the identifier. In this particular case, ...
1
vote
1answer
19 views

Using a Matrix field to create a homepage that shows entries from sections and categories

I have set up 3 channel types - A, B & C and a Category. Each entry type shares the same pool of categories. On the home page, I have created a Matrix field (homeSections) with a block type ...
1
vote
2answers
101 views

Offset setting a limit?

If have this in a template: {% for mainLink in section.links.limit(4).all() %} {% endfor %} {% for secondaryLink in section.links.offset(4).all() %} {% endfor %} Which I thought would show the first ...
2
votes
1answer
184 views

How to check an entry is in a section within a for loop

I need to display different information depending on the section the entry comes under when I'm displaying all entries within a loop. Use case - I have a feed which will pull in all entries such as '...
1
vote
2answers
58 views

How to use entry data?

My question: How can I use entry data in the craft backend? An example for the use-case: Author creates an entry for the section "Generate item". The entry has only a title/single word. ...
1
vote
0answers
28 views

Querying entries that have not been related to any other entry or contained matrix element

I have a large amount of content that we are attempting to collect before we migrate to our new site structures. Normally the staff are supposed to relate content back to main entries to make sure ...
1
vote
1answer
291 views

Work with data/content from entries

I'm usually working on Backends with PHP and ZF/Laminas. Now I'm building a headless (only Backend) Craft CMS website and have a couple of questions that I didn't find a clear answer on. The Craft ...
1
vote
1answer
22 views

Channgel entry to disabled

Is it possible that when my user adds a new entry in a channel on the English site, it gets copied to the channel of my Belgian site, but this entry is set automatically to disabled? So my English ...
1
vote
1answer
144 views

Problem with Twig group function, group by year

I am trying to apply the group filter so that my year headings appear in DESC order. They are appearing in ASC order instead, and applying |reverse doesn't work. Suggestions? {% set entries = craft....
12
votes
1answer
7k views

How to get one random entry from among multiple sections

I'm trying to pull a random entry from among an array of sections, but I can't get it to work. I tried the code below, but I'm just getting errors. I've tried multiple ways of listing the sections -- ...
0
votes
1answer
60 views

Making changes to existing page - how do I make a draft page first?

I'm making extensive updates to our homepage. Before I dig in, I want to confirm the steps to create a draft without overwriting the existing page. Select the entry that requires changes Select "...

1
2
3 4 5
19