6
votes
Accepted
Navigation, Structure, Usage, WOES!
First up I'm not sure if I actually need to place any information into the Entry URL Format and Entry Template settings for the section
Nope, you can probably just un-check the Entries in this ...
4
votes
Accepted
Use Matrix field to output specific html
In your code block.type is the matrix block type, ie homeSlider.
There's alot going on in your code that I'm not sure is intended or not, but let's say you had the fields mainImage and imageText as ...
3
votes
Output values from all entries in a specific section EXCEPT those with a specific category id
You can get the entry IDs that have are related to the category and then exclude them from the all the entries.
{% set entryIdsWithCategory =
craft.entries.section('driverPositions').relatedTo('7192'...
3
votes
How is a typical frontend request output generated?
Craft is an MVC application, so most requests initially will get routed to a controller action. Steps 3-6 in our Routing docs page show the various ways that the target controller action is decided.
...
3
votes
Accepted
Show all images from Matrix Block
Because logoSlider.image is an array of images (even if there's only one image in the array) you need an additional 'for' loop to catch all of the images (not just the first or last). Try something ...
3
votes
Accepted
Cycle outputs plain text, should be html
You can use Twig's "raw" filter to prevent the HTML from being escaped
{{ cycle(['<div></div>', '2', '3', '4'], loop.index0)|raw }}
2
votes
Unable to output position select value
If you're looking to just output the value of the PositionSelect field, it's block.placement.
See here for more info: http://buildwithcraft.com/docs/position-select-fields#templating
2
votes
Accepted
Smart Map - Outputting locations from a Matrix field for all entries within a single section
Great question! While seemingly tricky, the solution to this should be relatively simple...
Per the documentation, the locations parameter can come in a variety of different forms. But the one we're ...
1
vote
Can I have non-boolean TargetBlank output using HTMLPurifier and the Redactor plugin?
And this solved the problem:
"Attr.AllowedFrameTargets": ["_blank"]
1
vote
Accepted
How to output Name in Matrix entries
If you must insist on using such a long field name rather than putting it in your twig template, then this code should work:
{% set field = craft.fields.getFieldByHandle('fieldName') %}
{% for ...
1
vote
How to output Name in Matrix entries
I believe that it is not possible looking at the Matrix Block Model Docs.
What I would usually do, instead of having the front end facing title as the Field Name, is keep the Field name solely for ...
1
vote
Accepted
Output getSegments() array in template
That's because getSegments() returns an array. You can either get one of those segments by using:
{% set segments = craft.request.getSegments() %}
{{ segments[0] }}
Or loop through all returned ...
1
vote
Navigation, Structure, Usage, WOES!
Lots of different ways to skin the snake here but depending on how big your site site is, why create a separate structure section to begin with?
For a recent build, I created a "Pages" structure ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
output × 11matrix × 4
templating × 2
craft3 × 1
plugin-development × 1
assets × 1
categories × 1
entry × 1
field × 1
redactor × 1
structure × 1
navigation × 1
category × 1
array × 1
plugin-smartmap × 1
getsegment × 1
id × 1
position × 1
cycle × 1