Remember me? forgot password | register

SilverStripe Forum

3836 Posts in 845 Topics by 530 members

Jump to:

Extending and hacking

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Community » SilverStripe Forum » Extending and hacking » Adding <body> attributes programmatically
Page: 1 go to end Reply
Author Topic: Adding <body> attributes programmatically 220 views
  • spenniec
    avatar
    Community Member
    34 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?

    Last edited: 9 May 2008 at 5:48pm

  • Sam
    avatar
    Core Development Team
    477 posts

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

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

    220 views
go to top Reply

Currently Online:

There is nobody online.

Welcome to our latest member: dewoob