I have followed all available instructions, but the following TypoScript does not do what it is supposed to:
lib.menu.mainMenu = HMENU
lib.menu.mainMenu {
entryLevel = 0
1 = TMENU
1 {
NO = 1
NO {
stdWrap.htmlSpecialChars = 1
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
CUR = 1
CUR {
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
ACT = 1
ACT {
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
}
}
Instead of displaying (always!) the first level of the page structure, the second level is shown, and so on. Particularly leaf nodes lead to an empty menu bar. I don't understand this, the diverse manuals clearly state that only the first level will always appear if no other level is defined! So how could it be that, e.g. the second level is displayed in the same way if it is not defined?
Typo3 version: 6.1.5
One of the possible reasons for this behavior is that somewhere in the rootline (probably on the first level) you have a template record that has "Rootlevel" set. Therefore this is then considered (at least in HMENUs) the root page and entryLevel = 0 thus produces subpages of this page.
Related
If I have this code I can generate a link menu. and say that I only want to include Uid 4 and 8.
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 0
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
My question is now..
How can I say that I want to generate a link menu, from/of the sub pages under Uid 4, so it don't show the link to Uid 4, but the 3-5 sub-pages under this Uid ?
..UPDATE..
Okay I have this code now, and its almost OK.
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 5
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 5
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.prodNavi.2 < lib.prodNavi.1
But it show me to oranges boxes, almost as it using the Wrap 2 times.
How do I only show it like this, with one wrap.
You can use doNotShowLink = 1 for hiding menu items. And you can use stdWrap.override for hiding single items.
Here you would show uid 8 and subpages and subpages of uid 4. uid 4 itself would not be shown
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 4
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.leftNavi.2 < lib.leftNavi.1
UPDATE:
For Using the wrap only once just use it for the HMENU, not for the TMENU:
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 252
lib.prodNavi.wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
...
}
lib.prodNavi.2 < lib.prodNavi.1
I want to get following if condition in jade.
each item,count in display
if(count % 3 === 0)
{
ul.thumbnails
}
li.span6 //nested under ul
//more code nested under li
I googled searched a lot, but with no luck.
Basically, I want to make a new list for every count which is divisible by 3
I tried this:
mixin display_list
li
//code
each item,count in display
-if(count === 0 )
ul.thumbnails
mixin display_list
-else
mixin display_list
It still doesn't work!
Since Jade forces you to indent stuff that is nested, I think the only way (not sure, but it's certainly the most straightforward) is to do it like this:
- var i = 0;
- while(i < display.length)
ul.thumbnails
- var k = i + 3
- while(i < k && i < display.length) // Will repeat three times, unless display.length isn't large enough
li.span6 //nested under ul
//more code nested under li
- i++
Assuming display is an array
(This answer has been updated, the former answer was completely wrong)
Update 2: Fixed that k could be greater than display.length
I found a way but I don't think it is the correct way to do it.
a = [1,2,3,4,54,6,7,8,9,4,5]
each item, i in a
if i % 2 == 0
|<ul>
li #{item}
if (i+1) % 2 == 0
|</ul>
I want to click on the text "English" to get the english version of the website. Before I had a graphical menu:
lib.tslangmenu = HMENU
lib.tslangmenu {
special = language
special.value = 0,1,2
addQueryString = 1
1 = GMENU
1.NO {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.jpg || fileadmin/templates/images/englisch.jpg || fileadmin/templates/images/kroatisch.jpg
}
1.ACT < 1.NO
1.ACT = 1
1.ACT.wrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
This worked so far. Now I should change the menu to a text-based menu.
lib.tslangmenu {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 0
addQueryString = 1
1 = TMENU
1.NO = 1
1.NO.stdWrap.override = Deutsch || English || Hrvatski
1.ACT < 1.NO
1.ACT = 1
1.ACT.stdWrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
Now the wrap with the span is completely ignored. Also the menu is now displayed as follows:
MyCurrentPageName English Hrvatski
If I'm on german the word deutsch is overwritten with the current page title. The same is valid for all other languages. I also tried the TS given in this blog article. But currently it does the same. How do I get this working?
The first error is in your wrap: NO is not wrapped, so no span is generated (for NO-items). The problem that the page title is shown comes from wrong copying. The line
1.ACT < 1.NO
should really be
1.ACT < .1.NO
Just in case, here is a TS-config I have in active use:
lib.languageMenu = HMENU
lib.languageMenu {
special = language
special.value = 0,1
1 = TMENU
1 {
wrap = <ul class="langMenu">|</ul>
noBlur = 1
NO = 1
NO {
linkWrap = <li class="menu-item normal">|</li>
stdWrap.override = English || Deutsch
stdWrap.htmlSpecialChars = 1
}
ACT < .NO
ACT {
doNotLinkIt = 1
linkWrap = <li class="menu-item active">|</li>
}
# NO + Translation doesn't exist
USERDEF1 < .NO
USERDEF1.doNotLinkIt = 1
# ACT + Translation doesn't exist
USERDEF2 < .ACT
USERDEF2.doNotLinkIt = 1
}
}
Regards,
Jost
Check Here with flag icon
lib.languageMenu = HMENU
lib.languageMenu{
special = language
special.value = 0,1
protectLvar = 1
special.normalWhenNoLanguage = 0
# wrap = <div class="language"><ul>|</ul></div>
1 = TMENU
1 {
NO = 1
NO {
# linkWrap = <li class="in-active">|</li> || <li class="in-active">|</li>
stdWrap.override = {$germanLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/german.png">|| {$englishLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/english.png">
doNotLinkIt = 1
stdWrap.typolink.parameter.data = page:uid
stdWrap.typolink.additionalParams = &L=0 || &L=1
stdWrap.typolink.addQueryString = 1
stdWrap.typolink.ATagParams =class="InActive"
stdWrap.typolink.addQueryString.exclude = id,cHash,no_cache
stdWrap.typolink.addQueryString.method = GET
stdWrap.typolink.useCacheHash = 0
stdWrap.typolink.no_cache = 0
stdWrap.htmlSpecialChars = 0
# normalWhenNoLanguage = 0
}
ACT = 1
ACT < .NO
ACT.stdWrap.typolink.ATagParams =class="Active"
ACT.stdWrap.htmlSpecialChars = 0
# USERDEF1 < .NO
# USERDEF1.doNotLinkIt = 0
}
}
I have several nested layouts (VLayouts and HLayouts), which are included inside a tab pane. In one of these layouts (VLayout), there is severall elements which are added or removed dynamically depending on a window of selection. The first time the user makes a selection, the pane moves up several pixels (and you will not see the upper part of the pane). The rest of times, the pain remains in the wrong place.
In summary, the first adding affects to the top of the pane, and the rest of adding/removing doesn't affect to it.
This only happens on Chrome. However, Firefox and IE work ok.
My code of adding is:
int total = itemsPanel.getMembers().length - 1;
while (total >=0) {
itemsPanel.removeMember(itemsPanel.getMember(total));
total--;
}
Record[] records = selectorWindow.getSelectedRows();
if (records != null) {
for (Record record : records) {
String name = record.getAttribute("keyRecord");
HLayout item = items.get(name);
itemsPanel.addMember(row);
}
}
if (itemsPanel != null) {
int r = 80;
if (Utils.isReducedHeight()) {
r = 120;
}
int visibleHeight = getVisibleHeight() - StyleUtils.HEADER_HEIGHT - r;
itemsPanel.setHeight(Math.max(1, Math.min(itemsPanel.getMembers().length * Utils.getRowHeight(), visibleHeight)));
int h = Math.min(itemsPanel.getHeight() + 10, visibleHeight);
containerItemsPanel.setHeight(h);
}
I'm using gwt 2.5.1 and smartgwt 3.0. Any idea?
Thanks in advance
I have a DIV container somewhere on the page with min-width and min-height set to some values.
I am loading small panels (DIVs with display:inline-block) into it using callbacks and javascript.
Right now the number of panels is fixed, so that when the user maximizes the browser window, the size of the container increases, and white space appears at the end of last line.
I want to catch the container's size changes, and load more elements, as many as will fit without clipping into the container's new space.
I saw this on amazon.com. They have panels that display 4 products, but if the browser window is maximized, same panels will display more products filling all the available space in the container.
Scroll-bars must not appear, and no clipping of elements must be done.
Is there a script I could use, or sample code?
Thank you,
Andrei
Found a very nice solution to the problem.
Here's the code: (term 'display' here is used in the same sense as at the supermarket):
function updateDisplay() {
$(".s2", this).hide();
var x = $(".s2", this);
var prevPos = -1;
var nrows = 2;
for (var i = 0; i < x.length; i++) {
$(x[i]).toggle();
var curPos = $(x[i]).position().left;
if (curPos < prevPos) {
if (--nrows == 0) {
$(x[i]).toggle();
break;
}
}
prevPos = curPos;
}
}
function updateDisplays() {
$(".dcon").each(updateDisplay);
}
$(window).resize(updateDisplays);
$(document).ready(updateDisplays);
You can see it in action on the following pages:
www.megabit-mich.ru
www.sportolimpia.ru