Announcement

Collapse
No announcement yet.

CSS Files, Resources, Combined Resources & Branches

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CSS Files, Resources, Combined Resources & Branches

    Trying to wrap my head around this to ensure I've got it.

    When I have a custom CSS file, what I do is:

    1. Add that file under CSS Resource by setting the type, file path, tag attributes and make sure it is global and active.
    2. From there, select that file, hit the three dots, and then Resource Group in the drop down.
    3. In the Resource Groups modal, I select Show All.
    4. Since this is a CSS file, it make sense to assign my CSS file to the css_list group.

    From there, the /mm5/json.mvc?Store_Code=STORE-CODE&Function=CSSResource_Output&CSSCombin edResource_Code file will pick it up and incorporate my CSS file contents into that CSS Combined Resource file automatically.

    Branch - Now when I create a new branch, that will automatically be in the new branch as well, because of the way it was assigned in #4 above. Correct?

    Not much info out there to explain all step by step, just portions here and there, so it only got me part of the way through in my quest to understand.

    Thanks!
    Jamie Donaldson
    JSDVS Web Design / Development
    Web Design | Web Development | E-commerce Design & Integration

    #2
    Originally posted by jsdva View Post
    From there, the /mm5/json.mvc?Store_Code=STORE-CODE&Function=CSSResource_Output&CSSCombin edResource_Code file will pick it up and incorporate my CSS file contents into that CSS Combined Resource file automatically.

    Branch - Now when I create a new branch, that will automatically be in the new branch as well, because of the way it was assigned in #4 above. Correct?
    Adding the CSS Resource to the css_list resource group will render the CSS file within the css_list item. For example in the Shadows framework the css_list item is rendered in the <head> tag on the individual page templates: https://github.com/search?q=repo%3Am...list&type=code

    So if you added the resource to the css_list that is where the <style> tag will render.

    The link you gave above is for the CSS resource that has the Combined Resource type. This resource is a single resource that will combine multiple resources, for example in the Shadows framework the CSS resource called stylesheet is a combined resource containing the core, extensions, and theme resources:

    combined.png

    When creating a new branch, if you copied the same branch then yes the assignments will remain the same.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      Originally posted by Nick View Post

      The link you gave above is for the CSS resource that has the Combined Resource type. This resource is a single resource that will combine multiple resources, for example in the Shadows framework the CSS resource called stylesheet is a combined resource containing the core, extensions, and theme resources:

      combined.png

      When creating a new branch, if you copied the same branch then yes the assignments will remain the same.
      Leads me to another question, would I want to add my CSS file to the Combined Resources? Is that acceptable? Or, is it better to put it in with the css_list?

      Sorry if this seems daft.

      Thanks.
      Last edited by jsdva; 10-20-25, 09:45 AM. Reason: clarity
      Jamie Donaldson
      JSDVS Web Design / Development
      Web Design | Web Development | E-commerce Design & Integration

      Comment


        #4
        jsdva Yes it is acceptable, here are some benefits of Combined resources:
        • Performance: It reduces HTTP requests and parsing overhead by delivering multiple resources in one server-rendered response.
        • Caching Efficiency: Combined resources can be cached as a single versioned entity, minimizing partial cache invalidation across multiple files.
        Individual templates remain useful when:
        • Frequent Iteration or Overrides: Developers or store owners need to edit or override isolated templates via the Miva admin or IDE without rebuilding everything.
        • Debugging and Profiling: Individual files are easier to inspect and trace when diagnosing layout or variable scope issues.
        So it really depends on the CSS being added.
        Nicholas Adkins
        Technical Training Specialist / Miva, Inc.
        [email protected]
        https://www.miva.com/mivalearn

        Comment


          #5
          Thank you Nick for helping me understand! That makes perfect sense. Great teacher!!
          Jamie Donaldson
          JSDVS Web Design / Development
          Web Design | Web Development | E-commerce Design & Integration

          Comment

          Working...
          X