Re: CSS hook

Sebastian Birnbach <[email protected]> Fri, 28 Jul 2017 12:59:18 +0200
Newsgroups gmane.comp.horde.devel
Message-ID <CACTNBFNNFCNmaooO_7XYhLsRyDnKmkrFjYxVKyJ5MmDTUg4jXg@mail.gmail.com>
2017-07-26 21:38 GMT+02:00 Sebastian Birnbach <[email protected]>:

> I am working on a whups Block for which I want to use custom CSS
> definitions.
>
> I created a whups/themes/default/dossier.css file
> I also created a loader function in whups/config/hooks.php:
>
> ...
>     public function cssfiles($theme)
>     {
>         return array(
>             '/usr/local/www/apache24/data/whups/themes/default/dossier.css'
> =>
>             'whups/dossier.css'
>         );
>      }
> ...
>
> The loader function does get executed no problem but there seems to be a
> missing step. How do I use the URI inside the Block to make the CSS file
> load? (Sorry if this is a trivial question, I'm still working my way
> through the application stack)
>

It got better when I re-enabled JS caching and temporarily disabled
CSS-caching. I started to see the CSS inclusion statements in HTML source
and could debug from there.

The URI needs to match the file location when requested from the webserver
of course.
In the above example the URI should be "/whups/themes/default/dossier.css".
Beats me why both the file location and the URI are relevant in the hook,
though.

Case closed, thanks to all.
-- 
dev mailing list
Frequently Asked Questions: http://wiki.horde.org/FAQ
To unsubscribe, mail: [email protected]