# Question
Title: CRUDL Interface for Custom Data and Files: The Correct Way
I am creating a web app that will:

1. Take parameters in a form submission
2. Run an action which will query an api to retrieve report data based on those parameters
3. Save that report as a file along with user data (user name, id, member path, and time of submission) as an entry to a database
4. List those entries (along with links to download the files)

I have an idea about how to approach this but I wanted to check here to see if I'm on or off base before getting too deep into it. As of right now I have the first two items working well enough for testing: I can query the API and get the user data I need. It's the CRUDL best practices that I'm interested in learning for this question.

My thinking is that I would save this data as a channel entry and then list out the entries using the standard channel template tags. In other words, when someone makes a form submission it will validate and save that data and file as a channel entry.

What's the best way of going about this? Should I create a channel in the control panel Channel Manger and a corresponding directory in the File Manger and use the db helper to insert, edit, and delete those items in my action method?

# Answer
The best way would be to use the Model service to create Channel Entries and files:

https://docs.expressionengine.com/latest/development/services/model.html

This will guarantee you are saving complete records, which you can't guarantee if you are just blindly inserting data in the database. This also means you are triggering EE's extensions system, so other add-ons can work with yours, such as EE building search indexes off of your entries.

The Model service functions as the modern API for interacting with EE's models. The documentation is a little light, but I think there is enough there to get started. You can just create an entry like this and dump it's structure to so you understand how to work with it:

```
$entry = ee('Model')->make('ChannelEntry');
var_dump($entry);
exit();

```

Once you know the structure a little bit, you just add your info and save:

```
// I DON'T KNOW the structure of a file Model, this is just a guess.
// Just make one and var_dump it to figure out what properties you need to
// set to save a file properly.
$file = ee('Model')->make('File');
$file->title = "File";
$file->name = "file.jpg";
$file->upload_path = "1";
$file->save();

$entry = ee('Model')->make('ChannelEntry');
$entry->title = "My title";
$entry->url_title = "my_title";
$entry->my_file_field = $file->id;
$entry->channel_id = "1";

// Save
$entry->save();
unset($entry);
unset($file);

```

The old way would be to use the legacy API, but of course I wouldn't recommend it as it will probably go away in the next major version. But if you want to use it, it does work just fine:

https://docs.expressionengine.com/latest/development/legacy/api/api-channel-entries.html

And yes, as to your second part; just use the regular template codes to output your channel data.
> 2 votes

---
Tags: channel-entries, safecracker, file-uploads, file-manager, channel-files
---


title: How to reuse channel layouts?

text:
# Question
Title: How to reuse channel layouts?
I'd like to import a custom channel layout into another channel that uses the same fieldset. Is there an easy way to do this?

Using EE 5.2.2.

# Answer
> 0 votes
The easiest way to do this I've found is to:

1. Create a layout for your new channel
2. Go into exp\_channel\_layouts and grab the field\_layout field from your original layout
3. Copy the contents of this into your new layout's field\_layout field

As long as it's the same fieldset, it should work.

---
Tags: channel, layouts
---


# Question
Title: Requiring Admin approval for profile changes
So I'm looking for some suggestions. I have a client who needs to import user data from an old application they'd like to deprecate into an EE4 installation and integrate how they listed member data the same way on the old app. Most of this stuff is easy, but one of their requests is that if a Member can edit their own profile, that those edits be approved first by a SuperAdmin before going live.

I'm looking over these three add-ons:

User: https://eeharbor.com/user
Visitor (previously Zoo Visitor): https://eeharbor.com/visitor
Zeal Smart Members: https://devot-ee.com/add-ons/zeal-smart-members

And so far this functionality doesn't seem to be implemented anywhere.

The closest thought was using Visitor, which creates Channel Entries to store member data. Then I thought maybe something like Better Workflow was still out there, and I could use that so when a member profile entry is updated, it automatically goes in to the draft/review status, where a Super Admin could approve. But of course, that add-on is deprecated, and I can't seem to find any modern equivalent.

I know that EE isn't really built to be a full featured member management system, but I was hoping there was some middle ground. Has anyone successfully created anything like this? Or have any suggestions?

If an add-on like Better Workflow exists and works for EE4, I can probably build the whole thing out with Channel Entry tags and the Channel Form, as the member data being imported are members that already have accounts in the EE4 system, so I could cobble together a simple version of Visitor without it, but I still need to allow for profile edits to be reviewed.

# Answer
This might be of help.

https://boldminded.com/add-ons/publisher-lite

Basically a manager of workflow logic.
> 0 votes

---
Tags: members, member-management, ee4
---


title: Best way to make an event calendar?

text:
# Question
Title: Best way to make an event calendar?
In EE2 I made an event calendar with Low Events. That fieldtype was super useful. But now EE5 comes with a "Date" fieldtype that might just be fine, by the looks of it. Would this be a good practice in making an event calendar, or is there an addon out there that is really useful for an event calendar?

# Answer
> 2 votes
If you are developing the website in **EE5** and you've very easy functionality then you should go with Calendar Tag which is built in tag of **EE**.

And if you are developing the website in **EE2** or you have some complex functionality in **EE5** with Calendar then you should go for Solspace Calendar.

Both are very useful but all things is depends on your requirement.

# Answer
> 0 votes
I'm ending up going with Low Events (https://gotolow.com/addons/low-events) again. I used it back in EE2. EE5, while having a nice "Date" fieldtype (for Start and End values of an event), doesn't have good date filtering based on that like it does with Entry Date in the Entries or Calendar tag parameters.

I have no doubt Solspace Calendar is great, like the rest of their software. But going with Low Events to make porting easy.

---
Tags: low-events, calendar-events
---


# Question
Title: Removing primary domain site in EE 2.4 Multi Site installation
I have a multi site installation and want to point the domain for the primary site to a different website. I notice that all the sites use the URL for the primary domain theme folder (/themes) in the General Configuration.

I don't see any other occurrences of the primary domain in the other sites.

Will I run into any issues making this change?

ExpressionEngine v2.4.0 - Build: date 20120123

Thanks, Rob

# Answer
**Yes, this is going to be a problem.**

Your themes folder *must* be available to your MSM sites for them to function properly. The easy way to solve this is to move the themes folder to another available domain on the server, and change your different site settings to point at that. Note that if some domains are behind SSL and some aren't, you'll want to make sure you move it a domain that is behind SSL to cover both.

Also, some set-ups only access their Control Panel from the main domain (so `maindomain.com/system` or `maindomain.com/admin.php`). You'll need to make sure you can access your Control Panel from one of the other sites before making any changes.

Also, some MSM set-ups will have File Upload Preferences between the sites that point at the same folder and the same domain (so they can share images), and you'll want to make sure that isn't happening here so your non-primary MSM sites don't suddenly start 404'ing image/file uploads after you redirect/change your primary domain records.

I know you said you didn't see any instances of the main domain in the MSM domains, but I just wanted to point out some pain points to double check.
> 0 votes

# Answer
**Yes, definitely this will cause a problem.**

The main rule of MSM website is, domain of primary website and its secondary website must on same server. And all CMS folders should be in primary website and all secondary website should have respected path of primary website.

**So, in your case if you change the domain of primary website then you have to change updated domain and path in all respected secondary websites.**
> 0 votes

---
Tags: ee2, multi-site-manager
---


# Question
Title: path=logout - how to configure URL it redirects to?
I have put a logout link on my site. When I click it, I am logged out and redirected to the homepage. How do I specify a different page to redirect to?

# Answer
> 5 votes
I always recommend my add-on Authenticate.

https://objectivehtml.com/authenticate/documentation/tag/logout-url

```
{exp:authenticate:logout_url return="/some/return/url"}

```

# Answer
> 3 votes
I use a add-on for member management on the front-end called FreeMember. This add-on offers a more fine grained control for member management using regular templates. (including return url after logout).

https://github.com/expressodev/freemember

# Answer
> 2 votes
Another option, besides FreeMember is LogIn Redirect. Generally speaking, the standard login/logout doesn't offer you much leeway in modifying redirects, but either of these plugins (and others) aim to improve that experience.

# Answer
> 0 votes
The User add-on by EE Harbor has a nice little Logout form, which allows you to create a return path.

---
Tags: members, global-variables
---


title: Using the cp_custom_menu hook

text:
# Question
Title: Using the cp_custom_menu hook
I can't get the cp\_custom\_menu hook to run. Here's my code. The activate\_extension() function runs and successfully adds the extension to the db but it never gets called.

```
public function activate_extension()
{
    $hooks = array('cp_custom_menu');

    foreach ($hooks as $hook) {
        ee()->db->insert(
            'extensions',
            array(
                'class'    => __CLASS__,
                'hook'     => $hook,
                'method'   => $hook,
                'settings' => '',
                'priority' => 10,
                'version'  => $this->version,
                'enabled'  => 'y'
            )
        );
    }

}

public function cp_custom_menu($menu)
{
    // this never runs
    $menu->addItem('Title', ee('CP/URL')->make('/xyz'));
}

```

# Answer
The `cp_custom_menu` hook, although *sounding* like it will automatically add an item to the menu, in fact just adds your add-on as a new option when creating a custom menu via **Settings -\> Menu Manager** using the **Add-on** type. So check there before deciding that your function is never firing.
> 2 votes

# Answer
add this at the end of

```
public function cp_menu_array($menu)
    {
        if ($this->EE->extensions->last_call !== FALSE)
        {
            $menu = $this->EE->extensions->last_call;
        }

        $menu['whatever'] = cp_url('addons_modules/show_module_cp',array('module' => 'whatever'));
        $menu['whatever']       = BASE.AMP.'addons_modules/show_module_cp';
        return $menu;
    }

```
> 1 votes

---
Tags: add-on-development, hook
---


title: Can't sync .MP3 files

text:
# Question
Title: Can't sync .MP3 files
I am trying to upload MP3 files for a site running EE 4.3.8. When I upload via FTP and sync it in file manager I get the following error:

> The file type you are attempting to upload is not allowed.

Would appreciate some help on this.

# Answer
> 0 votes
Have you tried uploading it via a file or Asset field, or the file manager?

https://docs.expressionengine.com/latest/development/legacy/libraries/mime-type.html

Looking at this leads me to this file:

`system/ee/legacy/config/mimes.php`

which leads me to:

`system/ee/EllisLab/ExpressionEngine/Config/mimes.php`

which has a whitelist of mime types the upload class will allow. I do see these lines in the whitelist:

```
'audio/mpeg', // .mp2, .mp3, .mpga
'audio/mpg', // .mp3

```

I'm not sure if the file sync is using that whitelist or not (one would assume it is), but check that list and try uploading via the Control Panel and not via S/FTP.

