Right now we use theming functions. Template files are more maintainable and user-friendly for our themers. Let's switch to them.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | gigya-theme_functions-754544-6.patch | 10.58 KB | add1sun |
| #5 | gigya-theme_functions-754544-5.patch | 10.61 KB | add1sun |
Comments
Comment #1
EvanDonovan commentedComment #2
EvanDonovan commentedAre you referring to the gigya_login_block, gigya_register, and gigya_link_accounts functions? If so, I don't think that this will simplify things, and it will actually lead to a slight performance overhead (since functions are faster). The functions are fairly small, so turning them into tpl.php's wouldn't really help things much, if at all.
Comment #3
azinck commentedUnfortunately many themers struggle to use theming functions. I'm aware that there's a performance penalty to tpls, but I think I'd have to see a case made that the difference is significant. I think most people would prefer the added flexibility provided by tpls and preprocess functions.
Comment #4
EvanDonovan commentedSo these are the functions to which you refer? I'd like to see what the tpl's would look like, since it seems like currently at least there is more PHP than HTML in the functions, thus I think the benefit would be outweighed by the cost.
Comment #5
add1sun commentedI agree with azink that it is worth giving people some plain HTML to work with in a template. It may seem silly to people that find theme functions no problem to work with, but many, many people just want to wrap some of their own HTML around something or add their own class. Core does it all over the place, even on small things.
Here is a patch that converts 4 of the theme function to templates instead. The one that isn't done is gigya_friends, which is a table with some foreach love in it. It can and should be converted to a template, but I've not got it quite done. (If you think that is crazy, core does the same thing with the forum-list.tpl.php. It is considered a best practice to supply tpls when you can.)
The patch adds 4 new files and you should make sure you clear the theme registry after applying the patch.
Comment #6
add1sun commentedNew patch rerolled against HEAD, which has the new Content Profile code in it.
Comment #7
add1sun commentedI went ahead and committed this to HEAD since we are pushing for a new beta release today. Not marking fixed though since the gigya_friends function still needs templatizing.
Comment #8
gambaweb commentedPlease reopen if still relevant.