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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:38:52+00:00 2026-05-27T03:38:52+00:00

I am using display suite to display a full node of type ‘Article’. I

  • 0

I am using display suite to display a full node of type ‘Article’. I want to add some css and js on the page containing the article node, though the adding of these can’t be dependent on the themeing. So I cannot use the template.php file

How would I be able to do this ?

  • 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-27T03:38:53+00:00Added an answer on May 27, 2026 at 3:38 am

    Create a new module and put it in: /sites/all/modules/custom

    The module structure and files would look like this:

    ahelper/
    ahelper/css/article_node.css
    ahelper/js/article_node.js
    ahelper/ahelper.info
    ahelper/ahelper.module
    

    ahelper/ahelper.info

    core = "7.x"
    name = "Article Helper"
    project = "ahelper"
    version = "7.x-1.0"
    

    ahelper/ahelper.module

    <?php
    /**
     * Implements hook_node_view()
     */
    function ahelper_node_view($node, $view_mode, $langcode) {
      // if node is an article, and we're looking at a full page view
      if ($node->type == 'article' && $view_mode == 'full') {
        // then add this javascript file
        drupal_add_js(drupal_get_path('module', 'ahelper') .'/js/article_node.js');
        // and add this css file
        drupal_add_css(drupal_get_path('module', 'ahelper') .'/css/article_node.css');
      }
    }
    

    Then just enable the module. You can play around with the node_view hook.

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

Sidebar

Related Questions

Using HTML and CSS. I have text surrounded by a border using display:inline to
I have an associative array that I want to display using TileList. However, it
I have a 16 bit grayscale image that I want to display using WPF
I'm using timthumb to display a full screen gallery slider in a wordpress site.
I'm using the Repeater control on my site to display data from the database.
My drupal site (internal) will not display the TinyMCE editor when using Google Chrome
I am using Direct3D to display a number of I-sections used in steel construction.
I am using CGContextShowText to display text, but when rotating it using CGAffineTransformation ,
I am using DateField to display the Date and Time in my Blackberry Program,if
I'm using xslt do display Solr response in html, my xsl file is in

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.