# Question
Title: Problem creating templates / template group in the CP
Running EE 6.2.4

I recently upgrade from EE5 to EE6 locally, in the process of creating a new template/template group in the CP (by clicking on the Templates link in the sidebar), i suddenly got the following error:

```
SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF0\x9F\x8C\xAC R...' for column 'template_data' at row 1:
UPDATE `exp_templates` SET `template_data` =

```

**Stack Trace**

```
#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query('UPDATE `exp_tem...')
#1 ee/legacy/database/DB_driver.php(260): CI_DB_mysqli_driver->_execute('UPDATE `exp_tem...')
#2 ee/legacy/database/DB_driver.php(175): CI_DB_driver->simple_query('UPDATE `exp_tem...')
#3 ee/legacy/database/DB_active_rec.php(1388): CI_DB_driver->query('UPDATE `exp_tem...')
#4 ee/ExpressionEngine/Service/Model/Query/Update.php(116): CI_DB_active_record->update('templates')
#5 ee/ExpressionEngine/Service/Model/Query/Update.php(93): ExpressionEngine\Service\Model\Query\Update->actOnGateway(Object(ExpressionEngine\Service\Model\SyntheticGateway), Object(ExpressionEngine\Model\Template\Template))
#6 ee/ExpressionEngine/Service/Model/Query/Update.php(46): ExpressionEngine\Service\Model\Query\Update->doWork(Object(ExpressionEngine\Model\Template\Template))
#7 ee/ExpressionEngine/Service/Model/DataStore.php(275): ExpressionEngine\Service\Model\Query\Update->run()
#8 ee/ExpressionEngine/Service/Model/DataStore.php(240): ExpressionEngine\Service\Model\DataStore->runQuery('Update', Object(ExpressionEngine\Service\Model\Query\Builder))
#9 ee/ExpressionEngine/Service/Model/Query/Builder.php(71): ExpressionEngine\Service\Model\DataStore->updateQuery(Object(ExpressionEngine\Service\Model\Query\Builder))
#10 ee/ExpressionEngine/Service/Model/Model.php(358): ExpressionEngine\Service\Model\Query\Builder->update()
#11 ee/ExpressionEngine/Service/Model/FileSyncedModel.php(109): ExpressionEngine\Service\Model\Model->save()
#12 [internal function]: ExpressionEngine\Service\Model\FileSyncedModel->onAfterLoad()
#13 ee/ExpressionEngine/Service/Model/Model.php(826): call_user_func_array(Array, Array)
#14 ee/ExpressionEngine/Service/Model/Query/Result.php(70): ExpressionEngine\Service\Model\Model->emit('afterLoad')
#15 ee/ExpressionEngine/Service/Model/Query/Builder.php(63): ExpressionEngine\Service\Model\Query\Result->all()
#16 ee/ExpressionEngine/Controller/Design/AbstractDesign.php(437): ExpressionEngine\Service\Model\Query\Builder->all()
#17 ee/ExpressionEngine/Controller/Design/Design.php(93): ExpressionEngine\Controller\Design\AbstractDesign->buildTableFromTemplateQueryBuilder(Object(ExpressionEngine\Service\Model\Query\Builder))
#18 ee/ExpressionEngine/Controller/Design/Design.php(27): ExpressionEngine\Controller\Design\Design->manager()
#19 [internal function]: ExpressionEngine\Controller\Design\Design->index()
#20 ee/ExpressionEngine/Core/Core.php(257): call_user_func_array(Array, Array)
#21 ee/ExpressionEngine/Core/Core.php(113): ExpressionEngine\Core\Core->runController(Array)
#22 ee/ExpressionEngine/Boot/boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#23 public/admin.php(147): require_once('...')
#23 public/admin.php(147): require_once('...')

```

# Answer
Is this on the same server? Or a new one? Shooting from the hip (without the full picture). We usually see something along these signs when there's emojis in a template, and the DB doesn't have the proper CHARACTER SET to support it.
> 1 votes

---
Tags: templates
---


title: Bootstrap won't work on template

text:
# Question
Title: Bootstrap won't work on template
I'm new to EE and I have an issue linking to bootstraps folder. The default\_site template (home page) stylesheet link to assets folder works fine, but when I make a new template\_group and then a new template the links won't work. Any idea why the default\_site template links work, but new template links won't? Here are the links to the bootstrap folder:

```
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic">
<link rel="stylesheet" href="/assets/fonts/font-awesome.min.css">

```

# Answer
It's because you're using a relative path for `<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">` instead of an absolute.

Your default template works because your index file is on the same directory level as your `assets` folder.

Example:
https://mysite.com/index.php
https://mysite.com/assets/...

However, when you don't use a leading slash in your URL, the path is relative to where you are in the directory structure.

Example:
A link to the file `assets/mystyles.css` from the URL https://mysite.com/subpage would be the same as saying https://mysite.com/subpage/assets/mystlyes.css

Using an absolute path, tells the server you want to go back to the top of the tree to access this path. Thus you would want to use `/assets/mystyles.css`

Example:
A link to the file `/assets/mystyles.css` from the URL https://mysite.com/subpage would be the same as saying https://mysite.com/assets/mystlyes.css

When you use the `{site_url}` variable, an absolute URL is created. Using `{site_url}assets/mystyles.css` would render in the browser as `https://mysite.com/assets/mystyles.css`

Hope that helps.
> 1 votes

# Answer
I found the solution, by adding `{site_url}` it worked, but I don't need it for the default\_template. Maybe someone knows why?

```
href="{site_url}assets/bootstrap/css/bootstrap.min.css"

```
> 0 votes

---
Tags: css, bootstrap, stylesheets
---


# Question
Title: Front end not logged in when I am logged in at the back end EE6.2.5
When I am logged in as super admin the front end is not recognising this, and so I am unable to post comments, use the search engine, among other things. Is it likely that there is something wrong in my backend settings, or is this a bug?

# Answer
Check in your EE security & privacy settings to see if the CP session and website session settings are the same: for the two to operate from the same login you'll need the settings of both to be set to "cookie only".

HTH
> 0 votes

---
Tags: control-panel, comments, simple-search, settings
---


title: Redirect a URL and remove a segment

text:
# Question
Title: Redirect a URL and remove a segment
I recently redid an ExpressionEngine site that was not using template routes for a blog, so the blog URLs were like this: http://mywebsite/blog/detail/url-title-here

After the redesign, I created a template route and removed the 'detail' segment changing the URLs like this: http://mywebsite/blog/url-title-here

Both URLs are now accessible though, so I want to redirect all of the old URLs to the new ones without 'detail' in the URL.

How can I achieve this? Thanks.

# Answer
> 2 votes
I actually just figured it out with an htaccess RewriteRule.

RewriteRule ^blog/detail(.\*)$ /blog$1 \[NC,R=301,L\]

---
Tags: redirects, template-routes
---


# Question
Title: EE Channel Form, file upload - access to directory for specified field error
Ok, this one has me stumped.

Running EE 5.3.2

I'm using the Guests membergroup to post entries via front-end {exp:channel:form ...} syntax.

So one of the form fields is a file upload field, and it triggers this error message when a "guest" without an EE session/account tried to upload a file. But without using the file-upload, the form and all functions it needs to do works fine. It's only the file-upload field that causes this issue.

> **image\_upload**: You do not have access to the directory specified for this field.

Here's what i can confirm.

1. server side
    * all permissions and paths are correct
2. Upload Prefs
    * Guests doesnt show up in "Allowed Member groups" and i cant get it to show up either.
3. Member Group ( Guests )
    * membergroup does not have cpanel access
    * tried giving cpanel access + create entries + access file manager + new files - didn't work, and still did not show up in the list "Allowed member groups" for upload preferences.
4. Channel Settings
    * Default authors set to member of "Guests" membergroup.
    * Allow guests submissions? setting checked ON/Yes
5. Channel Field
    * Type: File
    * Allowed FileTypes: All
    * Allowed Directory: let's call it X which throws the error above

The code ( abstracted out for clarity ) that's used in the front-end form is:

```
{exp:channel:form
    channel="channel_x"
    return="/channel_x/confirm/ENTRY_ID"
    include_jquery="no"
    include_assets="no"
    unique_url_title="yes"
    logged_out_member_id="153"
}
<div class="form-block">
    <label for="image_upload">Upload Image or PDF</label>
    {!--field:image_upload--}
    <input type="hidden" name="image_upload_directory" value="75" />
    <input type="file" name="image_upload" value="" data-content-type="all" data-directory="75"  />
    <p class="monospace-gray-xsmall">One file upload per event</p>
</div>

{/exp:channel:form}

```

So at this point im completely at a loss.

Any help would be much appreciated. Thanks in advance!

# Answer
AFAIK for a guest to upload a file you need to set a logged\_out\_member\_id=.

More generally allowing guests to upload stuff to your server is possibly a recipe for much spam / dodgy file transactions... I hope you have lots of storage ... :)

HTH
> 0 votes

---
Tags: safecracker, file-uploads, error, ee5
---


title: Generate CSRF Token Asynchronously

text:
# Question
Title: Generate CSRF Token Asynchronously
EE 5.4.0

I'm developing an admin dashboard using ReactJS. I have a class that I'm using as an API to handle actions sent from the frontend. Part of this frontend is a member section that has a logout button.

The logout buttons are using a `csrf_token` as an href in a link that looks like this:

`href="https://www.domain.com/?ACT=15&csrf_token={token}"`

I'm trying to get/generate that csrf\_token value in my class and then return it to the frontend so I can have a working logout link in my component.

I can't use the normal EE logout tags because they won't be recognized in React components.

I've also tried using `EE.CSRF_TOKEN`, as suggested here, but I'm getting a notice that says `Use of undefined constant EE - assumed 'EE'`. It does return a value that resembles a csrf token, but when I test that using the ACT structure in the url, I get an error.

Is there a built in way to do this that I'm just missing?

# Answer
> 1 votes
You can write a currently valid CRSF token to any location you like in your template output using the Single Global Variable {csrf\_token} \- so one solution to your issue is to write this value into a data-\* parameter linked to a hidden or otherwise unused div and read the value from there into your React app.

HTH

---
Tags: logout, csrf
---


# Question
Title: How to add tags to mailchimp with freeform_next
i have a few newsletter signup forms (mailchimp) on this site. We need to differentiate the subscribers to different forms in mailchimp. We do that via tags. How can i add the tags to the newsletter subscribe form? I currently have a hidden field called "tags" with the id of the tag but that doesn't seem to get sent to mailchimp

# Answer
> 0 votes
Jelle - do you have fields created in Mailchimp to hold the "tags" data?

I've done similar things with Mailchimp, here's what I did:

1. Create a new free text input field in Mailchimp to hold the tags data
2. Add the field to your form code in Mailchimp's form editor and save
3. Copy form code, add to your site, and tweak so the tags field is hidden and you write tags data to it using EE code

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


