Jump to content

CSS support for Hooks

Featured Replies

Posted

Hooks already support templates but what about CSS files?

Adding CSS files manually in the hook package won't add them in DB and so you can't edit those files from ACP using the built-in editor, and using an FTP program to edit them defeats the purpose of the new IPB3 editor.

Also Alex made a hook for REP. It said place in master_CSS. That did nothing. I had to place in css_1 to work, so whats the purpose of master_css if it doesn't load the CSS files from there?

Or is that for IN_DEV, while css_1 is for non IN_DEV

  • Author

It is exactly because I saw the hook made by alex for REP system that I made this topic lol


Anyway master_css is used only for IN_DEV mode

I spoke to Brandon about it when I made that hook, hooks should support adding CSS files in a future version (3.x) for example. It's just one of those annoyances that'll you'll have to upload it to every CSS folder on your site.

It's not a perfect solution, but another option is hook into the includecss hook in globalTemplate->includeCSS, and manually insert a style tag with your css.

Or in your hook code you can do addToDocumentHead() as includecss pointing to the proper location. Then you could upload the CSS anywhere and the source code could map to it.

bfarber: You can't use addToDocumentHead() from a hook, since templateHooks() are dealt with after fetchOutput(), which deals with all those things.

  • Author

The problem is not to load the CSS but to have a different CSS for each skin editable in ACP :P

[quote name='m4rtin' date='01 June 2009 - 10:29 AM' timestamp='1243866552' post='1806742']
bfarber: You can't use addToDocumentHead() from a hook, since templateHooks() are dealt with after fetchOutput(), which deals with all those things.


Ah yes (at least for template hooks - overloaders you can use the method). Think we have an open discussion about that somewhere, either internally on a wish list or in the bug tracker FFFV.

  • 1 year later...

Was it implemented? As much as I can see, in last 1 year & 3 month that "new version" is not out still :)

  • Author

Yes you can now export CSS files exporting an hook, it was added in 3.1.0.

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.