How do you customize what value a Custom FieldType returns to a template Is it possible to control what gets output in the template a custom fieldtype?

For example im working on a eventbrite plugin and it saves the id in the database but I want the field in the template to return a fully formatted register button.

Right now im doing this with a craft variable that i'm passing the id and returns the html for the button into but feels like there might be a simpler way?



Related to that right now i have to add | raw to the variable output

so its 

{{ craft.eventBrite.registerButton(entry.eventbriteId) | raw }}


is there a way to prevent the escaping of whats being returned without the extra filter in the template?
Run your HTML string through getRaw before sending it back to the template...

return TemplateHelper::getRaw($output);


This will basically "pre-raw" your HTML string.