How to link tt_news H1 title to the news itself? - typo3

For the SEO reason, I have to link the news title in single view to the news itself. When I try this by ###LINK_ITEM### marker it links to the (return-page) I've chosen in flexforms to return.
How should I link that title to the page itself, it also can be used as PERMALINK the other systems like wordpress have.

You can extend tt_news with new marker.
create the extension with the kickstarter or just create empty one (extend tt_news table if
necessary)
create hook-objects and register for the hook "extraItemMarkerProcessor"
create the marker and content within that hook and assign value of current url $url=t3lib_div::getIndpEnv('TYPO3_REQUEST_URL');

Related

Show other field than title for some page types in TYPO3 backend page tree

We have an extension in TYPO3 8.7, which we're updating to TYPO3 10.4. One thing the extension does is alter the page tree in the backend so for some page types a different field than title is shown. For TYPO3 8 we're using a hook for that: $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'] where we could loop through the page tree nodes, check the doktype and replace the text.
The page tree has been completely rewritten in TYPO3 9, so this hook doesn't exist anymore. I've looked in the new TYPO3\CMS\Backend\Controller\Page\TreeController class, but don't see any Signal Slot or PSR-14 event in that class we can use.
Is there a way to manipulate the page tree in this way in TYPO3 10?
If you use the Navigation Title field (nav_title) provided by TYPO3 out of the box, you can use the Page TSConfig option showNavTitle to prefer that in the page tree if set for a page:
pageTree {
showNavTitle = 1
}
If nav_title is empty, the regular title is shown instead.

Getting the page title from the new PageTitle

I'm looking for a way to get the page title set via the new PageTitleProvider API to display it inside a FluidTemplate.
In one of our TYPO3 installations, the page title is used as title, displayed on the page itself. The main PAGE object is set up to render a FLUIDTEMPLATE object. I've implemented the examples on the new PageTitleAPI in the documentation, https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/PageTitleApi/Index.html into my extensions and that works just fine for the tag.
However, within the page itself, the title set in the page is still displayed, not the title I've set in my extension.
I've figured out, that I can instantiate the PageTitleProviderManager, but getTitle still resolves to the page name, not the title I've set, most likely because this object is resolved before the PageTitleProviders are set up by the extensions.
$pageTitleProviderManager = GeneralUtility::makeInstance(\TYPO3\CMS\Core\PageTitle\PageTitleProviderManager::class);
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( $pageTitleProviderManager->getTitle() );
// -> outputs the page name, not the title custom page title
Is there a way to resolve the page title after all Providers are processed and display it in a fluid template?
I also assume it depends on order of execution. so you need to build an order where your plugin is executed before the page title is rendered in the page template.
nowadays most integrators use the f:cObject viewhelper to render the content with lib.content. that means the content (and your plugin is rendered very late), as the page title is probably rendered before any content in the page template (independend whether you use template variables from the page template or a viewhelper which executes PHP or typoscript in the moment of the rendering.
Here you get a hint how to change the order:
try to render the content (including plugins) into a fluid-variable with the page templating ( e.g.:
page.10 = FLUIDTEMPLATE
page.10.variables.content < styles.content.get
) and try to get the page title when the page fluid is rendered: use a viewhelper to get the page title when the initial FLUID variables are already computed.
of course you also can define a FLUID-variable for the content in the page FLUID template before accessing the page title by viewhelper:
<f:variable name="content"><f:cObject typoscriptObejctPath="lib.content" /></f:variable>

Get Page Name/ID of Content Element in Backend Edit View

I'm new to Typo3.
Inside the Configuration section of my own Content element I need the ID or name of the Content element's page. How would you implement that?
I already tried to use flux:field.input but I dont know what to do with typoscript.
record.pid was the thing I was looking for!
<f:debug>{record}</f:debug>

Display category and its content in TYPO3

I am using TYPO3 6.2.9 CMS.I make category and assigned to page.But I don't know how to display the category when i am showing the page i want all the category assign to that page must display then after clicking that category the content which i have assign to that category must display
There is no out-of-the box solution for this.
But you can use the following :
Or create your own extension where you gather the categories of your page and render them on your page. You then can also create a sort of category menu.
You can use category collection :
http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.html
cObject RECORDS has also a categories property, so you could also use typoscript for rendering.
For this purpose you can use extensions to your website.
Catalogue extension package
Which relates to categorisers and if you want to you can customize it in your own manner.
Use of these extensions make simple in listing category.
The usage is also given in its manual ans its simple to adopt it.

tt_news: List of categors with link

I have a LIST VIEW in tt_news. I want to display a list of all the categories each entry belongs to, like this:
"TITLE OF NEWS
Sports, Travel, Photos"
so that each category name links to the view of all news from that category, like the CATMENU.
How could I do it? Im using genericmarkers for tt_news to add custom objects
Use the extraItemMarkerProcessor we were talking about before and insert new marker ie. ###ITEM_CATEGORIES###. Then you can use some kind of loop for every category to build link with and pass it to the marker as a list of coma-separated links:
$pObj->cObj->typolink($catName, $catLinkConfArray);
Building links with typolink is documented in TSref