New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve getChunk to allow file based and inline tpl #14201

Open
sdrenth opened this Issue Dec 14, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@sdrenth
Copy link
Contributor

sdrenth commented Dec 14, 2018

Feature request

Summary

The getChunk method from pdoTools allows you to use file based and inline tpl's. So it doesn't require a modChunk reference in the database.

I think the core getChunk method should be improved to allow also file based and inline TPLs and would like to know who else would like to see this improvement into the core of MODX.

pdoTools uses a system setting for the base path of where all static elements live, the new core system setting static_elements_basepath could be used for this as well.

Examples:

'tplWrapper' => '@FILE /elements/chunks/menu/wrapper.tpl'

AND

'tplWrapper' => '@INLINE <ul>[[+wrapper]]</ul>`

Why is it needed?

We like to work file based and for performance it would be better if we can bypass the database when working file based. And also for small templates it can be a lot easier to create an inline TPL then creating a new modChunk snippet for it in the database.

In short, it makes life easier and is also faster.

Suggested solution(s)

I think the getElement method in the modParser class should be changed to also support file based and inline tpls.

What do you guys think about the idea and the suggested solution?

@Oetzie

This comment has been minimized.

Copy link
Contributor

Oetzie commented Dec 17, 2018

Maybe also use Fenom from pdoTools (or another template engine) for parsing templates and chunks instead of MODx tags/output filters?

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

JoshuaLuckers commented Dec 17, 2018

@Oetzie if that is something you would like to see I suggest creating a new issue/feature request instead.

@Jako Jako added this to the v3.0.0-alpha milestone Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment