This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

DMeganoski
DMeganoski

So I am working on integrating a pretty nifty wysiwyg html editor into october. This is fairly complex with the use of twig markdown for templates.

The idea, essentially, is that a specific page will always be selected, though you will see and be able to edit the layout and partials for that page as well. (depending on the selected element)

I have a raw code editor (ace) that contains the editable markdown.

Essentially what I need to be able to do is render strings like

{% partial "nav" %}

or

{{ page.title }}

as it would be on that particular page. trying to render this string with a simple

\Twig::parse('{% partial "nav" %}');

Which throws an 'unknown partial tag' error.

\Twig::parse('{{ page.title }}');

returns an empty string (of course, how would it know what variable to use)

So... aside from building the data and including the partials manually, is there a simpler way to achieve this?

DMeganoski
DMeganoski

Just as an update for anyone interested, I have came up with a solution that does part of what I need it to do.

I found where twig was being built in Cms\Classes\Controller and copied it over to my own controller. I had to also copy all of the twig extensions over, though I opened an issue requesting a change so that I did not have to.

More details: https://github.com/octobercms/october/issues/2184

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.