Right now we use theming functions. Template files are more maintainable and user-friendly for our themers. Let's switch to them.

Comments

EvanDonovan’s picture

Version: 6.x-2.1 » 6.x-2.x-dev
EvanDonovan’s picture

Are 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.

azinck’s picture

Unfortunately 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.

EvanDonovan’s picture

So 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.

add1sun’s picture

Status: Active » Needs review
StatusFileSize
new10.61 KB

I 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.

add1sun’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
StatusFileSize
new10.58 KB

New patch rerolled against HEAD, which has the new Content Profile code in it.

add1sun’s picture

Title: Switch theming to use .tpl files » Switch theme_gigya_friends to use .tpl file
Assigned: azinck » add1sun
Status: Needs review » Active

I 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.

gambaweb’s picture

Status: Active » Closed (fixed)

Please reopen if still relevant.