If it is a specific MP3 file and not others, try and make other services recognize the mime type as `audio/mpeg` or `audio/mpg`.

---
Tags: file-uploads, sync
---


# Question
Title: Model Service ChannelEntry relationship fields
I can't figure out how to save (or retrieve) relationship field data using the Model Service. I can save flat fields with out an issue (and retrieve them).

So when retrieving an entry like this:

```
$entry = ee('Model')
        ->get('ChannelEntry')
        ->filter('channel_id', 1)
        ->first();

var_dump($entry->field_id_1); // this is a text field data, this works

var_dump($entry->field_id_2); // this is a relationship field with data, it outputs NULL

```

As you can see, I don't get the relationship data. I couldn't figure out a way to load relationship data either, by using `->with("Relationships")`or any other verbiage that makes sense.

At the same time, I can't seem to save relationship data in any way:

```
$entry = ee('Model')->make('ChannelEntry');

$entry->title = "Title";
$entry->url_title = "title";
$entry->site_id = 1;
$entry->channel_id = 1;
$entry->status = "open";
$entry->author_id = 1;
$entry->field_id_1 = "My text field"; // this works
$entry->field_id_2 = array("100", "101"); // doesn't save relatoinship data, and trying a few different formats didn't work
$entry->save();

```

I've been digging through the EE source code and it isn't clear if this is possible at all. I know I could insert raw DB entries next to the Model Service, but that sucks and is harder to get right.

Any one have any success with this?

# Answer
> 2 votes
I too had the same issue, the EE documentation to put it nicely is rather incomplete on this topic. Looking though the source I saw an example in ft.relationships.php:

```
ee('Model')->get('ChannelEntry', $entry_id)
                    ->with('Children', 'Channel')
                    ->fields('Channel.channel_title', 'Children.entry_id', 'Children.title', 'Children.channel_id')
                    ->first()
                    ->Children;

```

This will give you just the child relationship entries, so you could foreach your entries to get each entry's children. Not very satisfactory!

# Answer
> 1 votes
Yeah, you can save relationship data using below **Model** query. In below code `$entry->field_id_2` indicates the relationship data.

```
$entry = ee('Model')->make('ChannelEntry');
$entry->channel_id = 'your_channel_id';
$entry->site_id =  ee()->config->item('site_id');
$entry->author_id = ee()->session->userdata('member_id');
$entry->ip_address = ee()->session->userdata['ip_address'];
$entry->status = "open";
$entry->sticky = FALSE;
$entry->title = 'your_entry_title';
$entry->url_title = preg_replace("/[\s_]/", "-", 'your_entry_url_title');
$entry->field_id_2 = array('data'=>array("100", "101")); //ids of related entry
$entry->entry_date = ee()->localize->now;
$entry->edit_date = ee()->localize->now;
$entry->save();

```

Well, as far as I know there is no any method to fetch relationship data using **Model**. Because, as you should know relationship is third-party Addon. But you can get data of relationship from `exp_relationships` using below simple query.

```
$entry = ee()->db->get_where('exp_relationships', array('parent_id'=>'your_parent_entry_id'));
var_dump($entry->result());

```

I hope this will helps you.

---
Tags: channel-entries, ee4, channel-entries-api
---


# Question
Title: Fresh EE 5.5.2 Install, Javascript Error That Breaks The Admin Control Panel: Please Help!
This is related to another question I asked earlier but the problem is not caused by what I thought.

I did a fresh install of EE on a different server and I'm getting the same js error of `Uncaught TypeError: EE.grid is not a function`.

I've been pulling my hair out all day trying to debug this, and since it's on a fresh install of EE I'm really, seriously thrown off.

This is happening on any admin Control Panel form that uses file grids. So any type of channel entry that uses images, or even`categories` as they have an image uploader, is completely broken and unusable.

When I check the error in the Network tab of the chrome dev tools, this is in the Headers section:

```
Request URL: http://example.com/admin.php?S=0&D=cp&C=javascript&M=combo_load&plugin=ui.touch.punch,ee_table_reorder&file=cp/global_end,cp/grid,cp/files/picker,fields/file/cp,fields/file/file_field_drag_and_drop,fields/file/concurrency_queue,fields/file/file_upload_progress_table,fields/file/drag_and_drop_upload,fields/grid/file_grid,cp/date_picker&v=1556219934
Request Method: GET
Status Code: 406 Not Acceptable

```

All I've done with this new project is install EE, let it set up the example project (because it's easier to work off of), add an htaccess file according to the EE docs, and get my editor set up with ftp to the server. I have not touched or installed any modules.

As far as I can tell this has something to do with the combo loader(?????) But if so, why? Would would a brand new install on a brand new server START with errors that make the whole CMS unusable?

Really at a complete loss with this and if I can't get it figured out I'm going to have to abandon this CMS completely, which would really suck because I've invested a lot of time into learning its template system and really, really like working with it.

Any help at all would be immensely appreciated.

**\[EDIT\]** Some further strange behavior is that when I post an entry using the example site's blog setup, which contains a video, audio, and image field, it will save those items to the entry weather or not there's anything in them.

`HIT SAVE`

`HIT SAVE AGAIN (without changing anything)`

What on earth could possibly be going on here? Again, this is a brand new install of EE 5.2.2

# Answer
Your best bet is to open a support ticket with HostGator and asking them to 'whitelist' those mod\_sec rules that are causing the problem. As EE5 isn't as common as say WordPress, most hosting providers therefore don't have the relevant rules whitelisted as they don't have clients that have run into the issue (yet).

If you ask them nicely they might be able to do this for your server/all domains you want to use EE5 with.
> 1 votes

# Answer
It seems to be an Apache server module.

The 406 status code is when a mod\_security rule is enabled on an Apache server. So, disable it could resolve this problem.
> 1 votes

---
Tags: control-panel, error, javascript, install
---


# Question
Title: Does Multisite Manager work the same with sub-directories, or is it better to use sub-domains?
We have a site where we need to be able to control both front-end and back-end permissions on a per-site level.

Our site structure is as follows:

**Main Site / Main Domain:** All can access is ok
**State Site / Sub Domain:** Restricted access - front-end via cookies, back-end via permissions

They, for SEO reasons, would like their URLs to look like this:

**Main Site / Main Domain:** www.mydomain.com
**State Site / Sub - Domain:** www.mydomain.com/state

Does it matter if we use sub-directories, or would we need to use actual sub-domains for this? Or is there any other reason to use a sub-domain vs a sub-directory with MSM?

# Answer
> 2 votes
I've done both. The only thing you'll have to consider it making sure your cookie domains are set correctly, depending on if it's a `site2.domain.com` or `domain.com/site2`. Otherwise, the MSM sites will function exactly the same.

Past that, at most you have the regular head aches that could come from migrating a site, including getting `.htaccess` rules set correctly, and possibly dealing with hard coded links in templates in layouts and content, but that could also be fixed with `.htaccess` rules if you know what you're doing. Also, you'll have to make sure the introduction of `/state` to your main domains URI scheme isn't in conflict with any existing routes that start with `state`.

# Answer
> 2 votes
**Well, both things are fine in the terms of MSM.** You can create sub-domain as well as sub-directory also. **Just you need to take care is, about path settings at the time of setting MSM website.**

**And if you want to make SEO friendly then, yes sub-directory is the best option.**

---
Tags: multi-site-manager, admin, subdomain
---


# Question
Title: Setting a layout variable into channel form {custom_fields} loop is impossible and making an embed within this loop is not possible anymore in EE5
I re-code a website using DRY principles with layouts and layouts variables but I get stuck with this :

Into a channel form I have to store each {field\_name} into a {layout:set:append} so I can loop through this list into the layout template and dynamically show some stuff based on the fields name.

```
{exp:channel:form channel="mychannel" entry_id="{segment_3}"}
    {custom_fields}
        {layout:set:append name='lv_the_fields_name'}{field_name}{/layout:set}
    {/custom_fields}
{/exp:channel:form}

```

But setting a layout variable into channel form seems to not be possible/parsed. I get {layout:set name='lv\_the\_fields\_name'}the\_name\_of\_my\_field{/layout:set} in my HTML.

Before having the DRY approach I did show my divs this way in EE3+ (that was not beautiful but worked) :

```
{exp:channel:form channel="mychannel" entry_id="{segment_3}"}
            {custom_fields}
            <section class="cd-help-field field_{field_name}">
                    {embed="modify/_help_{field_name}"}
            </section>
            {/custom_fields}
{/exp:channel:form}

```

This technique worked in EE3+ but not anymore in EE5… it shows {embed="modify/\_help\_myfield"}

Is there a bug into channel form for EE5+ or does somebody know how I can achieve this please?

# Answer
> 0 votes
You are almost there - you just need to correct your syntax. To close a `layout:set:append` tag you need to use the same tag - i.e. `/layout:set:append` \- you left off `:append` from the closing tag.

So try this:

```
{exp:channel:form channel="mychannel" entry_id="{segment_3}"}
    {custom_fields}
        {layout:set:append name='lv_the_fields_name'}{field_name}{/layout:set:append}
    {/custom_fields}
{/exp:channel:form}

```

HTH

---
Tags: safecracker, template-layouts, layout-variables
---


# Question
Title: how to allow the group of members to use an addon?
I developed a driver that handles ajax requests, super admins can use it but I want members to be able to use it too.

# Answer
You can edit the permissions Member Groups have in the Control Panel. This includes allowing access to add-ons, and which add-ons they have access to.

https://docs.expressionengine.com/latest/control-panel/member-manager.html#member-groups

Just edit the permissions to the Member Groups you wish to allow access to your add-on.
> 3 votes

---
Tags: add-on
---


# Question
Title: When installing an SSL certificate the control panel css breaks
I've installed an SSL certificate on a domain and that has the lovely green padlock. However when I log into the control panel, all of the CSS is broken. Any ideas on what I should be doing? CHeers

# Answer
> 2 votes
Just remove the protocol from the Default base URL in system settings \> URL and Path Settings, so you have:

//yourdomain.com/

instead of

http://yourdomain.com/

# Answer
> 1 votes
check your theme folder url. most likely that is set to http

---
Tags: control-panel, css, ssl
---


# Question
Title: Solspace Calendar - Display next 4 events in order of occurence (date/time)
I am replacing an existing channel:entries tag pair which was displaying upcoming events, to now use the Solspace Calendar plugin (previous post here)

All I want to do is display the next 4 upcoming events.

(In order of occurrence - date/time.)
(Any event that has a category checkbox selected will not display.)
(The second/fourth div has a different style class)

