Hot answers tagged

9

Ok, this is something it looks like Ellis is not ready to really let people do even though it's in documentation, except perhaps developers who would provide via a full add-on installer and handling. However, it is possible. a. First, there is an EE interface to install new button features, but it is not called anywhere, Addons_installer:install_rte_tool. ...


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

This is a bit of an undocumented feature, but it works like this. In your extension, add a class variable called $required_by, with an array of values: $required_by = array('module'); ('module' is actually the only acceptable array value here, as neither plugins nor accessories have installation routines, which are needed for this to work.) Note that ...


5

You can use $this->EE->output->send_ajax_response($array); for the same purpose.


5

Good on you for writing your first plugin. Use this as a starting point for your plugins, quick, easy and avoids missing something. pkg.io Create it, download, unzip and upload to third party folder, just like any other add on. Once you can 'see' it in the plugin/module list you're all set to add your code.


5

First, no need to ever load directly from CI - you can always use EE. (So, $this->EE->load->helper('file').) Same with your validation class - I'd extend Form_validation, not CI_Form_validation. (Generally, EE should serve as your path to anything CI-related to avoid any conflicts.) You'll need to load your custom validation library, and call it ...


4

Yes via ACTion URLs, tutorial here. Basically in your install method (in your upd. file): //### Create ACTion IDs for the relevant functions ### $formActions = array( "YOUR-METHOD-NAME" ); foreach ($formActions as $method) { $data = array( 'class' => $this->class, 'method' => $method ...


4

The session cache only lasts for a single page request. So by the time your action gets called, that cache is gone. You'd be better off adding those to the form as hidden fields, and then grabbing them from POST in your action.


4

The issue is parse order. Read the attached pdf.parse order. Turn on the debugger and then view the template in your browser. Scroll down thru the debugger until you find the tag containing {current_url}. You will see that that {current_url} has not been parsed. According to the attached doc, it is not parsed until step 9 - last. In your module, try $...


4

This is far from obvious how to achieve in EE, and it's not really documented at all. A long while ago I wrote up on Stack Overflow how we (used to) do this in Store, and this was in turn based on how SafeCracker (now Channel Form) did it. However, I've since figured out an even cleaner way to achieve it (Channel Form, FreeMember, and many other add-ons use ...


4

I would suggest a couple things to help separate our your code. As Derek mentioned in a comment above, make sure you're abstracting your data model work to a model class. You can also create a libraries directory within your add-on package and begin to create your own set of libraries. Since they are local to your package, you'll be able to easily load them ...


4

If you add parse="inward" to your channel entries tag parameters, it will force module tags inside your parameters to be parsed before the channel entries tag.


4

Welcome to ExpressionEngine! The first thing to understand is that EE has no concept of "regions" - it completely separates your content from your templates. The only content which appears at any given URL (which essentially is the same as your templates - templates in EE are like routes or controllers) is what you explicitly define inside your templates. ...


4

I can think of two ways to do this. One is to use Resource Router. Your config would look something like this: $config['resource_router'] = array( ':num' => function($router, $wildcard) { $query = ee()->db->select('url_title') ->where('entry_id', $wildcard->value) ->where('channel_id', 1) // use the right channel id here ...


4

I found the answer. Devotee has a list here.


3

I'm using PHPUnit, which is by far more popular in PHP-land. The full ins and outs of getting it set up are probably beyond a stack exchange answer, but assuming there are a couple things which should put you in the right direction. Testing with EE and CI in general is always an uphill battle, since they weren't really designed with testing in mind, and ...


3

I spent some time trying to understand what happens on your code, until I notice the variable "{child_category_end}". This variable shows that the addon Laisvunas' Child Categories doesn't use the template class of EECMS, otherwise the variables would be something like "{child_category}(...){/child_category}". I can't say for sure without to read the code ...


3

Something like that is not possible with the first party search module. It would be possible to build queries like that with Low Search or Solspace SuperSearch however.


3

If you upgrade to the current version, 2.5.5, it is bundled within the install.


3

Since Last Visit "Attempts to point out various actions that have happened since a visitor's last visit to your site." http://devot-ee.com/add-ons/since-last-visit Otherwise you'd need to roll your own plugin that taps into the Session Class: http://ellislab.com/expressionengine/user-guide/development/usage/session.html Specifically looking at this ...


3

You can do it with the following example code within your plugin: require_once PATH_THIRD."modulename/modulefilename"; $obj = new ModuleClass(); $obj->module_method(); Hope, it would help you.


3

Generally when this happens it’s because either your system is off, or your .htaccess file intercepting Assets’ Ajax requests. If it’s the latter, you can try adding this to system/expressionengine/config/config.php: $config['assets_site_url'] = "/index.php"; Assuming you don’t have a .htaccess redirect that forces “index.php” out of the URL, that should ...


3

Man, take a look at the function _parse_sub_template used on stash. Mark Croxton, the developer of stash, cloned the tagdata and parsed it. // clone the template object $TMPL2 = $this->EE->TMPL; unset($this->EE->TMPL); // parse variables $TMPL2->tagdata = $this->_parse_template_vars($TMPL2->tagdata); // parse simple conditionals $...


3

The code you have should work fine. I've just run a test on a module and it loads fine in EE v2.5.3 (either in a method or in the class constructor). I've just had a quick read of the EE changelog and can't see any reference to changes there, so don't think it's version related. Are you sure it's not calling the Class and then doing something unexpected? I ...


3

You can't do that from the Pages module. You can set the default template, and then, in that template, call a specific entry by entry_id. This is an example of what I typically do in the default template (site home page)--e.g., site/index: {exp:channel:entries entry_id="1" channel="home_page" disable="member_data|trackbacks|pagination|...


3

You're using the wrong hook. Try using entry_submission_start and/or publish_form_entry_data Update: Abort the channel entry publish process? Head-scratcher: manipulating new/updated entries after submission


3

Looking carefully at your error message, you may have some incorrect capitalization of the EE_Fieldtype class file name. EE_Fieldtype.php is the correct way (uppercase F, lowercase t). Likely your localhost is case insensitive but your server is not.


3

I've very little experience with Drupal since 4.x many years ago, tried to get into it at 6.x and 7.x the last being 2 years ago. Ultimately went with ExpressionEngine 2 (had 1.6.x experience in the past for this). That said here are some thoughts. Templates - these can be flat files, you can use the administrative control panel to sync between the ...


3

You should create a library, which is just a PHP class stored in system/expressionengine/third_party/your_addon_name/libraries/. <?php class Your_library { public function do_something() { return 'foo'; } } Then in your module / extension, you'd be able to do this: ee()->load->library('your_library'); // prints out foo echo ee()->...


3

Extensions are used when you want to take over, modify, or perform extra routines when native first-party methods are executed. For example, performing extra actions after an entry is saved. Modules (and Plugins to an extent) are used when you want to make functionality (and therefore output) available in Templates via tags. Things that need to occur in a ...


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