With the following code I build my breadcrumb navigation with the according microdata for a BreadcrumbList:
lib.breadcrumb = COA
lib.breadcrumb {
wrap = <ol class="list-inline" role="menubar" itemscope itemtype="http://schema.org/BreadcrumbList">|</ol>
10 = HMENU
10 {
special = rootline
special.range = 0|-1
1 = TMENU
1 {
wrap = |
NO {
allWrap = <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">|</li>
stdWrap.htmlSpecialChars = 1
linkWrap = |
doNotLinkIt = 0 |*||*| 1
ATagBeforeWrap = 1
ATagTitle.field = nav_title // title
ATagParams = role="menuitem" itemprop="item"
stdWrap.wrap = <span itemprop="name">|</span>
after.cObject = COA
after.cObject {
5 = TEXT
5.dataWrap = <meta itemprop="position" content="{register:count_MENUOBJ}|" />
}
}
}
}
}
This works perfectliy fine, but I have no idea, how to add the item <meta itemprop="position" content="{register:count_MENUOBJ}|" />
for a newsrecord:
This is how it looks at the moment:
// add news title to breadcrumb if needed
[globalVar = GP:tx_news_pi1|news > 0]
lib.breadcrumb.10.1.NO.doNotLinkIt = 0
lib.breadcrumb.20 = COA
lib.breadcrumb.20 {
wrap = <li class="article" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">|</li>
after.cObject = COA
after.cObject {
5 = TEXT
5.dataWrap = <meta itemprop="position" content="{register:count_MENUOBJ}|" />
}
10 = RECORDS
10 {
dontCheckPid = 1
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
conf.tx_news_domain_model_news.htmlSpecialChars = 1
wrap = <span itemprop="name">|</span>
}
}
[end]
Obviously the {register:count_MENUOBJ}
is not available for the news item.
How can I get the last value of {register:count_MENUOBJ}
from the menu object and increase it by one for the news item?