Keywords not displayed in OMP

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

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

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:

I have checked it and there is no keywords in it.

Can you please verify my thinking and comment it?

Best regards, Primož

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 :slight_smile:

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

Hi @asmecher,
well, I tried, I hope I did it right.:slightly_smiling_face:

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

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