```
{exp:calendar:events channel="event" category="not 15" sort="asc" date_range_end="12 months"}
        <div class="hevent">
            <div class="{switch='hedate1|hedate2'}">
                <div class="day">{calendar:event_start_date format="%l"}</div>
                <div class="date">{calendar:event_start_date format="%j"}</div>
                <div class="month">{calendar:event_start_date format="%M %Y"}</div>
            </div>
            <div class="hecont">
                <h4>{calendar:title}</h4>
                <p>{calendar:e_summary}</p>
            </div>
            <div class="hecont">
                <p><i>{calendar:event_start_date_timestamp_utc format="%g:%i%a"} to {calendar:event_end_date_timestamp_utc format="%g:%i%a"}</i>
                <br>{calendar:e_location}</p>
            </div>
        <a href="events/whats-happening#{url_title}" title="{title}"></a>
        </div>
{exp:calendar:events}

```

Using Calendar 2.3.2

It appears that 'event\_limit' no longer works? Also unless I add "date\_range\_end="12 months", then NO results appear, even though the docs note that "If this parameter is not specified, then the default limit of 12 results will kick in".

What am I missing? ANY HELP is appreciated.

# Answer
> 0 votes
Perhaps you're viewing Calendar 1.x docs or sources, as the info you mention appears outdated. Have a look at the date\_range\_end parameter (default value is `today`, which is why you need to specify something like 12 months in a scenario like this).

As for limiting, use the limit parameter (`limit="4"`), as `event_limit` is from Calendar 1.x as well.

---
Tags: solspace, solspace-calendar, orderby, sort
---


# Question
Title: Solspace Calendar - Grid Field & Channel Images + Conditionals
I'm displaying a list of events and details on a page. Replacing the current channel:entries tag pair with the Solspace Calendar:Events tag.

I cannot work out how I am meant to display the current code (below) using the Calendar tags.

e\_image is a channel\_images field. Adding {calendar:e\_image} doesn't work.

```
    {if e_image}{e_image}
    <div class="ceimg2" style="background-image: url({image:url:esml})">
        <a href="{image:url:elrg}" title="{image:title}" class="large"><span>ENLARGE IMAGE</span></a>
    </div>{/e_image}
    {if:elseif e_map && ! e_image}
    <div class="ceimg1">
        <p>VIEW<br>MAP</p>
        <a href="{e_map}" target="_blank" title="VIEW MAP"><span></span></a>
    </div>{/if}

```

I have tried embedding it as a template using {exp:channel:entries channel="event" entry\_id="?" dynamic="no"} but not sure if i am missing something or it's just not possible?

I also have the same issue with details in a Grid field - also tried embedding as a template (as noted in the docs) but cannot understand what I'm doing wrong. Below is part of my original channel:entries code, with some added calendar:events tags. How would I go about embedding this?

e\_contact is the actual grid field, with ename, ephone, etc the individual grid columns.

```
        {e_contact}
        {if e_contact:count == "1"}<a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "2" AND "{e_contact:ephone}" != ""}  <i>or</i>   <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "3" AND "{e_contact:ephone}" != ""}  <i>or</i>   <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {if e_contact:count == "4" AND "{e_contact:ephone}" != ""}  <i>or</i>   <a href="tel:{e_contact:ephone}">{e_contact:ephone}</a> {e_contact:ename}{/if}
        {/e_contact}
        {e_contact limit="1"}{if e_contact:ephone}{/if}{/e_contact}
        {e_contact}
        {if e_contact:count =="1" AND "{e_contact:eemail}" != ""}<a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="2" AND "{e_contact:eemail}" != ""} <i>or</i>   <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="3" AND "{e_contact:eemail}" != ""} <i>or</i>   <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {if e_contact:count =="4" AND "{e_contact:eemail}" != ""} <i>or</i>   <a href="mailto:{e_contact:eemail}?subject={title} - {e_date format="%j%S %M %Y"}">{e_contact:eemail}</a>{/if}
        {/e_contact}
        {e_contact limit="1"}{if e_contact:eemail}</span>{/if}{/e_contact}

```

ANY HELP is appreciated!

# Answer
If you're going to use embeds, you need to make sure you're passing the entry ID from the `{exp:calendar:events}` tag over to the embedded `{exp:channel:entries}` tag inside the embed. That would look something like this:

Main template:

```
{exp:calendar:events
    channel="events"
    date_range_start="today"
    date_range_end="30 days"
    limit="20"
}
   {calendar:title} - {calendar:event_start_date format="%F %j, %Y"}
   {embed="path_to/template" entry_id="{calendar:entry_id}"}
{/exp:calendar:events}

```

Embedded Template:

```
{exp:channel:entries
    channel="events"
    entry_id="{embed:entry_id}"
}
   STUFF
{/exp:channel:entries}

```
> 1 votes

---
Tags: solspace, grid, solspace-calendar, channel-images
---


# Question
Title: Freeform Lite, input error message translation
The main message error could be translated through template code:

```
 {if form:has_errors}
            <div class="callout alert">
                There was an error submitting this form..
            </div>
 {/if}

```

But the input message error: `This field is required` could be translated only by translating `'This field is required'` inside this file: `system/user/addons/freeform_next/Library/Composer/Components/AbstractField.php`

```
 $errors[] = $this->translate('This field is required');

```

So, how to translate the `"This field is required"` message error without to modify the AbstractField.php file ?

# Answer
Translating in EE isn't the most robust, and as far as I understand, it has to be done with a translation file placed inside the add-on's language folder. You can just open up `/system/user/addons/freeform_next/language/english/freeform_next_lang.php`

Then copy and paste that into a folder with your language name at `/system/user/addons/freeform_next/language/`

And add lines like this:

```
'{email} is not a valid email address' => '{email} your translation here',
'This field is required' => 'Your translation here',

```

 If you wish, we can include any translations you provide us with in future releases of Freeform. :)
> 1 votes

---
Tags: solspace-freeform, translation
---


# Question
Title: ExpressionEngine 5 -Maximum number of entries
In previous versions of EE, there was a setting in the Channels called "Maximum number of entries". However, in EE5 I can't find this setting- is it still available?

# Answer
> 3 votes
Yep it is still there. Go to `Developer/Channels` and edit a channel (or create a new one) - the Maximum number of entries value is the third setting field down on the "Channel" tab (i.e. the first one that appears when you edit a channel).

More in the EE documentation.

HTH

---
Tags: entries, ee5
---


# Question
Title: Unable to connect to your database using the configuration settings you submitted
I’m kind of lost on what’s going on here. We are trying to install EE and are getting the error “Unable to connect to your database using the configuration settings you submitted”. I’ve installed many instances of EE and never had an issue with this, but never on IIS. So my first guess is that IIS is the culprit in some way. Side note, I had to install PHP and MySQL Server myself, both of which I’ve never had to do before, so there could be something there as well.

In an attempt to remove variables from the equation, I wrote a quick php script to connect to the database with the credentials I supplied the EE Wizard and was able to successfully connect and write to the database.

I’m not sure what this tells me though, other than it has something to do with how EE is attempting to connect to the database.

I’m not expecting a definitive answer here, just a direction. Any help, guidance or hell even suggestions are greatly appreciated.

**ENVIRONMENT:**
\- IIS - Windows Server 2016 Data Center
\- PHP 7.3.5
\- MySQL 8.0.16 - MySQL Community Server
\- EE 5.2

# Answer
Could be a authenticate problem due a compatibility with MySQL 8

Here an article about this problem:

https://u.expressionengine.com/article/mysql-8-and-expressionengine-tips-for-the-trailblazers

https://stackoverflow.com/questions/49948350/phpmyadmin-on-mysql-8-0
> 0 votes

# Answer
I figured it out in my case. When installing PHP I left the pdo\_mysql extension commented out. Uncomment, restart server and voila!
> 0 votes

---
Tags: database-error, install, ee5
---


# Question
Title: Freeform 4.2.4 on ExpressionEngine 2.11.2
I cannot get emails sent to my inbox from any of the freeforms.

I have tested EE's communication tool and our server successfully. It seems that freeform is no longer compatible with this version of EE.

Is there any way to fix this or revert to an older version of Freeform?

# Answer
> 1 votes
There is no reason why EE2.11.2 and Freeform 4.2.4 would work one day and not the next unless something has changed...

As it is (I am guessing) unlikely that you have changed anything in either the EE2.11.2 or Freeform 4.2.4 code, it sounds like something else has changed. It thus might be worth checking (for example) that nothing has changed on your server (e.g. php version?), or the configuration of your EE installation.

If that investigation doesn't flush any clues out, you could try double-checking your mail setup. You don't say how your EE installation connects to the mail service you use, but another thing worth trying is to change the mail service or mail server (or both).

Hope you find the problem. If nothing works, I would recommend considering another option - upgrading EE to the latest version - EE5 is **so** much better than EE2! The upgrade from EE2 to EE3 is a bit of a game, but much less so these days than it was when EE3 first came out - once you get to EE3 the upgrade to EE5 is usually pretty simple.

HTH

---
Tags: solspace-freeform
---


# Question
Title: Stash id for use in category filtering - help with parse order
I'd like to use a stash'd variable to filter a list of categories, but the following is not working:

```
{if segment_2=="thing1"}
    {exp:stash:set name="cat_id"}22{/exp:stash:set}
{if:elseif segment_2=="thing2"}
    {exp:stash:set name="cat_id"}23{/exp:stash:set}
{/if}

{exp:stash:set_list name="filters" parse_tags="yes"}
    {exp:channel:categories channel="channel1" category_group="{exp:stash:get name='cat_id'}" backspace="6"}
        {stash:category_id}{category_id}{/stash:category_id}
        {stash:category_name}{category_name}{/stash:category_name}
        {stash:category_url_title}{category_url_title}{/stash:category_url_title}
    {/exp:channel:categories}
{/exp:stash:set_list}

```

I think this is a parsing issue, but how do I fix it?

**Update**: I tried this after the answer offered below:

```
{exp:switchee variable="{segment_2}" parse="inward"}
    {case value="thing1"}
        {exp:stash:set name="cat_id"}22{/exp:stash:set}
    {/case}
    {case value="thing2"}
        {exp:stash:set name="cat_id"}23{/exp:stash:set}
    {/case}
{/exp:switchee}

{exp:stash:set_list name="filters" parse_tags="yes"}
    {exp:channel:categories channel="channel1" category_group="{exp:stash:get name='cat_id'}" backspace="6" parse="inward"}
        {stash:category_id}{category_id}{/stash:category_id}
        {stash:category_name}{category_name}{/stash:category_name}
        {stash:category_url_title}{category_url_title}{/stash:category_url_title}
    {/exp:channel:categories}
{/exp:stash:set_list}

```

