TYPO3 Special menu content element - typo3

I am working on TYPO3 6.2 and In a page I have added the content element "Special menu" with the the option Site map with selected page. I was able to render this with out any issues.For almost all pages I have added navigation title and obviously in the site map also this navigation title will be displayed.My requirement is that I want to show title instead of nav_title.Tried the below code and doesn't seems to work . Can any one help me with this?
tt_content.menu.20.2.1 {
NO {
stdWrap.cObject = COA
stdWrap.cObject {
10 = TEXT
10.field = subtitle
}
ATagTitle.field = subtitle
}
}
Any help would be appreciated.

Insert the following lines to the setup field of an ext-template at the page where you want to display the plugin "Special menu" with option "Site map" and wont to change link title to subtitle.
tt_content.menu.20.2 >
tt_content.menu.20.2 = HMENU
tt_content.menu.20.2.1 = TMENU
tt_content.menu.20.2.1 {
expAll = 1
wrap = <ul>|</ul>
NO{
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
stdWrap.field = subtitle//title # add title of link subtitle or if empty title
ATagTitle.field = nav_title//title #title add tag title what you need
}
}
tt_content.menu.20.2.2 < tt_content.menu.20.2.1
tt_content.menu.20.2.3 < tt_content.menu.20.2.1
tt_content.menu.20.2.4 < tt_content.menu.20.2.1
Example http://www.typozone.com/index.php?id=96

Related

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

typoscript: do not show submenu if certain backend_layout is selected

I made a special panning sub menu with icons which can be inserted choosing a specific backend_layout named pagets__panmenu , if that layout is selected the main menu should not display a sub menu and link to the page instead of opening a sub ...
I work with typo3 V7.6.11 and fluid styled content
The part reading the value works correctly:
NO = 1
NO {
before.cObject = LOAD_REGISTER
before.cObject{
panmenu.cObject = TEXT
panmenu.cObject.data.dataWrap = DB:pages:{field:uid}:backend_layout
}
ATagBeforeWrap = 1
wrapItemAndSub = <li>|</li>
stdWrap.htmlSpecialChars = 1
}
This is my best effort to match, but its not working:
IFSUB <.NO
IFSUB {
wrapItemAndSub = <li class="dropdown">|</li>
wrapItemAndSub.override = <li>|</li>
wrapItemAndSub.override.if {
value.data = register:panmenu
equals = pagets__panmenu
}
ATagParams = class="dropdown-toggle" data-toggle="dropdown"
ATagBeforeWrap = 1
}
I know that also the 2 < .1 has to be suppressed, I'm trying to get the if to work to keep the style and link clean for starters ...
First of all: have you set TMENU.IFSUB = 1?
Else, everything you do in IFSUB won't have an effect.
Now some general thoughts:
a) Normally, backend layouts are used to switch an entire page template:
page.10 = FLUIDTEMPLATE
page.10 {
file.stdWrap.cObject = CASE
file.stdWrap.cObject {
key.data = pagelayout
default = TEXT
default.value = {$myTemplatePath}/Standard.html
1 = TEXT
1.value = {$myTemplatePath}/Home.html
2 = TEXT
2.value = {$myTemplatePath}/Landing.html
}
layoutRootPath = {$myLayoutPath}
partialRootPath = {$myPartialPath}
}
So this initiates the frontend rendering for the entire page, where backend_layout with uid 1 will use the Home.html template, backend_layout with uid 2 will use the Landing.html template, and all others (=default) will use the Standard.html template.
If you build your site by this method, I would recommend doing
# that's the original version of your menu
lib.panmenu = HMENU
lib.panmenu {
// ...
}
# make a copy of the original
lib.panmenu_variant < lib.panmenu
# modify it as required
lib.panmenu_variant.1.NO {
// ...
}
Now, in your page Templates (which you call separately via the CASE from above), you can either use
<f:cObject typoscriptObjectPath="lib.panmenu" />
or
<f:cObject typoscriptObjectPath="lib.panmenu_variant" />
b) But if you don't want to follow that approach, you should also be able to use the backend_layout CASE on any cObject. The CASE variant has proven much more robust for me.
Here' how I'd try to get the CASE working (untested!)
// suppose temp.navigation_main is your full menu
temp.navigation_main_variant < temp.navigation_main
temp.navigation_main_variant {
// modify the menu as you please
10.2 >
10.1.IFSUB.wrapItemAndSub = <li>|</li>
}
// use lib.nav in your page
lib.nav = CASE
lib.nav {
key.data = pagelayout
// normally, lib.nav is the full navigation
default < lib.navigation_main
// except if be layout 1 is selected
1 < lib.navigation_main_variant
}
}
c) I've tried TypoScript constructions with LOAD_REGISTER and ifs years ago and they always made me go crazy. I wouldn't invest too much energy into them, as they rather seem to be legacy parameters than the future way of development for TYPO3 logic.

typo3 different title in second menu

i have to build an page with two menus. And in the second menu, i need different titles.
I had the idea to use the alternativ navigation-title. Is it possible to enable this in the first menu and disable in the second?
Thanks!
Yes you can do that by overwriting the stdWrap.cObject:
lib.menu1 = HMENU
lib.menu1.1 = TMENU
lib.menu1.1.NO = 1
lib.menu2 = HMENU
lib.menu2.1 = TMENU
lib.menu2.1.NO = 1
lib.menu2.1.NO.stdWrap.cObject = COA
lib.menu2.1.NO.stdWrap.cObject.10 = TEXT
lib.menu2.1.NO.stdWrap.cObject.10.field = nav_title // title
# = use nav_title field if available or title field as fallback
# also other fields are possible, e.g. subtitle
For your first menu set
NO.stdWrap.cObject = COA
NO.stdWrap.cObject {
10 = TEXT
10.field = title
and in your second menu
NO.stdWrap.cObject = COA
NO.stdWrap.cObject {
10 = TEXT
10.field = subtitle

Subpage Links with image and text

I try to implement a page which contains images to certain subpages. For each subpage, I have a seperate image. I want to display for each subpage the appropriate image "galerie_XX.png" an show the name of the subpage above the image. So far I got:
galerielabel = HMENU
galerielabel.special = directory
galerielabel{
1 = TMENU
1.NO.stdWrap{
wrap = <img src="fileadmin/templates/images/galerie/galerie_|.png" />
}
}
The Subpages are year names, like 2012, 2013... This script shows me the required images as a link.
My question is, how can I add the name of the subpages above the image?
Thank you in advance.
I suggest a different approach.
You can add images in the page properties.
Then, your menu could be like this:
lib.menu = COA
lib.menu.10 = HMENU
lib.menu.10 {
10 = HMENU
10.1 = TMENU
10.1.NO.doNotShowLink = 1 #will remove the link altogether
10.1.NO.before.cObject = COA
10.1.NO.before.cObject {
10 = TEXT
10.field = title #title of the page, change to any field you like
20 = IMAGE
20.file.import = uploads/media/ #4.x style
20.file.import.field = media
20.file.import.listNum = 0 #use first image referenced
20.width = 200 #set to imagesize of your liking
30 = TEXT
30.value = Do what you like here
}
}
Untested: the title of the page should be prepended
galerielabel = HMENU
galerielabel.special = directory
galerielabel{
1 = TMENU
1.NO.stdWrap{
# Prepend with page.title
prepend = TEXT
prepend {
field = title
htmlSpecialChars = 1
}
wrap = <img src="fileadmin/templates/images/galerie/galerie_|.png" />
}
}

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.