OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



displaying both cover image & TOC on home page..?

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

displaying both cover image & TOC on home page..?

Postby shimrah » Wed Apr 25, 2007 12:28 pm

Hello there,

Has anyone managed to display both the TOC and cover image on the home page at the same time? I will have a cover image for every issue, and would like to display them both.

I've been trying to figure this one out, but I'm having trouble making it work.

Any suggestions?

Thanks... :)
shimrah
 
Posts: 45
Joined: Thu Apr 05, 2007 10:01 am

Postby asmecher » Wed Apr 25, 2007 3:07 pm

Hi Shimrah,

This isn't possible via the user interface; you'll need to modify a few templates. If you've started doing so, please give me a quick summary of how far you've gotten and I'll see if I can provide some hints.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 7698
Joined: Wed Aug 10, 2005 12:56 pm

Postby shimrah » Thu Apr 26, 2007 7:30 am

Hey Alec,

I think I'm on the right track, but you can be the judge of that...

I've narrowed it down to the line
Code: Select all
{include file="issue/issue.tpl"}

in view.tpl. But I assume there's a parameter I need to set or a variable I need to pass in order to make the table of contents show up, because placing this line somewhere where I'm sure it's run doesn't output the table of contents.

Ideally, I'd like to have both the cover image and the table of contents show up on both the Home page and the Current page and, as far as I can tell this is the function to change in order to make that happen.

Am I getting warm?

Thanks...
shimrah
 
Posts: 45
Joined: Thu Apr 05, 2007 10:01 am

Postby asmecher » Thu Apr 26, 2007 9:38 am

Hi Shimrah,

It sounds like you're trying to bring the table of contents into the cover page; I'd suggest the opposite approach, because the way OJS sets up the template is different in each case. Try disabling the custom cover page on the Editor's "Issue Data" page, and then editing the issue template to display the cover page image and caption anyway.

Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 7698
Joined: Wed Aug 10, 2005 12:56 pm

Postby shimrah » Thu Apr 26, 2007 11:32 am

Ah!

Thanks for that... I got it working on the Home page with this view.tpl:

Code: Select all
<table cellpadding="5">
<tr>
<td>

<div><a href="{url page="issue" op="view" path=$issueId|to_array:"showToc"}"><img src="http://www.geriatricsjournals.ca/public/journals/{$issueId}/cover_1.gif" border="0" alt=""{if $width} width="{$width}"{/if}{if $height} height="{$height}"/></a></div>{/if}
</td>
<td>   
<div>{$issue->getCoverPageDescription()|escape|nl2br}</div>

      <h3>{translate key="issue.toc"}</h3>
      {include file="issue/issue.tpl"}
</td></tr>
</table>


Unfortunately, it's not happening on the "Current" page... any idea what's wrong with this code (specifically, why it results in no value for $issueId)?

Code: Select all
{assign var="pageCrumbTitleTranslated" value=$issueCrumbTitle}
{url|assign:"currentUrl" op="current"}

{include file="issue/header.tpl"}


{if $issue}
   {* Display the table of contents or cover page of the current issue. *}
   {include file="issue/view.tpl"}

{/if}

{include file="common/footer.tpl"}


Thanks again... the home page is looking great... :)
shimrah
 
Posts: 45
Joined: Thu Apr 05, 2007 10:01 am

Postby asmecher » Thu Apr 26, 2007 11:39 am

Hi Shimrah,

You can assign the issueId easily enough by adding this line after "{if $issue}":
Code: Select all
{assign var=issueId value=$issue->getIssueId()}
Regards,
Alec Smecher
Open Journal Systems Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 7698
Joined: Wed Aug 10, 2005 12:56 pm

Postby shimrah » Thu Apr 26, 2007 12:00 pm

That worked like a charm. Thanks!
shimrah
 
Posts: 45
Joined: Thu Apr 05, 2007 10:01 am

Re: displaying both cover image & TOC on home page..?

Postby alejo » Sun Mar 14, 2010 9:48 pm

Hello there

I would like to do the same thing on version 2.3.1.2. I have read this topic and compared with files mentioned, but I think what is said here is not applicable to this new version.
May I have some help, please?

Thanks,
Alejo
alejo
 
Posts: 11
Joined: Thu Apr 23, 2009 9:35 am
Location: Caracas, Venezuela

Re: displaying both cover image & TOC on home page..?

Postby mcrider » Fri Mar 19, 2010 2:08 pm

Hi alejo,

I'm having a little trouble following the beginning of this thread--Is the intention to display the table of contents and cover image for the current issue on your journal's home page? This should be automatic if you have a published issue and have enabled the setting in Journal Setup step 5.2.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: displaying both cover image & TOC on home page..?

Postby alejo » Sun Mar 21, 2010 7:02 am

Hi Matt

You are right: it's not quite clear. It's not really in the home page. What I'd like to do is to show, for each issue, both the TOC and the cover image (in /issue/current, for instance). When I select in ISSUE DATA to "Create a cover for this issue with the following elements: Cover image", the Table of Contents is not shown with the issue cover, but only as a link.

