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

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

Entries table with an inline toggle

I have a news item entry which have a toggle switch "pinned on frontpage". This is accessible through the edit resource page like normal but now they want an inline switch in the news entries overview ...
3
votes
1answer
28 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
36 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
9 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
16 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
24 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
37 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
31 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
15 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
27 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
30 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
31 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
21 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
39 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
22 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
22 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
67 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
45 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
39 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
56 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
24 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
50 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
23 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
27 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
22 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
19 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
50 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
28 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
39 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)...
1
vote
2answers
72 views

Contact Form Setup on Craft CMS

I am just getting to grips with Craft CMS and am finding the Contact Form plugin tricky to use. I have built a reasonable site structure, figured how fields, sections, etc work at a relatively basic ...
1
vote
1answer
23 views

Filter entries by other entry

There's a section called locations and another called vacancies. In vacancies the admin can assign a location entry to a vacancy. On the careers overview page we want to display selected vacancies ...
1
vote
0answers
48 views

How can I create a Module/Plugin to edit multiple entries via a single front-end form in Craft 3?

Scenario: I have a Structure section called Competitions that allows users to submit one or more (usually three maximum) entries to judged photo competitions. However, they can only submit one or two ...
1
vote
1answer
17 views

A-Z filter menu - limiting output to one when there are multiples

I have a A-Z menu to filter entries by their first letter. <ul class="directory-letters"> <li class="all current" data-filter="all">ALL</li> {% for entry in craft.entries....
2
votes
2answers
81 views

Filter entries by Field value using a variable

How do I filter a list of entries by the value of a field using the value of a variable? e.g. {% set location = block.locationVacancies %} {% set entries = craft.entries.section('careers').search('...
1
vote
1answer
21 views

Unable to edit single or structures, channels working fine after update to Craft 3

Working in devMode, when trying to edit an existing single or structure entry, I get an InvalidArgument error yii\base\InvalidArgumentException: Syntax error. in ...vendor/yiisoft/yii2/helpers/...
1
vote
1answer
38 views

Push/Add asset to Entry by asset filename

I have spreadsheet that i'm parsing and I have available to me a Entry ID and the Asset filename. Can I add the asset to the entry by the filename? Im targeting the product entry with: $product = ...
1
vote
0answers
10 views

Excluding entries based on a tag across whole site

I'm trying to exclude entries that are tagged "DO NOT PROMOTE" on any page where craft.entries is used minus their actual entry page. What I've come up with so far is this: public function init() { ...
1
vote
0answers
29 views

Viewing expired entries and live one with the same template

Working with Craft 2, I have a channel for events that each entry has an expiration date. Live entries should show the upcoming event info and expired entries should show archive info. I have ...
1
vote
1answer
18 views

Admin getElements 500 “unknown error”

I've duplicated a site into a new development environment, and everything works as it should other than the Entries section. It throws the AJAX-based "unknown error", originating from a 500 error on ...
1
vote
1answer
238 views

Impossible to invoke a method (“limit”) on an array… but it's not an array?

I am receiving the error message "Impossible to invoke a method ("limit") on an array," but I don't think I am working with an array! Here is why I think that... First I set an albums variable: {% ...
1
vote
2answers
84 views

A-Z Separate Pages

I've built a page listing all entries by Character 0-9/A-Z. But unfortunately it's extremely slow loading due to the amount of entries the site has. I'm wondering if I can break out the letters into ...
1
vote
1answer
40 views

Displaying entries from a specific custom date year

I've a list of entries, all with custom dates. Is there a way to show entries from a specific year, just using the custom date rather than the posted date? Any help is much appreciated!
1
vote
1answer
36 views

Edit entry, on the front end, with the entries field

I currently have front-end code working for a user to create an entry, add a title (text input) and also relate entries via the entries field type and checkboxes. All on a front-end application. ...
2
votes
1answer
191 views

Ajax Load more Posts

On my blog i need a load more button on the bottom of each section that simply loads more posts when clicked. Everything i look at people are using other javascript libraries. I just want to use ajax ...
2
votes
1answer
48 views

Showing entries for light switch [duplicate]

So I have three light switches on my blog: 'featured', 'required reading' and 'skills'. I got the featured section to work with this code: {% for entry in craft.entries .section(['etiquette', '...
1
vote
1answer
39 views

Joining sections (Channel) to query based on a related item attribute

I've been trying this for a while now, so might have read this before. Sorry about that, I'm struggling really hard to get this right. At first I tried (wrongly) with the eager load features. I have ...
1
vote
1answer
74 views

Unable to delete some entries

It is weird that I can delete some entires in the app but some I can't. When selecting specific entry to delete, I don't see the option to delete it. I only have "edit entry" and "view entry". In some ...
2
votes
1answer
34 views

Limit not working

I'm trying to show the next post that's not in the array of articles "completed". I have the next articles showing that haven't been completed, however i can't set a limit to just show one article. ...
1
vote
1answer
167 views

Order by score and another field

Currently I am sorting a category template with this: 'featured desc, postDate desc' Works as expected. But I would like to sort it first on the featured field, then on the score. Such as 'featured ...