title: Conditional in Head to detect channel

text:
# Question
Title: Conditional in Head to detect channel
I have an issue with detecting the channel of an entry so I can apply schema for different types of entries based on the channel:

```
<head>
{exp:channel:entries limit="1"}
  {if channel == "blog_post"}
  my schema here...
  {if:elseif channel == "recipe"}
  my schema here...
  {/if}
{/exp:channel:entries}
</head>

```

When I put out the channel in the comments I'll see another channel and not the blog post or recipe channel that it's been posted on in the admin. I used `{segment_1}` with success since the URL structure is `/recipe/{url_title}` and `/blog/{url_title}` but I'm SOL if I create a custom URL. Why wouldn't `{channel}` be accurate and is there a better way to do this?

# Answer
> 2 votes
Figured it out. I needed to specify the channels at the top of the loop.

```
<head>
{exp:channel:entries limit="1" channel="recipe|blog_post" }
  {if channel_short_name == "blog_post"}
  my schema here...
  {if:elseif channel_short_name == "recipe"}
  my schema here...
  {/if}
{/exp:channel:entries}
</head>

```

I would expect `exp:channel:entries` to get the accurate info and I would not need to specify a scope of channels to search so I can use the specific fields for each channel. I'll have to remember to add the channel to the parameter list if I want to add more schema per channel content.

---
Tags: channel-entries, ee6
---


# Question
Title: String replace/filter within Channel Entries loop
I need to escape some text within a channel entries loop so it doesn't break the JSON schema I created for each page:

```
{exp:channel:entries limit="1" channel="posts" }
  {title} //replace " quotes with \"
{/exp:channel:entries}

```

Liquid and Twig make this easy but I don't see anything readily available in the EE docs.

# Answer
> 1 votes
Any chance one of the following variable modifiers would do the trick for you?

:json https://docs.expressionengine.com/latest/templates/variable-modifiers.html#json

:replace https://docs.expressionengine.com/latest/templates/variable-modifiers.html#replace

---
Tags: channel-entries, ee6
---


# Question
Title: Unable to send emails, handshake times out
EE 6.2.7

I'm trying to connect to office365 exchange server using SMTP via STARTTLS.

When `stream_socket_enable_crypto()` attempts to establish a secure connection, it says `SSL: Handshake timed out`.

I ran this in the cPanel terminal: `openssl s_client -connect smtp.office365.com:587`

And got this result:

Any ideas why it fails to connect?

