Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
0 votes
0 answers
17 views

Adding an entry to an Entry element duplicates it

I have a site where the database is is some weird state which I would like to fix, but I'm not sure where to start. I have a channel of entries, and some of these entries (not all of them) suffer from ...
jishi's user avatar
  • 273
2 votes
1 answer
21 views

dateUpdated for different sites

I need to be able to distinguish when entries for multilingual websites were last updated. If I use entry -> dateUpdated, it gives me the same date for the English and German version of the entry, ...
Vio's user avatar
  • 21
0 votes
0 answers
18 views

Set entries section to orderby date entered

I have a page on a site that is showing entries with this code: {% extends '_layouts/default.twig' %} {% macro productItem(product) %} {% set filterClasses = [] %} {% for material in product....
rudtek's user avatar
  • 169
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
1 answer
54 views

Only show entries related to child category if it exists

I have a categories field for outputting products to a map. The categories linked to that field have a parent/child relationship. With {% set products = craft.entries.section('products').relatedTo(...
Tyssen's user avatar
  • 653
1 vote
1 answer
33 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
1 vote
1 answer
39 views

Filter entries on dropdown field value

I have a series of entries and I want to only display ones whose dropdown field matches a certain value. At the moment, my unfiltered query is like this: for item in entry.children.limit(6).orderBy('...
Tyssen's user avatar
  • 653
0 votes
1 answer
20 views

Admin Panel: Channels Grouping in Multiple Groups

In the admin panel, under "Entries", the "Channels" grouping has become disorganized as I have added new Channels over time. It seems as I add new channels, they stick to a group ...
AJezior's user avatar
0 votes
0 answers
28 views

Unable to list entries in site where section type is not available

I am using Craft CMS 4 latest. I have a NeoSections field that among others contain a field called entries that has one or more entries in it. I am running a multisite with 8 sites in 4 site groups. ...
nitech's user avatar
  • 679
2 votes
4 answers
74 views

Find all entries containing a certain twig component

How can I get all the pages (entry urls) which are containing a certain .twig component? Ex: $entries = Entry::find()->search('button.twig')->all(); $urls = []; foreach ($entries as $entry) { ...
Brecht Cloetens's user avatar
1 vote
2 answers
57 views

control panel: bidirectional related entries // concatenate entries

Is ist possible to "concatenate" entries? For example: You have five articles (A, B, C, D, E) ... might be a blog Editing the article A: A is related to C and D The relation should work ...
Marc 's user avatar
  • 182
1 vote
2 answers
190 views

How to manually import entries into Craft CMS?

I have some entries saved in a JSON file with the standard format that is created with export functionality (expanded). How can I import the entries from this JSON file back to my CMS? Feed Me seems ...
brikas's user avatar
  • 113
0 votes
0 answers
39 views

How to list categories only related to enabled entries or disabled child entries

Edit: solved in comments My entries are set up as a parent > child structure. A single entry can either have children or not have any. If parent has children, the children entries are put in a ...
Jake's user avatar
  • 43
1 vote
2 answers
102 views

How to programatically disable an entry for a specific site

We have a multi-site setup where we would like to disable a bunch of entries on the primary site only. They entries should still be enabled for the second site. I'm working on a migration that looks ...
Dalton Rooney's user avatar
1 vote
1 answer
22 views

Show featured entries first without affecting pagination

I have an entries field that can be used to select entries to be featured. I know I can remove the featured entries from the loop with this: {% set query = craft.entries.section('blog') %} {% set ...
Tyssen's user avatar
  • 653
2 votes
2 answers
249 views

Getting an error on element query after upgrade to craft 4

I've upgraded a project to craft 4, and now I'm getting an error on my entry query. Below is the code I have: {% set queryFeaturedEvents = entry.featuredEventsLimited.limit(3) %} {% set ...
Julie Velghe's user avatar
0 votes
2 answers
204 views

How to disable all entries of certain section types?

I need to disable all the entries of 3 (related) sections. After that I'll be running some imports and all actual data will be enabled again (within the correct sites). We're talking about around 2....
7ochem's user avatar
  • 165
1 vote
1 answer
34 views

Getting the position of the current entry within its section

I have a section of entries and I would like to output the position of the current entry to the entry template. I have a code that was working in Craft 3 but it broke in Craft 4 and I am struggling to ...
LessMore Creative Studio's user avatar
1 vote
1 answer
61 views

hi, my photo keeps on getting cropped when I add it, but I really need it fully, how do I do?

I made a new entry for my website, and I added a photo in "flexible", it's a png, and it does show the image where I want to, but it keeps getting cropped, and no matter how I crop it myself ...
leia's user avatar
  • 11
0 votes
1 answer
70 views

Get random entries order at each page load, but avoid repetitions

The easiest way to get a entries sort by random is to apply this: .orderBy('RAND()'). This is very useful, however I have a case where I need to get entries (which are adverts) in a random sequence ...
Romain P.'s user avatar
  • 1,852
0 votes
0 answers
22 views

GET Checkbox Value to the Query (Entries Field) [duplicate]

I am writing my first post because I am stuck and cannot move forward. I need a filter that filters by "Entries Field." The selection is done through a form + checkbox. I also get the ID of ...
Tomka84's user avatar
1 vote
1 answer
32 views

Incorporating Freeform form into an entry

I have constructed a Freeform form, but can't see how to incorporate the form (or a link to it) in an entry. Please advise. MTiA Phil
Phil's user avatar
  • 11
1 vote
1 answer
333 views

How to write SQL query for live/current version of Craft entries?

I maintain a Craft 3.4.17.1 site for a non-profit client and it's grant-reporting season. My client has asked me to put together a quick-turnaround offline report of all the content we published this ...
Sapphireblue's user avatar
1 vote
1 answer
152 views

How to get list of pages where the asset is used?

I have a list of assets link with assets id. eg: 23453 => 'https://some_cool_domain/assets/file_name.jpg' I need to find all the pages where this asset is being used. I am new to craftcms. I tried ...
Suman Bhandari's user avatar
1 vote
1 answer
132 views

Fetch Category Field Value on Entry Element

I am fairly new to Craft; I have an entry type with a custom field that is a Categories field. I am trying to use GraphQL to return the fields on my entry, including the category field value. Ex. my ...
Adrienne W's user avatar
2 votes
1 answer
97 views

Alternate way to test Preparse field?

I'm trying to use a Preparse field to display something conditionally depending on entries' lastUpdated property. In pseudocode: if lastUpdated < (now - 30 days) **>30 d** endif However, ...
4midori's user avatar
  • 656
1 vote
1 answer
27 views

Customies entries list is only visible with allowAdminChanges=true?

Running Craft 4.2.8, I only see this when allowAdminChanges=true, otherwise this Customize icon is gone. How come? This is not the case in latest Craft 3. Or is there some caching problem here? ...
jishi's user avatar
  • 273
2 votes
1 answer
928 views

Orderby entry field?

I am getting music album entries with the following code: {% set entries = craft.entries() .section('releases') .orderBy('title ASC') .all() %} Rather than ordering by the title, ...
fxfuture's user avatar
  • 279
1 vote
0 answers
46 views

cannot create matrix in craftcms 4.2.3

I just created a fresh project with craftcms 4, but am running into issues creating a matrix. Even with just one block field. It gives me the error Cannot assign string to property craft\models\...
jbrightdev's user avatar
0 votes
2 answers
69 views

Is it possible to create non-existent parent page in Craft?

I'm trying to create a new parent subfolder (/dogs) with child pages (/dogs/*). The child pages will have content: www.example.com/dogs/german-shepherd, www.example.com/dogs/chihuahua, www.example.com/...
Leah Shapiro's user avatar
0 votes
2 answers
365 views

Nested categories URI format on entries

I have a Category Group that can be 3 levels deep. Each category has its own page and its URI structure appends each category as you go deeper, like so: {parent ? parent.uri : 'root-uri' }/{slug} ...
comtyler's user avatar
1 vote
1 answer
530 views

GraphQL query orderBy number including null

I am attempting to query entries via that have a field (ex numberField) with field type Number. Some of the entries don't have a value for this field, so in the response it has null. I am wanting to ...
toddhf's user avatar
  • 11
1 vote
1 answer
759 views

Get entries in an entry type in twig template

I have two channel types section namely "Services" and "Cases". I have added caseServices as entry field in cases. I can get services of a case in twig as entry.caseServices. But ...
Vinod Patidar's user avatar
1 vote
1 answer
63 views

How to compare entries based on color?

Currently working on a website with a large amount of artworks. Each of these artworks contains a number of labels that links to a color (hex and RGB). I want to try to generate a list that retrieves ...
Jay V's user avatar
  • 73
1 vote
1 answer
36 views

Is re-running the ConvertEntryRevisions queue job safe to run after migration to Craft CMS 3.7?

I have a fairly large Craft CMS 2 site was recently migrated to Craft CMS 3, because of the large amount of entry revisions, the migration that runs the ConvertEntryRevisions queue job did not ...
James White's user avatar
  • 1,161
2 votes
1 answer
119 views

Sprig load more: prevent repeating entries with random output

On an article page i show 3 random entries, and a load more button via sprig. {% set query = craft.entries().section(section).orderby('RAND()').offset(offset).limit(3) %} {% set items = query.all() %}...
Henrik's user avatar
  • 425
1 vote
1 answer
23 views

Entry query on field using the `and` parameter

I'm struggling to get a and entry query to work - it seems to be stuck on or. Query is {% set blogQ = blogQ.blogTags(['and', blogTag|join(",")]) %} where blogTag is [2291,2290] in this case. ...
Jaytrix's user avatar
  • 317
1 vote
1 answer
129 views

Is it possible to change the order of entries or posts on the homepage?

I need to change the order of the posts / entries on our homepage - is there a way of doing that?
Louis's user avatar
  • 11
2 votes
1 answer
142 views

Backend: Entry list failes to load

I use Craft Pro CMS 3.7.39 [edit: now updated to Craft Pro CMS 3.7.42] in headless mode. Worked fine for some weeks now - but without configuration or code change some of many sections entry lists ...
Merkur's user avatar
  • 31
0 votes
0 answers
40 views

Expiry Date not being saved

we are trying to take advantage of the expiry date of Entries in Craft, but have observed that this field is not being saved into the database. Any ideas why this isn't being saved? Craft CMS 3.7.39
KAL Group's user avatar
1 vote
1 answer
546 views

Update Search Index on Entry create and update

I have a multiselect drop-down for age group and I have set "Use this field’s values as search keywords" check box checked. when I create a new entry or update existing entry . we are not ...
Amar Chand Yadav's user avatar
1 vote
1 answer
200 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
  • 137
1 vote
1 answer
100 views

Returning Metadata Fields with GraphQL?

I'm trying to pull as much information from the CMS as possible via the GraphQL API. I can't seem to find any info about how to extract the metadata information for the various entries in the CMS. At ...
Ailish's user avatar
  • 21
3 votes
1 answer
383 views

How to get column name of an entrie's field

I want to query some entries in a section. I am able to write a query using a GET Param as a filter on the title field. If I want to query a custom field however I need to know the precise column ...
Aram Loosman's user avatar
1 vote
1 answer
491 views

Creating an asset from an API using a module

I'm currently making a module that I'm hoping is going to create entries and assets from an API. I've got the entries part working and now I'm trying to create an asset from a URI of an image. I've ...
Jack Nixon's user avatar
1 vote
2 answers
440 views

Construct entries object from an array of IDs

I have 2 arrays of entry ID's that I need to merge and generate an entries object that I can iterate through and paginate. The reason for doing it this way at all, is that I need to display entries ...
InanisAtheos's user avatar
2 votes
1 answer
59 views

Updating entry field

I need to save page views for some pages. I ended up doing it with this code: {% set pageviews = entry.pageviews %} {% do entry.setFieldValue('pageviews', pageviews+1) %} {% do craft.app.getElements()....
Samuel's user avatar
  • 69
1 vote
1 answer
149 views

Possible to have a dynamic site base URL from entry field data?

Is it possible to have a dynamic site base URL coming from an entry's field data? I want to do something like https://{entry->subdomainField}.example.com/{entry->slug} with entries coming from ...
Josh Coady's user avatar
1 vote
0 answers
28 views

Craft 2 - Date Comparison In Criteria - Impossible to access an attribute ("today") on a string variable (">=")

I am working with a template in Craft 2, and I am setting up the criteria for entries to be displayed. Here is my code (below). {% set today = now|date('Y-m-d') %} {% set criteria = { section: '...
buck1112's user avatar
  • 400
1 vote
1 answer
52 views

Bad Gateway when using cached category query

I'm trying to find all tiers that have associated entries for a selection dropdown. This does not work, and throws a 502 error {% set allTeirs = craft.categories.group('catPartnerTeirs') %} {% set ...
andrewheins's user avatar

1
2 3 4 5
20