Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
23 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 ...
1
vote
1answer
18 views

Showing entries for light switch

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

Submit result from the front to the backoffice Craft CMS 2

I v'e got a new project coming soon, and I want to do it with Craft CMS 2, but I am wondering if there is a possible way to submit some result from the front end to the Cpannel entries, even have a ...
1
vote
1answer
24 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
20 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
23 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
15 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 ...
2
votes
1answer
35 views

Targeting the first entry item

I'm using Craft 3 and have created a section (channel type) for my project entries. At the bottom of each project page I have my Prev and Next Project buttons. How do I target the first and last ...
2
votes
1answer
13 views

Change order within grouped archive

I have an archive of exhibitions with entries grouped by year. The order of the groups should be descending, the order of the entries within the group should be ascending. For example: The order of ...
0
votes
0answers
19 views

Paginating with offset and limit not working when there is 1 result more than first page - Optimise?

A complicated one to explain, so I'll jump straight in: {% set pageNumber = craft.request.getPageNum %} {% set firstPageLimit = 8 %} {% set defaultLimit = 9 %} {% set limit = pageNumber == 1 ? ...
1
vote
1answer
16 views

Get the fields (fieldLayout) of the section. Not the entry

Can I get all the fields of a section? For example, I have channel events, I want the fields in that section, but not related to any specific event. I want to know all the fields (not the values), ...
1
vote
0answers
52 views

Create an Entry With PHP in CraftCMS3

I am having some trouble when trying to create a new Entry in Craft3 via PHP. In Craft 2, I was able to do something like this: $entry = new EntryModel(); $entry->getContent()->title = $...
2
votes
1answer
34 views

Can I get entries related to one category from a specific site?

