How to paginate a sorted list in Typo3 10? - fluid

I created an extension on Typo3 which is used to list the businesses. This extension is composed of a list page and a widget which is used to make a search on the home page and which sends back to the list page the results.
Everything is functional but I just have a problem with the pagination. When I search for a business from the home page, the paginate works fine when you are redirected to the list page. But when I sort by category directly on the list page, the first page of the pagination is functional but when I click on page 2, all the businesses appear.
So I wanted to try by adding as argument addQueryStringMethod="POST" but this is not supported since version 10 of Typo3.
Here is my pagination:
<f:widget.paginate objects="{commerces}" as="paginatedCommerces"
configuration="{itemsPerPage: 3, insertAbove: 0, insertBelow: 1, maximumNumberOfLinks: 10}">
<f:for each="{paginatedCommerces}" as="commerce" iteration="iterator">
<f:render partial="Commerce/Pagination.html" arguments="{commerce: commerce}" />
</f:for>
</f:widget.paginate>
I've seen similar problems on Google but never any answers so if anyone has any ideas, I'm interested!

Related

How to find DotNetNuke pages that point to my dnn page

I have updated an existing user DNN page with some text. I can preview this page using the Page Management page. Since I didn't create this page I don't know which other pages/menus contain a link to this page. How can I find out which pages/menus link to this page?
Thanks
Who or what created the page?
What is the URL that you visit to edit the page? (Edit the URL here to use a phony name.)
Getting the exact number of links to a page is almost impossible without the use of a site crawler, as the page could be referenced in many ways.
Via HTML Content on a Page - This would be in the HTMLText table of the database
Via a Page-Link Menu Item - This would be in the Tabs table of the database
Via a URL-Link Menu Item - This would be in the Tabs table as well, just tied by the URL rather than the TabId
There is no report/link in the DNN Platform to list all usages.

Indexed_search only the news detail

I'm setup a TYPO3 v9.5 website with the Indexed_search ext.
When I search a word using the seachbox on the FE it show all results : home page, categories pages, and news pages.
there is a way to index/search only the newsitems detail page ?
There are multiple ways to achieve this.
In my opinion the simplest (without setting up crawler configurations) would be to limit indexing to only this page.
See https://docs.typo3.org/c/typo3/cms-indexed-search/master/en-us/Configuration/General/Index.html
On your root page you would set page.config.index_enable = 0 in TypoScript setup and on your news detail page page.config.index_enable = 1. Then clear and rebuild the index.
Another possibility for smaller sites is to filter the shown results in your Fluid template. I would not really suggest that but it works, too.

Sitefinity widgets not showing on News Detail page

Inherited a Sitefinity website. There's a news list page, which I discovered is reused by the news detail pages to display content. If I update the list page, the changes are reflected on the detail pages.
Sometimes.
I have a content block that contains a "header" text - updating this in the list page is replicated across the details pages. Adding a javascript widget to the page to inject some custom javascript replicates across the details pages as well.
Adding a new content block or css widget does not replicate across the details pages.
Is there some rhyme or reason to this behavior that I'm missing?
My specifics:
I've successfully created widgets in the MVC several times now. I essentially need to add a new widget to just the news pages. Which seemed simple enough until I discovered that news pages are not individually created pages like... well, pages... but instead are just a content piece that is dynamically inserted in the news widget on the "parent" listing page. At least as far as I can tell that's how it appears to be working.
Adding my widget to the page didn't work, as I explained above. I then tried recreating it in the page itself using javascript, content block, and css widgets, at which time I discovered that the javascript is the only one making it to the details pages. I imagine this has to do with the way javascript widgets actually make it to the page - their placement is selected in advanced options, rather than simply appearing inline.
Sitefinity widgets go beyond presentation, and actually control routing.
As such content widgets (baseline or custom) have two 'modes' that they operate in: list and detail. Slugs for details are automatically generated in the following format.
/News
/News/{News-item-slug}
Of course, a list and a detail should look very different. To accommodate that, the widgets have two separate configurable templates.
So, add your custom html and javascript to the appropriate template to have it only apply in a given mode.

How to search category and fill site parameters automatically

I have seen some sites where you search (in Google) for a particular item category and when you click the link found in Google it automatically goes to the site clicked with the search criteria filled in displaying the categorised products.
Hypothetical Example
Go into Google type in Sony TV , click to search.
Results are displayed.
Clicking one of the links takes me to a website which shows all the Sony TV models beginning with AA.
Looking at the search options on the page some fields have been automatically filled in (in other words if you did this search manually the site would prompt you to enter some search criteria) - Not sure if this is relevant but thought to mention.
How is this done? Do i need to setup something in our Google account to get the same results?
It's fairly simple. You pass parameters in your URLs that identify the product, and then you just read the URL parameters when pre-populating the search form on the page. When building your site / sitemap / internal & external links you use those page URLs and Google will naturally pick them up.
In your example, you search for Sony TV. One of the results may be
example.com/index.php?product=sony-tv
The website has the variable sony-tv, which it gets from the URL and pre-populates on the search form.
The important part to note is that the site will have built its URL structure in this method typically and the page you're presented with just happens to look like the site dynamically searched based on your query (it hasn't).

Typo3 Fluid ViewHelper for random page

I am making my first site with typo3 and I need to place a boxes with random pages on my first page.
I made an frontend extension and I have a ViewHelper in it wich displays a box with HelloWorld text in it.
My question is how to get the information about pages, to get random page and it's content?
Use cobject viewhelper and use Typoscript (hint the content element, google for it).