What is stopping to see article summary data also in search results?

[Application Version: OJS 3.2.1]

Hi, all mighty Gods of OJS!! :bowing_man: … again coming to you, with another challenge, which I gave up after few days :smiley:

I’ve made some changes in templates\frontend\objects\ article_summary.tpl, that I got additional data and different layout:

{$article->getAuthorString()|escape}<br>
<span style="color:grey;font-style:italic">
      {$issueIdentification|escape}, {$article->getPages()|escape}
</span>

And this I get under issue (TOC):
image
(Focus on grey text)

I already figure it out, that search result (templates\frontend\pages\ search.tpl) are sharing above mentioned *.tpl file.

<div class="search_results">
	{iterate from=results item=result}
		{include file="frontend/objects/article_summary.tpl" article=$result.publishedSubmission journal=$result.journal showDatePublished=true hideGalleys=true}
	{/iterate}
</div>

But there (search results page) I can’t get title off issue ($issueIdentification):
prtscr02
(Missing “GEOLOGIJA 61/2 (2018)”)

I know that somehow, I need to pass info about article(s) issue. I tried few things, but always got half blank screen (html generating was stopped when get to the “get me issue”). But on another hand, not sure why I don’t see data if they are seen in included file :thinking:

Anyway… has anyone idea, what is stopping that I don’t see same data on search result page and more important question - have anyone idea how/where/what need to be fixed?

Thx in advance and have a great day, Marko :beer:

Hi @Marko_at_GeoZS

Is this journal in production ? Could you share a URL or a screenshot of what is not working as you would like to?

Best,
Israel

Hi Israel,

two pics are already above in original post, but I can poste bigger one to be seen better. I can’t share any link as journal is still in development and on local network.

From this pic you see articles under issue:
01

With green marker I marked the name of issue. And I know that same view is also under Search results. But under Search results page I don’t see issue name (simple missing). As seen on this pic:

02

Marked with “red/pink”. So, strange for me is, why I don’t see issue name under Search reults page or more important - how can I see it there :slight_smile:

Hope that now is more clear anh thanks for your help.

Cheers, Marko

Hi @Marko_at_GeoZS

Have you tried to enable the debug parameter in your config.inc.php file and check the log for errors?
It seems it is not providing an output, maybe it is related to DB charset or local PHP file encoding.

Best,
Israel

Sorry, @israel.cefrin for late reply, but I was absent. I tried (I think) all/everything in config.inc.php file regarding debug, but nothing come up. I didn’t get any error message. Neither on the web, neither console.log, neither log file. It’s really strange, but I can’t figure out what could be an issue…

Cheers, Marko

Hi @Marko_at_GeoZS

Could you please check your PHP/theme template files charset as well and review whether they are encoded using UTF8 w/ or without BOM ?

Best,
Israel

1 Like

Hi @israel.cefrin, as I’m working on original templates, this shouldn’t change… but I’ve checked and everything is UTF-8. I’ve also checked DB charset, testing with “English” (where are non-Slovenian characters) and not results. Always missing issue name :frowning:

I really appreciate you’re help! Now I book my time just to find solution for this because this is last/only error that we have with our webpage.

Cheers, Marko

By my understanding, which is not big one :smiley:

In templates\frontend\pages\ search.tpl we’re calling article_summary.tpl

	{* Search results, finally! *}
	<div class="search_results">
		{iterate from=results item=result}
			{include file="frontend/objects/article_summary.tpl" article=$result.publishedSubmission journal=$result.journal showDatePublished=true hideGalleys=false}
		{/iterate}
	</div>

… with parameter article (and journal). And as we can see in article_summary.tpl, we’re passing parameter article…

{$issueIdentification|escape}, {$article->getPages()|escape}

… it is possible, that I don’t get issue name as there’s missing “issueIdentification”? I tried few modifications to get/pass this info, but not success :frowning:

Cheers, Marko

1 Like

Yeah, usually I do not reply to my post if not necessary :wink: … but, I come to the solution! And if anyone finds useful - her it is. (Read above posts, that you’ll understand what was a challenge)

As mentioned, in templates\frontend\pages\ search.tpl we’re calling article_summary.tpl … and passing two (article, journal) parameters. But to receive the title of issue where the article is published, I need it to pass also issueIdentification. So, this is mine “upgrade” of part, where search results are displayed:

{* Search results, finally! *}
<div class="search_results">
	{iterate from=results item=result}
		{assign var="title" value=$result.issue->_data.title.sl_SI|cat:' ('|cat:$result.issue->_data.year|cat:')'}
		{include file="frontend/objects/article_summary.tpl" article=$result.publishedSubmission journal=$result.journal issueIdentification=$title showDatePublished=true hideGalleys=false}
	{/iterate}
</div>

With {assign var="title" value=$result.issue->_data.title.sl_SI|cat:' ('|cat:$result.issue->_data.year|cat:')'} I assign the title ($result.issue->_data.title.sl_SI) and a year ($result.issue->_data.year) of the article ($result). sl_SI is locale (Slovenia) and cat: is for putting together strings.

And in include file I’ve passed an additional parameter issueIdentification=$title. And this is it! I finally got issue title (with year) also at search results:

Screenshot 2021-09-08 195456

Cheers, Marko

1 Like