Re: [viewvc-users] Looking for a template variable
"C. Michael Pilato" <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.user |
|---|---|
| Organization | CollabNet, Inc. |
| Message-ID | <[email protected]> |
John Beranek wrote: > Sorry for the late reply, it took a while before I had time to try this. > It does work quite well except for one proviso. It seems you can't have > conditional parts of templates that use config variables that may or may > not be set. So, for example I couldn't do: > > [if-any cfg.general.mirror_site]blah[end] > > If 'mirror_site' wasn't defined in the config I would get a Python > backtrace. The way I've worked around it is something like: > > [is cfg.general.mirror_site "none"][else]blah[end] > > This still relies on the config variable being set, but at least it > allows sections to be turned off entirely by use of a special "none" value. ViewVC does support (and I can't believe I didn't think of this before) a generic key-value configuration store accessible to the templates. Search for "kv_files" in your viewvc.conf file. -- C. Michael Pilato <[email protected]> CollabNet <> www.collab.net <> Distributed Development On Demand ------------------------------------------------------ http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2501534 To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAku7X0IACgkQokEGqRcG/W75cACgz8gEu7uC0WAfL/B7QvuI8G16 uWoAnjwWiWSvQJiVSYmDEC+fXHUK3qD4 =Ao9P -----END PGP SIGNATURE-----