# Question
Title: PHP Issue: To execute another ur using PHP function file()
I have a PHP CRON script that use to execute the external url using the code below every 5 minutes: echo file("https://...");

This line of code is not working after i upgrade my server from VPS to Dedicated Server. Is that anything to do to the WHM tweak, firewall, or security?

# Answer
> 0 votes
First, you have to enable the common PHP setting if the server setup by your self in VPS/Dedicated server. You can also get the content from URL using the CURL method. It is proper method compare to file get contents because it provide more settings. Notes: CURL setting must be enable on your server.

```
// Initiate curl session in a variable (resource)
$curl_handle = curl_init();

$url = "http://dummy.restapiexample.com/api/v1/employees";

// Set the curl URL option
curl_setopt($curl_handle, CURLOPT_URL, $url);

// This option will return data as a string instead of direct output
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);

// Execute curl & store data in a variable
$curl_data = curl_exec($curl_handle);

curl_close($curl_handle);

```

---
Tags: php, cron, cpanel
---


# Question
Title: Error message when trying to open layout template
My other templates open fine from the EE backend, but when I try to open my layout template I get the following message:

```
Call to a member function getId() on null in [path]/ee/EllisLab/ExpressionEngine/Controller/Design/Template.php

```

I can see and open the template in my ftp program, but can't open it from inside of EE.

I'm running version 5.3.0

# Answer
If the issue is not solved and other templates working fine. Then you can follow the below steps to solve the issue.

You will create the new layout template and update the content it by your current layout template and save new one. Delete the current layout which have the issue. Rename to the new layout.

I hope that your problem will be solved.
> 0 votes

---
Tags: templates, php-errors, template-manager
---


title: Multi Language trailing slash in url

text:
# Question
Title: Multi Language trailing slash in url
I am currently using

```
RewriteCond %{REQUEST_URI} !^/system [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/$ /$1 [R=301,L,QSA]

```

to remove trailing slashes in my urls, however for some reason it does not work with the multi language module - I'm using Expression Engine 2.9.0 and Multi Language 2.0.1

Example:

```
domain.co.uk/link/ > domain.co.uk/link (trailing slash is removed)
domain.co.uk/cy/link/ > domain.co.uk/cy/link/ (trailing slash is NOT removed)

```

I realise this is legacy software but I'm just trying to maintain this site.

# Answer
Right below the RewriteEngine On line, add:

RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule ^(.\*)/$ /$1 \[L,R\] # \<- for test, for prod use \[L,R=301\] to enforce a no-trailing-slash policy.

To enforce a trailing-slash policy:

RewriteCond %{REQUEST\_FILENAME} !-f RewriteRule ^(.\*\[^/\])$ /$1/ \[L,R\] # \<- for test, for prod use \[L,R=301\]
> 0 votes

---
Tags: multi-language, multilingual
---


# Question
Title: Call to Action Buttons - force Bootstrap col display around EE looping content
I created a conditional in EE6 using Bootstrap 5 to determine display call to action buttons to show side by side when even number and full width stacked when odd. Used output total grid rows to determine if even or odd. All is working fine except the even numbers are not respecting the col-6 tag which should align side by side, they're stacking as half width on even numbers (odd numbers stack full width across as expected). So I want the first and second buttons to be side by side on one row and the third and fourth buttons to be side by side on a second row. ref: https://snipboard.io/Di908h.jpg

```
{cta}
<div class="row call-to-action-buttons call-{cta:total_rows}">
{if cta:total_rows % 2 != 0}
    <div class="col">
        <a  href="{cta:cta_url}"  >
            <div class="call-to-action-box">
               {cta:cta_label}
            </div>
        </a>
     </div>
{/if}
{if cta:total_rows % 2 == 0}
    <div class="col-6 d-inline-flex">
        <a  href="{cta:cta_url}"  class="col">
            <div class="call-to-action-box">
               {cta:cta_label}
            </div>
        </a>
     </div>
{/if}
</div>
{/cta}

```

# Answer
> 0 votes
I guess you've created your CTA in a grid field.
Your layout indicates (probably) that you have either one or two CTAs (would be odd to have four in two pairs, but five stacked full-width vertically), which suggests you could simplify this layout considerably: I think this would achieve the same output without the duplication...

```
{cta}
<div class="row call-to-action-buttons call-{cta:total_rows}">
    <div class="col{if cta:total_rows % 2 == 0}-6 d-inline-flex{/if}">
        <a  href="{cta:cta_url}"  >
            <div class="call-to-action-box">
               {cta:cta_label}
            </div>
        </a>
     </div>
</div>
{/cta}

```

Anyhow, it looks like the issue is the value being returned by your modulus conditional is not what you thought it was, so a good place to start is to confirm that these values are being calculated as you expected.

First check that the value returned by `{cta:total_rows}` is what you think it should be - have a look at the `call-...` value in the class statement and check that the value being appended is the correct one. If it is, try adding some brackets around the value in the modulus formula - something like:

```
{if {cta:total_rows} % 2 != 0}

```

and see if that works any better.

If none of that helps post some feedback on what happened when you tried the ideas here and perhaps that will help diagnose the issue for you.

HTH

# Answer
> 0 votes
Could it be you are creating a new row with each cta? Try this:

```
`
{cta}
{if cta:count == 1} <div class="row call-to-action-buttons call-{cta:total_rows}"> {/if}

...

{if cta:count == cta:total_rows}</div>{/if}
{/cta}
```

---
Tags: bootstrap
---


# Question
Title: Mail is not sending in the forms add-ons in EE2 site?
I have EE2 site. Mail is stopped working in the forms addon but the mail is working in the EE because I have checked with Communicate Module.

# Answer
You should verify the settings of the forms addon to select the "EE Internal" option for the "Email Library" field. Because the forms add-on uses the setting of the EE for that option.
> 0 votes

---
Tags: email
---


title: inserting links to publish

text:
# Question
Title: inserting links to publish
When I try to insert a link under "Publish" on my website, the square appears for me to fill in the https info, but the square is empty.

# Answer
> 0 votes
I'm using 1.7.1. I go to a new entry to edit it. I’ve printed a list of titles of my video works. I highlight a title to a video that I want users to be able to access on Vimeo by tapping that title. I highlight the title, then tap the to the “insert/edit link” icon. An empty box appears. This box usually will allow me to insert an https: link. There is nothing in the box, no printing, nothing.

---
Tags: ee1, entry, import, entrylinks
---


title: Create a channel entry via POST request

text:
# Question
Title: Create a channel entry via POST request
I'm using EE as a REST API, consumed by a web app. My question is, how can I create a channel entry via post request from my Web App? I have a contact form whose data needs to be handled. That's all I need :) I've been researching the discussions around the web about using EE as REST API and microservices, but all I found is an add-on with a prize of $65 and a EE Open API, which for some reason I can't trigger, after the installation.

# Answer
> 2 votes
Essentially, you'll create a module with an ACT URL. (https://docs.expressionengine.com/v2/development/modules.html).

You'll have your `mod.module_name.php` file, which will contain your logic to retrieve the data and enter it into the database using the Database Class (https://docs.expressionengine.com/v2/development/usage/database.html).

Then in you're `upd.module_name.php` file, you'll need to ensure that you add records to the `exp_actions` table, which will give you the ID for your ACT URL. https://docs.expressionengine.com/v2/development/modules.html#the-update-file-upd-module-name-php

---

if you want to take your API to the next level, you can check out this article: https://medium.com/expressionengine-cms/building-an-api-for-your-add-ons-with-expressionengine-and-the-a-team-85c1c9bc9e2c

# Answer
> 0 votes
You could trigger this via an Addon (create a form action request) and when that is hit you can use the Model service to create a channel entry.

# Answer
> 0 votes
I've found this as a great solution - EE Open Api.

---
Tags: ee2, forms, api, rest
---


# Question
Title: Mutliselect search option in Expression Engine
I have a checkbox to filter which categories that the simple search form is actually searching in. Is there a way to do this properly within EE? Here is the code below.

```
{exp:search:simple_form
    channel="promo_video"
    search_in="entries"
    no_result_page=""
    result_page=""}
    <input type="text" name="keywords" id="keywords" placeholder="Search here" />
    <input type="submit" id="submit-button" class="submit-search" value="Submit"/>
    <div class="search-group-title">Filter:</div>
    <ul class="search-group">
        <li><input type="checkbox" name="filters" id="{promo_description}" value="152"/>Sermon Description</li>
        <li><input type="checkbox" name="filters" id="{promo_video_title}" value="42"/>Series Title</li>
        <li><input type="checkbox" name="filters" id="{sermon_notes_txt)" value="241"/>Sermon Notes</li>
        <li><input type="checkbox" name="filters" id="{youtube_transcript}" value="239"/>Youtube Transcript</li>
        <li><input type="checkbox" name="filters" id="{meta_tags}" value="240"/>Tags</li>
    </ul>
{/exp:search:simple_form}

{exp:channel:entries channel="promo_video" orderby="date"}
    <div class="tile">
        <div class="video-title" style="font-weight: bold;">{promo_video_title}</div>
        <div class="promo-description">{promo_description}</div>
        <div class="meta-tags">{meta_tags}</div>
    </div>
{/exp:channel:entries}

