List Info

Thread: "calculated" path to template




"calculated" path to template
user name
2006-02-02 18:27:34
As long as Template::Provider is being patched for a new
release, is
there any chance of adding an additional piece of info to
the
template/component hash? I've encountered situations, when
I'm using a
list of INCLUDE_PATHs, where it would be useful to have
access to the
calculated full path to the actual template file.
 
If I'm not mistaken, this would only require a one-line
addition to the
_compile() method. I haven't done much patching, so forgive
me if this
isn't correctly formatted:
 
--- Template/Provider.pm     2004-01-30 13:37:50.000000000
-0500
+++ Provider.pm 2006-02-02 13:19:59.000000000 -0500
 -839,6
+839,7 
         $parsedoc-> = {
             'name'    => $data->,
             'modtime' => $data->,
+            'path'    => $data->,
             %{ $parsedoc-> },
         };

The key name "path" is merely a suggestion, but I
hope the concept makes
sense. Comments, anyone?

Jason

Jason Gottshall
jgottshallcapitoladvantage.com 


_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
"calculated" path to template
user name
2006-02-03 03:22:09
Sorry I haven't taken a close look at this code in context,
but would I be
correct in thinking that this would give the template coder
access to  the
full path name?  Because I personally have reasons for
wanting to keep
someone with template access from knowing full system paths.
 So if there
wasn't a way to disable such access at the code level, I'd
be wary of
this.

-Stephen

> As long as Template::Provider is being patched for a
new release, is
> there any chance of adding an additional piece of info
to the
> template/component hash? I've encountered situations,
when I'm using a
> list of INCLUDE_PATHs, where it would be useful to have
access to the
> calculated full path to the actual template file.
>
> If I'm not mistaken, this would only require a one-line
addition to the
> _compile() method. I haven't done much patching, so
forgive me if this
> isn't correctly formatted:
>
> --- Template/Provider.pm     2004-01-30
13:37:50.000000000 -0500
> +++ Provider.pm 2006-02-02 13:19:59.000000000 -0500
>  -839,6 +839,7 
>          $parsedoc-> = {
>              'name'    => $data->,
>              'modtime' => $data->,
> +            'path'    => $data->,
>              %{ $parsedoc-> },
>          };
>
> The key name "path" is merely a suggestion,
but I hope the concept makes
> sense. Comments, anyone?
>
> Jason
>
> Jason Gottshall
> jgottshallcapitoladvantage.com
>
>
> _______________________________________________
> templates mailing list
> templatestemplate-toolkit.org
> http://lists.template-toolkit.org/mailman/listinfo/t
emplates
>


_______________________________________________
templates mailing list
templatestemplate-toolkit.org
http://lists.template-toolkit.org/mailman/listinfo/t
emplates
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )