• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

module_json breaks with custom params [bug?]

Participant ,
Mar 18, 2017 Mar 18, 2017

Copy link to clipboard

Copied

Currently module_json unlike a lot of the other module tag can't have a custom tag as it just refuses to render.

i.e This works:

{module_json, json="/cricket/teams.json" template="/Templates/scores.tpl"}

Is this a bug? As I would recommend that the ability to pass other params though.

The concept would be that you can push "state" into the template: "/Templates/scores.tpl"

{module_json, json="/cricket/teams.json" template="/Templates/scores.tpl" activeTeam="Australia"}

This would allow custom logic to be encapsulated inside the rendered template.

TOPICS
Developer

Views

359

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 19, 2017 Mar 19, 2017

Hi jnowland,

Unlike other classic BC modules which use related data in our back-end database, {module_json} uses a custom JSON file as its data source and displays it according to a template file.

{module_json} fails to interpret params other than json= "" & template= ""  as, other params are not defined in the system for this module hence, i would consider inclusion of other parameters as an enhancement rather than a Bug.

Alternatively, custom logic on desired Key can be defined in the template f

...

Votes

Translate

Translate
Adobe Employee ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

Hi jnowland,

Unlike other classic BC modules which use related data in our back-end database, {module_json} uses a custom JSON file as its data source and displays it according to a template file.

{module_json} fails to interpret params other than json= "" & template= ""  as, other params are not defined in the system for this module hence, i would consider inclusion of other parameters as an enhancement rather than a Bug.

Alternatively, custom logic on desired Key can be defined in the template file.

For instance on this test page a custom message is being shown when defined condition is met for "activeTeam" Key: Link to page

Data File

Logic on template

Hope that helps !!

Regards,

Himanshu.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

In summary - Not a bug.

It is a data file. You can pass as a collection as well if you need to combine other data.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

Thank Himanshu for explaining the reasoning behind this decision. An "enhancement" is a more accurate description.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

LATEST

You are welcome, jnowland. I am glad that i was able to assist.

Please feel free to contact us for any further help or info

Regards,

Himanshu.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines