primozs
February 25, 2018, 7:50pm
1
Hello,
I am using OMP 3.1.0. I have defined in the Settings-Workflow-Submission that I am going to use keywords. I have specified some keywords for a book.
But when I go to the catalog and open the book there are no keywords. At least I can not find them. Can you please let me know where to find the keywords that are specified for a book?
Regards, Primož
1 Like
asoto
March 28, 2018, 2:30am
2
I have the same problem and apparently there is no other post related to this issue. Has anybody found a solution about it? We are using also the version OMP 3.1.0.0
Hi @asoto ,
We’re about to release OMP 3.1.1 (within the week) and I strongly suspect it’ll solve the issue. I’d suggest upgrading when it’s available and checking if that fixes it.
Regards,
Alec Smecher
Public Knowledge Project Team
asoto
April 19, 2018, 5:09am
4
Thank you @asmecher , we have tested OMP 3.1.1 and we found the keywords are still missing, even when have been assigned in the catalog entry, as you can see in the screenshot. Should I do something else to show them in the OMP’s public site ? https://omp.latinbooks.org/index.php/prueba/catalog/book/1
![|637x500]
Hi @asmecher ,
Now I installed OMP 3.1.2.1 and still no keywords. So, the keywords are added to a submission, but not visible to readers.
Any idea what is wrong?
Best regards, Primož
Hi @asmecher ,
Hm, I have looked in the GitHub and if I understand it correctly this is the OMP tempalte to show a book:
{**
* templates/frontend/objects/monograph_full.tpl
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief Display a full view of a monograph. Expected to be primary object on
* the page.
*
* Many presses will need to add custom data to this object, either through
* plugins which attach to hooks on the page or by editing the template
* themselves. In order to facilitate this, a flexible layout markup pattern has
* been implemented. If followed, plugins and other content can provide markup
* in a way that will render consistently with other items on the page. This
* pattern is used in the .main_entry column and the .entry_details column. It
* consists of the following:
*
* <!-- Wrapper class which provides proper spacing between components -->
* <div class="item">
This file has been truncated. show original
I have checked it and there is no keywords in it.
Can you please verify my thinking and comment it?
Best regards, Primož
habib
July 8, 2019, 12:15pm
7
Hi @primozs
if it helps, this is what I did:
You coud add two lines in pages/catalog/CatalogBookHandler.inc.php (in the function book()):
// Keywords
$submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO');
$templateMgr->assign('keywords', $submissionKeywordDao->getKeywords($publishedMonograph->getId(), array(AppLocale::getLocale())));
In this way you assign the keywords to the template variable “keywords”.
Then you have to add a few lines at the appropriate place in ./templates/frontend/objects/monograph_full.tpl:
{* Keywords *}
{if !empty($keywords[$currentLocale])}
<div class="item keywords">
<span class="label">
{capture assign=translatedKeywords}{translate key="common.keywords"}{/capture}
{translate key="semicolon" label=$translatedKeywords}
</span>
<span class="value">
{foreach from=$keywords item=keyword}
{foreach name=keywords from=$keyword item=keywordItem}
{$keywordItem|escape}{if !$smarty.foreach.keywords.last}, {/if}
{/foreach}
{/foreach}
</span>
</div>
{/if}
I stole these lines from OJS, where it’s already implemented.
Regards,
habib
2 Likes
Hi @habib ,
Thank you very much for help - copying from the OJS, great idea. Works like rocket
Best regards, Primož
Hi @habib ,
Would you be able to open a pull request in github for this change? I think it would be a welcome addition.
Regards,
Alec Smecher
Public Knowledge Project Team
habib
July 9, 2019, 7:56am
10
Hi @asmecher ,
well, I tried, I hope I did it right.
Hi @habib ,
Yes, thanks! It’s at pkp/pkp-lib#4909 Add display of keywords by ohilbig01 · Pull Request #690 · pkp/omp · GitHub – I’ve added a comment there.
Regards,
Alec Smecher
Public Knowledge Project Team
habib
July 10, 2019, 6:08am
12
Hi @asmecher ,
if I have other minor things (missing translations and such) should I do it the same way?
Regards
habib
Hi @habib ,
By all means, contributions are always welcome!
Regards,
Alec Smecher
Public Knowledge Project Team