The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0answers
11 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
11 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
88 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
10 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 ...
0
votes
0answers
14 views

Display Multiple Sections With Different Filters

I have one section called webinars where the entries work like events so there can be pending, live, and expired entries. I have another section called resources which are more standard entries where ...
1
vote
0answers
17 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 ...
1
vote
1answer
21 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
23 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
25 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
14 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
28 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
15 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.
0
votes
1answer
58 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 (...
0
votes
0answers
16 views

Nested Relationship

With PHP, how do we query a relationship of a relationship using Active Record? We are not directly querying the relation (venue) with the relationship (city). I've tried $model = $model->...
1
vote
1answer
65 views

Pagination and “if” condition

Some of my entries have the same entry.title. At the frontend, I would like to display these entries only once. This works with the following code: {% set entries = craft.entries().section('produkte')...
1
vote
1answer
24 views

Combine entries query, but filter one section by field

I would like to combine two sections: blog and recipes. I need to filter the blog section by a field. I have an entries field on on Blog and I want to query those entries where the field is empty. {%...
3
votes
1answer
35 views

Entry element query missing user field data when user is suspended

I have a channel in which each channel entry has a "users" field type that is limited to one user. My code below works fine when the user is not suspended, however if I suspend the user, the then $...
2
votes
1answer
22 views

How to assign entries to static positions such as footer?

The footer of my site has some links that can be considered "static" in the sense that they always should point to a specific entry. One for "acknowledgements", one for "cookie info" and one for "more ...
1
vote
1answer
21 views

Entries not visible on Production

I have a Structure called Pages which works great on my localhost. When it comes to deploying the website i'm not sure what the issue is. Before I deploy; I am running ./craft settings/rebuild. If I ...
0
votes
0answers
11 views

SQL to delete all entries and a matrix field from the database direct due to Craft issues in the admin

What would be safe SQL commands to delete all entries from the database? And similarly to delete all content from a specific Matrix field? The reason is because Craft seems to have an issue with ...
0
votes
0answers
21 views

Feed me not adding disabled entry to an entry field

I have multiple feeds, one of them creates entries in a channel "Memberships", and another one relates memberships to locations via a memberships field. The first feed created the memberships offline....
1
vote
1answer
26 views

Entries search query by 2 custom fields

So I have a Entry type that has two custom fields on it. Both fields are integer fields. I'd like to make a query in PHP that gets the entries by two custom fields, both of which are integer values. ...
0
votes
0answers
14 views

How to create Unique text field?

Is there a way to create unique field with native MySQL unique index? We have a use case where we don't want duplicate content.
0
votes
0answers
27 views

Update entry greyed out on Craft CMS 3.2.1

I just updated to Craft CMS 3.2.1. Now I can't update any of my entries ore create any new entries. The update entry greyed out on existing entries, and if I try and create a new entry I get the ...
1
vote
1answer
31 views

Find Entries based on Field Values

I have a set of events I want to query based on user-input date times. How do I achieve something like this? {% set entries = craft.entries.section('events').minScheduleDate('>=', 'now')....
1
vote
1answer
45 views

Set User's entry field from PHP in Craft 3

From this question, I tried: $user->setAttributes(['products' => $userProductsIds]); return Craft::$app->getElements()->saveElement($user); Where $user is an instance of craft\elements\...
1
vote
1answer
42 views

Show/display entries next/prev except entries with lightswitch field active

I have projects on my portfolio that link to each other. I'm currently using previous and next links. This is what my code looks like {# Set parameters for prev/next elements list #} {% set params = ...
1
vote
2answers
31 views

Access entry content in _layout.html

I have some content I wish to output in the main parent _layout.html template. Seems like something simple to achieve but can't seem to figure it out. If I call {{ entry.bannerLabel }} etc it throws ...
2
votes
1answer
46 views

Show entry version history on front end

We have some content that needs to display a log of changes (legal docs, terms etc) Could I use version history for this? I found this for Craft 2 but doesn't work on 3... How can I display entry ...
1
vote
1answer
16 views

Merging params PostDate limits errors

I'm attempting to merge in postDate restrictions based on the url segment. However I get twig errors with my code. So for a link of domain.com/news/archive/2016 I want to see all entries with a ...
1
vote
1answer
33 views

Offset not working correctly

I have an entry that has a entries field where 9 entries have been added. The first three entries are displayed in one block at the top of the page and this works correctly using .limit(3) However ...
1
vote
2answers
42 views

Paginating Merged Element Queries

I really want something like this to work but the merge function turns Elements into Arrays. I've managed to work around it other times but what's the best practice to combine two entry sets and then ...
0
votes
0answers
20 views

Access all entries when selecting an entry on multisite setup

I have a Craft 3 multi site setup. For example: - Site A - Site B - Site C Only Site B has a blog (channel). So the channel 'Blog' is disabled for Site A and site C. Now, I want to link to a specific ...
0
votes
0answers
25 views

How can I search for entries with precision in my module?

I'm working on an autocomplete Vue component for one of my Craft projects. It's very simple at the moment, all I am trying to do is have my component send a search value from the user to a controller. ...
0
votes
1answer
75 views

An unknown error occurred - no log entry

After copying files from a web server to my local devbox I am unable to open any 'Entries'. I keep getting two of the following error: "An unknown error occured." The assets section does open and I ...
0
votes
1answer
97 views

Order entries by content of their fields

Can I order entries by the content of a field every entry has? {% for entry in craft.entries.section('entries').order( *first time field of a matrix block within the entry* ).all() %}
1
vote
1answer
27 views

Get random entries from a section but keep the order of these when splitting the array

So I want to get 9 random entries from a section and I do this like so: {% set artists = craft.entries .section('artists') .artistImage(':notempty:') .with(['artistImage']) .orderBy('RAND()') ...
1
vote
1answer
37 views

Show entries in the Control Panel as a grid, to reorder position

I am looking for a way to display entries in a (5er) grid in the Craft backend (Control Panel) and show only the featured images. I have a customer who has on her website a gallery, where 5 squares ...
1
vote
0answers
70 views

Advanced queries with Super Table

I have three channels: Events, stages and artists. An artist is added to a timetable super table field in the stage channel. In the event, I have a stages field where I select stages. Events also ...
1
vote
1answer
36 views

Use a UUID for an entry ID in a URL path

When setting an "Entry URI Format" for a section, the values currently available to me are {slug} which is the title of the entry, or {id} which is usually a small number. I'd like to have an ...
1
vote
1answer
34 views

Entries with different styling

Is it possible to build categories with a list of entries that have different styling, like {% for entry in entries %} Row 1 - Entry 1 - full-wide Row 2 - 3 entries with (1/3 width of each) ...
1
vote
1answer
44 views

How to get all entries posted within a specific year?

I am trying to get all entries posted from 2018 and only 2018. All the other methods I've seen are for from a specific date or between two dates. Is there a simple way to get all posts from 2018 ...
0
votes
0answers
60 views

How to get url from related entry in another site

I'm relating entries from another site in my installation, and I'm having issues getting the correct URL for the entry. This is an example of what I currently have: {% set carouselEntries = entry....
2
votes
1answer
81 views

How to limit Expanded Search (plugin) query results for pagination?

I'm using the Expanded Search plugin to display results of the search query with an excerpt of the text matching the query for each result. I want to limit the results to 10 per page, using pagination....
1
vote
1answer
22 views

Entries Field Type showing all entries instead of entries selected

I am new to craft and twig and need some help showing only added entries to matrix block. What I have now is showing all entries from the section. I may be going about this all wrong, I don't know. I ...
1
vote
1answer
32 views

How I’ll get an entryId based on a given URL?

I want to configure deeplinks for an app and want to set up 'universal links'. Right now I'll send an entry id to the element api to get the right content. But with universal links I didn't have a ...
1
vote
1answer
26 views

How I can sort my entry that belong to 3 section on date?

{% set blog = craft.entries.section('blog').all() %} {% set news = craft.entries.section('news').all() %} {% set caseStudies = craft.entries.section('caseStudies').all() %} {% set allEntries = blog|...
1
vote
1answer
40 views

Display notification if no entries exist for status criteria and logged in user

I'm aiming to display disabled entries for a logged in user and a message if no entries with this criteria exist. I've tried two different ways without success. Version 1 gets all entries - live and ...
3
votes
1answer
53 views

Test for entry status

I want to test for the existence of disabled entries for the logged in author in a section. So far I have this: {% set profileEntryQuery = craft.entries() .section('profileEntry') .status(...
1
vote
1answer
39 views

Relationship between channels/entries

I need some help. Really struggle understanding how to build relationships between channels/entries. Context/Want: I have two separate channels: 1. "Plant catalogue" 2. "Plant care" I want to re-use ...