From karoly@negyesi.net Sat Apr 21 05:57:13 2007 From: Karoly Negyesi To: development@drupal.org Subject: [development] theme('table') Date: Fri, 20 Apr 2007 22:56:58 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7723264148802857541==" --===============7723264148802857541== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, I would like to ask everyone not to use literal and
tags ongoing. We have a theme('table'). Trivial example: zebra. Instead of striping everything separately we can do it centrally. Thanks, Karoly Negyesi --===============7723264148802857541==-- From merlin@logrus.com Sat Apr 21 07:11:20 2007 From: Earl Miles To: development@drupal.org Subject: Re: [development] theme('table') Date: Sat, 21 Apr 2007 00:10:56 -0700 Message-ID: <4629B900.30704@logrus.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3271965614393570963==" --===============3271965614393570963== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Karoly Negyesi wrote: > Hi, >=20 > I would like to ask everyone not to use literal and
=20 > tags ongoing. We have a theme('table'). >=20 > Trivial example: zebra. Instead of striping everything separately we can=20 > do it centrally. theme('table') is a really interesting conundrum. On pages that utilize table= s,=20 they are great for the programmer, and actually really hard on a designer. As= =20 we're moving toward templatizing the theme functions of Drupal, there turns o= ut=20 to be nothing to put into a .tpl.php for something that is, ultimately, just = a=20 table. On the other hand, not using theme('table') has the problem of leading to=20 inconsistency. Right now you can do quite a bit by theming all of your=20 tables...but no one ever (to my knowledge) actually overrides theme('table'),= =20 and most of that theming is done via CSS. I think what this really means is that theme('table') needs to be expanded in= =20 such a way that we can do named tables that will allow us to invoke individua= l=20 templates in the manner of node.tpl.php. Something like=20 table-forum_overview.tpl.php maybe. I've done a lot of back-and-forth with myself on this one, because there are = arguments on either side of the fence that are really compelling. I'm curious= =20 to hear other people's thoughts on this one. --===============3271965614393570963==-- From weitzman@tejasa.com Sat Apr 21 18:41:41 2007 From: Moshe Weitzman To: development@drupal.org Subject: Re: [development] theme('table') Date: Sat, 21 Apr 2007 14:41:32 -0400 Message-ID: <462A5ADC.9070800@tejasa.com> In-Reply-To: <4629B900.30704@logrus.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2303065007793418732==" --===============2303065007793418732== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > I think what this really means is that theme('table') needs to be > expanded in such a way that we can do named tables that will allow us to > invoke individual templates in the manner of node.tpl.php. Something > like table-forum_overview.tpl.php maybe. this sounds nice and consistent to me ... or we expand drupal_render usage and expect folks to override #theme if they want to take over themeing for a certain table. that seems like a more long term project, with more a bit more uncertainty. --===============2303065007793418732==-- From adrian@bryght.com Sun Apr 22 00:33:25 2007 From: adrian rossouw To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 02:33:02 +0200 Message-ID: <5A9187E1-AA4B-4582-9A82-FDFE98757153@bryght.com> In-Reply-To: <462A5ADC.9070800@tejasa.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3819270925891817633==" --===============3819270925891817633== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote: > > this sounds nice and consistent to me ... or we expand > drupal_render usage and expect folks to override #theme if they > want to take over themeing for a certain table. that seems like a > more long term project, with more a bit more uncertainty. doesn't that work today though ? just needing a documentation change. ie: it always uses #theme if found, instead of the theme_#type. --===============3819270925891817633== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PEhUTUw+PEJPRFkgc3R5bGU9IndvcmQtd3JhcDogYnJlYWstd29yZDsgLWtodG1sLW5ic3AtbW9k ZTogc3BhY2U7IC1raHRtbC1saW5lLWJyZWFrOiBhZnRlci13aGl0ZS1zcGFjZTsgIj48QlI+PERJ Vj48RElWPk9uIDIxIEFwciAyMDA3LCBhdCA4OjQxIFBNLCBNb3NoZSBXZWl0em1hbiB3cm90ZTo8 L0RJVj48QlIgY2xhc3M9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j48QlIgY2xhc3M9ImtodG1sLWJsb2NrLXBsYWNlaG9sZGVyIj48L0RJVj48L0JP RFk+PC9IVE1MPg== --===============3819270925891817633==-- From gordon@heydon.com.au Sun Apr 22 04:18:34 2007 From: Gordon Heydon To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 14:18:22 +1000 Message-ID: <462AE20E.3000009@heydon.com.au> In-Reply-To: <5A9187E1-AA4B-4582-9A82-FDFE98757153@bryght.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8868276620233346301==" --===============8868276620233346301== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, adrian rossouw wrote: > > On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote: > >> >> this sounds nice and consistent to me ... or we expand drupal_render >> usage and expect folks to override #theme if they want to take over >> themeing for a certain table. that seems like a more long term >> project, with more a bit more uncertainty. >> > > doesn't that work today though ? > just needing a documentation change. > > ie: it always uses #theme if found, instead of the theme_#type. > Yes does work, but not very well. You can change the look of your table, but that is about it. What I would love to see if being able to add new columns to a table, and then populate it will more information. An example would be the comment list, where you could add an additional column or row with hook_form_alter() and then it will get themed the way that you want it. Gordon. > !DSPAM:1000,462aafca298781821219920! --===============8868276620233346301==-- From weitzman@tejasa.com Sun Apr 22 12:48:24 2007 From: Moshe Weitzman To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 08:48:13 -0400 Message-ID: <462B598D.8010600@tejasa.com> In-Reply-To: <462AE20E.3000009@heydon.com.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7857954857450693974==" --===============7857954857450693974== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Gordon Heydon wrote: > Hi, >=20 > adrian rossouw wrote: >> >> On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote: >> >>> >>> this sounds nice and consistent to me ... or we expand drupal_render=20 >>> usage and expect folks to override #theme if they want to take over=20 >>> themeing for a certain table. that seems like a more long term=20 >>> project, with more a bit more uncertainty. >>> >> >> doesn't that work today though ? >> just needing a documentation change. i think it does. so whats needed is some general agreement that we should=20 output tables not directly through theme('table') but rather with a=20 construct like: $page['forum_overview'] =3D array( '#type' =3D> 'table', '#header' =3D> $header, '#rows' =3D> $rows ) $output =3D drupal_render($page); the big advantage is that modules can alter a table as suggested by Gordon=20 and that themers can override a single table with #theme. the disadvantage=20 is a small performance dip. we'll do some benchmarking to understand the amou= nt. note that i'm only talking about output of tables through drupal_render(),=20 not whole page. --===============7857954857450693974==-- From kkaefer@gmail.com Sun Apr 22 16:04:26 2007 From: Konstantin =?utf-8?q?K=C3=A4fer?= To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 18:04:13 +0200 Message-ID: <915392DF-2D61-46F2-B411-2C29F13A396F@gmail.com> In-Reply-To: <462B598D.8010600@tejasa.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6615184072785590919==" --===============6615184072785590919== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On 22.04.2007, at 14:48, Moshe Weitzman wrote: > i think it does. so whats needed is some general agreement that we > should output tables not directly through theme('table') but rather > with a construct like: http://drupal.org/node/80855 might be related with this issue. Konstantin Käfer – http://kkaefer.com/ --===============6615184072785590919==-- From fabio.varesano@gmail.com Sun Apr 22 18:10:01 2007 From: Fabio Varesano To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 20:09:37 +0200 Message-ID: <462BA4E1.3090505@gmail.com> In-Reply-To: <462B598D.8010600@tejasa.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6497961266967692130==" --===============6497961266967692130== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > note that i'm only talking about output of tables through > drupal_render(), not whole page. > And why not extending this approach to all kind of pages? not just table pages. Fabio --===============6497961266967692130==-- From weitzman@tejasa.com Sun Apr 22 18:20:31 2007 From: Moshe Weitzman To: development@drupal.org Subject: Re: [development] theme('table') Date: Sun, 22 Apr 2007 14:15:52 -0400 Message-ID: <462BA658.3050305@tejasa.com> In-Reply-To: <462BA4E1.3090505@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0442919401177283870==" --===============0442919401177283870== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Fabio Varesano wrote: >> note that i'm only talking about output of tables through >> drupal_render(), not whole page. >> > > And why not extending this approach to all kind of pages? > not just table pages. > > Fabio we'll get there one day. one step at a time. whole pages are hard. --===============0442919401177283870==-- From gordon@heydon.com.au Mon Apr 23 01:21:24 2007 From: Gordon Heydon To: development@drupal.org Subject: Re: [development] theme('table') Date: Mon, 23 Apr 2007 11:21:12 +1000 Message-ID: <462C0A08.3030408@heydon.com.au> In-Reply-To: <462B598D.8010600@tejasa.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6153430646940067384==" --===============6153430646940067384== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, Moshe Weitzman wrote: > Gordon Heydon wrote: >> Hi, >> >> adrian rossouw wrote: >>> >>> On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote: >>> >>>> >>>> this sounds nice and consistent to me ... or we expand drupal_render >>>> usage and expect folks to override #theme if they want to take over >>>> themeing for a certain table. that seems like a more long term >>>> project, with more a bit more uncertainty. >>>> >>> >>> doesn't that work today though ? >>> just needing a documentation change. > > i think it does. so whats needed is some general agreement that we > should output tables not directly through theme('table') but rather with > a construct like: > > $page['forum_overview'] = array( > '#type' => 'table', > '#header' => $header, > '#rows' => $rows > ) > $output = drupal_render($page); > > the big advantage is that modules can alter a table as suggested by > Gordon and that themers can override a single table with #theme. the > disadvantage is a small performance dip. we'll do some benchmarking to > understand the amount. > > note that i'm only talking about output of tables through > drupal_render(), not whole page. Yes I have actually started on this. Also I have done it so that it allows the naming of columns, so that hook_form_alter() can alter the contents of cells, and also so that you don't have to have all columns on all rows. Other advantages is that you can weight columns to put them where ever you want. This is something that I really need in E-Commerce for the transaction search table. Gordon. > !DSPAM:1000,462b593f101281670870668! > --===============6153430646940067384==--