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 ...
4
votes
How to change the name of an entry?
Settings > Sections > [Open your Page] > Change Name > Save
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 ...
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 ...
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=...
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 ...
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 ...
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 ...
2
votes
How do I get the url of single pages?
An other solution, you can use:
{{craft.entries.section("yourHandleSectionName").one().url}}
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)....
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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'...
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 ...
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.
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.
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
singles × 42templating × 11
entries × 8
structure × 7
sections × 6
routes × 4
navigation × 4
content × 4
localization × 3
field × 3
assets × 2
entry × 2
url × 2
craft3 × 1
matrix × 1
relations × 1
config × 1
image × 1
multi-site × 1
redirect × 1
performance × 1
array × 1
elementtype × 1
globals × 1
404 × 1