I also tried: {exp:stash:get name='cat\_id' process='end' }

But still no luck.

# Answer
> 1 votes
First problem: the variable "cat\_id" will get set twice and always have the later value. You could use Switchee instead of if/else. The reason why and some alternative solutions are described here: https://gist.github.com/croxton/9d012297096892ca5c10

Second problem: when you pass a variable in a parameter to a tag, you need to use parse="inward" to tell EE to parse the tag.

```
{exp:channel:categories channel="channel1" category_group="{exp:stash:get name='cat_id'}" backspace="6" parse="inward"}
...
{/exp:channel:categories}

```

---
Tags: stash
---


title: is it really free without any hiddens?

text:
# Question
Title: is it really free without any hiddens?
I used to be a EE user in the early 2000s. I left it after several upgrades. Also found it expensive for a private magazine that I ran. Always loved using it for the precision control of all aspects of a site. I just came by and was delighted to find it’s now free! Are there any annual recurring costs? Thank you

# Answer
ExpressionEngine is a free and open source product now. Downloading, installing, and using commercially is free.

Third-party add-ons and product support from EllisLab still costs money, but if you don't need add-ons or support, it really is free.
> 3 votes

---
Tags: expresso-store, expresso
---


# Question
Title: Error in Control Panel Channel Entries Pages: "EE.grid is not a function"
Using EE 5.2.1

I've been working with a custom module for the last few days and haven't been in the control panel so I'm not sure when this problem started but I *think* it has to do with me making a mistake in another module as I was working on this custom module.

**The Problem:** When I'm in the entry page in the control panel I'm getting a JS error that says ***"EE.grid is not a function"***.

Here's the console:

Or

> Uncaught TypeError: EE.grid is not a function at HTMLDocument. (admin.php?/cp/publish/edit/entry/13:890) at l (jquery.js?v=1552599112:3) at Object.fireWith \[as resolveWith\] (jquery.js?v=1552599112:3) at Function.ready (jquery.js?v=1552599112:3) at HTMLDocument.s (jquery.js?v=1552599112:2)

Here's the error:

That script line is saying:

```
Failed to load resource: the server responded with a status of 406 (Not Acceptable)

```

This hasn't been a problem before so I'm assume I've done something with a module somewhere to screw it up. When I was setting up my new module I was working off several core modules as examples and it's possible I did something with one of them.

Also, I can successfully save/edit entries but things related to files seem messed up. For instance, anything related to a file has a perpetual loading function running:

And if I try to add a new row

