Typo3 v9 Show "hidden" pages in sitemap - typo3

I am currently updating a website from Typo3 7 to Typo3 9. The Website includes a Sitemap, which I would like to also show pages that are marked as "Not in Menus". On the old version, this could be achieved usnig the following bit of typoscript:
tt_content.menu.20.2.includeNotInMenu = 1
tt_content.menu.20.2.excludeDoktypes = 6
This, however does not work anymore in v9 and I can't find any help on Google.

TYPO3 9 uses fluid_styled_content to render content instead of css_styled_content. The sitemap is rendered using a MenuProcessor. These same options are available in the MenuProcessor. You can set them using the following TypoScript:
tt_content.menu_sitemap.dataProcessing.10 {
includeNotInMenu = 1
excludeDoktypes = 6
}

The above solutions did not work for me. I am using Typo3 9.5.19
The following worked:
Add to constants
plugin.tx_seo.settings.xmlSitemap.sitemaps.pages.additionalWhere = no_index = 0 AND canonical_link = '' AND nav_hide = 0
Note: This does stop sub pages under a hidden page. all pages needs to be marked hidden

Related

How to show username in frontend in TYPO3 10?

In TYPO3 9 I managed to display the current username in a FLUID-template with the following Typoscript:
[loginUser=*]
temp.username = TEXT
temp.username {
insertData = 1
value = {TSFE:fe_user|user|username}
noTrimWrap = | ||
}
[global]
In TYPO3 10.4 this is not working anymore. Any idea how to display the current user?
Many thanks! Urs
In Typo3 V10, you have to use the Context API to retrieve data from global objects, try this :
[frontend.user.isLoggedIn]
temp.username = TEXT
temp.username.data = TSFE:fe_user|user|name
temp.username.wrap = |
[global]
Have a look at those links :
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/DataTypes/Index.html
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Context/Index.html#context-api
Florian
It's probably not working because you're using the old TypoScript conditions. Since TYPO3 9 the conditions work with Symfony expressions. The old conditions were deprecated in TYPO3 9 (but still worked) and removed in TYPO3 10. So [loginUser=*] will never be true in TYPO3 10. You should use [frontend.user.isLoggedIn] instead.
See https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Conditions/Index.html for more about the new TypoScript conditions.
Why use TypoScript? It is very limited on what it can bring back. I just finished a tutorial where you can use a ViewHelper to add an ExtBase variable which assigns the whole user object in the FrontEnd and you can use it wherever you want with all it's relations, even the image, which is difficult to get via TypoScript.
TYPO3 tutorial
Best regards

How to set default colPos in TYPO3

We are setting up a news integration for one of our customers and he needs the content element feature. But when adding a new content element to the News the system always selects an inexisting colPos. Through this, you can't specify the type of the content element before the colPos got changed.
Is it possible to change the default colPos from 0 to 1 or so?
I have tried to set the colPos by following code in the PageTS but it hasn't worked out for me.
TCEFORM.tt_content.colPos.config.default = 1
TCAdefaults.tt_content.colPos = 1 will force default value for all tt_content entries in this page (page tree).
Best way would be to set default value for news content elements only. This can be done with override child TCA
In TYPO3 version 7.6
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['foreign_record_defaults']['colPos'] = '1';
In TYPO3 version 8.6 and 9.5
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['overrideChildTca']['columns']['colPos']['config']['default'] = '1';
This can be configured in a custom project extension under ../Configuration/TCA/Overrides/tx_news_domain_model_news.php
TCAdefaults.tt_content.colPos = 1
Works for me. Add it to the page's TSConfig.

TYPO3 V7.6, default value for Number of Columns

How is it possible to set in Page TSConfig the default value for "Number of Columns" in TYPO3 V7.6? In erlier versions it was possible with TCEFORM.tt_content.imagecols = 1. If I set in V7.6 TCEFORM.tt_content.imagecols = 1 it makes no different which value is set. There is always imagecols = 2 set.
I have PHP 7.0.7 and use the rendering extension fluid_styled_content (not css_styled_content). Is there something I am missing?
Thanks in advance for your help.
TCAdefaults.tt_content.imagecols = 1
works for me in TYPO3 7.6.11
TCEFORM.tt_content.imagecols.config.default = 1 is not working, as described op.
Be aware: This config never works if you switch content type after saving a content:
https://forge.typo3.org/issues/75233

TYPO3 4.5.x set default pivar to fe_user uid

I have a page running TYPO3 4.5.x that has a singleview of a plugin (plugin.tx_browser). I would like the default pivar showUid to be the uid of the currently logged in user.
I can get the uid in typoscript with
data = TSFE:fe_user|user|uid
And I know I can set the piVar to a fixed value with
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid = 575
but i can not set
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid.data = TSFE:fe_user|user|uid
Is there a way to set the pivar thorugh typoscript dynamically?
The suggestion to use the stdWrap property unfortunately does not seem to work prior to TYPO3 6.2
Thanks
It's possible since Version 6.2. You just need to add the stdWrap property:
plugin.tx_browser_pi1._DEFAULT_PI_VARS.showUid.stdWrap.data = TSFE:fe_user|user|uid
See the the corresponding part in the TypoScript Reference.

In TYPO3 6.1, how to debug why CType is not rendering at all

In one of my TYPO3 6.1 sites, when I insert a content element of the CType "menu" ("MenĂ¼/Sitemap"), this is simply not rendered in the frontend. If I choose another CType, the item is output.
I have checked in the TSOB, tt_content.menu is there (css_styled_content is included).
Also, it is in the right column which is rendered via csc.
temp.maincontent < styles.content.get
temp.maincontent {
select.where = colPos = 0
wrap = <div class="maintext">|</div>
// required = 1
}
How could I debug this?
There was a weird issue with multiple backend layouts, being rendered in various parts of the PAGE COA. I've solved it by avoiding multiple use of the same temp. object, defining one temp.homecontent and one temp.standardcontent so they are not conflicting anymore.
To answer my own question "how to debug this": Well, by debugging.
I disabled all my TS includes and created the most basic kind of site: page = PAGE and page.10 < styles.content.get. With this setup, the CType menu was appearing. So I tried continuing by adding each TS template and then, when it stopped working, by adding / removing temp.item by tempitem from the corresponding template. Until I found the conflicting part. Fairly basic. But as there were no errors or similar hints in TSOB, probably the only way.