You are viewing the PKP Support Forum | PKP Home Wiki

using {url page="" op=""} for highlighting in OCS?[RESOLVED]

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

using {url page="" op=""} for highlighting in OCS?[RESOLVED]

Postby chrpfeiffer » Thu Feb 14, 2008 9:13 am


first Im glad to work with OCS, for the features and being opensource.

Right now I'm trying to rework something in the templates (sidepar.tpl) for highlighting of current menu items. My knowledge of smarty templates is not too good, so there may be better ways.

For using a decision when to append
Code: Select all
I try:

Code: Select all
{if $pageTitle == "about.organizingTeam"}class="current"{/if}

Code: Select all
{if $requestedPage == "user"}class="current"{/if}

For me the question is, how to track the second part of the Url, after the requestedPage part ? Is there a way to operate in smarty with the op="xxx" variable?
Code: Select all
<a href="{url page="schedConf" op="cfp"}">

Or is there a way to geht the content of the "
Code: Select all
function smartyUrl($params, &$smarty) {
" for the item 'op' with smarty in the sidebar.tpl, to check the current page and do dynamic item highlighting?

from TemplateManager.inc.php
Code: Select all
function smartyUrl($params, &$smarty) {
      // Extract the variables named in $paramList, and remove them
      // from the params array. Variables remaining in params will be
      // passed along to Request::url as extra parameters.
      $paramList = array('conference', 'schedConf', 'page', 'op', 'path', 'anchor', 'escape');
      foreach ($paramList as $param) {
         if (isset($params[$param])) {
            $$param = $params[$param];
         } else {
            $$param = null;

      return Request::url($conference, $schedConf, $page, $op, $path, $params, $anchor, !isset($escape) || $escape);

Thanks in advance,

Last edited by chrpfeiffer on Fri Feb 15, 2008 7:06 am, edited 1 time in total.
Posts: 2
Joined: Thu Feb 14, 2008 8:22 am

Re: using {url page="" op=""} for highlighting in OCS ?

Postby asmecher » Thu Feb 14, 2008 10:35 pm

Hi Christoph,

I'd suggest exposing the current op to the Smarty template using:
Code: Select all
$this->assign('requestedOp', Request::getRequestedOp());
...somewhere in classes/template/TemplateManager.inc.php where all the other assignments happen. Then you'll be able to use the $requestedOp variable within your templates.

Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: using {url page="" op=""} for highlighting in OCS ?

Postby chrpfeiffer » Fri Feb 15, 2008 7:05 am

Thanks alot, that works!
Posts: 2
Joined: Thu Feb 14, 2008 8:22 am

Return to OCS Technical Support

Who is online

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