Comments (7)
Cheers 👍
Absolutely, It's something I'm working on. For the most part it should work the same as Matrix fields. I'm working on having the template API be the same as entries in structures, so at the moment there's not a whole lot of support for handling child blocks. Fun fact though, you can use the {% nav %}
tag to output a Neo field.
I actually haven't really advertised this plugin yet for this exact reason, but somehow people have found it, haha.
from craft-neo.
re: Templating. How do we get to, loop through and render the child blocks?
from craft-neo.
Right. If we use block.children we get ALL the children regardless of entry.
from craft-neo.
Here we go:
{% for block in entry.neoContentBlocks %}
{% if block.type == 'multiColumn' %}
{% for col in block.children.ownerId(entry.id).type('column') %}
...
{% endfor %}
{% endif %}
{% endfor %}
where "multiColumn" is the parent and 'column' the children.
EDIT: nah. still get 'em all. the children don't know who their parent neoBlock is.
from craft-neo.
Hey @smockensturm sorry this has been trouble for you. Frustratingly this feature has been pretty hard to implement, but I've held back from advertising this plugin and writing the docs until it's implemented.
I've just released 1.0.2
which will let you get child blocks in the template, using a temporary API, just so it's usable in the meantime. This temporary API will remain supported throughout the 1.x
version. You can now check the README on how to use Neo in your templates.
from craft-neo.
Fantastic! Works a charm. On behalf of our entire team, we thank you. Looking forward to what you get up to.
from craft-neo.
My pleasure, thanks for using the plugin!
from craft-neo.
Related Issues (20)
- Chunk gc cleanup HOT 3
- Upgrade to 4.x breaking content HOT 4
- Error trying to propagate Neo field after updating translation settings HOT 2
- Neo Not Saving Changes to Field Layout HOT 2
- Exponential increase of blocks when adding an existing entry to another site HOT 5
- [Craft 5] Allow Neo fields to be reusable in field layouts HOT 1
- How to approach eager-loading in Craft 5 HOT 4
- Neo block queries return duplicate child blocks HOT 8
- [Craft 5] Action Menu won't open after a new Block is added HOT 3
- Craft keeps showing "Unsaved Changes" upon saving of an entry with Neo fields HOT 1
- Getting Invalid Field Layout Error in CP HOT 1
- Change section and site in content migration: Neo blocks lost HOT 4
- Copy / Paste of Neo Blocks HOT 1
- Javascript Error When Trying to Add a Block in Neo HOT 2
- Settings menu for fields in the layout designer not opening in Craft 5 HOT 2
- benf\neo\elements\Block::useMemoized(): Argument #1 ($use) must be of type Illuminate\Support\Collection|array|bool, benf\neo\elements\db\BlockQuery HOT 1
- Conditional asset fields not saving values after switching condition HOT 1
- [5.x] Error after changing field handle: Field is not included in the available field layouts HOT 5
- Entries from another site can be selected in the back end, but they are not output in Twig templates. HOT 2
- Entry condition applied even for single pages HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-neo.