OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



change display position of leftSidebar (help)

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

change display position of leftSidebar (help)

Postby samice » Thu Jan 30, 2014 4:08 pm

Hi guys, I'm trying to style components in my leftSidebar, but it interfers with the rest of my page each time i add a new component.. I finally came up with an idea to place the leftSidebar at the bottom of my page to avoid any more interference. So, I cut the
Code: Select all
{if $leftSidebarCode}
         <div id="leftSidebar">
            {$leftSidebarCode}
         </div>
      {/if}

section from "header.tpl" and pasted after the "</div> <!-- container -->" line in footer.tpl. after saving the new changes, I dont see the leftSidebar div anywhere in my journal page. I'm new to OJS, so Please what am I doing wrong? and how should I do it right? I'd appreciate any replies. thank you.
samice
 
Posts: 3
Joined: Fri Jan 24, 2014 3:32 pm

Re: change display position of leftSidebar (help)

Postby samice » Fri Jan 31, 2014 5:13 am

Please I'm still awaiting replies.. can't still figure out how to fix this.
samice
 
Posts: 3
Joined: Fri Jan 24, 2014 3:32 pm

Re: change display position of leftSidebar (help)

Postby mmott » Fri Jan 31, 2014 2:21 pm

For the OJS site I designed (http://www.haujournal.org/), I moved the sidebar down. Unfortunately OJS doesn't have a externalized templating system as far as I understand it, so while you can update .tpl files you run the risk they will be overwritten if you update the software. Hence I made only minimal changes in .tpl files and do most using javascript, basically including a javascript file that uses the already present jquery to move the sidebar to a different place on the site.

so I added:
Code: Select all
 <script type="text/javascript" src="{$baseUrl}/public/js/hau.js"></script>

to templates/article/header.tpl and to lib/pkp/templates/common/header.tpl just before the
Code: Select all
</head>
tag.

the Jquery code I use in the hau.js file for moving the sidebar on the hau website is:
Code: Select all
$(document).ready(function() {
   $("body").append($("#leftSidebar"));
});

'append' moves an element and places it after all other elements in the body tag in this example.

Hope that helps, it's a bit of a hack, but one that is relatively easy and doesn't change the base code too much.

M.
mmott
 
Posts: 2
Joined: Tue Dec 17, 2013 8:03 am

Re: change display position of leftSidebar (help)

Postby samice » Fri Jan 31, 2014 3:41 pm

You, my friend are genius! :D it worked at first try. Just the answer to my problem.
Thanx M, I owe you one. :)
samice
 
Posts: 3
Joined: Fri Jan 24, 2014 3:32 pm


Return to OJS Development

Who is online

Users browsing this forum: Google [Bot] and 2 guests