Change css of catalog

35 views
Skip to first unread message

ke...@lumenlearning.com

unread,
Jul 6, 2015, 8:38:09 PM7/6/15
to press...@googlegroups.com
I'm trying to modify the catalog view (update Pressbooks name in corner, change background color of sidebar, adjust some other details), but can't find how to get Pressbooks to use my custom css.  I understand how to do this for individual books, but can't seem to find where to include my files to make the style-catalog.css available.

Thanks for any direction!
Kelly

Hugh McGuire

unread,
Jul 6, 2015, 11:28:09 PM7/6/15
to ke...@lumenlearning.com, press...@googlegroups.com
not sure what you are wanting to do, but the catalog.css file should be at:
~plugins/pressbooks/assets/css/style-catalog.css

see:
https://github.com/pressbooks/pressbooks/blob/f3ef656c0b4e43bc110c609e09643db5df8be403/assets/css/style-catalog.css

> --
> You received this message because you are subscribed to the Google Groups "Pressbooks" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pressbooks+...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pressbooks.




--
---------------------------------------------------------------
hughmcguire.net | twitter.com/hughmcguire
skype. h.mcguire | tel. +1.514.464.2047
---------------------------------------------------------------

ke...@lumenlearning.com

unread,
Jul 7, 2015, 11:39:15 AM7/7/15
to press...@googlegroups.com, ke...@lumenlearning.com
Right.  I'm trying to modify it without hacking the pressbooks core though, so that we don't overwrite our changes when we pull down updates to pressbooks. 
Thanks!

nick

unread,
Jul 7, 2015, 12:05:15 PM7/7/15
to press...@googlegroups.com
Sounds like you need a plugin that allows your custom CSS to be enqueued separately after the Pressbooks CSS:

https://wordpress.org/plugins/simple-custom-css/

If you want that CSS to be global and apply to all sites, then you’d want to look at a “network activated" custom plugin (or a must use plugin) that just enqueues your override styles.

_________________________
Nick Ciske
VP Web Engineering
http://cimbura.com
@nciske

ke...@lumenlearning.com

unread,
Jul 8, 2015, 3:11:34 PM7/8/15
to press...@googlegroups.com, ke...@lumenlearning.com
It seems to me like the class-pb-catalog.php file (lines 903-917) should be allowing me to make changes to the template and then to the CSS via:
if ( $overridden_template = locate_template( 'pb-catalog.php' ) ) {
load_template( $overridden_template, true );

But, I've tried all kinds of places to put the files (style-catalog.css and pb-catalog.php), but can't seem to make a change in anything without hacking the pressbooks core.  Thoughts?

Thanks so much for any help.

Kelly

On Monday, July 6, 2015 at 8:28:09 PM UTC-7, Hugh McGuire wrote:

Joseph Flowers

unread,
Jul 8, 2015, 4:06:31 PM7/8/15
to press...@googlegroups.com
Have you tried putting a copy of pb-catalog.php into themes-root/pressbooks-publisher.  That works for me.  the version of PB I'm running was forked ~ a month ago but I imagine it will still work

ke...@lumenlearning.com

unread,
Jul 8, 2015, 4:08:31 PM7/8/15
to press...@googlegroups.com
If you pull down their latest version some time in the future, won't your changes be overwritten though?

Joseph Flowers

unread,
Jul 8, 2015, 4:21:59 PM7/8/15
to press...@googlegroups.com
I don't think so ... their version of the file lives in includes/ but via the code you posted they are allowing a separate copy to live in the directory I mentioned, and that one will get used first.  If you pull the latest code down from github, it should only change files that are in the git repo unless you were to delete and start from scratch.  I can't guarantee anything but that's the best suggestion I got :)

ke...@lumenlearning.com

unread,
Jul 8, 2015, 4:31:03 PM7/8/15
to press...@googlegroups.com
Ok.  I'll give it a try!

ke...@lumenlearning.com

unread,
Jul 8, 2015, 5:03:31 PM7/8/15
to press...@googlegroups.com
Thanks for your help.  Although I would ideally not be doing it within Pressbooks itself, that seems to do the trick.  And, definitely is a better option than I had before your suggestion!  :)
Thanks,
Kelly
Reply all
Reply to author
Forward
0 new messages