Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Adding <body> attributes programmatically

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1102 Views
  • spenniec
    Avatar
    Community Member
    37 Posts

    Adding <body> attributes programmatically Link to this post

    Hi,

    I want the ability to add some event attributes to the <body> tag of a Page but do so only through programming, not via a control or variable in a template file. I was thinking it would work like the Requirements includeInHtml method which seems to do the string replacing on the </head> tag

    Is there something like that already available?

    My question is:
    What calls Requirements::includeInHtml in the execution pipeline/rendering process so I can look at writing a class and methods to add the attributes?

    Seek and ye shall find. Answered my own question, it is SSViewer.php, what's my next move?

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Adding <body> attributes programmatically Link to this post

    Why not use Requirements::javascript() to include a js file that sets window.onload?

    1102 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.