[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trac
Subject:    Re: [Trac] Re: shared templates and htdocs
From:       RjOllos <rjollos () gmail ! com>
Date:       2019-07-06 3:41:05
Message-ID: 76b1309b-aa17-4f24-b429-7ae9643888db () googlegroups ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Thursday, November 15, 2018 at 3:01:19 AM UTC-8, Clemens Feige wrote:
> 
> RjOllos wrote on 14.11.2018 at 21:53: 
> > On Wednesday, November 7, 2018 at 2:35:10 AM UTC-8, Clemens Feige wrote: 
> > > 
> > > Hello 
> > > 
> > > I like to ask for help concerning placement of shared templates and 
> > > htdocs. How can I share one common <site.html> and one common 
> > > <style.css> file across multiple TRAC repositories? 
> > > 
> > > I have read the docu (TracIni, TracInterfaceCustomization and others) 
> > > but cannot get it working. My current workaround is to copy the 
> > > <site.html> <style.css> many times into each repo. 
> > > 
> > > I am using TRAC 1.2.2 on Linux. 
> > > 
> > > This is my desired directory structure: 
> > > /data/trac/trac.global.ini 
> > > /data/trac/htdocs/style.cs 
> > > /data/trac/templates/site.html 
> > > /data/trac/plugins/<plugin eggs are here> 
> > > ... then a bunch of repos: 
> > > /data/trac/repos/myrepo1/ 
> > > /data/trac/repos/myrepo2/ 
> > > 
> > > This is how I import the CSS file from the <site.html> 
> > > <link rel="stylesheet" href="${href.chrome('site/style.css')}" /> 
> > > 
> > > This is what I put in the trac.ini of each repo: 
> > > [inherit] 
> > > file = /data/trac/trac.global.ini 
> > > plugins_dir = /data/trac/plugins 
> > > htdocs_dir = /data/trac/htdocs 
> > > 
> > > Please advice. 
> > > 
> > > Thanks 
> > > Clemens 
> > > 
> > 
> > You probably need to set [inherit] templates_dir: 
> > https://trac.edgewall.org/wiki/TracIni#inherit-templates_dir-option 
> > 
> > Do you find style.css when you navigate to?: 
> > /chrome/shared/style.css 
> > 
> > It looks like you need to substitute "shared/style.css" for 
> > "site/style.css" in your template. 
> > 
> > - Ryan 
> > 
> 
> Thanks Ryan. 
> 
> Your hints were very helpful and solved my issue. 
> 
> I did as you said: 
> I added "[inherit] templates_dir" to the trac.ini of each repo: 
> 
> [inherit] 
> file = /data/trac/trac.global.ini 
> plugins_dir = /data/trac/plugins 
> templates_dir = /data/trac/templates 
> htdocs_dir = /data/trac/htdocs 
> 
> ... and in site.html changed to: 
> <link rel="stylesheet" href="${href.chrome('shared/style.css')}" /> 
> 
> The CSS is now found at URL /chrome/shared/style.css 
> 
> Thanks again 
> Clemens 
> 

Edited page to make a section for information on Sharing Templates:
https://trac.edgewall.org/wiki/1.3/TracInterfaceCustomization?action=diff&version=5

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac \
Users" group. To unsubscribe from this group and stop receiving emails from it, send \
an email to trac-users+unsubscribe@googlegroups.com. To post to this group, send \
email to trac-users@googlegroups.com. Visit this group at \
https://groups.google.com/group/trac-users. To view this discussion on the web visit \
https://groups.google.com/d/msgid/trac-users/76b1309b-aa17-4f24-b429-7ae9643888db%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


[Attachment #5 (text/html)]

<div dir="ltr"><br><br>On Thursday, November 15, 2018 at 3:01:19 AM UTC-8, Clemens \
Feige wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: \
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">RjOllos wrote on 14.11.2018 at \
21:53: <br>&gt; On Wednesday, November 7, 2018 at 2:35:10 AM UTC-8, Clemens Feige \
wrote: <br>&gt;&gt;
<br>&gt;&gt; Hello
<br>&gt;&gt;
<br>&gt;&gt; I like to ask for help concerning placement of shared templates and
<br>&gt;&gt; htdocs. How can I share one common &lt;site.html&gt; and one common
<br>&gt;&gt; &lt;style.css&gt; file across multiple TRAC repositories?
<br>&gt;&gt;
<br>&gt;&gt; I have read the docu (TracIni, TracInterfaceCustomization and others)
<br>&gt;&gt; but cannot get it working. My current workaround is to copy the
<br>&gt;&gt; &lt;site.html&gt; &lt;style.css&gt; many times into each repo.
<br>&gt;&gt;
<br>&gt;&gt; I am using TRAC 1.2.2 on Linux.
<br>&gt;&gt;
<br>&gt;&gt; This is my desired directory structure:
<br>&gt;&gt;      /data/trac/trac.global.ini
<br>&gt;&gt;      /data/trac/htdocs/style.cs
<br>&gt;&gt;      /data/trac/templates/site.<wbr>html
<br>&gt;&gt;      /data/trac/plugins/&lt;plugin eggs are here&gt;
<br>&gt;&gt; ... then a bunch of repos:
<br>&gt;&gt;      /data/trac/repos/myrepo1/
<br>&gt;&gt;      /data/trac/repos/myrepo2/
<br>&gt;&gt;
<br>&gt;&gt; This is how I import the CSS file from the &lt;site.html&gt;
<br>&gt;&gt;      &lt;link rel=&quot;stylesheet&quot; \
href=&quot;${href.chrome(&#39;site/<wbr>style.css&#39;)}&quot; /&gt; <br>&gt;&gt;
<br>&gt;&gt; This is what I put in the trac.ini of each repo:
<br>&gt;&gt;      [inherit]
<br>&gt;&gt;      file = /data/trac/trac.global.ini
<br>&gt;&gt;      plugins_dir = /data/trac/plugins
<br>&gt;&gt;      htdocs_dir = /data/trac/htdocs
<br>&gt;&gt;
<br>&gt;&gt; Please advice.
<br>&gt;&gt;
<br>&gt;&gt; Thanks
<br>&gt;&gt; Clemens
<br>&gt;&gt;
<br>&gt; 
<br>&gt; You probably need to set [inherit] templates_dir:
<br>&gt; <a href="https://trac.edgewall.org/wiki/TracIni#inherit-templates_dir-option" \
target="_blank" rel="nofollow" \
onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftrac.edgewal \
l.org%2Fwiki%2FTracIni%23inherit-templates_dir-option\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHrK2ONLUYnUxBFlEIUfJ7xITaTJg&#39;;return \
true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Ftrac.edge \
wall.org%2Fwiki%2FTracIni%23inherit-templates_dir-option\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHrK2ONLUYnUxBFlEIUfJ7xITaTJg&#39;;return \
true;">https://trac.edgewall.org/<wbr>wiki/TracIni#inherit-<wbr>templates_dir-option</a>
 <br>&gt; 
<br>&gt; Do you find style.css when you navigate to?:
<br>&gt; /chrome/shared/style.css
<br>&gt; 
<br>&gt; It looks like you need to substitute &quot;shared/style.css&quot; for
<br>&gt; &quot;site/style.css&quot; in your template.
<br>&gt; 
<br>&gt; - Ryan
<br>&gt; 
<br>
<br>Thanks Ryan.
<br>
<br>Your hints were very helpful and solved my issue.
<br>
<br>I did as you said:
<br>I added &quot;[inherit] templates_dir&quot; to the trac.ini of each repo:
<br>
<br>[inherit]
<br>file = /data/trac/trac.global.ini
<br>plugins_dir = /data/trac/plugins
<br>templates_dir = /data/trac/templates
<br>htdocs_dir = /data/trac/htdocs
<br>
<br>... and in site.html changed to:
<br>   &lt;link rel=&quot;stylesheet&quot; \
href=&quot;${href.chrome(&#39;shared/<wbr>style.css&#39;)}&quot; /&gt; <br>
<br>The CSS is now found at URL /chrome/shared/style.css
<br>
<br>Thanks again
<br>Clemens
<br>
</blockquote><div><br></div><div>Edited page to make a section for information on \
Sharing Templates:</div><div>https://trac.edgewall.org/wiki/1.3/TracInterfaceCustomization?action=diff&amp;version=5</div><div><br></div><div>- \
Ryan<br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &quot;Trac \
Users&quot; group.<br /> To unsubscribe from this group and stop receiving emails \
from it, send an email to <a \
href="mailto:trac-users+unsubscribe@googlegroups.com">trac-users+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:trac-users@googlegroups.com">trac-users@googlegroups.com</a>.<br /> \
Visit this group at <a \
href="https://groups.google.com/group/trac-users">https://groups.google.com/group/trac-users</a>.<br \
/> To view this discussion on the web visit <a \
href="https://groups.google.com/d/msgid/trac-users/76b1309b-aa17-4f24-b429-7ae9643888d \
b%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/trac-users/76b1309b-aa17-4f24-b429-7ae9643888db%40googlegroups.com</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic