9

Try turning off javascript protection to allow the conditionals to parse: $config['protect_javascript'] = 'n'; Also, I would wrap the channel entries tag around the conditional like so: <script type="text/javascript"> ... {exp:channel:entries channel="products" disable="member_data|pagination" limit="1"} {if add_option_on=="On"} if (thisForm.os2....


7

Loading assets within an add-on can be tricky if you don't know how to do it properly. For instance, your code is likely failing because it's relying the CP (control panel) to serve the assets. So, if the CP class is not instantiated, your code will fail. I suggest you take a look at Theme Loader, my open source library I use for all my add-ons. It works ...


7

Go to line 706 in /system/expressionengine/third_party/campaigner/ext.campaigner.php and change it from: $this->EE->javascript->generate_json($js_member_fields)); to: json_encode($js_member_fields)); And yes, this line needs double parentheses at the end, since it's a continuation of line 705.


6

I suspect that you're running into an issue whereby your server sets content expiry headers for javascript and that's resulting in the addon's output being cached. I recently submitted a bug report for this issue, with the proposed fix being to explicitly set a no-cache header for javascript generated via the cp_js_end hook. The fix has been accepted for a ...


6

I think you're looking for this page in the EE Developer docs. Basically, if you only need the JS in the Control Panel (so not on the front-end of the site), put your JS files in the /your_addon_package/javascript/ folder and then use $this->EE->cp->load_package_js('my_file'); to load it. If you need the JS outside of the CP as well, you need to ...


6

By default EE prevents the advanced conditional parser from processing anything between <script> tags. Try adding this config variable: $config['protect_javascript'] = 'n';


5

After a few minutes I was able to figure out an easy way to do this. I found a similar question here on EESE about adding custom JS to a new entry. I was able to put the CSS I needed right in instructions of the field. I had to keep everything on one line, because the field instructions look like they're being parsed with XHTML, so it was adding paragraph ...


5

I'm not quite as trusting with the way the fields labels handles JavaScript over say the way it handles HTML which, by the way, handles nicely. Anyways, I will add another option here for future reference as I think it could be helpful either way: As I mentioned in a comment on another question you could write an extension which uses the cp_js_end hook ...


5

Ian, You and Anna/MediaGirl hit on the issue. Currently EE's output class only disables the template debugger and output profiler on responses sent through its own send_ajax_response() method (which makes certain assumptions about the response itself.) Hopefully EllisLab will build in some additional ajax response options to the Output class in the future. ...


5

I recently had the same issue where clicking the "show" link didn't show DB query results when template debugging was enabled. In my case, it was my CSS reset code that was hiding the output. If I remember correctly, "legend" was set to display:none. You can check your theory about the matching IDs by setting up a blank template and checking to see if the ...


5

