Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

4 votes
Accepted

Correct way to share functions/methods between Module and Extension

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() { ...
user avatar
  • 4,002
4 votes
Accepted

With new Routing capabilities in EE 2.8 - Trying to figure out the best solution

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) { $...
user avatar
  • 4,002
4 votes
Accepted

What Addons are compatible with EE 3.0?

I found the answer. Devotee has a list here.
user avatar
  • 1,068
3 votes
Accepted

Detect if url is that of the Pages Module

You should be able to do: {exp:channel:entries} {if page_uri} {!-- or {if pages_url} --} This is a page in the pages module {if:else} This is not {/if} {/exp:channel:...
user avatar
  • 7,556
3 votes
Accepted

Module development: Any reasons creating catch-all action is a bad idea?

It's really your choice here. I imagine that this framework is best for smaller addons. One point of access is always slightly frowned upon; because it creates a SPOF in your addon. Trust me, I ...
user avatar
  • 5,900
3 votes

How to create modules in ExpressionEngine?

The 1st party guide is everything you need to get the concept of module/extension/add-on/plugin/fieldtype development : https://ellislab.com/expressionengine/user-guide/development/index.html If you'...
user avatar
  • 2,418
3 votes

Development Cycle

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 ...
user avatar
  • 836
3 votes
Accepted

Hook for when viewing single entry

Crelate a plugin containing single function, say, function_name. The plugin will accept member_id of logged in visitor ee()->session->userdata('member_id') and ID of entry being viewed, ...
user avatar
  • 2,831
3 votes
Accepted

Modules vs Extensions

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 (...
user avatar
  • 2,255
3 votes
Accepted

PHP Version compatibility issue with EE module

As error says, PHP 7 is only allow variables to passed by reference not an instance. You now need to remove that line and replace all $this->EE calls to ee(). That will work for you.
user avatar
  • 626
2 votes
Accepted

EE 2.8.x - "All data associated...will be permanently deleted!" when installing an addon

This a confirmed bug, marked as "fixed in upcoming release". https://support.ellislab.com/bugs/detail/20149
user avatar
  • 17.4k
2 votes

Development Cycle

That which is not portable in the database can be set in the config.php see http://ellislab.com/expressionengine/user-guide/operations/moving.html You can write a script to set these dynamically ...
user avatar
  • 121
2 votes

Development Cycle

Let me be 100% clear that I am not even close to an expert on this, but I've recently started using the development workflow described on Krasimir Tsonev's blog in order to enable a local development ...
user avatar
  • 213
2 votes

Upload file form in CP - create module

You can use the api to add a single upload field to your module or fieldtype. http://ellislab.com/expressionengine/user-guide/development/usage/file_field.html . if you want to include multiple image ...
user avatar
2 votes
Accepted

Hook for when status is updated

I would use the entry_submission_ready extension hook, and write a mini-extension that looks at the meta array in the api for the entry status value, and compares it to the previous value for that ...
user avatar
  • 5,900
2 votes
Accepted

Security of an Action URL called from AJAX

What data does the script which is being triggered with action URL accept? If that's EE form submission, then you should not worry if you follow standard EE forms security settings/practice. If it's ...
user avatar
  • 2,831
2 votes
Accepted

Global variable as a module tag pair's parameter?

One really simple way to get around parse order is just to use an embed. {embed="embeds/_rest" ip_address="{ip_address}"} Then in your embedded template (embeds/_rest): {exp:rest url="http://domain....
user avatar
  • 7,941
2 votes
Accepted

Stash with timestamps and custom written module

Carefully "unescape" the variables you want to be cached, so e.g. {stash:nocache} <div> {if {current_time format="%U"} - {/stash:nocache}{event_time format="%U"}{stash:nocache} < -86400} ...
user avatar
  • 5,234
2 votes
Accepted

Render embed tags Shine pdf

What you're looking to do is far from trivial, however.... Lets simplify first. Forget the pdf module, I assume you want to render your embed (and any other) tags and push the result into your pdf ...
user avatar
  • 2,418
2 votes
Accepted

Add a new menu button in control panel on module installation

There isn't a standard function, but there is a standard event hook, so within your module you can create an extension too, and use this to input your menu item. This way when you install the module, ...
user avatar
  • 2,418
2 votes

Add form to EE Module for front end processing

Take a look at the Code Ignitor Validation Helper. You can use this within PHP on an EE template, it really is as easy as this (example from the CI Docs), just replacing $this with a reference to EE : ...
user avatar
  • 2,418
2 votes

How to add a new database column in third party module?

add_column just defines the column specs. After which you need to run create_table https://codeigniter.com/userguide2/database/forge.html#add_field "After the fields have been defined, they can be ...
user avatar
  • 1,987
2 votes
Accepted

How to add a new database column in third party module?

The add column function requires the database name, something that I had missed out in my function. ee()->dbforge->add_column( 'module_table', $updates ); Full code: public function update( $...
user avatar
2 votes
Accepted

Upgrading module from EE2 > EE3

Generally yes, you only need to add addon.setup.php. There of course could be some deprecated code etc.
user avatar
  • 2,831
2 votes

How to update Modules?

Important edit: a database backup before you do any module updating might prevent data loss and is always a good idea! It is a pretty straight forward process. For Transcribe simply follow the ...
user avatar
  • 3,562
1 vote
Accepted

Store: who can access "Settings?"

You will have to login with your super admin account and go to the settings panel. From there you will need to navigate to the security panel. You should see your member group on the right hand side ...
user avatar
  • 7,556
1 vote

form validation for module mod file template tags

Looks like you're looking for the Forn Validation library that is inherited from CodeIgnitor. What you seem to be trying to do is set the validation rules at thes same time as setting up the form, ...
user avatar
  • 2,418
1 vote

redirect in add-on module redirecting me to admin control panel login form with # appended in URL

Brandon is correct - EE does not like a hash in a redirect URL. Instead, try using flash data for this. $this->EE->session->set_flashdata('selected-tab', 'settings'); $this->EE->...
user avatar
  • 17.4k
1 vote
Accepted

Photo Frame add-on -- customize alt attribute?

You can use the same template code as before. Just need to add {item_photo:url} <div class="item-photo"> <img src="{item_photo:url}" alt="{title} photo"> </div>
user avatar
  • 5,781
1 vote

Pagination while Get Variables in URL

There isn't "something obvious" you're missing, as far as I know. I try and maintain the query string in pagination for Low Search, which ended up doing an obtuse regular expression to find/replace ...
user avatar
  • 11.3k

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