Typo3 News Extension - Global News Link Custom per Partner - typo3

I have the following problem. We have stored several websites for our partners in a Typo3 installation.
We have set up the site so that we bring global news for each customer to their website. If I now create a global message, it appears on the customer's website. Now we would like to place a separate link in the news for each customer. But apparently this is not possible.
Does anyone have any idea how to do that?
Thank you so much!
We use:
typo3 9.5.14
Extension: News System (news)

I am not sure, whether I understand you correctly.
You can easily use different templates for each customer by changing the paths to the template files in Typoscript for each websites:
plugin.tx_news {
view {
templateRootPaths.100 = EXT:your_extension/Resources/Private/News/Customer1/Templates/
partialRootPaths.100 = EXT:your_extension/Resources/Private/News/Customer1/Partials/
layoutRootPaths.100 = EXT:your_extension/Resources/Private/News/Customer1/Layouts/
}
}
Now you are able to set different links for each website.
Another way is to add a Typoscript variable in the settings section of the ext:news typoscript like this:
plugin.tx_news {
settings {
pageLinkUid = 123
}
}
And add the following link into your fluid template:
<f:link.page pageUid="{settings.pageLinkUid}">page link</f:link.page>
The link of the page can be changed with typoscript for each customer.

Related

Problem with file_list extension of Typo3

I am pretty new in Typo3 world.
I'm trying to list all the files in a folder and parse them one by one. To list the files, I'm using "file_list" extension (https://docs.typo3.org/p/causal/file_list/2.4/en-us/Index.html) and following the image gallery tutorial (https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/ExampleGallery/Index.html). To this end, I have created a folder at "/fileadmin/user_upload/test" and created three empty files in it for test purposes.
I have created these 4 files just as described in the tutorial:
ext_emconf.php
ext_icon.png
ext_localconf.php
ext_tables.php
This is the content of my "Configuration/TypoScript/setup.typoscript" file:
plugin.tx_filelist {
view {
partialRootPaths.100 = EXT:my_gallery/Resources/Private/Partials/
}
settings {
path = file:1:/user_upload/test/
mode = FOLDER
}
}
I have also created MyGallery.html under "typo3conf/ext/my_gallery/Resources/Private/Partials" with the same content as in the tutorial.
I have the file "typo3conf/ext/my_gallery/Resources/Private/Templates/Default.html" which includes one line:
<f:render partial="MyGallery" />
In Typoscript backend, I have created a page with a template and included "My Gallery(my_gallery)" and "File List(file_list)" static extensions in it.
The setup section of the page includes:
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
templateName = Default
templateRootPaths.1 = typo3conf/ext/my_gallery/Resources/Private/Templates
partialRootPath = typo3conf/ext/my_gallery/Resources/Private/Partials
}
Now my page renders the template and partial in the frontend (I could confirm this by injecting dummy content) but does not show any folder list. According to the HTML template, I assumed there should be a "files" variable passed to the page, but when I reviewed the debug information, I could not even find such a variable.
I need help to parse the folder content in the frontend HTML file.
Not tried it myself, but after a quick look into the documentations you linked.
Assuming everything was done corretly regarding the documentations, the point what you missed is following:
In the backend, in the page module, on any page create a new content element. There should be the filelist plugin. In the plugin option, there should be a option, where you can select your created "My Gallery" template.
Filelist is an extbase plugin. So it must be placed in a page. As alternative, you may add a typoscript to directly render a plugin instance into a template variabel, you can place / output in the template. Or in any template.
The first and easier option would be to place it in a page as content element.
If you want it as variable, you can create / rendet it as shown in the filelist documentation on https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/BestPractices/TypoScript.html
If you add such a snippet to typoscript (propely modified to match your stuff).
You can render it in the page template with:
<f:cObject typoscriptObjectPath="lib.filelist" />
But this would display it on every page.
For the start, I would suggest to go the "put it as an content element on a page" way.
edit 1 / answer on your comment
Maybe something went wrong or you missed, when you followed the gallery exampel on https://docs.typo3.org/p/causal/file_list/2.4/en-us/AdministratorManual/ …
Would suggest to check every step clearly.
Things, which came in my mind:
missing include of the default static template from the filelist extension/plugin on the root page / root template record
missing include of the static template from your dedicated extension (like in the example)
wrong order of the static includes (eventully)
not enabled your dedicated extension
missing cache clear
..

ext: news with rx_shariff - facebook shared news return problem

