aleksip / plugin-data-transform

Data Transform Plugin for Pattern Lab PHP
GNU General Public License v2.0
34 stars 10 forks source link

Use include() inside join()? #15

Closed aaron-capellic closed 6 years ago

aaron-capellic commented 6 years ago

Is something like this possible? Thanks.

{
  "page": {
    "title": "Act Now to Save Lives",
    "content": {
      "join()": [
        "atoms-paragraph-monthly-donor",
        "components-infographic-impact",
        "components-mega-card-gift-array",
        "include()": {
          "pattern": "components-related-card-group",
          "with": {
            "page": "fundraising"
          }
        },
        "components-newsletter"
      ]
    },
    "footer": "components-footer"
  }
}
aleksip commented 6 years ago

Hi, yes it is! You can find examples in https://github.com/aleksip/shila-drupal-theme.

dsrikanth commented 5 years ago

In case you ended up here like me, below is how it is done. { "page": { "title": "Act Now to Save Lives", "content": { "join()": [ "atoms-paragraph-monthly-donor", "components-infographic-impact", "components-mega-card-gift-array", { "include()": { "pattern": "components-related-card-group", "with": { "page": "fundraising" } }, }, "components-newsletter" ] }, "footer": "components-footer" } }

Reference: https://github.com/aleksip/shila-drupal-theme/blob/c68205196b73512c0a0ed0e3747368cb0ce030f4/dist/_patterns/03-templates/shila-basic-page/shila-basic-page.html%7Earticle.json