Hot answers tagged

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 ...
user avatar
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 ...
user avatar
  • 7,248
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'...
user avatar
  • 2,985
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. ...
user avatar
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 ...
user avatar
  • 418
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 }}
user avatar
  • 601
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
user avatar
  • 66.5k
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 ...
user avatar
  • 23.6k
1 vote

Can I have non-boolean TargetBlank output using HTMLPurifier and the Redactor plugin?

And this solved the problem: "Attr.AllowedFrameTargets": ["_blank"]
user avatar
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 ...
user avatar
  • 6,341
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 ...
user avatar
  • 66
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 ...
user avatar
  • 6,288
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 ...
user avatar
  • 6,477

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