I'm running opencart 2.0.3.1 and i wanted to add a responsive background image on the admin login page (route: common/login ). i thought on doing so by editing the header.tpl file on /admin/view/template/common and adding a php condition on the body tag where i add a class with the background if the route = "common/login".
My logic thinking: first i want to test if there's a route (so if !landing page), if there's one then check if it equals the login route and if so, insert the "background-image" class on the tag.
here's my php code:
<?php
if( !isset($this->request->get['route']) ){
if( ((string)$this->request->get['route'] ) == "common/login" OR ( (string)$this->request->get['route'] )=="login" ){
echo('class="login-background"');
}
}
?>
Here's my header.tpl's body tag:
<body
<?php
if( !isset($this->request->get['route']) ){
if( ( (string)$this->request->get['route'] )=="common/login" OR ( (string)$this->request->get['route'] )=="login" ){
echo('class="login-background"');
}
}
?>
>
and here's my css:
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
color: #666666;
line-height: 18px;
text-rendering: optimizeLegibility;
}
body.login-background{
background-image:url(http://example.net/image/login-admin.jpg);
background-position: center center;
background-size: cover;
background-attachment: fixed;
}
but i get this error:
Notice: Undefined index: route in "MYDIRECTORY"/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 39
If i'm not mistaken the problem is on the "2nd if" but i don't know how to solve it (I'm still a n00b as you can see.)
Hope you can help me out!!