Closed fourroses666 closed 7 years ago
I think, better to build nav by javascript. Or you can create custom snippet for this.
Otherwise, it would be great to select "templates set" in snippet parameter. Of course, these templates should be defined in config. For example:
'templates' => [
'owner' => '@CHUNK cb-about',
'images' => '@CHUNK cb-about-images'
// this used by menu builder
'anchors' => [
'owner' => '<a href="#about[+iteration+]">About</a>',
],
],
In this case snippet call will look like:
[[ContentBlocks? &tplSet=`anchors`]]
[+iteration+] placeholder is not exists yet, it's in nearest plan
Cool, I think that will be a great solution. I'm very pleased with contentblocks :)
I don't need the iteration for the navigation I think. It will grab the sortorder of the blocks already? Maybe it can be extended with the sortOrder parameter?
[[ContentBlocks? &tplSet=`anchors` &sortOrder=`ASC`]]
Is sorting really needed? It is implied that sorting makes by manager
Ah not really needed. When the templateSet already picks the sortorder of the contentblocks order thats ok.
I was just thinking for other options for the templateSet snippet order.
I have started some testsite with ContentBlocks. Its a Onepage site. The blocks/sections need to have an anchor, (scrollto) that anchor name also has to show up in the navigation. When some new block is being added it also is being added in the navigation.
But how can I show it in both the anchor and the navigation? Is it possible to grab content out of ContentBlocks outside ContentBlocks?.
Lets say, grab field "header" out of config file "about".
[[ContentBlocks? &block=`about` &field=`header`]]