TYPO3 tt_news genericmarkers url for every news item on list view - typo3

I create the genericmarker (###GENERIC_URL###) of "current" url and display it on single view page.
plugin.tt_news {
genericmarkers.URL = TEXT
genericmarkers.URL {
data = getIndpEnv:TYPO3_REQUEST_URL
wrap = link: |
}
}
Is it possible to get the tt_news url for every news item and display it on list view as a additional url link?

If I understood you correctly, you need single view url ?
This should work :
plugin.tt_news.genericmarkers.URL = COA
plugin.tt_news.genericmarkers.URL {
1 = TEXT
1.data = TSFE:baseUrl
2 = TEXT
2 {
value =
typolink = 1
typolink {
# Change 1 to page UID where your single view plugin is placed
parameter = 1
additionalParams = &tx_ttnews[tt_news]={field:uid}
additionalParams.insertData = 1
returnLast = url
}
}
}

Related

Typo3 Fluid Templates How to add multiple templates

I have a finished static HTML Template. I need to map it to typo3 so the content is dynamic. I followed following tutorial: https://docs.typo3.org/typo3cms/SitePackageTutorial/FluidTemplates/Index.html
This works perfectly, but now I wonder how I can change the template per site? I made template for each site i.e Gallerie.html, Contact.html and they are linked to the same Layout as Header and Footer is always the same.
How do I now tell the page About us to use the Gallerie.html?
My setup.typoscript:
page = PAGE
page {
typeNum = 0
// Part 1: Fluid template section
10 = FLUIDTEMPLATE
10 {
templateName = TEXT
templateName.stdWrap.cObject = CASE
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
templateRootPaths {
0 = EXT:eventmanagement/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:eventmanagement/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:eventmanagement/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
}
}
At the Moment it loads the Default.html Template from eventmanagement/Resources/Private/Templates/Page/ on every page. I created now a second Template called Gallerie.html in eventmanagement/Resources/Private/Templates/Page/ how do I add this now to the page Gallerie in the Backend?
I don't know if it's very useful to have for (nearly) every page another template but in general that's possible. Just consider that in the root-line always that template is used that is defined on the current level or - if not existing - that, that is found first while going up the root-line.
For every additional template you've to add a section inside this snippet from above:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
So including the option about us the snippet could look like this:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
pagets__aboutus = TEXT
pagets__aboutus.value = AboutUs
aboutus = TEXT
aboutus.value = AboutUs
}
Additional you still have to change the TCA probably to include the options in the drop-down-button.

TYPO3 Hide & Replace Pagetitle in Breadcrumb

I have a little problem with my navigation and couldn't get it work...I got on every page a breadcrumb navigation which shows the page tree until the current page.
So far so good but when I go to the details page of my news I got the following tree Home > Newest > Article. I don't want to have the page title Article here because every other news would have this tree. Instead of the pagetitle I want to have the news title so I modified my navigation like this:
30 = HMENU
30 {
special = rootline
special.range = 0 | -1
1 = TMENU
1 {
stdWrap.dataWrap = <p>{ date : d.m.Y } ::: |
NO = 1
NO {
wrapItemAndSub = | >
stdWrap.htmlSpecialChars = 1
}
CUR = 1
CUR.allWrap = | </p>
stdWrap.append = RECORDS
stdWrap.append {
if.isTrue.data = GP:tx_news_pi1|news
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
}
}
}
}
And now the problem: when I click go on a page which is hidden in menus the breadcrumb looks like this Home >. Obviously the last page isn't displayed and this should be solved but I don't know how to do it.
At least I tried something with this in some combinations but cant't get it work
if {
value = 46
equals.field = uid
excludeUidList = 46 //includeNotInMenu = 1
}
When adding includeNotInMenu = 1 under the special.range hidden pages are shown in the breadcrumb title but then the breadcrum in news looks like this Home > Newest > Article NewsTitle and I don't want to have this 'Article' in it. Hope someone of you can help me!
first:
not displaying the current page is ok only for the news-detail page. so use a condition to realize it:
[page|uid = 123]
30.30.special.range = 1|-2
[global]
second:
add the current news title after the menu. the handling is a littel bit easier.
30.40 = RECORDS
30.40 {
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
}
}
therefore you might need to change the wrap. either split it or (better) give it an additional COA level.
and so the news title only is neccessary on your detail page you put that code into the condition.
Alternatives:
you can use .stdWrap.if to modify the range of the breadcrumb and the display of the news title, but with the TS-condition you have a smaller typoscript for normal pages (faster rendering).
You even need no condition for the tx_news_pi1|news parameter, as the detail page normaly would not show anything (except an error)
For example (since Ext news 7.2) to hide News Detail page in the breadcrumb..
Home > News > News Detail > Article name
page.10.dataProcessing {
100 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
100 {
special = rootline
special.range = 0|-1
includeNotInMenu = 1
as = breadcrumb
}
110 = GeorgRinger\News\DataProcessing\AddNewsToMenuProcessor
110.menus = breadcrumb
}
[page["uid"] == {$pages.newsDetail}]
page.10.dataProcessing.100.special.range = 0|-2
[END]
Results in
Home > News > Article name

