Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Ability to create multiple stylesheets #2

Open
ashsmith opened this issue Apr 19, 2016 · 1 comment
Open

Ability to create multiple stylesheets #2

ashsmith opened this issue Apr 19, 2016 · 1 comment

Comments

@ashsmith
Copy link
Contributor

Ideally, we should be able to specify which page handles to apply configuration generated css applies to, and the ability to implement multiple stylesheets.

For example, if generated CSS is to be used on the catalog_product_view handle, then that should be the only place that CSS is loaded.

I'd propose changing Meanbee_ConfigPoweredCss_Block_Css to inherit from Mage_Core_Block_Text_List and for child blocks to be implemented based on xml configuration where you can also specify what handles should be applied. i.e.

<config>
....
<default>
    <meanbee_configurationpoweredcss>
        <css_blocks>
            <default_css>
                <block_type>namespace_module/config_css_default</block_type>
                <handles>default</handles>
            </default_css>
            <products_css>
                <block_type>namespace_module/config_css_products</block_type>
                <handles>catalog_product_list,catalog_product_view</handles>
            </products_css>
        </css_blocks>
    </meanbee_configurationpoweredcss>
</default>
</config>

Thoughts?

@bobbyshaw
Copy link
Member

I can see this being beneficial though I don't have a complete idea of how this would be implemented yet.

My thoughts:

  • Is there a use case for needing a custom block type? We could modify it to be able to pass the page handle and it would generate a file based on that handle.
  • The generation process goes through each store, loads our block and saves the output of the _toHtml() to a file. This would need to change to presumably create a file for every page handle in your list that's saved in config.
  • You would then need a template for each page handle defined, so you would need to be aware to create a file in base/default, e.g. app/design/frontend/base/default/template/meanbee/configpoweredcss/catalog_product_view/css.phtml
  • The css files generated would then be skin/frontend/base/default/css/<page_handle>/meanbee_configpoweredcss_<store_id>.css

Does at a fair bit of complexity to it. I think we should be careful when adding this in to allow people to generate one file by default that's included on every request and still facilitate this functionality for those that would like it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants