Jump to content

Best way to style PageTable elements?


Dani
 Share

Recommended Posts

Dear all,

I have the following situation: There's a template with a PageTable field. All the PageTable elements may have different templates - let's call them element templates. These element templates use specific stylings and scripts. E.g., one element contains a contact form (built with FormBuilder) that needs form-specific CSS and JS.

The page elements are not direct children of the page. They're attached to a separate page that serves as an element container. But that's just an aside.

I general, when it comes to rendering my pages, I am following the "delayed output" strategy suggested by Ryan.

Now my question is this: When I render the (main) page with all its PageTable elements (with possibly different templates), how do I include all the elements and their templates in the rendering strategy? Of course, in my (main) page template I could simply iterate over the elements and render them. However, at the time of rendering these elements, I haven't included their custom styling and script requirements yet. I should somehow do that before so that such specific stylings etc. can be included in the <head> section of the generated output.

I hope you understand what I am trying to convey. I just want to do it the beautiful way, or the PW way ^_^

Any suggestions are appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...