我试图通过在页面的typoscript呈现菜单中出现的页数来分割一个数字(由于使用Foundation的前端框架,我的情况是12),并输出结果作为html菜单项的类名的一部分。Typoscript的数学运算
目前,我可以得到typoscript输出菜单中的项数{register:count_menuItems}
,但我无法弄清楚如何分割这个数字并输出商。
下面是我的代码:
lib.navigation.secondary = HMENU
lib.navigation.secondary {
entryLevel = 1
stdWrap.dataWrap = <div class="row large-10 small-centered large-centered columns">|</div>
1 = TMENU
1 {
NO {
allWrap = <div class="large-{register:count_menuItems} small-12 columns first">|</div> |*| <div class="large-{register:count_menuItems} small-12 columns">|</div> |*| <div class="large-{register:count_menuItems} small-12 columns last">|</div>
allWrap.insertData = 1
stdWrap.cObject = COA
stdWrap.cObject {
# getting the navigation title with fallback to the title
10 = TEXT
10.field = nav_title // title
10.wrap = <h4>|</h4>
# getting the subtitle of the page
20 = TEXT
20.field = subtitle
20.wrap = <p>|</p>
}
}
}
}
要创建尽管这样的工作对我来说,我很想看到更简洁的实现! –