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
3
votes
2answers
551 views

What is the checkbox for when editing Matrix fields?

Referring to the screenshot below; I've just added a Matrix field to a new site, and I'm not sure what the checkboxes are for? The Matrix field just has two plain text fields. As far as I can tell, ...
3
votes
1answer
2k views

How could I have a plugin hook into when I edit or update a post?

What I am trying to do is have my plugin know when I edit a post that is part of a particular section - let's call it "parts" - which then checks to see if a field is filled out in the form and then ...
3
votes
1answer
909 views

Filter entries by month

I'm trying to make a archive page for a blog sorted by months. I tried to consult the solution from Linking and showing archive by month, but I can't get it to work like it should. The code I have now ...
3
votes
2answers
701 views

Order grouped entries

I need to group and order member profiles alphabetically but I can't get it to work. Have a look here: http://ffsd.de.w0129b45.kasserver.com/mitglieder (It's german but you should get the idea :)) In ...
3
votes
3answers
727 views

Porting from EE - How to filter by category/segment in one template

Sorry if there is an answer out there for this, I've read quite a few posts but have got myself confused. I hope you can point me in the right direction. I have this code in my EE template: {exp:...
3
votes
2answers
904 views

How do I set a specific entry in a template with "set"

This won't work in a template: {% set entry = craft.entries.id(43) %}<h1>Titel: {{ entry.title }}</h1> But this does: {% for entry in craft.entries.id(43) %}<h1>Titel: {{ entry....
3
votes
2answers
2k views

Converting array of entries to an array of ids

If I've got an array of entries, is there a less long winded approach to convert that to an array of ids so I can use it in another lookup. {# Look up authors that match the entered query. {% set ...
3
votes
1answer
341 views

How do I add a value to a tag field type using the entries service saveEntry method?

I am updating an entry using the entries service, I want to add a tag value into a tag field type (classifiedTags). $entry = craft()->entries->getEntryById(120); $entry->getContent()->...
3
votes
2answers
2k views

How to query using variables

I'm having issues with getting results from a query. I have 2 search parameters which i have set to variables. I would like to match both of these to get results. At the moment the query is returning ...
3
votes
2answers
151 views

Complicated A-Z problem

I am attempting to create an 'a to z' listing on a site with 1000+ entries of people. The catch is that it needs to be indexed by surname unless that person doesn't have a surname, in which case it ...
3
votes
1answer
200 views

Div into the content of an Entry

I have a problem when trying to put a div into a content of an entry. I'm creating entries, building a HTML hierarchy that helps me to manipulate the content with JS. I'm adding divs an build ...
3
votes
1answer
814 views

Ordering of ElementCriteriaModel with varying statuses

I have a built a little plugin that calls the Twitter API to add new Tweets from a user timeline as entries, so that I can return them in an ElementCriteriaModel request to be integrated with content ...
3
votes
1answer
291 views

Rendering pages from Craft CMS as static HTML

Has anyone tried creating a process whereby the pages/entries generated from Craft could be presented as static HTML? I am keen to know what different approaches have been taken in the past as we are ...
3
votes
1answer
2k 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 ...
3
votes
3answers
710 views

Pagination with randomly ordered entries

I have a need to list a set of entries 9 at a time but with a random order. The pagination happens via Ajax, with each next set of 9 entries loaded onto the page when the user clicks the "See more" ...
3
votes
2answers
481 views

How to skip the first X entries using ElementAPI

I'm looking how to use the .offset(x) parameters of craft.entries inside the ElementAPI. I tried to add 'offset' => 1 before, after and inside the criteria array, but the x first entries are still ...
3
votes
1answer
2k views

Group entries by section

How do I group entries by section? I have search results: {% set entries = allowedSearchableEntries.search(query).order('score').limit(100) %} But I want to have SECTION NAME entry 1 entry 4 entry ...
3
votes
1answer
2k views

How do I export search results as a csv?

I have set up a custom search of entries on a page in my Craft site which includes filters to filter the results. I would like to be able to export these results (filtered or otherwise) as a CSV ...
3
votes
2answers
191 views

Fire event first time future dated entry goes 'live' from 'pending'

Is there a way I can run some code from a plugin when a future dated entry goes 'live' from 'pending'? I am trying to send an email update that a new entry has been posted. The related post below ...
3
votes
1answer
2k views

Query Entries by Tag

I want to only show entries that match a specific tag. I'm trying to do something like: {% paginate craft.entries.section('blog').relatedTo('tagName').order('score') as entriesOnPage %} This doesn't ...
3
votes
1answer
338 views

Dynamic relatedTo queries

I've got an advanced search form which culminates in: craft.entries.section('whatsOn').relatedTo( 'and', { element: artCategories }, { element: locationCategories }, { element: ...
3
votes
1answer
529 views

Get all entries attributed with category

Maybe I'm going mad here, but I can't figure out how to get all entries which are in a certain category. Following the syntax laid out here: http://buildwithcraft.com/help/entries-related-to-category ...
3
votes
2answers
889 views

Hide section on "Entries" tab

Is there a way to hide a section from the Entries tab based on user permissions? Whether it means creating a user permission in a plugin, or hiding the section selection tab from Entries altogether. ...
3
votes
1answer
137 views

Plugin to "check/uncheck" all matrix blocks while editing entries?

I did a brief search and didn't pull anything up. Is there a native or easy way to "check/uncheck" all matrix blocks? We have a considerable number of them and this would be extremely helpful. Thanks.
3
votes
2answers
293 views

Show content based on chosen city