TYPO3 8.7 - Link Target ist missing in navigation for page typ external URL

After update from TYPO3 7.6.16 to 8.7 in my navigation (TMENU) the target _blank is no longer output for pages of typ external URL. In page properties the target flag _blank is entered. Any hints?
Try this, working for me:
lib.mainmenuu = HMENU
lib.mainmenuu {
special = directory
special.value = 1
1=TMENU
1.wrap=<ul>|</ul>
1.NO {
# do not create a link here else there are double <a> tags
doNotLinkIt = 1
wrapItemAndSub=<li>|</li>
stdWrap.cObject = CASE
stdWrap.cObject {
key.field = doktype
default = TEXT
default {
field = title
typolink.parameter.field = uid
stdWrap.htmlSpecialChars = 1
}
# 3 = external url
3 = TEXT
3 {
field = title
typolink.parameter.field = url
typolink.extTarget = _blank
}
}
}
}
Here, use your news detail page id instead of 27. this will override default page title with current detail news title.

TYPO3 TypoScript: Display a list of subpages with content on parent page

I am trying to create an archive page that displays a list of subpages, similar to WordPress but display the parent's subpages instead of posts. I want the archive page to include the following from the subpage:
Title
First image
First 150 words of regular text element
At the moment I can display a page title, but that's where I got stuck. I am placing the code in a sub template. Here is the code.
lib.portfoliolist = CONTENT
lib.portfoliolist.table = pages
lib.portfoliolist.select {
pidInList = this
}
lib.portfoliolist.renderObj = COA
lib.portfoliolist.renderObj {
stdWrap.wrap = <div class="project">|</div><hr />
10 = TEXT
10 {
field = title
wrap = <h2>|</h2>
10.typolink.parameter.field = uid
}
}
If it helps, all of the images are within the fileadmin/user_upload/ directory, and this is my page structure:
Root
Home
About
Project Portfolio
Project 1
Project 2
Blog
Contact Us
Seems like I figured it out myself, all I had to do was call for content in a separate query. For those that are looking to achieve something similar, here is the code I used to help you out.
lib.portfoliolist = CONTENT
lib.portfoliolist.table = pages
lib.portfoliolist.select {
orderBy = sorting ASC
}
lib.portfoliolist.renderObj = COA
lib.portfoliolist.renderObj {
stdWrap.allWrap = <div class="row">|</div>
stdWrap.wrap = <div class="project col-lg-6 col-md-6 col-sm-12 col-xs-12">|</div>
10 = TEXT
10 {
field = title
wrap = <h2>|</h2>
typolink.parameter.field = pages.uid
}
20 = CONTENT
20 {
table = tt_content
select {
pidInList.field = uid
selectFields = header, bodytext
orderBy = sorting ASC
}
renderObj = COA
renderObj {
30 = TEXT
30.value {
field = bodytext
wrap = <div>|</div>
}
}
}
}

HMENU with graphics

In a TYPO3 site, I have a list of sibling pages. Each page has some images in the "media" field. Im trying to make a navigation to go to the previos/next sibling. So far I have this:
# Append Sitenavi for projects
[PIDupinRootline = 43]
page.10.marks.MAIN.20 = HMENU
page.10.marks.MAIN.20{
special = browse
special{
items = next|prev
}
1 = TMENU
1{
NO = 1
}
}
[global]
But instead of using the page title, id like to use the first image from the "files" field. How could I do it?
This is the way to get other fields:
page.10.marks.MAIN.20 = HMENU
page.10.marks.MAIN.20 {
special = browse
special {
items = prev | next
}
1 = TMENU
1 {
NO = 1
NO.stdWrap.field = subtitle // title
}
}
Now if your change subtitle // title to image and add NO.stdWrap.wrap = <img src"|" />, then it should work.