You are viewing the PKP Support Forum | PKP Home Wiki

OJS (could be for OxS) site index improvements

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.

OJS (could be for OxS) site index improvements

Postby ramon » Wed Mar 13, 2013 10:28 am

Hello all,

I'm creating a new post because I couldn't find any other post related to this.
Not sure if it should be here, but made more sense. Feel free to organize as you see fit!!

As I'm "playing" with OJS 2.42, I realized the site index hasn't changed much, and still does not allow proper CSS customization.
I believe the site index HTML output could be improved with the following (right after the really necessary alpha list, for portals):

Code: Select all
<ol class="journals">
{iterate from=journals item=journal}
        {if $site->getSetting('showThumbnail')}
                {assign var="displayJournalThumbnail" value=$journal->getLocalizedSetting('journalThumbnail')}
                {if $displayJournalThumbnail && is_array($displayJournalThumbnail)}
                        {assign var="altText" value=$journal->getLocalizedSetting('journalThumbnailAltText')}
                        <div class="homepageImage"><a href="{url journal=$journal->getPath()}" class="action"><img src="{$journalFilesPath}{$journal->getId()}/{$displayJournalThumbnail.uploadName|escape:"url"}" {if $altText != ''}alt="{$altText|escape}"{else}alt="{translate key="common.pageHeaderLogo.altText"}"{/if} /></a></div>
        {if $site->getSetting('showTitle')}
        {if $site->getSetting('showDescription')}
                {if $journal->getLocalizedDescription()}
                        <div class="journal_desc">{$journal->getLocalizedDescription()|nl2br}</div>
        <div class="journal_access"><a href="{url journal=$journal->getPath()}" class="action">{translate key="site.journalView"}</a> | <a href="{url journal=$journal->getPath() page="issue" op="current"}" class="action">{translate key="site.journalCurrent"}</a> | <a href="{url journal=$journal->getPath() page="user" op="register"}" class="action">{translate key="site.journalRegister"}</a></div>

{if $journals->wasEmpty()}
        <li>{translate key="site.noJournals"}</li>
<div class="pagenav">
        <div id="journalListPageInfo">{page_info iterator=$journals}</div>
        <div id="journalListPageLinks">{page_links anchor="journals" name="journals" iterator=$journals}

Basically, an ordered list, a few divs replacing <p> tags, with classes added to them, and an extra div to group the page nav, also with a CSS class added to it, was all I did.
This simple change allows much more flexibility with CSS styling.
I can remove the <li> numbering, float them and use CSS media queries to change the width of the <li> items so they adjusts to screen or device size, for example.

Anyway, just a suggestion to incorporate to the code. Improvements to this are always welcome.
If I come up with further ideas, I'll add them here...

Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
Posts: 945
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 4 guests