Just have a question on the way way to approach this: I have entire sections of a website that are per city and the number of cities might grow. I plan to create a city category and add the cities to ...
3
votes
1answer
506 views

Entries & Twitter Posts

I'm trying to build what's basically a blog page, but spread throughout the posts we want some of our tweets as well. Obviously we have the entries from Craft, and I've found this plugin which I can ...
3
votes
2answers
668 views

Two-way relations

I have a section 'people' which has several related entries such as 'sibling', 'spouse', 'offspring', etc. When creating a new 'person' the user has to set up these relationships. I understand that's ...
3
votes
1answer
409 views

Display additional fields (and sort by) in Entries in Control Panel

I have created a Calendar channel in the Control Panel. I have added a field Calendar Date. Is it possible to add that field to the Entries list and sort by it? If I use the post date as the ...
3
votes
1answer
143 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->...
3
votes
1answer
243 views

Find entries from related section after certain date

Does anyone know how to achieve the following in Twig with Craft 3: My sections locations and trainings. I want to find all the entries from locations which has a relation to trainings and a ...
3
votes
1answer
342 views

Ordering entries based on an eager-loaded element's custom field

I have a query that loads a set of movies, and eager-loads corresponding shows, which are related elements. For now, the movies are sorted by startingDate, which is a custom field in the movie entry: ...
3
votes
1answer
813 views

SEOMatic using the pages title

SEOmatic for some reason isn't picking up any 'Title' fields from the entries, which leaves it displaying '| SiteName' within the browser tab. Currently my 'Site SEO Title' is empty, but can this ...
3
votes
1answer
180 views

How/Can does Craft handle ancestor/grandparent relationships?

I spent a fair amount of time yesterday searching for any other questions that may have been answered that are similar to this one, but haven't had much luck. Essentially what I want to do is to ...
3
votes
3answers
232 views

How do I order by _entry type_ when looping through entries in a template?

I currently have multiple sections like so: {% for craft.entries.section('mySection').type('oneType')... %} ... {% endfor %} {% for craft.entries.section('mySection').type('anotherType')... %} ....
3
votes
1answer
453 views

Hide search results depending on field value

This is my search results query: {% set query = craft.request.getParam('q') %} {% set miniCards = craft.entries.search(query).order('score').limit(12) %} I have a lightswitch field called ...
3
votes
1answer
614 views

Making multiple pages different with the same template

Lets say I have four different pages I set up on a channel to have four different directories. ie ... hello/1, hello/2, hello/3, hello/4. But they are all using the same template. What could an ...
3
votes
2answers
619 views

Sorting Entries by category, from multiple category groups

I'm struggling to figure out how to do this: We have a bunch of entries in single a channel. There are two category groups an entry can be assigned to, with multiple categories in each group. We ...
3
votes
2answers
89 views

How do I insert a special entry into a sections list?

I want to apologize if I'm not asking the question correctly, but basically this is what I want to do: I have this craft.entries: {% paginate craft.entries.section('example').limit(10) as ...
3
votes
1answer
184 views

Pagination / Custom Routes (Based on Entry Existing)

I've created a custom route for my entries based on week like so: 'events/(?P<year>\d{4})/(?P<week>\d{2})' => 'events/_weekindex', I know i can group entries by week like this: {% ...
3
votes
1answer
359 views

Element Actions for Entries being viewed from modifyEntrySources

Im using the modifyEntrySources hook in my plugin, when I view the entries based on my custom criteria it doesn't show the checkboxes for element actions, is there a way to get these back or is this a ...
3
votes
2answers
241 views

Changing status via entries list in one locale also (unexpectedly) changes status in other locale(s)

I'm not certain if this is expected behavior but if so the user experience is confusing/unexpected: When viewing a list of entries in the control panel, swapping between locales shows the expected ...
3
votes
1answer
386 views

Pull first image from rich text field

Is there a way to output the first image of a rich text field? At the moment the template code is as simple as: {{ entry.body }} The purpose is so that I can use the image in the meta section of ...
3
votes
1answer
2k views

Order entries by custom time field

I've got an events listings which works pretty well and there is a: Custom Date field, eventEnd (just date) Custom Start Time, eventStart (just time) Custom End Time, eventEnd (just time) I can list ...
3
votes
2answers
512 views

Blank entry input page

I can't edit my entries. The entry page has no input fields. See attachtment I run the latest Craft version. Cleared the cache, tried different browsers. No errors in my console. It looks like that ...
3
votes
2answers
609 views

Retrieve Author Email based on Entry Id

I have created a front-end form to facilitate editorial review of user submitted content. I have created a controller action to receive the post. My question, how do I locate the email address of ...
3
votes
1answer
726 views

How can I display the number of related entries?

I have a template which displays a table of all the bookings on the website. The booking channel entries consist of two fields: a related user, and a related event, 1:1. There's a drop-down list of ...
3
votes
1answer
750 views

Get entries by date but ignore time

I'm trying to pull entries from a database where the postDate is a specific date. {% set today = thisyear ~ "-" ~ thismonth ~ "-" ~ day %} {% set today = today|date('Y-m-d') %} {% set entries = ...
3
votes
1answer
408 views

Entries not saving CDbException

We have a very strange issue here. On my computer I'm trying to save an entry. The process indicator keeps spinning for about five minutes before this exception comes up: CDbException CDbCommand ...
3
votes
1answer
779 views

URI / Slug auto generation limitation

Craft seems to have a limitation when generating unique URI for > 100 entries with the same title..... I have a channel with YouTube videos in and some are spread across 140 parts all with the same ...
3
votes
1answer
131 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 $...

1 2 3
4
5
19