in2code-de / publications

Follower of EXT:bib to show publications in TYPO3. Im- and export of bibtext and xml files.
https://www.in2code.de/agentur/typo3-extensions/publications/
11 stars 16 forks source link

[FEATURE] adds HighlightAuthorViewHelper to highlight an Author ()by … #30

Closed karliwalti closed 2 years ago

karliwalti commented 3 years ago

adds HighlightAuthorViewHelper to highlight an Author.

custom html is wrapped around author name

Example in a citestyle doc:

        <publications:format.highlightAuthor author="{author}" before="<b>" after="</b>" searchterms="{filter.author}" >
            <publications:format.initials>{author.firstName} </publications:format.initials>{author.lastName}
        </publications:format.highlightAuthor>

TODO: (done, but will be pushed later when #27 and #28 are merged to prevent conflicts)

kfumy commented 3 years ago

one question to karliwalti: beside of the viewhelper, all templates still have to be changed?

karliwalti commented 3 years ago

one question to karliwalti: beside of the viewhelper, all templates still have to be changed?

@kfumy yes, as mentioned citestyles need to still be updated, but I wanted to wait until other merge requests are in that might cause conflict. Since they are now in, I will add updates in coming days.

@einpraegsam thanks for picking up the formatting conflicts. Happy to resolve this. I tried to maintain style of previous code and will pay extra attention to https://www.php-fig.org/psr/psr-12/

karliwalti commented 3 years ago

there is a mismatch between flexform definition and language definition: flexform: flexform.pi1.template.highlightAuthors db.localllang_db.xlf: flexform.pi1.filter.highlightAuthors

template versus filter ;-)

Thank you for picking this up.

I am facing the current challenge that citestyle9 is not working on my testenv from branch develop. Is this just mine or a common issue?

kfumy commented 3 years ago

no, citestyle9 is broken for me too (in the FE): TYPO3 Exception tells me:

(1/1) TYPO3Fluid\Fluid\Core\ViewHelper\Exception

Undeclared arguments passed to ViewHelper In2code\Publications\ViewHelpers\Format\MonthNameFromNumberViewHelper: suffix. Valid arguments are: month, limit in /app/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 478

kfumy commented 3 years ago

did not find the error yet in the citestyle.

kfumy commented 3 years ago

on line 208 in citestyle9.html there is a suffix=" " declaration. That causes the error.

kfumy commented 3 years ago

ah, it is because the pull request #38, which changes the responsibel viewhelper ist not integrated. ...

karliwalti commented 3 years ago

ah, it is because the pull request #38, which changes the responsibel viewhelper ist not integrated. ...

I removed this now with a comment to add it back when available. Also added style updates for citestyle4 and 9

kfumy commented 3 years ago

ah, it is because the pull request #38, which changes the responsibel viewhelper ist not integrated. ...

I removed this now with a comment to add it back when available. Also added style updates for citestyle4 and 9

it works now. in FE there is a strange whiteroom between year and page Bildschirmfoto 2021-11-17 um 15 20 31 es

kfumy commented 2 years ago

today, I worked with the publications again and there is a small point, where I can´t discover the reason of misformatting. Sometimes in a list of publications the '.' or ';' after year is correct, sometimes there is a space, look at the screenshot. It appeares on all Citestyles, here on "Vancouver for Web". Bildschirmfoto 2021-12-16 um 16 18 32 .

karliwalti commented 2 years ago

I noticed a similar thing already with the author list rendering. I do not have a good explanation for it, but the cause is following: When rendering is done with f:render of a section in same file, it seems that line breaks are included in the html, but this is rather random, sometimes it is rendered and sometimes not.

The only fix I have for this is to put all on one line without break. Not sure if there is a better way with Fluid.

@kfumy could you check whether this fixes the issue for you with citestyle9?