Comments (5)
Ok tracked down the problem. Basically shortcode-core was only setting the twig vars in onTwigSiteVariables()
event. This is not available when Modular pages are rending, so i needed to add some logic for onTwigPageVariables()
. So should be good after next release.
from grav-plugin-shortcode-core.
ok fixed in latest release.
from grav-plugin-shortcode-core.
Just tried and it does not work for me. When I have this setting in my page's header:
content:
items: @self.modular
order:
by: default
dir: asc
custom:
- _what_we_do
- _portfolio
- _clients
- _team
- _where_we_are
- _contacts
shortcode variable is still null: am I missing something?
from grav-plugin-shortcode-core.
I think your confused as to the way modular pages work. It's quite similar to a blog list in that the modular.html.twig
template loops over a page collection to create the resulting total page. Each modular page though gets it's content()
method called and in each of those modular sub pages. The shortcodes are then associated with each modular sub-page, not the parent page.
The way I tested was to use the one-page skeleton and then add an 'author' section shortcode to the showcase.md
modular page. Then I added a {{ shortcode.section.author }}
in the templates/modular/showcase.html.twig
file that renders it, and it worked fine.
BTW, you should be able to get to the shortcodes from each modular page with the page.find()
technique.
from grav-plugin-shortcode-core.
Got it.
from grav-plugin-shortcode-core.
Related Issues (20)
- CSS of shortcodes not loaded with twig, calling with markdown|shortcodes filter HOT 1
- Shortcode update creating copies of itself HOT 3
- Unexpected error message when updating v5.0.4 to v.5.0.5 HOT 6
- Shortcodes fail to render HOT 2
- Shortcodes don't work correctly with enabled Markdown Extra
- Accessing 'page' throws 404 error HOT 1
- Fontawesome icons are not displayed HOT 4
- Update Readme HOT 1
- Support 'subject' argument for safe-email shortcode
- Nested shortcodes broken in flex objects content HOT 5
- Unclear description of admin_pages_only option
- Twig variables not rendering inside html tags HOT 1
- Can't add assets after update HOT 4
- not possible to load JS assets in bottom group HOT 1
- Question: Autocomplete in Shortcode possible? HOT 1
- RegularParser fails with memory exhausted errors
- Shortcodes refer to wrong subpage when used in loop. HOT 3
- Shortcodes of subpages do not refer to the correct subpage.
- Assets not loaded when using shortcode only in Twig HOT 11
- Album icon shortcode
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 grav-plugin-shortcode-core.