If I can get entries in a category like this: {% set entries = craft.entries.section('sectionSlug').relatedTo('categorySlug').all() %} And a entries from another site like this: {% set entries = ...
1
vote
1answer
79 views

Nested Entries in Craft 3

In Craft 2 there used to be a Nested Entries field, but this is not available in Craft 3. I know I can do {parent.uri}/{slug} in the Entry URI Format field, but if I want it to be appended by ...
1
vote
1answer
37 views

Craft 3: get enabled sites of an entry

I'm looking for a way to list all the enabled sites for a given entry. I couldn't find some sort of getEnabledSites method that's similar to the available getSupportedSites. The latter only returns ...
1
vote
1answer
21 views

Set Variable if Current Field is Empty

I'm trying to set a variable within my templates which does the following: If this field is empty then use another field instead. I have 2x Fields called affiliateUrl and offerLink, if offerLink ...
1
vote
1answer
14 views

Falling back to Parent Category if no asset exists

I'm trying to make it so that if an entry image does not exist, then fall back to the category image that the entry belongs to. Right now this isn't working and is receiving an error. {% set feature =...
1
vote
1answer
13 views

Displaying how long til post expires

I'm trying to display how long til a certain post expires depending on a date/time field. Example Expires in 13 days. My field is currently displayed by doing {{ entry.expiration }} I just don'...
0
votes
0answers
15 views

SQL Error (Feed Me) when matching entries

I'm currently getting the following error when matching on an entry field. Offers Test: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~ unknown LINE 3: WHERE "id" ...
0
votes
0answers
21 views

Changing Slug to Custom Field

I currently have an entry section called Brands which automatically saves with a custom Title field automatically generated using the following settings: {{ object.brandShortname }} Promo Codes & ...
1
vote
1answer
44 views

Craft CMS 3 - Entries field, getURL

Just migrating a site from 2 to 3 and stuck on this little call, cannot find anything in the docs at all. Matrix field, Entries. <a href="{{ entry.featuredProjectLink.getUrl() }}"> Cannot for ...
0
votes
0answers
18 views

Can I extend the Entry object to receive value from custom table [duplicate]

We are using CraftCMS 3. I have a custom table which are storing statistical information about the entry. Is there any way to extend the Entry query, to left join this table, and access the fields. ...
1
vote
1answer
22 views

Including Entry Property in Object

I'm trying to get the category title to render within the following object but it's just returning it as the static string instead of the {{ category.title }} actually rendering. {% set seo = craft....
1
vote
2answers
51 views

How to use an asset as featured image in different entries

I have currently the problem, that I can't use the same asset in different entries as featured image. Craft Pro Version: 3.0.9 My setup is the following: Volumes: Local, Base URL: @web/uploads, ...
1
vote
1answer
25 views

Entries object getting reset after a relatedTo query

This is from a template that worked in Craft 2, but doesn't in Craft 3. {% set entries = craft.entries.type('publications').orderBy("postDate desc") %} entries.count() outputs 80 {% for cat in ...
2
votes
1answer
27 views

Previous/Next button to next item in Matrix

I've made a projects structure with inside a couple of projects. On the homepage people can fill in a matrix with either a project or a textblock. I'm capable of looping through the detail pages in ...
0
votes
0answers
22 views

Importing entries under a parent with Sprout Import using related key?

When creating the import JSON for Sprout Import, is there a way to use the "related" key in the attributes section of a new entry to attach the entry to a parent? I see in another question that you ...
2
votes
1answer
136 views

Craft 3 Multi Category and Field Search

Looking for the solution to searching entries in one section that are related to multiple categories and match number field criteria. This is for a used auto website. Categories: Make/Model/Trim: ...
3
votes
1answer
45 views

How do you limit the number of items that show up in a navigation?

I have a nav set up which works find but I need to limit the number of top level links to the first 5 in the loop (right now we have 9 plus oodles of children links!). Have tried various flavours of ...
1
vote
0answers
21 views

Craft 2: New locale introduction not affecting old entries

I just introduced a new (2nd) locale to my site. It now seems I can easily set up translated versions for "single" and "channel" pages that I set up new. The old entries, which existed prior to ...
0
votes
1answer
38 views

Display Full Month Name

Currently trying to get the date filter to display 'April' instead of concatenated version 'Apr'. My code below is: {{ now|date("M, Y") }}
0
votes
0answers
13 views

Can I restrict a user to one entry and one field?

The client would like to have users who can gain access to one specific entry (e.g. user Bob gets access to the entry Chicago from the Towns section). With this access, Bob needs to be able to make ...
0
votes
0answers
14 views

How to sort entries via categories?

I am creating a site on which I want to list images, ordered after month and year. I created two category-groups, one is called "Month" and one "Year". (They contain all months as single category and ...
1
vote
1answer
31 views

Replicate entries structure in admin

I am looking to see if there is an easy way or already a plugin available that would replicate the entries structure layout. I plan on creating a plugin that would allow an admin to mass update a ...
1
vote
1answer
71 views

Craft 3 entries “before” not working

I have a Craft 3 site. For some reason the before filter isn't working when pulling entries from a channel, but after does. This is not a data issue. {% set start = "2 months ago"|date() %} {% set ...
1
vote
1answer
35 views

Macro for entry loop causing 'null' variable template error

I am new to the concept of Twig templates and I can’t get it right from the documentation … What I am trying to achieve is to have a reusable Blogroll snippet that outputs entries in different ...
1
vote
1answer
28 views

Split posts by days similar to Product hunt

I've been looking around at numerous posts but can't seem to find a solution that works without constant work arounds. I'm looking to show posts split by days they were posted similar to www....
0
votes
0answers
16 views

Strange behavior with Re-saving Events entries task

I have an odd issue with re-saving entries. I have a structure where I have 3 levels. There are 3 top level parent entries. If I change the Entry Url Format. It changes 2 of the parent entries and ...
1
vote
1answer
23 views

How to get a result from search even if the search query contains a part of title?

Suppose there are three Entries: Entry One Section One Channel One I need to get Section One in result when I search Sect. Is this possible ? I am using {% set entries = craft.entries.search(query)...
1
vote
1answer
63 views

How to get specific entries id

I am attempting to get a specific entries id from within a specific section. I have looked around, and clearly have not found anything yet. To clarify, lets say we have a section called "Stories", ...
1
vote
1answer
32 views

Using multiple Templates per section

I'm using this support article as a guide and I'm stuck on what I'm doing wrong. I have an "events" section, and I would like to use a different template for one the entries. I've created a new ...
0
votes
0answers
42 views

Get Entries from Section related to a category

I'm currently trying to get all entries which belong to a section which is related to that category. e.g. Category Brand Offer Offer belongs to a brand. Brand has a category field. {% set ...
1
vote
2answers
60 views

Search query: grouping and merging multiple searches

Is it possible to 'group' search logic in the craft.entries.search query? I need to do the following: [a OR b OR c] AND [d OR e] AND [x OR y OR z] Thanks!
0
votes
1answer
11 views

Page is Not listed in Backend

One of the pages in the menu header is called Order Online, which takes users to a separate website. I want to change the link where it takes users to but when I went to the backend of the site, the ...
0
votes
1answer
29 views

How can I use two different templates for a single entry?

I'm building a coursework site and have a Course section, who's entries will be courses containing work that the client will assign to users. I built in both the work itself (different "lessons" ...
1
vote
0answers
20 views

Carry over asset field content to other locales

I have a site with English and French locales. One of the fields we have assigned to our entries is an asset field. Currently when an admin adds a new entry, all the English content will carry over ...
1
vote
1answer
44 views

Re-Saving neccessary?

I have switched the field of the SEOmatic plugin to translateable. All the SEO Titles are taken from the entry title. After changing to translateable I can see the translated fields in the SEO Title ...
1
vote
1answer
90 views

Sort CP Entries by Category

I know it's possible, using modifyEntrySortableAttributes, to sort the CP entries table by a custom field, when that field is a number, string, date/time, or bool. Would it be possible to sort a CP ...
1
vote
1answer
32 views

How to limit navigation by entry type

I couldn't find this anywhere so I thought I would post the answer. How do you limit the output of a navigation element to a specific entry type. This question is explicitly for the navigation ...
2
votes
1answer
28 views

Using values from one entry as default values in another?

Is it possible to do the following in Craft? I want to set up course information as follows: 1) have a courseType which contains default values for that type of course - name (i.e. 3 hour skills, ...