Closed rraman closed 11 years ago
Hi ramanr,
I responded to your comment on my blog: http://techiferous.com/2011/03/introducing-tabulous-tabs-in-rails/comment-page-2/#comment-14536
Thanks for noting this and I'll leave the issue open because I think that it would be nice for tabulous to have a supported interface for overriding the generated markup. (I do apologize for how long it has taken me to get back to you; I've been quite sick.)
Have you thought about how that interface could be?
No, and I probably won't have time to get to it quickly. If I were you, I would just monkey-patch it for now.
By the way, is there a specific problem with the existing markup? Is there a specific use case that it does not support? I'm interested to know how people are using tabulous and in what ways it is weak so that I can improve it when I have a chance.
Yeah for now I would do monkey patch!
I have a certain naming pattern to follow for all my dom elements' id & css names and by default these tabs can't have one :-(
You have a couple of other options, by the way. You could use JavaScript to rewrite the markup. Or you can use rack-plastic to rewrite the markup on the server side: http://rubygems.org/gems/rack-plastic
Thanks.
For now i wouldn't want to go for changing the markup for the tabs. I don't want to do it every time a page is loaded:-(.
I'll monkey patch for now and will let you know if I come up with a interface to have custom markups. i the mean time, if you have any idea to define an interface, I could help.
Thanks, rraman. Happy monkey-patching. :)
May I make a suggestion? The helpers could be modified to take a partial and use that for rendering tabs. Then document the locals that the partial needs to accept.
Thanks! I'm collecting ideas on ways to improve tabulous and I will add this idea to my list.
@rraman Tabulous version 2 now allows you to customize the tab HTML by writing your own renderer class. Thanks for bringing this need to my attention!
@zpearce I implemented the custom rendering as a Ruby class you can define. This works pretty well since there is a lot of Ruby logic involved in creating the markup for a tab. I like your idea of specifying a partial, though, so I'm adding it to my list of ideas to keep in mind for future improvements.
Would be great if the tab & subtab nav/ul element can have custom dom element id.