Including parts of a diet template in another

seany seany at uni-bonn.de
Sat Mar 25 20:56:14 UTC 2023


Hello

If we are creating a multipage Vibe.d application, we need to use 
diet templates. I can't find any info on how to include parts or 
whole of a diet template in another.

So for example, if i had pages :

1 =>

     ```
     html
       head
         //stuff in head
       body
         // a common div goes here
         .commonDiv
            // common div stuff here
         .first-page-specific-div
            // first page specific stuff ...


     ```

and

2 =>

     ```
     html
       head
         //stuff in head
       body
         // a common div goes here
         .commonDiv
            // common div stuff here
         .second-page-specific-div
            // second page specific stuff ...
     ```

I would like to do something like this

commonDivFile.extension =>

     .commonDiv
        \\ common div stuff goes here....
        \\ add css file affecting the common div
        \\ add javascript with event listeners for common div 
elements..

and then

1 =>

     ```
     html
       head
         //stuff in head
       body
         // some method to include commonDiv here, unknow to me
         .first-page-specific-div
            // first page specific stuff ...


     ```

and

2 =>

     ```
     html
       head
         //stuff in head
       body
         // some method to include commonDiv here, unknow to me
         .second-page-specific-div
            // second page specific stuff ...
     ```


I can't find a way to do this in documents. If it is in the 
documentation, please point me to it. I do not want to use an 
iframe.

What can be done in this case? Thank you.


More information about the Digitalmars-d-learn mailing list