(since the JS isn't loading) I just get the hash link and sent back to the top of the page:

I haven't gotten very far in this project and I can save the code I *have* done so it wouldn't be the end of the world to start over, but if it's possible to just reload some core module or something that could possibly fix this that would obviously be better.

# Answer
So you see the JS resource URL that is being loaded? It looks something like this:

`.../admin.php?S=0&D=cp&C=javascript...`

Open that link in a new tab. It is a compiled output of JS resources for the Control Panel. This JS resource is not a raw asset, it is the output of executed PHP. This means that if your CP is reporting errors or notices, **they show up in your JS resource file**. This means that the JS file your Control Panel is trying to load starts with a warning or error report that is **not valid JavaScript**, meaning your web browser can't properly use the JS resource your Control Panel needs.

So open that resource in a new tab raw, look at what the PHP error/notice is being reported, and resolve it. Don't forget to clear both local and any infrastructure cache that might exists for that URL.
> 1 votes

---
Tags: control-panel, file-uploads, javascript, entries, file-manager
---


# Question
Title: InnoDB or MyISAM - What's the "correct" database storage engine for EE4/EE5?
As I am looking into my database via phpMyAdmin I see that most of the tables are MyISAM, some are InnoDB (e.g. from plugins). As far as I read in the web InnoDB is known as "better", but I am no expert.

As I have been upgrading EE for years I am not sure if it's problematic if MyISAM is used instead of InnoDB. Also I would like to know if it could cause problems with EE to convert all tables to InnoDB.

Thanks in advance!

# Answer
EE now defaults to using InnoDB type tables in MySQL.

The docs have instructions on how one can convert MyISAM tables to InnoDB (here).

Whether it makes any difference on an average site is moot, and there should be no issues if you run a site with a mixture of MyISAM and InnoDB tables.

HTH.
> 1 votes

---
Tags: database, ee4, ee5
---


# Question
Title: How do I add .jpf mime type to config.php?
In order to upload JPEG2000 (.jpf) images to a site I need to add a new mime type to config.php. What is the correct way to do this?

# Answer
> 1 votes
There is a configuration override you can use here:

https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#mime\_whitelist\_additions

Just use that in your config file to add your custom mime types to the whitelist.

---
Tags: image
---


# Question
Title: Is it possible to add an image field into Freeform pro?
Is it possible to add an mage field into Freeform pro? Maybe a footer image field.

The reason for this is, that we are doing forms for business awards and need to have sponsors logo on all the pages.

# Answer
> 0 votes
If you’re referring to using the new Freeform (“Next”), you can simply add an HTML special field type to your form in Composer and set an image there. You can ALSO just hard code image into a formatting template for forms.

If using Freeform Classic (old Pro or Free), there isn’t an HTML field but you can also just add the logo image code to your main EE template(s) the form sits in.

# Answer
> 0 votes
Another approach is to use a channel to create your form pages, and use Freeform's fieldtype to select the form you want to use in your entry. This means you can populate your entry/page content using normal EE fields the inserting the form wherever you want it to appear.

---
Tags: solspace-freeform
---


# Question
Title: Break a single entry into an arbitrary number of pages?
The documentation describes using separate fields to create pages for an entry. But how can I create pages arbitrarily? There are multiple reasons I don't want to create a separate field for each page. The Simple Pagination plugin looks like what I want, but it isn't available anymore.

# Answer
> 0 votes
I am not aware of either a built feature or an add-on that will let you break a long entry in to smaller chunks in a way that will let you spread these across several pages, but others might.

There are possibly ways that you could achieve this result within EE without an add-on, but they would be non-trivial solutions to implement.

I suspect it would be easier to do this within the page using javascript / css (i.e. send the whole entry to the page, and do the chunking of the entry into blocks in javascript, or simply use CSS to allow the text part to scroll on that window within its block etc.

HTH

---
Tags: pagination
---


# Question
Title: Migrating entire site from V2 to Open Source - how?
We have an EE site built on v2.10.1 and it’s creaking at the seams. The site was designed and developed by an external agency about 4 years ago before my time began here. I am a Wordpress veteran, but before we make the decision to move over to Wordpress, we have been considering re-building the site on the new EE open source platform.

I guess my question to you all is, what is the process of migrating the content from an old version to the new open source. Are there any drawbacks? - or is it just an EE install on a new server and copy the content over?

Your comments, advice would be greatly appreciated.

regards Naomi -

# Answer
> 1 votes
In summary it is a bit more complex than just copying over the data - there have been some changes in how EE operates internally that require your data to be updated to operate on the latest EE versions. Also the way in which add-ons to EE work changed significantly with EE3, and so it is possible that you will need to change / update some of these too if your site uses any.

The process is certainly doable, and many EE2 sites are making the shift to EE5 now that it is open source. The change is almost certainly going to take less effort than rebuilding the site in Wordpress, plus EE5 is a really nice product (faster, more features, easier to use) so your site on EE5 will be alot better than it is on EE2.

There are some suggestions about what you need to do here.

If you have specific questions that go beyond what is covered there, just add them in here as replies and I am sure you will get helpful guidance from the community. But as the linked answer points out, the updating process is one that it might make sense to subcontract to someone who has done it before... :)

HTH

---
Tags: migration
---


# Question
Title: How can I troubleshoot this EE3 > EE5 upgrade error?
I've been struggling with this for a week or two and I'm completely stuck. I've also posted the question here without success: https://expressionengine.com/forums/topic/252326/error-when-finally-updating-to-5.2.2-from-3.x

Here's my error after what appeared to be a successful EE3 \> EE5 upgrade. It seems to only happen on my Home/index page, but all other pages work perfectly fine. Does anyone recognize this error?

> Exception Caught
>
> SQLSTATE\[42S22\]: Column not found: 1054 Unknown column ‘m.url’ in ‘field list’: SELECT t.entry\_id, t.channel\_id, t.forum\_topic\_id, t.author\_id, t.ip\_address, t.title, t.url\_title, t.status, t.view\_count\_one, t.view\_count\_two, t.view\_count\_three, t.view\_count\_four, t.allow\_comments, t.comment\_expiration\_date, t.sticky, t.entry\_date, t.year, t.month, t.day, t.edit\_date, t.expiration\_date, t.recent\_comment\_date, t.comment\_total, t.site\_id as entry\_site\_id, w.channel\_title, w.channel\_name, w.channel\_url, w.comment\_url, w.comment\_moderate, w.channel\_html\_formatting, w.channel\_allow\_img\_urls, w.channel\_auto\_link\_urls, w.comment\_system\_enabled, m.username, m.email, m.url, m.screen\_name, m.location, m.occupation, m.interests, m.aol\_im, m.yahoo\_im, m.msn\_im, m.icq, m.signature, m.sig\_img\_filename, m.sig\_img\_width, m.sig\_img\_height, m.avatar\_filename, m.avatar\_width, m.avatar\_height, m.photo\_filename, m.photo\_width, m.photo\_height, m.group\_id, m.member\_id, m.bday\_d, m.bday\_m, m.bday\_y, m.bio, md.*, wd.* FROM exp\_channel\_titles AS t LEFT JOIN exp\_channels AS w ON t.channel\_id = w.channel\_id LEFT JOIN exp\_channel\_data AS wd ON t.entry\_id = wd.entry\_id LEFT JOIN exp\_members AS m ON m.member\_id = t.author\_id LEFT JOIN exp\_member\_data AS md ON md.member\_id = m.member\_id WHERE t.entry\_id IN (3737) ORDER BY t.sticky desc, t.entry\_date desc, t.entry\_id desc
>
> ee/legacy/database/drivers/mysqli/mysqli\_connection.php:117
>
> Blockquote
>
> Stack Trace: Please include when reporting this error

```
0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query(‘SELECT t.entry…’)
1 ee/legacy/database/DB_driver.php(270): CI_DB_mysqli_driver->_execute(‘SELECT t.entry…’)
2 ee/legacy/database/DB_driver.php(180): CI_DB_driver->simple_query(‘SELECT t.entry…’)
3 ee/EllisLab/Addons/channel/mod.channel.php(248): CI_DB_driver->query(‘SELECT t.entry…’)
4 ee/legacy/libraries/Template.php(1847): Channel->entries()
5 ee/legacy/libraries/Template.php(1482): EE_Template->process_tags()
6 ee/legacy/libraries/Template.php(578): EE_Template->tags()
7 ee/legacy/libraries/Template.php(234): EE_Template->parse(‘{!– ra:0000000…’, false, 1, false)
8 ee/legacy/libraries/Template.php(165): EE_Template->fetch_and_parse(”, ”, false)
9 ee/legacy/libraries/Core.php(661): EE_Template->run_template_engine(”, ”)
10 ee/legacy/controllers/ee.php(63): EE_Core->generate_page()
11 [internal function]: EE->index()
12 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
13 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
14 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
15 public_html/index.php(173): require_once(‘…’)
15 public_html/index.php(173): require_once(‘…’)

```

# Answer
> 0 votes
The EE 4.0.0 upgrade script did some wackiness with some of the member fields and moved them from columns to to their own data table, and URL is one of them. However, if it didn't exist as a column before, it just does nothing I believe. Is this a system that was originally on `EE1`? I have a suspicion that the `EE1 -> EE2` upgrade doesn't create/move over some member columns/fields that a raw install of `EE2.X` creates. Just a theory.

It's a buggy step in the upgrade. Also, you might have an add-on or something looking for that column when it doesn't exists. Honestly, I would just create that column in the `exp_members` table and it'll probably do the trick. I looked up a pre-EE4 system and got the structure for that column:

```
`url` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL

```

So just fire up your favorite MySQL tool and create that column.

Also, I read your question on the forum. I absolutely recommend going one major version at a time (if you do any future EE upgrades), and upgrading add-ons in-between. For major EE upgrades I even have a set of the update scripts modified to log **every** function fire to watch for where things fail or stall. I've upgraded some behemoth EE systems in the last few years.

---
Tags: ee
---


title: Setting up Fields and Logic

text:
# Question
Title: Setting up Fields and Logic
I’ve got a filtered portfolio project where the user will be able to add images or videos which pop up (like an overlay) without directing to another page. The user can also opt to add text content which then designates that the entry SHOULD direct to another page. This is all based on a class (ajax-link, video-link, or image-link). I am trying to figure out how to configure the backend entry fields and the logic on the template that allows EE to know what class the user has selected.

Below is a sample of the three entry types coded out in HTML. I’ve highlighted the three content types. The image and video aren’t different, because they’re just direct URLs - but the issue I can’t seem to figure out is how to code the entry tag when the user wants to direct to another page.

The “ajax-link” class is the one that sends the user to a separate page.

```
                         <!--Portfolio Item-->
                            <div class="item col-lg-4 col-sm-6 catering">
                                <a class="image-link" href="img/portfolio/img-1.jpg">
                                    <figure>
                                        <img src="img/portfolio/img-1.jpg" alt="">
                                        <figcaption>
                                            <h4>Book Design</h4>
                                            <p>Graphic</p>
                                        </figcaption>
                                    </figure>
                                </a>
                            </div>

                            <!--Portfolio Item-->
                            <div class="item col-lg-4 col-sm-6 roomservice">
                                <a class="ajax-link" href="{path='home/single-work'}">
                                    <figure>
                                        <img src="img/portfolio/img-2.jpg" alt="">
                                        <figcaption>
                                            <h4>Notepad Design</h4>
                                            <p>Design</p>
                                        </figcaption>
                                    </figure>
                                </a>
                            </div>

                            <!--Portfolio Item-->
                            <div class="item col-lg-4 col-sm-6 interviews reno">
                                <a class="video-link" href="YouTube URL">
                                    <figure>
                                        <img src="img/portfolio/img-3.jpg" alt="">
                                        <figcaption>
                                            <h4>Creative Cup</h4>
                                            <p>Graphic</p>
                                        </figcaption>
                                    </figure>
                                </a>
                            </div>

```

I’m not sure how to set this up with conditionals or on the backend so that the site “knows” what to do based on what class the user has input.

Any help would be so greatly appreciated!!

# Answer
> 1 votes
If you are using EE5 then one solution would be to use a Fluid field. Set up the Fluid field to allow the user to pick one of three fields (one for each of your cases) and then in your template you can set it up to use the appropriate HTML depending on which of the defined Fluid field types the user chose.

It is pretty easy to do, and gives you much more control / flexibility than you might think.

More on Fluid fields here.

HTH

---
Tags: conditionals, custom-fields, fields, advanced-conditionals
---


title: How to run EE3 Installer

text:
# Question
Title: How to run EE3 Installer
I am upgrading from EE2 to EE3. I have the latest version (2.11.9) and have followed the steps to download EE3, copy the config.php and database.php files, disable and remove plugins, and then copy /system, /themes/, admin.php, and index.php over.

However, after that, when I visit /admin.php to run the installer, I can't get it to run. It just shows me an error:

> SQLSTATE\[42S02\]: Base table or view not found: 1146 Table 'xyz.exp\_plugins' doesn't exist: SELECT `plugin_package` FROM (`exp_plugins`) ee/legacy/database/drivers/mysqli/mysqli\_connection.php:122

Can anyone tell me how to get the installer to run? I also tried visiting /system and /system/ee/installer in the browser.

I got the upgrade instructions here:

https://docs.expressionengine.com/v3/installation/upgrade\_from\_2.x.html

I got EE3 from here (master-v3 branch):

https://github.com/ExpressionEngine/ExpressionEngine/tree/master-v3

# Answer
When upgrading to v3, you have to download the specific release tag instead of just downloading the v3 master branch. This is the link:

https://github.com/ExpressionEngine/ExpressionEngine/releases/tag/3.5.17

Then, the installer folder will be there and automatically run when visiting /admin.php.

Be sure to download the 1st file on that page named after the release and NOT the source code zip. The source is not packaged as an app to be deployed to a production website.
> 1 votes

# Answer
Seems to be an add-on problem. So try to uninstall, or update it this add-on before to to the update. Check if this addon is EE3 compatible or not, if it still exists, and if it is useful or not.

Could have a look here: EE2 upgrade to EE3, how to upgrade addons?

Will add-ons for EE2 work in EE3?
> 1 votes

# Answer
Try to visit the installer directly; it sounds like your `admin.php` file is trying to load the Control Panel system and not the installer. The `plugins` table is created in the EE 3.0.0 update script, which clearly hasn't run yet.

Something might also be wacky in your `config.php`, making EE think it is already upgraded. Make sure your config file version number matches 2.11.9.

Try to visit this URL (replace the proper terms for your domain/environment):

```
www.mydomain.com/system/installer/index.php

```
> 1 votes

---
Tags: ee2, ee3, upgrade, ee2-upgrades
---


title: Mod_Security Roadblocks, Hosting EE

text:
# Question
Title: Mod_Security Roadblocks, Hosting EE
I am experiencing recurring issues related to Mod\_Security with EE on my current host, HostGator. I have seen HostGator suggested as a good host for EE projects in several articles and my work already has a production server there so that's what I've been using, however a little while back I experienced an issue with JS libraries not loading in the admin control panel which turned out to be a Mod\_Security issue, and HostGator does not have any Mod\_Security settings in their Cpanel, so I had to have a back and forth with their support team which took several days to resolve.

I am now getting another Mod\_Security message when I try to use the EE Chanel Form tags.

To test the feature I made this simple form:

```
{exp:channel:form channel="order_reports"}
    <input type="text" name="title">
    <input type="submit" value="Submit">
{/exp:channel:form}

```

And when I submit I get this:

> Not Acceptable! An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod\_Security.

I do not want to have to contact support for my host every time I need to run a form post action, or anything else for that matter.

Since HostGator no longer seems viable due to their lack of Mod\_Security controls, I would like to know from some people here who have experience with the more complex features of EE what hosts they use or would suggest. I will need to switch from HostGator and I am not in a position to troubleshoot a bunch of different hosts until I find one that doesn't have a problem with EE.

Thank you!

# Answer
> 1 votes
Your best bet is still to open a support ticket with HostGator and asking them to 'whitelist' those mod\_sec rules that are causing the problem. As EE5 isn't as common as say WordPress, most hosting providers therefore don't have the relevant rules whitelisted as they don't have clients that have run into the issue (yet).

If you ask them nicely they might be able to do this for your server/all domains you want to use EE5 with.

Most shared hosts will have the same issue unless they already have clients running EE sites and have whitelisted the rules server wide.

---
Tags: safecracker, security, server, hosting
---


title: EE 1.6.9 blank page

text:
# Question
Title: EE 1.6.9 blank page
I have a very old website made with EE 1.6.9 which was working without problems. I had to move it to another server and while the admin section is working properly, the website it totally blank.

Any idea of the problem ?

# Answer
Does the new server run a different version of PHP? If possible and you have the option to do so, you could try lowering the version of PHP down to 5.6 or 5.4 and see if that resurrects the site.
> 1 votes

# Answer
Ooof. I hope you have very good luck and this is a simple missing PHP module or something, but EE1.6.9 is going to be very hard to support. I can't find a copy of EE1.X to help much, but a white screen of death (WSOD) is almost always a fatal PHP error occurring before there is any output, resulting in an empty response.

In your `index.php` file, there will be some way to set error reporting all the way on. In EE2+, the way to set debugging on is by setting this variable to a value of 1 in your `index.php`:

```
$debug = 1;

```

I'm not sure if it is the same in EE1.X. If that doesn't work, you can try forcing it using native PHP:

```
error_reporting(E_ALL);
ini_set('display_errors', 1);

```

That should get your front end to actually report the error occuring. From there just resolve the error if you can.
> 0 votes

---
Tags: blank-screen
---


title: Cron Job to Clear Cache in EE3

text:
# Question
Title: Cron Job to Clear Cache in EE3
I have an ExpressionEngine 3 site that the client doesn't want to upgrade but we need to clear the cache weekly. I'd like to set up a cron job to do this.

Is this possible? If so how?

Thank you.

# Answer
You can use this Cron Clean Cache addon:

https://expressionengine.com/add-ons/cron-clean-cache

https://expressionengine.com/add-ons/cron

Easy to implement and working fine !
> 0 votes

# Answer
Maybe a bash or php script, external from EE, that flushes the /user/cache/\* folder.
> 1 votes

# Answer
Here's how you'd delete cache every Sunday at 12:00 AM.

Run crontab -e

Define:

0 0 * * 0 rm /path/to/user/cache/\*
> 0 votes

---
Tags: cron
---


# Question
Title: EE5 read from template files instead of database
I recently upgraded from EE2 to EE5. For my template groups and templates, I had a /templates folder that I used to save/load my templates. So the site read from that folder and not the database.

In EE5, for some reason I cannot get it to do the same, so now it is trying to load all templates from code saved in the database instead of the template files.

During the upgrade, the /templates folder was moved to /system/user/templates. I also added this to my config.php file:

```
$config['save_tmpl_files'] = 'y';

```

But that also didn't work. Anyone know how to force EE5 to read templates from files instead of database?

# Answer
> 0 votes
The system still the same, the template path since EE3 is different from the EE2 one. If the template code is no cached, always are read from the database.

Templates files are very useful to edit the content at your own, to edit them inside your prefered text editor, IDE, than inside the Control Panel.

When the EE system cache is used, or an other one, the templates are read from the cache to speed up the access time, so the site performances.

So, no need to worry about this problem **(EE5 read from template files instead of database)** if you can edit the template yourself in text editor. It's implemented from EE3 version, and many other addons as Low Variables for example, that directly saves templates, snippets, variables to files.

# Answer
> 0 votes
Well, if you have created any template from Template Manager in ExpressionEngine, it always saves and read from database. As Stephane says, it only change if **Caching** comes into the picture.

In your case, EE5 allows to change the Template directory path if you want. So, it is possible to move your **Templates** to any separate folder in your `public_html` and manages from there. And also you have facility to change the template code from Template Manager by directly editing the template from Admin Panel.

---
Tags: templates, ee5
---


# Question
Title: CE Image, variable not parsed inside src image
I tried to insert a custom field variable, Stash here, a simple custom field as a text field works fine (the value is parsed), but when I use a pair tag (as Fluid, Grid or another add-on), or a Stash variable, the value is never parsed:

```
{exp:ce_img:single src="{text_ee_field}"}

{exp:ce_img:pair src="{text_ee_field}"}
    <img src="{made}" />
{/exp:ce_img:pair}

```

give

```
<img src="http_lorempixel.com/400/200_400_200.jpg">
<img src="http_lorempixel.com/400/200_400_200.jpg">

```

Using a **variable** (Stash, EE, Low Var....), or a **tag pair** from Grid, Fluid, or other addons, doesn't work, I get blank code.

```
{exp:stash:set name="image"}http://lorempixel.com/400/200/{/exp:stash:set}

{exp:ce_img:single src="{exp:stash:get name="image"}"}

{exp:ce_img:pair src="{exp:stash:get name="image"}"}
    <img src="{made}" />
{/exp:ce_img:pair}

```

What could be the problem ?? A parse order ?? Priority ?? I tried **parse="inward", priority="0"**. Even tried a Stash embed method with the **parse="start"** parameter, with no results.

# Answer
> 1 votes
Stash is very useful sometimes, but also is notorious for exactly this kind of obscure fail behaviour. Just look at the kind of questions asked about stash in this forum and you will see that you are not alone in encountering baffling behaviour.

There probably is a cute / concise solution to your problem: I'm not sure I have such for you, but do have two suggestions:

1. you might want to try wrapping your ce-img code within a stash parse tag - this simple coerces EE to evaluate whatever it contains multiple times, and can sometimes fix the kind of issue you are having - more here.
2. A better solution (I think at least) would be to replace stash with a layout variable - means splitting your template into (at least) two parts, but you can then access the values you save on the first template in the layout stack on subsequent templates - so just save your image definition on the first template in the sequence and recall it in your CE Image tag later on. More on layout templates and variables here.

Why are layout variables better? I think because they work, and because solutions that do not rely on an add-on are usually better than ones that do. You can't always avoid them, but in my view if you can you should!

HTH

---
Tags: parse-order, variable, ce-image, parameters, parsing
---


# Question
Title: DevDemon Forms Add-on with Expression Engine 4
Has anyone used the Forms add-on with `EE4`? DevDemon lists 4 as supported but I'm running into some issues and haven't found any solutions.

I've upgraded my site from previous versions of EE so I have an existing form. The form loads on the site. However some fields are incorrect/missing values and when editing the form in EE I get the following error in a dialog: `Failed to load Default Forms Fields.. See`XHR`Response.`

I can make updates to the form and `save` but they aren't actually saved.

Submitting the form on the site results in the following error:

```
Fatal error: Class 'DevDemon\Forms\Service\PHPMailer' not found in
/var/www/vhosts/[...]/system/user/addons/forms/Service/FormEmail.php on line 590

```

# Answer
I think this might be a misunderstanding:

> DevDemon lists 4 as supported

Unfortunately Forms is only compatible with EE2 and EE3 at this time:

http://www.devdemon.com/expressionengine-addons/forms

> REQUIREMENTS
>
> ExpressionEngine 2.3.1+ or ExpressionEngine 3

We hope to update it for EE4 soon!
> 1 votes

# Answer
I was having this issue on EE3. For anyone else having the issue, I changed the Email Library setting in Forms from PHP Mailer to EE Internal and that bypasses the issue
> 1 votes

---
Tags: add-on, forms, devdemon, ee4, ee4-upgrade
---


# Question
Title: Get average rating from a Super Search results set
I have a series of super search results listing pages displaying lists that are all rated with the Ratings module.

I want to get the average rating of *all* the entries in the list to put into schema markup (as opposed to the average rating for each entry which is what the `exp:rating:stats` tag would do).

I thought I could do it with the query module because I've used it for a similar case elsewhere on the site, except that there it's working out the average of all the ratings on the *site*, not just those from a particular page.

I can save the list of IDs to a variable with Stash:

```
  {exp:super_search:results}
        {exp:stash:append_list
              name='ids'
              context="@URI"
        }{stash:id}{entry_id},{/stash:id}{/exp:stash:append_list}
  {/exp:super_search:results}

```

which outputs as expected, i.e. `1,2,3` etc. but if I try to input that into a query like

```
  {exp:query
        sql="SELECT count(entry_id) as `count`, avg(rating) as `avg` FROM exp_ratings WHERE entry_id IN ({exp:stash:get_list
        name='ids'
        backspace='1'
        process='end'
        context='@URI'
  }{id}{/exp:stash:get_list})"
        parse='inward'
  }
 {/query}

```

I get a WSOD.

I've also tried the above with all the line breaks removed.

If I replace the `get_list` in the query with the actual values that the list outputs if used outside the `query`, e.g.

```
  {exp:query
        sql="SELECT count(entry_id) as `count`, avg(rating) as `avg` FROM exp_ratings WHERE entry_id IN (1,2,3)"
        parse='inward'
  }
 {/query}

```

I get the expected output. So the query itself is fine, it's just trying to use a dynamic Stash variable which seems to be causing the WSOD.

Does anyone have suggestions as to how I could accomplish the task?

# Answer
> 0 votes
After a bit more searching I found that passing variables into EE's query module to be problematic with a lot of workarounds using PHP variables or plugins instead.

So I wrote a quick plugin to handle the query and ended up doing this in the template:

```
{exp:stash:parse process='end'}
  <script type='application/ld+json'>
  {
    "@context": "http://schema.org/",
    "@type": "CollectionPage",
    "aggregateRating": {
      "@type": "AggregateRating",
      "ratingCount": "{super_search_total_results}",
      "ratingValue": "{exp:td_tours_average_rating ids="{exp:stash:get_list name='st_schema_ids' backspace='1' context='@URI'}{schema_id}{/exp:stash:get_list}" parse="inward"}"
    }
  }
  </script>
  {/exp:stash:parse}

```

---
Tags: stash, supersearch, query, solspace-rating, query-module
---


# Question
Title: Run Expressionengine hook to trigger Netlify deploy on save
I have built templates to export my EE site as a JSON API. I am trying to set up a static site generator deploying to Netlify.

What I want is to run a curl command when I create a new entry or update an old one to trigger a build and deploy by Netlify.

```
curl -X POST -d '{}' https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXX

```

I am pretty familiar with PHP but zero experience with EE. What would be the best way to achieve this?

Thanks.

# Answer
> 1 votes
You'll want to write an Extension that is fired by this extension hook:

https://docs.expressionengine.com/latest/development/extension-hooks/model/channel-entry.html#before\_channel\_entry\_saveentry-values

Extension docs:

https://docs.expressionengine.com/latest/development/extensions.html

When all set up, you'll have a method in your Extension class that is called whenever you save a new entry or update an existing one. That method will look like this:

```
public function my_extension_method($entry, $values)
{
    // Here I would recommend instantiating a Curl library to perform your curl actions
}

```

Please review the docs and let us know if you get stuck, I could probably expand my example if needed.

---
Tags: ee2
---


title: Channel Form Only Showing For One User

text:
# Question
Title: Channel Form Only Showing For One User
EE 5.2.2

I'm using the channel form tag to update a channel from the frontend. It works when I am logged in as my admin user but if another user is logged in the form doesn't even render.

I'm just using a basic form to test the functionality:

```
    {exp:channel:form channel="{my_channel}" return="/{my_page_index}"}
        <input type="text" name="title">
        <input type="submit" value="Submit">
    {/exp:channel:form}

```

When logged in as my admin user, the form shows and works just fine. But when another user is logged in the form doesn't render for them.

I was looking for a parameter that is possibly not being applied that would prevent the form from showing to non-admin users in the documentation (https://docs.expressionengine.com/latest/channels/channel-form/overview.html) but didn't find anything that seemed to apply.

What could be the reason why my channel form tag isn't rendering for everyone?

# Answer
> 1 votes
There is no parameters to set these things. You have to change settings from backend.

Go to `Members > Member Groups > EDIT MEMBER GROUP` to find this setting: https://nimb.ws/YALHnf

Allow access to given member group to add entries from frontend and now you are able to view channel form as another member. :)

---
Tags: channel-entries, members, safecracker, channel
---


# Question
Title: CE Cache - if page not yet cached, error: Base table or view not found
If a **not cached page** is accessed for the first time, give an error message (EE cache is disabled from the control panel).

When this same page is accessed one more time, the page is well displayed, no error message.

How this problem could be solved ?

**Using this CE Cache syntax for the main template:**

```
    {exp:ce_cache:it id="ce_principal" global="no" seconds="604800"}
        {exp:stash:get name='main_content'}
    {/exp:ce_cache:it}

```

(EE cache is disabled from the control panel)

**Inside the CE Cache control panel page, if i want to see a cached page appears this error message:**

> Fatal error: Uncaught Error: Call to a member function hasModule() on null in /home/mysite/system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php:1179 Stack trace: #0 /home/mysite/system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(943): EllisLab\ExpressionEngine\Controller\Addons\Addons-\>getModule('ce\_cache&S=1c17...')
>
> # 1 \[internal function\]: EllisLab\ExpressionEngine\Controller\Addons\Addons-\>settings('ce\_cache&S=1c17...',
>
> 'view\_item', 'file&item=ce\_ca...', '663b4b', 'global', 'js\_main') #2 /home/mysite/system/ee/EllisLab/ExpressionEngine/Core/Core.php(241): call\_user\_func\_array(Array, Array) #3 /home/mysite/system/ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\mysite\Core\Core-\>runController(Array) #4 /home/mysite/system/ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core-\>run(Object(EllisLab\ExpressionEngine\Core\Request))
>
> # 5 /home/mysite/www/admin.php(147): require\_once('/home/cistosara.. in
>
> /home/mysite/system/ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php on line 1179

# Answer
> 1 votes
It looks from the last error you reported that the CP issue is being caused by a configuration error - EE is trying to delete an entry from a table that doesn't exist (the table `exp_ce_cache_tagged_items`).

The table is installed by CE-Cache during initial install and / or updates if it does not exist. The table is defined both in CE-Cache 1.10.1 (EE2) and CE-Cache 2.0.2 (EE3), so whether your install is a new build or an update from an earlier version, this table should be present.

If it is absent (you could check by having a look at the MySQL database for the site using a MySQL utility such as SequelPro or phpMyAdmin) you probably need to add it back... either doing so manually in the MySQL or uninstalling / reinstalling the add-on from a clean copy of the add-on code (the install code will recreate the table if it is not present when the install routine runs). Reinstalling is probably the better option here, as the absent table may not be the only issue with the install.

If fixing the missing table doesn't do the job, post back with info on whether the errors change after the table is back in the MySQL, and also things like which version of the add-on and EE you are using and so on.

HTH

---
Tags: mysql, ce-cache
---


title: Expression Engine 1.6.8 CMS 500 Errors

text:
# Question
Title: Expression Engine 1.6.8 CMS 500 Errors
We've got a website that uses EE 1.6.8 (I know very old and soon to be replaced).

The front end website works fine with no issues at all, which is great. The issue that I've got is when I login to the CMS and try to edit certain pages it gives an error 500. This happens on about half the pages if I try and go into them, however the other half work fine without issue.

