Bug 6566 - Publicly display keywords in article abstract pages, if they exist
Publicly display keywords in article abstract pages, if they exist
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: User Interface
2.3.x
All All
: P3 enhancement
Assigned To: James MacGregor
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-02 17:25 PDT by James MacGregor
Modified: 2011-06-07 13:46 PDT (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
adds "keywords" section to article view (793 bytes, patch)
2011-06-01 12:55 PDT, Mike Kamermans
Details | Diff
OCS patch (508 bytes, patch)
2011-06-06 17:54 PDT, Mike Kamermans
Details | Diff
patch against ojs-stable-2_3 (776 bytes, patch)
2011-06-07 13:39 PDT, Mike Kamermans
Details | Diff
patch against ocs-stable-2_3 (491 bytes, patch)
2011-06-07 13:39 PDT, Mike Kamermans
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James MacGregor 2011-04-02 17:25:22 PDT
Keywords aren't currently displayed publicly on article abstract pages (except in the RT, if enabled, which is a little buried). I think it's pretty standard that they be publicly displayed if they exist. The following code does just this (I've placed it between the abstract and citation code chunks in in templates/article/article.tpl), but should probably be refactored slightly (eg. this should probably have its own locale key): 

        {if $article->getLocalizedSubject()}
                <h4>{translate key="rt.metadata.pkp.subject"}</h4>
                <br />
                <div>{$article->getLocalizedSubject()|strip_unsafe_html|nl2br}</div>
                <br />
        {/if}
Comment 1 Mike Kamermans 2011-06-01 12:55:29 PDT
Created attachment 3530 [details]
adds "keywords" section to article view

This patch adds a "keywords" section to the article view, between abstract and citations; I made it use the "article.subject" key which we already had mapping to "keywords" so we won't need a new key for this.
Comment 2 Mike Kamermans 2011-06-01 13:01:17 PDT
there are a lot of <br/> in this template, incidentally. Should these be engineered out of existence (in the spirit of html/css separation)?
Comment 3 Alec Smecher 2011-06-01 15:10:20 PDT
No, leave the <br/> tags for now; best not to disrupt the CSS. This will probably need porting to OCS as well, if you get the chance.
Comment 4 Mike Kamermans 2011-06-06 17:54:55 PDT
Created attachment 3535 [details]
OCS patch

this patches the same issue in OCS, in the templates/paper/paper.tlp file
Comment 5 Alec Smecher 2011-06-07 12:53:17 PDT
On closer look -- the keywords should be fully escaped, rather than permitting limited HTML, as per the use of getLocalizedSubject in other template files. (This is for both OJS and OCS.)
Comment 6 Mike Kamermans 2011-06-07 13:39:10 PDT
Created attachment 3545 [details]
patch against ojs-stable-2_3

adds keywords between abstract and citations (fully escaped) in OJS
Comment 7 Mike Kamermans 2011-06-07 13:39:35 PDT
Created attachment 3546 [details]
patch against ocs-stable-2_3

adds keywords between abstract and citations (fully escaped) in OCS
Comment 8 Alec Smecher 2011-06-07 13:46:10 PDT
Committed to ojs-stable-2_3, ojs master, ocs-stable-2_3, ocs master.