Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Aikman 43 posts 97 karma points
    Sep 19, 2019 @ 12:48
    Paul Aikman
    0

    Element Type Templates?

    It looks like templates can't be chosen for "element type" doc types, and element types are the only thing that can be placed in nested content.

    This seems a wee bit restrictive to me, are there any plans/workarounds to offer the flexibility of full doc type templates in element types?

  • Steve Megson 151 posts 1022 karma points MVP c-trib
    Sep 19, 2019 @ 16:18
    Steve Megson
    0

    Do you have a particular use case in mind? I'm not sure what assigning a template to a nested content element would let you do. Since it doesn't have a URL as a standalone page, when would the template be used?

  • Mario Lopez 168 posts 952 karma points MVP 3x c-trib
    Sep 19, 2019 @ 22:49
    Mario Lopez
    0

    An element type doesn't need a template because it cannot be created in the tree so it doesn't have a url so it cannot be rendered on its own.

    En element is meant to be used in other doctype 'container' like in a nested content property.

    Why would you need a template?

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Sep 19, 2019 @ 23:35
    Nicholas Westby
    0

    Not sure of your use case, but I can think of two options that might work depending on what you're trying to accomplish:

    • Infer Template You could infer the "template" from the doctype alias.
    • Template Drop Down You could create a drop down property on each element type that allows the "template" to be chosen (and the drop down could either pick actual templates or just be a normal drop down with a few values you've added to it).
  • Paul Aikman 43 posts 97 karma points
    Sep 26, 2019 @ 12:45
    Paul Aikman
    0

    Hi folks, thanks for the replies.

    I'd hoped to use it in order to implement "variants" for components we were building - e.g you can drop a CTA component on the page via nested content and use the templates feature to set the layout (if it's going to potentially be very different markup but the same data fields across the site).

    We've gone back to the good old node/child node approach for this, which is a shame! Could have gone for the dropdown approach etc as suggested, but it was felt that "full" node doc types give you this out of the box anyway so it's maybe the best approach for now.

Please Sign in or register to post replies

Write your reply to:

Draft