I should add that this problem sprang up without any changes made to email settings or any version updates (I've updated versions since the problem started in the hopes that the update would help, but the same problem persists). It happens with contact forms, password reset requests, checkout notifications, etc.

# Answer
> 0 votes
I ended up resolving this by identifying where it was failing in the core Email class, and why. I ended up hard coding the newline variable to "\n\r", and updating the `stream_socket_enable_crypto()` method from `STREAM_CRYPTO_METHOD_TLS_CLIENT` type to `STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT`. I really don't like digging into the core files and changing things, but I didn't really have any other option, as emails needed to be working on the website.

I wonder if this is something that's been occurring with anyone else, or if it's just me.

---
Tags: email, ssl, smtp
---


# Question
Title: IP logging in ExpressionEngine always shows 127.0.0.1
It seems that both the access logs, search logs and comments in ExpressionEngine always display with a local IP address of 127.0.0.1. How can I have EE show the actual IP address a user, search or comment is coming from, instead of 127.0.0.1?

# Answer
> 2 votes
This can be caused by a proxy. To have the logs track the correct IP address you'll need to set the IP of the proxy server(s) in your config file. Please note, this will tell ExpressionEngine to look in additional locations in PHP for the correct IP address.

To do this, simply add the following.

> $config\[‘proxy\_ips’\] = ‘127.0.0.1’;

https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#proxy\_ips

---
Tags: ip, developer-log
---


title: exp_cookie_settings error on update

text:
# Question
Title: exp_cookie_settings error on update
I'm updating manually from EE 3.5.10 to EE 6. When I try to load admin.php in my browser to start the update I get the following error:

SQLSTATE\[42S02\]: Base table or view not found: 1146 Table 'db196778\_nape.exp\_cookie\_settings' doesn't exist: SELECT CookieSetting\_cookie\_settings.cookie\_id as CookieSetting\__cookie\_id, CookieSetting\_cookie\_settings.cookie\_provider as CookieSetting\__cookie\_provider, CookieSetting\_cookie\_settings.cookie\_name as CookieSetting\__cookie\_name FROM (`exp_cookie_settings` as CookieSetting\_cookie\_settings) WHERE ( `CookieSetting_cookie_settings`.`cookie_provider` IN ('ee', 'cp') ) LIMIT 18446744073709551615

exp\_cookie\_settings does not exist in the database to begin with under EE 3.5.10 so I'm not sure why the updater is looking for that table.

Any ideas how I can get this update working? Thanks.

# Answer
Figured it out. For some reason, my ee folder was missing the installer folder. Once I replaced it, the installer worked.
> 2 votes

# Answer
Do you have a .env.php file? If so, make sure that you have the install mode set to true: `putenv('EE_INSTALL_MODE=TRUE');`
> 1 votes

---
Tags: update
---


# Question
Title: How do i get the value of a query string
I'm trying to get the value of a query string in the URL. I stumbled onto `{current_query_string}` which displays the whole query string. But i'm looking to get everything after the `=`.

```
{resource_tags backspace="5"}
   <a href="/segment_name_here?tag_id={tag_id}">{tag}</a>
{/resource_tags}

```

Basically i just want to get the `{tag_id}` part from the url so i can display a list of entries based on the `{tag_id}`.

So if the url is `/segment_name_here?tag_id=44` i just want the number `44`

# Answer
If your currently running on ExpressionEngine 6 you should be able to use the Request add-on (shipped as part of the core) to grab the GET variable. Should be something along the following lines.

> {exp:request:get name="tag\_id"}

https://docs.expressionengine.com/latest/add-ons/request.html#request

Without seeing the template, there may also be a way to pass the tag id as a segment.
> 1 votes

---
Tags: tags, querystring
---


# Question
Title: making categories selectable in page edit view
I'd like to develop a selection option for categories when a user edits a page. This is required as I'm building a white label website - meaning each client should be able to create their own pages from a long list of predefined topics (represented by categories) and apply those to filter a list of products showing on each page. Applying categories to each product is simple, what I'm stuck with is how do I expose a list of categories to select from on the page edit view, so filtering a list view on each page becomes just as easy.

What I've tried so far and didn't work (I've seen that only "orderby" can hold a variable, but it was worth a shot, here "category\_to\_show" is a variable that can be edited in page view):

```
{exp:channel:entries channel="review" limit="12" ... category_group="2" show="category_to_show"}

```

This only works if I enter the numbers (or names) of the categories in the html that I would like to show eg. show="3|12", but since each page's content needs to be dynamic, I can't set a number without knowing what the page's content will be about.

The other idea I came up with is to make the category dynamic and set the value with a variable in an ajax form and submit it on page load. This probably will cause performance problems...

How should I solve this in a non-hacky way? Since it's a white label website, I don't want to use plugins or addons so it won't cause licensing headaches in the future.

# Answer
So, I came up with the solution, it's bare bone, but it works:

```
<div id="csrf" hidden>{csrf_token}</div>

{exp:channel:entries channel="main"}
<div id="the_url" hidden>/lists/category/{game_type_filter}</div>
{/exp:channel:entries}

<script>
function submitForm() {
    var http = new XMLHttpRequest();
    http.open("POST", document.getElementById('the_url').innerHTML, true);
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    var token = document.getElementById('csrf').innerHTML;
    http.setRequestHeader('x-csrf-token', token);
    var params = `csrf_token=` + token;
    http.send(params);
    http.onreadystatechange = function() {
        if (http.readyState == 4) {
            document.querySelector('#list-wrapper').innerHTML = http.responseText;
        }
    }
} submitForm();
</script>

```

A little explanation: xhr is the way to go, I've put the actual list in a separate template so it wont interfere with the pages addon.

Csrf token is required for the request (actually I haven't tried without it as i've started with a normal form submit and stripped it back)

{game\_type\_filter} variable is editable on the page's entry view (I will probably make it a dropdown or something later)

"the\_url" variable represents the other template which can be filtered with its url to get the right set of results, post with xhr, fill the response into the div where the list should be and thats it.
> 1 votes

---
Tags: categories, dynamic
---


title: RTE Field Text Direction

text:
# Question
Title: RTE Field Text Direction
i recently updated my system from 5 to 6 , but i found that the text direction option in RTE field is removed in EE6 , what can i do to change the RTE field writing direction ?

# Answer
Thanks for getting in touch about this.

We're planning to add much broader RTL support to ExpressoinEngine in the near future. It might be worth checking out this PR in github.

https://packettide.atlassian.net/browse/EECORE-1810

On the RTE its self, we also have a ticket internally to look at RTL support as part of this larger RTL scope.

Thanks,

-Tom Jaeger
> 0 votes

---
Tags: rte
---


# Question
Title: Possible to 'build' a field tag with a var?
is there a way - possibly with php - to 'build' a field tag from a 'variable'?

i currently have this:

```
{exp:stash:get_list name="rf_columns" prefix="rf"}{!--
    --}{if rf:col_value == 'f_admin_notes'}{f_admin_notes}{/if}{!--
    --}{if rf:col_value == 'f_hname1'}{f_hname1}{/if}{!--
    --}{if rf:col_value == 'f_fname1'}{f_fname1}{/if}{!--
    --}{if rf:col_value == 'f_mname1'}{f_mname1}{/if}{!--
    --}{if rf:col_value == 'f_lname1'}{f_lname1}{/if}{!--
    --}{if rf:col_value == 'f_notes'}{f_notes}{/if}{!--
    --}{if rf:col_value == 'f_organisation'}{f_organisation}{/if}{!--
    --}{if rf:col_value == 'entry_id'}{entry_id}{/if}{!--
    --}{if rf:col_value == 'count'}{count}{/if}{!--
    --}...
{/exp:stash:get_list}

```

obviously this is quite cumbersome, I'm hoping to have something like:

```
{<?php echo 'rf:col_value'; ?>}

```

i've tried this, but i don't think im doing it right

just to explain, i have a grid field where the user can select the data they would like displayed, i then use that to output the data of the corresponding field

my channel ("reports") grid has a dropdown to select a field name as a value and not the field related, so it's value is just the text "f\_field\_name", i'm then using that value inside the entries tag for "contacts" to output the actual field value:

```
{if rf:col_value == 'f_field_name'}{f_field_name}{/if}

```

instead i'm hoping to be able to 'build' the field tag, e.g. `{{rf:col_value}}` (output the value "f\_field\_name" then parse the outer curly braces to output the actual value of "{f\_field\_name}")

# Answer
I ran a quick test with a dropdown field, where the value of the drop down was {body} (a field in another channel I have). I believe the following should work to do what your looking for.

```
{exp:channel:entries channel="test" dynamic="no" limit="1"}
    <h1>{title}</h1>
    <hr>
    {embed="test/body_field_test" get_field='{field}'}
{/exp:channel:entries}

```

And then for the embed.

```
{exp:channel:entries channel="blog" dynamic="no" limit="1"}
    {!-- This renders the selected field from a dropdown in the entry... in my test the body field --}
    {embed:get_field}
{/exp:channel:entries}

```
> 1 votes

# Answer
There is a way to do this that would appear to be quite a bit less complicated, and possibly helpfully, does not require the use of either stash, inline php or embeds...

What you need to do is exploit one of the many semi-hidden advantages of EE's Layout Variables system.

EE's template layout system lets you break down the construction of an output template into a series of steps - with each subsequent template in the sequence being able to access the content generated in the previous steps. By using some of these component templates in more than one 'layout stack' you can build templates with common architecture but different detailed content (so for example you can use one stack to embed a form developed on one sub-template within a general background page layout, and in another stack embed a video box in the same space instead: then any changes to the background layout will reflected in the output produced by both template stacks). As part of this system on each sub template you can define content fragments and save them as variables, and then access them from templates later in the stack.

A quirk of the template layout system is that EE evaluates each sub-template before it passes processing on to the next in the sequence: what gets passed on is the 'output' of the sub-template, not the tags that make it up. For the next template, EE evaluates the content from scratch - simply reading the tags presented and evaluating them (in passing - this facility makes it possible to dispense with many embeds and many uses of Stash).

For your issue, all you need to do is construct your 'dynamic' field tag to a layout variable within one template in the stack and then add this layout variable to the template code in the appropriate place in a later sub-template in the stack. Possibly the only cleverness is to ensure that EE doesn't 'evaluate' the field when you build it - to ensure this requires using a url\_encode side-step to hide the curly brackets - the url encoded value for `{` is `%7B` and for `}` is `%7D`.

So how would it work... for the sake of the example let's assume you have a field `{chosen_option}` that you are using to determine which field you want to capture. In the earlier of the layout templates you would need code like this...

```
{layout:set name="computed_field"}%7B{chosen_option}%7D{/layout:set}

```

If your variable contained the text "title" this would save a layout variable with the content `%7Btitle%7D`.

Now on a later template we want to retrieve this value - this is quite simple but uses another neat EE feature (Variable Modifiers) to reverse our encoding dodge for the curly brackets... all you need to do is insert something like this within your template at the place where you want to retrieve the variable field content

```
{layout:computed_field:url_decode}

```

This translates into the sub-template (in our example case) as `{title}` and indeed if this is included within a Channel Entries loop (or whatever) it will expand to the value saved as the title for the entry...

Hope all that makes sense
> 1 votes

---
Tags: stash, custom-fields, grid
---


# Question
Title: Need help with error after upgrade to EE v6
Just upgraded EE from V2 to 6.3.2 and all fine except this error when trying to edit entries:

```
Parse error: syntax error, unexpected 'clone' (T_CLONE), expecting identifier (T_STRING) in xxxx/xxx/xxxx/ee/ExpressionEngine/Addons/pages/tab.pages.php on line 130

```

Anyone got any idea on cause or possible fix?

# Answer
So it looks like this is an error with some of the code in PHP 5.6 If possible to upgrade to PHP 7.x or higher, this should be resolved.

We'll also make a change to fix this in PHP 5.6 in the core.
> 1 votes

---
Tags: upgrade, ee2-upgrades, php-errors, ee6
---


title: Custom Fileds per Roles

text:
# Question
Title: Custom Fileds per Roles
I am building website for startup. At this moment I am researching if EE will be good choice for this. In this case I have 2 type of users. For example ServiceProviders and Buyers. I want for ServiceProviders to fill few more info when registering than Buyers. Is this possible to do in EE with Roles? Maybe with some Addon?

# Answer
> 1 votes
You can define easily the Role user in the control panel , members manager:

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

And after using the member Role tag manager: https://docs.expressionengine.com/latest/member/member-roles-tags.html

In the Member manager you will manage wich fields, templates associated for each role.

No add-on needed!

---
Tags: members, control-panel
---


# Question
Title: What is the best way to import entries for EE6?
We've previously used Datagrab to import entries from XML and CSV files into ExpressionEngine sites, however it doesn't look like it is supported for EE6. Is there an alternative add-on that can used to import content? We tried using Smart Import Export but found the documentation to be lacking.

# Answer
An update here for anyone coming across this question now : Datagrab is now available for EE6 (https://expressionengine.com/add-ons/datagrab)
> 2 votes

---
Tags: datagrab, ee6
---


# Question
Title: One Page Checkout via AJAX with Cartthrob (Stripe)
I am trying to create a one page checkout for donations on a site using Cartthrob Pro 6.3.0 and EE 6.2.7, where the donation is added to the cart and the user can checkout all on the same page without refreshing using the jQuery Form Plugin (which is what is used in the Cartthrob ajax examples).

I am able to submit the add\_to\_cart\_form and have it add the donation product to the cart correctly, but when the checkout form is submitted right after that, it does not go through correctly. It creates a closed entry in the 'Orders' channel and when I check Stripe, the payment does not go through. This is the error I get in the Stripe log:

> payment\_intent\_unexpected\_state You cannot confirm this PaymentIntent because it's missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method.

So it seems like something is not being sent to Stripe when submitting the checkout form via AJAX but I'm not sure how to go about finding the issue. If anyone can point me in the right direction, I'd appreciate it!

(Also just a note that the add to cart and checkout system works correctly when not submitting via AJAX and just using a regular cart process to submit each form individually and moving to the next page.)

# Answer
An update for anyone who happens upon this question:

We contacted the Cartthrob team about this issue, and from their response, it is not currently possible to do this the way we expected: "Due to how the cart and checkout template tag function, what you're attempting isn't doable without a pulling and executing the checkout template form with Ajax."
> 1 votes

---
Tags: cartthrob, stripe, ee6
---


title: CartThrob 'cart_items_info' in PHP

text:
# Question
Title: CartThrob 'cart_items_info' in PHP
EE: 6.3.4

CartThrob: 6.3.0

I would like to get a user's current cart (the data that comes from the `cart_items_info` tag) using PHP.

I've been looking through the documentation and the database structure to find a way to do this, but I haven't had much luck.

Is there a PHP method or hook similar to the `cart_items_info` tag that I could use to get a users current cart items?

# Answer
> 1 votes
Take a look at:

```
ee()->cartthrob->cart->items()

```

It's an array of the user's cart.

Also, if you're curious about how any of the template tags work, they're stored at `src/Tags`

---
Tags: cartthrob
---


title: Expresso Store get cart items in PHP

text:
# Question
Title: Expresso Store get cart items in PHP
EE: 6.3.4

I am aware that Expresso Store is discontinued. I would like to be able to get the contents of the user's current cart in PHP. The answer here does not work (`ee()->store_cart->contents()`).

I asked the same question for a different cart addon here. If there is a similar solution, I would really appreciate being pointed in the right direction.

Thanks so much!

# Answer
> 1 votes
I believe you could use `ee()->store->orders->get_cart()->toTagArray()`

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


# Question
Title: Update expression engine channel entry content
I'm new to expression engine so my question might not sound right to most people.

I'm trying to update the content for a channel entry but not sure whether it's possible or not.

I checked the channel fields API but through this API I can only update the structure of the field what I'm trying to achieve is update the data available in it.

For example for a channel called Blog, I've added a custom field 'reference'. This custom field contains a URL. I need to update this URL based on an external API but not sure how.

I'd be grateful for any help.

Thanks

# Answer
The easiest way to update a channel entry is to edit it via the ExpressionEngine administration screens. If you log into the administration area (usually via a link similar to `https://domain.com/admin.php` but the exact form might change on systems if the developers have done things to make it more obscure). Once you have logged in you should see options for editing the content of the CMS (what this looks like varies according to which version of EE you are using). The documenter link description hereentation for which ever version of EE you are using should give good guidance on how to edit content - but in your case simply find the entries for channel blog, open the blog entry you are wanting to change, and then paste in the URL to the field you added. Hope this helps.
> 0 votes

---
Tags: channel-entries, add-on, php, channel-images, api
---


# Question
Title: Update Grid Fields data Programmatically
I have a channel entry with the "images" field.

The field type is Grid.

What I'm trying to do is add a few pictures in the field through PHP.

I'm using this query to fetch the entry:

```
$entry = ee( "Model" )->get( "ChannelEntry" )
->filter( "channel_id", 6 )
->filter( "entry_id", 394 )
->filter( "status", "IN", array( "open" ) )->first()

```

The issue is, that I can access simple fields but the grid is always empty.

I'm not sure how can I access the images in the field or add new images in the field.

Is there any better documentation on model relationships? or a way to achieve this functionality?

Any kind of help will be much appreciated.

# Answer
> 0 votes
Few notes / comments on this one.

Firstly, this is an area we need to get better docs around as a whole..

The following thread has a working example in it that may be of use for you.

https://expressionengine.com/forums/topic/253398

When saving images specifically, I would just confirm their saved correctly in the DB (ex. try saving the same image in the CP and then programmatically to make sure whats saved in the DB correctly.)

---
Tags: channel, add-on-development, custom-fields, grid, image
---


# Question
Title: Discussion forum with collapsed forums at start
We use the discussion forum in EE 6.3.4. On Forum Home all forums are open at startup, i.e. not collapsed. You can close the forums yourself with the - sign on the right. The state of the different forums is stored in cookies.

Is there a way to set all forums to be collapsed at startup? I can't find any configuration option.

# Answer
Unfortunately I don't believe this is supported out of the box. That being said I'm sure you could manually do it if need be.
> 0 votes

---
Tags: forum
---


title: Member Relationship

text:
# Question
Title: Member Relationship
I have been trying to figure this out and I can't seem to figure out an approach. This seems like something that should be a part of ExpressionEngine? I really don't want to have to use an add-on for this.

All I want to do is have a channel related to members. So if a member creates a "Guild" I can say "Give me all guild's for this member". Also, if I create a "Character" that belongs to a member and a guild... I would like to be able to say "Give me all characters for my member".

Any help would be greatly appreciated. The last time I worked with EE was EE2 lol. This is on EE 6.

# Answer
If the entries are all authored by the member, you can use the author\_id param, along the following lines, in your channel entries l

author\_id="CURRENT\_USER"

https://docs.expressionengine.com/latest/channels/entries.html#author\_id
> 0 votes

---
Tags: members, relationships
---


# Question
Title: Conditionals within channel form custom_fields loop?
Trying to setup a public submission page/form using channel:form in ExpressionEngine 6.3.4, and the relevant channel has some fields that the user shouldn't be able to fill in/edit themselves, as I'll be putting those in the template as hidden fields instead.

In the past (mainly with EE 2.x) I've been able to do things like this to hide fields that I didn't output by the custom\_fields loop :

```
{custom_fields}
    {if "{field_name}" != "hiddenfieldname"}
    [CODE TO OUTPUT THE FIELDS GOES HERE]
    {/if}
{/custom_fields}

```

But when I try to do the same thing in EE 6.3.4, it doesn't work as intended - and the conditional tags themselves are showing up in the output, with an odd EE template comment ahead of each one (which doesn't exist in the template code), E.g.

{!-- ra:000000000aba49ff000000005af6a0c9 --}{if 'fieldname1' == 'hiddenfieldname'} Field Label: \[field\] {/if}

Any ideas how to get around that, or is that a technique that no longer works in newer versions of EE?

# Answer
try adding show\_fields="not hiddenfieldname" to your channel field tag. you can show and hide fields in the tag.
> 0 votes

---
Tags: safecracker, conditionals
---


# Question
Title: CP Session - keep alive or override timeout behavior?
I need a quick point in the right direction. This is for EE-5.3.X

I built out a SAML plugin to log in users using our IDP/SSO setup which works great, but i had a tiny oversight, the CP session timeout. The setup is set to use Cookies Only for both CP and Web.

I need to either keep the EE session/cookie alive forever ( preferably without overriding the sessions.php core file ) **OR** override that re-login overlay to force a user to be logged out via SLO redirect.

So how do I hook into the EE's CP session timeout overlay if that's the path i'm taking.

# Answer
I think you might want to use "remember me" functionality and override the config to set the session length to like a year: https://docs.expressionengine.com/latest/config/config-files.html#remember-me-expiration
> 0 votes

---
Tags: control-panel, sessions, ee5
---


title: filter page by multiple categories

text:
# Question
Title: filter page by multiple categories
I have a single channel with two different category groups. I want to filter the results by combining those groups. So I could say show me all pet types = dogs & pet colours = brown. I have the following code producing the two dropdowns but I'm trying to get a the page to reload with the filtered results.

  <input type="hidden" name="csrf_token" value="{csrf_token}" />

    <select name="category[]">
        <option value="">filter by convention</option>
        {exp:channel:categories channel="convention" category_group="3"}
        <option value="1">{category_name}</option>
        {/exp:channel:categories}
    </select>
    <select name="category[]">
        <option value="">filter by Area</option>
        {exp:channel:categories channel="{ch}" category_group="4"}
        <option value="1">{category_name}</option>
        {/exp:channel:categories}
    </select>

    <input type="submit" value="Go!">
</form>```

# Answer
> 0 votes
If you are on EE7 you could do this with Pro Search (and if on an earlier version with Low Search. The way to go about this is described here: https://gotolow.com/addons/low-search/docs/examples#categories-3

---
Tags: categories, filter
---


title: alphabetical categories list

text:
# Question
Title: alphabetical categories list
I am building out a navigation using the a category group from a channel. It works fine, but I can't get the categories to list out alphabetically. This is the code I have spitting it out

```
{exp:channel:categories channel='convention' category_group="3"  show_empty="no" style="linear" }
<li class="pf-c-nav__item"><a class="pf-c-nav__link {if active} pf-m-current{/if}" href="{path='convention'}">{category_name}</a></li>
{/exp:channel:categories}

```

# Answer
looks like the categories are ordered by their order in the backend. I moved them around and that seemed to fix it. Doesn't look there is a way to by default force them to order alphabetically though.
> 0 votes

---
Tags: categories, navigation, ee7
---


# Question
Title: Possible to match conditional from multiple values?
I'm trying to display relationship field "members" from selected "events" if their "field" value matches a certain "query":

```
{ev_members status="open|other"}
    {if get:f}
        {if ev_members:{get:f} *= '{get:q}'}
            {ev_members:entry_id}|
        {/if}
    {if:else}
        {ev_members:entry_id}|
    {/if}
{/ev_members}

```

I'm using URL querys so, `{get:f}` is the field searched on and `{get:q}` is the query

e.g.

`{if ev_members:organisation_name *= 'Oxford|Cambridge|Oxbridge'}`

I've tried pipes, commas, spaces, and encoded pipes, commas and spaces, but nothing works. this works fine if using a single value though.

I saw another thread with a very similar issue, but the solution was an addon for an earlier vers of expressionengine, so won't work here unfortunately.

thanks

# Answer
I was able to find a solution

I'm using stash, and I was getting this info via an ajax call.

My ajax data output template is in an embed from a 'filter' template, I use this to set some stash vars and filter ajax calls depending on URL.

The result is essentially a 'Report'

The report is also an entry, in which I have stored the "event" `entry_ids`, (`{embed:em_event_ids}`)

I set a var of all the "event" IDs I'd like to build a 'report' on

```
{exp:stash:set name="event_refs"}{!--
--}{exp:channel:entries
        channel="events"
        entry_id="{embed:em_event_ids}"
        other_params...
    }{f_event_ref}{if count != total_results}|{/if}{/exp:channel:entries}{/exp:stash:set}

```

I then use the `event_refs` var to filter the "members" of those "events" (in the same template file:)

```
{exp:channel:entries
channel="members"
search:f_event_refs="{exp:stash:event_refs}"
{if get:f}search:{get:f}="{get:q}"{/if}
other_params...
}{entry_id}{if count != total_results}|{/if}{/exp:channel:entries}

```

Doing it this way, the query with pipes (`{get:q}`), works as searching for multiple values

The data output is then what is used on the page making the ajax call
> 0 votes

---
Tags: conditionals
---


# Question
Title: Bug: Fresh install error, looking for fluid field type in user/addons but is a core addon? EEv 7.2.2
This is a fresh install, just downloaded a copy of EEv 7.2.2 (latest) and I get this error in the admin when trying to create channels or entries:

> Error: Unable to load requested field type file: ft.fluid.field.php. Confirm the field type is located in the system/user/addons directory

I've double checked the downloaded system/user/addons folder and there is nothing in this directory. I tried to copy the ft.fluid.field.php from system/ee/ExpressionEngine/Addons/fluid\_field to system/user/addons, but the error persists.

# Answer
> 0 votes
Interesting... you shouldn't be seeing this... My gut is to grab a fresh zip off of ExpressionEngine.com and then replace your /system/ee/ExpressoinEngine/ folder from the download....

---
Tags: error, addons, core, fluid-field
---


# Question
Title: commenting module creating strange error
Can anyone help with the following error from the commenting feature? When I want to look at the list of comments in the control panel this is what I get

# Answer
> 0 votes
Turns out it was an issue with our database. I deleted the comment entry in the database and that fixed the problem. I think it was an issue of deleting an entry and the comment wasn't also deleted. I'm really not sure exactly what it was though.

---
Tags: error, comments
---


title: Filtering by channel

text:
# Question
Title: Filtering by channel
I have a page where I am listing out all entries to all channels. I want to have a filter for filtering by channel. Anyone know how to do this with pro search (EE7)?

# Answer
> 0 votes
Not sure how to do this with pro search, but you can try setting up a filter using dynamic parameters.

1. Create a form where a user can select a channel or channels, send his selection to your template
2. Catch POST data using `dynamic_parameters="channel"` parameter.

# Answer
> 0 votes
To do this with Pro Search you can try out the following:

I have a template with

```
{exp:pro_search:form result_page="test/return_pro_result"}

<select name="channel" id="channel">
    {collections}
  <option value={collection_name}>{collection_name}</option>
  {/collections}
</select>
<input type="submit">

{/exp:pro_search:form}

```

and then my return\_pro\_result template looks like

```
{exp:pro_search:results query="{segment_3}" limit="10"}
    {if count ==  1}<ol>{/if}
      <li><a href="{comment_url_title_auto_path}">{title}</a></li>
    {if count == total_results}</ol>{/if}
    {if no_results}No search results{/if}
{/exp:pro_search:results}

```

---
Tags: search, filter, filtering
---


# Question
Title: Migrating Matrix and Wygwam to native grid and rich text in version 6
Is it at all possible to Migrate Matrix and Wygwam fields to native Grid and Rich Text fields in version 6?

# Answer
> 0 votes
You could create an XML template that outputs your wygwam and matrix field data and use Datagrab or Smart Import Export to import it to the new native fields.

# Answer
> 0 votes
Wygwam fields should be able to switch those without issues. Matrix stores it's data differently, so exporting / importing should be an option. In V2 there was a script (somewhere) that provided a migrration from matrix to grid.

# Answer
> 0 votes
here's the Playa & Matrix Importer script Jelle is talking about https://expressionengine.com/add-ons/playa-matrix-importer

---
Tags: matrix, wygwam, grid, richtext
---


title: EE6 gif upload removes animation?

text:
# Question
Title: EE6 gif upload removes animation?
Recently updated to EE6.4 and now all of a sudden any uploaded filename.gif (GIF) image is manipulated and the animations are removed.

Example being, uploaded a 404kb gif with animation which was converted to a 101kb gif without animation.

Sftp manual uploads do not cause this so I'm certain it isn't a server/host issue. Also I know this was not the case with EE5.

General settings are set to use GD2 and not GD, also this server is running php8.

I'm assuming that when EE is creating a thumbnail (which doesnt need animatio) it also somehow loses the original file being uploaded and just uploads a the temp non-aminated one.

Any ideas?

# Answer
This is a known/accepted bug with EE6.

So far there is no suggestion from Packet Tide about when the bug might be fixed, but if you read the Github comments you can see a working / workable solution described (but it requires you modify the code for an EE Image processing library).

Alternatively there is a work around - use an FTP type program to upload the gif to the appropriate Files directory within your EE setup, and then from within the EE CP "synchronise" the Files directory - this will update the EE database with details of your GIF image but won't cause the image to be overwritten by the upload process...

HTH
> 0 votes

---
Tags: file-uploads, files, ee6
---


title: How to create an entry using php

text:
# Question
Title: How to create an entry using php
I am trying to create an entry using an API call, please help me or you can suggest me an add-on. thank you.

# Answer
> 0 votes
To be able to better answer your question, it is helpful always to give some information about the environment you are working with - which version of EE, which version of php etc.

As for your question, to give you a better answer you would do well to clarify what you are trying to do:

* In general terms EE encourages developers to use Add-ons to hold code that executes php; there is good documentation on how to go about building and deploying add-ons in the EE documentation.
* It is possible to do some things using inline php similar to Wordpress, but to do this you need to enable php processing for your template (it is disabled by default) - more information on how to do this in the docs
* As for how to create an entry, there is a worked example in the docs

HTH

# Answer
> 0 votes
You probably need to give more detail about what you're looking to as, as was rightly pointed out...

But in general there are Modules to help with this.

If you're looking to integrate the site with an API you should look at DataGrab... it's great for this kind of thing.

DataGrab

# Answer
> 0 votes
Reinos Webservice might be helpful as well. It supports an Entry API with support for third party addons

---
Tags: entries
---


title: {!-- ra:000 … - error - how to handle?

text:
# Question
Title: {!-- ra:000 … - error - how to handle?
it happens to me repeatedly that suddenly the frontend is not displayed correctly (see screenshot attached). I see no trigger, it seems to happen without reason (just changing ordinary html-tags in a template). Even if I copy the template from the working live-system over to the broken dev-system, it is not working in the dev-system. Strange.  In another thread, it was suspected that incorrect PHP code could be the cause. But that is not the case for me, if I remove the entire PHP code from the template, the error remains. BUT: If I turn off php in the template settings, the page works again. Similarly, the page works if I remove a larger Switchee branch.

Does anyone have any idea of what can be done here? Could switchee be the culprit? It hasn't been updated in 5 years after all. Thank you in advance for any help!

**EDIT 26 Jan 2023**

Actually the problem just vanished. A day later the error completely was gone. I know how that sounds, but definitely the problem just vanished. I also deleted all EE-caches while coping with the error, so it wasn't a caching-problem. Have to mention that there was a similar problem some weeks ago. Suddenly the live system AND the dev-system showed such errors. I solved it for both systems by emptying a template, saving and pasting the same(!) code into it. Sounds strange - and IS strange, therefore I really would appreciate any help!

# Answer
As @tom-jaeger presumed the problem was the addon which threw a deprecation-notice. This lead to the error in the frontend, and it explains why the error suddenly appeared and vanished: The notice was thrown only once.

@mark-croxton helped out by updating the addon Switchee to PHP 8.1 compatibility (thanks!); you can find it on Github (croxton/Switchee).
> 1 votes

---
Tags: error, php-errors, switchee
---


# Question
Title: 500 Internal Server Error - Cannot access frontend or backend
Firstly, I was using the hosts file to point the server/hosting ip to a domain.

I went into Files, and tried creating an Upload Directory. All I did was give it a name and 'Saved'. An error appeared stating I had to select something from the 'Adapter' field. I selected 'Local', clicked saved and instantly received the 500 Internal Server Error page. I cannot view any part of the frontend or EE backend.

'..a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.'

Trying to access any file with a php extension gives the error.

An error that appears in cPanel 'Errors': 'client denied by server configuration: /home/username/public\_html/.user.ini'

Tried clearing .htaccess, no change. Am using EE 7.2.10

ANY HELP on how to get things back would be extremely appreciated!

# Answer
The quickest way to get back up and running might be to go through cPanel and PHPMyAdmin to open your database. And then navigate to the `exp_upload_prefs` table and delete the row for the Upload Directory that you just created.

However, this won't tell you what the problem was. I would also recommend making sure you have debugging enabled so that you might see a more helpful message. On a non-production site you can edit your `admin.php` and `index.php` files and change `$debug = 0;` to `$debug = 1;`

It's possible there were permission problems with the directory's location but getting a more descriptive error message would help pinpoint the problem.
> 1 votes

# Answer
I would contact your host and ask for your IP address to be allow listed.... I've run into this a few times when my IP address has gotten blocked for some reason.

The 500 error could likely be from the server and NOT ExpressionEngine.
> 0 votes

# Answer
Which php version are u using? Try 7.4 in case...
> 0 votes

# Answer
Host/server support had to Reset PHP for the domain. (Didn't know that was even a thing.)
> 0 votes

---
Tags: error, server, error-500
---


# Question
Title: Many error messages after update from EE5 to EE6.4.6
I am seeing many error messages post-update from EE 5.x.x to EE 6.4.6. They go away if I revert back to PHP 7.4 from PHP 8.1. All add-ons (just Wygwam and ChannelImages) are up to date. Dreamhost server. Any suggestions greatly appreciated (previous list of error messages removed for clarity).

UPDATE: Thanks eeharbor for supplying the new ChannelImages update (7.5.2) this made the error messages I was seeing when saving an entry go away. However, I still am seeing the following error messages on multiple sites that I updated from EE version 5.x.x to 6.4.6, with PHP version set to 8.1:::

```
WHEN LOADING CERTAIN PAGES ON FRONT END:

Deprecated
ctype_digit(): Argument of type bool will be interpreted as string in the future
ee/ExpressionEngine/Addons/channel/mod.channel.php, line 4187
Severity: E_DEPRECATED

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/ExpressionEngine/Boot/boot.common.php, line 475
Severity: E_WARNING

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WHEN TRYING TO DOWNLOAD TEMPLATES (OPERATION FAILS COMPLETELY):

Deprecated
ZipArchive::open(): Using empty file as ZipArchive is deprecated
ee/ExpressionEngine/Controller/Design/AbstractDesign.php, line 331
Severity: E_DEPRECATED

Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/legacy/helpers/download_helper.php, line 54
Severity: E_WARNING

```

# Answer
> 1 votes
A new release of Channel Images: 7.5.2 has been released to fix this. Thank you for your patience as we update our addons to php 8.2

# Answer
> 0 votes
This looks like a problem arising in the Channel Images add-on - see the lines

```
Deprecated
parse_str(): Passing null to parameter #1 ($string) of type string is deprecated

user/addons/channel_images/api.channel_images.php, line 596

    Severity: E_DEPRECATED

Deprecated
parse_str(): Passing null to parameter #1 ($string) of type string is deprecated

user/addons/channel_images/api.channel_images.php, line 596

    Severity: E_DEPRECATED

```

It looks like these issues then trigger a cascade of other issues.

Channel Images claims to be php 8.2 compatible in the latest version (7.5.1) - so if this error is happening and that's the version you are using I think you should get in touch with eeharbor to see if they can resolve it for you.

HTH.

---
Tags: error, update
---


# Question
Title: How to list all members and their custom member fields?
I'm trying to figure out how to have a page that lists all members with basic fields like email, screen\_name and then all the other custom member fields I created.

# Answer
> 3 votes
Please see this thread: Display members in group in template

You will probably need to use an extension or plugin to do this easily. Something like solspace User or another plugin that will allow you to output your list directly.

Another option is accessing the member data via query but you will need to do some work to the query to get it to show the custom profile data. The standard query for members is:

```
{exp:query sql="SELECT * FROM exp_members"}

```

and if you need to group them by member group:

```
{exp:query sql="SELECT * FROM exp_members WHERE group_id='2'"}

```

In this way you could get your member IDs and send them to an embedded template. Please note that it is probably more efficient to use a custom query instead of an embed.

```
{exp:query sql="SELECT member_id FROM exp_members"}
    {member_id}
    {embed="member-info-embed-template-path" member_id="{member_id}"}
{/exp:query}

```

then your embed template can output standard custom profile tags

```
{exp:member:custom_profile_data member_id="{embed:member_id}"}
    <div>{your_custom_profile_tag}</div>
{/exp:member:custom_profile_data}

```

For query speed with many members you will probably want to do away with the embed method and directly output all your member data via a custom query. You will need to do a JOIN for exp\_members and exp\_member\_data based on the member id. I think the following will get you there.

```
{exp:query sql="SELECT * FROM exp_members INNER JOIN exp_member_data
ON exp_members.member_id = exp_member_data.member_id
GROUP BY exp_members.member_id
ORDER BY exp_members.member_id ASC
LIMIT 10"}
    {member_id} {screen_name} {m_field_id_2}<br />
{/exp:query}

```

you can adjust the above query as needed to limit your results by adding WHERE and AND clauses like WHERE group\_id='4' AND m\_field\_id\_2='whatever'

just keep in mind that you'll need to use m\_field\_id\_NUMBER instead of the EE field name if you are using the above query as is. Also, it may be better to specify the exact column names in the SELECT rather than using SELECT \*.

Hope this helps.

# Answer
> 1 votes
I've also been working on attempting this today, and have found that the ExpressionEngine Member data tables have changed a bit. The custom Member Field data is now stored in a separate Table for each field, and can be referenced by using the Member ID identifier.

```
{exp:query sql="SELECT * FROM exp_members
INNER JOIN exp_member_data_field_1 ON exp_members.member_id = exp_member_data_field_1.member_id
INNER JOIN exp_member_data_field_2 ON exp_members.member_id = exp_member_data_field_2.member_id
WHERE role_id=6 ORDER BY exp_members.join_date DESC"}
  <p>{m_field_id_1} {m_field_id_2}</p>
{/exp:query}

```

Here you can see how I managed to output the Member's First Name and Surname which (for me) are stored in the `exp_member_data_field_1` and `exp_member_data_field_2` tables. Oh, and `group_id` is now called `role_id`.

# Answer
> 0 votes
There is no need to fire custom queries for that. You can do it with any member module:

Free:

https://devot-ee.com/add-ons/zeal-smart-members

Paid:

https://devot-ee.com/add-ons/smart-members-pro

https://devot-ee.com/add-ons/user

You can search for other modules on https://devot-ee.com

# Answer
> 0 votes
I know that this is a bit of an old post, but if anyone stumbles on this, if you are using EE7 (and I think EE6 as well) you can do all of this with the native {exp:member:memberlist ...} Member List tags like so:

```
{exp:member:memberlist
orderby="screen_name"
group_id = '5' (or whatever group ID you are looking for)
sort="asc"
}
{/exp:member:memberlist}

```

and then combine it with {member\_rows} tags and the {exp:member:custom\_profile\_data} {my\_custon\_field} {/exp:member:custom\_profile\_data} to display as much or as little data as your want.

All the tags are exposed for use in your own templates and don't need to use the native Member" templates at all.

Complete docs are here: https://docs.expressionengine.com/latest/member/memberlist.html

Here: https://docs.expressionengine.com/latest/member/search.html

and here: https://docs.expressionengine.com/latest/member/custom-profile-data.html

Hope it helps. R

---
Tags: members, custom-fields, member-details
---


title: Display members in group in template

text:
# Question
Title: Display members in group in template
Is there a way to display all the members that belong to a certain group\_id inside a template without resorting to the lame and gross profile\_themes nonsense?

# Answer
I just did this recently with the AC Member List add-on.

```
{exp:ac_memberlist group_id="5|6|7"}
  <h2>{screen_name}</h2>
  <li>Username: {username}</li>
  <li>Name: {screen_name}</li>
{/exp:ac_memberlist}

```

Make sure this is outside of any `{exp:channel:entries}` tag. I spent hours with that mistake :)
> 4 votes

# Answer
You will need to use either a custom query

```
{exp:query sql="SELECT * FROM exp_members GROUP BY group_id"}
 tags here
{/exp:query}

```

The other option would be to use an add-on such as Solspace User and their users tag

```
{exp:user:users}
  content
{/exp:user:users}

```
> 5 votes

# Answer
We've done it before, but as we've been using Profile:Edit or Zoo Visitor, we've just used the standard exp:channel:entries tag to do the listing as Member data is transferred into Channel Entries.

```
{exp:channel:entries
    channel="members"
    dynamic="off"
    status="Open"
    group_id="8"
    limit="50"
}

```

Job done.
> 4 votes

# Answer
I know that this is an old post, but I am posting this answer in case anyone else should stumble upon it.

EE7 (and I think EE6) have exposed all of its member tags, as well as the {exp:member:memberlist} tags so you can build these lists in your own template designs and are not restricted by the "lame and gross profile\_themes nonsense".

You can then combine the {exp:member:memberlist} tags with the {exp:member:custom\_profile\_data} tags to build out flexible member lists based on your own configuration and need, inside of your own site templates.

They have also made the {exp:member:member\_search} functions available in the same way, to allow you to create dynamic, sortable lists.

Documentation can be found here: https://docs.expressionengine.com/latest/member/memberlist.html
> 1 votes

---
Tags: members, groups
---


# Question
Title: Field 'tax_override' doesn't have a default value
Working with the default templates in Expresso-Store and am getting the following error when trying to add to cart; please note that the default tax rate has been set.

Error Number: 1364

Field 'tax\_override' doesn't have a default value

insert into `exp_store_orders` (`order_hash`, `billing_same_as_shipping`, `billing_country`, `billing_state`, `shipping_country`, `shipping_state`, `shipping_method`, `weight_units`, `dimension_units`, `site_id`, `order_date`, `ip_address`, `ip_country`, `return_url`, `cancel_url`) values ('dd3c64ebe03881dd2dbc8d33185332c2', 1, 'US', 'NE', 'US', 'NE', '', 'lb', 'in', '1', 1467737126, '70.184.219.242', NULL, 'http://www.heartlandclassics.info/store\_example/product/related-product-test', 'http://www.heartlandclassics.info/store\_example/product/related-product-test')

Filename: third\_party/store/vendor/expressodev/laravel-codeigniter-db/src/CodeIgniterConnection.php

Line Number: 145

# Answer
We found that we needed to turn off strict MySQL on the server and the tax issue was resolved.
> 1 votes

# Answer
I just had the same problem and found this question and the solution from 92 West. A better way is to go into the database and change the default value for the 'tax\_override' field from 'none' to NULL.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: REstriction on amount of text I can input to a survey
I am using EE v2.11.9. Much of my website has been built by external develoers so I have limited knowledge. I seem to have a reached a limit on the amount of text / words I can enter into a 'introduction' section of a 'survey' in EE. Does anyone know how to increase or remove the limit?

# Answer
First place where i'd look is in the field configuration. Since it's called "introduction" my guess it's limited to a certain number of characters.

Your site is running on a really old version of EE. Before anything else i'd advise you to have it updated asap.
> 1 votes

---
Tags: content
---


# Question
Title: How are EE templates and entries tied together?
I am new to EE and am trying to help maintain an large, old EE installation (Running EE 3.3.3 on IIS). It uses the Construct plugin.

There is an entry on the site with slug “business-office”, and I have a template html file in the backend named boffice.html. Changes made in boffice.html show up on the site on entry “business-office”. This template is specific to this one entry. There are many entries on the site with this same 1-to-1 setup. All good so far.

What I don’t understand, and haven’t been able to discover, is how the template and entry are connected -- how does EE know to use that template with that entry? I don’t see anything in the entry options for “business-office” to specify a template. In the template code, nothing points back to a particular entry. In Template manager, I can see a “site/boffice” template listed, but it doesn’t specify “business-office” in any way that I can see. In Template Routes, the route is empty for “site/boffice”. In the Construct plugin, I see a similar template entry to the EE template, presumably to tie together the EE template to the Construct template (?), but again, no direct reference to “business-office”.

How does EE know to use the boffice.html template with the “business-office” entry?

# Answer
This association can be set while editing the Construct navigation/tree settings for the menu node which corresponds to the entry.
> 0 votes

---
Tags: ee3
---


# Question
Title: Cant get image to display when sharing to Facebook with "og:image" property within entry tag
I have my "og:image" property within entry tag like this

```
{exp:channel:entries channel="news" limit="1" status="open" require_entry="yes" orderby="date" sort="desc" disable="categories|category_fields|member_data|trackbacks" dynamic="yes" show_future_entries="yes" show_expired="yes"}
     <meta property="og:image" content="{images limit="1"}{image}{/images}" />
     <meta property="og:image:secure_url" content="{images limit="1"}{image}{/images}" />
     <meta property="og:image:width" content="1200" />
     <meta property="og:image:height" content="630" />
     <meta property="og:image:alt" content="alternative" />
{/exp:channel:entries}

```

Im using a "Social Bookmarks" addon and the review before posting comes out displaying the image but when I post the image is absent.

If I run the page url through Facebook's Sharing Debugger it states that the image is present and no problems were found but it also throws up one issue:

Warnings That Should Be Fixed

Inferred Property - The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

Am I doing something wrong?

Thanks for any help, Paul :)

# Answer
> 0 votes
Did you try to re-scrape the page in FB debugger?

---
Tags: facebook, social
---


title: Alphabetical Category order?

text:
# Question
Title: Alphabetical Category order?
I've recently imported some data that resulted in the creation of hundreds of categories. Unfortunately, within the CMS, they all list in ID order, making this very difficult to manage.

There used to be a way to change the order of categories in EE2. You had a "Master Sort Order" where could choose alphabetical or custom. Is there any way to do this in EE6+, or at least get them to alphabetical order within the system without manually dragging them into the correct place?

# Answer
> 0 votes
```
You can do this programmatically via:

{exp:channel:categories style="linear" orderby="category_name" sort="asc"}
    <a href="#">{category_name}</a>
{/exp:channel:categories}

```

---
Tags: categories
---


# Question
Title: Using {paginate} in a {parents} pair tag
I'm using EE 7.3.9 have 2 channels related via a relationship field, and I would like to create a page showing all the entries in channel 1 (the parent) that have in common the same field in the channel 2 (the child).

So I created a list with

```
{exp:channel:entries channel="channel2" url_title="{segment_2}" limit="1"}
{parents field="relationship_field" limit="4" paginate="bottom"}
{parents:title}
{paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/parents}
{/exp:channel:entries}

```

It shows the first 4 entries that have that particular field in {segment\_2}, but the pagination doesn't show.

I also tried to achieve the same result in the other way, accessing via the parent field

```
{exp:channel:entries channel="channel1" search:relationship_field="{segment_2}" limit="4" paginate="bottom"}

```

but it doesn't show anything, and in the documentation there is this statement

> "Relationship fields cannot be searched using the search parameter".

So, how can I achieve the goal to show all the entries that have in common a particular relationship field AND the pagination?

Thank you in advance for your answer.

# Answer
> 0 votes
This might be a good excuse to use a custom query combined with a template embed. In short, you use the query to get a list of entry\_ids based on your criteria. Then pass it to the embed template to output and paginate:

First the custom query

```
{!-- get related parent entry IDs for the given child entry --}
{exp:query sql="SELECT parent_id
               FROM exp_relationships
               WHERE child_id =
                 (SELECT entry_id FROM exp_channel_titles WHERE url_title = '{segment_2}' LIMIT 1)"}

    {!-- if it's the first row, set a variable with the entry ID. For subsequent rows, append the ID with a pipe. --}
    {if count == 1}{embed="your_template_group/related_entries" the_ids="{parent_id}"}{if:else}|{parent_id}{/if}
{/exp:query}

```

and the template embed:

```
{exp:channel:entries channel="channel1" entry_id="{embed:the_ids}" limit="4" paginate="bottom"}
    {title}
    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}
{/exp:channel:entries}

```

---
Tags: relationships, search, pagination, parent, ee7
---


# Question
Title: Can I determine the channel name for each entry within a relationship field tag pair?
On a relationship field that allows user to select entries from multiple channels, is it possible on the front end template to use the entry’s channel name in a conditional? Like I want to use different html and display different fields depending on whether the entry is from channel A or B.

# Answer
> 1 votes
I think you can use the single channel variables to do something like this...

```
{home_slideshow status="open|featured"}
    {if "{home_slideshow:channel_short_name}" == "channel_events"}

```

https://docs.expressionengine.com/latest/channels/entries.html#single-variables

---
Tags: relationships
---


# Question
Title: Cartthrob 8: 403 or memory issue after paypal standard on cartthrob will not send through to order_info
Hi I have been having problems with this for months and I have not been able to get it sorted every time an order is made it goes to paypal(standard) and the payment is taken after this the issue arrises that it either comes up with a 403 error or a fatal error:allowed memory size is exhausted.

Please note the payment goes through and it works but it is coming up with errors rather than sending me to `/store/order_info`

I have contacted my hosting and we have rigorously tested everything and maxed out memory availability to make sure there is no problems on that end. They cannot see any issues and are blaming the problem on the Cart Throb.

For context I have been using Cart Throb for a while on this site but recently I have upgraded the site to all the latest versions. My hosting provider are saying the recent upgrades are causing the issues.

The site should go to `/store/order_info` after a purchase is made but it has been going to `/index.php/store/checkout` despite the fact I have `return="{template_group}/order_info"`

Another issue which I think may be linked and could be causing problems is that when I go to *orders \> order status* in the backend of the site of the addon I cannot change any of the settings and it just shows `Error Updating Settings!` in a red box at the start so all of the order status settings are blank.

Any help would be hugely appreciated as I need to get the issue sorted... I am starting to think that maybe when I updated that a few files might not have uploaded correctly or something which is why there are some small errors but most of the things still work.

Thanks & Best Regards, John

# Answer
I think you should submit a ticket to CartThrob's official support:

https://support.cartthrob.com/support/home

What version of PHP is the site running?
> 0 votes

---
Tags: cartthrob, upgrade, paypal, order-info
---


title: ExpressionEngine on PHP7

text:
# Question
Title: ExpressionEngine on PHP7
**PHP 7 Release Candidate 7** came out today.

Rasmus Lerdorf has been giving talks on the advantages of PHP7 including benchmarking against many popular PHP applications -- for example here's the benchmark for WordPress. His talks also include a request for PHP users to run their own tests/benchmarks against their own code.

Questions:

Has anyone tried EE3 or EE2 on this new version of PHP?

Has EllisLab made any comment regarding EE on PHP7?

Has anyone tried benchmarking EE on PHP7 according to Ras' instructions?

# Answer
Concerning a statement from EllisLab, they posted a blog-entry on 13th April, 2016 telling that EE2 and EE3 are PHP 7-compatible: https://ellislab.com/blog/entry/time-to-upgrade-php
> 3 votes

# Answer
I just gave it a shot and it looked like the install worked fine, but the control panel loaded up with a bunch of errors. It looked like they could likely have been suppressed by turning off E\_NOTICE or changing E\_STRICT in error reporting since they didn't look like errors that would stop anything from working.
> 2 votes

# Answer
Been running EE3 (3.3.3) with php7, and it runs smooth as a baby's butt.

There are a whole lot of problems with add-ons tho I've realised.

* Solstice TAG throws a nasty error making it impossible to add new entries.
* DataGrab is not working (Well, the UI is, but no imports are made, and no import-setups can be saved).

Don't know about any other add-ons (except Stash, which works, of course), since we stopped development until PHP has been downgraded.

So, if you run **no** add-ons, upgrade your PHP. If you are relying on add-ons, be *very very* careful.
> 2 votes

# Answer
I have run a site locally on PHP 7 without any problems. EE usually only requires a minimal version of PHP. As I've said, no issues so far.
> 1 votes

# Answer
We are just trying to run a older version of EE on PHP7.

The only major issue we are encountering is that all the form submissions are setting the local date to 1969-12-31 23:59, although that only appears to be on form submission rather than actually on when its running. For example if I add {entry\_date} into a form page, when you load the page it will display the correct result, after you hit submit, it will change to 1969-12-31 23:59.

EE is 2.5.3, unfortunately too much custom code in it to upgrade it.

If anyone happens to know what is causing this, it would be much appreciated! :)
> 0 votes

# Answer
If anyone else has hit this, the `string_to_timestamp` function in `Localize.php` is the problem. `convert_human_date_to_gmt` is returning back an invalid date so it returns 0 date (adjusted for GMT)
> 0 votes

---
Tags: php, performance, compatibility
---


# Question
Title: How do I use pagination on a search results page?
I am running EE 7.3.12 and using Simple Search for a search box. The search works correctly but I am having trouble applying the pagination element.

Here is the search box code:

```
{exp:search:simple_form channel="youtube" search_in="everywhere" limit="9" result_page="member-content/search-results"}
    <input class="search ms-5" type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" placeholder="Search">
  {/exp:search:simple_form}

```

Here is the results page code:

```
<h2>Search Results</h2>

<div class="row">
{exp:search:search_results paginate="bottom"}
<div class="col">
<div class="embed-responsive embed-responsive-16by9">
<iframe src="{url}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>
<h3 class="mt-3">{title}</h3>
<p>{excerpt}</p>
</div>

{if count == total_results}
</div><!-- /.row -->
{/if}
{paginate}
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/exp:search:search_results}

{if count == total_results}
    </div><!-- /.row -->
{/if}
{paginate}
    <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}
{/exp:search:search_results}

```

Obviously Bootstrap rows and columns work differently than classic tables, but failure is not an option. How do I adjust this to properly display pagination?

# Answer
I got some help from EE on this but I am going to post it to make it official.

Search uses **results="9"** instead of limit="9". With that in place the the following is no longer needed:

```
{if count == total_results}
    </div><!-- /.row -->
{/if}

```
> 0 votes

---
Tags: pagination, ee, simple-search
---


title: Grid within Fluid fieldtype

text:
# Question
Title: Grid within Fluid fieldtype
would someone be willing to explain to me quickly how to use Grid inside Fluid fieldtype... I can't get the syntax right... on a simple example...

{fluid\_field} {grid\_field} {grid\_field:custom\_field} {/grid\_field} {/fluid\_field}

Thank you very much in advance!

# Answer
> 0 votes
What you are missing is the inclusion of a `{content}` tag pair. So your code should work when you do something like:

```
{fluid_field}
    {grid_field}
        {content}
            {content:custom_field}
        {/content}
    {/grid_field}
{/fluid_field}

```

There is a more complex illustration of this in the EE documentation.

HTH

---
Tags: grid, fluid-field
---


# Question
Title: Cartthrob remove product from cart if purchased
I'm new to cartthrob and want to know how can a product be automatically deleted if that product has been purchased from current logged in user. Let's see it as a scenario I'm logged out and I add that product into cart and while checkout I get asked to login and After I login that product gets added to cart even if I've already purchased that product to cart....so please tell me how can I remove that product automatically in Expressionengine cartthrob?

# Answer
> 0 votes
You'll need to create an extension on the `cartthrob_add_to_cart_start` hook. This hook runs right before the process of adding an item to the cart so you can check if the member has purchased said product and then apply the `end_script` value and stop execution to meet your needs

---
Tags: cartthrob, ee
---


title: The requested URL was not found

text:
# Question
Title: The requested URL was not found
I have Apache/2.4.48 on Windows + PHP version 8.0.8. When I write www.sitename.com everything is OK - the website is online, but when I clicked on the same link in Facebook, the address become: www.sitename.com/?fbclid=IwAR1Os9R3NI3fl2ssnajHMBB2Vmo and the result is "The requested URL was not found". My default page is index.php and it doesn't need a parameters. What's the problem?

# Answer
If you take that URL and add index.php before the question mark does it then work as intended?
> 0 votes

---
Tags: php, url, apache
---


title: Fetch entry using PHP

text:
# Question
Title: Fetch entry using PHP
Is there a way to get an entry using only PHP? I've looked at the developer API, http://ellislab.com/expressionengine/user-guide/development/api/api\_channel\_entries.html, but there doesn't seem to be a way to fetch an entry.

I'd like to do this:

```
$entry = ee()->api_channel_entries->get_entry($entry_id);

```

# Answer
> 1 votes
I was able to use the Bones plugin and get data over the ACT (Action) APIs, such as:

`?ACT=40&url_title=$sSlug`

Or:

`?ACT=40&entry_id=$nEntryID`

# Answer
> 0 votes
Short answer: there is no API for this.

Longer answer: there is no API, but... You could either check out ObjectiveHTML's Channel Data library. You could also try and utilize the Channel module. However, that path is completely undocumented, so if you decide to go that route, tread lightly.

---
Tags: channel-entries-api
---


# Question
Title: Cartthrob show out of stock if product is purchased by current user
I'm new to cartthrob and I want a functionality where if a user has purchased a product already then show out of stock to that user so that user can not make an order again. I'm using this code currently, it's working but as soon as I change entry status of that product purchased then this condition does not work. Please help

```
{if {exp:cartthrob:is_purchased_item entry_id="{entry_id}"} }
 You have already purchased this item!
{if:elseif {exp:cartthrob:is_in_cart entry_id="{entry_id}"}}
  <p class="text-center cart-button"><a href="/sample-products/cart" class="green-button">Go to cart</a></p>
{if:else}
{exp:cartthrob:add_to_cart_form class="form" secure_action="yes" return="/sample-products/cart" entry_id="{entry_id}" quantity="1"}
  <style>.form{border:0;}</style>
  <input type="hidden" name="item_options[purchased_type]" value="Sample Product"/>
  <input type="submit" name="submit" value="Add to Cart" class="green-button">
{/exp:cartthrob:add_to_cart_form}
{/if}

```

# Answer
> 0 votes
UPDATE:

I've created own custom function which checks from the database if the current user has purchased item in the past and its working fine.

# Answer
> 0 votes
You didn't really outline the result of your code, but just reviewing it, I'm pretty sure it's the lack of quotes on your conditionals. This worked for me:

```
{if '{exp:cartthrob:is_purchased_item entry_id="{entry_id}"}' == '1'}
    You have already purchased this item!
{if:elseif '{exp:cartthrob:is_in_cart entry_id="{entry_id}"}' == '1'}
    <p class="text-center cart-button"><a href="/sample-products/cart" class="green-button">Go to cart</a></p>
{if:else}
     {exp:cartthrob:add_to_cart_form class="form" secure_action="yes" return="/sample-products/cart" entry_id="{entry_id}" quantity="1"}
    <style>.form{border:0;}</style>
    <input type="hidden" name="item_options[purchased_type]" value="Sample Product"/>
    <input type="submit" name="submit" value="Add to Cart" class="green-button">
    {/exp:cartthrob:add_to_cart_form}
{/if}

```

---
Tags: cartthrob, ee, ee7
---


# Question
Title: How to send CC Email in Freeform v2 Expressionengine
I've read official documentation but did not find any tag where I can send CC and BCC email notification after submit, if anyone knows please let me know.

# Answer
There are tow types of notifications. Admin and visitor. For a cc or bcc for vistor you just add an extra e-mail-field I guess. For the admin notification just click the mail button next to the settings within the form and select a notification template. An area show up where your can put mailadressen "Email address(es) to receive an email notification. Enter each on a new line." Mails wil be send like a BCC.\[\]

\[
> 0 votes

---
Tags: ee7
---


title: Custom Member Fields On Registration

text:
# Question
Title: Custom Member Fields On Registration
I have created these on the backend at custom member fields.

Do I need to do something extra?

```
{exp:member:registration_form
    return="member/registration/success"
    error_handling="inline"
}

    <p>* Required fields</p>
    <fieldset>
        <h4>Login details</h4>

        <p>
            <label for="username">Username*: {if error:username}{error:username}{/if}</label><br />
            <input type="text" name="username" id="username" value="{if username}{username}{/if}"/><br />
        </p>

        <p>
            <label for="email">Email*: {if error:email}{error:email}{/if}</label><br />
            <input type="text" name="email" id="email" value="{if email}{email}{/if}"/><br />
        </p>

        <p>
            <label for="first_name">First Name*: {if error:first_name}{error:first_name}{/if}</label><br />
            <input type="text" name="first_name" id="first_name" value="{if first_name}{first_name}{/if}"/><br />
        </p>

        <p>
            <label for="surname">Surname*: {if error:surname}{error:surname}{/if}</label><br />
            <input type="text" name="surname" id="surname" value="{if surname}{surname}{/if}"/><br />
        </p>

        <p>
            <label for="phone_number">Phone Number*: {if error:phone_number}{error:phone_number}{/if}</label><br />
            <input type="text" name="phone_number" id="phone_number" value="{if phone_number}{phone_number}{/if}"/><br />
        </p>

        <p>
            <label for="password">Password*: {if error:password}{error:password}{/if}</label><br />
            <input type="password" name="password" id="password" value="{if password}{password}{/if}"/>
        </p>

        <p>
            <label for="password_confirm">Confirm password*: </label><br />
            <input type="password" name="password_confirm" id="password_confirm" value="{if password_confirm}{password_confirm}{/if}"/>
        </p>

        <p>
            <label for="terms_of_service">Terms of service:</label><br />
            <div>All messages posted at this site express the views of the author, and do not necessarily reflect the views of the owners and administrators
                of this site.By registering at this site you agree not to post any messages that are obscene, vulgar, slanderous, hateful, threatening, or that violate any laws. We will
                permanently ban all users who do so.We reserve the right to remove, edit, or move any messages for any reason.</div>
        </p>

        <p>
            <label><input type="checkbox" name="accept_terms" value="y" {if accept_terms == 'y'}checked="checked"{/if} /> I accept these terms {if error:accept_terms}{error:accept_terms}{/if}</label>
        </p>

        {if captcha}
            <p>
                <label for="captcha">{lang:captcha}*</label>
                {captcha}<br/>
                <input type="text" id="captcha" name="captcha" value="" size="20" maxlength="20" style="width:140px;"/>
            </p>
        {/if}
    </fieldset>

    <input type="submit" value="Register" class="btn btn-primary" />
{/exp:member:registration_form}

```

# Answer
> 2 votes
I had to use `m_field_id_1` to reference the Custom Field like below

```
<div class="form-group"> <label for="surname"> {if error:m_field_id_1}{error:m_field_id_1}{/if}</label> <input type="text" name="m_field_id_1" id="m_field_id_1" placeholder="Surname*" class="pry-form-control" value="{if m_field_id_1}{m_field_id_1}{/if}" required /> </div>

```

and then it worked.

---
Tags: registration
---


# Question
Title: Contact form needs to send email to content of email field - using Freeform Next v3
I need a contact form users can use to send an inquiry to an email provided with a list of multiple events. The email address is not visible to the public, but is provided with the channel entry for each event. The field for this address is {contact\_email}.

I built a form that successfully sends a copy of the email notification to our office email (Admin Recipients), but not to the intended primary recipients.

Here is the opening to the form:

> {exp:freeform\_next:form form\_name="contact\_acim\_group\_host" required="firstname|lastname|email|email\_confirm" matching\_fields="email|email\_confirm" return="http://www.pathwaysoflight.org/acim\_groups/thank\_you" recipients="{contact\_email}" admin\_notify="info@pathwaysoflight.org" user\_notification\_template="group\_info\_request" user\_notify="{contact\_email}" template="contact\_acim\_group\_host" }

The template contains the following fields: 1st name; last name; comments (text area).

The subject of the notification email is set with this line:

> \<input type="hidden" id="subject" name="subject" size="40" value="Request for information about your ACIM study group."

What am I missing?

# Answer
> 0 votes
You can set up a notification for this. In the notification recipient field enter the email field with curly braces that you want to use, e.g. `{contact_email}`

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


# Question
Title: Embedded template variables and conditionals?
In an upstream template, I do this code :

```
{embed="templatecategory/template" varA="{var1}" varB="{var2}"}

```

These variables are populated by a custom addon.

And in the next template:

```
{embed:varA}<br>
{if varA == 3}
    its 3!
{if:else}
    its not 3!
{/if}

```

The output is:

```
3

its not 3!

```

so the embedded variable works! its there!

I'm assuming that the conditional is being run before the variable resolves(parsing order issue). So, I've tried to use stash in the upstream template to no avail.

```
{exp:stash:set}
    {stash:StashVar}{var1}{/stash:StashVar}
{/exp:stash:set}

```

And the downstream template is

```
<script> console.log("StashVar = {StashVar}")</script>
{stash:embed:StashVar}
<br>
{if StashVar == 3}
    its 3!
{if:else}
    its not 3!
{/if}

```

and again the output is

```
3
its not 3!

```

Note the console log I put in to see what is happening. If I run that command in the upstream template it correctly outputs

```
StashVar = 3

```

but downstream is

```
StashVar = {StashVar}

```

What's the easiest way to get those variables to the downstream template for use in conditionals?

# Answer
> 2 votes
I think your problem is that you're not using the correct variable name in the conditional. When you send a variable in an embed, the variable on the other end is `{embed:variable_name}`, not `{variable_name}`.

With that in mind, try the following...

```
{embed:varA}<br>
{if embed:varA == 3}
    its 3!
{if:else}
    its not 3!
{/if}

```

If that doesn't work, try

```
{embed:varA}<br>
{if "{embed:varA}" == "3"}
    its 3!
{if:else}
    its not 3!
{/if}

```

# Answer
> -1 votes
Why don't you just test the embed variable?

```
{!-- PAGE TEMPLATE --}
{exp:stash:set name="stashVar"}{var1}{/exp:stash:set}
{embed="group/template" stashVar="{exp:stash:get name='stashVar'}"}

```

Then...

```
{!-- EMBED TEMPLATE --}
{if embed:StashVar == 3}
    its 3!
{if:else}
    its not 3!
{/if}

```

I think it's slightly unclear what you are trying to accomplish because you changed variable names multiple times.

# Answer
> -1 votes
If you are chaining templates (that's what it sounds like at least) these days you can usually avoid the need to use `{embed}` constructs much of the time through the use of Layout Variables.

Based on what it looks like you are trying to do, the advantage of Layout Variables for this use case comes as a side-effect of how Layout Templates are evaluated by EE - basically each template in a template layout stack is evaluated **before** processing moves on to the next one in the stack - so any layout variables you define on one layout template are evaluated before they are saved / made available in the next (and all subsequent) templates in the layout stack.

Because layout templates are evaluated in sequence, and thanks to how EE writes out template debug information, you also get a side-benefit in that you can inspect the values of all layout variables directly from the template debug report (as you can for the values assigned to embed variables actually).

HTH

---
Tags: templates, stash, conditionals, variable, parsing
---


title: Redirect all EE-URLs to one

text:
# Question
Title: Redirect all EE-URLs to one
I have three URLs for every entry:

1 https://www.xy.de/site/single/zahnraeder-zeichnen-aufgaben

2 https://www.xy.de/site/single/zahnraeder-zeichnen-aufgaben/3093

3 https://www.xy.de/site/single/3093

Is there any way to redirect them to 1 ? I would prefer to kill 2 and 3 permanently, but I don't know how to do this technically.

Thanks for any advice!

# Answer
you'll want to use 301 redirects in your `.htaccess` file

e.g:

```
Redirect 301 /site/single/zahnraeder-zeichnen-aufgaben/3093 /site/single/zahnraeder-zeichnen-aufgaben
Redirect 301 /site/single/3093 /site/single/zahnraeder-zeichnen-aufgaben

```

(pay attention to the spaces)

and something like this should be at the top of your `.htaccess` file:

```
<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://www.xy.de%{REQUEST_URI} [R=301,L,NE]

```
> 0 votes

# Answer
Are all of those entries using the same template?

If so I would setup a template route in the CP. Something like:

`/site/single/{title:alpha_dash}`

And in your template route make sure you require segments.

In your template I would use `url_title="{segment_3}"` in your `exp:channel:entries` loop and add:

```
{if no_results}
    {redirect="404"}
{/if}

```

Additionally, consider adding the following to your template (in your entries loop) if the above doesn't cover it.

```
{if segment_4}
    {redirect="/site/single/{url_title}"}
{/if}

```
> 0 votes

---
Tags: url, redirects
---


# Question
Title: Detour - Expression Engine Addon not working
EE 7.3.14 Detour 3.0.2

Redirects are not working at all Redirects are properly formatted tried both EE and PHP url detection methods

# Answer
> 0 votes
This is most likely related to your server configuration. Are you properly routing all traffic through the ExpressionEngine index.php file?

You may need to update your .htaccess file or your nginx config depending on your server type.

---
Tags: detour-pro
---


# Question
Title: How to duplicate entries in ExpressionEngine 3
So I used MX Cloner in EE2 but it doesn't support EE3. Anyone know any tools for duplicating a channel entry in EE3? Need to create a few variations of landing pages.

# Answer
I have the same issue in EE3. I have found SimpleCloner for EE3. It is given more option than MX Cloner.

See github link : https://github.com/ThorntonStuart/SimpleCloner
> 1 votes

# Answer
The 2024 (and probably 2021 =) response to this is: You just have to upgrade to ExpressionEngine 7. It will clone entries natively.
> 1 votes

---
Tags: ee3, duplicate
---


# Question
Title: EE6 Transcribe Add-on Step-By-Step Guide?
Important question from the jump since I may have terribly misunderstood something:

Does "Transcribe" on EEHarbor automatically translate content or do you have to manually translate the words and copy-paste them/create variables yourself?

EDIT: Yeah, there is no translation feature in this add-on. I'll likely be looking at Publisher which does explicitly offer auto-translation.

That aside, I find myself at a loss in implementing this add-on. **I've already read through the documentation, but I need my hand held here in a major way.**

I've installed it, created the default language English (en) and second language Spanish (es). I created a test page in English, and related it to a test page in Spanish. I created a template:

```
{exp:transcribe:entries channel="general"}

    <h1>{title}</h1>

    {page_content}

{/exp:transcribe:entries}

```

And I can view both of my test entries using that template. However, the content is 1:1 - both in English. Which is not what I was expecting from: "Transcribe handles everything from word/phrase translation to channel entry translations..."

This is a pre-existing site with MANY existing entries. Transcribe's documentation states it has a work-around for that scenario, which only links to the Tag Reference page. And at least at the moment, the terminology used on that page is so vague and circular that I can't make heads or tails of what I'm supposed to use - the same general framework as what I have above? Or do I use {exp:transcribe:language} or {exp:transcribe:translate} and does that mean I need to create 2 templates for each language or just 1? Please please just give a Step 1, Step 2, Step 3.

Or, I guess, if my initial assumption is wrong - what's everyone using to translate their sites first?

# Answer
> 0 votes
Transcribe does not translate. It is more of a multilingual content management addon.

It gives you the means of adding languages to a site, and fields to store said language content. It does require the site owner to input the translated content.

# Answer
> 0 votes
Just a note: Publisher does not auto-translate either. Like Transcribe, Publisher is more of a multilingual manager, not a means of auto-translation.

Before you dismiss either one, just be aware there's power in both, as they offer an admin user interface for language manuage, template tags, variables. And there's a *lot* of website content elements where AI translation can fail: Buttons, links, "Submit," "Login," etc - those can be variables managed by Transcribe or Publisher.

---
Tags: transcribe, ee6, translation
---


title: Template variables conditions

text:
# Question
Title: Template variables conditions
Im on Expression engine 7 now. Im trying check template variable for condition. like so:

```
{if site_logo_path != ""}
    <img src="{site_logo_path}">
{if:else}
    <h1>Site Name</h1>
{/if}

```

Im tryed:

```
{if {site_logo_path} != ""}
{if "{site_logo_path}" != ""}
{if '{site_logo_path}' != ""}

```

No one is working correctly. If site\_logo\_path is empty string or url always displays second rule with h1.

Thanks for your attention. Regards.

# Answer
Does your {site\_logo\_path} is a normal variable or it come from a layout:set?

Did you try {if !site\_logo\_path} ?
> 0 votes

# Answer
Where is `{site_logo_path}` coming from?

**Is it a layout variable?**

`{layout:set name="site_logo_path"}/some/path/file.png{/layout:set}`

If so you would use in your if statement:

`{layout:site_logo_path}`

**Is it a channel field?**

```
{exp:channel:entries channel="some_channel"}
    {site_logo_path}
{/exp:channel:entries}

```

If so, it needs to be wrapped in a channel entries loop like above.

**Is it a global template variable?**

Then what you have tried should've worked.

**Is it a template partial?**

Then I don't think you can evaluate it in an if statement.
> 0 votes

# Answer
If it's like you want to show path then you can try this

```
{if site_logo_path && site_logo_path != ""}
Your condition to show logo
{if:else}
show else
{/if}

```

This should do the trick. If this does not work, let me know what is your purpose and I will help you.
> 0 votes

---
Tags: templates, conditionals, configuration-variables
---