23

The following list should get you started: ExpressionEngine Add-On Development Docs: links to guidelines, reference material, and tutorials for developing Plugins, Modules, and Extensions for ExpressionEngine ExpressionEngine Add-on Development Recipes: a collection of articles and tutorials to help you learn how to build ExpressionEngine add-ons Add-On ...


6

While you can't actually parse the tag using your custom module, you can pass parameters to the channel module and run it. Here's a code sample: function your_module_method() { // Set the parameters for the channel:entries tag $this->EE->TMPL->tagparams['entry_id'] = $entry_ids; $this->EE->TMPL->tagparams['dynamic'] = 'no'; ...


6

Converting from EE2 to EE3 is easy. All the syntax's etc. are almost same. You just need to create an extra file named addon.setup.php and done. In your case, follow the points below: Open FTP and go to your site/system/user/addons/ Create a Folder named string. Enter in the folder. Create a file named pi.string.php and put this code inside: $...


5

Use the session cache: if (ee()->session->cache(__CLASS__, __FUNCTION__) === FALSE) { ee()->cp->add_to_head('/path/to/foo.css'); ee()->session->set_cache(__CLASS__, __FUNCTION__, TRUE); } Your code will only run once per page load.


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're looking for robust tracking of user actions in the Control Panel than what EE provides, there is Audit (and Audit Pro). Audit adds some additional user tracking beyond what EE does. Here is the list of what it tracks, from its page on Devot:ee Member Logins, including Control Panel & front-end Member Logouts, including Control Panel &...


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

You can use the channel fields api to get the field names: ee()->load->library('api'); ee()->api->instantiate('channel_fields'); $fields = ee()->api_channel_fields->fetch_custom_channel_fields(); //change 1 to your site_id if using MSM $quantity_field_id = $fields['custom_channel_fields'][1]['your_quantity_field_name']; $sql .= "picd....


4

After setting the return data, you need to return program control to the Template class, which ends execution of the current method. if ($date[2] == 25 && $date[1] == 12) { $this->return_data = '<p>Sorry, there are no sailings on Christmas Day.</p>'; return; } Incidentally, it isn't necessary to set the $return_data class ...


4

ee()->router->fetch_class() and ee()->router->fetch_method() should always reveal that information to you, regardless of the URL pattern or special routing.


4

ref: https://docs.expressionengine.com/latest/development/legacy/libraries/cache.html#class-methods ee()->cache->delete('/myaddon/');


3

I've done it before. Take a look at the display_field method of ft.wygwam.php. You'll see that it's fairly simple to instantiate a WYGWAM field. A few calls to the Wygwam_Helper class to load the JS/CSS. There are also some helpers for properly formatting the data. You'll need a textarea with an id, and also the ID number of a WYGWAM config. I don't want to ...


3

I managed to fix this. My problem stemmed from an incorrect class name and missing a critical bit of code which inserted the necessary information into the extensions table. I needed to insert; ee()->db->insert('extensions', $data); within the activate_extension method The extension wasn't showing as 'Enabled' in the CP because the class name was ...


3

@naboovallay said it all really, but seeing as I had exactly the code you wanted already open, I figured I'd paste it... function update($current = '') { if ($current == '' OR $current == $this->version) return FALSE; if (preg_replace("/[^0-9\.]/", '', $current) < '1.1.0') { //### Create ACTion IDs for the relevant functions ...


3

If you are in an extension, it's possible that the db class is in the midst of a query. I'll show an example. Let's say this was the core EE code: ee()->db->select('some_column'); ee()->db->where('some_column', 1); // your code gets called here, while the active record methods have already been invoked ee()->extensions->call('some_hook');...


3

You would actually want to use a module for this, so that you can have an action ID associated. The module development documentation section about the install method mentions how to setup action IDs, which basically allow you to load http://yourdomain.com?ACT=123 from a cron job and run a method from your module. From there you simply need to build out ...


3

You could create an extension which uses the channel_entries_query_result hook to add your variable to each entry row. That will get parsed along with the native vars. To pass data from your module/plugin file to the extension, you'd need to use the Session cache. You might be interested to know that Low Search offers a straight forward API for custom ...


3

If you're looking to change the column layout as well as the look, try the module Zenbu. It will let you customize which columns are visible from the Edit Entries view. You can show expiration dates, edit dates, custom field data, etc. You can also vary what columns are shown based on member groups. https://devot-ee.com/add-ons/zenbu


3

You can create a function to set variable for backward compatibility like below : function set_var($key, $val) { if (version_compare(APP_VER, '2.6.0', '<')) { ee()->cp->set_variable($key, $val); } else { ee()->view->$key = $val; } } You can then use this function as below : $this->set_var('...


2

I usually check if entry_id = 0 (for new entry) $this->EE->input->get_post('entry_id') == 0


2

You can compare $meta['edit_date'] with $meta['entry_date']. You will need to bring both dates to same format of course, as entry_date contains current timestamp, while edit_date is formatted as '%Y%m%d%H%i%s'


2

There is a version_compare function that can help simplify version comparison conditionals. See this example in the documentation.


2

First you need to get the version of your add-on so know if you should run any update functions or not. Replace the "ENTER_YOUR_CURRENT_VERSION_HERE" with the current version of your add-on. You could do this like this: public function update($current = '') { // Is the current version (from database) lower then the version for your current add-on? ...


2

The comments on the official documentation page note the following: Just a note that on display_field the data has htmlspeciachars on it if you’re trying to deserialize or decode_json so make sure you do this: htmlspecialchars_decode($data) Before you try and decode it. So to apply that same thing in your case, you'd need: function ...


2

I think, the addon may be generating the form with the following code: $hidden_fields = array( 'ACT' => 'ACTION ID', 'RET' => 'RETURN URL' ); $data = array( 'action' => 'FORM ACTION', 'hidden_fields' => $hidden_fields, 'id' => 'FORM ID', ); $tagdata = $this->EE->TMPL->tagdata; $form ...


2

You can render views from module/plugin tags fine. I've done this in the past and they work with EE tags within them, so most EE tags are available. From memory you might have issues with early global variables not being available as they're called before plugin/module tags. So within your plugin/module, instead of returning a parsed variable array for ...


2

The quick way would be to use an SQL query (something like http://pastie.org/private/x6uue9y6ieqvlqf6ai59q), but that would not get you the URL, though, as that depends on several other settings. If you're confident that the settings for the upload folder (or Assets external source) for that will never change, this will probably not be an issue for you. The ...


2

There's a very basic Control Panel log file here: http://ellislab.com/expressionengine/user-guide/cp/tools/logs/cp_log.html It tracks certain actions, though not exactly sure what they are. :) Does that help?


2

An alternative: if you're comfortable having a script outside of EE access your database, you could write a simple-ish SQL update statement, and have your cron run that script. The SQL would be something like this: update exp_channel_titles set status = 'new status' where entry_date > 1385943600 and channel_id = 1 If you're using a "custom" field for ...


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