Created
September 16, 2011 22:28
-
-
Save danielpcox/1223311 to your computer and use it in GitHub Desktop.
Parametrized Tags In DRYML
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
<!-- defining a tag --> | |
<def tag="messages"> | |
<br /><br /> | |
<ul> | |
<li param="msg1">Message 1</li> | |
<li param="msg2">Message 2</li> | |
<li param="msg3">Message 3</li> | |
</ul> | |
</def> | |
<!-- now we could use it in a page --> | |
<messages/> | |
<!-- | |
Output is: | |
<br /><br /> | |
<ul> | |
<li>Message 1</li> | |
<li>Message 2</li> | |
<li>Message 3</li> | |
</ul> | |
--> | |
<!-- but since some of the tags in there are parametrized, we could change the output on the fly --> | |
<messages> | |
<msg3:>This last one is changed.</msg3:> | |
</messages> | |
<!-- | |
Output is: | |
<br /><br /> | |
<ul> | |
<li>Message 1</li> | |
<li>Message 2</li> | |
<li>This last one is changed.</li> | |
</ul> | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment