Jump to main content Jump to doc navigation

bdPriceGroups is a simple snippet to output your price groups.

Snippet Properties

Property Name Description Default Value
limit Limit the amount of results. 0
offset Offset to start at. 0
sortby Field to sort on. Can be sortorder, id or name. sortorder
sortdir Direction to sort on. Either asc or desc. asc
rowSeparator String to use between rowTpl items. \n
tplOuter Chunkname to wrap the complete result set in.
Default:
<h2>Price Groups</h2>
<ul>
    [[+wrapper]]
</ul>

Placeholders to use:

  • wrapper | | | tplRow | Chunk name to wrap individual target groups in. Default:
<li>[[+display]]</li>

Placeholders to use:

  • id
  • display
  • sortorder | |

Examples

Minimum call:

[[!bdPriceGroups]]

Result (depending on your price group data):

<h2>Price Groups</h2>
<ul>
  <li>Cheap</li>
  <li>Good Value</li>
  <li>Exact Budget</li>
  <li>Too frick'n expensive</li>
</ul>

Display as Select box

Snippet call:

<label for="pricegroup">Price Group</label>
[[!bdTargets? &tplRow=`bdl.pricegroup.row` &tplOuter=`bdl.pricegroup.outer`]]

bdl.pricegroup.row:

<option value="[[+id]]">[[+display]]</option>

bdl.pricegroup.outer:

<select name="pricegroup">
  <option value="0">Choose a Price Group</option>
  [[+wrapper]]
</select>

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Digital Penguin
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • Following Sea
  • Anton Tarasov
  • eydolan
  • Raffy
  • Lefthandmedia
  • Murray Wood
  • Snow Creative
  • Nick Clark
  • Helen
  • JT Skaggs
  • krisznet
  • YJ
  • Yanni
  • Richard

Budget

$366 per month—let's make that $500!

Learn more