-2

I want to create a page template might be used in multiple sites.

what I am currently doing is like this

<header class="">
<template data-sly-template.header data-sly-resource="${@path='header', resourceType='sitename/components/content/header'}" </div>

I need to dynamically pass the path so when user navigate to a different site same header should be used.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

1

You can pass values to a template as shown below

<template data-sly-template.header="${@ path}">
    <sly data-sly-resource="${path @ resourceType='sitename/components/content/header'}"></sly>
</template>

and then call the header as shown below

<sly data-sly-call="${header @ path='header'}"></sly>
rakhi4110
  • 9,253
  • 2
  • 30
  • 49