Skip to content
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

Make current context available as placeholder in field options #166

Open
azeller opened this issue Apr 17, 2019 · 1 comment
Open

Make current context available as placeholder in field options #166

azeller opened this issue Apr 17, 2019 · 1 comment

Comments

@azeller
Copy link
Contributor

azeller commented Apr 17, 2019

Summary

This issue only concerns multi-context-mode. This is more of an enhancement than a bug. In some fields it's possible to make snippet calls so tags get processed and you can for example create your own set up input options by calling pdoResources to populate them. This is not context-aware.

Step to reproduce

Try to find a context placeholder and fail at it.

Observed behavior

Me not finding the context placeholder :)

Expected behavior

Me having a [[+clientconfig.context]] placeholder of some sort, so I can do this:

[[pdoResources? 
   &tpl=`@INLINE [[+pagetitle]]==[[+id]]`
   &parents=`0`
   &limit=`0`
   &context=`[[+clientconfig.context:default=`web`]]`
   &outputSeparator=`||`
   &showHidden=`1`
]]

Environment

ClientConfig 2.1.0, MODX 2.7.1, Debian, MySQL 5.7.25, PHP 7.0.33

@Mark-H
Copy link
Member

Mark-H commented Oct 24, 2019

This would likely need to be added in core/components/clientconfig/controllers/home.class.php around line 44-48. Perhaps simply $this->modx->setPlaceholder('context', $context) where $context is a validated key (currently handled around line 57-68.

Would be a cool enhancement but don't have time to build (and more importantly) test that right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants