Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Trac ignores 'templates_dir'-setting

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


mutetella at denkdran

Aug 7, 2012, 3:35 PM

Post #1 of 4 (390 views)
Permalink
Trac ignores 'templates_dir'-setting

Hello,

I'm confused about this behaviour:

If I have a 'site.html' in the <env>/templates-path all works as expected.
If I put the same 'site.html' in another path, e. g. the shared
'/htdocs'-path Trac ignores it.
My Apache 'httpd.conf':
...
Alias /htdocs /home/claus/webapps/trac/.htdocs
<Directory /home/claus/webapps/trac/.htdocs>
Order allow,deny
Allow from all
</Directory>
...

My 'trac.ini':
...
[inherit]
plugins_dir =
templates_dir = /htdocs
...

What is wrong?

mutetella

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/8jsSMgGTd2YJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


hoff.st at web

Aug 8, 2012, 2:34 PM

Post #2 of 4 (365 views)
Permalink
Re: Trac ignores 'templates_dir'-setting [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 08.08.2012 00:35, schrieb mutetella:
> Hello,
>
> I'm confused about this behaviour:
>
> If I have a 'site.html' in the <env>/templates-path all works as
> expected. If I put the same 'site.html' in another path, e. g. the
> shared '/htdocs'-path Trac ignores it.
> My Apache 'httpd.conf':
> ...
> Alias /htdocs /home/claus/webapps/trac/.htdocs
> <Directory /home/claus/webapps/trac/.htdocs>
> Order allow,deny
> Allow from all
> </Directory>
> ...
>
> My 'trac.ini':
> ...
> [inherit]
> plugins_dir =
> templates_dir = /htdocs
> ...
>
> What is wrong?

IMHO the whole approach is wrong. The Genshi template is retrieved from
file system, not via HTTP by the Trac server internally.

Why can't you use that path directly in trac.ini? This looks too
complicated to me anyway. Just write

templates_dir = /home/claus/webapps/trac/.htdocs

Still there should be a reason for having htdocs and templates separated
in Trac environments by default, so I would hesitate to mix one into the
other even in inherited folders, but YMMV.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAi20sACgkQ31DJeiZFuHfd9ACfVVw+2sZLOqLUVo+EVX7fuAfD
ohgAnjzsCvUxUSZxSbS+fsttSd7pHRa1
=grDv
-----END PGP SIGNATURE-----

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


mutetella at denkdran

Aug 9, 2012, 2:26 AM

Post #3 of 4 (363 views)
Permalink
Re: Trac ignores 'templates_dir'-setting [In reply to]

Ok, if I used

template_dir = /home/claus/webapps/trac/.htdocs

it works proper. Thank you.

I used the Apache-alias '/htdocs' first, because under the [trac]-section a

htdocs_location = /home/claus/webapps/trac/.htdocs

or under the [header_logo]-section a

src = /home/claus/webapps/trac/.logos/logo_wiki_400x100.png

don't work, only an Apache-alias get me further here.

Is this so because 'templates_dir' will be used from genshi directly
whereas 'htdocs_location' or the logo-src are trac-internal settings?

Can you give me an explanation?

Thanks for your help!!

Claus

Am Mittwoch, 8. August 2012 23:34:04 UTC+2 schrieb hasienda:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 08.08.2012 00:35, schrieb mutetella:
> > Hello,
> >
> > I'm confused about this behaviour:
> >
> > If I have a 'site.html' in the <env>/templates-path all works as
> > expected. If I put the same 'site.html' in another path, e. g. the
> > shared '/htdocs'-path Trac ignores it.
> > My Apache 'httpd.conf':
> > ...
> > Alias /htdocs /home/claus/webapps/trac/.htdocs
> > <Directory /home/claus/webapps/trac/.htdocs>
> > Order allow,deny
> > Allow from all
> > </Directory>
> > ...
> >
> > My 'trac.ini':
> > ...
> > [inherit]
> > plugins_dir =
> > templates_dir = /htdocs
> > ...
> >
> > What is wrong?
>
> IMHO the whole approach is wrong. The Genshi template is retrieved from
> file system, not via HTTP by the Trac server internally.
>
> Why can't you use that path directly in trac.ini? This looks too
> complicated to me anyway. Just write
>
> templates_dir = /home/claus/webapps/trac/.htdocs
>
> Still there should be a reason for having htdocs and templates separated
> in Trac environments by default, so I would hesitate to mix one into the
> other even in inherited folders, but YMMV.
>
> Steffen Hoffmann
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlAi20sACgkQ31DJeiZFuHfd9ACfVVw+2sZLOqLUVo+EVX7fuAfD
> ohgAnjzsCvUxUSZxSbS+fsttSd7pHRa1
> =grDv
> -----END PGP SIGNATURE-----
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/trac-users/-/SVEivJZomIAJ.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.


hoff.st at web

Aug 9, 2012, 12:33 PM

Post #4 of 4 (360 views)
Permalink
Re: Trac ignores 'templates_dir'-setting [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 09.08.2012 11:26, schrieb mutetella:
> it works proper. Thank you.

Fine, you're welcome.

> I used the Apache-alias '/htdocs' first, because under the [trac]-section a
>
> htdocs_location = /home/claus/webapps/trac/.htdocs
>
> or under the [header_logo]-section a
>
> src = /home/claus/webapps/trac/.logos/logo_wiki_400x100.png
>
> don't work, only an Apache-alias get me further here.

Well, this is static content --> htdocs.

> Is this so because 'templates_dir' will be used from genshi directly
> whereas 'htdocs_location' or the logo-src are trac-internal settings?
>
> Can you give me an explanation?

As written before, templates are actually processed by the server (Trac
and Genshi), yes.

htdocs' resources (CSS, images, JavaScript, etc.) are just referenced in
XTHML pages and served by whatever you use for serving your static web
content, Apache, any other web server or Trac's own code - tracd.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAkEJoACgkQ31DJeiZFuHf0tQCgzAMSYXSALSmVfLzrxmrfp/hE
BSUAn20iJ/N8YFi7nOKqcBZv+gd7+Q93
=nQ95
-----END PGP SIGNATURE-----

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.