My name stuff


SUBMITTED BY: jhb0294

DATE: Nov. 24, 2015, 1:36 p.m.

FORMAT: Text only

SIZE: 1.1 kB

HITS: 4812

  1. <!-- create the complete html img tag for a given image -->
  2. <?= $page->image()->html() ?>
  3. <!-- modify the attributes of the img tag -->
  4. <?= $page->image()->html(['class' => 'myImage']) ?>
  5. <!-- resize an image first and then get the img tag for it -->
  6. <?= $page->image()->resize(300,200)->html() ?>
  7. <!-- crop an image first and then get the img tag for it -->
  8. <?= $page->image()->crop(300)->html() ?>
  9. <!-- build a link tag for any field. The url of the page will be used for the href -->
  10. <?= $page->title()->link() ?>
  11. <!-- customize the url -->
  12. <?= $page->title()->link('some/page') ?>
  13. <!-- customize the attributes -->
  14. <?= $page->title()->link(['class' => 'myLink']) ?>
  15. <!-- customize the url and attributes -->
  16. <?= $page->title()->link('some/page', ['class' => 'myLink']) ?>
  17. <!-- convert a custom field value to an absolute url -->
  18. <?= $page->related()->url() ?>
  19. <!-- convert a custom field value to an integer -->
  20. <?= $page->myInt()->int() ?>
  21. <!-- convert a custom field value to a float -->
  22. <?= $page->myFloat()->float() ?>

comments powered by Disqus