getgrav / getgrav/grav-plugin-shortcode-core

Modular pages share shortcodes

Open
#87 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
47
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm having trouble with modular pages, I have a bunch of modular pages with some [sections]. Each modular (sub)page contains a section with the same name.

The problem is that the shortcodes are added to the ShortcodeManager instance per request and are not cleared. That means that my three modular pages that each have a section [section name=first] all share the "first" section of the modular page that gets parsed first.

I suggest clearing the objects array before/after the processing of a (modular) page. For me adding `$this->shortcodes->resetObjects()` at the beginning of the processShortCodes function in `shortcode-core.php` works. But this breaks pages that also require rawHandlers (I don't).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.