Skip to content

Commit

Permalink
add data-node_id to HTML body element for easy lookup from Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertlaposa committed Jun 24, 2015
1 parent 4e16838 commit 59d867c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions controllers/node/page/default.php
Expand Up @@ -112,6 +112,12 @@ public function processPage() {

$this->saveBodyCssClass($body_css_class);

/**
* save node_id to registry
*/

Zend_Registry::set('node_id', $this->GET['id']);

/**
* process open graph tags
*/
Expand Down
2 changes: 1 addition & 1 deletion templates/sys/html.html
Expand Up @@ -12,7 +12,7 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{REGISTRY.head}
</head>
<body class="{REGISTRY.body_css_class|htmlspecialchars}">
<body class="{REGISTRY.body_css_class|htmlspecialchars}" data-node_id="{REGISTRY.node_id}">
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
{SUB_CONTENT}
</body>
Expand Down
2 changes: 1 addition & 1 deletion templates/sys/html5.html
Expand Up @@ -17,7 +17,7 @@
<meta property="og:locale" content="{LOCALE_OPENGRAPH}" />
{REGISTRY.head}
</head>
<body class="{REGISTRY.body_css_class|htmlspecialchars}">
<body class="{REGISTRY.body_css_class|htmlspecialchars}" data-node_id="{REGISTRY.node_id}">
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
{SUB_CONTENT}
</body>
Expand Down
2 changes: 1 addition & 1 deletion templates/sys/html5_og.html
Expand Up @@ -17,7 +17,7 @@
<meta property="og:locale" content="{LOCALE_OPENGRAPH}" />
{REGISTRY.head}
</head>
<body class="{REGISTRY.body_css_class|htmlspecialchars}">
<body class="{REGISTRY.body_css_class|htmlspecialchars}" data-node_id="{REGISTRY.node_id}">
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
{SUB_CONTENT}
</body>
Expand Down
2 changes: 1 addition & 1 deletion templates/sys/xhtml.html
Expand Up @@ -14,7 +14,7 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{REGISTRY.head}
</head>
<body class="{REGISTRY.body_css_class|htmlspecialchars}">
<body class="{REGISTRY.body_css_class|htmlspecialchars}" data-node_id="{REGISTRY.node_id}">
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
{SUB_CONTENT}
</body>
Expand Down
2 changes: 1 addition & 1 deletion templates/sys/xhtml_10-trans.html
Expand Up @@ -13,7 +13,7 @@
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{REGISTRY.head}
</head>
<body class="{REGISTRY.body_css_class|htmlspecialchars}">
<body class="{REGISTRY.body_css_class|htmlspecialchars}" data-node_id="{REGISTRY.node_id}">
<!-- BEGIN: messages --><div class="onxshop_messages">{MESSAGES}</div><!-- END: messages -->
{SUB_CONTENT}
</body>
Expand Down

0 comments on commit 59d867c

Please sign in to comment.