Created
November 17, 2008 01:20
-
-
Save speedmax/25625 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Option 1, flat tags | |
$page['tags'] = array('soccer', 'cricket betting', 'football'); | |
// get keyword | |
<meta type="keyword" content="{{ page.tags|join }}"/> | |
// get list of tag links | |
{% for tag in page.tags %} | |
<a href="{{ tag|tag_url }} ">{{ tag }}</a> | |
{% endfor %} | |
---------------------------------------------------------------------- | |
// Option 2, tags with attributes | |
$page['tags'] = array( | |
array('name'=>'soccer', 'url' => '/tags/soccer') | |
array('name' => 'a league', 'url' => '/tags/cricket-betting' ) | |
) | |
// get keyword | |
<meta type="keyword" content=" | |
{% for tag in page.tags %} | |
{{ tag.name }} {% if not loop.last %},{% endif %} | |
{% endfor %} | |
"/> | |
// get list of tag links | |
{% for tag in page.tags %} | |
<a href="{{ tag.url }} ">{{ tag.name }}</a> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment