Site logo

Archived topic

Suggestion for Elements Display Rules

3 replies · Started by Bill Forsyth III on June 2, 2021

Viewing posts 1–4 of 4

Howdy!
I've really been putting elements through the paces on my current project.

As I've been tuning page rules, I've realized something: It would be really, really handy if there could be a display rules exclusion based on existence of other elements on the page.

For example, the project I'm working on, the customer has designed two different page hero styles. It would be nice if the most used page hero display rule was set to display on entire site and set to exclude alternate hero element was used.

By allowing for exclusions this way, it would eliminate the need to assign pages that need the special rule and also add every one of those pages to the exclusion of the primary element. That way you're only having to make one entry for each exception, rather than two.

Thanks!
Bill

Hi there,

It's definitely nice to have automatic exclusions and/or intuitive suggestion of exclusion rule depending on existing elements but this will be a lot more complex than what it seems.

I'll log this on GitHub but we can't guarantee if/when it's going to be implemented. Especially this one as it's definitely going to take a lot of development time to implement.

Hi Elvin,
I always hate it when people use the word "just" when they don't know what all is involved.... but can't you "just" create something similar to the page exclusion where you choose the page to exclude. It could be an exclusion type of "element" and the dropdown would be the other elements. I could see it could get to be a hairball if you've got cyclical exclusions or a chain of exclusions, but I think if you only looked one level deep, that should help keep it simpler.

Also, I love the "Elements" entry in the admin bar. That's been great for being able to quickly identify and modify an element that needs work.

Thanks,
Bill

Hi there,

the tricky part here is that a 'hooked' element has no way of knowing that another element exists on the page.
However, we did manage this with the Block Element Content Template for archives - using Parent / Child Hierarchy - you can see that in action here:

https://www.youtube.com/watch?v=8byA37OTBRg

We 'may' be able to introduce similar functionality to other Elements.

This archived topic is closed to new replies.