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
17 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 ...
0
votes
1answer
20 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
22 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
26 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
19 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
1answer
29 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
0answers
12 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
25 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,...
0
votes
0answers
16 views

Manual Search Index

Any time after i use import with Feed me plugin Craft run updating search index, it takes so long time. For example in my new import have 2-3 articles, updating start index all my entries, i have ~50k....
0
votes
0answers
30 views

Filter entries by custom date field

I am trying to filter entries by a date range using a custom field and finding it more difficult than I think it should be. I have found the following two questions that seem similar: How to display ...
1
vote
1answer
26 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
14 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
98 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
13 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
15 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
20 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
35 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
28 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
27 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
18 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
32 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
17 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
88 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
22 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
72 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
25 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
41 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
23 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
14 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
23 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
33 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
15 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
32 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
32 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
70 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
45 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
37 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
51 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
18 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
43 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
54 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
26 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
108 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
29 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
41 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
90 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
43 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 ...