This question has been flagged
3 Replies
11992 Views

I want to makes some modifications to the CSS for the standard Blog in the Website builder.  Does anyone know where those CSS files for the Themes are located??

Avatar
Discard

/odoo/addons/website_blog/static/src/css/website_blog.css

Thanks Luke

Best Answer

You can find the CSS, XML, and JS for the blog in:

XML:
/addons/website_blog/views/
/addons/website_blog/static/src/xml

CSS:

/addons/website_blog/static/src/css

JS:

/addons/website_blog/static/src/js

I'd recommend leaving the core files alone, as otherwise you will lose your changes when you upgrade the module in the future.

You can refer to the following guide as a reference for inheriting and over-riding the standard CSS, XML, and JS:

https://www.odoo.com/forum/help-1/question/new-bootstrap-theme-on-website-builder-58809

What i'd recommend is creating a new, very basic module to override/replace the core files with your own modified files for the blog. You can do this by following the instructions below:

  1. Create a new directory in your addons directory for your module (eg. website_blog_mark)
  2. create an empty __init__.py file in that folder (this can be used to add python logic to your module later, but will be uneccessary for your current requirements)
  3. create an __openerp__.py with the following in it (you can change my customisations such as Blog CSS Mark Wells, etc.):

    {

    'name': 'Blog CSS Mark Wells',

    'category': 'Website',

    'website': 'http://www.YOURWEBSITEHERE.com',

    'summary': 'News, Blogs, Announces, Discussions',

    'version': '1.0',

    'description': """

    Mark Wells Blog

    ============

    """,

    'author': 'Mark Wells',

    'depends': ['website_blog'],

    'data': [

    'data/theme.xml',

    ],

    'installable': True,

    'application': True,

    }

  4. create a subdirectory in your theme called data
  5. create a file in data called theme.xml
  6. put the following content in theme.xml:
    <?xml version="1.0" encoding="UTF-8"?>
  7. follow the instructions in the forum post link i've provided to either replace the files with your own custom css, js, and xml using xpath to inherit and replace files, or parts of files
  8. create a subdirectory in your modules root directory called static (eg. /addons/website_blog_mark/static)
  9. create subdirectories for css, js, xml, or whatever else you'd like to put into your module.
  10. in your theme.xml file you can add your custom css and js as required by using the module's path (eg. website_blog_mark/static/css/mark_theme.css)

Feel free to post back in the comments if you have any more questions.

Avatar
Discard

How can I access/change it (the CSS file) using the Website Builder - Web Interface?