picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.81k stars 616 forks source link

Add Event Triggers to `content` Filter #680

Closed PxaMMaxP closed 7 months ago

PxaMMaxP commented 7 months ago

In this merge I add important event triggers to improve the consistency in the functionality of PicoCMS. Previously, the onContentPrepared and onContentParsed events were only triggered when a page was called directly.

This limitation led to problems with plugins that rely on these events, especially if the content was processed via the internal Twig filter content. The added event triggers in the content filter ensure that all plugins involved in content creation work smoothly even when the content filter is used.

This change ensures broader and more reliable plugin compatibility within PicoCMS.

PxaMMaxP commented 7 months ago

Heyy,

thanks for your detailed explanations, and sorry for the confusion with the wrong branch.

About the change of the content-filter-trigger-events branch: My problem was that when I rendered the content of several pages with the content-filter on one page, the corresponding plugins were not applied to that content.

In my specific case, it was the targetBlank plugin. Links were not changed accordingly on the content-->content-filter-->output path.

I noticed that there was no note (issue..) about this and it should have made me suspicious.

I'll close the pull request and take another close look at the whole thing.