Skip to main content
14 votes

How to write a simple navigation?

I pulled together this brain-dump of 8 different ways of doing navigation. There are probably more. With any method make sure you keep a close eye on the query count and load speed, as some of these ...
James Smith's user avatar
  • 5,344
4 votes

How to change the name of an entry?

Settings > Sections > [Open your Page] > Change Name > Save
JMKelley's user avatar
  • 1,416
3 votes

Where does Craft store HTML Templates?

It sounds like you have access to the CP, but not the server. In order to modify the template files (usually stored in the templates directory, next to the public web folder), you'll need SSH or FTP ...
August Miller's user avatar
3 votes
Accepted

Single entry with 450 Matrix blocks throwing error on save

Most likely you're bumping into php.ini limitations. I'd bump the values of memory_limit, post_max_size and max_input_vars and see if that helps. They are common culprits when POSTing large amounts ...
Brad Bell's user avatar
  • 67.5k
3 votes
Accepted

Change name of Singles

Add a /translations/ folder to your project root and within that folder a /fill-in-locale-here/ folder. Add a file "app.php" to that /translations/fill-in-locale-here/ folder which returns an array of ...
mdmngz's user avatar
  • 157
3 votes
Accepted

Translating a section's title field on save

Figured out something that works, though I can't explain why: {{ object.section.name|t(language=object.locale) }} Update Here's how to do it for Craft 3: {{ object.section.name|t('site', language=...
Mats Mikkel Rummelhoff's user avatar
2 votes
Accepted

Single not loading correctly with additional segments

If I understand your question correctly you might be better off using SEOmatic's Template Meta feature. Using the Template Meta you're be able to set the meta info on a per template basis. So in this ...
zackspear's user avatar
  • 545
2 votes

How do I get the url of single pages?

An other solution, you can use: {{craft.entries.section("yourHandleSectionName").one().url}}
Alexis Dalai Waldo Jiménez's user avatar
2 votes

How do I get the url of single pages?

To get an URL to a specific CraftCMS single entry. Look up for the entry unique id in admin panel and then apply in Twig template: Example below: {% set page_cookies_policy = craft.entries.id(10)....
denesis's user avatar
  • 109
2 votes

How to write a simple navigation?

This doesn't work for every project, but for brochure style sites I like having all the client-arrangeable pages in one Structure, with toggles on each entry to optionally show in primary or secondary ...
richardschaefer's user avatar
2 votes

Multi sites: how to give each site a home single entry?

It's well explained in your section settings in the CP: there is a table with the settings for each site with a hint to leave the field blank if it should be the homepage. If you want to have a ...
Robin Schambach's user avatar
2 votes
Accepted

Singles or routes solution

I would like to offer another solution: We always have a structured section pages where our clients can insert all the pages they want to show. It's a structured section because the menu is generated ...
Robin Schambach's user avatar
2 votes
Accepted

Using Structures instead of Singles

I'm doing this at the moment. It's not a perfect solution, but nor is it terrible. In a lot of ways, I'd quite like Craft to just burn Singles and Channels and use nothing but Structures. You can do ...
Matt Wilcox's user avatar
  • 3,209
2 votes
Accepted

How to display multiple entry loops on the homepage (Single section type)

You can do this in a Single without too much trouble. Your homepage will presumably have its own template, so the simplest solution is to content-manage the fields for your Hero, Intro and Image ...
Martin Spain's user avatar
  • 1,519
2 votes

Allow editors to create pages (singles)

Just make a channel for your generic pages, and set the route to {slug}, that way your editors can create, delete, edit and disable any generic template pages without needing to touch the more ...
Nick's user avatar
  • 146
2 votes
Accepted

"Single" Entry page gives 404, even though it's enabled

This was occurring because I didn't have a template file for the page in question. I added it under /craft/templates/. All I had to do was copy another template used for news articles and adapt it to ...
GDP2's user avatar
  • 141
1 vote

4.8.0 - How to avoid singles content to be duplicated accross all sites

How to avoid singles content to be duplicated accross all sites? Singles only exist once, so they don't have propagation settings. You can only choose the sites in which to enable the single section, ...
MoritzLost's user avatar
  • 11.5k
1 vote

How to change the name of an entry?

JMKelley has the right answer - adding that if you have a use case where an author needs to change the text, then be sure to make a field to use instead for display purposes. For singles its common ...
cherrykoda's user avatar
  • 1,114
1 vote
Accepted

Default field on any single pages

Frame Challenge – The question implies that you're allowing admin changes in production and/or are giving your editors / non-technical-collaborators admin privileges to create new sections, which is a ...
MoritzLost's user avatar
  • 11.5k
1 vote
Accepted

Can't get a Single

You need to use the machine name of the section, not the single's slug. Check Settings -> Sections in the backend to find out the machine name. Machine names can't contain hyphens, so about-us isn'...
MoritzLost's user avatar
  • 11.5k
1 vote

How to display multiple entry loops on the homepage (Single section type)

Martin Spain's answer covers a tactical way to handle this, but I thought I'd tackle this a different way. When you use the pre-built routing for entries or categories, Craft does some things behind ...
RitterKnight's user avatar
  • 6,582
1 vote

Allow editors to create pages (singles)

To let users create template without touching settings. On the top of my mind, you can try a "matrix" field with multiple "block type". And using "channel" section to replace "single" section.
Parry Huang's user avatar
1 vote

How do I setup the Login Page to work with requireLogin?

You didn't specify Craft 2 or 3, but I'm pretty sure this answer applies to both. The template should live at templates/login/index.twig or templates/login.twig. Craft will resolve to both of them. ...
Brad Bell's user avatar
  • 67.5k
1 vote
Accepted

Can't Access Image URL on Single Page

You left off the .first(). {% set notFound = craft.entries.section('page404').first() %} Without that, the Element Criteria Model will default to .find(). first - Returns a single Entry Model. find ...
Lindsey D's user avatar
  • 24k
1 vote

Can't open new single section

You will need to add a template called test.html that extends the "_layout.html" template. The layout template is just a wrapper template, and with the "_" in front of it, it will always be invisible ...
AbbeyDesign's user avatar
  • 1,527
1 vote

What's the best way to set up a content-manageable 404 page?

This is something I discuss in the Handling Errors Gracefully in Craft CMS article, not just for 404s, but for a number of different status codes/errors. The actual templating code then ends up ...
andrew.welch's user avatar
  • 11.6k

Only top scored, non community-wiki answers of a minimum length are eligible