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.

Entries generally 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. If you have Craft Client or Craft Pro, you will also be able to create drafts of entries that live alongside the current live version of the entry, and you’ll also be able to view past versions of the entry.

Generally each entry will have a stake in its own primary URL on your site, though any entry can be fetched from anywhere if your template needs it.

See Craft's Sections and Entries Documentation for more.

985 questions
21
votes
1 answer

Exclude Current Entry

How can I exclude the current entry when I've structured my syntax like this? {% set entries = craft.entries({ section: 'blog', order: 'postDate', limit: 5, }) %}
Niall Thompson
  • 1,199
  • 1
  • 11
  • 24
17
votes
4 answers

How do I target the first item in a Twig for loop?

I'm looping through some images and want to target just the first image. How do I do that? {% for image in entry.images %} {{ image.title }} {% endfor %}
julzmon
  • 941
  • 2
  • 9
  • 19
14
votes
1 answer

How to duplicate entries

How do I duplicate content within craft? I created one article, and dont want to copy paste content from one to the other, or use one article as template for the others.
nexflo
  • 539
  • 4
  • 13
11
votes
1 answer

craft.entries and lightswitch

This is super simple, and I don't get why it's not working. {% set results = craft.entries.section('events').lightSwitchField('1') %} Returns all entries in Events where the light switch field is green. {% set results =…
Matt Wilcox
  • 3,199
  • 1
  • 14
  • 28
10
votes
4 answers

Infinite scrolling with Craft?

I'm looking to create an infinite scrolling section of entries on a site we're building. Has anyone tackled this yet? What's the best way to approach this?
Adam McCombs
  • 1,695
  • 12
  • 25
6
votes
1 answer

Can entries be returned based on checkbox selection?

I have a section with entries which I wish to push to specific parts of the website. I know I could filter them with a Category but the section already has a category so I would like to use checkboxes. The checkbox only has 3 options so I could like…
mmc501
  • 1,779
  • 13
  • 34
5
votes
3 answers

Is it possible exclude an entry type from result of craft.entries?

I would like to fetch all entries apart from those of a specific type: 'chapter'. How do I achieve this with a standard call to 'craft.entries'? {% set results = craft.entries({ 'search': query, 'order': 'score' }) %}
hamishtaplin
  • 776
  • 8
  • 16
5
votes
2 answers

Is there a "sticky post" function built into Craft?

How would I make a post(s) sticky so that it appears first in the results and does not repeat later in the results?
Steve Adams
  • 1,671
  • 2
  • 15
  • 27
5
votes
1 answer

Singles Entry return content

I am brand new to Craft so excuse me if the question seems a little simple. Is this the best way to return the contents of a 'singles' section. Does everything end up in a for loop even if you are only returning a single entry. {% for entry in…
Phil
  • 250
  • 1
  • 5
5
votes
1 answer

List all entries below top level 1 in a structure section (level 2 or 3 or 4 ...)

I have a structure section with 3 levels. I d like to list all entries below 1st level. I see ancestorDist or descendantDist but I m not sure it is what I need... https://craftcms.com/docs/templating/craft.entries I see I can select multiple…
Miguel Bocquier
  • 972
  • 1
  • 7
  • 19
5
votes
1 answer

Is it possible to have entries only visible to logged-in users?

I want to have a public and private (logged in users) section on the front-end. Is that possible on craft?
Reah
  • 51
  • 2
5
votes
2 answers

How to make next/prev links for entries circular/endless

I've got a basic portfolio website which has "prev project" and "next project" buttons on each entry detail page. I'd like for when you reach the last project for the "next project" button to simply link back to the first instead of simply not…
4
votes
1 answer

Display news (from a channel) on the Homepage

I have started my very first Craft project (coming from EE) - so, apologies if this is a to simple question. On the homepage I want to display the latest news entry - and short excerpts from a few older ones. No other type of entries on the…
4
votes
3 answers

Outputting .relatedTo() total entries number

I'm trying to get the total number of entires that match a .relatedTo() search. {% set category = craft.categories.group('products').title(cat).first() %} {% set entries = craft.entries.section('products').relatedTo(category).find() %} I have…
Taylermade
  • 131
  • 1
  • 5
4
votes
2 answers

How can I force a download of entry data to an excel file?

The website I'm building enables users to book places on events. This is simply a form which creates an entry in a channel containing 2 fields: "related user" and "related event". In the control panel I've written a simple plugin which displays all…
darylknight
  • 3,290
  • 18
  • 42
1
2 3 4 5 6