Global Trac-Wiki Images

9 views
Skip to first unread message

bejot22

unread,
Nov 29, 2011, 10:12:39 AM11/29/11
to Trac Users
Hello again,

I am looking for a solution to show a specific image on almost every
wiki-page.
To do this I just want do add something like [[Image(everywhere.png)]]
to the wiki-pages.
But unfortunately this does not work.
It is not possible to define globally available images.
To solve this problem I created a Ticket with all images.
Then I added to the following string to the specific wiki-pages:
[[Image(/raw-attachment/ticket/546/everywhere.png)]]
Is there a possibility to make my "everywhere.png" globally available
so I do not need to specify a path?

Thank you in advance!
bejot22

Cooke, Mark

unread,
Nov 29, 2011, 10:33:03 AM11/29/11
to trac-...@googlegroups.com
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of bejot22
> Sent: 29 November 2011 15:13
> To: Trac Users
> Subject: [Trac] Global Trac-Wiki Images
>
> Hello again,
>
> I am looking for a solution to show a specific image on almost every
> wiki-page.
> To do this I just want do add something like [[Image(everywhere.png)]]
> to the wiki-pages.
> But unfortunately this does not work.

...my trac's copy of WikiMacros says:-

The first argument is the file specification. The file specification may reference attachments in three ways:
module:id:file, where module can be either wiki or ticket, to refer to the attachment named file of the specified wiki page or ticket.
id:file: same as above, but id is either a ticket shorthand or a Wiki page name.
file to refer to a local attachment named 'file'. This only works from within that wiki page or a ticket.

...so I am guessing what you probably need is something like:
{{{
[[Image(wiki:MyWikiPage:everywhere.png)]]
}}}

~ mark c

bejot22

unread,
Dec 13, 2011, 8:13:06 AM12/13/11
to Trac Users
Hi Marc,

thank you for your response.
I solved the problem through copying the file everywhere.png to
"/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/
htdocs" (in my case).
Now I was able to link like this: "[[Image(/chrome/common/
everywhere.png)]]".
Thanks again!

Sincerly yours
bejot22

> > bejot22- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Cooke, Mark

unread,
Dec 14, 2011, 4:56:56 AM12/14/11
to trac-...@googlegroups.com
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of bejot22
> Sent: 13 December 2011 13:13
> To: Trac Users
> Subject: [Trac] Re: Global Trac-Wiki Images
>
> Hi Marc,
>
> thank you for your response.
> I solved the problem through copying the file everywhere.png to
> "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/
> htdocs" (in my case).

...and what happens when you next upgrade Trac? I'm not sure if your package manager would remove that file... If you use the `absolute` page attachment path then the image stays with the wiki data (especially if you need to move the data to a new server).

~ mark c

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

osimons

unread,
Dec 14, 2011, 6:57:58 AM12/14/11
to Trac Users

As Mark says, it is a bad idea to put files into the Trac egg. Instead
put the image in the project htdocs directory (ie. /path/to/
your_project/htdocs/), then you can reference it as:

[[Image(htdocs:everywhere.png)]]


:::simon

https://www.coderesort.com
http://trac-hacks.org/wiki/osimons

Reply all
Reply to author
Forward
0 new messages