Home javascript Michetime SHEMA.org in MODX Revolution

Michetime SHEMA.org in MODX Revolution

Author

Date

Category

Please tell me the moment.
I add a micarkome, but the validator requires that every crumb has a meta tag position (& lt; Meta Itemprop = "Position" CONTENT = "there is an element number" / & gt; ).

The problem is that you need to make a counter in the MODX code so that the crumb index puts in Content, I even have no idea how to do it.

Here is the whole code of bread crumbs:

[[BreadCrumb?
& amp; Containertpl = `@ INLINE & LT; ul id =" BreadCrumb "ItemScope Itemtype =" http://schema.org/breadcrumblist "& gt; [[+ crumbs]] & lt; / ul & gt;`
& amp; homecrumbtpl = `@ inline & lt; li itemprop =" Itemlistelement "ItemScope Itemtype =" http://schema.org/listitem "& gt; & lt; a href =" [[+ link]] "ItemPROP =" Item "& gt ; & lt; span itemprop = "name" & gt; [[+ pagetitle]] & lt; / span & gt; & lt; / a & gt; & lt; meta itemprop = "Position" Content = "" / & gt; & lt; / li & gt; `
& amp; currentcrumbtpl = `@ inline & lt; li itemprop =" ItemLisTelement "ItemScope Itemtype =" http://schema.org/listitem "& gt; & lt; span itemprop =" name "& gt; [[+ pagetitle]] & lt; / Span & gt; & lt; Meta ItemProp = "Position" Content = "" / & gt; & lt; / li & gt; `
& amp; linkcrumbtpl = `@ inline & lt; li itemprop =" ItemLisTelement "ItemScope Itemtype =" http://schema.org/listitem "& gt; & lt; a href =" [[+ link]] "ItemPROP =" Item "& gt ; & lt; span itemprop = "name" & gt; [[+ pagetitle]] & lt; / span & gt; & lt; / a & gt; & lt; meta itemprop = "Position" Content = "" / & gt; & lt; / li & gt; `
& amp; CategoryCrumbtpl = `@ INLINE & LT; Li ItemProp =" Itemlistelement "ItemScope Itemtype =" http://schema.org/listitem "& gt; & lt; a href =" [[+ link]] "ItemPROP =" Item "& gt ; & lt; span itemprop = "name" & gt; [[+ pagetitle]] & lt; / span & gt; & lt; / a & gt; & lt; meta itemprop = "Position" Content = "" / & gt; & lt; / li & gt; `
& amp; maxcrumbtpl = `@ inline & lt; li itemprop =" Itemlistelement "ItemScope Itemtype =" http://schema.org/listitem "& gt; & lt; span itemprop =" name "& gt; ... & lt; / span & gt; & lt ; / Li & gt; `]]

Answer 1, Authority 100%

In the latest version of BreadCrumb 1.4.4 Add placeholder [[+ Position]], so you can use plugin without crutches now.


Answer 2

I can only offer to use pdocrumbs from the PDotools library (https://modx.com/ Extras / Package / Pdotools? Version = 557C464FDC532F69510518F6 ) There is a Chank [[+ IDX]] which contains the sequence number of the element.

Documentation: https://docs.modx.pro/komponentyi/pdotools/snippetyi / pdocrumbs


Answer 3

BreadCrumb does not support Playtovder for the values ​​of the sequence numbers of the elements.

Look in the direction of using a snippet PDOCRUMBS .

If for some reason you want to solve the task on snippeting breadcrumb , then you can add the required playerholder yourself, slightly changing its code:

  1. Add before the line 127 :
$ bc = 0;
  1. change the line 164 to the following:
$ placeholders = array_merge ($ resource- & gt; toarray (), array ('link' = & gt; $ LINK, ' idx '= & gt; ++ $ bc));

After that you can use the playholder [[+ IDX]]

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions