TYPO3 | Wrap only if not equal to value - typo3

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

Related

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

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.

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)

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

Why is my typo3 based root/home pagetitle inheriting to sub-page titles?

I have the pagetitle attribute set in my root page of my typo3 site. For some reason, that title seems to inherit to sub-pages even when I explicitly have the pagetitle set in the sub-page. For example, say I have my root/home page pagetitle set to "HOMEPAGE" and I have a sub-page pagetitle set to "SUBPAGE". The pagetitle that will appear on the sub-page when it is rendered is: "SUBPAGE - HOMEPAGE". Why is this happening? How do I set the page title to the value I want without it inheriting values from the root?
You can alter this behaviour in Typoscript:
config.noPageTitle = 2
## value 2 is correct
## see: http://bugs.typo3.org/view.php?id=1382
page.headerData.10 = TEXT
page.headerData.10.field = subtitle // title
page.headerData.10.wrap = <title>| - deinedomain.com</title>