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
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

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: 22
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: 22
Joined: Tue Apr 15, 2014 9:50 am
Location: Varna, Bulgaria


Return to OJS Development

Who is online

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

cron