Wählen Sie Ihre Sprache:

<we:ifPosition>

Since version: - | Requires endtag: yes

Description

The tag we:ifPosition allows to control the actual position of blocks (<we:block>), listviews (<we:listview>), linklists (<we:linklist>) or listdirs (<we:listdir>). The parameter "position" can handle versatile values to control the first, last, all even, all odd or a specific position (1,2,3, …). Is "type" = "block" or "linklist" it is necessary to specify the name ("reference") of the related block/linklist.

Attributes

type

Default value: - | since version: - | required: yes

Set this attribute to the type of tag to be examined.

Allowed values:

  • block
  • linklist
  • listdir
  • listview

position

Default value: - | since version: - | required: yes

Set this attribute to the position(s) to be examined.

Allowed values:

  • first
  • last
  • odd
  • even

reference

Default value: - | since version: - | required: no

Set this attribute to the name of the block (<we:block>) or linklist (<we:linklist>) to be examined.


Syntax

<we:ifPosition type="block|linklist|listdir|listview" position="first|last|odd|even" [reference="attribute"]> ... </we:ifPosition>

Examples

Example #1 - block

<we:block name="MyBlock">
  <we:ifPosition type="block" position="first" reference="MyBlock">
    first entry
  </we:ifPosition>
</we:block>

Example #2 - block

<we:block name="MyBlock">
  <we:ifPosition type="block" position="1" reference="MyBlock">
    first entry
  </we:ifPosition>
</we:block>

Example #3 - block

<we:block name="MyBlock">
  <we:ifPosition type="block" position="1,3" reference="MyBlock">
    first or third entry
  </we:ifPosition>
</we:block>

Example #4 - block

<we:block name="MyBlock">
  <we:ifPosition type="block" position="last" reference="MyBlock">
    last entry
  </we:ifPosition>
</we:block>

Example #5 - listview

<we:listview name="MyListview">
  <we:repeat>
    <we:ifPosition type="listview" position="first">
      first entry
    </we:ifPosition>
  </we:repeat>
</we:listview>

Example #6 - listview

<we:listview name="MyListview">
  <we:repeat>
    <we:ifPosition type="listview" position="1">
      first entry
    </we:ifPosition>
  </we:repeat>
</we:listview>

Example #7 - listview

<we:listview name="MyListview">
  <we:repeat>
    <we:ifPosition type="listview" position="1,3">
      first or third entry
    </we:ifPosition>
  </we:repeat>
</we:listview>

Example #8 - listview

<we:listview name="MyListview">
  <we:repeat>
    <we:ifPosition type="listview" position="last">
      last entry
    </we:ifPosition>
  </we:repeat>
</we:listview>