Is it possible to specify a default paint layout to be applied to nested content area?


(Evan Wills) #1

Hi there

 

Scenario: I'm using an nested content design area in a parse file to render the contents of a paint layout.

Question: Is it possible to hard code the paint layout ID into the design_area within the parse file, rather than having to do it at the customisation level?


(Tim Davison) #2

As far as I'm aware there's not.  I try to keep paint layouts somewhat separate from the site design, but maybe that's just my paradigm (and not necessarily the best).  What are you trying to do?  There may be a different way that suits a parse file more than nesting a paint layout.


(Evan Wills) #3

Hey Tim

 

I'm totally with you on separation of concerns usually, but in this case, I'm swapping out multiple nested (and very ugly) show_if statements in the parse-file for paint layout conditional keywords. So the paint layout is a fundamental part of the design and is never going to change.

 

Basically, my problem is that, for certain parts of the parse file, I have been nesting show_if statements up to five levels deep to handle branching logic. If you multiply this by six or seven areas where this type of branching logic is replicated, the parse file gets VERY messy and very hard to reason about. So much so that my colleagues won't touch those bit of the parse file any more and I always have trouble when I need to tweak them. I can achieve the same thing easily with paint layout conditional keywords but that creates a disconnect between the areas of logic. If I can hard code the paint layout in the parse file then I can reconnect the two.

 

If you have access to squizmap, I have a feature request there relating to this issue show_switch parse file design


(Tim Davison) #4

Gotcha.  And I agree, the switch type logic is one big thing missing from parse files/design areas.  It's the one thing I think everyone struggles with.

 

Have you tried just using the keyword %globals_asset_contents:xyz% where xyz is the asset ID of the paint layout?  


(Evan Wills) #5

Gotcha.  And I agree, the switch type logic is one big thing missing from parse files/design areas.  It's the one thing I think everyone struggles with.

 

Have you tried just using the keyword %globals_asset_contents:xyz% where xyz is the asset ID of the paint layout?  

 

Nice. No I hadn't thought of that but it's a very simple, solution. It still doesn't link the paint layout logic to the parse file but...

 

I wonder which method is more performant, specifying the paint layout through a globals keyword or through the design area customisation. (Maybe Bart has some insight)


(Tim Davison) #6

 It still doesn't link the paint layout logic to the parse file but...

 

Yeah, I thought that might be the case, that it might nest it but not 'process' it.

 

Usually I would hide behind caching for performance, but in your case it seems far more dynamic so probably won't apply.


(Evan Wills) #7

Sorry, Yes it does work. What I meant was, you still have to dig through the customisation configuration to find the connection between the parse file and the paint layout.