Reviewed & tested by the community
Project:
Panels CSS & JS
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2015 at 20:17 UTC
Updated:
23 Feb 2018 at 00:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
osopolarPatch adds keyword substitution for css_code and js_code.
Comment #3
nwom commentedSadly #2 is a patch for the wrong module (and is most likely for a different issue). I'm eager to test out this patch! Setting back to Active for now. Thanks!
Comment #4
osopolarYou are right, I uploaded the wrong patch. Please check this one.
Comment #5
nwom commentedThank you very much for providing the patch! This will be a life saver.
However, when applying the patch, the following errors are shown:
I went ahead and fixed the whitespace errors in the attached patch.
With either patch applied, the following error is shown when navigating to the Panels CSS & JS configuration tab:
Notice: Undefined index: substitute in panels_css_js_code_js_edit_form() (line 146 of /var/aegir/platforms/drupal-7.56/sites/SITE/modules/panels_css_js/panels_css_js.module).Also, only one "Use context keywords" is shown. The checkbox is only shown under CSS code, and not under JS code.
Setting to needs work for now.
Comment #6
nwom commentedHere is a new patch that fixes the second checkbox from not showing up, and also fixes the watchdog "Undefined Index" notices from showing. Please review.
Comment #7
nwom commentedFound another issue. After enabling one checkbox, both checkboxes instead are automatically checked. Enabling only one isn't possible, and disabling both of them is no longer possible after enabling one.
The whitespace issue is also back oddly enough.
Comment #8
nwom commentedHere is another patch that fixes the check boxes not working correctly. This should clear up all of the issues I found. Please review.
Comment #9
nwom commentedIt appears only contexts are loaded from the entity, but not contexts available through a panels relationship. The same contexts can be otherwise loaded into custom content panes just fine.
Also, I just noticed that backslashes are automatically being removed when the contexts are used as js code. However, if the same contexts are loaded into custom content panes, the back slashes are rendered as expected.
Any ideas @osopolar?
Setting this back to Needs Work for now.
Comment #10
elamanFixed by using ctools_context_get_context_from_relationships to load relationships.
As for backslashes. Javascript treats them as a special character. For example
\tas tab,\sas space.If you want to use backslashes in text, please do
\\instead.Comment #11
nwom commented#10 works perfectly. Thanks!
Also thank you for the hint about the backslashes.