Forum
Is it possible to ouput shared content in a "detail" HTML template?
Is it possible to output share content in a "detail"/master HTML template?
e.g. let's say I have a general "refund policy" that I wanted all the individual products to include. I might want something like the following:
Product 1 (output from product_detail.html)
- Name of product: bike
- Refund policy: some text here that is always the same <-- this is shared content
- [Image of bike]
- [some other info about bike]
Product 2 (output from product_detail.html)
- Name of product: skateboard
- Refund policy: some text here that is always the same <-- this is the same shared content
- [Image of skateboard]
- [some other info about skateboard]
Someone in Slack helped me with this. Here is a solution applied to this example:
Then in product_detail:
Looks right - except you may need to add
encode="false"
to that last template tag to stop the content being double-encoded.