tt_news pagebrowser - How to disable page selector - typo3

how can I show only "next" and "prev" links under the tt_news list? The typoscript already contains:
plugin.tt_news {
pageBrowser {
maxPages = 10
showResultCount = 0
showPBrowserText = 1
dontLinkActivePage = 0
showFirstLast = 0
showRange = 0
hscText = 1
browseBoxWrap = <ul>|</ul>
activeLinkWrap = <li class="active">|</li>
disabledLinkWrap = <li>|</li>
inactiveLinkWrap = <li>|</li>
}
}
Oh and what does "hscText" stands for?

The solution gives Daimi's Skinnablepagebrowser (currently alpha!) which provides additional parameters for the next and prev button. With that and by clearing the normal pagebrowser link wrappers you can only show the next and prev buttons ;D

Related

TYPO3 add section to link in TMENU

I try to build a simple menu where the field "subtitle" (if set) from the page is added as anchor to the link
MAINMENU2 = HMENU
MAINMENU2 {
special = directory
special.value = 1
1 = TMENU
1 {
expAll = 1
wrap = <ul class="menu">|</ul>
noBlur = 1
NO = 1
NO.stdWrap.typolink.section.field = subtitle
}
}
output: Page XY
expected: Page XY
How must the TypoScript look like to get this work?
You need to disable the automatic link building of TMENU with doNotLinkIt and then build the complete link with typolink:
NO {
doNotLinkIt = 1
stdWrap.typolink {
parameter.field = uid
section.field = subtitle
}
}

HMENU: How to wrap page content into my menu?