Nothing has changed from my side of it so I suspect there was some change on the shared hosting platform (Fast Hosts) but I can't get anywhere with my hosting company.

I don't dare change anything too drastic because the live website is working fine, so I don't want to risk this going down or I would have a serious problem on my hands.

Any ideas of what I can check as it's really frustrating.

TIA P.S I'm a total newbie to EE and have no experience with it apart from the CMS.

# Answer
Check the php version. And mod\_security setting with hosting provider...
> 0 votes

---
Tags: white-screen-of-death, error-500
---


# Question
Title: Output/Debugging: What does the exclamation mark mean and how to interpret it?
When I turn on output and debugging I get an exclamation-mark in some cases (only in "templates"), like this:

What does this mean and how can I get more information about the error?

Thanks in advance!

# Answer
The right answer is: exclamation mark means a LOG item. For your current log item (screenshot you provided), this log item register from `system/ee/legacy/libraries/Extensions.php` file.

So it register assets extension method that is calling on `channel_entries_query_result` hook.

In short, Nothing serious, Just a log message.
> 3 votes

---
Tags: debugging
---


# Question
Title: Publish Layout - randomly reorders fields EE 5.2.2
I updated an EE 2.10 site to EE 5.2.2 a couple of weeks ago.

Today the client requested some new fields be added to a channel. I added them and went to move them into the correct position in the publish layout. Only one moved and saved. The other field stayed at the bottom despite movign and saving a few times.

I kept trying and now all the fields move into a random order each time I save the layout. How do I get the layout to work as expected?

# Answer
> 1 votes
Oh boy, this sounds like a bug I had in EE3 (https://expressionengine.com/support/bugs/21971/Layout-Order-Messing-Up#comment\_17258). My workaround was making a new layout vs. editing an existing one. I'd recommend giving that a shot (a simple layout to start) to see how that goes.

# Answer
> -2 votes
To reorder the fields I'm using Low Reoder that permit to sort entries:

https://gotolow.com/addons/low-reorder

---
Tags: control-panel, bug, publish-layout
---


title: Fluid Fields Not Working

text:
# Question
Title: Fluid Fields Not Working
I am trying to wrap my brain around fluid fields, and the documentation isn't helping me AT ALL. How do I get these to display on my site?

**The channel is**: Portfolio

**The fluid field is**: portfolio\_popup\_image

**The sub-fields within the fluid field are**: portfolio\_caption, portfolio\_image, and portfolio\_image\_alt\_text.

Here's my template sample:

```
<!--Portfolio Item-->
{exp:channel:entries channel="portfolio"}

    <!--Portfolio Item-->
    {portfolio_popup_image}

        <div class="item col-lg-4 col-sm-6 catering">
            <a class="image-link" href="{portfolio_popup_image:portfolio_image}">
                <figure>
                    <img src="{portfolio_popup_image:portfolio_image}" alt="{portfolio_popup_image:portfolio_image_alt_text}">
                    <figcaption>
                        <h4>{title}</h4>
                        <p>{portfolio_popup_image:portfolio_caption}</p>
                    </figcaption>
                </figure>
            </a>
        </div>

    {/portfolio_popup_image}
{/exp:channel:entries}

```

I have been looking at the instructions and my template for over an hour and can't get anything to work. Any help would be greatly appreciated.

# Answer
> 1 votes
Fluid fields are designed to allow the user creating a channel entry to choose which fields are included in the entry. So when you are designing your template you cannot make assumptions about which fields the user will have chosen, or (to some extent) how many, or in what order. So template processing of Fluid fields needs to be handled differently to what you may be used to.

In your example code it is written as though you are confident that the user will provide values for each of the three 'fluid' fields you have defined. For this kind of scenario you might be better off using a Grid field - where you can specify that to complete the entry the user must provide all three grid field values before they can save the entry. The template code you have provided would work if your field was a grid field.

To use a Fluid field you approach things slightly differently. Your code would look more like this:

```
<!--Portfolio Item-->
{exp:channel:entries channel="portfolio"}

    <!--Portfolio Item-->
    {portfolio_popup_image}

        {portfolio_popup_image:portfolio_caption}
            ... HTML to insert if (and every time) a caption field is speciied in channel entry...
        {/portfolio_popup_image:portfolio_caption}

        {portfolio_popup_image:portfolio_image}
            ... HTML to insert if (and every time) an image field is speciied in channel entry...
        {/portfolio_popup_image:portfolio_image}

        {portfolio_popup_image:portfolio_image_alt_text}
            ... HTML to insert if (and every time) an alt-text field is speciied in channel entry...
        {/portfolio_popup_image:portfolio_image_alt_text}

    {/portfolio_popup_image}
{/exp:channel:entries}

```

Within each of the fluid field HTML blocks you still need to be able to specify where the actual values assigned to each fluid field appear, and you do this using the special tag `{content}`.

The Fluid Field documentation is now pretty clear on how to use the field, and has some good examples, so if you are still not sure go back and give it a read.

Based on what you describe in your question however, I think you really should consider using a Grid field instead.

HTH

# Answer
> 0 votes
Are you looking to solve your problem at-hand, or research Fluid fields in general? As jcogs said, a Grid field would be better in this case. But FYI, if you simply want to know more about Fluid, think of a Fluid field containing a text, image (tall), and image (wide) fields. You would let your author define however many of each they want, and order them however they want. So when amount defined (including zero), and/or order isn't constrained, Fluid is great.

---
Tags: ee5, how-to, fluid-field
---


title: How many queries is too many?

text:
# Question
Title: How many queries is too many?
How many queries on a page would be considered too many and should be looked into?

I site I am currently working on has about 20 - 30 queries per page.

Is that pretty good or do I need to to look into lowering that number?

Just not sure what is average or typical.

Thanks.

# Answer
> 2 votes
Although in general it is good practice to find ways to minimise the number of queries on a page, it probably doesn't matter too much: what is more important is getting the information you need on the page with a level of performance that meets your site's requirements. Also remember that EE is running loads of queries in the background to process your template tags, so the amount of effort is not just limited to the number of queries you run yourself. As a guide a data intensive page (multiple layouts and embeds) on a site I maintain requires about 200 queries to build.

If you think your loading times are too long, then the EE built in debug tools provide useful information about the overall amount of time and effort a page requires to put onscreen. You can speed up most sites using a combination of its caching tools and its template layout system, plus if you have the time / resources it plays nicely with other caching technologies as required.

HTH

# Answer
> 2 votes
The number of queries isn't normally that important, it's the page loading times you need to watch. Saying that if you're reaching several hundred or thousand queries per page it's worth looking to see what's causing it and optimising where you can.

Personally I try to keep queries below 100/200 per page before caching, after caching below 50 where possible.

# Answer
> 0 votes
If you use the developer tools for your browser, e.g., Chrome's (Ctrl + Shift + i), then go to the Network tab, then refresh your page, you'll see your page's load time, isolated from other elements. If that is too high (I'd say 1+ second), I'd look at your database calls. Sometimes there's an obvious big one, but other times you can do all the tweaking/simplifying possible, such as with the disable parameter. Or you could simply use cache, particularly page caching.

---
Tags: queries
---


# Question
Title: Admin Javascript not loading certain scripts
It appears that something has changed in the last two weeks that is not allowing the admin javascript to load when updating or creating entries of specific channels because of the field types contained. This is on EE 3.5.17, and no updates done after February. Last operation was 17 May when it was known to work.

The offending cp javascript: /admin.php?S==cp&C=javascript&M=combo\_load&plugin=ee\_table\_reorder&file=cp/global\_end,cp/files/picker,cp/grid,fields/file/cp,fields/relationship/cp,cp/date\_picker&v=version\_number

What I have found is that if I paste in the javascript as-is, it presents the 404, but if I remove the fields/relationship/cp, the cp/grid, and the cp/date\_picker, it will load. Adding any of the above theme js back in gives it a 404, even though the files are confirmed in the themes' js/compressed folder. This stops features like grid file upload, etc from working on entry creation / edit pages in the CP.

It was known and confirmed working 2 weeks ago... Any thoughts on why CP javascript behaviour would change in this way?

# Answer
A Small Orange, our great hosting service, reviewed the Mod Security logs and identified the part that was causing this issue to occur. Effectively, there were parts of the URL that were flagged as potential problems and had started blocking them. They were quick to whitelist the resources called in the scripts used, and now our CP's javascript shows up and functions correctly. When it was 404, it was the base script for all the other things like date picker, grid, and other functionality to work right, so without it, things like file upload could not trigger correctly.
> 0 votes

---
Tags: control-panel, javascript, cp-themes
---


title: File field ... not loading

