[publican-list] Including common content in custom brand

Jeff Fearn jfearn at redhat.com
Thu Oct 2 22:56:06 UTC 2014


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

On 10/02/2014 11:48 PM, Petr Kovar wrote:
> Hi,
> 
> I'm trying to integrate a Publican book with an existing (Django-based) website [1] and was wondering if there is a way to modify my own Publican brand (or templates) so that I could include parts of the website
> common content such as footer or header in the html(-single) output generated by Publican.
> 
>> From what I can gather from skimming through the Publican User Guide, it
> looks like I can only customize the brand's CSS but not really inject my own HTML.

Hi Petr, you can do this in your brand.

If you want a site wide footer you can edit the site footer [1].

For different footers per page you need to override the XSL. Basically you add xsl/html-single.xsl to your brand, import the publican html-single xsl in it, and then override one of the footer template.

Here is an example of a brand that just changes the toc content for html-single [2].

For the footer content you can probably get away with overriding user.footer.content. You can look at the one in /usr/share/publican/xsl/xhtml-common.xsl for an idea of how it works.

For the header you can look at overriding user.header.content, or if you want to really change the page layout then look at overriding '<xsl:template match="*" mode="process.root">', checkout the version in
/usr/share/publican/xsl/html-single.xsl to see how it works.

Cheers, Jeff.

1: https://jfearn.fedorapeople.org/en-US/Publican/4.2/html/Users_Guide/Auto_Docs_Configs-Site_option.html#footer
2: https://git.fedorahosted.org/cgit/publican-fedora.git/tree/xsl/html-single.xsl

- -- 
Jeff Fearn
Senior Software Engineer
GSS Subscriber Platform
Red Hat Pty Ltd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJULdgGAAoJELs3R4zxGZvKYWEH/i7BCyMLM7iAqy6+AANDgLsL
oxhBkSJvJt9T7kE71kNVD/Gr281rnqEMFDDwjtI/bC1cc1d4jVUmfwsXQ8xEbiOY
dixASKb6vRqsJ9V4upK+XRmXZWk7BIRxKJdSsJ3yx5FU1ud6ExNRSEzJ00CZSMij
GQL+lcKGfudP4w+PAwBu5zqjkoN+ZkQa/+nOzmF1X4yvTeJndSLTDIVc8c57Eyr+
dsl3xXFYZIYKFiQdQ0/dInTBOeeGo1txsy8pSzYbqUsJcl69YYNcNdgvaLkbiCDg
lvOw6zKk7omwK0NxSwOaBrCfe8W06SFZ7t4ieexxw+JYq//QYK7v+/wpy8j8n/M=
=CrEl
-----END PGP SIGNATURE-----




More information about the publican-list mailing list