I would like to build a full with dropdown menu based on page content defined into a folder.
The idea is to have:
MENU (folder)
- menu 1 (page)
- menu 2 (page)
My goal is to get the following output:
menu 1 content in menu 1 page
menu 2 content in menu 2 page
There is only one content bloc in the pages.
No problem to get the li with menu 1 / 2 but I cannotfind the way to get and wrap the page content.
My code looks like
menu.nav = HMENU
menu.nav {
special = directory
special.value = 214
entryLevel = 1
1 = TMENU
1.wrap = <ul>|</ul>
1.expAll = 1
1.NO = 1
1.NO.wrapItemAndSub.cObject = TEXT
1.NO.wrapItemAndSub.cObject.value = <li>|</ul></li>
1.NO.after.cObject = COA
1.NO.after.cObject {
10 = TEXT
10.value = <div class="dropdown">
20 = CONTENT
20 {
table = tt_content
select {
....
but I cannot figure out what is required here to get the content of the pages.
Does someone can help me with this issue?
Thanks in advance.
Regards
Joël
I'll try a solution here, hoping that I'm not simplifying too much your code,at least you could take it as a starting point:
menu.nav = HMENU
menu.nav {
special = directory
special.value = 214
1 = TMENU
1.wrap = <ul>|</ul>
1.NO {
wrapItemAndSub = <li>|</li>
after.cObject = CONTENT
after.cObject {
table = tt_content
select {
pidInList.field = uid
where = {#colPos} = 0
}
renderObj = < tt_content
wrap = <div class="dropdown">|</div>
}
}
}
I took this one as starting point.
I had a similar problem sometime ago, came upwith this code to make a menu containing database information.
It is not an answer, but it is a similar piece of code. Hopefully it gives you an idea.
It generates a list of links to pages which have "no_search" = 0 or another condition. There is also a database join made to get the pagepath or url of pages in the site.
Think you can do the same thing with your page content, output it as html.
lib.sitemap = CONTENT
lib.sitemap {
table = pages
select {
orderBy = pages.sorting
selectFields = pages.uid, pages.title, tx_realurl_pathcache.pagepath
join = tx_realurl_pathcache ON tx_realurl_pathcache.page_id=pages.uid
pidInList = 44
recursive = 7
where = (no_search="0") or (nav_hide=1 and no_search=0)
groupBy = tx_realurl_pathcache.page_id
}
renderObj = COA
renderObj.wrap = <li>|</li>
renderObj.10 = TEXT
renderObj.10 {
field = pagepath
wrap = <a href="|">
}
renderObj.20 = TEXT
renderObj.20.field = title
renderObj.30 = TEXT
renderObj.30.value = </a>
}
lib.sitemap.wrap = <ul> | </ul>
You have to do this
lib.navbar2 = COA
lib.navbar2.wrap = <nav>|</nav>
lib.navbar2 {
20 = HMENU
20.wrap = <ul>|</ul>
20 {
#entryLevel = 0
#excludeUidList = 11,12
1 = TMENU
1 {
wrap = |
expAll = 1
NO = 1
NO.allWrap >
NO.wrapItemAndSub = <li>|</li>
NO.after.cObject = COA
NO.after.cObject{
stdWrap.wrap = <div class="megamenu-wrapper">|</div>
20 = CONTENT
20 {
table = tt_content
select {
pidInList.field = uid
orderBy = sorting
where = colPos=4
languageField=sys_language_uid
}
}
20.wrap = |
}
ACT = 1
ACT < .NO
ACT.wrapItemAndSub = <li class="active">|</li>
CUR = 1
CUR < .NO
CUR.wrapItemAndSub = <li class="active">|</li>
}
}
}

TMENU - only mark current page as active, not parents

I have a menu currently looking like this. Not only the current active item is marked as active, but also its parents and all the way up. How can I make it so parents aren't marked?
Here's the menu typoscript.
lib.secondNavi = HMENU
lib.secondNavi.entryLevel=0
lib.secondNavi.1 = TMENU
lib.secondNavi.1 {
wrap = <ul id="secondNavi">|</ul>
expAll = 0
NO.allWrap = <li>|</li>
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="active">|</li>
ACT < .CUR
}
lib.secondNavi.2 < lib.secondNavi.1
lib.secondNavi.2 {
wrap = <ul>|</ul>
}
lib.secondNavi.3 < lib.secondNavi.2
lib.secondNavi.3 {
wrap = <ul>|</ul>
}
Using Typo3 6.1.7.
Active (ACT) in TypoScript means current page AND each parent in the page tree.
Current page (CUR) is only the page that you are on (determined by its ID)
documentation
You are copying settings of CUR to ACT so you have mark the pages on rootline as well, just remove the ACT < .CUR line or on other levels empty it by: ACT >

only show Typoscript breadcrumb when more then 1

I try to create a breadcrumb that is only shown subpages. So far I have this code:
lib.breadcrumb = HMENU
lib.breadcrumb {
special = rootline
special.range = 1|-1
wrap = <span class="breadcrumbs">|</span>
1 = TMENU
1 {
noBlur = 1
NO {
allWrap = <span>|</span>
stdWrap.htmlSpecialChars = 1
}
CUR = 1
CUR {
doNotLinkIt = 0
allWrap = <span class="current">|</span>
}
}
}
(range is 1 cause 0 is something special).
So on page1 I don't want to show the breadcrumbs. On page1.1 that is a subpage from page1 I want to see th breadcrumb like page1 > page1.1.
My Problem is, I don't find a way to only show the breadcrumbs on subpages. Any idea?
On option would be to use a condition of type treeLevel.
Just wrap your code in:
[treeLevel = 2,3,4,5,6,7]
# ... Your code here
[global]
Or clear the menu on levels 0 and 1:
[treeLevel = 0,1]
lib.breadcrumb >
[global]

Typoscript menu jump to subpage

I want to create a menu with submenu, that's quiet straight forward via typoscript. The challenge is, that I want the parent levels to link directly to the first subpage if the content of the containing page is empty.
I know you can achieve that via shortcut links in the backend, but I want to, if possible, achieve that via typoscript.
Any ideas? I enclode the typoscript menu code I currently use.
lib.mainMenu = COA
lib.mainMenu{
10 = HMENU
10{
# Level 1, further levels are generic
1 = TMENU
1.noBlur = 1
1.expAll = 0
1.wrap = <ul data-role="listview" data-inset="true">|</ul>
1.NO = 1
1.NO.ATagBeforeWrap = 1
1.NO.insertData = 1
1.NO.wrapItemAndSub.insertData = 1
1.NO.wrapItemAndSub = <li id="menu_{field:uid}">|</li>
1.NO.ATagTitle.field = subtitle // title
1.ACT = 1
1.ACT.ATagBeforeWrap = 1
1.ACT.wrapItemAndSub.insertData = 1
1.ACT.wrapItemAndSub = <li id="menu_{field:uid}" class="active">|</li>
1.ACT.ATagTitle.field = subtitle // title
1.CUR = 1
1.CUR.ATagBeforeWrap = 1
1.CUR.wrapItemAndSub.insertData = 1
1.CUR.wrapItemAndSub = <li id="menu_{field:uid}" class="active">|</li>
1.CUR.ATagTitle.field = subtitle // title
}
20 < .10
20.entryLevel = 1
20.1.wrap = <ul data-role="listview" data-inset="true">|</ul>
30 < .20
30.entryLevel = 2
40 < .20
40.entryLevel = 3
}
Maybe you can build your solution based on hints from here:
http://typo3-blog.net/tutorials/news/if-funktionen-in-typo3.html
In the example from the link above, it's not a menu, but there's a subquery on a table (in your case tt_content) which will then be used to define if something's output or not:
temp.main = COA
temp.main.20 = COA
temp.main.20 {
[...]
wrap=<div class="meine-adressen">|</div>
stdWrap.if.isTrue.cObject = CONTENT
stdWrap.if.isTrue.cObject{
table = tt_address
select {
[...]
}
renderObj = TEXT
renderObj.value = 1
}
}
temp.main.21 = TEXT
temp.main.21 {
wrap=<div class="keine-adressen">|</div>
value = Keine Adressen gefunden
stdWrap.if.isFalse.cObject < temp.main.20.stdWrap.if.isTrue.cObject
}
But I'm not sure if this wouldn't give you headaches in a HMENU
I think it is possible using typoscript, but I dont know how to do it.
The below typoscript may help you:
Typoscript to find the number of content elements in a page:
lib.emptypage = CONTENT
lib.emptypage{
table = tt_content
select{
selectFields = count(uid) AS count
pid = id
}
renderObj = COA
renderObj {
10 = TEXT
10 {
value = {field:count}
insertData = 1
}
}
wrap = |
}
If count is equal to zero, then the page is empty.
Typoscript to get the first subpage:
lib.firstsubpage= HMENU
lib.firstsubpage {
maxItems = 1
1 = TMENU
1 {
NO = 1
}
}
Please share your typoscript solution after implementing it.