I use TYPO3 8.7 and NEWS extension 6.3 and shariff-sharing.
When i share a news record on Facebook the publication goes well, but when i tried to go back to news record i get 404 error. I think the problem is a query parameter called attach to outbound links by Facebook and appearing in the news record URL. Something like http://example.com/newstitle/?fbclid=IwAR2QIndkh'. What i must do to correct this?
Any help would be appreciated.
As #Wolffc already noted, you need to add the parameter to TYPO3's cHash excluded parameters.
If you use realurl, you also need to tell realurl about it. The current master contains a change for that https://github.com/dmitryd/typo3-realurl/commit/2f1dfced4a2f64656f4091ab79ab307ff6daa469 - that makes realurl reconfigure TYPO3 to include the parameter.
Until it gets released, I suggested a common configuration that I use my realurl configuration (let realurl use the TYPO3 conf) here:
https://github.com/dmitryd/typo3-realurl/pull/650
You need ro add fbclid to the chash ignored parameters in the install tool

What Typo3 newsletter extension can automatically fetch web content changes

The Typo3 extension tt_news enables for example all created news by this extension to be shown in the newsletter but not content from a "not news" page of the website.
We are looking for a plugin which automatically finds new content on the website and let us create a newsletter from it.
What extension could be used here? Might direct mail be able to do so?
Taken from the Direct Mail manual: "Newsletter pages are just normal pages. Their rendering is configured by the TS template."
A very simple solution for what you want to do would be to write a simple extension where you get the newest content elements and output them. Direct Mail itself will not do that for you, but it will send out any content that you provide on the "Newsletter page".

typo3: is there a way to see the pages and its html templates in one place?

in typo3 admin site, I am using TemplaVoilĂ  to make html templates. I have many pages in my site, so I wonder if there is a way that I can check which page is using which html template in one overall page, instead of checking it one by one, something like:
contact page: home.html
employer page: employer.html
...
You can use a hook to add this information in the TemplaVoila s module.

How can I render a link on a Powermail confirmation/submit page?

I'm trying to place a link on the submit page of my powermail setup.
You'd think this is a simple task, but bear with me.
My Powermail form has 2 hidden fields which are prefilled with a page ID and a page title.
These belong to the page I later want to return to, after having sent the mail. By putting these values in the form, I hoped to have access to them whenever I need them in the process.
I prefill these hidden fields from TypoScript like so:
plugin.tx_powermail {
settings {
setup {
prefill {
// Hidden "back to" page ID. This is the page you may want to return to after sending a mail.
backto = TEXT
backto.data = GP:backTo
backto.if.isTrue.data = GP:backTo
backtotext = TEXT
backtotext.noTrimWrap = |Back to ||
backtotext.data = GP:title
backtotext.if.isTrue.data = GP:title
backtotext.htmlSpecialChars = 1
}
}
}
}
1. Approach
Given that Powermail claims you can now use Fluid ViewHelpers in your content sections, I though, great, let's use the PageViewHelper, like so:
{f:link.page(pageUid:'{backto}')}
But where does my link text go? More inline notation to the rescue!
{backtotext -> f:link.page(pageUid:'{backto}')}
Rendered Result
Seems like the inline notation is not fully supported. I thought I was smart by simply using:
{f:link.page(pageUid:'{backto}')}{backtotext}
But this leaves the <a> tag open, which has very undesirable effects...
So - No link for me!
2. Approach
So I thought I would simply construct the link in TypoScript and render it on the page via
{f:cObject(typoscriptObjectPath:'lib.myBackLink')}
But I can't see any way to access the variables from the (sent) Powermail form in TS. So I don't have access to the page ID or title.
3. Approach
So I thought, if the default PageViewHelper only wants to render its children as its content, maybe I can roll my own ViewHelper that accepts the content as a parameter!
But how would I make that ViewHelper known to the system so that I can use it in my customized Powermail templates?
I've only used Fluid inside of my extensions before. It was obvious how Fluid would look up the correct ViewHelper by name, by what if I want to use a ViewHelper in my fileadmin folder hierarchy?
4. Approach
So, why not just use a normal link by using {backtotext} in the RTE?
TYPO3 realizes, that that is an illegal reference, and quickly turns the link into:
And the resulting output will simply not be a link.
So, that doesn't work either.
OK, so I change the target to {backtotext} (removed a slash). Now the URL is no longer recognized as internal and is marked with data-htmlarea-external="1". This causes my link to actually be fully evaluated and rendered (yay).
But it is now treated like an external link, RealURL no longer affects it and it is subject to external link _target behavior.
Why is this so difficult? What am I not understanding?
In RTE you have to use <link ###pageid###> instead of <a href="...">.
Have a look into the RTE DB field contents (or hit the no RTE checkbox) on how to use the link elements.
As it turned out, none of the previously attempted solution actually worked.
To get things over with, I just replaced the web section in the PowermailAll template, like so:
Section for Web view
<f:section name="web">
</a>
</f:section>
And then I used the following in my Submit Page content:
{f:link.page(pageUid:'{backto}')}{backtotext}{powermail_all}
Problem solved. I guess...