Remember me? forgot password | register

SilverStripe Forum

4683 Posts in 1048 Topics by 664 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 373 views
  • spenniec
    avatar
    Community Member
    35 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
    482 posts

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

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

    373 views
go to top Reply

Currently Online:

kudesign

Welcome to our latest member: patrics