webman
webman

Reputation: 1203

TYPO3 realurl and tx_news, use title as entire path-segment

I migrated a wordpress website, using the Yoast SEO plugin, to TYPO3 and the news articles have URL's that use only the domain and the title;

## example
http://example.com/news-title/

does anybody knows any other option ?

Upvotes: 0

Views: 759

Answers (2)

Georg Ringer
Georg Ringer

Reputation: 7939

I propose this solution

1) Skip not needed arguments

By using the following setting

plugin.tx_news {
        settings {
                link {
                        skipControllerAndAction = 1
                }
        }
}

the links don't include the controller and action anymore. I prefer to use this instead of removing it in realurl because of less magic in realurl.

2.) Render the single view on the homepage

Just for clarification: As homepage is the meant the 1st page.

[globalVar = GP:tx_news_pi1|news > 0] && [globalVar = TSFE:id = HOMEPAGE-ID]
  lib.news = USER
  lib.news {
                userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
                pluginName = Pi1
                vendorName = GeorgRinger
                extensionName = News
                controller = News
                settings =< plugin.tx_news.settings
                persistence =< plugin.tx_news.persistence
                view =< plugin.tx_news.view
                action = detail
                switchableControllerActions.News.1 = detail
  }
  page.10 < lib.news
[end]

This is just a proof of concept as the final integration depends on how render your templates & content. You could also remove the page.10 < lib.news and check the variable lib.news in your content or you assign it to the variables and check that in the templates.

Upvotes: 1

Thomas L&#246;ffler
Thomas L&#246;ffler

Reputation: 6174

With the combination of

you are able to create such an URL. But I would suggest not to use the start page and create redirects to e.g. http://example.com/article/news-title/.

Upvotes: 1

Related Questions