Override page title when logged in - TYPO3 - typo3

I have TYPO3 8.7.7. with fluid_styled_content.
I want to change the the title of the login page from 'login' to 'logout' (subtitle) when the user is logged in. With TYPO3 7.6.x I used the following snippet successfully
[loginUser = *]
temp.mainnav.2.NO.stdWrap.override.cObject = TEXT
temp.mainnav.2.NO.stdWrap.override.cObject {
value = subtitle
if.value.field = uid
## ID of the login page
if.equals = 22
}
temp.mainnav.2.CUR.stdWrap.override.cObject <lib.mainnav.2.NO.stdWrap.override.cObject
[global]
Now I have always the same title.

Sorry that I don't have the solution for TS, but here is how I did for this situation. I create 2 pages, one for Login (show at any login) and the other for Logout (hide at login).

You could use fluid in this instance:
<f:security.ifAuthenticated>
<f:then>
Logout
</f:then>
<f:else>
Login
</f:else>
</f:security.ifAuthenticated>

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.

TYPO3 Extbase Parameters in Url get ignored. No action is called

I'm writing an extension which checks for the browser version, and if the version isn't supported a hint is showed.
I'm doing this with a typoscript condition, which works well so far. But in the hint is a link for the ignoring. The link should call my action "setSessionParameters" in the controller "BrowserCheck". If the link is clicked the correct url gets called, but the same output as before is shown (the hint). The action is completly ignored. I tried to put in a non existing action, but not even an exception is called, which means for me: It's not checked if the question is allowed in the ext_localconf and neither it gets checked in the controller.
I think the typoscript configuration could be a problem, but I can't find a solution. Can anyone help?
Please see my code below
ext_localconf.php:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'VENDOR.' . $extensionKey,
'browsercheck',
[
'BrowserCheck' => 'setSessionParameter',
],
[
'BrowserCheck' => 'setSessionParameter',
]
);
page.typoscript:
page = PAGE
[session('wcobrowsercheck') == "ignore" || checkInternetExplorer()]
page{
//normal setup
}
[ELSE]
// called setup for hint-case
page >
page = PAGE
page{
typeNum = 0
shortcutIcon = {$files.favicon.path}
10 = FLUIDTEMPLATE
10 {
templateRootPaths {
0 = EXT:my_extension/Resources/Private/Templates/BrowserCheck
}
layoutRootPaths {
0 = EXT:my_extension/Resources/Private/Layouts/BrowserCheck
}
templateName = MainPage
}
includeCSS {
...
}
}
[END]
link call in the template:
<f:link.action controller="BrowserCheck" action="setSessionParameters" extensionName="my_extension" pluginName="browsercheck" arguments="{ignore: 'true'}"> ignore </f:link.action>
I see 2 issues with your setup.
You define the PAGE object twice. And the second time you wipe all previous configuration
I can't see that you have placed the plugin on the page.
As your question targets the second issue, I recommend adding the plugin to the page via typoscript if you want that plugin to be available everywhere.
page = PAGE
// ...
page.999 < tt_content.list.20.extkey_pluginname
Or you use a plugin that is placed on the page as a content element. Both will work. But with the current setup you cannot call the plugin as it's not present on the page.

TYPO3 powermail front end set pid

I want to use powermail for a commenting system, including powermail and powermail frontend with typoscript on every page..
With the frond end module I would like to show only the mails of the current page.
I can set the value with
plugin.tx_powermail {
settings {
Pi2 {
main.pid = 15
}
}
}
which works
How do I assign the current page id?
main.pid.data = gp:id
does not work.
Or is there any approach for my problem?
main.pid.data = page:uid
should give you the uid of the current page.

Liferay hide sites depending on roles

In one requirement I need to hide some sites (from the top right menu ) depending on the role of the user .
Right now if the user X doesn't have the access to site ABC but he can still sees the site in the top right My Site menu. When he clicks on it he goes there and sees message saying you are not authorized. Instead of this I want to hide those site which the user doesn't have access to.
Is there any way to do so?
Check is the user is a member of the site. If he should not have access to the site, don't make him a member. The top right menu is generated according to the site membership.
here's [a link] , i hope this will help you , http://findnerd.com/list/view/Hiding-My-Sites-Menu-in-Docbar-in-Liferay/1940/
Update :
You can hide the "My Sites" menu from Liferay Docbar by creating hook. In my example i am hidding the menu option for all the users except those whose role is Administrator. You need to Hook the html/taglib/ui/my_sites/page.jsp
Add the following code to check whether the logged in user is administrator role.
boolean isAdminUser=permissionChecker.isOmniadmin();
Hence if the logged in user is Administrator we are showing the My Sites menu else hidding it. I added extra condition of isAdminUser in following code for same.
<c:if test="<%= !mySiteGroups.isEmpty() && isAdminUser %>">
Following is the code snippet from page.jsp
<%# include file="/html/taglib/init.jsp" %>
<%
String[] classNames = (String[])request.getAttribute("liferay-ui:my_sites:classNames");
String cssClass = GetterUtil.getString((String)request.getAttribute("liferay-ui:my_sites:cssClass"));
boolean includeControlPanel = GetterUtil.getBoolean((String)request.getAttribute("liferay-ui:my_sites:includeControlPanel"));
int max = GetterUtil.getInteger((String)request.getAttribute("liferay-ui:my_sites:max"));
if (max <= 0) {
max = PropsValues.MY_SITES_MAX_ELEMENTS;
}
List<Group> mySiteGroups = user.getMySiteGroups(classNames, includeControlPanel, max);
boolean isAdminUser=permissionChecker.isOmniadmin();
System.out.println("\n\n\n\n\n\n isAdminUser \n\n\n\n\n\n"+isAdminUser);
%>
<c:if test="<%= !mySiteGroups.isEmpty() && isAdminUser %>">
<ul class="taglib-my-sites <%= cssClass %>">
<%
PortletURL portletURL = new PortletURLImpl(request, PortletKeys.SITE_REDIRECTOR, plid, PortletRequest.ACTION_PHASE);
portletURL.setParameter("struts_action", "/my_sites/view");
portletURL.setPortletMode(PortletMode.VIEW);
portletURL.setWindowState(WindowState.NORMAL);
for (Group mySiteGroup : mySiteGroups) {
String escapedSiteName = HtmlUtil.escape(mySiteGroup.getName());
boolean showPublicSite = mySiteGroup.isShowSite(permissionChecker, false);
boolean showPrivateSite = mySiteGroup.isShowSite(permissionChecker, true);
%>

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