OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



How to display content if you are on the homepage

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.

How to display content if you are on the homepage

Postby cjpetrov » Sun Jun 08, 2014 11:40 pm

Hi there,
I have a question about another of my customization in the OJS. The task is that I want to be able to display some content only on my homepage. So my questions are:
1. How to convert the code?
2. How to detect if I am on homepage?

For example:
On the homepage I want the titles of the menu to be with different names, rather than the rest of the Journal pages. :)
Thanks in advance. :)

Regards,
Tsvetan Petrov
Medical University of Varna
cjpetrov
 
Posts: 18
Joined: Tue Apr 15, 2014 9:50 am
Location: Varna, Bulgaria

Re: How to display content if you are on the homepage

Postby cjpetrov » Mon Jun 09, 2014 1:49 am

I found a way, but is a work around, just by checking with a simple {if}{else} statement => $smarty.server.REQUEST_URI, which searches for the link after the host domain.

Code: Select all
{if $smarty.server.REQUEST_URI == '/ojs/index.php' || $smarty.server.REQUEST_URI == '/ojs/index.php/index/index' || $smarty.server.REQUEST_URI == '/ojs/index.php/index/about' || $smarty.server.REQUEST_URI == '/ojs/index.php/index/user'}
     <li id="about"><a href="{url page="about"}">{translate key="navigation.aboutHome"}</a></li>
{else}   
     <li id="about"><a href="{url page="about"}">{translate key="navigation.about"}</a></li>   
{/if}


Regards,
Tsvetan Petrov
Medical University of Varna, Bulgaria
cjpetrov
 
Posts: 18
Joined: Tue Apr 15, 2014 9:50 am
Location: Varna, Bulgaria


Return to OJS Development

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest