?
avatar SemaphoreOxalis
SemaphoreOxalis
29 Jan 2017

Steps to reproduce the issue

You want to insert fields in a article body.
For example you add a gallery to an article but you wan to offer the user to use this gallery in the body of the article.

Expected result

Having a button in editor just like module, article etc for inserting a plug-in value or label+value but of course the field is not render like "normally" with turning him off in option.

Actual result

Fields are only display before/after titles and body.

System information (as much as possible)

J!3.7A2

avatar SemaphoreOxalis SemaphoreOxalis - open - 29 Jan 2017
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jan 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jan 2017
avatar laoneo
laoneo - comment - 30 Jan 2017

We have that in DPFields and also in com_fields at the beginning. Then some people decided to make our own one parser and skip Mustache as template engine. Actually @chrisdavenport is the driver behind that, but it is still not finished yet. Perhaps he can tell more about the status.
I'v kicked out templating for fields and opened a new PR joomla-projects/custom-fields#135, just that we have the reference how the functionality would look like. For me this is a very handy functionality but people have not been in favor of using Mustache.

avatar chrisdavenport
chrisdavenport - comment - 30 Jan 2017

I wouldn't say that I'm driving it, I merely wrote a simple parser that would solve the problem without introducing the bloat associated with Mustache or Twig. In my opinion, all we need is a simple parser and let JLayout do the rendering. Others wanted to use a third-party library which does both (and then add JLayout into the mix as well). Opinions differ and no decision has been made.

See #11702 for the details. The PR also includes a refactoring of the loadmodule plugin to use the new parser.

This is an important decision because whatever parser we settle on will naturally tend to become the de facto standard for Joomla going forward, not just for Custom Fields, but for all extensions that need to parse and render embedded codes.

avatar Bakual
Bakual - comment - 30 Jan 2017

Actually, I think it would be enough to have a simple content plugin where you can select the field you want to insert and it then creates a tag like we have in other cases. Eg {field=15} where 15 is the ID of the field (selected from a modal). The content plugin then replaces that with the respective field. But maybe I'm thinkingto simple here and miss the complex part. I haven't tried it yet ?

avatar SemaphoreOxalis
SemaphoreOxalis - comment - 30 Jan 2017

I think so. Having a full rendering of the fields seems complicated (cool but complicated). My concern with a full rendering : what code will be included in the editor ? the {tag_fields} when we look at the source tab and the full render in the wysiwyg section ?

avatar laoneo
laoneo - comment - 30 Jan 2017

I suggest to try out DPFields for a demo, there the rendering functionality is still included. An editor button is shipped as well which inserts a field into the description. The documentation about that part can be found here https://joomla.digital-peak.com/documentation/162-dpfields/2750-rendering-fields. Me and many users of DPFields do like that functionality.

avatar chrisdavenport
chrisdavenport - comment - 30 Jan 2017

@Bakual Yes, that's what I was trying to achieve with #11702

I think Mustache is overkill (and isn't even a perfect fit as some additional code needed to be wrapped around it anyway) because it is trying to do the rendering as well as the parsing. I would argue that we only need a simple parser and let JLayout take care of the rendering. Nothing more. At least not in J3.

avatar Bakual
Bakual - comment - 30 Jan 2017

I wrote a simple content plugin which would allow to render a field within an item: #13814.
It's not ready yet for production but it you can try it out and tell me what you think.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 5 Feb 2017

@SemaphoreOxalis can this Issue can be closed because of PR?

avatar Bakual
Bakual - comment - 5 Feb 2017

Closing as we now have both plugins merged.

avatar Bakual Bakual - change - 5 Feb 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-02-05 12:17:43
Closed_By Bakual
avatar Bakual Bakual - close - 5 Feb 2017

Add a Comment

Login with GitHub to post a comment