Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2015
    Posts
    725
    Plugin Contributions
    1

    Default Encapsulated Plugin - CSS concerns

    This is just my opinion regarding the encapsulated plugins. I feel like this was not the best approach. Burying CSS inside isolated plugin directories is a massive step backward for the front-end workflow. It completely bypasses Zen Cart’s native template override system, meaning we lose that direct, 1-to-1 control over layouts that made the platform great. Instead of writing clean, modular styles, we're now stuck piling on redundant CSS. rules. It’s a mess that’s going to cause serious headache and maintenance issues for future site builds."

    I noticed this when i was working on my demo site. It was very easy to spot and so i felt i wanted to address the issue and get some feedback

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,925
    Plugin Contributions
    96

    Default Re: Encapsulated Plugin - CSS concerns

    Quote Originally Posted by chadlly2003 View Post
    This is just my opinion regarding the encapsulated plugins. I feel like this was not the best approach. Burying CSS inside isolated plugin directories is a massive step backward for the front-end workflow. It completely bypasses Zen Cart’s native template override system, meaning we lose that direct, 1-to-1 control over layouts that made the platform great. Instead of writing clean, modular styles, we're now stuck piling on redundant CSS. rules. It’s a mess that’s going to cause serious headache and maintenance issues for future site builds."

    I noticed this when i was working on my demo site. It was very easy to spot and so i felt i wanted to address the issue and get some feedback
    Depends on the plugin. POSM, for instance, provides a default set of CSS that's loaded, but if the site's specified an override then that version's loaded next (which could override the default values. See POSM's catalog/includes/classes/observers/class.products_options_stock_observer.php:
    Code:
            // -----
            // Look for any plugin's stylesheet, first in the as-distributed 'default'
            // and then for any overrides present in the site's active template.
            //
            $stylesheet = 'options_stock_styles.css';
            echo '<link rel="stylesheet" href="' . $this->getZcPluginDir() . DIR_WS_TEMPLATES . "default/css/$stylesheet" . '">' . "\n";
    
            $stylesheet_dir = $template->get_template_dir($stylesheet, DIR_WS_TEMPLATE, $current_page_base, 'css');
            $stylesheet_dir .= '/' . $stylesheet;
            if (!str_contains($stylesheet_dir, $this->getZcPluginDir()) && file_exists($stylesheet_dir)) {
                echo '<link rel="stylesheet" href="' . $stylesheet_dir . '">' . "\n";
            }

 

 

Similar Threads

  1. v210 Encapsulated Plugin
    By jodean in forum General Questions
    Replies: 2
    Last Post: 14 Feb 2025, 05:53 PM
  2. Encapsulated plugin, observer class loading javascript
    By torvista in forum Code Collaboration
    Replies: 2
    Last Post: 8 Feb 2025, 03:03 PM
  3. v210 pluginID of yet to be submitted encapsulated plugin?
    By retched in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 6 Dec 2024, 08:24 PM
  4. Encapsulated plugin installer timeout
    By pilou2 in forum Code Collaboration
    Replies: 2
    Last Post: 2 Nov 2024, 05:50 PM
  5. v201 How to override/modify an encapsulated Plugin
    By torvista in forum Contribution-Writing Guidelines
    Replies: 3
    Last Post: 29 May 2024, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg