Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
18 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
26 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
27 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
12 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
23 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
26 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
12 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
18 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
49 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
91 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
22 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
29 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
40 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
15 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
24 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
26 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
16 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
64 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
16 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
27 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
22 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
26 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
39 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
38 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 ...
0
votes
0answers
25 views

How to query Elements with an entry field count of zero

I have an Entry 'Product' which cans zero or more 'Components' I am trying to figure out how to query all Product entries that have zero components. I can do this to get everything: $entries = ...
1
vote
1answer
78 views

Internal server error message

I'm getting the following internal server error message when I try and make a change on my website. It is only happening on one page! file_get_contents(https://maps.googleapis.com/maps/api/geocode/...
1
vote
1answer
28 views

How can I loop through a collection in the index file?

I am basically wondering where does this section('services') is set up and how. https://github.com/craftcms/demo/blob/3f224f1f2e260c3e18190b16420c2e661cbb35ee/templates/services/_entry.html#L22 I ...
1
vote
1answer
218 views

A hash key must be followed by a colon (:) syntax error

Trying to get entries between two dates and am getting: 'A hash key must be followed by a colon (:). Unexpected token "operator" of value "~" ("punctuation" expected with value ":")' {% set posts = ...
1
vote
2answers
35 views

Passing variables between sibling blocks

Is there any possibility to use "entry" from the for-loop inside the "main" block inside another block ("header" in my case)? See example below: {% extends "main" %} {% block header %} ...
2
votes
2answers
20 views

How to process POST and entry fields when using same form for Add as Edit on front end?

I use the same form for adding an entry on the front end as I do for editing it. So when editing it, we need to insert the field values in the fields. When editing or adding it we also need to re-...
1
vote
1answer
84 views

Element query: find entries where a field's value is greater than, or less than another field's value?

I would like to do something like this: craft.entries.section('mySection').field1('> field2').all() And it should return all the entries in mySection whose field1 value is greater than their ...
1
vote
1answer
49 views

live and pending entries together not working

Craft 3.0.37 I have the following code which I expect to output all entries (live and pending) but it doesn't <ul> {% for entry in craft.entries.section('podcast').status('live','pending')....
1
vote
2answers
34 views

Querying an array of users

I need to displaying some notifications on a Craft site, and I want to allow users to mark each notification as read. There won't be many users or notifications, so a plugin seems overkill. Instead I'...
1
vote
1answer
41 views

Get Entries from Every Site

How do I pull in entries from every site? I can't even seem to pass more than one argument to the .siteId parameter: {% set entries = craft.entries({ section: 'resources', siteId: [1,2,3], }...
1
vote
1answer
52 views

Display Entries Belonging to User

I'm trying to group entries by user on my front-end. I've got so far but I can't seem to get any further to my goal of displaying what type of entries they have posted e.g. lifestyle or tech. to do ...
2
votes
1answer
49 views

Error clearing a field via migration script

I'm using a migration script to clear out the values for a field on one of my entries. The field is an Entry Field and is not required. So I do this: $product->components = []; Craft::$app->...
0
votes
2answers
23 views

Hyperlinks in blog are not showing underlined

I'm brand new to Craft, having been a Wordpress user. I'm managing a site for a small charity. Having done some new pages and a blog page without any problem, I did a blog yesterday in which the ...
1
vote
1answer
178 views

Craft CMS Structure: How can I display parent and child items on an active parent page?

I'm currently setting up a Structure nav and am trying to set it up so that child pages only display if; 1) The child page itself (or it's sibling) is currently active 2) The parent page of that ...
1
vote
1answer
185 views

Using multiple 'search' parameter values to filter entries

I'm trying to filter entries down based on keywords and also if they have selected a letter that matches the first letter of an entry title on Craft 3. So far I have this: {% set keywordParam = ...
0
votes
1answer
42 views

Displaying related image assets from another section with twig

I have a site that shows upcoming football matches in a table, and I would like to include the clubs' logos next to each club name. I have the following sections and entry types, both generated using ...
1
vote
2answers
140 views

Search products and entries with pagination

Is there any way of searching both entries and products at the same time? Wanting a single search on the site which will return all entries and products containing the searched for phrase. Looked at ...
1
vote
1answer
45 views

Edit links in footer

I'm new to Craft and need to add a link to the right side of the footer on this site http://britainthinks.com/ Can't see anything in the dashboard that holds the existing content or any obvious ...
2
votes
2answers
76 views

Best practice for naming fields shared across entries in CraftCMS

I have a question about best-practice for naming fields; I am creating a craft site for a football club, which include the following: club name (Global) team names player names These are all ...
2
votes
1answer
37 views

Use an entry field's value in body class

I have created a plain text field that is assigned to a section and is available in the tabs for entries in that section. I want to use this field's value to modify the CSS on my template. My _entry....
1
vote
1answer
37 views

Does entry ID change with locale?

I have a condition that checks entry Id. The condition seems to not work for Japanese locale but works fine on English. I would think that entry ID remains the same irrespective of the locale. Please ...
1
vote
2answers
32 views

Removing URL's from Existing Entries

We've created a site which now has 40 entries in a Structure. We need to retrospectively remove the URI's because there isn't an individual page for each entry, they're all on one page but search ...
2
votes
1answer
34 views

Programatically Changing Entry Types?

I have a people channel that historically has used another field to decide if they're a "featured" person or not. The field set for "featured" people has now diverged from what a normal person has, ...
1
vote
1answer
71 views

How can I conditionally resave entries based on the value of an entry's field in a Craft 3 Module/Plugin?

Scenario: I want to programatically bulk resave entries in a certain Site in a certain Section of a certain Type. I have a Craft 3 Module with a Console Controller containing following code: public ...
2
votes
1answer
40 views

Pre-fill fields when creating an entry in CP

I am using redactor plugin for my field type and I want to use global values of the same field type to be used as pre-fill value when creating a new entry. Use case: Each year there is an edition of ...
1
vote
1answer
63 views

Craft 3 plugin to import channel entries

I try to finish a plugin which imports data into my craftcms project. I already created a console based method/service, which I trigger/run in my shell. Inside my method(s) I receive data (XML or JSON)...