Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination template can't include partials because setPartialRootPaths() is never called #174

Closed
Defcon0 opened this issue Jul 14, 2023 · 2 comments

Comments

@Defcon0
Copy link

Defcon0 commented Jul 14, 2023

Hello,

I just tried to override the Widget/Pagination.html which worked. But then I tried to use a partial in it which didn't work.

It's mainly because the partialRootPaths aren't loaded at all:

https://github.com/tpwd/ke_search/blob/master/Classes/Lib/Pluginbase.php#L975

That could simply be fixed by adding

$view->setPartialRootPaths($this->conf['view']['partialRootPaths']);

in Pluginbase::renderPagebrowser().

In addition, in my project I have the case that I have more than 1 partials path. Hence, I can't just use the constant "plugin.tx_kesearch.partialRootPath".

Now I tried to fix that by using the following typoscript setup:

constants.typoscript:

@import 'EXT:ke_search/Configuration/TypoScript/constants.typoscript'

plugin.tx_kesearch.templateRootPath = EXT:sitepackage/Resources/Private/Fluid/Extension/KeSearch/Templates/
plugin.tx_kesearch.partialRootPath = EXT:sitepackage/Resources/Private/Fluid/Extension/KeSearch/Partials/

setup.typoscript:

@import 'EXT:ke_search/Configuration/TypoScript/setup.typoscript'

plugin.tx_kesearch_pi1 {
    view {
        partialRootPaths.200 = EXT:sitepackage/Resources/Private/Fluid/Components/
    }
}

This indeed works for the searchbox plugin but not for the resultlist and also not for the pagination when I add

$view->setPartialRootPaths($this->conf['view']['partialRootPaths']);

in Pluginbase::renderPagebrowser() as mentioned before. The additional partialRootPath is simply mising in $this->conf and I have no idea, why.

What can I do about that?

Thanks in advance

Bye Defcon0

christianbltr added a commit that referenced this issue Dec 1, 2023
Use the built-in pagination API to render the pagination
instead of a custom solution with a dedicated
standalone view. This simplifies overwriting the
pagebrowser with a custom template and also gives more
options for integrators because now partials can be
used.
@Defcon0
Copy link
Author

Defcon0 commented Dec 13, 2023

Thanks for the change @christianbltr . I adjusted my setup and it works now. 👍

But ain't that a breaking change in a minor version (5.1.3 to 5.2)?

@christianbltr
Copy link
Member

Yes, you are right. Maybe it would have been better to tag version 6. But on the other hand I would prefer to tag version 6 when it is compatible with TYPO3 13. And it is mentioned as a breaking change in the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants