We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12295
    • 30 Posts
    Hi,
    I have done a search in the forum but could not find much about microformats.
    Support for microformats would be very cool!
    Have someone used microformats on a project together with modx?

    Thanks
    Friedhelm
      • 22303 MODX Staff
      • 10,725 Posts
      Sure, microformats are just a set of prescribed HTML markup to organize specific kinds of content. For instance, I use hCalendar to output events I store in a custom calendar database by simply replacing some placeholders in a chunk template. e.g.
      <div class="vevent">
      <h4>
      <abbr class="summary" title="[+summary+]">[+summary+]</abbr> [+edit_event_link+]
      <br />
      <small><em><a href="[+website+]">[+website+]</a></em></small>
      </h4>
      <p class="description">[+description+]</p>[+cost_hr+]
      <p>Show starts at <abbr class="dtstart" title="[+start_date_hCal+]">[+start_date_hr+]</abbr> <abbr class="location" title="[+location+]"></abbr><span class="url" style="float:right;"><a href="[+url_hCal+]">Read more...</a></span></p>
      <abbr class="uid" title="[+owner.uid+]"></abbr><abbr class="dtstamp" title="[+created+]"></abbr>
      <br class="clear" />
      </div>
      

      My snippet creates an array with rows representing each event and it’s details, then loops over them and uses $modx->parseChunk() to render this chunk with the proper data for each one.

      MODx is perfect for microformats since it gives you granular control over all of your markup, as long as the add-ons you choose/develop provide mechanisms for customizing your output.