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
1answer
59 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
14 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
59 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
132 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 '...
0
votes
0answers
27 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
2answers
49 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
1answer
145 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
62 views

How do you eager load or join reverse relationships for entries?

So I have structures that are related in the follwing way: Locations has many Providers Providers has many Health Topics I know that I can eager load all Locations with related Providers and Health ...
1
vote
1answer
18 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
65 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....
0
votes
0answers
26 views

Toggle related entries visibility/status - custom field?

I appreciate this is a bit of an edge case... While viewing an entry, you can double click on related entries to view and modify them without having to leave the original entry's view. The one thing ...
0
votes
1answer
45 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
vote
1answer
20 views

retrieve matrix data to twig file

I create a section clientSection which I linked an matrix field like in this image: The field has two block types : clientImage which has an field clientImage and clientDescription which has an field ...
1
vote
1answer
84 views

Looping through element queries directly has been deprecated

on the template _events.twig {% include "./components/_listing" with { entries: craft.entries.section('events').orderBy('eventStartDate ASC').limit(3), columns: 3, heading: 'On this month', ...
0
votes
0answers
85 views

How to allow multiple entries to have the same slug?

Users create an account and their profile (domain.com/userName) is a template pulling info from craft users. Each user can create entries, all stored in a Structure section (domain.com/userName/...
1
vote
1answer
36 views

Struggling to get Entry index number so I can output “X of Total Entries”

I have a channel which has multiple entries in, I'm trying to output the current entry number, for example "1 out of 20 posts" Currently this is what I am working with: {% set total = craft.entries()...
0
votes
1answer
48 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
30 views

Global Site Variables (Static Page?)

On various Craft sites, I've needed to provide my clients with access to certain variables used across the site. Things like open hours, specific seasonal color palettes, on / off operation toggles. ...
0
votes
1answer
13 views

Is it possible for an assigned entry (via field type Entries field) to know what it has been assigned to?

I have two entry types 'pipeline' (structure) and 'series' (channel). I know I can add children in a structure, but I want to keep 'pipeline' and 'series' separate to avoid duplication, as a series ...
2
votes
1answer
76 views

Unable to create a “Single” entry

I haven't made a new single in a few years, it seems. Now when I try to create one, there is no option to do so. Normally, the New Entry button seems to be split, with the left part directly creating ...
1
vote
1answer
37 views

Not triggering SEOMatic on save element

I'm writing a module that loops over lines in a CSV file to save them as entries. For every entry I save with elements->saveElement($element);, SEOMatic will queue a job that regenerates the ...
1
vote
1answer
86 views

list entries by category, including uncategorized entries

I have a channel that is essentially a list of companies participating in an event. Within that channel is a category group of sponsorship levels. Companies that are sponsors are assigned a ...
1
vote
1answer
92 views

Conditional fields based on structure level

I have a site that will heavily rely on the structure entry type to allow the client to publish content. The "1st" level of the structure will always act as a table of contents for its children. The ...
1
vote
1answer
30 views

entry edit no other content area unless title?

I am a newbie of Craft CMS. I installed it on my localhost. I added a few sections and fields to test it when I go to Entries, create and edit the entry, there is just a title input area? Is that ...
1
vote
1answer
75 views

How to query in MySQL all entries with related categories

I have a custom product grid not associated with Craft Commerce. I am wondering, how can I query, in the SQL database, all entries and their related categories?
1
vote
2answers
56 views

Add user to entry user field [RSVP to Event]

I'm trying to add an RSVP button for users to register their attendance at my events. Once they click the button, I would like them to be added to a field called eventAttendees on the event entry. My ...
3
votes
1answer
57 views

A Streamlined Way to Export / Import Entries Between Environments?

Do any of you have a preferred workflow for exporting entries to be imported into another installation of Craft using plugins or migrations or other processes? I'd think this would be a good job for a ...
1
vote
1answer
40 views

Craft CMS shows disabled entry page

Entry is disabled https://monosnap.com/file/l8tgvr5Fxpw0OXPbpcwiI57JmZjL51 But despite that on its address I see its template loaded only without entry data. I expected to see 'Page Not Found'.
1
vote
1answer
139 views

Event when an entry is enabled

I've been looking for an event that get triggered when an entry is moved from a disabled to enabled status. Currently I'm trying to find it through the EVENT_AFTER_SAVE_ELEMENT event but I have no ...
2
votes
1answer
77 views

Don't output specific category on entry page

With {% for category in entry.categories.all() %} <a href="{{ category.url }}">{{ category.title }}</a> {{ not loop.last ? '| ' }} {% endfor %} How do I exclude a specific category ...
1
vote
1answer
107 views

Categories or Structures: Most efficient way to organize FAQ sections

Working on a plan for a site that has multiple audiences, with a FAQ section for each audience. FAQ entries are organized by Topic (Finance, Advertising, Publicity) each FAQ entry can be ...
2
votes
2answers
248 views

Displaying one site's content in another site (Craft 3 Multi-site)

I've got a bunch of entries in Site 1. I need to display them in Site 2. If I specify the site, I get the entries. {% set entries = craft.entries.section('cenicNews').site('cenicOrg').limit(10) %} ...
1
vote
0answers
107 views

How to get an Entry in structure and all of its children and it's children's children with Element APi?

How do I get all of an entry's children using the Element API? I want to return something like: data: [ title: 'Root Entry' uri: 'root-entry' children: [ { title: '...
1
vote
1answer
29 views

How does a CMS work ? How to add articles and manage them? [closed]

I would like to design a news outlet website, if that's the correct name. I've drawn a little sketch and I have a pretty good idea about the user interface; things like the site logo, nav-bar, ...
1
vote
1answer
30 views

Replace # with entry.title

Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this: <h3>{{ wordBoldTitle|replace({'#'...
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 ...
2
votes
0answers
123 views

Conditionally attach behaviors to craft\elements\Entry by section

I'm trying to conditionally attach behaviors based on an entries section. The following code works fine, but I'm trying to clarify one bit: To avoid a yii\base\InvalidConfigException on the CP ...
1
vote
1answer
278 views

EVENT_BEFORE_SAVE_ELEMENT Saving element loop in task/queue

I'm calling EVENT_BEFORE_SAVE_ELEMENT to trigger a task that then updates the entry, but it's causing a loop? The event is triggered when a specific entry type is saved: Event::on( Elements::class,...
1
vote
1answer
35 views

Create entry from template / UI without a form

I need to create an entry from my UI after the user triggers a particular event on the page. I want this to happen automatically and not rely on the user to submit a form. Is there a way to create ...
1
vote
0answers
32 views

Search if Super Table Field Has Rows

I have a section with a super table field, and I only want to display entries in that section if the super table field has rows (so basically a "not empty" search). How do I do this? I tried using the ...
2
votes
2answers
333 views

Craft 3 version - How to get entries related to current category only (not children)

I need some help with syntax on this for Craft 3, please. I want to use this piece of code: {% set fruitEntries = craft.entries.relatedTo({ relatedTo: catP,id: 'and, not '~str }) %} from this ...
0
votes
0answers
24 views

Character Limit incorrect for international characters

I've been running into errors importing specific entries in my custom module. Boils down to an issue with the Character Limit on the Plain Text fieldtype when importing international characters. It ...
1
vote
0answers
25 views

Filtering Entries based on Amenities (Category)

Hello and thank you in advance. I have a page that lists hotels by region. On the initial load of the page I am able to render all the hotels by region in a tabbed format. This part of the page works ...
2
votes
1answer
235 views

How to import entries from Craft 2 to Craft 3?

So, I've been working on a Craft 3 upgrade, managed to set everything up, including configuring new plugins etc. Since I've started working on the upgrade process, some new entries have been published ...
1
vote
1answer
63 views

Show entries by a certain category AND certain lightswitch

Just thinking of an easy way for the user to manage products on a site. Therefore is it possible to display entries by a category and a lightswitch toggle? IE. Category selected is Photocopiers and ...
1
vote
1answer
39 views

Field removed from entry layout is still displaying

So I'm setting my meta author tag this way: <meta name="author" content="{% if seoAuthor is defined %}{{seoAuthor}}{% else %}{{globalSeo.seoAuthor}}{% endif %}"> seoAuthor is a field that ...
1
vote
0answers
48 views

How to display entries by descendants of a particular category slug

I'm trying to display entries (with a category heading) by only the descendants of a particular category slug. So it would be similar to this: Display entries by category (multiple categories) but ...
0
votes
0answers
164 views

Advanced Entry Queries

I'm looking to write advanced nested search queries in Craft. For example, below I'm looking to find results that have a featuredContent value of 1 and an endDate after today or empty. In psuedo code,...
1
vote
1answer
143 views

In the entries listing (backend), how can I disable the preview button in Craft 3?

I'm building a single page site, so there wont be a page for each entry. How can I disable the preview (world) button for each entry? I'm using the structure section type.
2
votes
1answer
470 views

Request must accept JSON in response

I am getting error message while loading entries from dashboard. Please see attached screenshot - While looking into browser console, I found the error message Request must accept JSON in response (...

1
2
3 4 5
19