Copied to clipboard

Flag this post as spam?

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


  • Andrei 68 posts 130 karma points
    Nov 08, 2018 @ 09:44
    Andrei
    0

    Nested content - restrict elements depending on current page doctype?

    I have this situation: A data type "Standard page components" (nested content) which has a list of components available (like text-content, image, big-teaser, etc). This datatype is used on most standard pages. However on some pages I need to have more or less components available from that list. For example on a page type called JobPostingsPage I need to have available an extra component called "JobList". As it is today this can only be achieved by making a new nested content data type where I copy all elements from from 'Standard page components' and add the extra JobList. You can see how this gets nasty when you have more specific pages which need one or more extra components available. You end up having to maintain lots of list in different nested content data types.

    What I would like would be to restrict the elements available in the nested content based on the current doc type where they are used. All this because we want to prevent editors from adding specific components in pages where they should not be available.

    Anybody else having this problem?

  • Harry Spyrou 212 posts 604 karma points
    Nov 08, 2018 @ 11:51
    Harry Spyrou
    0

    Hi Andrei,

    I'm not sure if that's doable by default, but I had a similar problem a while ago and I just created Nested Content collections of data types according to the document type I was on.

    E.g. Home Page doctype had a nested content collection called homeCollection or something and I added as many modules I wanted in there. Let's say 15.

    Then went to a product page and had a different collection called productCollection that used 7 of the previous ones and 2 new ones.

    Does it make sense?

  • Andrei 68 posts 130 karma points
    Nov 08, 2018 @ 14:05
    Andrei
    0

    Hi Harry,

    Yes, it makes sense, that's also what I do for now. But I end up with a bunch of nested content collections that contain 15-20 elements. Every time a new component is made, I need to remember to add it to all collections. It's a bit annoying. And if I leave the project, at some point in the future, another developer will maybe not know to do the same.

  • Harry Spyrou 212 posts 604 karma points
    Nov 08, 2018 @ 14:20
    Harry Spyrou
    0

    Then you're looking into building a custom editor most likely but I've never heard or done what you're trying to do.

Please Sign in or register to post replies

Write your reply to:

Draft