html-template-users Mailing List for HTML::Template (Page 20)
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: Michael P. <mp...@pl...> - 2006-04-14 17:19:26
|
Sam Tregar wrote: > On Thu, 13 Apr 2006, Michael Peters wrote: > >> Is it possible to combine the 'escape' attribute of H::T with >> H::T::Expr? > > No, I don't think so. I don't think it would be too hard to add > support for it though. HTML::Template supports combining escape and > code-ref params, so it'd just be a matter of making the > HTML::Template::Expr parser smart enough to pass it through. It looks like it also doesn't support 'default'. So by making the "parser smart enough" do you mean copying that huge regex from H::T and modifying it with the expr regex? A very simple approach would be to take any tmpl_vars/loops, etc that use expr and capture anything before the expr="..." and after it and then just add them to the generated tags. This however doesn't solve the sub-ref problem. -- Michael Peters Developer Plus Three, LP |
From: Sam T. <sa...@tr...> - 2006-04-14 00:14:30
|
On Thu, 13 Apr 2006, Michael Peters wrote: > Is it possible to combine the 'escape' attribute of H::T with > H::T::Expr? No, I don't think so. I don't think it would be too hard to add support for it though. HTML::Template supports combining escape and code-ref params, so it'd just be a matter of making the HTML::Template::Expr parser smart enough to pass it through. -sam |
From: Michael P. <mp...@pl...> - 2006-04-13 23:52:44
|
Is it possible to combine the 'escape' attribute of H::T with H::T::Expr? I'm guessing not since any combination I've tried fails. If it's too hard to do, maybe a new function could be added so that you can do somthing like <tmpl_var expr="escape(uc(title), 'HTML')"> -- Michael Peters Developer Plus Three, LP |
From: Aaron D. <aa...@da...> - 2006-04-12 19:04:43
|
We're pleased to announce that version 2.004 of Krang is now available. This release is comprised of several enhancements and bug fixes. Of note are improvements to the permissioning system, an improved version of HTML::Template::Expr and Xinha enhancements. Notable changes in this release: * Added enforcement of permissions at the application and run-mode level rather than just at the UI link level. * Added support for multiple word action names in admin scheduler. * Added new Krang list system primitive, Krang::ElementClass::CheckBoxGroup. * Decoupled processing of assets from publish_story() and preview_story() allowing for future subclassing into Krang::Publisher::Parallel simply redefine _process_assets() and _process_preview_assets() * Added a new configuration parameter, Charset. This may be used to control the character set for the Krang user-interface * Upgraded HTML::Template::Expr to version 0.06 - now supports chained binary operators! * Fixed bug in Krang::ElementClass::ListGroup and Krang::ElementClass::RadioGroup such that associated ListItems will now be automatically added to the DataSet. * Fixed bug in Krang::ElementClass::Date where date would change if KDS was exported from a machine in one time zone and imported on a machine in an earlier time zone. For more information about Krang, visit the Krang website: http://krang.sourceforge.net/ There you can download Krang, view screenshots, read documentation, join our mailing-lists and access the CVS tree. Detailed change-log here: http://krang.sf.net/docs/changelog.html Krang is an Open Source web-publisher / content-management system designed for large-scale magazine-style websites. It is a 100% Perl application using Apache/mod_perl and MySQL, as well as numerous CPAN modules. Krang provides a powerful and easy to use story and media editing environment for magazine editors, as well as a complete template development environment for web designers. On the back-end, Perl programmers can customize Krang to control the data entered in the story editor and add code to drive the templates to build output. Krang can be enhanced with add-ons containing new skins and other new features. Krang easily handles large data sets and can manage multiple websites in a single installation. - the Krang team ---- Aaron Dancygier |
From: Paulsen, B. <BPa...@le...> - 2006-03-24 02:32:53
|
As mentioned previously, I dug up the code and found that I already submitted it to CPAN a while ago. =46eel free to download it from there and let me know if you have questions. Brian ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Eric F. <er...@dm...> - 2006-03-23 00:47:02
|
Hi, So I can do that from within the app were I am using HTML::Template.. Ahh, I was wondering why everyone always uses croak by default in all of the modules I look at.. Thanks! Eric At 12:11 PM 3/21/2006, Sam Tregar wrote: >On Tue, 21 Mar 2006, Eric Frazier wrote: > >>Is there any way you could change this line in Template.pm from croak to >>confess? > >No need to change Template.pm. Just tell Carp you want verbose >reports: > > use Carp qw(verbose); > >Now all croak()s will have stack traces. > >-sam |
From: Sam T. <sa...@tr...> - 2006-03-21 20:12:00
|
On Tue, 21 Mar 2006, Eric Frazier wrote: > Is there any way you could change this line in Template.pm from croak to > confess? No need to change Template.pm. Just tell Carp you want verbose reports: use Carp qw(verbose); Now all croak()s will have stack traces. -sam |
From: Eric F. <er...@dm...> - 2006-03-21 17:26:32
|
Hi, Is there any way you could change this line in Template.pm from croak to confess? I know I might be missing something about croak vs confess, but it is always a pain to get this error and then have to try to figure out where it came from, whereas with confess it is easy.. # load in options supplied to new() for (my $x = 0; $x <= $#_; $x += 2) { defined($_[($x + 1)]) or croak("HTML::Template->new() called with odd number of option parameters - should be of the form option => value"); $options->{lc($_[$x])} = $_[($x + 1)]; } Thanks, Eric |
From: David W. <da...@ki...> - 2006-03-21 03:32:23
|
Fellow HTML::Templaters, Apologies for the previous email, which contained the announcement for Bricolage 1.10.0, which was released in January. This is the correct announcement for Bricolage 1.10.1, which was released today. The Bricolage development team is pleased to announce the release of Bricolage 1.10.1. This maintenance release adds a few new features, a number of improvements, and many bug fixes. Highlights include new SOAP modules, improved packaging support, and smother upgrades from 1.8.x versions. The most important changes are: New Features * Added ContribType, Destination, and Preference SOAP modules. [Scott] * Added upload and download feature to the template interface, so that templates can optionally be uploaded or downloaded. Suggested by Chris Sutton. [David] Improvements * Added installation defaults for FreeBSD that will be used when the USE_DEFAULTS environment variable is set to "freebsd" during installation. [Rod Taylor] * Created two new make targets, "install_files" and "install_db", to allow the files to be installed without doing anything with the database. Useful for packagers who need to let users manually create the database. [Marshall] * Updated Bric::ElementAdmin to be conversant in the merging of element type sets and elements. That is, it now makes sense in the context of Bricolage 1.10. Reported by Ryan O'Toole. [David] * The View/Edit link has been restored to stories, media, and templates on desks, and the title has been returned to its status as a preview link. The URI is no longer a link. [David] Bug Fixes * The database upgrade script now updates table permissions after executing all of the scripts for each version to be upgraded, rather than after all of the upgrade scripts have run, thus allowing later scripts to properly access tables created by earlier scripts. Reported by Nate Perry-Thistle. [David] * Fixed some of the 1.8.9 upgrade scripts that run after the 1.9.x upgrade scripts to that they are properly compatible. [Nate Perry-Thistle, Rod Taylor, and David] * Reverting stories and media no longer leads to occasional errors such as, "Too many Bric::Biz::Element::Container objects found". Reported by Simon Wilcox. [David] * Disabled the "sticky" scroll bar in the story profile. It just didn't work very well. [David] * The "Allow Multiple" checkbox and "Size" field in the "Add New Field" section of the element type profile work again. Reported by Rod Taylor and Paul Orrock. [David] * Multiple select lists no longer break the story and element profiles, and can once again have their values properly changed from multiple to single to none. Spotted by Rod Taylor. [David] * Assets can once again be properly deleted from desks. [David] * Cancelling the checkout of an media document now deletes any new file that has been uploaded and, if the AUTO_PREVIEW_MEDIA bricolage.conf directive is enabled, re-previews the previous version of the media file. [David] * The autopopulated fields for image element types are now created when a new image element type is created. This was made possible by moving the selection of media type (Image, Audio, Video, or Other Media) to the New Element Type screen, where it is now part of the "Content Type" select list, which also includes the Story and Subelement options. As a result, one can no longer change the media type in an existing element type (not that it ever made sense to do so). Reported by Paul Orrock. [David] * Failed jobs can once again be cancelled. Reported by Rod Taylor. [David] * Publishing multiple versions of a document before any of the publish jobs for those versions are executed no longer leads to publishing errors when the older version is published. Thanks to Rod Taylor for the spot! [David] For a complete list of the changes in Bricolage 1.10.1, see the changes list at http://www.bricolage.cc/news/announce/changes/bricolage-1.10.1/. For the complete history of ongoing changes in Bricolage, see Bric::Changes at http://www.bricolage.cc/docs/current/api/Bric::Changes. Download Bricolage 1.10.1 now from the Bricolage Website at http://www.bricolage.cc/downloads/, from the SourceForge download page at http://sourceforge.net/project/showfiles.php?group_id=34789, or from the Kineticode download page at http://www.kineticode.com/bricolage/downloads/. 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, HTML::Template, PHP5, and Template Toolkit 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 by eWEEK as "quite possibly the most capable enterprise-class open-source application available." Enjoy! --The Bricolage Team |
From: David W. <da...@ki...> - 2006-03-21 03:27:53
|
Fellow HTML::Templaters, It is with great pleasure that the Bricolage development team announces the release of Bricolage 1.10. The culmination of over 19 months of development, version 1.10 represents a significant advance for the celebrated open-source content management and publishing system. Here are some of the highlights: PHP Templating Bricolage is the first content management system to support three different Perl-based templating architectures (Mason, Template Toolkit, and HTML::Template) as well as one in a completely different programming language: PHP 5. Bricolage 1.10 adds PHP templating support, allowing template developers to use the popular Web programming language to formatting their documents for output. This functionality is thanks to a killer new technology, known as PHP::Interpreter, that loads the PHP 5 interpreter into a Perl 5 interpreter, and affords transparent access between PHP and Perl code. The upshot is that PHP templaters get full access to the entire Bricolage API, as well as the ability to use whatever other PHP or Perl libraries they wish. Our expect is that this development will push Bricolage into new environments where PHP developers can make use of the powerful content management and publishing system without having to learn a new programming language. Furthermore, we hope that PHP::Interpreter will act as a bridge between the Perl and PHP communities, such that there is a greater exchange of ideas and a greater ability to use each other's libraries. PHP::Interpreter was developed by OmniTI. PHP::Interpreter and the PHP templating support in Bricolage were sponsored by SAPO--Portugal Online. LDAP Authentication Bricolage 1.10 includes support for a pluggable authentication architecture, and in addition to its built-in authentication has added a module for authentication against an LDAP directory server. This new feature is sure to be welcome in busy enterprises that rely on a directory server, such as Windows Active Directory http://www.microsoft.com/windowsserver2003/technologies/directory/activ edirectory/default.mspx, Novel eDirectory http://www.novell.com/products/edirectory/, or OpenLDAP http://www.openldap.org/. Authentication can be limited to members of a directory group, and supports LDAP v.3 and TLS connectivity. Contributed by Kineticode. Revamped Interface Bricolage 1.10 sports a completely revamped browser interface that is XHTML compliant and handles all styling via CSS. Yes, our 1999-era table-driven interface is officially a thing of the past. The upshot is that the interface is much more elegant, easier to skin with your own look (by overriding its CSS files), allows search results and editing fields to expand and contract with the browser window size, and delivers pages as much as 70% smaller than they were before. The new interface was Contributed by Marshall Roch. A second major new UI feature is the revamped "Bulk Edit" interface. Gone is the old "Super Bulk Edit" interface, with the Bulk Edit revisions overtaking its functionality. Now you can edit the entire contents of a story document, from the top-most element to the bottom-most field, in a single textarea field with no reloads. The secret to allowing the full-text editing of Bricolage's unique hierarchical element structures is Plain Old Documentation, or "POD". Subelements are denoted by a new =begin POD tag, and end with a matching =end tag. The result is a much more natural editing interface. Even related stories and media are supported by new POD tags. We believe that this improvement will greatly facilitate the editing process, making Bricolage a much more enjoyable product for content editors to work with. The Bulk Edit revision is complemented by two new additions: diff support and a JavaScript-powered "Find and Replace" dialog box. Users can now see at a glance the changes between one version of a document and another. The changes are shown on a word-by-word basis, with additions in green with an underline and deletions in red with a strikeout. A similar interface is used to show the differences between versions of templates using the traditional "unified diff" format rather than word-by word. The JavaScript-powered "Find and Replace" dialog box can be used to search by strings or regular expressions in a Bulk Edit or Template editing environment. Found bits of text can also be replaced or even globally replaced. We believe that this powerful new feature, combined with the new Bulk Edit interface, makes Bricolage a compelling content editing environment. The Bulk Edit, diff, and Find and Replace features were contributed by Kineticode. What's in a Name? A somewhat less apparent but no less massive change in Bricolage 1.10 is a system-wide naming normalization. Now all objects in Bricolage are known by the same names, from the UI to the class to the database to the SOAP server. Most noticeable in the UI will be the elimination of the old "Element Type" object, and the renaming of "Element" objects to "Element Types." This change has the benefit of disambiguating element types, which define the structure of documents, and elements, which are the document parts that contain content. Gone is the confusion between element administration and content elements; there are now only element types and elements. Another example is the renaming of "Data Elements" to "Field Types" and "Fields". And in tandem with this change, the storage of field values in the database has been denormalized, so that every field value does not also store the name and key name of the field. This greatly reduces the size of the database, and should make field lookups much faster, particularly in formatting templates. And while we were going about denormalizing field storage, the data types of the database columns were also normalized. Old-style, inefficient column types have been dumped in favor of more efficient, precise column types. For example, all "NUMERIC" columns, which everywhere only contained integers or booleans, have been converted the "INTEGER" and "BOOLEAN" data types, as appropriate. This change will also be invisible to the everyday Bricolage user, but should enhance database performance by optimizing the storage of object attributes. And finally, a more visible change: Bricolage 1.10 introduces much more flexible URI formats. You can now use many more parts of the cover date in the URI, and in whatever format you like. So you could have a format of "/%{categories}/%Y-%m-%d/" and end up with the URI "/foo/bar/2004-09-22/" if you wanted. Or even "/%{categories}/%Y/%V/" to get the week number as part of the URI. You can also include document UUIDs, and even your own text, (e.g. foobar in /%{categories}/%Y/%m/foobar/%{uuid}/". This enhancement finally allows users to almost always be able to replicate legacy URI formats in Bricolage, for a seamless upgrade from an older CMS. What are You Waiting For? There are many, many more changes in Bricolage 1.10 that, overall, make using it a joy. For a complete list of the changes, see the changes list at http://www.bricolage.cc/news/announce/changes/bricolage-1.10.0/. For the complete history of ongoing changes in Bricolage, see Bric::Changes at http://www.bricolage.cc/docs/current/api/Bric::Changes. Download Bricolage 1.10.0 now from the Bricolage Website at http://www.bricolage.cc/downloads/, from the SourceForge download page at http://sourceforge.net/project/showfiles.php?group_id=34789, or from the Kineticode download page at http://www.kineticode.com/bricolage/downloads/. 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, HTML::Template, PHP5, and Template Toolkit 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 by eWEEK as "quite possibly the most capable enterprise-class open-source application available." Enjoy! --The Bricolage Team |
From: Mark S. <ma...@su...> - 2006-03-21 02:50:12
|
On 2006-03-16, Tom Heady <tom...@pu...> wrote: > > Uh, but which one? > > Sourceforge: > http://sourceforge.net/tracker/?atid=101075&group_id=1075&func=browse > > or cpan: > http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Template Good point. I believe the rt.cpan.org is actively being maintained, and is the one I would recommend. The "BUGS" section of the docs should updated to clarify this. Mark -- http://mark.stosberg.com/ |
From: Tom H. <tom...@pu...> - 2006-03-16 06:53:25
|
Attached are patches/tests for the following bugs: * when specifying a default_escape, you can't turn it off I have fixed ESCAPE=0 and added ESCAPE=NONE to turn off escaping altogether for a TMPL_VAR. The pod was also updated to reflect this change. Usage: <TMPL_VAR foo ESCAPE=NONE> <TMPL_VAR foo ESCAPE=0> * ESCAPE='JS' did not work I fixed a regex so that single quotes around JS now works. I have also added a new test file: 04default_escape.t Tom |
From: Tom H. <tom...@pu...> - 2006-03-16 04:38:30
|
Mark Stosberg wrote: > On 2006-03-15, Tom Heady <tom...@pu...> wrote: > >>Hello, >> >>What would be the most appropriate way to contribute bug >>fixes/patches/tests? >> ... > > Tom, > > I believe using the bug tracking system is the preferred route. I know > Sam has mentioned that in the past. It's also a visible place for other > users to find the contribution in case they want to use it before an > official release happens. > > Mark > Uh, but which one? Sourceforge: http://sourceforge.net/tracker/?atid=101075&group_id=1075&func=browse or cpan: http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Template Tom |
From: Mark S. <ma...@su...> - 2006-03-16 04:13:15
|
On 2006-03-15, Tom Heady <tom...@pu...> wrote: > Hello, > > What would be the most appropriate way to contribute bug > fixes/patches/tests? > > I have a patch and tests that will fix the following: > > ------------------------------------ > use HTML::Template; > > my $text = q{<TMPL_VAR foo ESCAPE=0>}; > my $template = HTML::Template->new( > scalarref => \$text, > default_escape => "HTML" ); > $template->param(foo => '<b>this is bold\n'); > print $template->output; > > __DATA__ > <b>this is bold\n > > ------------------------------------ Tom, I believe using the bug tracking system is the preferred route. I know Sam has mentioned that in the past. It's also a visible place for other users to find the contribution in case they want to use it before an official release happens. Mark -- http://mark.stosberg.com/ |
From: Kapoor, N. <nis...@xc...> - 2006-03-15 15:23:04
|
> #BUT, if I need to bold the 'search text', I need to iterate through = the loop > my @loopData=3D(); > foreach my $rec (@{$data}) { > my %loopRow; > $rec->{title} =3D~ s/(\b$searchText\b)/<b>$1<\/b>/ig; > $loopRow{title} =3D $rec->{title}; > push @loopData, \%loopRow; > } > $template->param(myLoopVar =3D> \@loopData); If you're dying to do it in one statement I suppose you could do: $template->param(myLoopVar =3D> [ map { $_->{title} =3D~ s!\b($searchText)\b!<b>$1</b>!ig; $_ } @$data ]); [Nishi]=20 The 'single' statement lets me assign any and all fields in one go - = without having to worry about individual fields. I was hoping if somehow = I could populate @{$data} with the 'replaced' text, that would do it. = Also, there are cases when the resultset contains different fields based = on different conditions it was called with. So, access to individual = fields is not always available. Not a big issue, but just wanted to run = it by the group. Thanks for the prompt response. Nishi |
From: Tom H. <tom...@pu...> - 2006-03-15 10:36:29
|
Hello, What would be the most appropriate way to contribute bug fixes/patches/tests? I have a patch and tests that will fix the following: ------------------------------------ use HTML::Template; my $text = q{<TMPL_VAR foo ESCAPE=0>}; my $template = HTML::Template->new( scalarref => \$text, default_escape => "HTML" ); $template->param(foo => '<b>this is bold\n'); print $template->output; __DATA__ <b>this is bold\n ------------------------------------ Thanks, Tom |
From: Sam T. <sa...@tr...> - 2006-03-13 22:47:42
|
On Mon, 13 Mar 2006, Kapoor, Nishikant wrote: > Is there a way I can continue to use the 'single' assignment, and > still achieve this objective? You seem to have the right idea here: > #BUT, if I need to bold the 'search text', I need to iterate through the loop > my @loopData=(); > foreach my $rec (@{$data}) { > my %loopRow; > $rec->{title} =~ s/(\b$searchText\b)/<b>$1<\/b>/ig; > $loopRow{title} = $rec->{title}; > push @loopData, \%loopRow; > } > $template->param(myLoopVar => \@loopData); If you're dying to do it in one statement I suppose you could do: $template->param(myLoopVar => [ map { $_->{title} =~ s!\b($searchText)\b!<b>$1</b>!ig; $_ } @$data ]); I don't exactly consider that an improvement, personally. -sam |
From: Roger B. W. <ro...@fi...> - 2006-03-13 22:47:22
|
On Mon, Mar 13, 2006 at 04:41:15PM -0600, Kapoor, Nishikant wrote: >For populating loops, I get the resultset from db, and assign it directly to the loop_var. This works wonderfully for most cases, except where there is a need to process each row before assigning it to the template. One particular case is where I am retrieving a resultset after a search query, and I need to highlight the text that was searched for. > >Is there a way I can continue to use the 'single' assignment, and still achieve this objective? Well, you could cheat and roll the loop into a map statement... my $data = &getDataFromDB; map {$data[$_]{bold}=1} 0..$#{$data}; $template->param(myLoopVar => $data); and have a <tmpl_if name=bold><b></tmpl_if> <tmpl_var name=title escape=html> <tmpl_if name=bold></b></tmpl_if> You really shouldn't be putting html markup into template parameters anyway, without a very good reason. Roger |
From: Kapoor, N. <nis...@xc...> - 2006-03-13 22:41:34
|
For populating loops, I get the resultset from db, and assign it = directly to the loop_var. This works wonderfully for most cases, except = where there is a need to process each row before assigning it to the = template. One particular case is where I am retrieving a resultset after = a search query, and I need to highlight the text that was searched for. Is there a way I can continue to use the 'single' assignment, and still = achieve this objective? Thanks, Nishi Here is some code snippet to explain it more: my $data =3D &getDataFromDB; $template->param(myLoopVar =3D> $data); #preferred way #BUT, if I need to bold the 'search text', I need to iterate through the = loop my @loopData=3D(); foreach my $rec (@{$data}) { my %loopRow; $rec->{title} =3D~ s/(\b$searchText\b)/<b>$1<\/b>/ig; $loopRow{title} =3D $rec->{title}; push @loopData, \%loopRow; } $template->param(myLoopVar =3D> \@loopData); |
From: Dan H. <dan...@re...> - 2006-03-11 01:32:47
|
Hi I'm using CGI::Application::Plugin::Anytemplate with = HTML::Template::Expr for an application, and it uses a heck of a lot of memory. Because my = code is spread over a number of packages, I'll summarise my logic in = pseudo-code: sub publish_all { foreach my $content_id ($self->get_content_ids()) { $self->publish_article($content_id) } } sub publish_article { my ($self, $content_id) =3D @_; my %content =3D $self->get_content($content_id); my $template =3D $self->template->load( file =3D> $self->get_template($content{template}) ); $template->param(%content); write_to_file_system(${$template->output}); 1; } As I loop through "publish_article", the memory goes up the more times = it is called. No globals are defined in my modules.=20 Trying to track down memory usage in Perl can be hard. Running Devel::FindGlobals, I see that the reported size for $HTML::Template::Expr::PARSER is 100,039,491 bytes after publishing 500 articles! Assuming that the stats are correct, how can I keep $PARSER = down to a minimal size? BTW. For my test, I invoked the app via the OS command line not through = the web server Dan Horne |
From: Dan A. <dan...@sn...> - 2006-03-10 16:31:11
|
> H::T won't change anything about your template that isn't a <tmpl_*> tag. So > something else is changing your <br />. What other tools are you passing your > output through? > > -- Aargh! It's a Firefox thing; view source shows it right, but when I save the page to a file for validation, the trailing /'s go away. Never mind. |
From: Michael P. <mp...@pl...> - 2006-03-10 16:20:08
|
Dan Axtell wrote: > Hi, > > I have a report that aims to be and XHTML 1.0 compliant document. In my > template I use <br /> for my linebreaks; but after I fill in various template > tags via HTML::Template, they all become <br>, which fails to pass the > validator at w3c.org. Am I missing something obvious here, or is > HTML::Template not a good idea for producing XHTML 1.0 compliant documents? H::T won't change anything about your template that isn't a <tmpl_*> tag. So something else is changing your <br />. What other tools are you passing your output through? -- Michael Peters Developer Plus Three, LP |
From: Dan A. <dan...@sn...> - 2006-03-10 16:13:09
|
Hi, I have a report that aims to be and XHTML 1.0 compliant document. In my template I use <br /> for my linebreaks; but after I fill in various template tags via HTML::Template, they all become <br>, which fails to pass the validator at w3c.org. Am I missing something obvious here, or is HTML::Template not a good idea for producing XHTML 1.0 compliant documents? Thanks, Dan |
From: Michael P. <mp...@pl...> - 2006-03-08 14:23:28
|
Paulsen, Brian wrote: > Try using double_file_cache? I'm thinking this may be more of a > HTML::Template issue than a mod_perl issue. Just to let you know. H::T works just fine under mod_perl. If you have any caching going on, it's probably because you're leaving some globals or package level vars hanging around. When H::T caches the template, it doesn't cache the output or the params you pass in, it just caches the compiled state of the template. -- Michael Peters Developer Plus Three, LP |
From: Paulsen, B. <BPa...@le...> - 2006-03-08 04:23:37
|
Try using double_file_cache=3F I'm thinking this may be more of a HTML::Template issue than a mod_perl issue. What happens if you print the companyID value to STDERR =3F =20 -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 11:19 PM To: htm...@li... Subject: [htmltmpl] verified something ok so I used telnet to grab a few instances of our CGI using HTML::Template and the caching is still present. drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi=3FcompanyID=3D2 <snip> <p>Welcome to the <strong>omNovia</strong> Conference Center </snip> drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi=3FcompanyID=3D1 <snip> <p>Welcome to the <strong>Traders International</strong> Conference Center </snip> drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi=3FcompanyID=3D45 <snip> <p>Welcome to the <strong>omNovia</strong> Conference Center </snip> Any ideas=3F I should mention that roomlogin_new.cgi does use strict while our old CGI does not. And the old CGI doesn't have this problem even though both run under the same mod-perl enabled dir. Thanks, Matthew ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |