TYPO3 include an extension via typoscript lib - typo3

I am using 10.4.16.
I wrote an extension, which works fine, if I install it as an plugin on a page.
It is a kind of news ticker and should run in the header part of the web page.
I have done it before with another extension, which works fine. But this time I don't get it running and I don't know how find out the problem or how to debug the code.
lib.header_ticker = COA
lib.header_ticker{
15 = USER
15 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = HGA
pluginName = Showfe
extensionName = Newsticker
controller = NewsTicker
action = show
view =< plugin.tx_newsticker_showfe.view
}
}
With #import will be the lib file included into the setup of the web site template. showfe is the frontend plugin of the extension.
Here the part of the template analyser:
I checked the source code of the web page, nothing of the code is included.
Solution:
Stupid mistake, forget to add
<f:cObject typoscriptObjectPath="lib.header_ticker" />
in the template file. Now it works!

Related

enable powermail spamshied is not working

I am working with powermail in typo3 version 8.7.31 and powermail version 6.1.0.
I want to enable powermail spamshield to the contact form but it not working see my code of typoscript.
I created new template for extension for contact page.
For constant
plugin.tx_powermail.settings.spamshield.enable = 1
plugin.tx_powermail.settings.setup.spamshield._enable = 1
plugin.tx_powermail.settings.setup.spamshield.methods.4._enable = 1
plugin.tx_powermail.settings.setup.spamshield.factor = 75
Also i added in setup the same code as above but nothing happen when i entered same value to the all fields.
Any help? Thanks
Spamshield is enabled by default in powermail. So no configuration needed. What if you enter "Viagra" in all fields. Is spamshield really not working?

How to set logout redirect in felogin plugin in TYPO3 6.2?

