小编ssg*_*est的帖子

在SilverStripe页脚之后插入JavaScript

为什么我的JavaScript出现在页脚之后?下面是我在布局中的代码(Page.ss):

<% include SideBar %>
<div class="content-container unit size3of4 lastUnit">
    <article>
    <h1>$Title</h1>
        <div class="content">
            <script type="text/javascript">
                window.onload = function() {
                    var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
                    function preload() {
                        game.load.image('logo', 'phaser.png');
                    }
                    function create() {
                        var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'logo');
                        logo.anchor.setTo(0.5, 0.5);
                    }
                };
            </script>
        </div>
    </article>
    $Form
    $CommentsForm
</div>
Run Code Online (Sandbox Code Playgroud)

javascript silverstripe phaser-framework

6
推荐指数
1
解决办法
451
查看次数

如何自定义SilverStripe页面的<title>

如何自定义<title>SilverStripe页面?

现在是的

<title><% if $MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> &raquo; $SiteConfig.Title</title>
Run Code Online (Sandbox Code Playgroud)

silverstripe

4
推荐指数
1
解决办法
1022
查看次数