Last active
August 4, 2017 10:45
-
-
Save bastianallgeier/ccd90c483153f915a380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- create the complete html img tag for a given image --> | |
<?= $page->image()->html() ?> | |
<!-- modify the attributes of the img tag --> | |
<?= $page->image()->html(['class' => 'myImage']) ?> | |
<!-- resize an image first and then get the img tag for it --> | |
<?= $page->image()->resize(300,200)->html() ?> | |
<!-- crop an image first and then get the img tag for it --> | |
<?= $page->image()->crop(300)->html() ?> | |
<!-- build a link tag for any field. The url of the page will be used for the href --> | |
<?= $page->title()->link() ?> | |
<!-- customize the url --> | |
<?= $page->title()->link('some/page') ?> | |
<!-- customize the attributes --> | |
<?= $page->title()->link(['class' => 'myLink']) ?> | |
<!-- customize the url and attributes --> | |
<?= $page->title()->link('some/page', ['class' => 'myLink']) ?> | |
<!-- convert a custom field value to an absolute url --> | |
<?= $page->related()->url() ?> | |
<!-- convert a custom field value to an integer --> | |
<?= $page->myInt()->int() ?> | |
<!-- convert a custom field value to a float --> | |
<?= $page->myFloat()->float() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment