html-template-users Mailing List for HTML::Template (Page 68)
Brought to you by:
samtregar
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(42) |
Jul
(80) |
Aug
(77) |
Sep
(97) |
Oct
(65) |
Nov
(80) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(63) |
Feb
(47) |
Mar
(45) |
Apr
(63) |
May
(67) |
Jun
(51) |
Jul
(78) |
Aug
(37) |
Sep
(45) |
Oct
(59) |
Nov
(50) |
Dec
(70) |
2004 |
Jan
(23) |
Feb
(90) |
Mar
(37) |
Apr
(53) |
May
(111) |
Jun
(71) |
Jul
(35) |
Aug
(58) |
Sep
(35) |
Oct
(35) |
Nov
(35) |
Dec
(20) |
2005 |
Jan
(51) |
Feb
(19) |
Mar
(20) |
Apr
(8) |
May
(26) |
Jun
(14) |
Jul
(49) |
Aug
(24) |
Sep
(20) |
Oct
(49) |
Nov
(17) |
Dec
(53) |
2006 |
Jan
(12) |
Feb
(26) |
Mar
(45) |
Apr
(19) |
May
(19) |
Jun
(13) |
Jul
(11) |
Aug
(9) |
Sep
(10) |
Oct
(16) |
Nov
(17) |
Dec
(13) |
2007 |
Jan
(9) |
Feb
(12) |
Mar
(28) |
Apr
(33) |
May
(12) |
Jun
(12) |
Jul
(19) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
(5) |
Dec
(13) |
2008 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(16) |
May
(3) |
Jun
(1) |
Jul
(12) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
(6) |
Jul
(5) |
Aug
(3) |
Sep
(7) |
Oct
(1) |
Nov
(15) |
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
|
Apr
(28) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(8) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Roger B. W. <ro...@fi...> - 2003-10-12 09:46:03
|
On Sat, Oct 11, 2003 at 04:58:28PM -0400, David Kaufman wrote: >having said that, i *don't* usually use it to generate static *HTML* >files, but mostly for other things such as conf files and other >miscellaneous system administration work, and this is definitely *not* it's >stated purpose. I've used it for: PostScript (mostly for parameter insertion) .ini files plain text (that gets fiddly with line breaks) source code formatting ...oh, and HTML. Some people like Template::Toolkit, especially on London.pm, but I prefer a more lightweight package. Roger |
From: Offer K. <of...@ne...> - 2003-10-11 21:42:44
|
> maintaining) web sites as sets of static html files so > ...especially if > you're comfortable with the process of building and compiling > software with > make, makefiles and the like, webmake may be just what you're > looking for. > > if you do decide to use webmake, please post back here with > your impressions "comfortable with... make" is the last description that would fit me - I can install from source using "./config ; make; make install" but that's about it for me, so it does not look like I'll be giving webmake a spin. Thanks for the reply, though. > > hth, > > -dave > Just curious- what does "hth" stand for? Thanks again, Offer |
From: Karen J. C. <si...@ph...> - 2003-10-11 21:05:37
|
On Sat, 11 Oct 2003, Offer Kaye wrote: OK>However, I would like to use it as a regular Perl script, to generate OK>static HTML pages. I know this *can* be done, since I tried it on the OK>example provided in the documentation. But I'm wondering whether OK>HTML::Template is really suitable for this kind of use, or if I'm OK>"abusing" it. If that's "abuse," then I'm "abusing" H::T more than I'm "using" it. -- Karen J. Cravens si...@ph... |
From: David K. <da...@gi...> - 2003-10-11 20:58:33
|
Offer Kaye <of...@ne...> wrote: > [...] I would like to use it as a regular Perl script, to generate > static HTML pages. I know this *can* be done, since I tried it on the > example provided in the documentation. But I'm wondering whether > HTML::Template is really suitable for this kind of use, or if I'm > "abusing" it. it certainly can be done, and i suppose "suitability" is best judged by you, after using it that way. it's quite suitable (for me) for generating static files, but that may just be because i use it so heavily for CGI scripts that i've become very familiar with the syntax, and comfortable using it in other ways. having said that, i *don't* usually use it to generate static *HTML* files, but mostly for other things such as conf files and other miscellaneous system administration work, and this is definitely *not* it's stated purpose. > Is there another module you could recommend as better suited for this > task? i've flirted on an off with using webmake: http://webmake.taint.org/ it is however "yet another templating system", with it's own syntax and i've been reluctant to switch (maybe my comfort level with H::T has become a liability :-)) but webmake's design is very clearly aimed at generating (and maintaining) web sites as sets of static html files so ...especially if you're comfortable with the process of building and compiling software with make, makefiles and the like, webmake may be just what you're looking for. if you do decide to use webmake, please post back here with your impressions (good or bad). i come across web dev projects often enough where a sizeable site of static pages needs to be generated (and only occasionally regenerated), based on smaller set of "core templates". in these certain situations, though i usually end up using a dynamic templating system anyway, it does sometimes feel like overkill, which is why i've been keeping an eye on webmake. hth, -dave |
From: <m.s...@gm...> - 2003-10-11 20:47:51
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, HTML::Template is *definitely* suitable for this task, too. CGI::Application::Generator uses it to create stubs in a perl module file, and I have heard rumors that people use HTML::Template for Postscript or Pdf generation - so generating static html pages should be something really straightforward with HTML::Template. By the way, CGI::Application is really worth trying for any CGI with more than one state, especially together with HTML::Template. Regards, Markus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard <http://www.gnupg.org/> iD8DBQE/iGxTxxUzQSse11ARAkuFAJ45QCmKjIqtYAuRxQwMFtK7TyZUbQCeNiTk Ih8uGO+JkZ82x3Bh9PSKdVw= =1n78 -----END PGP SIGNATURE----- |
From: Offer K. <of...@ne...> - 2003-10-11 20:28:14
|
Hi, I'm an HTML::Template newbie, and I was wondering whether the veterans on this list could help me. The documentation for HTML::Template talks about using it as a CGI script, to generate the HTML code "on-the-fly". However, I would like to use it as a regular Perl script, to generate static HTML pages. I know this *can* be done, since I tried it on the example provided in the documentation. But I'm wondering whether HTML::Template is really suitable for this kind of use, or if I'm "abusing" it. Is there another module you could recommend as better suited for this task? I've looked at the Template-Toolkit, but it looks a little more complex than HTML::Template, so before I choose it or another module over HTML::Template I would appreciate some advice from veteran users. Thanks in advance, Offer Kaye |
From: Wayne W. <ww...@by...> - 2003-10-05 17:33:31
|
I need something roughly opposite die_on_bad_params. I need to know what vars (or loops) in the template are NOT populated at output time. I've taken over a project where I need to know if I am completely populating the templates. Any ideas? I could do a bunch of query looping and call param('name') on all the vars that query gives me, but it seems like I wouldn't be the first to want this. Is there something already written? Thanks! Wayne Walker ww...@by... |
From: David W. <da...@ki...> - 2003-10-04 00:20:56
|
I'm pleased to announce announce the release of Bricolage 1.6.6. This maintenance release addresses a number issues discovered since the release of version 1.6.5. Some of the more important changes include: * Added README.Solaris. * When an asset is published or deployed directly from the asset profile, it is now properly removed from the publish or deploy desk. * Templates now display their output channel associations instead of their element associations on desks. This seems to be more useful, since the element association is usually obvious from the name. * The category URI is now displayed for assets on desks, rather than the name. This is consistent with the display of the category elsewhere. * Elements to which no subelements can be added will no longer display an empty select list and "Add Element" button. * Bug fix when deploying to multiple output channels. If the output channel IDs matched each other partly, it could cause a file to be removed after it just had been uploaded. * Users with CREATE access to a start desk can once again create stories on that desk even when they don't have CREATE access to "All Stories." * Each upgrade script is now run within the confines of a single database transaction. If any database changes within an upgrade script encounter an error, all of the changes in that script will be rolled back. * An upgrade script failure will now cause "make upgrade" to halt installation so that any issues are immediately identified and correctable. For a complete list of the changes, see the changes file at: http://sourceforge.net/project/shownotes.php?release_id=188766 ABOUT BRICOLAGE Bricolage is a full-featured, enterprise-class content management and publishing system. It offers a browser-based interface for ease-of use, a full-fledged templating system with complete HTML::Mason and HTML::Template support for flexibility, and many other features. It operates in an Apache/mod_perl environment, and uses the PostgreSQL RDBMS for its repository. A comprehensive, actively-developed open source CMS, Bricolage has been hailed as "Most Impressive" in 2002 by eWeek. Learn more about Bricolage and download it from the Bricolage home page, http://bricolage.cc/. Enjoy! David -- David Wheeler AIM: dwTheory da...@ki... ICQ: 15726394 http://www.kineticode.com/ Yahoo!: dew7e Jabber: Th...@ja... Kineticode. Setting knowledge in motion.[sm] |
From: Sam T. <sa...@tr...> - 2003-10-03 18:30:22
|
On Fri, 3 Oct 2003, Todd Chapman wrote: > I guess I answered my own question. I turned on cache_debug > and the logs say that I am getting cache hits! Too bad I > didn't speed up the application significantly. Need a high > resolution timer to see the the improvement... One way to see a real improvement is to load all your templates during Apache startup. Then the memory used by the templates will be shared across Apache child processes. For large apps with lots of templates this can save quite a lot of memory. You'll find an example of loading templates at startup in the FAQ section. For details about Apache and shared memory in child processes see the mod_perl guide on perl.apache.org. -sam |
From: Todd C. <htm...@ch...> - 2003-10-03 18:20:28
|
I guess I answered my own question. I turned on cache_debug and the logs say that I am getting cache hits! Too bad I didn't speed up the application significantly. Need a high resolution timer to see the the improvement... -Todd On Fri, Oct 03, 2003 at 12:53:06PM -0400, Todd Chapman wrote: > I am moving my CGI script to mod_perl. To get things > going quickly I'm running them under Apache::PerlRun. > The HTML::Template docs say that I can turn caching > on when running under mod_perl. Does this assume I > am using Apache::Registry, or will the caching work > with Apache::PerlRun also? > > Thanks! > > -Todd |
From: Todd C. <htm...@ch...> - 2003-10-03 17:48:24
|
I am moving my CGI script to mod_perl. To get things going quickly I'm running them under Apache::PerlRun. The HTML::Template docs say that I can turn caching on when running under mod_perl. Does this assume I am using Apache::Registry, or will the caching work with Apache::PerlRun also? Thanks! -Todd |
From: Philip S T. <phi...@gm...> - 2003-09-29 09:16:53
|
On Mon, 29 Sep 2003, Kenneth Gonsalves wrote: > my %rowdata; > $rowdata{cols} = \@cls; ^^^^^^^^^^^^^^^^^^ you assign a reference to @cls > push (@rows,\%rowdata); > @cls = (); ^^^^^^^ which you then blow away all @rows contain an empty (). Instead, why not just use an anonymous arrayref: my $cls = [], and push into that? You should also quote hash keys. Philip -- [He] took me into his library and showed me his books, of which he had a complete set. -- Ring Lardner |
From: Kenneth G. <la...@th...> - 2003-09-29 08:47:57
|
hi i have some data that i want to output in three columns, so i'm trying to build a nested loop. This is the perl code: #!/usr/bin/perl -w use CGI; use HTML::Template; use strict; use DBI; my $q = new CGI(); my @rows = (); my @cls = (); my $q1 = "select id,blurb,thumb from pictures"; my $st1 = $dbh->prepare($q1); $st1->execute; my $cl = -1; while (my @r = $st1->fetchrow) { $cl++; my %data; my $pic = '/pics/'.$r[2]; $data{id} = $r[0]; $data{pic} = $pic; $data{blurb} = $r[1]; $cls[$cl] = \%data; if ($cl == 3) { my %rowdata; $rowdata{cols} = \@cls; push (@rows,\%rowdata); @cls = (); $cl = -1; } } my $log = HTML::Template->new ( filename => 'foo.tmpl', path => './tmpl', associate => $q ); $log->param(image => $title, LIST => \@rows); print $q->header, $log->output(); _________________________________________ and this is the relevant part of the template code: <table border="1" cellspacing="0" cellpadding="5"> <TMPL_LOOP NAME = "LIST"> <tr> <TMPL_LOOP NAME = "cols"> <td> <img src="<TMPL_VAR NAME='pic'>"> </td> </TMPL_LOOP> </tr> </TMPL_LOOP> </table> _________________________________ but there is no output kg |
From: Erik <er...@ne...> - 2003-09-29 05:12:58
|
Puneet Kishor has written: > header.cgi --> header.tmpl --> frame: header > map.cgi --> map.tmpl --> frame: map > table.cgi --> table.tmpl --> frame: table > tabledetail.cgi --> tabledetail.tmpl --> frame: tabledetail > > clicking on the map (in the map frame, obviously), causes map.cgi to > select certain features in the map and redraw the map with those > features selected. Those features are also connected to a dbf file (and > later on, to a real table in MySQL). Hence, the dbf rows are also > selected. However, the map gets redrawn via the map.tmpl in the map > frame, while the dbf rows need to be shown in the table frame. The way > I am doing it right now is that I show the map in the map frame, and > then a form button with a lame message such as "12 features selected -- > press button to view them". Pressing the button calls table.cgi with > target="table", and the dbf rows are displayed in the table frame. Then > clicking on any single row shows its details in the tabledetail frame. If I understand this right ... I click a link in "map", it changes both "map" and "table" and blanks out "tabledetail". If that's right, the following solution will work for you. 1.) In your map frame, create your links like this: <a href="table.cgi" onClick="window.self.location='map.cgi'" target="table"> My Map Link </a> Note the the HREF fills the "table" frame and the onClick fills the current frame. 2.) In the SRC of the table.tmpl file, include a lil bit of javascript magic. Something like this (the actual syntax here may be incorrect) top.tabledetail.document = "blank.html"; Put that right after yer script tag, with no subroutine around it so it will fire as soon as the browser reads it. And you're done. - Erik |
From: Puneet K. <pk...@ei...> - 2003-09-29 00:35:17
|
On Sunday, September 28, 2003, at 08:49 AM, Karen J. Cravens wrote: > .. > > It's still sort of do-able, depending on your reason for frames. If > they're just there to, say, provide scrollbars and you don't mind > refreshing the whole page, you can do something like this: > .. On Sunday, September 28, 2003, at 02:49 PM, Erik wrote: > .. > > This is a little off-HTML::Template topic but I might propose another > solution. > .. Thanks for the replies folks. Really appreciate it. However, I _need_ to use frames because... well, I need to. I am not a big fan of frames, and know most all the ways to avoid them (or fake them... overflow:auto is great). However, I also believe that frames can be immensely useful in certain situations, and this is one of 'em. POST requests usually cache-out, and db queries are expensive. In this application, frames not only simplify navigation, they also minimize user-webserver as well as webserver-dbserver traffic. As I described earlier, I have four frames like so (we can forget about the header frame) -- header.cgi --> header.tmpl --> frame: header map.cgi --> map.tmpl --> frame: map table.cgi --> table.tmpl --> frame: table tabledetail.cgi --> tabledetail.tmpl --> frame: tabledetail clicking on the map (in the map frame, obviously), causes map.cgi to select certain features in the map and redraw the map with those features selected. Those features are also connected to a dbf file (and later on, to a real table in MySQL). Hence, the dbf rows are also selected. However, the map gets redrawn via the map.tmpl in the map frame, while the dbf rows need to be shown in the table frame. The way I am doing it right now is that I show the map in the map frame, and then a form button with a lame message such as "12 features selected -- press button to view them". Pressing the button calls table.cgi with target="table", and the dbf rows are displayed in the table frame. Then clicking on any single row shows its details in the tabledetail frame. Ideally, I would like map.cgi to select the features in the map, redraw the map, and send the map to the map frame, and the dbf rows to the table frame. In case the table frame or the tabledetail frame have query results from a previous call, I would also like to send a blank.html to them, etc. Drawing the map and querying the dbf file (or the MySQL table, later on) is a fairly expensive proposition (esp drawing the map), so frames allow me to have the user navigate only parts of the application desktop without refreshing things unnecessarily. Would be nice if I could somehow tell a template to go to a specific frame, of course, filling a frame is a pulling action, so there is no way to send a template to a specific frame. I am coming to the conclusion that I cannot do what I want, and will have to devise some other approach to this app. Puneet. |
From: Karen J. C. <si...@ph...> - 2003-09-28 14:06:40
|
On Sat, 27 Sep 2003, Puneet Kishor wrote: PK>see, the problem is not really being able to fire two frames (yes, js PK>is the solution)... the problem is firing them from one perl script PK>calculating/creating values that have to be displayed in two frames... PK>as I understand... one script usually has one template associated with PK>it (although it could have more templates... there is nothing in the PK>docs that says it can't). What I cannot to is fire two scripts... PK>because all the relevant calculations are in one script... I just want PK>to take the results and divvy them up into two frames. Ah. It's still sort of do-able, depending on your reason for frames. If they're just there to, say, provide scrollbars and you don't mind refreshing the whole page, you can do something like this: Button launches script into _top. Script builds all the frames, writes them out (either as complete HTML files or as parms to be stuffed in H::T later) to something persistent, then returns the top-level HTML to the browser. That top-level HTML either refers to files that were just written, or to a subsidiary script that just populates templates. (In the former case, you have to worry about expiring old files and handling 404's; in the latter you just have to worry about expiring old data, and the subsidiary script can gracefully handle references to data it can't find.) It's not quite as pretty as just refreshing two frames, but I can't think of any other way to do it. Depending on the structure of your page, you might be able to make the frames that need refreshed a nested framed page, though. -- Karen J. Cravens si...@ph... |
From: Puneet K. <pk...@ei...> - 2003-09-28 02:16:18
|
On Saturday, September 27, 2003, at 08:03 PM, Karen J. Cravens wrote: > On Sat, 27 Sep 2003, Puneet Kishor wrote: > > PK>So I am working with frames (I have to). Different scripts populate > PK>different templates in different frames -- at different times. Now I > PK>want to press one button in one frame, and update two (or more) > frames > PK>with respectively different templates. > > Only way I know of to do that is with Javascript and putting an onclick > either in the FORM or in the A link (depending on whether your "button" > is a submit button or just a link button). > ya but... see, the problem is not really being able to fire two frames (yes, js is the solution)... the problem is firing them from one perl script calculating/creating values that have to be displayed in two frames... as I understand... one script usually has one template associated with it (although it could have more templates... there is nothing in the docs that says it can't). What I cannot to is fire two scripts... because all the relevant calculations are in one script... I just want to take the results and divvy them up into two frames. this may well prove my undoing. |
From: Karen J. C. <si...@ph...> - 2003-09-28 01:41:13
|
On Sat, 27 Sep 2003, Puneet Kishor wrote: PK>So I am working with frames (I have to). Different scripts populate PK>different templates in different frames -- at different times. Now I PK>want to press one button in one frame, and update two (or more) frames PK>with respectively different templates. Only way I know of to do that is with Javascript and putting an onclick either in the FORM or in the A link (depending on whether your "button" is a submit button or just a link button). Here's one explanation: http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20737567.html (The problem is, of course, those of us who use non-Javascript browsers will only get one frame updated. Of course, my non-JS browser is also a non-framed browser, so I suppose it's a moot point...) -- Karen J. Cravens si...@ph... |
From: Puneet K. <pk...@ei...> - 2003-09-28 00:15:04
|
So I am working with frames (I have to). Different scripts populate different templates in different frames -- at different times. Now I want to press one button in one frame, and update two (or more) frames with respectively different templates. I have -- frame1.cgi --> frame1.tmpl --> frame1 frame2.cgi --> frame2.tmpl --> frame2 frame3.cgi --> frame3.tmpl --> frame3 frame4.cgi --> frame4.tmpl --> frame4 I want to do -- frame1 frame2 frame3 --> frame3.cgi --> frame3.tmpl --> frame3 | frame4 |-> frame4.tmpl --> frame4 Needless to say... there is stuff in frame3.cgi that is powering stuff in frame3.tmpl as well as in frame4.tmpl. ( I am clicking on a map in one frame which is causing features to be selected and the map to be redrawn with the selection visible. At the same time, I want to query the underlying database for the selected features and display them in another frame. ) How do I do this? |
From: Cees H. <ce...@si...> - 2003-09-26 17:02:21
|
I would suggest using HTML::FillInForms to provide the sticky fields that you are after. It will simplify your templates, and save you lots of headaches. http://search.cpan.org/author/TJMATHER/HTML-FillInForm-1.02/lib/HTML/FillInForm.pm Cheers, Cees Quoting Wojciech Pietron <W.P...@it...>: > Hi, > > I have a form that collects info about books' authors. > There is a popup menu idicating the number of authors > and dynamic number of text fields for the authors' names. > > Here you are (simplified example): > > <-- how many authors --> > <select name="nr_of_authors" onChange=submit()> > <option value="1">1</option> > <option value="2" selected>2</option> > <option value="3">3</option> > </select> > > <-- create fields for authors --> > <form> > <input type="text" name="author_1" value=""><br> > <input type="text" name="author_2" value=""><br> > <form> > > This is a part of authors.tmpl: > <TMPL_LOOP NAME="aut_loop"> > <input type="text" name=author_<TMPL_VAR NAME="__counter__"> > value="?"><br> > </TMPL_LOOP> > > Does anybody know how I can make that formy sticky and take advantage of > associate function? What should I put in the place of question mark? It > looks like <TMPL_VAR NAME="author_<TMPL_VAR NAME="__counter__">"> does not > work. > > Thank you in advance. > Wojciech Pietroñ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > |
From: Wojciech P. <W.P...@it...> - 2003-09-26 09:58:07
|
Hi, I have a form that collects info about books' authors.=20 There is a popup menu idicating the number of authors=20 and dynamic number of text fields for the authors' names. Here you are (simplified example): <-- how many authors --> <select name=3D"nr_of_authors" onChange=3Dsubmit()> <option value=3D"1">1</option> <option value=3D"2" selected>2</option> <option value=3D"3">3</option> </select> <-- create fields for authors --> <form> <input type=3D"text" name=3D"author_1" value=3D""><br> <input type=3D"text" name=3D"author_2" value=3D""><br> <form> This is a part of authors.tmpl: <TMPL_LOOP NAME=3D"aut_loop"> <input type=3D"text" name=3Dauthor_<TMPL_VAR NAME=3D"__counter__"> va= lue=3D"?"><br> </TMPL_LOOP> Does anybody know how I can make that formy sticky and take advantage of associate function? What should I put in the place of question mark? It looks like <TMPL_VAR NAME=3D"author_<TMPL_VAR NAME=3D"__counter__">"> doe= s not work. Thank you in advance. Wojciech Pietro=F1 |
From: Ron S. <ro...@de...> - 2003-09-25 23:37:38
|
On Thu, 25 Sep 2003 16:38:49 +0200, Ralf Ullrich wrote: Hi Ralf See below. >=3D> $html) and this works fine. but this is bad if you want to= style >certain rows in a different way from other rows. But i don't= know >how to >handle this with TMPL_LOOP, since I never can know, how many >children >exist for one parent and how deep this hierarchy will be. >has anyone on this list done something like this and could point= me >in >the right direction? I see Karen has given you some ideas. To create a crude tree-like structure within a table, try= prefixing the rows with multiple white boxes and then an 'elbow' box. Demo images: http://www.deakin.edu.au/~rons/html/black-and-white-boxes.html This method is trivial, but may help. Also, learn how to use H::T's __first__ etc tokens to change the= CSS class of a <td>, etc. Demo: =09<tmpl_loop name =3D outer_result_loop> =09=09<tmpl_if name =3D __first__> =09=09=09<tr> =09=09=09=09<tmpl_loop name =3D inner_result_loop> =09=09=09=09=09<td class =3D "headbox"> =09=09=09=09=09=09<tmpl_var name =3D result_td> =09=09=09=09=09</td> =09=09=09=09</tmpl_loop> =09=09=09</tr> =09=09<tmpl_else> =09=09=09<tr> =09=09=09=09<tmpl_loop name =3D inner_result_loop> =09=09=09=09=09<td> =09=09=09=09=09=09<tmpl_var name =3D result_td> =09=09=09=09=09</td> =09=09=09=09</tmpl_loop> =09=09=09</tr> =09=09</tmpl_if> =09</tmpl_loop> -- Ron Savage, ro...@de... on 26/09/2003. Room EF 312 Deakin University, 221 Burwood Highway, Burwood, VIC 3125,= Australia Phone: +61-3-9251 7067, Fax: +61-3-9251 7604 http://www.deakin.edu.au/~rons |
From: Sam T. <sa...@tr...> - 2003-09-25 18:24:00
|
On Thu, 25 Sep 2003, Wojciech Pietron wrote: > I have two nested loops. Is there a way to get the value of > outer <TMPL_VAR NAME="__counter__"> from inner loop? No there isn't. But it should be easy to create your own __counter__ workalike and access it normally with global_vars set. -sam |
From: Karen J. C. <si...@ph...> - 2003-09-25 17:43:44
|
On Thu, 25 Sep 2003, Ralf Ullrich wrote: RU>has anyone on this list done something like this and could point me in RU>the right direction? H::T doesn't recurse very well, but it does loops nicely. What I end up doing is putting all messages in a single TMPL_LOOP. The indentation level is then used to make a dummy TMPL_LOOP within that one, which is used by the template however it needs to be... at the moment, I think I'm just using nonbreaking spaces to indent it. You could use clear graphics to do the same thing. If you were willing to accept less of a separation between template and code, you could pass a simple variable instead (level*N), and use it for the width of a clear graphic, or an empty table cell. Or if you're using expressions, you could pass the level value as is, and multiply it by the desired amount within the template. -- Karen J. Cravens si...@ph... |
From: Brett S. <swi...@sw...> - 2003-09-25 15:53:53
|
> html::template. I get the guestbook-data via DBi from a MySQL-Server. > I process this data within a recursive function, which calls itself > until no record has any more children. By now I append all html-data with First, the part that isn't your question, but I feel opinionated :) Recursion is expensive. I've done this in two other ways, depending on my data: 1) Select all data from table (including info on which nodes are children of others, then sort.) 2) create a list (initially of just the root). Move through this list, inserting (splice()ing) any children of the current node just after the current node. This is my preferred method. IT also allows me to store the "depth" (relative to root) of each node. > => $html) and this works fine. but this is bad if you want to style > certain rows in a different way from other rows. But i don't know how to I just offer my data as a list to my template, which can then style the output based on the depth of the node (since that is now in the data). For example, each node usually has (NodeID, Depth, Name, Title, Text, Date). I can indent or otherwise indicate the depth on a per-row basis, and all HTML formatting is done in the template. Hope that helps in some fashion. -- SwiftOne / Brett Sanger swi...@sw... |