Most Popular

1500 questions
20
votes
3 answers

Is there a way to output only the first paragraph of a Rich Text field?

I have a rich text output section I want to limit to the first paragraph so I can link to a full version on another page. What's the best way to do this?
Allen Pieper
  • 619
  • 6
  • 11
20
votes
3 answers

How can I check on the value of a template variable?

If I'm used to PHP's var_dump() and print_r() to check the value of a variable, how can I evolve to inspect things in Craft where Twig's dump isn't available?
Matt Stein
  • 4,006
  • 3
  • 26
  • 57
19
votes
1 answer

How do I output the locale’s name?

When I output {{ craft.locale }} in my template, I get the current locale’s ID (e.g. “en”) rather than its name (e.g. “English”). How do I get the locale’s name?
Brandon Kelly
  • 34,307
  • 2
  • 71
  • 137
19
votes
3 answers

How to return a specific entry?

Hopefully this is a simple question but I couldn't find a clear answer anywhere - I just want to be able to pull in data from a specific entry, where I know the identifier. In this particular case, the entry is a single. Currently I'm doing this: {%…
pumkincreative
  • 761
  • 2
  • 7
  • 15
19
votes
5 answers

Create line breaks from text field

I'm looking for a way to output line break from a text field. I'm aware of the "Allow line breaks" option and I have set that to true. I've then entered text with multiple new lines. However, when this text gets output in the template, there are no…
bravokiloecho
  • 1,583
  • 4
  • 17
  • 22
19
votes
2 answers

Section entries - order by random

I was wondering if it's was possible to order section entries by random. Example: {% for entry in craft.entries.section('team').type('mainPeople').order('title random)) %}
Willans
  • 193
  • 1
  • 4
19
votes
2 answers

Can a plugin add JS or CSS to the control panel?

Say for example, I wanted to add a "Expand/Collapse All" button to Matrix fields. Is there any way to do this, or is this something more appropriate for a feature request for P&T?
Tim Kelty
  • 3,081
  • 1
  • 18
  • 29
19
votes
1 answer

How do I check if a lightswitch field is false?

I have a Resources page and an archived Resources page made up of entries. I want to show all current resources on the main page (this list should not include the archived ones) and on the archived page I only want to show only archived resources. I…
Carlos
  • 193
  • 5
19
votes
1 answer

Where can I download previous versions of Craft?

Auto-updating is great and all, but sometimes you need to roll-back to a previous version or build of Craft for whatever reason. Where can you download these?
Brad Bell
  • 67,440
  • 6
  • 73
  • 143
19
votes
4 answers

Can I run one Craft install on multiple domains and/or subdomains?

Is it possible to have one Craft install running multiple domains and/or subdomains? For example having the same Craft install running a blog Channel at blog.example.com and also an about Single at example.com/about.
Simon Kuran
  • 3,015
  • 1
  • 18
  • 33
19
votes
1 answer

Transform Info from Handle?

Can I extract a transform's settings from its handle? I'm trying to avoid upscaling images using the workaround, and I'd like to set my transform handle dynamically within some conditionals. (see this link). Say I'm looping through a matrix field as…
James Muspratt
  • 423
  • 2
  • 10
18
votes
4 answers

What is the recommended Nginx configuration for Craft?

I'm looking for the recommended way of how to configure Nginx server to run Craft. Currently, I use the following configuration, it works, but I don't know if it could be better: server { listen 80; server_name example.com; root…
mohd4482
  • 612
  • 1
  • 4
  • 17
18
votes
9 answers

Craft constantly logging out from admin area

While working in the Craft admin area, on a fresh install, I get logged out every once in a while. It makes the CMS unusable. I have tried: Clearing cookies Resetting the cache in the backend Sometimes it logs out after 1 pageview, sometimes…
Jason D
  • 1,132
  • 1
  • 9
  • 17
18
votes
2 answers

How do I force Craft to regenerate assets transform?

I had to add an image size in the assets transforms; all my pics were previously uploaded, but when I use getUrl('headIpad'), it makes urls like this: http://host.com/cpresources/transforms/4/ Instead of…
Kateriine
  • 181
  • 1
  • 4
18
votes
6 answers

Solution for Matrix-within-Matrix (or More Robust Table Fields)

I was wondering if anyone has stumbled on a good solution for including matrix-like fields within a matrix block. I’m working on a site where each page's is constructed in one big matrix with several block types (each representing a “row" in the…
philzelnar
  • 735
  • 6
  • 15