detail page title in browser drops to a backend news detail page title - typo3

It is not a bug, of course, but i cant figure out how to solve it.
With previous version of News there was all fine.
Sorry for my language, it hard to explain.
Current Behavior
For example - I have this page title behaivor for the first time news detail page visit -
"SiteName: Some NewsRecord Title" (this is fine, how it should be).
Then when i go to list view, and again click on news to view it in detail (or just refresh the page I'm currently viewing) - page title gets look like this:
"SiteName: news" where "news" is a page title in the backend page tree, that contains newsDetailView plugin
To override this strange behavior, i use such typoscript setup (But this should not be a permanent solution to the problem, of course)
[globalVar = TSFE:id = 7]
config.noPageTitle = 2
temp.newsTitle = RECORDS
temp.newsTitle {
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
htmlSpecialChars = 1
}
wrap = <title>SiteName: |</title>
}
page.headerData.1 >
page.headerData.1 < temp.newsTitle
[global]
Environment
TYPO3 version(s): [9.5.15]
news version: [8.0.0]
Composer (Composer Mode): [no]

With 9.5 and the nice SEO extension you really shouldn't do such stuff anymore. Don't use config.noPageTitle and it should work out of the box as the news extension will set the title just right.

Related

How to display latest or all posts (pages) of a parent page, in a single page in TYPO3 CMS

I have a TYPO3 TypoScript html template and want to show in a single page (called: "competitions"), a list of all competitions with their image and title and this should be links for each of them ('competition'). I have thought to make a page ('competitions') and subpages ('single cmpetition'). I'm not using Fluid actually. How can i get and display those in main page? Or is another way to achieve this ?
depending on your data structure (is the relevant info you want to show stored in the pages record or do you want access tt_content records inside that pages) it is more or less easy.
you always can access the informations with typoscript, but those constructs may get complicated. that means: developing the TS may take some time and the following rendering might also get complex and might take some time.
the easiest way: all information in pages records:
temp.competitions = CONTENT
temp.competitions {
table = pages
select {
pidInList = this
orderBy = sorting
}
renderObj = COA
renderObj {
wrap = <div class="teaser">|</div>
10 = TEXT
10.field = title
10.wrap = <h3>|</h3>
20 = TEXT
20.field = abstract
20.wrap = <div class="abstract">|</div>
30 = IMAGE
:
}
}

How to hide a plugin's title via Typoscript when rendering with css_styled_content

This is probably very basic, but I'm stuck.
In TYPO3 6.1.x with tx_news, I have configured the news detail view to appear on the same page as the list view as taught on http://docs.typo3.org/typo3cms/extensions/news/latest/Main/Tutorial/IntegrationWithTs/Index.html
Also, I have pulled in the news'header as h1 as such
temp.h1 = COA
temp.h1 {
10 = TEXT
10 {
value = <h1>{page:title}</h1>
insertData = 1
}
10 = RECORDS
10 {
if.isTrue.data = GP:tx_news_pi1|news
dontCheckPid = 1
tables = tx_news_domain_model_news
source.data = GP:tx_news_pi1|news
source.intval = 1
conf.tx_news_domain_model_news = TEXT
conf.tx_news_domain_model_news {
field = title
htmlSpecialChars = 1
}
wrap = <h1>|</h1>
}
}
What I couldn't solve yet is that the plugin element has a title (in the regular "header" field). I need to display this header only in the list, but hide that plugin's header field in detail view.
How / where can I do that via page TS?
This is probably not even in the plugin, but in css_styled_content?
Something like this...
[globalVar = GP:tx_news_pi1|news > 0]
plugin.tx_news.stdheader >
[else]
But how?
A plugin is always using this prototype object:
tt_content.list
Therefore you could delete the header of this object like that
tt_content.list.10 >
But if you have other plugins on the same page, their headers would also be deleted. So that would be a bad idea.
I would suggest you use the header_layout field. By default it has an entry called "Hidden" that will hide the header of your plugin. If you don't have it, check the Page TypoScript configuration. You can add own items by using:
TCEFORM.tt_content.headerLayout.addItems.99 = My Header Layout
Then you can then define the rendering of your own layouts in
lib.stdheader.10
(it's a CASE object)

typo3 show submenu without subpages

I have a website with some pages, presented in a normal menu. Every page has subpages and shows them in a submenu. Except one page. This page has no subpages and should have a content menu which navigates to different content sections on the page. The thing with the content navigation is done with:
temp.contentnav = CONTENT
temp.contentnav {
table = tt_content
select {
pidInList = 7
orderBy = sorting
where = colPos=0
languageField=sys_language_uid
}
renderObj = TEXT
renderObj {
field = header
wrap= <li>|</li>
typolink.parameter.field=pid
typolink.parameter.dataWrap=|#{field:uid}
typolink.ATagParams = class="linkSubpage"
if.isTrue.field=header
}
wrap = <ul id="subMenu"> | </ul>
}
page.10.marks.MENU.2a.NO.after.cObject < temp.contentnav
but this works only if the page has at least one subpage. The workaround would be to add a subpage and hide the submenulink, but is there a better solution to show the custom submenu without adding subpages?
Use a HMENU item with the levels to generate your submenu.
Your behavior is not the right one in the TYPO3 working style. Use the rights TypoScript objects.
And remove the "a" from the "page.10.marks.MENU.2a.NO". The correct use is 1,2,3,...
http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/CommonProperties/Index.html
http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/CommonItemStates/Index.html
http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Tmenu/Index.html
http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Tmenuitem/Index.html

Setting the page title in TYPO3

I have the below code and which makes the page title more seo friendly. However I am running into the below problems.
config.noPageTitle = 1
page.headerData {
100 = TEXT
100 {
field = description
noTrimWrap = noTrimWrap = |<title>| - Example Site</title>|
}
}
If I have the field = title it displays tha page title field, however on the news single page it doesn't work as it displays the name of the page rather than the title of the aritle.
If I have the field = description the news single defaults to the article title however if I haven't put a description on one of my pages then it displays
<title> - Example Site</title>
Is there away to do if description = '' show title (if it is not a news article)?
Or is there another way I should be approaching this?
There are many samples and snippets for using tt_news title as page title.
Check for an instance this one: http://blog.chandanweb.com/typo3/display-news-title-as-page-title-in-tt_news-detail-view

TYPO3 | Wrap only if not equal to value

Am using the following TS to customize my title tag to append the website name to the page title.
(Page title - Site Name).
config.noPageTitle = 2
page.headerData.5 = TEXT
page.headerData.5.field = subtitle // title
page.headerData.5.wrap = <title>| - Site Name</title>
My issue is that I do not want it to appear on the Homepage since the page title there is the same as my site name. (So it says Site Name - Site Name).
My homepage is the tree root, and all other pages are under it.
I want to omit this condition only for Home page.
I am looking for such a condition,
WRAP ONLY IF NOT EQUALS 'Site Name'
How can I achieve this. Any ideas?
Got the answer from the Typo3 Mailing list.
Awesome support there.
In case anyone needs it, here it is.
[globalVar = TSFE:id = 10]
page.headerData.5.wrap = <title>|</title>
[else]
page.headerData.5.wrap = <title>| - Site Name</title>
[end]
Now just change 10 to your homepage ID