text:
# Question
Title: File field ... not loading
I updated my installation of EE to 5.2.3 and now my file fields say "...loading" but do not load. Other fields work. I tried a fresh install but the same thing happens. I am wondering if someone might be able to offer me some advice. Thanks.

# Answer
I had a similar issue a while back. I don't know what your console is saying but if it's returning a 406 error it's probably an issue with Mod\_Security preventing your scripts from rendering. Check out the link I posted and see if anything looks familiar. If it does then it's a server side issue and you'll have to whitelist those actions in Mod\_Security. If your site is hosted on a web hosting service then you'll have to contact their support team and resolve it that way. Hope this helps!
> 1 votes

---
Tags: file-uploads, fieldtype
---


# Question
Title: (A Different) Channel Entry Data Not Showing in Entry Detail Pages
EE 5.2.2

I have a site that I'm building for a client. It was my intention to have certain elements in the `_html-wrapper` layout be dynamic so they could change them as they desired (image, short description, hours of operation, etc). I created a `homepage` channel with a single entry to handle this content.

The section looks like this

```
{exp:channel:entries channel="homepage" limit="1"}
    <section class="w-4" style="min-width:15em;">
          <h1><a href="{homepage}"><img src="{header_icon}" /><b>{site_name}</b></a></h1>
    </section>
    <section class="w-5">
          <p class="description">{entry_description}</p>
    </section>
    <section class="w-4">
          <p>{address}</p>
    </section>
    <section class="w-2">
          <p>{hours_of_operation}</p>
    </section>
{/exp:channel:entries}

```

It's working just fine until I get into an entry page, at which time it does not render.

So `example.com` works, `example.com/product` works, but `example.com/product/entry/entry-page` does not work.

Is there some sort of conflict with channel entries from different channels rendering on entry pages?

Also, I'm working off of the example site (since I'm still new to EE).

Thanks a lot!

# Answer
It is not so clear from what you say what actually you are trying to do, but at the simplest level, it seems that while `example.com/product` generates output when applied to the template fragment you provide, `example.com/product/entry/entry-page` does not.

Probably this down to a parameter `dynamic="no"` that is missing from your `{exp:channel:entries}` tag.

In the default state, EE will try and guess what channel entry to look up based on the URL slugs, which works fine in simple cases, but is less reliable with more complex ones.

When you add **`dynamic="no"`** parameter to the tag, you are telling EE to look up the entry based just on the information given within the tag parameters.

It might be a better solution for you to feed the `{exp:channel:entries}` tag with the parameters you want it to use. You can do this using the `url_title` parameter, and feeding it the segment of the URL that has the right `url_title` for the entry you want to look up in your `{exp:channel:entries}` call. Something like:

```
{exp:channel:entries channel="homepage" limit="1" url_title="{segment_1}" dynamic="no"}

...

{/exp:channel:entries}

```

The variable `{segment_1}` is a **segment variable** and returns the content of the first slug in the URL - so in your example case `production`. It will return this regardless of what follows the first segment (but these are available via `{segment_2}`... etc. if needed.

There are other ways to do these things, and I may have guessed wrong about what you are trying to do, but maybe this will be of some use.

HTH
> 2 votes

---
Tags: channel-entries, templates, channel, tags
---


# Question
Title: How to use my custom HTML Button on the rich text editor?
I made a custom HTML button in System Settings -\> HTML Buttons

When going to a channel entry, the rich text editor still only displays the default buttons. I see no way of adding my custom one.

How can I add it?

# Answer
> 0 votes
Each member in your site may have his own set of formatting buttons, and the setting in My Account page overrides the one in System settings.

# Answer
> 0 votes
This is because the custom HTML buttons only work with the field type `Textarea`. Once you select that field at the bottom will be a box falled `Field tools` and then you select `Show formatting buttons`. That will show your custom HTML buttons you made in settings.

I wish they were added to the rich text editor as well, but they are not. And using the text area with your custom buttons just creates code which is also annoying when trying to hide the code from clients.

I'm on EE 5.2.3

If you want to create your own buttons for the rich text editor field type follow this page in the EE docs: https://docs.expressionengine.com/latest/development/rte-tools.html

---
Tags: richtext
---


# Question
Title: Using Solspace Calendar, repeating events with with a start dates over a year old don't show up, if when "Until" field is set to far in the future
Here is the search we're using in the template.

```
{exp:calendar:events
    date_range_start="today"
    date_range_end="today"
    calendar="1"}

{/exp:calendar:events}

```

The events we are looking for have a start/end date in the past but are set to repeat until a certain date (usually in year 2048).

It works fine if the event's start date is less than 1 year old. As soon as it's older than 1 year, the even won't show up, even if the Until field is set to 2048. Any ideas?

# Answer
Unfortunately this becomes a bit of a limitation with Calendar for performance reasons. Calendar needs to check for all occurrences across a specific timeframe, and the larger that timeframe is, the heavier the request is - especially for sites with many events. It seems like this has worked well for most customers, but I understand it will affect some others.

The current limitation is 365 recurrences of a single event (allowing for a daily event to happen for 1 full year).

If you have an event that occurs quite frequently, it's more likely you'll run into this issue. It can be worked around by bumping up the start date every once in a while, or make new copies of the event for each calendar year, etc.
> 0 votes

---
Tags: solspace-calendar
---


# Question
Title: Freeform Pro fieldtype- how to set the return path?
In upgrading an ExpressionEngine site from 3.x to 5.2.3, I am switching from using Freeform Classic to Freeform Pro 1.7.12.

In Freeform Classic, there was a Freeform fieldtype where you could set the return path individually per entry (http://docs.solspace.com/expressionengine/freeform/classic/getting-started/channel-entry-fieldtype.html). In the new version of Freeform, while that fieldtype exists, I cannot find that same return path functionality (http://docs.solspace.com/expressionengine/freeform/v1/overview/channel-fieldtype.html#creating-a-freeform-field).

Does this feature still exist in the new version of Freeform?

# Answer
> 0 votes
Unfortunately this currently isn't possible. It's on our list to add support for it in the future however. The only workaround right now would be to have a regular EE Field that contains a list of Form's and ID's/short names and another field for Return URL. You could then pass off the short\_name and return URL to the Render tag:

```
{exp:channel:entries}
   <h3>{title}</h3>
   ...

   {exp:freeform_next:render
      form="{my_ff_formname_field}"
      return="{my_ff_returnurl_field}"
   }

   ...
{/exp:channel:entries}

```

---
Tags: solspace-freeform, solspace-freeform-next
---


title: Calendar Tag Entry Fields Not Showing

text:
# Question
Title: Calendar Tag Entry Fields Not Showing
EE 5.2.2

Using the `{exp:channel:calendar}` tag, I'm not able to get custom fields from within the `{entries}` tag.

example:

```
{exp:channel:calendar channel="showtimes"}
    {if entries}
        {entries}
            {title} // does show
            {showtime} // a custom text field, does not show
        {/entries}
    {/if}
{/exp:channel:calendar}

```

There also isn't any problem calling things like `author` or `entry_date`, but my custom fields are not showing and it's vital that they do.

Thanks for any help!

# Answer
The calendar tag doesn't support custom fields. Either use a channel:entries tag, or something like the Solspace Calendar module if you need more flexibility with things like recurring dates.
> 1 votes

---
Tags: entries, tags, calendar, calendar-events
---


title: Upgrade a site from EE2 to EE5

text:
# Question
Title: Upgrade a site from EE2 to EE5
I need to upgrade an EE2 site to EE5 and looking for some insight on best practices.

From what I've seen it looks like the EE upgrade path would require upgrading from 2 \> 3 \> 4 \> 5. The issue I would have is not having a copy of EE3. Is that something I can get somewhere?

Or try and use some plugins to export my entries EE2 and then import them into a fresh EE5 install and rebuild a bunch of things.

Any best practices, articles, or pitfalls I should watch out for would be greatly appreciated.

# Answer
Alright, let's do this. I got you, fam. I've done several `2 > 5` upgrades, both small sites and some real big ones.

First thing, so far no client has opted to go the rebuild route. Generally it would take longer than the upgrade process (so more money from them), and I would only recommend it to a site that was in such bad shape (templates are a mess, PHP used in all the wrong places, lots of deprecated add-ons, etc) that I wouldn't choose to take on the upgrade project in the first place because of that.

Second, if you visit https://github.com/ExpressionEngine/ExpressionEngine/tree/3.5.17 and click `Clone or Download` you will get the production copy of version `3.5.17`. You can get the latest version of `4` and `5` this way if you choose.

The thing is, is that EE `5` will have the upgrade scripts to go from `2` all the way to `5`. And those scripts are the most up-to-date update scripts, that have the least bugs. The rub is, however, that depending on your add-on inventory, you almost certainly have to go step-wise. Many of the more complex add-ons need to migrate data in certain ways between major versions, so you have to stop at EE `3` and upgrade your add-ons, stop at EE `4` and upgrade your add-ons. I've found the most success in going step-wise, especially with the bigger more complicated upgrades.

If you essentially have no add-ons or very few that have very simple upgrade paths themselves, you actually can get away with going from `2` all the way to `5`.

Here is the next complexity; during this upgrade, at some point you'll want to switch from PHP `5.6.x` to at least PHP `7.0`. This complicates things, but it can be done after the fact.

If you are going to go stepwise, I recommend copying the EE `5` update scripts over the EE `4` and EE `3` scripts (only going so far, so just overwrite the EE `3` update scripts up to the latest EE `3`, same with EE `4`) because those scripts are the most bug checked at this point.

Also, **rehearse** the upgrade. Make a throwaway staging server and duplicate your application. If you use a service like Digital Ocean that allows you to take snapshots of a VPS you launch, that is super helpful, so if an upgrade attempt fails on the staging server, you can debug what happened, and just reset easily to a pre-attempt snapshot and try again.

Another thing I've done is add logging to all the upgrade scripts methods. It just logs to a file, something like this at the beginning of each method in each script:

```
file_put_contents ($_SERVER["DOCUMENT_ROOT"] . "/upgrade_log.php", date("c") . " : " . __FILE__ . " : " . __FUNCTION__ . " : " . __LINE__ .  "\n\r", FILE_APPEND);

```

An extra benefit to this is that if you are logged on to the server, you can tail that log while you run the upgrade like so:

```
tail -f upgrade_log.php

```

and watch live. This will also help you gauge some of the slower methods that might be more memory intensive and might be an issue between different environments.

So if an upgrade fails without a useful error, I know what the last fired method is, so I can debug why it failed there.

There's a lot more I could say, but you'd need to ask more specific questions, I've rambled enough. If you have trouble when you rehearse the upgrade, ask more questions.
> 6 votes

---
Tags: upgrade, ee2-upgrades
---