Creating a new directive

4 views
Skip to first unread message

wat3r...@gmail.com

unread,
Dec 1, 2015, 11:41:01 AM12/1/15
to rythmengine
Hi,

I'd like to create a new directive for metadata. Is this already supported? Basically, I'd like to add information that is not intended to be displayed. It's similar to a comment but more structured.

I was also thinking of adding them as a comment. If I do this, is there a way to retrieve all the comments within a template?

I appreciate any help.

Thanks,
Maria

green

unread,
Dec 1, 2015, 3:45:12 PM12/1/15
to rythm...@googlegroups.com
Comments can't be accessed from within a template. As a developer you can view them, but they are meaningless at runtime.

If you want to add some information, you can declare arguments without using them. e.g.

@args String meta_a = "this is meta information A", String meta_b = "this is meta information B"

As long as you don't do things like @meta_a and @meta_b they will not be displayed. 

However I am still curious if you don't display something, why do you need to retrieve them in the template? 

--
You received this message because you are subscribed to the Google Groups "rythmengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rythmengine...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wat3r...@gmail.com

unread,
Dec 2, 2015, 9:56:20 AM12/2/15
to rythmengine
Oh ok, that's true. I can simply add them as arguments and not use them.

I have a lot of templates. I'd like to embed some information on each one; then, extract them to return to certain types of users who needs to know what the template is about. But, the information is not something to be displayed to the end user. I could put them in a separate file (which probably would get huge) or database. But, that's a little too heavyweight for what I'm trying to do. So, I was thinking I could just embed the information on each template somehow with a special directive, a comment, or an argument. I think the argument approach may be the best way. It would be nice to have a special directive for metadata.

Thanks for the suggestions!

Maria
Reply all
Reply to author
Forward
0 new messages