```

Essentially, if the series title is selected, then the search would only take place within the {promo\_video\_title} field group. Also, if there are multiple boxes checked, for example, Sermon notes and Series title, only the {promo\_video\_title} and the {sermon\_notes\_txt} field groups would be searched. Right now it currently displays all of the entries from the promo\_video channel, but I was wondering if the results were able to be filtered.

# Answer
> 1 votes
Simple search does not allow you to constrain a search within categories. To do what you describe you have (at least) two options:

1. Use simple search as now and then dump the unfiltered output from any search into a set of layout variable arrays, in which you capture (along with the search content / results to be displayed) the category(ies) assigned to each search result; with that you can then use conditional elements in your template to control which categories get displayed on the page in response to the checkboxes chosen. It is not super efficient if you are likely to be generating huge numbers of search results each time, but provided the numbers involved are small it should work fairly well: for this to work though you'll need to split your search-results template processing across two templates (so that you can use the layout variable arrays you defined in the template output).
2. Use a more sophisticated search function that allows you to limit responses by category such as Low Search \- there may be other add-ons that do this too, but for many **Low Search** remains the go-to for sophisticated search.

HTH

# Answer
> 2 votes
EE has an "advanced" search feature as well which allows category filtering - see https://docs.expressionengine.com/latest/add-ons/search/advanced.html for example code.

---
Tags: ee3, simple-search, checkbox
---


# Question
Title: Are categories really needed with ExpressionEngine?
Basically I have around 20,000 items that I want to build out pages for. They do have a category and a single subcategory. So far I have had a nightmare time trying to import them into EE categories and subcats. There are too many issues with the slug and they have to be unique as well as other items.

Overall my question is whether I can just keep them in fields and then and then build categories and filter them on the fields? Would this be a major disaster if I don't use categories? Will performance suffer?

As another option, perhaps just create the Main Category which is around 150 categories and then filter the subcategories on the subcategory field instead of trying to map it in the nested subcategories.

# Answer
It might be more helpful if you describe what the pages are for. However, in general, my rule is that I'm going to have lots of entries and entries can belong to multiple categories, then I use categories.

However, we're aware that categories is still an area of EE that we need to review and look at updating. There are still some limitations with categories vs entries with relationships or other options.

Other options include having each category as a channel entry of sorts and using relationship fields to associate related entries. Then you would just loop through the relationship field to list all entries. However, at 20,000 entires, that just seems pretty cumbersome to me.

To keep them as fields, then it sounds like you need to do some sort of searching (https://docs.expressionengine.com/latest/channels/entries.html#searchfield\_name) to list entires and search those entries by a keyword (category name) and in that custom field. I do think you would take a slight performance using this method though, but it could work.

All that to say, from what you describe, I would stick with categories.
> 0 votes

# Answer
Another thing to think about would be to create a custom data structure that suits your data and build an add-on to handle access to this information from within EE.

How this might work would of course depend on how you plan to use the data on the site; add-ons are not so complicated to create and there may be some processing efficiencies obtained by manipulating the entries using custom code rather than relying on EE's general purpose structures.
> 0 votes

# Answer
Two things I can think of:

**Low search module https://eeharbor.com/low-search**

You could use this to organise content into collections, do search/filtering on categories and/or custom field values, shortcut URL's for predefined sets of results, as well as using as a general keyword search.

It's possible to build a complete filtering system with it.

**Tags https://eeharbor.com/tag or https://eeharbor.com/tag**

Would tagging of entries help?
> 0 votes

---
Tags: categories, child-categories
---


# Question
Title: syntax error or access violation: 1118 row size too large
We're getting this error when trying to create new fields on a large site. One of the suggested fixes is to set innodb strict mode to off.

The hosting company say they can't do this for us and we don't have access to the mysql config files as far as I can see.

Is there way to set this in EE itself?

We've tried adding:

$this-\>EE-\>db-\>query('SET @@SESSION.innodb\_strict\_mode = 'OFF'');

to mysqli\_connection.php

but that just seems to crash the site

# Answer
> 1 votes
It would help to know what version of EE you are using - good practice is to include this along with details of your php environment in your question; different versions of EE have different characteristics, so knowing this info helps you get a good answer sooner.

The 'row size too large' error is often associated with EE2's `exp_channel_data` table getting too wide; there is a limit on how wide a table can be in MySQL and in EE2 all the site variables are stored as columns in the same table - when you have too many site variables MySQL runs out of column space and EE throws errors.

There are some options to reduce the amount of space MySQL uses to store the table, but since they involve changing the structure of the table they may later lead to operational problems.

A better solution is to think about restructuring the variables you use - deleting any that you no longer need is a good start. If you cannot delete any, have a think about converting some to grid fields - grid fields store their data in a different way (the data is stored in tables separate from `exp_channel_data` and so moving variables to grid fields can reduce pressure on the size of the channel-data table).

An even better solution would be to upgrade the EE installation to a newer version of EE - I think EE3 and onwards (it might be EE4)stores variables in a different way (similar to how grid fields work) and eliminates the table size problem completely. EE2 updates sometimes cause problems (mostly due to the need to also update add-ons) but the new one-click updater does make the process a lot less problematic than it used to be.

HTH

---
Tags: database
---


# Question
Title: EE 6.0.6 Template Group Directory access is forbidden 403
I just don't get what is happening. I can create just about any template group name and it works fine, but if I try to create a template group called "themes", I receive the 403 Error Directory access is forbidden. The index.html file just has "test 123" in it, so no coding issue. I have checked my files, and nothing else is called "themes". I may have had themes.html in my root at one point, but that was deleted days ago, so not sure if something is holding onto that and creating some conflict. Is there anything else I can look at or try since I do want to use this as my subdirectory, www.mysite.com/themes?

# Answer
> 1 votes
If you are using EE 3-6 (possibly lower as well) "themes" is a protected name in the EE Installation at the web root of your install. So mydomain.com/themes is seeing that directory before your template directory and throwing the 403 error. Either choose a different name for your template group or do as JCOGS suggested.

# Answer
> 0 votes
EE stores useful CSS and JS resources used by EE itself and some add-ons in the directory `/themes` \- so I imagine any attempt to define a template group with that name will cause problems.

Why your attempts to create a `themes.group` template folder give you a 403 is unclear to me (rather than some more meaningful error) but suspect that it is EE's way of letting you know that there is a conflict.

I don't know whether it is possible to rename the `/themes` directory, but it is certainly possible to move it. So a work-around would be to add an extra directory to the webroot called (say) `cats` and move the `/themes` directory to be below this - and then update the relevant entries in EE's **URL Paths and Settings** CP page to point at the new location (i.e. `/cats/themes`). Then you will avoid the conflict ...

HTH

# Answer
> 0 votes
R.Kern and JCOGS Design are correct. Can you not choose a different name for that template group? You can always use template routes if you need themes as one of your segment names. You might need to use dynamic="no" in your channel entries tag parameters too.

---
Tags: error, permissions
---


title: Random Code at the top of every page

text:
# Question
Title: Random Code at the top of every page
We just updated to the latest version of **Expression Engine 2 (2.11.6)**, but now it looks like there's some kind of code being injected at the very top of our page, right after the "body" tag:

> {!-- ra:00000000397d91950000000074865fe6 --}

It doesn't seem to be coming from any of our templates. Any idea why EE generates this random code?

# Answer
> 5 votes
i've had the same thing today. in my case it was related to a php script in the templates that was trying to get images from flickr over the old api. However i have seen people mentioning it can also be caching related. So first thing would be to clear all caches

# Answer
> 0 votes
I've just had the same issue, when moving an old EE 2.9.3 site to a Dev server and applying a test domain name.
There were some PHP Includes in the templates, which referenced the live site's server path. When I changed these... all fixed.

For example:
include("/home/sites/domainname.co.uk/public\_html/swift/swift\_required.php");
...changed to...
include("/home/domain/public\_html/swift/swift\_required.php");

---
Tags: ee2
---


# Question
Title: Parsing order with stylesheets & dynamic background images
Seems I can't use source set to switch out a background image (which happens to be from a file grid) So can't use this code

The issue is in parsing. I need to do something like this:

```
@media screen and (max-width: 440px) {
  .banner {background-image: url('{banner_dual:banner_long}');
}

@media screen and (min-width: 441px) {
 .banner {background-image: url('{banner_dual:banner_short}');
}

```

But my templates calls the stylesheet before the template can parse it. Since it's dynamic i can't add the query in the stylesheet.

```
<!doctype html>
<html lang="en">
{exp:channel:entries channel="home"}
  <head>
    <meta...
    <style>
       {styles}
   </style>
</head>
<body>
{banner_dual}
<div class="banner rtf" style="background-image: url('{banner_dual:banner_long}')">
{/banner_dual}

```

Any ideas how to solve this?

# Answer
> 0 votes
If you need to do stuff like that you are better off putting the dynamic content in an inline style tag - specificly because of the parsing order.

Also, It has been my understanding (and experience) that you are better off keeping your stylesheets outside of the CMS and call them in as a locally hosted file. Calling them from the Template manager only increases the processing overhead and doesn't really give much benefit.

# Answer
> 0 votes
Inline styles are by far the easiest way to do this. Keep the `style` tag inside your entries tag so you can pull in custom values, and after your main CSS link so your custom styles override anything else.

For ease of reference I'd put the style tag immediately above the custom field you're calling in your template. That way you can omit the style tag if it's not needed.

It might not be pretty but it works.

Here's a rough example:

```
<!doctype html>
<html lang="en">
{exp:channel:entries channel="home"}
  <head>
    <meta...
    <style>
       {styles}
   </style>
</head>
<body>

{!-- your banner field --}
{banner_dual}

{!-- custom style tag to select viewport based image --}
<style>
@media screen and (max-width: 440px) {
  .banner {background-image: url('{banner_dual:banner_long}');
}
@media screen and (min-width: 441px) {
 .banner {background-image: url('{banner_dual:banner_short}');
}
</style>

{!-- your banner container --}
<div class="banner rtf" style="background-image: url('{banner_dual:banner_long}')">
</div>
{/banner_dual}
{!-- /banner field--}

{/exp:channel:entries}

```

---
Tags: parse-order
---


# Question
Title: After Upgrading EE5->EE6: Warning with plugin
after having upgraded from EE5.4.2 to EE6.0.6 I get a warning in the frontend:

> Warning Class "ExpressionEngine\Addons\ReadingTime\Reading\_time" not found ee/ExpressionEngine/Core/Autoloader.php, line 91
>
> Severity: E\_WARNING

The concerned plugin is a real small and easy plugin with only some lines of code (the Reading Time from EllisLab. I don't understand the error - does it tell me that the plugin is old/deprecated somehow or is there any other problem?

Any hint would help me further, thanks in advance!

# Answer
> 1 votes
You can download the ReadingTime addon from the EllisLab Github. I think it disappeared from the pre-installed addons for EE6 as part of the change over from EllisLab ownership to opensource.

I can confirm that it works fine in EE6 - you just need to add it like any other third-party add-on.

HTH

---
Tags: upgrade
---


# Question
Title: Why template tag does not render of the 'Bloqs' add-on on front pages?
I have uploaded some changes to my site and suddenly the pages of the site is broken due to the template tags of 'Bloqs' add-on are not working but there is no error or warning.

# Answer
> 1 votes
If your new changes are related to adding the new fields to the channel then there will be a chance the title of the new fields are the same as the title of fields of the **Bloqs** add-on. Because we had faced

---
Tags: add-on
---


title: EE6: Tag Cache growing very big

text:
# Question
Title: EE6: Tag Cache growing very big
after upgrading from EE 5.4.2 to EE 6.0.6 my tag cache (system/user/cache/templategroup-name/tag\_cache) is growing very quickly. (Info: At the same time I upgraded the server from PHP 7.3.x to PHP 8.0.x)

I deleted the cache 1 hour ago, now it's about 40.000 files with a total of ~250MB. There might have been about max. 1000 unique users in here. The site has ~1.500 posts and ~50 static pages. \[Edit: 20 hours later the folder is 1,8GB in size …\]

With EE5 the whole system-folder was always under 30MB.

In my templates I use the tag-cache mostly with refresh=30

This does not seem normal to me. Is there any advice?

Thanks in advance!!!

# Answer
> 1 votes
I would start off with enabling Output Profiler and inspect the template log on few pages, to see if something's not completely expected there (specifically related to cache)

The next thing I would check is the server time settings, along with the timestamps of the tag cache files. It looks to me like the cache files are being created too often, instead of respecting 30 min refresh interval.

---
Tags: cache, ee6
---


title: GraphQL API for ExpressionEngine

text:
# Question
Title: GraphQL API for ExpressionEngine
I just started using Expression Engine and it looks promising, but I am a bit lost with the addons ecosystem.

I have been searching around for a GraphQL integration with EE but I can't find one.

Do you know if there is an existing solution that allows consuming EE data via GraphQL?

# Answer
Don't know if this will help - https://expressionengine.com/add-ons/reinos-webservice
> 0 votes

---
Tags: add-on
---


# Question
Title: call to `exp_member_groups` database table, which is non-existent in ExpressionEngine 6
I am getting this error message in ExpressionEngine 6 developer log.

Add-on is making a call to `exp_member_groups` database table, which is non-existent in ExpressionEngine 6. If you are site owner, try upgrading Addon to latest available version. If you are the add-on developer, update your class to use Role model.

# Answer
> 0 votes
ExpressionEngine 6 introduced a new feature Member Roles. Member groups will no longer use in this version. You will have to update the addon. for more detail about this feature see the documentation. Member Roles

Here is the guide to call MemberGroup model with Role model.

---
Tags: ee6
---


# Question
Title: "exp_module_member_groups' doesn't exist" on uninstalling add-on
I am getting the error while uninstalling the Addon in EE6.

"exp\_module\_member\_groups' doesn't exist"

# Answer
If the add-on has version that's EE6-compatible (and it's available to you), you should first update it and then uninstall.

Having said that, removing record from `exp_module_member_groups` is usually the last step for uninstall, so if you see add-on removed for the list then you're probably good to go.
> 1 votes

# Answer
In EE6, `exp_module_member_groups` table is now renamed as `exp_module_member_roles`

look like the addon is not compatible with EE6. You have to rename the table `exp_module_member_groups` to `exp_module_member_roles` in the `upd` file of the addon.
> 0 votes

---
Tags: ee6
---


title: Next/Prev entry links for EE6

text:
# Question
Title: Next/Prev entry links for EE6
Are there any plugins that enhance next/prev entry linking for EE6? I need to be able to order them using a custom field instead of the default date.

I used to use the Advanced Prev Next Entry plugin which was perfect but it hasn't been updated in a very long time and there doesn't seem to be anything else out there.

Thanks.

# Answer
You can simulate the next / prev behaviour using the paginate feature of the `channel:entries` tag. Have a look at the `{previous_page}` and `{next_page}` tags within the `{paginate}` variable. This approach will allow you to sort the results in any way that suits (within the limits of the channel entries ordering controls).

HTH
> 0 votes

# Answer
If you are trying to paginate a blog detail page to allow going to the next post or previous post, you can try this way. Place this code at bottom of the blog detail template.

```
{exp:channel:next_entry channel="blog"}
    <div class="your_class">
        <a href="{path='blog/'}" alt="{title}">Previous</a>
    </div>
{/exp:channel:next_entry}

{exp:channel:prev_entry channel="blog"}
    <div class="your_class">
        <a href="{path='blog/'}" alt="{title}">Next</a>
    </div>
{/exp:channel:prev_entry}

```
> 0 votes

---
Tags: next-prev
---


title: Text files no longer updating templates

text:
# Question
Title: Text files no longer updating templates
I am building a new site using EE 6.06. I got everything set up with fields, channels, templates, partials, etc. and I was able to use my favorite IDE to edit the content, but when I sat down to work today that connection no longer works. When I create new templates they do not show up in the Templates folder on server side and when I make any edits to existing templates on my side and try to upload them, the server does not recognize the changes. Template folder permissions is set to 777.

I checked in phpMyAdmin and new templates appear in the database but they do not show up in the Template files.

Fortunately I can edit in the EE control panel, but the convenience of editing in my IDE is lost.

Any clues what the solution to this dilemma might be? I have been building EE sites for more than ten years and have never seen anything like this.

# Answer
It looks like you do not have preference set to save templates as files. Add this to your `config.php`

> $config\['save\_tmpl\_files'\] = 'y';

https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#save\_tmpl\_files
> 1 votes

---
Tags: templates
---


# Question
Title: Simple Commerce set up, Public certificate
EE 6.03

Ive enabled the Simple Commerce Addon, I've looked at the documentation on paypal:

https://developer.paypal.com/docs/api-basics/notifications/ipn/IPNIntro/

and on EE:

https://docs.expressionengine.com/latest/add-ons/simple-commerce/paypal-settings.html

but it's not clear to me what information is required.

I think I need to generate a certificate on paypal and upload it to the server, or do I need to generate one locally?

Where should I upload it to?

Where do I get the details for:

Public certification ID

Public certificate path

# Answer
Finally found the page on the EE site that explains it,

https://docs.expressionengine.com/latest/add-ons/simple-commerce/index.html

quite annoying as lots of pages refer to 'Please read the section on simple\_commerce\_encrypted\_payments' without actually linking to it and searching the site doesn't help either!
> 0 votes

---
Tags: paypal, simple-commerce
---


title: Contact Request Form not sending emails

text:
# Question
Title: Contact Request Form not sending emails
I had a question about my contact form on my Expression Engine Site. It just stopped working, it won't send emails and I don't know if it is in the PHP or what? I know there is nothing in the action"", but that's how it always was. Any help would be appreciated. Here is the code I have: \`

```
        <section role="header">

            <ol role="breadcrumbs">
                <li><a href="{path='site_index'}">Home</a></li>
                <li>Request A Quote</li>
            </ol>

            <h2 class="title">Request A Quote</h2>
            <span class="arrow"></span>
        </section>

        <section id="request_form">

            {exp:channel:entries channel="pages"}

            {content}

            {/exp:channel:entries}

            <form method="post" action="">
                <fieldset role="user info">
                    <legend>Basic Information</legend>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="name">Your Name<sub>*</sub></label>
                            <input type="text" name="name" id="name" tabindex="1" />
                            <span class="error" role="name">Please Specify Your Name</span>
                        </li>
                        <li class="right">
                            <label for="company">Name of Your Company</label>
                            <input type="text" name="company" id="company" tabindex="2" />
                        </li>
                    </ol>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="phone">Contact Phone</label>
                            <input type="text" name="phone" id="phone" tabindex="4" />
                        </li>
                        <li class="right">
                            <label for="email">Email Address<sub>*</sub></label>
                            <input type="text" name="email" id="email" tabindex="3" />
                            <span class="error" role="email">Please Supply Your E-mail Address</span>
                        </li>
                    </ol>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="addr">Address<sub>*</sub></label>
                            <input type="text" name="addr" id="addr" tabindex="4" />
                        </li>
                        <li class="left">
                            <label for="city">City<sub>*</sub></label>
                            <input type="text" name="city" id="city" tabindex="5" />
                        </li>
                        <li class="left">
                            <label for="state">State<sub>*</sub></label>
                            <input type="text" name="state" id="state" maxlength="2" tabindex="6" />
                        </li>
                        <li class="left">
                            <label for="zip">Zip Code<sub>*</sub></label>
                            <input type="text" name="zip" id="zip" maxlength="5" tabindex="7" />
                        </li>
                    </ol>
                </fieldset>
                <fieldset role="project details">
                    <legend>Project Specifics <span class="diagonals"></span></legend>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="type">Building Type<sub>*</sub></label>
                            <select name="type" id="type" tabindex="4">
                                <option value="Agriculture">Agriculture</option>
                                <option value="Commercial">Commercial</option>
                                <option value="Equine">Equine</option>
                                <option value="Pavilion">Pavilion</option>
                                <option value="Residential">Residential</option>
                            </select>
                        </li>
                        <li class="left">
                            <label for="city">Building Dimensions<sub>*</sub></label>
                            Width <input type="text" name="d_width" id="d_width" tabindex="5" />
                            Length <input type="text" name="d_length" id="d_length" tabindex="5" />
                            Height <input type="text" name="d_height" id="d_height" tabindex="5" />
                        </li>
                    </ol>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="city">Overhead Doors</label>
                            <span>Size</span> <input type="text" name="ohd_size" id="ohd_size" tabindex="5" />
                            <span>Quantity</span> <input type="text" name="ohd_quantity" id="ohd_quantity" tabindex="5" />
                        </li>
                        <li class="left">
                            <label for="city">Slider Doors</label>
                            <span>Size</span> <input type="text" name="sd_size" id="sd_size" tabindex="5" />
                            <span>Quantity</span> <input type="text" name="sd_quantity" id="sd_quantity" tabindex="5" />
                        </li>
                    </ol>
                    <ol class="no_bullets">
                        <li class="left">
                            <label for="city">Entry Doors</label>
                            <span>Size</span> <input type="text" name="ed_size" id="ed_size" tabindex="5">
                            <span>Quantity</span> <input type="text" name="ed_quantity" id="ed_quantity" tabindex="5">
                        </li>
                        <li class="left">
                            <label for="windows">Windows</label>
                            <span>Quantity</span> <input type="text" name="windows" id="windows" tabindex="5">
                        </li>
                        <li class="left">
                            <label for="city">Overhangs</label>
                            <input type="text" name="overhangs" id="overhangs" tabindex="5">
                        </li>
                    </ol>
                    <ol class="no_bullets">
                        <li>
                            <label for="city">Colors</label>
                            <input type="text" name="colors" id="colors" placeholder="Siding: Red, Trim: white, etc." tabindex="5" />
                        </li>
                    </ol>
                </fieldset>

                <fieldset role="message">
                    <legend>Additional Details</legend>
                    <ol class="no_bullets">
                        <li>
                            <label for="details">Please add any extra information that may be helpful in the planning of your project</label>
                            <textarea name="details" id="details" tabindex="5"></textarea>
                        </li>
                    </ol>
                </fieldset>

                <fieldset role="submit">
                    <input type="hidden" id="process_val" value="rfp" />
                    <input type="submit" name="submit" value="Submit" tabindex="6" class="dred_button">
                    <p class="required">* Required Fields</p>
                </fieldset>
            </form>

        </section>

    </article>`

```

# Answer
Couple thoughts for you to run down.

Might be spam-filter related. Look up your out-going mail logs on your server, they might tell you something interesting.

Also, if your action is blank, it's likely there's a jquery/javascript that's involved in your form process. If you use firebug, pop that open and see if you're getting any errors on the page. I'm guessing there may be something else broken on the page which would, in turn, break scripts related to the form.
> 1 votes

# Answer
Did this occur after an ee upgrade if so check this forum out.

http://ellislab.com/forums/viewthread/238309/
> 0 votes

# Answer
You can try ExpressionEngine's Email addon.

https://docs.expressionengine.com/latest/add-ons/email.html#email-contact-form

Also, check the email settings of EE. Navigate to `Settings->Outgoing Email` and try `PHP mail` in the Protocol section.
> 0 votes

# Answer
I would definitely try the Email add-on as well. Also, something else i have done before for this sort of thing is to create a channel to collect the info through a front-end Channel Form, and then use "MX Email From Template" Add-On to send the email. This works real well if you need it nicely or specificly formatted in a way that the Email Addon can't.
> 0 votes

---
Tags: email
---


# Question
Title: Getting warning message for Template Tags while updating from EE5 to EE6
After the successful update, I am getting a warning message about the below template tags on the success page that the template tags are not found.

```
{exp:mailinglist:form}
{exp:trackback:url}
{exp:trackback:entries}
{exp:referrer}
{exp:emoticon}

```

should we take care of it? or these addons removed from EE6?

# Answer
> 1 votes
In ExpressionEngine 6 we added a new check, for broken tags etc. Which I'm guessing is why these have surfaced during the EE 6 upgrade.

The following is a bit of a breakdown of the tags mentioned above.

```
 {exp:trackback:url}
 {exp:trackback:entries}

```

I believe this add-on was removed starting in version 2.0 https://docs.expressionengine.com/v2/installation/version\_notes\_2.0.html

```
 {exp:referrer}
 {exp:mailinglist:form}

```

Removed in version 3.0 https://docs.expressionengine.com/v3/about/changelog.html

```
{exp:emoticon}

```

Replaced with Emoji module in Version 4 https://docs.expressionengine.com/v4/installation/version\_notes\_4.0.0.html#emoticon-module

So some of these (emoticon) can be updated, others likely removed. My guess is that the functionality around these tags hasn't been working as intended for a while, or the add-ons we manually updated to support the newer versions of ExpressionEngine.

# Answer
> 0 votes
All of these modules have been deprecated in past versions so you'll need to remove those tags from the templates.

```
{exp:mailinglist:form} -v3
{exp:trackback:url} - v2
{exp:trackback:entries} -v2
{exp:referrer} - v3
{exp:emoticon} -v5

```

---
Tags: ee6
---


# Question
Title: Check domain where site data SEO is being plugged into
I need to be able to plug in a page URL on Facebook and Twitter and display different images.

I imagine this can be done with the og:type, but how do I check the domain in which the image is being displayed?

I created a grid field with a select dropdown option to select FB, TW, or our website, and file options to select different images. When the social media manager goes to FB or Twitter, she needs those images to show depending on which social media platform she's on.

Is this doable using og:type or seo\_type, or jquery/js?

# Answer
Broadly to get a preview card to show in TW or Facebook you need to specify some information in the `<head>` area of your HTML page. What information varies according to which service you want the preview to appear on, and you should check the documentation about how to specify these meta tags from OpenGraph (i.e. for Facebook) and Twitter relating to this function to get the full story.

The TLDR; version is that what appears is determined by the content of either opengraph meta-tags (facebook) or twitter meta-tags (twitter).

AFAIK the basic information you need for a preview card to display on each is something like this...

```
    <!-- Twitter / OpenGraph tags -->
    <meta property="og:title" content="...page title...">
    <meta property="og:type" content="e.g. website|article|profile|product">
    <meta property="og:url" content="... url of page ...">
    <meta property="og:image" content="... url of image to use ...">
    <meta property="og:image:width" content="... in px ...">
    <meta property="og:image:height" content="... in px ...">
    <meta property="og:image:alt" content="... alt text for image ...">
    <meta property="og:description" content="... description ...">
    <meta property="og:site_name" content="... name of site ...">
    <meta property="fb:app_id" content="... site's FB app registration # ...">

    <meta name="twitter:card" content="e.g. summary_large_image|summary|player">
    <meta name="twitter:title" content="...page title...">
    <meta name="twitter:description" content="... description ...">
    <meta name="twitter:site" content="@site_owner_tw_tag">
    <meta name="twitter:url" content="...url of page...">
    <meta name="twitter:creator" content="@creator_tw_tag">
    <meta name="twitter:image" content="...image url...">
    <meta name="twitter:domain" content="...site domain...">

    <link rel="canonical" href="{current_url}">
    <!-- /Twitter / OpenGraph tags -->

```

You probably don't need all of these (but you can actually have quite a few more if you really want to...), and for the pictures on preview cards the good news is that Twitter will use whatever OpenGraph (i.e. facebook) data you specify for this if you don't specify twitter specific info.

Also, you might find this resource helpful - it gives info on how big the pictures need to be for the various social media platforms that can do previews.

HTH
> 0 votes

---
Tags: jquery, channel-images, parse-order, seo, parse
---


title: EE 5.1.3 Install Error

text:
# Question
Title: EE 5.1.3 Install Error
I'm trying to install EE 5.1.3 on my server but keep getting error:

```
Exception Caught

No such property: 'db' on EllisLab\ExpressionEngine\Legacy\Facade

ee/EllisLab/ExpressionEngine/Legacy/Facade.php:120

Stack Trace: Please include when reporting this error

#0 ee/EllisLab/ExpressionEngine/Legacy/Facade.php(30): EllisLab\ExpressionEngine\Legacy\Facade->get('db')
#1 ee/installer/controllers/wizard.php(853): EllisLab\ExpressionEngine\Legacy\Facade->__get('db')
#2 ee/installer/controllers/wizard.php(272): Wizard->do_install()
#3 [internal function]: Wizard->_remap('do_install', Array)
#4 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#5 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#6 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#7 admin.php(153): require_once('...')
#7 admin.php(153): require_once('...')

```

I have doubled checked that the DB is, in fact, up and running and connected to it using all same credentials in entered on the admin.php install wizard page.

Any help or direction in getting this resolved would be greatly appreciated.

# Answer
are you sure the paths and mysqli settings you used are correct?
> 0 votes

# Answer
It turns out my host changed from using "localhost" for accessing the db and had to use a different host. Thanks!
> 0 votes

# Answer
Check `$config['database']` array in `config.php` file. If your localhost is running on a different port, you will have to add the port in the hostname in the `config.php` file like `localhost:9090`
> 0 votes

---
Tags: install, ee5
---


# Question
Title: Can't log in to ANY EE site (on only one computer)
Weird problem that is happening only with EE sites one one computer. I manage a number of ExpressionEngine websites and suddenly today I can't log in to any of them. I get the "This form has expired. Please refresh and try again" error message on any EE site I try to log in to. I checked on other computers and can log in just fine, even from my phone which is on the same IP address as my main computer. I have tried all manner of cache clearing (on EE via ftp and in browsers) and cookie clearing, computer restarts, different browsers, many tweaks to config files. Nothing is helping. The only thing that seems to have an effect is if I add "$config\['disable\_csrf\_protection'\] = "y";" to the config file - this doesn't allow me to log in, instead I see a "you must enter a username" message, even though a username has been entered. The EE sites I am trying to log in to are all running either version 5.4 or 6+. Any ideas at all???

# Answer
It could be a stale cookie. Clear your browser history and cookies then try logging in again.

Otherwise open up /system/user/config/config.php and add:

```
$config['cp_session_type'] = 's';

```

This forces control panel logins to use session ID's instead of cookies.
> 0 votes

# Answer
OP answer: BITDEFENDER developed a sudden hostility to multiple ExpressionEngine sites, many of which I access on a daily basis. When I turn off Bitdefender I am able to access all EE sites again. If you run into this issue save yourself some time and check your anti-virus software first!
> 0 votes

---
Tags: control-panel
---


# Question
Title: Site Optimisation: What do you think I should do?
So I have an SEO and website designing startup Pluton Ltd.https://pluton.ltd Now I have tried to make it look awesome but it is taking a lot of time to load. I have even compressed and optimized my images. What else can be done?

# Answer
A great place to start with things like this is to checkout Google Pagespeed. It looks like a couple things:

1. Serve your images in next gen formats (webp)
2. Fix your render blocking resources, like styles that need are being loaded in the header
3. Fix your server time. It's taking way too long.

You asked this in the EE Stack, but your site looks to be WordPress. There are a load of WP plugins that can help with this kind of thing, like WP Rocket or Hummingbird, that can take care of a number of these things.
> 1 votes

# Answer
My first question is.... Looking into your page code... is this a WordPress site? it looks to have a ton of elements from there...

Looked some more... I think you might have posted to the wrong forum. I can't help much with WP.

UPDATE: One recommendation I can make is to run your site through something like seositecheckup.com. It will at least tell you where to start. it looks like... although you pass, the items you fail are all directly related to site speed. You are extremely heavy on the image side.

R
> 0 votes

# Answer
It's a Wordpress site so this is indeed the wrong forum.

Your total home page weight is 15mb so no wonder its slow, here's what's causing that.

CSS 2.45mb
JS 2.99mb
FONTS 0.45mb
IMAGES 9.09mb

In an ideal world a home page like yours should come in at less than 1mb.
> 0 votes

# Answer
Use WGET and render this as a static site or use a static site Wordpress plugin.
> 0 votes

---
Tags: structure, low-search
---


# Question
Title: Problem installing - "there is no suitable CSPRNG installed on your system"
Can anyone help me with this? Im trying to installed 5.3.2 and this message is appearing.

```
Exception Caught
There is no suitable CSPRNG installed on your system
ee/EllisLab/ExpressionEngine/Library/Compat/Random/random.php:176

Stack Trace: Please include when reporting this error
#0 ee/EllisLab/ExpressionEngine/Library/Compat/Random/random_int.php(156): random_bytes(8)
#1 ee/EllisLab/ExpressionEngine/Service/Encrypt/Encrypt.php(285): random_int(-9223372036854775807, 9223372036854775807)
#2 ee/installer/controllers/wizard.php(878): EllisLab\ExpressionEngine\Service\Encrypt\Encrypt->generateKey()
#3 ee/installer/controllers/wizard.php(272): Wizard->do_install()
#4 [internal function]: Wizard->_remap('do_install', Array)
#5 ee/EllisLab/ExpressionEngine/Core/Core.php(241): call_user_func_array(Array, Array)
#6 ee/EllisLab/ExpressionEngine/Core/Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#7 ee/EllisLab/ExpressionEngine/Boot/boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#8 admin.php(153): require_once('...')
#8 admin.php(153): require_once('...')

```

# Answer
> 2 votes
CSPRNG stands for cryptographically secure pseudo-random number generator which is a library added to PHP from version 7.0 onwards. From version 5.2 onwards it was possible to install an additional module on your server to provide this service.

So my guess is that the php system on the server you are using is running some flavour of php5, and that this additional module is not installed.

Strong recommendation is therefore to adjust your server to be one that is running a version of php7. If this is not possible, then discuss with your server administration the possibility of adding the necessary CSPRNG module to whatever version is being used.

HTH

# Answer
> 1 votes
I know it's an old thread, but if someone is having same problem when running Windows server with PHP 5.6, you need to make sure you have CAPICOM installed and `com_dotnet` extension is included in `php.ini`

---
Tags: php-errors, install
---


title: Getting CAPTCHA to work with Freeform

text:
# Question
Title: Getting CAPTCHA to work with Freeform
I'm trying to add a CAPTCHA to a Freeform (free version) form.

The form is a callback request form that features in the header of the site, so is visible on every page and is not linked to a specific channel.

I've got the CAPTCHA to show up but the form can be submitted with the CAPTCHA text field left blank.

Anyone know a good way of using a CAPTCHA with Solspace's Freeform in this way?

# Answer
> 2 votes
After hours of digging (never worked with ExpressionEngine before) I found out why it was not working in our setup (EE v2.8.1, Freeform Pro 4.1.7). Leaving this here for anybody else looking for the answer:

Go to **CP \> Admin \> Security and Privacy \> CAPTCHA Preferences**. There you will find two input fields that were empty in the site I was working on: "**Server Path to CAPTCHA Folder**" and "**Full URL to CAPTCHA Folder**". Fill these out.

The last one should probably be "/images/captchas" and the first depends on your server. You can find the correct path using PHP's getcwd. It should look something like "/var/www/vhosts/\[...\]/public\_html/images/captchas". This folder should be writable.

After that the Captcha finally showed up.

A few dead ends, to help redirect misguided searches:

* The "{captcha}" or "{freeform:captcha}" EE template code was not the issue
* CAPTCHA being disabled for logged in members was not the issue
* "Enable Membership CAPTCHA" was not the issue (I think this related to registering, which we don't use)

# Answer
> 0 votes
In the documentation there is a parameter to make sure the captcha is required

This assumes you are using the freeform captcha not the default ExpressionEngine one.

If you have done these things already, please edit your question to include your code.

---
Tags: solspace-freeform, captcha
---


title: Additional data in the comments

text:
# Question
Title: Additional data in the comments
Need to add to comments selection of Like/Dislike. The form of adding text requires a mandatory choice of one of two options. In the form of a radio button. And, accordingly, display this field for published comments. Sorting no need.

Any ideas?

# Answer
I solved it very simply. You can use a ready-made {location} field and a radio button with options. The radio sends 1 (Like) or 2 (Dislike) to the {location} filed.

Only does not work with registered users. For them, the {location} field is already filled in, even if it is empty.
> 0 votes

---
Tags: comments
---


title: Email contact form not sending mail

text:
# Question
Title: Email contact form not sending mail
My email contact form doesnt work at all. I can send email throught he system "send mail" but not a form.

My code looks like this:

```
{exp:email:contact_form user_recipients="no" recipients="xxx@xxx.com" redirect="2" return="{site_url}contact" charset="utf-8"}

            <div class="contact-form w-form">
              <div id="email-form" name="email-form" data-name="Email Form" class="mail-form w-clearfix">
              <input type="text" class="text-field-name w-input" maxlength="256" name="name" data-name="Name" placeholder="Name" id="name"><input type="email" class="text-field-email w-input" maxlength="256" name="email" data-name="Email" placeholder="Email" id="email" required="">
              <input type="text" class="text-field-subject w-input" maxlength="256" name="Subject" data-name="Subject" placeholder="Subject" id="Subject" required="">
              <textarea placeholder="Please write your message here ..." maxlength="5000" id="Message" name="message" data-name="Message" class="text-area-message w-input"></textarea>
              <input type="submit" name="submit" value="Submit" class="submit-button w-button">
              </div>

            </div>
{/exp:email:contact_form}

```

# Answer
@paul You need to include a `from` input, even if it's just hidden. See the docs here: https://docs.expressionengine.com/latest/add-ons/email.html#from
> 0 votes

---
Tags: email, email-contact-form
---


# Question
Title: Trying to export EE to WordPress and I can't get all of the content to show
I have a EE site that I'm trying to export to a WordPress site using this guide https://kingdesignllc.com/blog/migrating-from-expression-engine-to-wordpress/. It's working ok, except I can't get all of the content to import into WordPress.

This brings in a couple of paragraphs - `<content:encoded><![CDATA[{body}]]></content:encoded>` \- but the rest of the content can't be imported because it's within this tag:

```
<wp:meta_key>extended</wp:meta_key>
<wp:meta_value><![CDATA[{extended}]]></wp:meta_value>
<excerpt:encoded><![CDATA[{summary}]]></excerpt:encoded>

```

Anyone have an idea on how to combine the two so I can import all of the content? The entire template is below:

```
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>

<link>{site_url}</link>
<description>My Site</description>
<pubDate>{current_time format="{DATE_RSS}"}</pubDate>
<generator>http://wordpress.org/?v=2.8.6</generator>
<language>en</language>
<wp:wxr_version>1.0</wp:wxr_version>
<wp:base_site_url>{homepage}</wp:base_site_url>
<wp:base_blog_url>{site_url}</wp:base_blog_url>
{exp:weblog:categories style="linear" weblog="default_site"}
<wp:category>
<wp:category_nicename>{category_url_title}</wp:category_nicename>
<wp:category_parent></wp:category_parent>
<wp:cat_name><![CDATA[{category_name}]]></wp:cat_name>
</wp:category>
{/exp:weblog:categories}
{exp:weblog:entries weblog="default_site" orderby="date" sort="desc" limit="200" offset="0" rdf="off"}
<item>
<title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
<link>localhost:8000/?p={entry_id}</link>
<pubDate>{entry_date format="{DATE_RSS}"}</pubDate>
<dc:creator><![CDATA[{author}]]></dc:creator>
{categories}

<category domain="category" nicename="{category_url_title}"><![CDATA[{category_name}]]></category>
{/categories}
<guid isPermaLink="false">localhost:8000/?p={entry_id}</guid>
<description></description>
<content:encoded><![CDATA[{body}]]></content:encoded>
<wp:meta_key>extended</wp:meta_key>
<wp:meta_value><![CDATA[{extended}]]></wp:meta_value>
<excerpt:encoded><![CDATA[{summary}]]></excerpt:encoded>
<wp:post_id>{entry_id}</wp:post_id>
<wp:post_date>{entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date>
<wp:post_date_gmt>{gmt_entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date_gmt>
<wp:comment_status>open</wp:comment_status>
<wp:ping_status>open</wp:ping_status>
<wp:status>publish</wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type>post</wp:post_type>
<wp:post_password></wp:post_password>
<wp:postmeta>

</wp:postmeta>
{embed="comments.xml" the_entry_id="{entry_id}"}
</item>
{/exp:weblog:entries}
</channel>
</rss>

```

# Answer
> 0 votes
Unless I'm missing something, you need to adjust this line of code:

```
<content:encoded><![CDATA[{body}]]></content:encoded>

```

to use the correct combination of these tags which are holding the content: `{summary}{extended}{body}`

```
<content:encoded><![CDATA[{summary}{extended}{body}]]></content:encoded>

```

---
Tags: export, database-migrations
---


# Question
Title: Upgrading from EE v2 - v6 - Module alternatives?
Am upgrading an old site from v2 - latest version but there are two must have plugins/modules that I can't find replacement for.

1. Is called "Authentic" and it essentially password protects a download area by-passing the member module. This could have been done by restricting to logged in members but there are several client-specified reasons why we can't do it this way.
2. This is "Zoo Flexible Admin" and is used to create custom menus - ie the main areas that admin use of the CP will go in custom menus here.

Is there any way of replicating these? Recommendations for modules that do the same thing or workarounds?

Cheers

# Answer
> 1 votes
1. Looking at this add-on it looks like it would be a very quick one to update to version 6 (Might be worth asking in Slack https://expressionengine.com/blog/join-us-in-slack if someone is willing and able to do it)
2. In version 6 most people replace Zoo Flexible Admin with the native menu manager. https://docs.expressionengine.com/latest/control-panel/settings/menu-manager.html

---
Tags: ee2-upgrades, zoo
---


# Question
Title: How can I list child entries from parent in EE Structure?
I'm working with EE v2.9.3 and Structure v3.3.14.5 I have simple structure hierarchy

```
MAIN PARENT
- parent 1
---child 1a
---child 1b
- parent 2
---child 2a

```

and so on. I want to create json for my javascript file. So, I started with creating snippet with that structure:

```
<script type="text/javascript">
var d = [
      {exp:structure:entries channel="first-channel" disable="categories|category_fields|member_data|pagination" dynamic="no" status="open"}
    {
        "name": "{title}",
        "locations": [
         {
            "name": "{title}",
            "phone": "xxx",
            "email": "xxx",
          }
        ],
    },
      {/exp:structure:entries}

];
console.log(d);
</script>

```

And it's working. I can see my objects created with names parent 1, parent 2 etc. Now I want to create "locations" key (whatever there's 1 or more entries) which will be contains my child entries like child 1a, 1b etc. I tried with nested `{exp:structure:entires}` but it doesn't work. So my question is - how can I create `locations` key based on nested `exp` loop?

# Answer
How did you nest the second entries tag? If you just added it within it might not work, might need to use an embed. But someone else might know if a better way.
> 0 votes

---
Tags: structure, nested-list, child
---


title: simple form search

text:
# Question
Title: simple form search
I have created a simple\_form for a search bar in a sidebar. I can view it in the debugger and it highlights when I submit but nothing happens. I have added a result\_page and a no\_result\_page but nothing occurs. I would expect to hit one of those pages upon submission but nothing happens?

```
{exp:search:simple_form
            channel="articles"
            result_page="search/results"
            no_result_page="articles"
            results="10"
            show_future_entries="no"
            status="open"
            where="any"
            }
    <input type="search" class="form-control" id="exampleInputEmail1" placeholder="Search">
    <input type="submit" value="submit" class="submit">
{/exp:search:simple_form}

```

Any ideas why its not submitting anywhere? Ive checked and the search module is installed.

# Answer
> 0 votes
Are you getting a standard error message something like "You did not submit a search term"??

This is the first step, your search keywords field needs to be named and ID'd `keywords` so :

```
<input type="search" class="form-control" id="keywords" name="keywords" placeholder="Search">

```

Once I do this my search form submits without errors, in fact as I have no articles channel it forwards me to `/articles/[SEARCHKEY]` i.e. no results...

My recommendation is to start with the documented form and alter it to your needs, testing results/no results as you go : https://ellislab.com/expressionengine/user-guide/add-ons/search/simple.html

**Edit** : Additionally

I note your no results path is just `/articles`, note that simple search will append the search key to your URL, so on no results will go to `/articles/SOMEALPHANUMSTRING`. I assume you have a Template group called "articles" however wit hthe presence of the search key this will casue EE to look for a template called whatever the search key is. To get around this, make sure you set up your index template with the route path of `articles/{searchkey}` or similar, this will allow the search key to pass through.

If you use a scheme like `articles/url_title` to also display individual articles, on this single view template set your route to `articles/{article_url_title}` and make sure this route happens before your article listing /no results route in the route manager.

# Answer
> 0 votes
Your search field needs naming "keywords":

```
<input type="search" name="keywords" class="form-control" id="exampleInputEmail1" placeholder="Search">

```

Try that...

---
Tags: search
---


title: Channel form not working for Members

text:
# Question
Title: Channel form not working for Members
When I am logged in as super admin then the channel form works (inserting the new entries to the channel) but when I am logged in as a normal user(members group user or guest user) then it does not work. I have changed lots of settings of members but this not working.

Form: {exp:channel:form channel="wedding" return="site/ENTRY\_ID" json="yes" class="form account-form" include\_assets="no" include\_jquery="no"}

when I am submitting the form it shows refreshes the page not saving data into the channel when set the redirect link. if json="yes" shows this message

{"success":1,"errors":\[\],"field\_errors":\[\],"entry\_id":null,"url\_title":null,"channel\_id":3}.

# Answer
Do 'members' have permission to post entries to the channel the form is for?

Channels \> \[Your Channel\] \> Permissions (depending on the version of ee you're using)
> 0 votes

---
Tags: members, channel, entries, url-title
---


# Question
Title: Freeform Pro Composer Templates - add class to input/select/checkboxes
Is there an easy way to apply classes to Freeform Pro form elements in composer mode?

I have gone through several SO posts (& blog posts including this helpful one) however haven't been able to find a solution to cover all elements.

The general suggestion appears to be:

*Replace*

```
{composer:field_output}

```

*With*

```
{freeform:field:{composer:field_name} attr:class="form-control"}

```

Which works well until you get to `<select>` & other HTML elements:

**Note:** The orange highlight is where a select field type should be and the red is a random tag that I can't seem to work out where it's coming from...

The only way I can get all elements to display correctly is by using the standard syntax "`{composer:field_output}`" and then jQuery to add classes to elements:

```
//jQuery
$('.composer-form input[type="text"],.composer-form select,.composer-form textarea').addClass("form-control");
$('.composer-form input[type="submit"]').addClass("btn btn-primary");

```

If there isn't an easy way to apply relevant classes to elements using conditional statements, I will stick with the jQuery option however I really hope it's something simply I am missing in my composer template (see below for the template code).

Any help, advice or insight will be greatly appreciated.

**Composer (Bootstrap 3) template**:

```
<div class="form-group composer-form">
{composer:page}
    {composer:rows}
            <div class="row">
        {composer:columns}
                <div class="{if composer:column_total == 1}col-md-12{/if}{if composer:column_total == 2}col-md-6{/if}{if composer:column_total == 3}col-md-4{/if}{if composer:column_total == 4}col-md-3{/if}">
                {if composer:field_total == 0}

                {/if}
            {composer:fields}
                {if composer:field_label}
                    {if composer:field_type == 'nonfield_captcha'}
                        {if freeform:captcha}
                        <p>
                            <strong>{composer:field_label}</strong>
                        </p>
                        {/if}
                    {if:else}
                        <label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
                            {composer:field_label}{if composer:field_required} <span class="required_item">*</span>{/if}
                        </label>
                    {/if}
                {/if}
                {if composer:field_output}
                    {if composer:field_type == 'nonfield_captcha'}
                        {if freeform:captcha}
                                {freeform:captcha}<br />
                                <input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
                        {/if}

                    {if:else}

                        {freeform:field:{composer:field_name} attr:class="form-control"}

                    {/if}
                {/if}
            {/composer:fields}
                </div>
        {/composer:columns}
            </div>
    {/composer:rows}
{/composer:page}
</div>

```

# Answer
> 0 votes
It should be done like so:

```
{composer:fields}
                {if composer:field_output}
                    {if composer:field_type == 'nonfield_title'}
                        <h2>{composer:field_output}</h2>
                    {if:elseif composer:field_type == "text"}
                        <fieldset>
                        <label class="field_label no-sidebar" {if composer:field_name != ''}for="{composer:field_name}"{/if}>
                            {composer:field_label}
                            {if composer:field_required}<span class="required" required aria-required="true">*</span>{/if}
                        </label>
                        <input type="text" class="input" name="{composer:field_name}" placeholder="{composer:field_label}"></fieldset>
                    {/if}
                    {if:else}
                        <fieldset>{composer:field_output}</fieldset>
                    {/if}
                {/if}
{/composer:fields}

```

# Answer
> 0 votes
You could always add some extra CSS to target input fields, for instance:

```
.composer-form input[type='checkbox'] { /* your styles */ }
.composer-form input[type='text'] { /* your styles */ }

```

---
Tags: solspace-freeform, solspace, composer, composer-template
---


# Question
Title: Change all links http to https with search-and-repace-tool?
In my database there are old `http://`-urls (in different fields). I want to replace them all with `https://`

Does this work with the search-and-repace-tool (in EE6: Tools -\> Data Operations -\> Search and Replace ) without crashing the whole thing?

Also I am not sure how I could target the whole database. As you can see in my screenshot I had to choose a special channel field, but I want run the replace over alle fields.

Thanks in advance!

# Answer
Yes you can do that with search & replace. The only "downside" is that you have to do it one custom field at a time. If you know what fields might have http:// in them you can skip the others.
> 2 votes

# Answer
Are these links within your site? If yes, It might be easier to just setup a http to https redirect using htaccess or nginx config.
> 1 votes

# Answer
I'd consider moving to relative links instead of hard-coding http: or https:. e.g., instead of:

```
<a href="https://www.mysite.com/page>Page</a>

```

You'd have:

```
<a href="/page">Page<a/>

```

That would obey the protocol your user is on and be flexible in case you ever change the domain. You'd find "https://www.mysite.com/" and replace it with "/".

On top of that, I'd set up your web server to forward http traffic to https. e.g., in Apache:

```
<VirtualHost *:80>
  ServerName www.mysite.com
  Redirect 301 / https://www.mysite.com
</VirtualHost>

<VirtualHost *:443>
  ServerName www.mysite.com
  #rest of settings
</VirtualHost>

```

That would solve your http traffic problem. Google would index your site properly (https).
> 0 votes

---
Tags: http, ee6
---


# Question
Title: Textile plug-in throwing PHP errors RE preg_replace /e modifier
I'm using the Textile plug-in on a new project and it's spawning PHP errors all over the place and complaining thusly:

> A PHP Error was encountered Severity: 8192
>
> Message: preg\_replace(): The /e modifier is deprecated, use preg\_replace\_callback instead
>
> Filename: textile/pi.textile.php
>
> Line Number: 918

Not one I've run into before but this is occurring in my local dev env on a new MacBook so it's a fresh install of MAMP running PHP 5.5.3.

Any ideas???

**Update:** I only see the PHP error in the front end templates when logged in as Admin.

The function generating the error is 'footNoteRef':

```
function footnoteRef($text)
{
    return preg_replace('/(?<=\S)\[([0-9]+)\](\s)?/Ue',
        '$this->footnoteID(\'\1\',\'\2\')', $text);
}

```

:)

# Answer
> 6 votes
According to https://www.php.net/preg\_replace , the /e modifier was removed in PHP 5.5.0 . If you downgrade PHP to pre-5.5.0, then the error will go away. Alternatively, in your config.php file set error\_reporting(E\_ALL ^ E\_DEPRECATED); to hide deprecated warnings.

Alternatively, upgrade Textile - but it looks like http://devot-ee.com/add-ons/textile-editor-helper-teh hasn't been upgraded in some time.

=== Added after you posted the code ==

Try changing

```
function footnoteRef($text)
{
    return preg_replace('/(?<=\S)\[([0-9]+)\](\s)?/Ue',
        '$this->footnoteID(\'\1\',\'\2\')', $text);
}

```

to (untested)

```
function footnoteRef($text)
{
    return preg_replace_callback('/(?<=\S)\[([0-9]+)\](\s)?/U',
function ($matches) {
            return $this->footnoteID($matches[1],$matches[2]);
        },
         $text);
}

```

# Answer
> 0 votes
So, if you remove everything from the function as it is and replace it with the following:

```
preg_replace_callback('/(?<=\S)\[([0-9]+)\](\s)?/U',
                   create_function('$matches','return $this->footnoteID($matches[1],$matches[2])'), $text);

```

This is totally untested, but I *think* it's right. No doubt if it's not, someone will chime in - Regular Expressions are not my forte.

# Answer
> 0 votes
after upgrading to php 7.3 you will likely see a similar error related to textile compilation

```
preg_replace_callback(): Compilation failed: invalid range in character class at offset 184
user/addons/textile/pi.textile.php, line 628

```

this is explained quite well in this stackoverflow thread: https://stackoverflow.com/a/56551371/11512584

> PHP PCRE engine migrates to PCRE2, and the PCRElibrary version used in PHP 7.3 is 10.32, and that is where Backward Incompatible Changes originate from

on line 615 column 38 of pi.textile.php there was an unescaped hyphen, adding a backslash before this hyphen was enough to resolve the compilation error in my case (expression engine 5.4.2, using Textile plugin for ExpressionEngine 2.x)

diff:

```
615c615
<       $qtags = array('\*\*','\*','\?\?','\-','__','_','%','\+','~','\^');
---
>       $qtags = array('\*\*','\*','\?\?','-','__','_','%','\+','~','\^');

```

---
Tags: plugin, php-errors
---


title: Replacing spaces in image file names

text:
# Question
Title: Replacing spaces in image file names
I'm working on an upgrade of an EE2 site to EE6. The site is using Assets and CE Image. A lot of the images that have been uploaded over the years (since 2012) have spaces in the filenames. CE Image used to handle this OK on EE2, but now on EE6, those images aren't being transformed.

I saw elsewhere that adding `url_decode` to the `src` would fix it, but it's not working for me.

I've tried searching for another image resizing add-on but the only one I could find was a fork of `imgsizer` and it has the same problem with spaces in file names.

So then I thought about renaming all of the images on the server and updating the `file_names` in the `exp_assets_files` table. But there's a lot of images that have been uploaded twice, some with spaces in the file names, and then others uploaded some time later without. And when trying to run queries on the database, I get errors for `Duplicate entry 'filename.jpg' for key 'unq_folder_id__file_name'`.

Anyone have any advice on this problem? This site has several thousand images on it. :(

# Answer
> I saw elsewhere that adding url\_decode to the src would fix it, but it's not working for me.

Might want to try `url_encode`

Other option might be `{my_file:replace find=' ' replace='_'}`
> 0 votes

# Answer
I'm on the verge of releasing a new EE5/EE6 add-on (the unoriginally titled **JCOGS Image**) that is a drop-in replacement for **CE Image**. In my testing it works with image filenames that include spaces. If you DM me either here or via the EE Slack I can maybe set you up with an RC copy if that helps...
> 0 votes

# Answer
I'd probably go for renaming files and file references in the database to prevent similar issues arising later. Cure the problem not the sympton.

Right now you have a couple of good temporary fixes available which will of course work, but it's something you'll always have to "fix".
> 0 votes

---
Tags: assets, ce-image
---


# Question
Title: Can I relate a non-calendar entry to a Solspace Calendar?
I have a site with EE6 and Solspace EE Calendar 4. I have a single Events channel where all events are published. I have 15+ calendars set up in EE Calendar for various programs represented on the site.

I want to allow our publishers to associate a non-event/non-calendar entry (which represents a single page on the website) with a specific calendar in the addon. The goal is to be able to create a mini-calendar and list upcoming events, filtered to a specific calendar/program, on the page template for the non-event/non-calendar entry.

I'm struggling with the best way to associate a non-event entry with one of the calendars in EE Calendar so that I can use this relationship in the template tag parameters to create a mini-cal or event list.

I could add a new field where publishers enter the calendar id or calendar shortname, but this seems clunky as they would need to look up that info in the control panel ahead of time. I could add a new EE Calendar field, but this field is designed to capture date & time of an event and not really designed to just establish a relationship to a specific calendar.

Does anyone have an idea which would make this relationship more seamless and user friendly? Maybe I'm missing something simple by thinking the solution needs to be complicated.

Thanks!

# Answer
If you don't have many 'single pages' (i.e. less than a few dozen) on the site I'd look at adding a relationship field in the events channel. When you create an event you'd select one or more pages to relate to. That would give you the ability to bi-direction linking to/from those pages.
> 1 votes

---
Tags: solspace, solspace-calendar
---


# Question
Title: Use Channel Entries Search to Search Grid Field?
See: Use channel search parameter with grid fields

The answer suggests that there is no way to search for grid field values. Is this still the case until now?

# Answer
> 1 votes
That's correct. The easiest way to do it is with the excellent Low Search addon and use the Low Search Results tag as a drop in replacement for the {exp:channel:entries} tag and use the Field Search filter as described.

# Answer
> 0 votes
Remember to set the field and at least one of its columns as searchable. The values of the chosen column will be concatenated on a database column specially to be searched.

---
Tags: channel-entries, search
---


# Question
Title: Use channel search parameter with grid fields
I need to filter entries basing on `grid` field. If grid field is filled the entries will be shown. But I can't do that because seems that is not supported by `search` parameter. This doesn't works:

```
{exp:channel:entries channel="notizie" limit="10" search:immagine_principale:immagine="not IS_EMPTY"}

```

where `immagine_pricipale` is a grid field.

How can I solve it?!

# Answer
> 1 votes
If you use the Low Search Results tag as a replacement for the Channel Entries tag, you can use that exact syntax thanks to the Field Search filter. As far as I know, there's no native way to filter entries like that.

# Answer
> 0 votes
Remember to set the field and at least one of its columns as searchable. The values of the chosen column will be concatenated on a database column specially to be searched.

# Answer
> -1 votes
You can use search on the grid field tag pair, like:

```
{exp:channel:entries channel="notizie"}

    {!--grid field--}
    {immagine_principale
        search:immagine="not IS_EMPTY"
        limit="10"
    }
        {!--content...--}
    {/immagine_principale}

{/exp:channel:entries}

```

ee grid search parameter in docs

---
Tags: channel-entries, grid, entries
---


# Question
Title: Including {exp:channel:entries} within Freeform Notifications
Is it possible to include Channel Entry data within Freeform Email Notifications?
Either when using the Database Entry or the HTML Template method?

Thanks.

# Answer
The way to do this would be to use the `override_values` parameter: https://docs.solspace.com/expressionengine/freeform/v2/templating/form.html#param-overridevalues

You can feed Freeform fields values at template level. What you'd want to do is create a hidden field that captures the Entry ID. Then override its (empty) value with the Entry ID:

`override_values:location="{entry_id}"`

You may need to have the form inside an embed in order to pass the Entry ID to it in time.

Then inside your email notification template, you should be able to feed a `{exp:channel:entries}` tag the ID you collected from that field, or perhaps you don't need to (if all you wanted was the ID or an Entry title, etc.
> 1 votes

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


title: Template Dynamic Variables

text:
# Question
Title: Template Dynamic Variables
I do not know how to program in PHP, but I am trying to understand how I can set dynamic variables in templates. For example, if I use the query tag, how can I create a few dynamic variables that i can place the value of in a few different areas on the template? I have been looking at low variables and the standard template variables, but don't see how to make them work dynamically. Can this be done?

# Answer
There are two ways that you can do this, one built in to EE's core function, the second using a widely used add-on.

Almost all dynamic variable use cases can be met using layout variables; a system that allows you to create and store single variable values and simple arrays during the evaluation of a template. You can store anything that can be generated as output by an EE template within a layout variable.

The quirk with layout variables is that the variables you define only become available for use after parsing of the template is complete, so the only way to use them within your page is to concurrently use EE's template layout system - which is not a bad thing, the template layout system is helpful and powerful. It lets you break the parsing of a template into the accummulation of the processing of two or more component templates: layout variables defined in a component template become available to the next (and all subsequent) templates in the sequence.

The alternative solution is to use an add-on called stash. This widely used add-on provides (amongst other things) a very similar mechanism for storing local / temporary values to that provided by layout variables, the primary difference being that stash variables become available for re-use upon definition (no need to wait until the template evaluation is complete).

Stash is a complicated add-on and has complicated documentation to go with it that at times can be confusing to follow, though using it for local variable storage is clearly explained.

By comparison layout variables do less (but usually enough) but are simpler to work with, though to get the best from them you need to learn also to structure your template designs to use the template layout system.

HTH
> 0 votes

---
Tags: low-variables, layout-variables
---


title: Pending comment

text:
# Question
Title: Pending comment
think a stupid question but don't see it. I have two channels with comment possibilities one the comments are pending and the other directly post the comment on the site. I want to pending both but don't see where or how I can do that. I'm logged off

Thanks

# Answer
Check out the "Moderate Comments" setting in the channel settings. https://docs.expressionengine.com/latest/control-panel/channels.html#settings-tab
> 2 votes

---
Tags: templates, comments, comment-form, template-manager
---


# Question
Title: Does Expression Engine 3.5+ work with PHP 7.4?
Hosting for the site is moving to a new server which will initially run PHP 7.2, but is slated to move to 7.4 soon. The documents show that 3.5+ will run on 7.2 but 7.4 is not mentioned.

Will EE 3.5+ run on 7.4?

# Answer
> 2 votes
I don't believe the 3.x line supports PHP 7.4. For what it's worth, the upgrade to 6.x is pretty simple from 3.x. It would also put you on a major version that's LTS and as such will be supported for 5 more years.

https://expressionengine.com/support/version-support

---
Tags: php
---


# Question
Title: Embedcode doesn't display channel file input
if I use {embed="store/something"} and use {field:photo} inside something it doesn't appear but if I goto something directly the {field:photo} is visible and works fine. Is this a bug??? EE6

# Answer
When you open one within a template EE generates a whole new template instance for an embed: the content of the embed are not affected directly by the conditions in the template that called it. This is one of (possibly the only) the features of embeds that give reason for using one. The details of what is going on are explained well in the documentation.

So in your case, since the embed 'starts again' it won't know what is being referred to by any variable field unless you run a new channel:entries tag within the embed.

This lack of awareness of context is unhelpful - usually you want an embed to be responsive to the circumstances where the embed is called - and to address this embeds can pass variables from the context to the embed - simply add parameters with the name of the variables you want to use within your embed and then reference these parameters using the `{embed:variable_name}` construct within your embedded templated.

So in your case you could modify your embed tag to read:

```
{embed="store/something" photo="{field:photo}"}

```

and in your embed template access the `{field:photo}` value using the variable `{embed:photo}`.

Alternatively, if you don't need or want the separate template instance - for example if you are simply looking to reuse a common code block in several templates - you might be better to consider either putting your embed code into a template partial, or possibly refactoring your template to let you make use of layout variables.

HTH
> 1 votes

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


title: Pages not showing data

text:
# Question
Title: Pages not showing data
I wanted to make a new page "Career Fair" so copied "Admissions" a channel and template, rename it off course. On "Career Fair" I have checked to admission fields.

After this, some pages of Admissions are not showing their entry data on the frontend but data is present on the backend.

Sharing that page code which is not showing data:

```
{exp:channel:entries channel="admission" url_title="undergraduate-admissions" status="open" dynamic="no" limit="1"}

```

# Answer
I don't know if it is intended or not, but the code you have shared will only ever show one entry on the page you are loading it on - the `limit='1'` parameter in the tag will ensure that however many entries you have in your channel, only one will be displayed. So you could try removing this parameter and maybe that will help.

If not, you'll need to provide some more information about what you are doing on your site, and also the version of EE you are using (and if you can find it out what version of php your web server is running).

HTH
> 0 votes

---
Tags: channel, fields, entry, content
---


title: Deprecated function set_cookie

text:
# Question
Title: Deprecated function set_cookie
I am running EE 6.2.1. My developer log continuously reports two errors:

> Deprecated function set\_cookie() called in /var/www/vhosts/domain.tld/systemfolder/ee/ExpressionEngine/Addons/comment/mod.comment.php on line 1738.
>
> Deprecated since 2.8. Use EE\_Input::delete\_cookie() instead.

and

> Deprecated function set\_cookie() called in /var/www/vhosts/domain.tld/systemfolder/ee/ExpressionEngine/Addons/comment/mod.comment.php on line 1728.
>
> Deprecated since 2.8. Use EE\_Input::delete\_cookie() instead.

How could I get rid of this problem?

# Answer
> 0 votes
This was a bug that will be fixed with 6.2.4 - see Github #1759

# Answer
> 0 votes
I would start by checking that the files got updated properly. Looking at the codebase for 6.2.1, the referenced lines do not contain `set_cookie` function mentioned: https://github.com/ExpressionEngine/ExpressionEngine/blob/5b36e9d84ba183ef863747dbb7df16b56644a83e/system/ee/ExpressionEngine/Addons/comment/mod.comment.php#L1738

---
Tags: comments, cookies
---


# Question
Title: How to escape special HTML characters in output?
It is commonly useful to escape encode special HTML characters in output to avoid breaking output attributes (among other reasons):

Take the following seemingly innocent template snippet:

```
<!DOCTYPE html>
<html>
{exp:channel:entries channel="blog"}
<head>
    <title>{title}</title>

    <meta name="description" content="{meta_description}"/>

```

This will not perform as one might expect when `meta_description` contains special characters like double quotes or ampersands.

For example, bad output:

```
<!DOCTYPE html>
<html>

<head>
    <title>Some Blog Title</title>

    <meta name="description" content="Learn how to program with "Best practices & methods""/>

```

How can this be resolved?

# Answer
ExpressionEngine does not appear to provide a way to deal with this scenario out-of-the-box.

One solution would be to create a custom plugin like the following. I have intentionally named this "Utility Functions" because I plan to add additional functionality as needed. But hopefully this will save some time for future readers.

```
<?php
$plugin_info       = array(
    'pi_name'        => 'Utility Functions',
    'pi_version'     => '1.0.0',
    'pi_author'      => 'Lea Hayes',
    'pi_author_url'  => 'http://leahayes.co.uk',
    'pi_description' => 'A selection of utility functions for use in templates.',
    'pi_usage'       => util::usage()
);

class util {

    public function htmlspecialchars() {
        $this->EE = &get_instance();
        return htmlspecialchars($this->EE->TMPL->tagdata);
    }

    public static function usage() {
        return '{exp:util:htmlspecialchars}Place unescaped content here...{/exp:util:htmlspecialchars}';
    }

}
/* End of file pi.util.php */
/* Location: ./system/third_party/util/pi.util.php */

```

The original template can then be written as:

```
<!DOCTYPE html>
<html>
{exp:channel:entries channel="blog"}
<head>
    <title>{title}</title>

    <meta name="description" content="{exp:util:htmlspecialchars}{meta_description}{/exp:util:htmlspecialchars}"/>

```

Meaning that the output is:

```
<!DOCTYPE html>
<html>

<head>
    <title>Some Blog Title</title>

    <meta name="description" content="Learn how to program with "Best practices & methods""/>

```

It is likely that there are already other add-ons that deal with this, but at least with this approach you can add your own functions as needed.
> 7 votes

# Answer
You can use Ce\_string for this, which is the ultimate swiss army knife.

```
{exp:ce_str:ing htmlspecialchars=":CONST:ENT_QUOTES"}<a href='test'>Test</a>{/exp:ce_str:ing}

```
> 8 votes

# Answer
aren't we overkillingt this somewhat??

How about setting PHP on Output and dropping this into the template :

```
<?php echo addslashes("{meta_description}"); ?>

```

Simple, no need for extra plugins (and extra work for CI or EE), just PHP on templates. Plus `addslashes` does exactly what the OP's asking for, no silly `str_replace` with massive arrays of escape characters ect...

Just my 2 pennith!
> 1 votes

# Answer
This did the trick for me (plugin doesn't work with later versions of EE).

{exp:markdown} Text to be **parsed**. (for me the channel field tag {data\_feedback\_text}) {/exp:markdown}

Without the markdown tag some php code I had was dying due to quotes within the string.
> 1 votes

# Answer
If anyone is still wondering, now you can use native variable modifiers. `{meta_description:attr_safe}`

https://docs.expressionengine.com/latest/templates/variable-modifiers.html#variable-modifiers
> 1 votes

# Answer
I know it may be way too late to answer your question, but in case any body else sees this thread, you can use PHP String Fun. This plugin allows you to use practically any PHP string functions. I used the *str\_replace* function with the parameter *reverse="y"*. You can do, for example, something like this:

```
{exp:phpstringfun reverse="y" function="str_replace" par1='\"' par2='"'}
    {text_to_replace}
{/exp:phpstringfun}

```

**Edit** : you can use PHP String Fun of course, or Ce\_string or even roll your own... or you could just add some PHP snippet to the template and do it yourself (set the PHP on output). in this case though the most sensible PHP function for the specific challange in the OP is addslashes
> 0 votes

# Answer
There's a first party add-on for that.

```
<meta name="description"
  content="{exp:html_attribute_content limit="200" end_char="…"}{meta_description}{/exp:html_attribute_content}"
/>

```

There's a list of useful add-ons to download right from EECMS user guide.
> -1 votes

---
Tags: add-on, templates, channel-entries, add-on-development, tags
---


# Question
Title: IF conditional not working with Relationship fields in Fluids
When using a **Relationship** field with a **Fluid** field type the **current\_field\_name** variable can be printed out for debugging just fine, but **IF conditionals don't work** when using current\_field\_name.

```
{exp:channel:entries channel="testfluid" dynamic="no" show_future_entries="yes" limit="1"}
    {testfluid}
    debug print out {testfluid:current_field_name}
    {if testfluid:current_field_name=="my_relationship_field_name_as_printed_out_fine_one_line_before"}
        #anything here never gets processed
        {content}
            {content:title}
        {/content}
    {/if}
    {/testfluid}
{/exp:channel:entries}

```

Also tried wrapping testfluid:current\_field\_name in braces, no change.

Just to be clear: if I remove the IF condition the relationship field is processed just fine, it's just the IF conditional not working. That wouldn't be an issue if one was only using a Fluid with one field, but obviously causes trouble with multiple different field types within a fluid.

Using latest EE version (6.2.4).

# Answer
> 0 votes
You could try

```
 {if '{testfluid:current_field_name}' == '{my_relationship_field_name_as_printed_out_fine_one_line_before}'}

```

---
Tags: relationships, conditionals, fluid-field
---


title: Is EE6 a good fit for our use case?

text:
# Question
Title: Is EE6 a good fit for our use case?
My company is looking at EE 6 as the basis for our SAS application.

In our business model, each company will have a backend to upload product information to, and customize forms and pages for their company. We will have multiple companies each with it's own admin account on the backend.

On the front-end, users will search across all products, with the ability to apply filters based on product criteria. We will be using Freeform Pro to handle forms.

Is this a good fit for the current version of EE?

# Answer
How many companies and/or member logins would you expect?

Generally, these requirements would pose no problems to EE6. Would EE be acting as the SAS, or more of a member login vehicle to feed data to another system?
> 1 votes

# Answer
As Creative Arc suggested EE could be a good fit.

The only part that might need some thinking is "each company...\[can\] customise forms". EE has addons to manage custom email form creation but generally anyone with access can create forms and see other peoples forms. You might be able to work around that by providing premade form fields that the member can set up using a regular channel entry, or a custom module.
> 0 votes

# Answer
Yes, this will not be a problem with EE using the multisite features, each company can have its own settings, but you are sharing some data with all of them like search and other features as it is using the same database. From a users' perspective, the front end, each one will be its own unique brand and company:

**Multiple Site Manager:**

https://docs.expressionengine.com/latest/msm/overview.html
> 0 votes

---
Tags: ee6
---