UPDATE: Store 2 includes the fix mentioned below. It will be an option in the next version. In the meantime, you can fix it by opening mod.store.php, going down to about line 235, and changing this: (document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(script); to this: document.getElementsByTagName("body")[0]....


4

This is usually caused by a JavaScript error or error loading an asset file. You should turn on your browser's developer tools and look for any 404s in addition to the JavaScript errors you looked for to begin debugging this type of problem.


4

As a small edition to this (and it's a great solution by the way!), when I need to do something like this ... rather then putting the CSS (or JS!) directly into the instructions field, I create a .css or .js file and then add the link to the instructions field: <script src="/assets/js/ee_cp.js"></script> or <link rel="stylesheet" type="...


4

The main problem here is this: keywords="{segment_3}" You probably don't have keywords in the third segment, but an entire encoded query. You're feeding that query as keywords to the URL tag, essentially encoding it twice. If you use the URL tag and you want to work from an existing search action, use query="{segement_3}" to pass all the details from the ...


4

Answering my own question as I think this is useful. Adrian at Expresso helped me out. Basically, we output the menus and also output custom buttons. Then we just hide the menus with CSS. This presumably avoids writing lots of new custom Javascript or introducing new dependencies to the way the form is processed by Store. See this jsFiddle EE code {!-- ...


4

The cleanest way is to create an accessory add-on that will add your js to all pages in the cp. Here's a basic example called "Default Value." Change the name and code as needed. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * ExpressionEngine Developer Accessory * * @package Default Value * @category ...


4

You have this tagged as PHP, but this sounds more like a job for JavaScript. The Search module is already preventing empty searches, which is why you get that error page. Lots of ways to accomplish this, here is one way if you are using jQuery: $(document).ready(function() { $('#search').submit(function() { if ($('#keywords').val() == '') { ...


3

Because this isn't happening in your local development environment, I would guess it's not EE related but instead is caused by something on the server or is DNS related. But here are some things to try/check: Log out of EE, clear all cookies and cache, then log back in Disable extensions temporarily by adding this to your config.php file $conf['...


3

Is the ExpiresByType an htaccess rule you've added via HTML5 Boilerplate or something similar? I'd just comment it out. If it's from EE or an addon, try overriding it via an htaccess file that is closer to the files in question. E.g., public_html/control_panel/.htaccess will be trump public_html/.htaccess The files are cached by type so I don't think you ...


3

About a year ago @BrandonKelly, Pixel and Tonic mentioned potentially adding support for using just using the SafeCracker File Upload field to upload to Assets, but I'm not certain if that has happened, as of yet. There are ways to hide the file browser, using CSS or Javascript, but that wouldn't solve your memory issue, since the script to examine the ...


3

Depending on the context you might want to try the {logged_in_email} variable as that's less likely to be impacted by any other modules you're using. Reposted as an answer rather than a comment as it seems to have worked.


3

NB This P&T support thread seems to suggest that CKEditor (which is the editor WYGWAM is based should automatically strip <script> tags, so might be worth checking your themes/third_party/wygwam/lib/ckeditor/config.js file and asking on their Get Satisfaction if that isn't the case for you. That aside. even if you can do this in CKEditor, my ...


3

After doing some testing suggested by MediaGirl, I was able to answer with confidence that the root cause in my situation was the multiple calls to display template debugging (via the XHR-loaded content). Since the code uses IDs to determine what container to show or hide and all 7 of those containers have the same ID, it creates a condition where none of ...


3

A quick solution is to pop the code into the field's instructions. It will show on adds/edits if you do that. You might be able to create a conditional based on the url to not run it on edits. EDIT: Added screenshot


3

If it were me, I wouldn't use JS to handle this, as anyone with JS disabled will be able to get around this stuff. Even using browser cookies could be circumvented, so you really need to think how important is it to see these screens. If having JS and cookies disabled isn't a factor, go with whatever method you this is faster (most likely a jquery solution). ...


3

Let's take a crack at (2) first of all, because it seems to me like getting this working using the File FT will require the least mucking about in total. When you use the search box in the file manager modal, an ajax request should fire off back to the CP to look for results: Is that request firing (see the "network" tab of your web inspector), and if so ...


3

I had the same problem in another context, so I don't know if this will help. I had the problem using safecracker with its own JS loader. The only thing that worked for me was to load my own js (in this case jquery) and set the safecracker parameter to "no" to stop it loading its own. As an aside, I lament the lack of a unified approach to integrating ...


3

I have just spent many hours trying to resolve the very same issue, however, I was relunctant to upgrade PHP. On my production server, JavaScript was taking 5 seconds to load slowing down the responsiveness of every page within the control panel. However, the issue did not occur on my local (MAMP) server. I went through a process of disabling all the ...


3

What about: {modifiers} {modifier_name}: {modifier_options} <label><input type="radio" name="{modifier_input_name}" value="{option_id}" /> {option_name}</label> {/modifier_options} {/modifiers}


3

EE won't parse tags that are stored outside of templates unless you do some trickery to send them back into the parser. Keep them in templates if you need the tags parsed. Though I should note that the parsing abilities for CSS and Javascript templates seem limited. While you are at it be sure to look into a minimizing module, this doesn't solve your ...


Only top voted, non community-wiki answers of a minimum length are eligible