Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8119425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:47:58+00:00 2026-06-06T04:47:58+00:00

I am developing a CMS so I need each respective site’s global css file

  • 0

I am developing a CMS so I need each respective site’s global css file to be stored in a database and loaded. I have a controller called util and the method is called sitecss. So my main wrapper view looks like this:

<link rel="stylesheet" type="text/css" href="/util/sitecss">

The css loads, but has no effect. If I view source on the page, and then click on the link, I can see the css just fine. So I know it is being loaded. Is it something about it not coming from a file? Or perhaps the browser assuming it is cached when it is not?

If I make a static file and change to above to

<link rel="stylesheet" type="text/css" href="/css/site.css">

everything works just fine. If I do this in .NET with a handler ashx file, it works fine. It is in php with Codeigniter that I am having the problem. I know someone will ask “why don’t you just make static files?” and the answer is, it is not practical for this application. This is for thousands of sites with very rapid deployment.

Thanks in advance!

EDIT:

My controller method looks like this:

function sitecss() {
    $cssdata = $this->cmsutils->loadCss($this->session->userdata('sitecss'));
    echo $cssdata;
}

So can I just echo a mime-type first? It doesn’t seem like this will work as I am making this call within the

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:48:00+00:00Added an answer on June 6, 2026 at 4:48 am

    write a caching library to pull from the database and create a css file in a cache folder.

    You will need:

    Library Class

    • Interact with the css and create a form to perform CRUD
    • handle cache file monitoring CRUD (every hour or, even on every C,U,D of the form)
    • Inject the stylesheet cache file into the DOM view

    Model

    • Interact with the database and perform CRUD operations
    • return data to the Controller for creating the cache file

    View

    • parse out the values into a css stylesheet file format

    The other option is to define a mime type with a controller and just load a view with the stylesheet properly formatted. No writing to the filesystem or anything.. Add a .css extension to the end of the URI and call it good…


    I do this exact same thing for an app that I just released. I have a form in a view on the admin section of the app that has specified textfields. The user inputs hexadecimal color codes and then it saves/updates the data in the database. The library then creates a cached css file that is referenced in the header view. We did this to eliminate the need for us to add a .gitignore file in a special directory when we deploy the app to several clients.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I am currently developing a Java front end for an Enterprise CMS database
I'm developing a MVC .Net site and would like to implement a CMS system.
Developing a project of mine I realize I have a need for some level
I just inherited a site built on the mojoPortal CMS but we don't have
I have, for a while now been using a reset.css file to reset everything
I am developing a CMS that stores user content in a database table like
I'm developing a CMS that required i18n support. The translation strings are stored as
I'm developing CMS application in C#(4.0 Framework) which connects to MySQL database (5.0.95) on
I am developing a very simple CMS system for my brother's web site. I
I'm developing a CMS (with Django, but that doesn't matter) and have chosen GIT.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.