Reputation: 20279
The editor created multiple tt_news article with the same title. If you navigate to the news you can see the correct excerpt, but when clicking on the detail view you get the article which is not the seen in the excerpt. It is an older article with the same title. The URL looks like this
http://yourdomain.com/news/news-detail/duplicate-article-name.html
The following versions are currently used:
CoolUriConf.xml_default
has the following content
<uriparts>
<part>
<parameter>tx_ttnews[tt_news]</parameter>
<lookindb>
<to>SELECT title FROM tt_news WHERE uid=$1</to>
<t3conv>1</t3conv>
</lookindb>
</part>
Now I changed it according to the manual to this
<uriparts>
<part>
<parameter>tx_ttnews[tt_news]</parameter>
<lookindb>
<to>SELECT CONCAT(tt1.title,IF(tt2.number>1,CONCAT('-',tt2.number),'')) FROM tt_news as tt1, (SELECT COUNT(*) AS number FROM tt_news WHERE title=(SELECT title FROM tt_news WHERE uid=$1)) AS tt2 WHERE tt1.uid=$1</to>
<t3conv>1</t3conv>
</lookindb>
</part>
I cleared all caches (including CoolURI cache) but now the latest article can be found if clicking on the URL. The URL hasen't changed.
What I'm doing wrong? I even tried it with another browser.
Upvotes: 1
Views: 336
Reputation: 20279
I finally found the error. It was the wrong file I edited. I edited typo3conf/ext/cooluri/cooluri/CoolUriConf.xml_default
.
You find the correct path if you go into the Extension Manager
and click on CoolURI
. There is a XML path
variable where the path to your real CoolUriConf.xml
is. In my case it was fileadmin
. Now the latest article has the following name:
http://yourdomain.com/news/news-detail/duplicate-article-name.html
An older one has this name
http://yourdomain.com/news/news-detail/duplicate-article-name-2.html
and so on. There are nicer solutions but all what CoolURI
can does.
Upvotes: 0
Reputation: 576
Try to use RealUrl it much much easier than CoolURI to configure.
Ok, I'm thinking about this and try to change query to:
SELECT CONCAT(tt1.title,IF(tt2.number>1,CONCAT('-',tt2.number),'')) FROM tt_news as tt1, (SELECT ROW_NUMBER() OVER (ORDER BY uid) AS number FROM tt_news WHERE title=(SELECT title FROM tt_news WHERE uid=$1)) AS tt2 WHERE tt1.uid=$1
After that you should have links like this:
http://yourdomain.com/news/news-detail/duplicate-article-name-1.html
http://yourdomain.com/news/news-detail/duplicate-article-name-2.html
http://yourdomain.com/news/news-detail/duplicate-article-name-3.html
Upvotes: 1