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 8564197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:08:29+00:00 2026-06-11T17:08:29+00:00

In the situation where index page is the root for every request. And based

  • 0

In the situation where index page is the root for every request. And based on URL different page are served.

For now we use same name for CSS file as for page to be served.

But this fails where we want to use same CSS for a group of page or we don’t want a special CSS for a page common CSS is sufficient

Also array is suggest a solution but it seem to be unmanageable when site pages increase

  • 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-11T17:08:31+00:00Added an answer on June 11, 2026 at 5:08 pm

    A LUT would be the fastest way, although I think you need to seriously re-architect your app.

    Anyway on your index page you have some variable $pageName that says which page you want to load. The you can do something like this.

    $myPages = array(
       "somePage" => array("style_base.css", "custom_style1.css"),
       "otherPage" => array("style_base.css", "awesome_style.css")
       // more pages here
    );
    
    foreach( $myPages[$pageName] as $pageStyleSheet ) {
        echo '<link href="' . $pageStyleSheet . '" rel="stylesheet" type="text/css">' . PHP_EOL;
    }
    

    Just so you know this is super hacky and if I had to maintain your app, I would probably want to kill you. BUT it is the fastest way based on the architecture you described.

    UPDATE

    Another idea, but if you keep the stylesheet for every page based on the page name and use @include for the sheets you want to reuse. So for somePage.css you could have

    @include('otherPage.css')
    

    That way you can keep reflecting off the page name, but still reuse styles.

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

Sidebar

Related Questions

Situation: I have an index page which loads pages into it with ajax as
Okay, here is my situation. I have a page, index.php, which is the mainsite
I have a situation on a single page web application. I use address information
Situation: Google has indexed a page in a forum. The thread is now deleted.
Right, here's my situation, I have a form on a page (index.jsp) which submits
I'm renewing question. For simplify situation I've this script in index.php file <form name=f
Situation: My tooltips show up on my page. Opening my fancybox works. Doing the
Got myself in a funny situation: page has three tables. Using sortEnd, any time
I have an HTML page embedded inside another page. Now I would like to
Here's my situation : in the webapp, I use an interceptor to set the

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.