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

  • Home
  • SEARCH
  • 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 4019504
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:06:45+00:00 2026-05-20T10:06:45+00:00

In hook_css_alter, I want to disable style-sheets on specific pages. Was ok for the

  • 0

In hook_css_alter, I want to disable style-sheets on specific pages.
Was ok for the front page requirement with following snippet:

function morin_css_alter(&$css) {
  if(drupal_is_front_page()){
    foreach ($css as $data => $item) {
      unset($css[$data]);
    }
  }
}

Now I need to remove specific styles on a photo-album page. I have thought of a few ways to do this, but I’d like to do it the drupal way.

The closest function I have found to do this is drupal_get_destination() ,
I don’t think it’s meant for this but it does return the current path in an array, as shown by the following snippet added in css_alter hook.

echo " PATH = " . var_dump(drupal_get_destination());

Output: PATH = array(1) { ["destination"]=> string(6) "photos" }

Is this the recommended way of getting the path from inside a function/hook, or is there some variable in global namespace I should use instead?

  • 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-05-20T10:06:46+00:00Added an answer on May 20, 2026 at 10:06 am

    You want http://api.drupal.org/api/drupal/includes–bootstrap.inc/function/request_path/7.

    For Drupal 6, one has to use $_GET['q'].

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

Sidebar

Related Questions

I'm looking for a way to force drupal to use 1.4 on specific pages.
I want to hide the default Wordpress home page from my website navigation http://www.dawaf.co.uk/es/portraits
For my favorite modes, I use the following snippet to load hs-minor-mode on startup:
<?php /** hook_menu **/ function example_contact_form_menu() { return array( 'contact_form_test' => array( 'page callback'
Trying to hook into the function comment_text() supplied by Wordpress API to wrap the
I have used hook_form_FORM_ID_alter( ) function to alter a menu_edit_menu form to add few
I'm trying to hook the SetCooperativeLevel function in the DirectDraw object. My goal is
How do I hook a custom function, so that on label click, the same
as the title describes, I am to style a webform and for that i
I am using colorbox to AJAX some external HTML onto a page. My client

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.