html-template-users Mailing List for HTML::Template (Page 98)
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: html-template-users e-m. f. n. p. <htm...@ia...> - 2002-09-16 21:09:40
|
Hello using this code my $template = HTML::Template->new( filename => 'testfile', die_on_bad_params => 0, global_vars => 1, loop_context_vars => 1 ); push @INNER_LOOP, { INNER_VAR => 'this is inner var' }; push @OUTER_LOOP, { OUTER_VAR => 'this is outer var', INNER_LOOP => \@INNER_LOOP }; $template->param( OUTER_LOOP => \@OUTER_LOOP ); print $template->output(); ----- and taking the manual page example <TMPL_LOOP OUTER_LOOP> OUTER: <TMPL_VAR OUTER_VAR> <TMPL_LOOP INNER_LOOP> INNER: <TMPL_VAR INNER_VAR> INSIDE OUT: <TMPL_VAR OUTER_VAR> </TMPL_LOOP> </TMPL_LOOP> gives the expected OUTER: this is outer var INNER: this is inner var INSIDE OUT: this is outer var however if I don't refer to OUTER_VAR in the OUTER_LOOP then INNER_LOOP doesn't get it either i.e. <TMPL_LOOP OUTER_LOOP> <TMPL_LOOP INNER_LOOP> INNER: <TMPL_VAR INNER_VAR> INSIDE OUT: <TMPL_VAR OUTER_VAR> </TMPL_LOOP> </TMPL_LOOP> gives INNER: this is inner var INSIDE OUT: is this a bug? TIA, Neil p.s. <TMPL_LOOP OUTER_LOOP> <TMPL_LOOP INNER_LOOP> INNER: <TMPL_VAR INNER_VAR> INSIDE OUT: <TMPL_VAR OUTER_VAR> </TMPL_LOOP> OUTER: <TMPL_VAR OUTER_VAR> </TMPL_LOOP> works fine |
From: Sam T. <sa...@tr...> - 2002-09-16 17:28:55
|
On Mon, 16 Sep 2002, MArk Williams wrote: > we have a problem here with the cacheing of templates. > We have multiple template directories and templates with the same name. > Cacheing seems to be giving us the wrong templates back. > Is there a problem with cacheing? We want cacheing on. Can you show me how to reproduce the problem? How are you loading your templates? -sam |
From: MArk W. <ma...@or...> - 2002-09-16 15:08:00
|
Hi all, we have a problem here with the cacheing of templates. We have multiple template directories and templates with the same name. Cacheing seems to be giving us the wrong templates back. Is there a problem with cacheing? We want cacheing on. Mark Williams |
From: Philip S T. <phi...@gm...> - 2002-09-13 13:13:28
|
For those who don't know, HTML.Template.java is a java implementation of HTML::Template. It is almost completely compatible with HTML::Template.pm The only thing not supported are the caching directives and filters (which are on the way). By popular demand, this release has the global_vars option. die_on_bad_params has also been included. The tutorial on the website has also been updated to reflect some of the newer constructs. Homepage: http://html-tmpl-java.sourceforge.net/ Changes in current release: ver 0.1.1 - Fixed bug in tmpl_var which failed if parameter was not a String - TMPL_VAR and TMPL_LOOP now give a reasonable error message if parameter is of the wrong type - Var.typeOfElement now actually returns the type and not the name - support for die_on_bad_params - support for global_vars - New __COUNTER__ TMPL_LOOP context variable - Can now set default values for TMPL_VARs through the template: <TMPL_VAR name="myvar" default="default_value"> Philip -- fenderberg, n.: The large glacial deposits that form on the insides of car fenders during snowstorms. -- "Sniglets", Rich Hall & Friends |
From: Mark M. <mm...@ol...> - 2002-09-12 01:15:55
|
-- Mark Mertel mm...@ol... Phone: (360) 344-3113 FAX: (360) 344-3553 Cell: (206) 409-2018 |
From: csajl <cs...@ya...> - 2002-09-10 22:59:31
|
thanks much. this is exactly what i was trying to do. --- Philip S Tellis <phi...@gm...> wrote: > On Thu, 5 Sep 2002, csajl wrote: > > > i was thinking i'd have to parse the entire x.tmpl into a string and > > supply that as a tmpl_var when i parse through the gui.tmpl. > > use a filter. something like this: > > <tmpl_include "%%include_file%%"> > > and in the perl filter: > > s/<tmpl_include "%%include_file%%">/<tmpl_include "$include_file">/g; > __________________________________________________ Yahoo! - We Remember 9-11: A tribute to the more than 3,000 lives lost http://dir.remember.yahoo.com/tribute |
From: Philip S T. <phi...@gm...> - 2002-09-10 12:37:59
|
On Fri, 6 Sep 2002 10:46, Kenny Smith wrote: > I'm looking for a way to display a different looking error message when > H::T encounters an error like "HTML::Template::param() : attempt to set > parameter 'extra_urls' with a scalar - parameter is not a TMPL_VAR! at > ...", one that fits my site design. You could also look at $SIG{__DIE__} and $SIG{__WARN__} -- Digital circuits are made from analog parts. -- Don Vonada |
From: Philip S T. <phi...@gm...> - 2002-09-10 08:01:46
|
Sometime on Sep 9, Kenny Smith assembled some asciibets to say: > I'm currently using the CGI::Carp qw(fatalsToBrowser) to grab those > things... maybe I'll look into customizing it's error message. use fatalsToBrowser along with set_message - from CGI::Carp. -- Ontogeny recapitulates phylogeny. |
From: Martijn v. d. B. <Mar...@as...> - 2002-09-10 06:28:38
|
Hi, On Tuesday 10 September 2002 02:23, Kenny Smith wrote: > Hi all, > > I posted this before, but I wanted to throw it out there again... > > Is the only way to catch the internal H::T errors (like "attempt to set > parameter 'extra_urls' with a scalar - parameter is not a TMPL_VAR!") b= y > doing all of my H::T inside an eval and checking the magic error variab= les? I have the following at the very beginning of the instance script (eg.=20 'my_application.cgi') of my CGI::Application / H::T apps. It causes all=20 errors to be written to a logfile in my directory tree instead of to the=20 webserver's log or the browser. # # Use local logfile # BEGIN { use CGI::Carp qw(carpout); my $log =3D "errorlog.txt"; # logfile in cwd open(LOG, ">>$log") or die "Cannot write to log $log: $!"; carpout(LOG); } HTH, Martijn --=20 +----------------------------------+ Martijn van den Burg ASML, CS PPC Inform@tion Systems Voice: +31 (0)40 268 3856 +----------------------------------+ |
From: Kenny S. <ke...@jo...> - 2002-09-10 05:33:47
|
Hi David, I'm currently using the CGI::Carp qw(fatalsToBrowser) to grab those things... maybe I'll look into customizing it's error message. Kenny > also if you're doing CGI programming and are just annoyed > by apache's less-than-enlightening 500 Server Errors while > you're writing/debugging code, don't forget about: > > use CGI::Carp qw( fatalsToBrowser); > |
From: David K. <da...@gi...> - 2002-09-10 01:03:31
|
Kenny Smith <ke...@jo...> wrote: > > Is the only way to catch the internal H::T errors (like "attempt to > set parameter 'extra_urls' with a scalar - parameter is not a > TMPL_VAR!") by doing all of my H::T inside an eval and checking the > magic error variables? yes, but not *all* of your H::T code, just the parts that are likely to throw errors. the error you mention, for example, would only be thrown during the $template->param() call, so you could just wrap that one statement in an eval, if that's the kind of error you want to handle, as opposed to parse errors like badly nested loops, broken tmpl syntax, etc. also if you're doing CGI programming and are just annoyed by apache's less-than-enlightening 500 Server Errors while you're writing/debugging code, don't forget about: use CGI::Carp qw( fatalsToBrowser); which can trap those perl die messages for you and display them in the browser right away so you don't have to monitor the error log. but don't leave fatalsToBrowser running on a public URL because the raw error messages *might* just give would-be hackers more info than they might otherwise have, like the absolute paths to scripts and whatnot... CGI::Carp also lets you hook in your *own* callback to be used to generate the HTML displayed for perl exceptions, so this could be used to s/ubsti/tute/ or strip the error messages down to something less revealing, but again, it's a bit risky as you never know what perl's last words might be as it's dying... -dave |
From: Kenny S. <ke...@jo...> - 2002-09-10 00:36:57
|
Hi all, I posted this before, but I wanted to throw it out there again... Is the only way to catch the internal H::T errors (like "attempt to set parameter 'extra_urls' with a scalar - parameter is not a TMPL_VAR!") by doing all of my H::T inside an eval and checking the magic error variables? Kenny |
From: David K. <da...@gi...> - 2002-09-09 15:34:31
|
Mike Carlton <mi...@mi...> wrote: > Does anyone have suggestions on how to cleanly code up a monthly > calendar application with H::T? > > I've currently got a perl script that generates an html table and the > cell contents -- this works fine, but is a royal pain to update the > html. So it occurs to me that I would like to set this up as a > template. > > The table cell for each day of the month will have a list of links -- > this is straightforward enough. But I can't see how to code all the > possible calendar formats in H::T -- there are months with 4, 5 or 6 > weeks. The number of days in a month varies, the number blank days > before the 1st and after the last day varies, etc. i wrote a calendar application using HTML::Template and CGI::Application that you can see at http://asiasociety.org/events/ it sounds like you need something a bit different. this is a fixed-size html "calendar widget" with each day containing only the date itself, linked to results starting on that date, while you need a larger stretchy calendar with more lengthy cell contents. also this widget doesn't show just the 12 "calendar months". it can start in any week and always shows five weeks, so there are cases where the dates shown span *three* calendar months, even though at first glance it appears to be just like a wall calendar with one month per page... in any case the logic to generate the calendar itself with HTML::Template goes something like this: the first day of the first week of my calendar is the most recent sunday previous to today (or today if today is sunday) so i started with: $now = time() (unix date/time in seconds) and: @date = localtime($now), to get today's date. (and i fixup the zero-based month elements, adding 1, and 1900-based year adding 1900, of course.) one of my @date elements is: $day_of_week, (0-6) == (Sun-Sat). so to get back to sunday i need: $seconds_in_a_day = 60*60*24 $seconds_since_sunday = $seconds_in_a_day * $day_of_week which gives us: $sundays_time = $now - $seconds_since_sunday, and @sundays_date = localtime($sundays_time); my template uses a tmpl_loop named "weeks" for the weeks (table rows) and the week tmpl_loop contains a nested tmpl_loop named days something like this: <table> <!-- header row --> <tr> <th>Sun</th> <th>Mon</th> <th>Tue</th> <th>Wed</th> <th>Thu</th> <th>Fri</th> <th>Sat</th> </tr> <tmpl_loop name="weeks"> <tr> <tmpl_loop name="days"> <td> today is: <tmpl_var month>/<tmpl_var date>/<tmpl_var year>! </td> </tmpl_loop> </tr> </tmpl_loop> <table> to populate this template, i needed a fairly complicated data structure. i needed "weeks" to be passed to the template as an arrayref representing the rows in the table, and within each iteration of the weeks loop, i need a *nested* loop named "days" representing the days in that week (the cells of the table). each day in days needed to be a hashref containing whatever actual named tmpl_vars i needed to generate the html for that day's table cell. to create this data structure i started with $this_days_time = $sundays_time, created a perl loop to iterate over the 5 weeks, and an inner loop to iterate over each 7 days, incrementing $this_days_time += $seconds_in_a_day, and passing that value to localtime to get back a @date array, and populate the day's cell, to end up with something like this: $weeks= [ { days=> [ {month=>9, date=>8, year=>2002}, {month=>9, date=>9, year=>2002}, {month=>9, date=>10, year=>2002}, {month=>9, date=>11, year=>2002}, {month=>9, date=>12, year=>2002}, {month=>9, date=>13, year=>2002}, {month=>9, date=>14, year=>2002}, ] }, { days=> [ { etc. }, { etc. }, ] }, ... ]; with all five weeks containing seven days each. like i said my calendar widget has a fixed number of five weeks in a sort of "moving window" that can start in the middle of a month, span more than one month, etc. but the same type of logic could be used to compute $days_since_the_sunday_before_the_first_of_the_month :-) and start from there, "blanking" any cells whose month != the current month. hope this helps, -dave PS: cut-n-pasters, beware: all the above template and perl code is from memory and may cause cheese to exude from your cd-rom when invoked. |
From: Philip S T. <phi...@gm...> - 2002-09-09 06:38:57
|
On Sun, 8 Sep 2002, Mike Carlton wrote: > Does anyone have suggestions on how to cleanly code up a monthly calendar > application with H::T? i've got this running on my site: http://www.ncst.ernet.in/~etu/IndProg.shtml - for a pretty regularly updated calendar, and http://www.ncst.ernet.in/~etu/calendar/PGDST.shtml?month=9&year=2001&type=day&fac=dsal&family=corner for an older one, but with more entries. I could answer specific questions if you have any, and even send you some GNU GPL'ed code if that licence is alright with you. Philip -- Got a dictionary? I want to know the meaning of life. |
From: Mike C. <mi...@mi...> - 2002-09-09 06:05:31
|
Does anyone have suggestions on how to cleanly code up a monthly calendar application with H::T? I've currently got a perl script that generates an html table and the cell contents -- this works fine, but is a royal pain to update the html. So it occurs to me that I would like to set this up as a template. The table cell for each day of the month will have a list of links -- this is straightforward enough. But I can't see how to code all the possible calendar formats in H::T -- there are months with 4, 5 or 6 weeks. The number of days in a month varies, the number blank days before the 1st and after the last day varies, etc. Comments? Thanks, --Mike Carlton |
From: Cees H. <ce...@si...> - 2002-09-06 14:15:01
|
Quoting Philip S Tellis <phi...@gm...>: > On Thu, 5 Sep 2002, csajl wrote: > > > i was thinking i'd have to parse the entire x.tmpl into a string and > > supply that as a tmpl_var when i parse through the gui.tmpl. > > use a filter. something like this: > > <tmpl_include "%%include_file%%"> > > and in the perl filter: > > s/<tmpl_include "%%include_file%%">/<tmpl_include "$include_file">/g; > > although i'm not quite sure if this works as I think it should. ie, > does H::T pass a <tmpl_include> to a filter and then do the including or > does it just do the including? This would break if you are using caching, since H::T doesn't consider filters when doing its cache lookups. Sam said he was planning to add support for generating your own cache keys which would solve this problem, but I guess he's been quite busy lately. However, with caching turned off, your method should work. From what I remember of the code, filters are applied first, then the template is parsed. When an include file is found, it is sent through the filter first, then parsed and included, etc... So if you have many includes in your template, the filter will be called many times. Cees |
From: Philip S T. <phi...@gm...> - 2002-09-06 04:59:40
|
On Thu, 5 Sep 2002, csajl wrote: > i was thinking i'd have to parse the entire x.tmpl into a string and > supply that as a tmpl_var when i parse through the gui.tmpl. use a filter. something like this: <tmpl_include "%%include_file%%"> and in the perl filter: s/<tmpl_include "%%include_file%%">/<tmpl_include "$include_file">/g; although i'm not quite sure if this works as I think it should. ie, does H::T pass a <tmpl_include> to a filter and then do the including or does it just do the including? -- Life is the urge to ecstasy. |
From: Karen C. <si...@ph...> - 2002-09-06 02:20:11
|
On 5 Sep 2002 at 13:58, csajl wrote: > i was thinking i'd have to parse the entire x.tmpl into a string and supply > that as a tmpl_var when i parse through the gui.tmpl. > the separate two calls don't necessarily bother me at this point, but didn't > understand if H-T was able to do such a thing. I'm not quite sure where you're going with this, but couldn't you go the other way 'round, the way I do, and TMPL_INCLUDE the "skin" parts into the individual pages? I actually have four different prefab sections, with three different "openings" for custom stuff: Prefab header Menu Prefab separator (which currently opens the table tags) Main content Prefab separator (which closes that cell and opens another) Sidebar content Prefab footer (which closes out the table, and adds all the various bottom-of- the-page meeble) This setup lets me change the look of the site quite a bit without changing anything but the prefab files. Here's a piece of an older site-look: <URL: http://www.phoenyx.net/gamers/2002/index.html > compared to the new one on the main page. (The older stuff is MhonArc- generated, and I haven't gotten around to reconfiguring the mhonarc.rc file and regenerating the vast quantities of archives we've got. If anyone wants to earn my undying gratitude, convince Earl Hood to switch MhonArc to H::T.) |
From: Brendon O. <bre...@re...> - 2002-09-06 01:16:19
|
On Fri, 6 Sep 2002 10:46, Kenny Smith wrote: > Hi all, > > I'm looking for a way to display a different looking error message when > H::T encounters an error like "HTML::Template::param() : attempt to set > parameter 'extra_urls' with a scalar - parameter is not a TMPL_VAR! at > ...", one that fits my site design. Easiest way is to wrap your HTML::Template->new() in an eval: eval { $tmpl_obj = HTML::Template->new ( ... ) }; if ($@ or ! $tmpl_obj) { ... do your error thing, possibly using $@ for the error message... } Regards, - Brendon. -- R E D S H E R I F F Brendon Oliver - Technology Release Manager [bre...@re...] Level 7, 10 Queens Road +61 3 9864 0755 tel Melbourne VIC +61 3 9864 0778 fax Australia +61 411 048 342 mob This message and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this message in error please notify us immediately by return email or telephone +61 (3) 659 0432, then delete this message. Any views expressed in this message are those of the individual sender and many not necessarily reflect the views of Red Sheriff. --- Humans are communications junkies. We just can't get enough. -- Alan Kay 1:35pm up 3 days, 5:52, 0 users, load average: 1.02, 0.50, 0.24 |
From: Kenny S. <ke...@jo...> - 2002-09-06 00:59:40
|
Hi all, I'm looking for a way to display a different looking error message when H::T encounters an error like "HTML::Template::param() : attempt to set parameter 'extra_urls' with a scalar - parameter is not a TMPL_VAR! at ...", one that fits my site design. I'm hoping there is some way to associate a subroutine ref (or something similiar) with a template object which can be called in the case of an error. I've looked through the perldoc, but I didn't see anything. Any help? Kenny Smith JournalScape.com |
From: csajl <cs...@ya...> - 2002-09-05 20:58:35
|
thanks for the reply. i think i started down the right path (and resolved my initial confusion)after sending out this message, but am i able to pass the "gui" template a filename to then be parsed as part of the tmpl_include (which, then in turn, will be parsed)? ideally, i'd like to reference one gui template for all the pages and simply supply H-T a name of that page-specific .tmpl to parse into the area "x". i was thinking i'd have to parse the entire x.tmpl into a string and supply that as a tmpl_var when i parse through the gui.tmpl. the separate two calls don't necessarily bother me at this point, but didn't understand if H-T was able to do such a thing. thanks. --- Karen Cravens <si...@ph...> wrote: > On 5 Sep 2002 at 11:28, csajl wrote: > > > the tmpl_include function works but only as far as vertical layout blocks > are > > concerned (or am i missing something?). > > You're missing something. But it's more of an HTML issue than an H-T issue. > > > i searched the mailing list archives as well as google and haven't found a > > solution. any pointers would be greatly appreciated. > > You want a table, most likely. That's the layout I use at the Phoenyx. In > fact, if you look at <URL: http://www.phoenyx.net/index.tmpl >, you can see > the raw template file for the index.html main page (static, regenerated > nightly). You'll have to look at the subtemplates, since I actually do a > sort of > reverse template, but the basic structure of the HTML looks something like > this: > > === Sample pseudocode === > <TABLE width=100%> > <TR><TD width=(either an explicit pixel width or a percentage, depending on > what you're putting in the "sidebar") valign="top"> > > (Your sidebar stuff) > > </td></tr><TR><TD valign="top"> > > (Your main content stuff... the "x", or a TMPL_INCLUDE in your case) > > </td></tr> > </table> > === end pseudocode === > > You can get clever with your table layout and cause the main content to > appear above the sidebar for Lynx users (two rows, two columns, of which > the first cell is 1 pixel high, and the second column is a rowspan of two, > and > the sidebar lives in the first column, *second* row), but you have to be > careful > because Netscape and IE don't always agree on how that should be > displayed. I think mine still does that, so don't let it confuse you. > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com |
From: Karen C. <si...@ph...> - 2002-09-05 19:00:30
|
On 5 Sep 2002 at 11:28, csajl wrote: > the tmpl_include function works but only as far as vertical layout blocks are > concerned (or am i missing something?). You're missing something. But it's more of an HTML issue than an H-T issue. > i searched the mailing list archives as well as google and haven't found a > solution. any pointers would be greatly appreciated. You want a table, most likely. That's the layout I use at the Phoenyx. In fact, if you look at <URL: http://www.phoenyx.net/index.tmpl >, you can see the raw template file for the index.html main page (static, regenerated nightly). You'll have to look at the subtemplates, since I actually do a sort of reverse template, but the basic structure of the HTML looks something like this: === Sample pseudocode === <TABLE width=100%> <TR><TD width=(either an explicit pixel width or a percentage, depending on what you're putting in the "sidebar") valign="top"> (Your sidebar stuff) </td></tr><TR><TD valign="top"> (Your main content stuff... the "x", or a TMPL_INCLUDE in your case) </td></tr> </table> === end pseudocode === You can get clever with your table layout and cause the main content to appear above the sidebar for Lynx users (two rows, two columns, of which the first cell is 1 pixel high, and the second column is a rowspan of two, and the sidebar lives in the first column, *second* row), but you have to be careful because Netscape and IE don't always agree on how that should be displayed. I think mine still does that, so don't let it confuse you. |
From: csajl <cs...@ya...> - 2002-09-05 18:28:50
|
greetings. i'm fairly new to using H-T, having come from a more php-based solution. i'm trying to setup an environment where i can read one base skin/gui tmpl file for the entire site and then include each page-specific template. the tmpl_include function works but only as far as vertical layout blocks are concerned (or am i missing something?). ideally, i'd have a single template file with a layout: |---------------------------| | | | | |---------------------------| | | | | | | | | | | | XX | | | | | | | | | | | | | |---------------------------| | | | | |---------------------------| where the "gui" is everything except the XX cell. of course, the XX cell is the page-specifc "other" template to be parse as well. i searched the mailing list archives as well as google and haven't found a solution. any pointers would be greatly appreciated. thanks. --chris __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com |
From: Cory T. <ct...@on...> - 2002-09-05 11:52:36
|
I've been playing with : http://search.cpan.org/author/TJMATHER/HTML-Template-XPath-0.10/lib/HTML/Tem plate/XPath.pm For a few days. Pretty cool -- claims to be based on HTML::Template, but uses 'CONTENT_VAR' and 'CONTENT_LOOP' instead of the (insert praise here) 'TMPL_VAR' and 'TMPL_LOOP' names. I like the use of Xpath, this module seems like (potentially) a good way to provide defaults & semi-static data to templates, and placing it in XML could further simplify some code. So, here I am, wondering if anyone else has been thinking about this? Anyone else want to think/talk about it? -- Cory |
From: Philip S T. <phi...@gm...> - 2002-09-04 05:21:22
|
On Tue, 3 Sep 2002, Mike Carlton wrote: > <tmpl_if name=loginame> <tmpl_if name="logged_in"> now it's a boolean variable. your perl code decides whether logged_in should be set or not. your template just reacts to that. of course, the former was okay too, since in perl anything can be considered boolean. -- What is now proved was once only imagin'd. -- William Blake |