<main class='main-page'> ">
<main class='main-page'> " />
U
U
Underdoggit2019-06-10 13:09:04
MODX
Underdoggit, 2019-06-10 13:09:04

Properly adding a main chunk to modx?

Hello everyone, I split index.html into chunks, now the main page looks like this:



  
    
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    



  





<main class="main-page"> </main>

Question: how to correctly insert the main wrapper as a chunk, and is there any point in this? As I understand it, if I change the class in main without adding it to a chunk, then it will be possible to combine styles using it as a parent? Or is this a bad approach?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Tarasov, 2019-06-10
@Underdoggit

Each chunk is another request to the database.
The meaning is determined by convenience, if the tag is the same everywhere, it can and should be stuffed. If it's different, it's not worth it, leave it at the template level. There are no strict rules here, do what is convenient for you + so that it is convenient to support it in the future. You can also parametrize a chunk by passing, for example, the same class into it:
and use it inside the chunk, a placeholder will be passed there.

S
Sanes, 2019-06-10
@Sanes

A good approach is to use Fenom

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question