I'm using felogin - to get it to work I set it up in TypoScript in my root template:
plugin.tx_felogin_pi1 {
storagePid = 40,38,36,35,51
showForgotPasswordLink = 1
redirectMode = groupLogin,userLogin,login,loginError
redirectPageLogout = 6
...
It works fine, except when I try to logout while being on a page with restricted access because then it tries to find that restricted-page and for those cases I set up the install tool to redirect it to a "Page not found" template.
I noticed the logout-form action always points to the page ID I'm currently on:
<form action="index.php?id=49" target="_top" method="post">
so that's not what I want...I would like it to always be action="index.php?id=6" but my redirectPageLogout = 6 line didn't manage to change it.
Anyone an idea how can I change this?
In the felogin html template there's just ###ACTION_URI### and idk where it gets that from in the logout-form but I wanna play by the rules and not change it in the template directly...unless there's no other way.
You need to have access to a login-/logout-plugin after your logout is processed to get the forwarding working.
So if your logout plugin is on a page which is only invisible for logged in user. the logout is processed, but your redirect can't be processed (the default-handling of TYPO3 takes over and throws you to a page which is accessable). The same occurs if only the plugin itself is only visible for logged in users.
if you target the logout form directly to a page with a plugin visible for all, first the logout and secondly the redirect can be processed always.

Change the friendly URL of a web content in Liferay

I am currently using an article display page to display my web content in Liferay 6.2. I'm trying to figure out how to edit the path of my friendly URL after the /-/.
Current URL: siteName/-/articleName
Desired URL: siteName/-/topicSection/articleName
You are talking about the attribute JournalArticle.urlTitle. The problem is, that there is no UI in Liferay, which lets you change that attribute (at least not out of the box).
You've got two options:
If you just want to change an existing article, you can change that attribute in the database (I'd guess that the additional / is no problem):
UPDATE JournalArticle
SET urlTitle = 'topicSection/articleName'
WHERE urlTitle = 'articleName'
If you want to offer an UI for editing that attribute, you could write a hook.
Here a short summary how to write such a hook:
Add this lines to your liferay-hook.xml:
<portal-properties>portal.properties</portal-properties>
<language-properties>Language.properties</language-properties>
<custom-jsp-dir>/WEB-INF/custom_jsps</custom-jsp-dir>
Create a file portal.properties in the Java source directory and add this line:
journal.article.form.update = urlTitle
Create a file Language.properties in the Java source directory and add this line:
urlTitle = Friendly URL
Add a file WEB-INF/custom_jsps/html/portlet/journal/article/urlTitle.jsp into the web content folder:
<%# include file="/html/portlet/journal/init.jsp" %>
<% JournalArticle article = (JournalArticle)request.getAttribute(WebKeys.JOURNAL_ARTICLE); %>
<aui:model-context bean="<%= article %>" model="<%= JournalArticle.class %>" />
<h3>Friendly URL</h3>
<aui:input name="urlTitle" />

TYPO3 extension real_url returns 404 on all pages

assume the following pagetree structure
root
client1
page 1
page 2
page 3
client2
page 1
page 2
page 3
by default TYPO3 will display the page by id /index.php?id=[pid]
I'm trying to achieve the following effect
/client1/page1
so I came across the realurl extension which I did managed to make it work and I got the expected result in the url after setting
config.absRefPrefix = client1/
in my setup.ts field in my template
realurl.basic.enableAutoConf = 1
in the extension's configuration page
but now I'm getting a 404 on all pages when I access them like this /client1/page1 and
I only get the content without any css images and javascript when I access them over id
because the absRefPrefix is now added to the resources
e.g. /client1/fileadmin/assets/images/logo.jpg
whats wrong with this picture?
update 1:
setting absRefPrefix = / did 'fix' everything everything however I'm not meeting the client requirement now
the client's name should be in the URL in this format
mysite.com/client1/page1
right now I see mysite.com/page1
the client name is being skipped that was reason I added the client name in the absRefPrefix
Just like "user" i have to ask... why not place everything under root?
Then use:
config.absRefPrefix = /
config.simulateStaticDocuments = 0
config.tx_realurl_enable = 1
Answer to update1:
Check the pages Client1 and Client2, in page properties, general tab: Exclude from speaking URL should be left unchecked. RealUrl should by default create the structure you are looking for if the rootpage holds the domain and the client pages are really pages and not different websites.

TYPO3: 404 for restricted access page instead of login form

I have a link pointing to restricted page. When I access the link directly in logout status, its redirect to 404. Actually it should redirect to login form.
I tried:
config {
typolinkLinkAccessRestrictedPages=PAGE_ID
typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID###
}
Not working.
Also I tried the login status redirect plugin, no use.
Anyone know how to do this? I am using TYPO3 version 4.4.8.
As this is still unanswered, does this help?
Valid for TYPO3 < 8.x
# Check if user is logged in:
[usergroup = *]
# do something
[else]
page.config >
page.config.additionalHeaders = Location: http://www.yourdomain.org/login.html
[end]
I recently posted this to another questions and it crossed my mind that it might be a suitable workaround for your probem.
Found here
I'm not sure how to make redirection work correctly, but perhaps a bit of background will be helpful.
typolinkLinkAccessRestrictedPages only interacts with link generation. That way, anywhere you have a link to an access restricted page, you should get a link that points to the "PAGE Id" page. I suspect you are using your login pid in place of PAGE Id, which I guess should work, but I haven't used this particular feature. I have typolinkLinkAccessRestrictedPages = NONE which makes all links show up, linked to the correct url, but only users who are logged in will successfully load those pages.
If anyone, without being logged in, uses a bookmark to an access restricted page, or they click on one of these links, or directly type in the address, or whatever, they will run into TYPO3's 404 handling (with the error message: ID was not an accessible page). To change how TYPO3 handles these errors, you need to change what TYPO3 does via this setting in localconf.php:
$TYPO3_CONF_VARS["FE"]["pageNotFound_handling"]
I don't know if there's a clean way to just automatically redirect to the login page without hacking the pageNotFound_handling.
As far as the typoscript solution, that wouldn't work for my site, because the trigger isn't whether or not someone is logged in (often they will not be logged in)--the trigger for my site is trying to access a protected page when you are not logged in. I don't want it to redirect everyone who isn't logged in because a lot of pages don't require any login.
Fe_login cannot alone do this...
Follow these steps::
Install "pagenotfoundhandling" extention after felogin login
configuration.
Configure 403 page as login page in "pagenotfoundhandling" extention configuration.
Then, when you try to access "Access restricted page", "pagenotfoundhandling" will redirect to login page then pagenotfoundhandling handle redirect to again requested page. I have tested this on TYPO3 6.2.14
And I found an other workaround that looks like it should work fine.
# pages and subpages starting at 123 and 321 are restricted
[PIDinRootline = 123,321] && [loginUser = ]
page.headerData.666 = TEXT
page.headerData.666 {
data = getIndpEnv:TYPO3_REQUEST_URL
wrap = <meta http-equiv="refresh" content="0; URL=/passwort/?referer= | " />
}
[global]
Important notice: Do not restrict the complete page, only all contents of the page. Otherwise RealURL will trigger the 404 handler.
At the moment page.config.additionalHeaders (like used by #Mateng) does not support stdWrap, though you cannot add a referrer to redirect to the desired page after login (see TYPO3 Forge and vote for feature request).
Complete solution :
1. first in typo3conf/LocalConfiguration.php you have to add:
'FE' => [
'pageNotFound_handling' => 'REDIRECT:/login/',
"pageNotFound_handling_statheader" => 'HTTP/1.1 404 Not Found',
...
],
then add to typoscript :
'
config {
typolinkLinkAccessRestrictedPages = YOUR_LOGIN_PAGE_ID
typolinkLinkAccessRestrictedPages_addParams = &return_url=###RETURN_URL###
}
plugin.tx_felogin_pi1.redirectMode = referer
'
Because there seems no proper solution for this behaviour of TYPO3, I use the following workaround with RealURL.
Create a 404 page in TYPO3
set the Speaking URL path segment to "404-error" and check
Override the whole page path
Add a text that describes what is happening (i. e. "Page doesn't exist or is restricted, please login")
Add the felogin plugin to that page and hide it when users are logged in
Set [FE][pageNotFound_handling] = /404-error/ in the install tool
This 404-error page is shown every time a user requests a page that he is either not allowed to see or a page that does not exist. When the user uses the login form on the page, he will find the proper content immediately after login because the URI did not change at all (when there is no redirect configured for the fe_login plugin).