Thank you,
Alejo
alejo
 
Posts: 11
Joined: Thu Apr 23, 2009 9:35 am
Location: Caracas, Venezuela

Re: displaying both cover image & TOC on home page..?

Postby mcrider » Tue Mar 23, 2010 9:48 am

Hi Alejo,

One solution I found is to check the option 'Do not display cover image prior to table of contents' in the issue editing page, and then in templates/issue/view.tpl, add this line to about line 37 (between {elseif $issue} and <h3>{translate key="issue.toc"}</h3>):
Code: Select all
<div id="issueCoverImage"><a href="{$currentUrl}"><img src="{$coverPagePath|escape}{$issue->getFileName($locale)|escape}"{if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}{if $width} width="{$width|escape}"{/if}{if $height} height="{$height|escape}"{/if}/></a></div>


Let us know how that works.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: displaying both cover image & TOC on home page..?

Postby alejo » Wed Mar 24, 2010 8:32 pm

Hi, Matt

I checked the option 'Do not display cover image prior to table of contents' in the issue editing page, and added the line of code you suggested after the issue description:
Code: Select all
{elseif $issue}
   <div id="issueDescription">{$issue->getIssueDescription()|strip_unsafe_html|nl2br}</div>
   <div id="issueCoverImage"><a href="{$currentUrl}"><img src="{$coverPagePath|escape}{$issue->getFileName($locale)|escape}"{if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}{if $width} width="{$width|escape}"{/if}{if $height} height="{$height|escape}"{/if}/></a></div>
    <h3>{translate key="issue.toc"}</h3>

It works fine, but if I hadn't a cover image for one issue, I see the words "Cover page" instead. The same happens in the homepage if I want to show the table of contents, and the current issue doesn't have a cover image. I think a conditional must be missing.

Thanks for your help,
Alejo
alejo
 
Posts: 11
Joined: Thu Apr 23, 2009 9:35 am
Location: Caracas, Venezuela

Re: displaying both cover image & TOC on home page..?

Postby alejo » Thu Mar 25, 2010 5:51 am

Hi, viewtech, thanks for your answer

So far, I only did what Matt suggested me:

    1. I checked the option 'Do not display cover image prior to table of contents' in the issue editing page, and...
    2. ...added next line to templates/issue/view.tpl:
    Code: Select all
    <div id="issueCoverImage"><a href="{$currentUrl}"><img src="{$coverPagePath|escape}{$issue->getFileName($locale)|escape}"{if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}{if $width} width="{$width|escape}"{/if}{if $height} height="{$height|escape}"{/if}/></a></div>

    between:
    Code: Select all
    {elseif $issue} //line 36
       <div id="issueDescription">{$issue->getIssueDescription()|strip_unsafe_html|nl2br}</div> //line 37

    and:
    Code: Select all
    <h3>{translate key="issue.toc"}</h3> //line 38

After that, both cover image and TOC are shown nicely, but if any issue doesn't have a cover image I see the words "Cover image" where the cover should be. It happens the same in the homepage if I want to show there the table of contents of current issue (if it doesn't have a cover image, of course).

Thanks for your ideas,
Alejo
alejo
 
Posts: 11
Joined: Thu Apr 23, 2009 9:35 am
Location: Caracas, Venezuela

Re: displaying both cover image & TOC on home page..?

Postby mcrider » Thu Mar 25, 2010 10:02 am

Hi alejo,

You can just remove {if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if} from that code--Or else put in a conditional that checks if $coverPagePath is set before displaying anything.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: displaying both cover image & TOC on home page..?

Postby alejo » Thu Mar 25, 2010 4:56 pm

Hi Matt

I tried removing {if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}, but it didn't work: "Cover page" was still there. I tried then put in a conditional that checks if $coverPagePath is set, but it didn't work neither. Finally, I managed to do it with the conditional {if $issue->getFileName($locale)}. The code look like this now:
Code: Select all
{if $issue->getFileName($locale)}<div id="issueCoverImage"><a href="{$currentUrl}"><img src="{$coverPagePath|escape}{$issue->getFileName($locale)|escape}"{if $issue->getCoverPageAltText($locale) != ''} alt="{$issue->getCoverPageAltText($locale)|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}{if $width} width="{$width|escape}"{/if}{if $height} height="{$height|escape}"{/if}/></a></div>{/if}

I had to change the code for alternative text:
Code: Select all
{if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}

by this other one (I took it from /templates/issue/archive.tpl), because it wasn't showing properly the alternate text, but "Cover image", no matter what text I introduced in the issue data.
Code: Select all
{if $issue->getCoverPageAltText($locale) != ''} alt="{$issue->getCoverPageAltText($locale)|escape}"{else} alt="{translate key="issue.coverPage.altText"}"{/if}

Everything is working perfectly now.

Thanks a lot for your help,
Alejo
alejo
 
Posts: 11
Joined: Thu Apr 23, 2009 9:35 am
Location: Caracas, Venezuela

Next

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 2 guests