Inject CSS and JS files into Panels, Mini-Panels, Panels Everywhere
This module allows developers to Inject CSS & JS files into page based on Panels or into block based on Mini Panels. Also this module is useful feature if you building site theme using Panels Everywhere page template
Advantages:
- you don't need to push all CSS code into "style.css" file and all JS code into "script.js" file.
- you don't need to add CSS and JS files using theme ".info" file.
- you don't need to include files using drupal_add_css() and drupal_add_js() in template.php or in your custom module.
- you can inject CSS and JS files into pages based on Panels
- you can inject CSS and JS files into blocks based on Mini Panels.
- you can inject CSS and JS files into Panels Everywhere page template.
- you can use different types of placeholders to enter path to CSS or JS files instead of full path.
How to Inject Files:
- using "CSS & JS files" tab in the Page Manager (Structure -> Pages) when you configuring page based on Panels
- using ctools content type "CSS & JS files" under "Page elements" tab when you add new content to Panels or Mini-Panels
How to Use:
There are two textareas for CSS and JS files accordingly. Enter one file per line.
You can use "[module-{module_name}]" or "[theme-{theme_name}]" placeholders to get path to module/theme. You can use "[theme]" placeholder to get path to current page theeme.
Placeholders examples:
- [theme]/css/careers.css - path to current page theme
- [theme-zen]/js/careers.js - path to "Zen" theme
- [module-views]/views.css - path to "Views" module
Project Page: https://drupal.org/sandbox/webmasterslava/1644300
Git Repository: http://git.drupal.org/sandbox/webmasterslava/1644300.git
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxwebmasterslava1644300git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
webmasterslava commentedfixed
Comment #3
Darth Raven commentedpanel_css_js_fules.module
misspelling
theeme => theme
Comment #4
webmasterslava commentedfixed
Comment #5
cbudzi commentedSource Code looks clean to me.
Comment #6
kscheirerThis seems like a great module! Normally Panels makes you edit the template files to add custom css or js.
while (list($key, $value) = each($ops['children'])) {could probably be a foreach()?Setting to "needs work" for #1 and #2.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #7
webmasterslava commented1. I have replaced a lot of code with one small function but without using Tokens API, because module should search for dynamic placeholders like "[module-XXX]", "[theme-XXX]" where XXX is dynamic part that can be for example "views", "zen" etc. Also module should check if found module/theme exists on the site. All of that are impossible with Tokens API, so I implemented all the code with couple preg_match() and str_replace() functions.
2. String functions replaced with "drupal_" functions.
Comment #8
kscheirerSorry, you can't RTBC your own issue, "needs review" is the appropriate status after making fixes.
Comment #9
kscheirerThanks, that does look better.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #10
kscheirerIt's been a month without any further problems, so...
Thanks for your contribution, webmasterslava!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Crafted, Curated, Contributed.
Comment #11.0
(not verified) commenteddescription updated