# Question
Title: White screen after log in to Control Panel, after upgrade from v2.9.2 to 2.10.2
After an upgrade from 2.9.2 to 2.10.2 the site was working normally in the browser, and the system login page accepted credentials. After that was a white screen.

Turning on error logging in admin.php produced the following error:

> A Database Error Occurred
>
> Error Number: 1054
>
> Unknown column 'login\_state' in 'field list'
>
> SELECT `member_id`, `admin_sess`, `last_activity`, `fingerprint`, `sess_start`, `login_state` FROM (`exp_sessions`) WHERE `session_id` = 'b0e0c13fd814f8ce72c88a242ac269705f9c5df5'
>
> Filename: libraries/Session.php
>
> Line Number: 731

The database table *exp\_update\_log* indicates successful update to v2.10.2

# Answer
> 3 votes
I located this line (found at 721) in **/system/expressionengine/libraries/Session.php** and removed *login\_state* from the query - so from this:

```
ee()->db->select('member_id, admin_sess, last_activity, fingerprint, sess_start, login_state');

```

to this:

```
ee()->db->select('member_id, admin_sess, last_activity, fingerprint, sess_start'); // login_state

```

The control panel loaded up fine and all seems functional now.

I'm hoping this is just a bug in this particular upgrade path... Or should I run an SQL query to add this column to the *exp\_sessions* database table?

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


# Question
Title: modifying .htaccess to remove index.php? breaks my access to the control panel
I recently took over from another developer and I'm having some trouble with my .htaccess breaking my admin control panel.

My .htaccess file is as follows:

```
RewriteEngine On
RewriteRule ^case-studies/(.*) /articles-case-studies/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

<FilesMatch "\.pdf$">
  header set x-robots-tag: noindex
</FilesMatch>

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_URI} !^/php-fpm/*
</IfModule>

```

which does effectively remove index.php from my urls. The problem I'm having is when I try to log into the back end control panel at:

```
www.example.com/admin

```

the page just gets stuck in an infinite redirect loop. What I've noticed is that without removing index.php? when I try to login to www.example.com/admin it redirects to

```
www.example.com/admin/index.php?/cp/login&return=

```

What am I missing?

Edit:for grammar mistakes

# Answer
EllisLab says you have to add a special rewrite condition if you rename your system folder:

```
If your site’s system directory (/system/) has been renamed and is still accessible by URL, modify the RewriteCond line above:

RewriteCond %{REQUEST_URI} !/newdirectoryname/.* [NC]

```
> 1 votes

---
Tags: htaccess, redirects
---


title: Grouping Channel Fields

text:
# Question
Title: Grouping Channel Fields
Is there a way to group Channel fields when displaying it in the Content section in EE's CP? A way to visually group related fields might be a usability improvement when there are a lot of Channel fields. Possible in EE?

# Answer
> 6 votes
You can create custom tabs on the publish page and choose which fields they contain. Just click the 'show toolbar' link on the upper right hand side of the publish page and you'll see these controls:

Individual fields can be hidden by clicking on the little eye icons. Tabs can be created via the Add Tab link and populated by dragging and dropping field names from the field list to the main content area. You can also remove the default tabs if they're not relevant to the content you're working with (e.g. I often delete the Categories tab).

Once you've got everything arranged as you want it select the usergroups that should see this layout (different usergroups can have different layouts assigned) and hit 'Save Layout'.

# Answer
> 1 votes
Yes, using EE's native "custom publish layouts" (accessed by clicking the "show toolbar" link in the top right of a given channel's publish screen). How well this works for you though depends on the degree of grouping you are looking for.

One option would be if you just want a bunch of related fields moved around to be in proximity to one another, you can use custom publish layout to "collect" them together in a single publish/edit screen.

If you need to segment them (like with a heading for each group or something) the closest you can get is adding tabs and moving the appropriate custom fields into each tab.

# Answer
> 1 votes
...To edit the third paragraph of Jean St-Armand's answer above for anyone else who comes along and finds this question, you could try using ***Red Carrot Notes*** both with or without EE native tabs to build on the native functionality. It's not full of features, but the one that it has works well, allowing you to color-code headings as well as position them amongst any other fields in the control panel.

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


# Question
Title: Really need help - Trouble with EE3, Addons, and server settings - ERRORS
I really need to get some help on this as I have reached out to EL, The Outfit, DD, etc. All have been helpful and eager to assist, but we can't resolve the issue.

I have never run into issues like this with anything I have ever hosted on Siteground (who is where this client is), but I have never tried to install/run EE3 on any either.

I initially had issues with EE3 alone. One of the issues was a bug and is being resolved in the next release. The other was resolved by updating to 3.1.1. The second issue was with DevDemon's Updater add-on. This was an object reference error, also resolved by fresh install of EE 3.1.1.

I them purchased NavEE to use and upon install, was greeted with a page of errors, warnings, etc. I cannot reproduce the errors on my local dev setup running WAMP. Michael at The Outfit was helpful in checking into things on his end as well. While neither of us were able to reproduce it on our ends, we were able to reproduce it on the SG server. I even provided a zip file of the file system with a DB dump. When rebuilt, the error was not present on local machines.

I then opened up a support ticket with the hosting company. However, they only checked file permissions and made sure the files were present and that there were no PHP error logs. They don't know enough about what requirements, if any were causing the conflict and suggested I get with the CMS/Add-on company again. Once I find out, I will be able to tell them what they need to do.

This is beyond frustrating to say the least. :(

The way to reproduce this issue, assuming you have NavEE, is to attempt to install it. You should be presented with a view file to enter your license. However, I am greeted with this:

```
Exception Caught
View file not found: mcp/license/index

/home/stkhomes/system/ee/EllisLab/ExpressionEngine/Service/View/View.php:343
Stack Trace: hide details

#0 ee/EllisLab/ExpressionEngine/Service/View/View.php(95): EllisLab\ExpressionEngine\Service\View\View->getPath()
#1 user/addons/navee/mcp.navee.php(36): EllisLab\ExpressionEngine\Service\View\View->render(Array)
#2 [internal function]: Navee_mcp->license()
#3 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(1607): call_user_func_array(Array, Array)
#4 ee/EllisLab/ExpressionEngine/Controller/Addons/Addons.php(883): EllisLab\ExpressionEngine\Controller\Addons\Addons->getModuleSettings('navee', 'license', Array)
#5 [internal function]: EllisLab\ExpressionEngine\Controller\Addons\Addons->settings('navee', 'license')
#6 ee/EllisLab/ExpressionEngine/Core/Core.php(191): call_user_func_array(Array, Array)
#7 ee/EllisLab/ExpressionEngine/Core/Core.php(94): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#8 ee/EllisLab/ExpressionEngine/Boot/boot.php(138): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#9 /home/stkhomes/public_html/admin.php(143): require_once('/home/stkhomes/...')
#9 /home/stkhomes/public_html/admin.php(143): require_once('/home/stkhomes/...')

```

The file IS in location and the properties are set properly as well. If there is anyone that can help with this, it would be greatly appreciated. I can provide whatever is needed in information in order to check server requirements, settings, etc.

# Answer
> 2 votes
Ok, I don't know what was happening, or why the casing was "off", but the issue was due to the following lines inside of EE's View.php service file:

```
/**
 * Get the full server path to the view file backing this
 * view object.
 *
 * @return String The full server path
 */
protected function getPath()
{
    $path = $this->provider->getPath().'/View';
    $old_path = $this->provider->getPath().'/views';

    foreach (array($path, $old_path) as $path)
    {
        if (file_exists($path.'/'.$this->path.'.php'))
        {
            return $path.'/'.$this->path.'.php';
        }
    }
    throw new \Exception('View file not found: '.htmlentities($this->path));
}

```

in which the path is turned to "View". the folder in the NavEE package was named with a lower case "view".

Changing the case corrected the issue.

\***Noted:

A. Apache is case-insensitive when serving HFS, but B. points out a security vulnerability where a path of a different case can cause a whole and points out that the presence of mod\_hfs prevents this.

# Answer
> 0 votes
Are you trying to install NavEE with the updater addon? Or a manual install? If the former, try the latter if you haven't already. The updater can run into permission and ownership problems.

---
Tags: add-on, php, php-errors, ee3, navee
---


title: Why is keeping URLs clean so messy?

text:
# Question
Title: Why is keeping URLs clean so messy?
I am using EE2.9.2 with Stash and CE Cache. While trying to create a clean URL structure, ie. raising the appropriate 404s where necessary, I ran into challenges I'm struggling to solve.

I have a Books section (among other resources) where I've set up categories (e.g. Arts, Children, etc.). To keep this section 404-sane I need to check if the URL has the proper "books" in it and if the category exists.

After a lot of try and error, here's what I ended up doing:

1) **Test for proper section**
This is the template /resources/index.html
"/resources/books" should pass, "/resources/bookz" should not.

```
{if segment_2 != ""}
    {if "movies|books|music" *= segment_2}
        {!-- all is well (there is no "does not contain" directive in EE) --}
    {if:else}
        {!--redirect="404"--}

        {!-- TEMPORARY WORKAROUND--}
        {exp:channel:entries
            channel="resources"
            url_title="does_not_exist"
            disable="categories|category_fields|custom_fields|member_data|pagination"}
                {if no_results } {redirect="404"} {/if}
        {/exp:channel:entries}
    {/if}
{/if}

```

I'd love to use the commented line instead of the workaround, but if I enable CE Cache and enter a wrong URL nothing happens and the request eventually times out.

2) **Test for proper category**
This is the template I embed if {segment\_3} is not empty.
"/resources/books/arts" should pass, but "/resources/books/artz" should not.

```
{if {exp:stash:is_empty name="current_category_name"}}
    <?php
        $this->EE->output->set_header("HTTP/1.0 404 Not Found");
    ?>
    {!--redirect="404"--}
    {redirect="error/error-404"}
{/if}

```

Again I'd love to use the commented line and not use PHP, but if I don't CE Cache caches the wrong URL.

I'm frustrated that something so elementary and necessary seems to hard.

Any advice on how to do this better or why the above doesn't work with the commented line instead of the workarounds is very much appreciated.

# Answer
I would suggest that you stop trying to handle the routing logic in the template. It makes the templates more complicated than they need to be.

I highly recommend Resource Router for routing.

One nice approach for 404s is to define rules in Resource Router for all possible routes, and add this rule to the end to capture anything that does not match them:

```
".*" => function($router) {
   $router->set404();
}

```
> 1 votes

---
Tags: stash, 404
---


# Question
Title: Exp:resso Store callback from WorldPay returning 403 Forbidden
**Exp:resso Store v1.6.5 on ExpressionEngine v2.10.2**

I have an integration using PayPal Express working just fine with callbacks, however with WorldPay as alternative payment provider, there's an error on the callback:

> Error reported: Callback to http://www.example.com/?ACT=24&H=8fbe37725478025650b33d945595c1cc: NOT OK, received HTTP status: 403

Request:

> POST /?installation=1234567&ACT=24&msgType=authResult&H=8fbe37725478025650b33d945595c1cc

Response:

> HTTP/1.1 403 Forbidden This form has expired. Please refresh and try again.

The data going from WorldPay to EE looks OK but the callback URL isn't functioning correctly.

A successful upgrade of EE from 2.9.2 to v2.10.2 did not resolve the issue.

Any ideas? Thanks.

# Answer
This issue with Exp:resso Store v1.6.5 was unresolved, but a paid **upgrade to Store v2.5.1** solved the problem - no more callback failures on the live site.

Some additional configuration is required on upgrading from Store v1 to v2, however the upgrade was pretty smooth:

https://www.exp-resso.com/docs/installation.html

https://www.exp-resso.com/docs/store\_20\_upgrade\_notes.html

United Kingdom doesn't seem to be included in the default delivery countries for some reason. WorldPay settings need checked and re-entered where necessary.
> 0 votes

---
Tags: expresso-store, ee2, add-on, payment-gateway, worldpay
---


# Question
Title: Resource router hijacking all template groups
I could swear this was working last week.

I've got Resource Router set up like so:

```
':url_title' => function($router) {
$router->setTemplate('addon/index');
$router->setGlobal('template', 'addon');
},
':url_title/faqs' => function($router) {
    $router->setTemplate('addon/faqs');
$router->setGlobal('template', 'addon');
},
':url_title/changelog' => function($router) {
    $router->setTemplate('addon/changelog');
$router->setGlobal('template', 'addon');
},
':url_title/documentation' => function($router) {
    $router->setTemplate('addon/documentation');
$router->setGlobal('template', 'addon');
}

```

and it works.

However, I've just started to notice that if I try /blog the template that gets served is addon/index.

'blog' is not a URL title that exists in the database and this is happening for other template groups as well.

Like I say, this has been working and only just seeing it has stopped coming back to the project this morning.

If I were to alter my routes like:

```
'blog' => 'blog',
'blog/:url_title' => 'blog/post',
'voucher' => 'voucher',
'members' => 'member',
':url_title' => function($router) {
$router->setTemplate('addon/index');
$router->setGlobal('template', 'addon');
},

```

it works, but I'd rather rely on native EE routing for these template groups.

# Answer
`:url_title` will match any string that *could* be a url title as it is converted to `([^/]+)` \[1\]

To stop this rule matching template groups, you can check that the match is for a real entry in the expected channel like this:

```
':url_title' => function($router, $wildcard) {
    // valid entry in the 'home' channel (id=3)?
    if ($wildcard->isValidUrlTitle(array('channel_id' => 3))) {
        $router->setTemplate('addon');
        $router->setGlobal('template', 'addon');
    }
},

```

\[1\] Note: `^` is added to the start and `$` to the end of the rule automatically by Resource Router, so the actual url pattern matched is `^([^/]+)$`
> 2 votes

---
Tags: url, routing, template-routes, resource-router
---


# Question
Title: Is there a simple way for the client to add to a dropdown list on a publish page?
I'm creating an "events" channel and I want to have a dropdown list on the publish page so the editor can select the country in which an event takes place. Initially, events will only happen in 2 or 3 different countries (e.g., US, Italy, France) and so I don't want to populate a list of all countries. What I'm looking for, then, is a way that in the future, an editor can easily add a country to the list without having to go into the field settings etc.

Is this doable?

# Answer
> 0 votes
You could use an add-on (possibly custom) or a relationship field.

Using a channel for countries, and each entry just had the title of the country, then use a relationship field specific to that channel.

Otherwise existing add-on's you could use include Category Select (EE2) which converts the native category selection field to a dropdown and you could customise the field layout to include on the first publish tab instead of an additional tab. Or a custom category fieldtype WB Category Select, where you have a specific category group for countries and each category being a specific country.

Or similar to relationship field, using a channel for countries and each entry a country you could use Z Select.

---
Tags: custom-fields, drop-down
---


title: Any pre-order addon for Cartthrob?

text:
# Question
Title: Any pre-order addon for Cartthrob?
Is there any native/third-party addon to manage pre-order for Cartthrob in expressionengine? or do we've to build something bespoke? Any idea?

# Answer
(I'm with Vector; we make CartThrob)

One question I have about this is how you're handling this on the payment gateway side. To collect the card information but not charge it right away, you'll need to use your payment gateway's vault function. That's doable but isn't how CartThrob single-purchases work out of the box; it just charges the card immediately at checkout.

An interesting thing is that CartThrob Subscriptions does use the gateway vault and allows making arbitrary single charges. You might be able to use CT subscriptions for this and make a fake $0-plan to just get the card number in the vault and then charge them later.

Or, the cleaner solution would be a custom payment gateway for CT. That would be pretty straightforward to make and would store the cards in the payment vault. You could combine that with a module or some other backend UI to mass-charge a whole bunch of people at shipping, or one at a time if they don't all go out together.

Feel free to submit a support request if you'd like us to help with that!
> 0 votes

---
Tags: cartthrob
---


# Question
Title: DevDemon Forms can't get any conditionals to work
I'm desperate. I've purchased Forms several times for different clients, and recently upgraded to a developer license since it provides such great functionality for us. I've come up against a problem and emailed their support twice about, with no answer (plus a third time about something unrelated, and no answer to that either....)

My newest client needs conditional logic on their form, and no matter what I try, I cannot get them to work. I am using the Forms fieldtype for a channel. The form shows up correctly, I can make edits to it as needed, I have {exp:forms:output\_js} being called in successfully for other forms on the same site (with no conditionals).

EE version 2.10.2, Forms version 3.5.3

I have a checkbox question of: "What times are you available to volunteer?" with the checkboxes / values of:

* All day / all-day
* Morning shift / morning-shift
* Afternoon shift / afternoon-shift

If, and only if, "All Day" is selected, I have a follow up checkbox question ("If you are available all day, which authors would you be interested in assisting?") that I would like to show up. I've turned conditionals "on" for this question, and selected:

**Show** this field if **any** of the following match:

Field: **What times are you available to volunteer?**

Conditional: **is**

Value: **all-day**

Doesn't work. I've tried all sorts of changes: switching from "show" logic to "hide" logic, using numerical values instead of alpha, with spaces, without spaces, with dashes, without dashes, radio buttons instead of checkboxes, etc. I've deleted the form, recreated the form, cleared cache, tried on other forms, etc.

I'm at a complete loss - if I can't get conditionals working, I'm going to have to request a refund and find another solution (which I want to avoid, I love everything else about this plugin!)

# Answer
> 0 votes
Have you got queue javascript in the form tag

```
 {exp:forms:form form_name="your_form" queue_js="yes"}

```

My conditionals never work without that in there. If you do have it in there its probably a javascript conflict

---
Tags: conditionals, forms, devdemon
---


title: Problem with date/time setting

text:
# Question
Title: Problem with date/time setting
So I have ExpressionEngine Core Core v2.10.1 - Build Date: 20150501 installed and under localisation I have set to see 24 hour default time formatting and to include seconds in the default time format, but when I go to list of entries, that setting is not applied. I still see AM/PM time and also when I go in the entry and want to change time of publishing for some entry I get an error: "This form has expired. Please refresh and try again." I did put in config.php $config\['disable\_csrf\_protection'\] = "y"; but it did not help.

# Answer
You need to change the date formatting options for your members (in this case, I suppose, the Superadmin) as well.
> 0 votes

# Answer
You can change the localization preferences for all members by setting the following config variable:

```
$config['allow_member_localization'] = 'n';

```

EE will then use the fallback include\_seconds config variable. I had a similar issue and added the following code to my config.php to solve it:

```
$config['include_seconds'] = 'y';
$config['allow_member_localization'] = 'n';

```
> 0 votes

---
Tags: date, config, date-format, entry-date, edit-date
---


# Question
Title: Can't upload EPS files in File Manager in ExpressionEngine 2.10.2
I am able to upload PDF, TXT, SQL, AI, XLSX, JPG, PNG files using the File Manager as a Super Admin. However, when I try to upload an EPS file, I get a "File not Allowed" error. Mime file has 'application/postscript', // .ai, .eps, .ps in the white list.

-- Does anyone else have any ideas? I have now tried installations of EE versions 1.6.8, 2.1.0, 2.7.0 and they load EPS files with no problems. There seems to be a problem uploading EPS files when I try EE 2.10.2, 3.0.6, 3.1.2. I wonder if it has something to do with the new Mime Types file from 2.10 onward? --

Thanks!

# Answer
Depending on version, creation software used, possibly OS, and a whole host of other variables, the actual mime-type of a file can vary. Some quick research show me that an EPS file may represent as these mime types:

```
application/postscript
application/eps
application/x-eps
image/eps
image/x-eps

```

I would try adding these mime types one-by-one to your white-list array and hopefully one will cover it. Make sure to remove the ones that didn't work after.
> 0 votes

---
Tags: file-uploads
---


title: ProForm not showing any fields

text:
# Question
Title: ProForm not showing any fields
I'm using ProForm and just upgraded from 1.64 to 1.73. (Running EE 2.10.1.) Since the ProForm upgrade, none of my (visible) form fields show up. The labels for them appear, but absolutely no HTML for the fields themselves.

The hidden fields (including some custom ones) show up fine in the source.

We're using the simple form tag, so it shouldn't be a template issue.

Any ideas on what's going on?

# Answer
After testing some new fields (which worked) and comparing their MySQL data with that of the problem fields, I found that setting the MySQL field to 'NULL' in the proform\_form\_fields table made the fields work again. This unfortunately only worked for text fields - list fields (such as dropdowns) still did not work, but I was able to fix them by changing the "Style" properties to another type, saving the field, then changing the Style back to the desired format.

It appears upgrading from ProForm 1.63 didn't update the database the way it should have (might be my fault). However, all is working now. Hopefully this will help someone else if the same issue crops up for them! :)
> 0 votes

---
Tags: ee2
---


title: EE and Store UPS Shipping Canada API

text:
# Question
Title: EE and Store UPS Shipping Canada API
I have a store on EE 2.9.0 with Store UPS shipping.

But I cannot reach Domestic Ground when the user has to choose his shipping mode. I'm in Canada and need to ship in Canada but it looks like the extension is created for USA.

In the file on the extension I had:

```
    '03' => 'Domestic Ground',
    '12' => 'Domestic 3 Day Select',
    '01' => 'Domestic Next Day Air',
    '14' => 'Domestic Next Day Air Early AM',
    '13' => 'Domestic Next Day Air Saver',
    '02' => 'Domestic Second Day Air',
    '59' => 'Domestic Second Day Air AM',
    '11' => 'International Standard',
    '65' => 'International Saver',
    '07' => 'International Worldwide Express',
    '54' => 'International Worldwide Express Plus',
    '08' => 'International Worldwide Expedited',

```

But I talked with UPS Canada and they said Domestic Ground number 20

Has anybody the same problem before?

# Answer
> 0 votes
The UPS gateway is indeed for the US. You should be able to copy the plugin files and then update the service codes along with the API end points to match UPS Canada. If you need to have both the UPS US and Canada version live you would also need to change the namespacing accordingly

---
Tags: expresso-store, ups-shipping
---


# Question
Title: Expresso store with a Pay Trace gateway?
We built site with Expresso store - client came back with a Pay Trace gateway. Anyone connected these? Ideas?

# Answer
Based on Expresso's payment gateway docs (As of Feb. 1), you won't see any Pay Trace payment gateway.

Although, Expresso payment processing is based on Omnipay. And if you try to visit their docs, you'll see that they now support Pay Trace gateway maintained by Oleg Ilyushyn.

Maybe Expresso's docs aren't updated? Or maybe Expresso's Omnipay build is not the latest version? I'm not really sure. But If Expresso's Omnipay doesn't support Pay Trace, you might want to use the latest Omnipay separately from Expresso.
> 0 votes

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


# Question
Title: Expresso Store v2.5.1 and EE v2.8.1, WorldPay doesn't redirect after successful order?
For some reason after a successful test order I am not being redirected back to the site after paying via WorldPay.

I have made sure that the settings tally up and are correct as per the docs here: https://www.exp-resso.com/docs/payment\_gateways.html#worldpay

I have also checked the return URL is correct and even tried making it an absolute link, but again no luck.

I have also tried disabling secure forms via the config file using the below as v2.8.1 doesn't have the option to turn off secure forms now: $config\['disable\_csrf\_protection'\] = 'y';

The orders are successful as I can see them in the CP afterwards, it also works when registering a new member, but again doesn't redirect.

Another small issue I have, which may or may not be related, is the Freemember logout link gives an error regarding not being authorized, see below: "You are not authorized to perform this action"

Any ideas before I resort to trying an EE upgrade to v2.9.3 would be helpful please? Ideally I'd rather not have to update it at this time.

Thanks in advance!

EDIT: Latest update

After updating EE to v2.10.2 the issue is still present (no redirection after payment at WP TEST server), orders go through successfully and are added to the CP as status 'new'.

I am now receiving error emails from WP to see what's happening, I get the following:

Error reported: Callback to http://www.example.com/?ACT=39&H=9daf75637f356b4deff064a7aa93333e: NOT OK, recevied HTTP status: 302

And the response attachement shows the following:

HTTP/1.1 302 Moved Temporarily Server: nginx Date: Mon, 01 Feb 2016 11:03:37 GMT Content-Type: text/html Content-Length: 0 Connection: close X-Powered-By: PHP/5.4.45 Set-Cookie: exp\_last\_visit=1138964616; expires=Tue, 31-Jan-2017 11:03:36 GMT; path=/; httponly Set-Cookie: exp\_last\_activity=1454324616; expires=Tue, 31-Jan-2017 11:03:36 GMT; path=/; httponly Set-Cookie: exp\_csrf\_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; httponly Set-Cookie: exp\_csrf\_token=1afab38559e3fdd5f89351e6bae32f562a49b981; expires=Mon, 01-Feb-2016 13:03:36 GMT; path=/; httponly Location: http://www.example.com/shop/order/2defc3fdfcc028fc36a4c1b3e3607ec9 X-Powered-By: PleskLin MS-Author-Via: DAV

I'm not sure what any of this means as I haven't experienced this type of issue/error before.

Any ideas please anyone?

# Answer
> 0 votes
It turns out that trying to use radio buttons to choose a payment method was the cause of the issue here, which I'm still not 100% sure why. I was allowing a choice bewteen 'Manual' for invoice based payment and 'WorldPay' for online payment.

So changing over to the default method of using the select box field, as below, seemed to make the difference:

{payment\_method\_options}

The checkout process now works fine, phew!

# Answer
> 1 votes
WorldPay's hosted payment confirmation pages (successful or unsuccessful) won't automatically redirect back to the EE Store order confirmation page under your own domain, if the callback (Payment Response) is unsuccessful.

If your orders are appearing as Order Status *New* in *EE : Store : Orders*, the callback should be working OK, but if they're marked *Incomplete*, the callback is failing (a problem I had). WorldPay's CP can be configured for an error email to be sent in this case: *Payment Response failure email address*. See WorldPay documentation.

In the past for another shopping cart, I've needed to hardcode into WorldPay's *ResultY.html* and *ResultC.html* files a return link variable, either as a meta refresh tag or anchor. I don't know if this is required in this case.

Here are the WorldPay settings that work for me:

* Payment Response URL: `<wpdisplay item=MC_callback>`
* Payment Response enabled? *tick*
* Shopper Redirect URL *(blank)*
* Shopper Redirect button enabled? *(blank)*
* Enable Recurring Payment Response *(blank)*
* Enable the Shopper Response: *tick*
* Suspension of Payment Response *(blank)*
* Payment Response failure email address: *(your email)*
* Attach HTTP(s) Payment Message to the failure email? *tick*
* Merchant receipt email address: *(blank)*
* Enable Mobile Pages? *(blank)*
* No Worldpay Header enabled? *(blank)*
* Remove Breadcrumb? *(blank)*
* Info servlet password *(blank)*
* Payment Response password: *enter and confirm pwd also in Store settings*
* MD5 secret for transactions: *enter and confirm pwd also in Store settings*
* SignatureFields: *(blank)*

---
Tags: expresso-store, payment-gateway, worldpay
---


# Question
Title: independent gallery not related to an entry
We are using channel-images for all our websites, but facing one big questions which always comes up.

A gallery is always created per entry, also folder of the gallery is named by the ID of the entry.

Our wish would be to create independent galleries, folder not named by id, but rather by the name of the gallery. afterwards, galleries are linked like relationships to entries. so one gallery can be linked to multiple entries, instead of creating the gallery again.

anybody in here stubmbled over that usecase we would like to have? if yes, how did you solved it or did we overlook some feature in channel images?

Best, Thomas

# Answer
> 0 votes
It's been a long time since I used Channel Images, but from your description it sounds like your scenario and issue is that each gallery is assigned to a content page entry...?

Why not have a "galleries" channel, then each entry is named as you would want the gallery. You then have all the images associated with that gallery entry. Within the content entries, you have a relationship field linked to the galleries channel - which obviously lists the nice name of each gallery. Then you can select multiple content entries with the same gallery without duplication. Your template tags access the channel images via the relationship field tag instead of directly.

---
Tags: channel-images
---


title: Playa: Complex, nested and filtered

text:
# Question
Title: Playa: Complex, nested and filtered
EE 2.10.1 Playa 4.5.2 Stash 2.6.7

I'm building out a particularly complex single entry page and can't seem to wrap my head around how to approach what needs to be done.

I have a **Trips** channel with two playa fields **Related Outpost** and **Related Activity**. On the individual trip page I need to list all trips that are in the same outpost (reverse relationship) and sort them by Activity.

So Trip A takes place at the Green Outpost. I need to show all trips that also take place at the Green Outpost and then sort/filter like this:

**Rafting (activity)**

* trip a
* trip b
* trip c

**Hiking (activity)**

* trip d
* trip e

I know it's not possible to filter/search by a playa field natively, but would this be possible using Stash and if so, where would I start with this?

Currently I have the following, stripped down template, where I suspect that each Activity (Rafting etc) would be an embed

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

        {trip_outpost}<h2 class="text-center trip-outpost">{title}</h2>{/trip_outpost}

    <h3>Rafting</h3>
        <div class="trip">
            <h4>Trip Title</h4>
            Trip Details Here
        </div>

        <div class="trip">
            <h4>Trip Title</h4>
            Trip Details Here
        </div>

        <div class="trip">
            <h4>Trip Title</h4>
            Trip Details Here
        </div>

    <h3>Hiking</h3>
        <div class="trip">
            <h4>Trip Title</h4>
            Trip Details Here
        </div>

        <div class="trip">
            <h4>Trip Title</h4>
            Trip Details Here
        </div>

{/exp:channel:entries}

```

# Answer
You could use `{exp:playa:coparents}` to list other parent entries (trips) that share the same child (outpost). Then within that loop, list the activity associated with each trip (I'm assuming you have the field set to only select one activity); we'll capture the related trips as a Stash list, and also create a second list of all the activities in the related trips.

Then we need to loop over the unique activities in the list and output trips that match each activity. We can do that with a nested Stash get\_list:

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

    {exp:stash:set_list name="trips" parse="yes" parse_depth="3"}
        {exp:playa:coparents field="trip_outpost" var_prefix="trip"}
            {stash:title}{trip:title}{/stash:title}
            {stash:activity}@{exp:playa:children entry_id="{trip:entry_id}" field="trip_activity" var_prefix="activity"}{exp:stash:append_list name="activities"}{stash:activity}{activity:title}{/stash:activity}{/exp:stash:append_list}{activity:title}@{/exp:playa:children}{/stash:activity}
        {/exp:playa:coparents}
    {exp:stash:set_list}

{/exp:channel:entries}

{exp:stash:get_list name="activities" unique="activity" process="end"}
    <h3>{activity}</h3>
    <ul>
    {exp:stash:get_list:trips name="trips" match="#\Q@{activity}@\E#" against="activity" prefix="trip"}
        <li>{trip:title}</li>
    {/exp:stash:get_list:trips}
    </ul>
{/exp:stash:get_list}

```
> 1 votes

---
Tags: playa, stash, relationships
---


# Question
Title: Store : Update order status on checkout submit
I want to update the status of an order to **processing** once the checkout form has been submitted.

Looking through the dev docs: https://www.expresso.com/docs/extension\_hooks.html

One of these two hooks fit the bill:

* store\_payment\_request\_start
* store\_payment\_request\_end

These are called when the order is processed by a payment provider - however, if I use a discount code for 100% off (ie, a free order) then these hooks aren't called (which does makes sense to me - I'm assuming the order isn't pinged to the payment provider as there is no payment to make).

Anyway, I can't see any further hooks that I can use to accomplish this status change, is anyone aware of way I can change the order status on a checkout submission?

# Answer
Are you looking for an iterim order status between being marked as 'New' when the user comes back from the payment gateway after a successful payment?

Otherwise in the Store settings there are 'Order Statuses' with the default being 'New' once an order has been processed/submitted, but theres no reason why you can't add a new default status of 'Processing' instead. Then you could have another status of 'Shipped' so you can assign that status when a particular order has been sent out.

If you have any existing orders you might not be able edit the default 'New' status as it's already assigned to those orders.

Hope that helps.
> 0 votes

---
Tags: expresso-store, status, orders
---


# Question
Title: CartThrob v2.3.2 - How to set up free shipping on orders over £x after any discount has been subtracted?
I'm using CartThrob v2.3.2 on a site where the client would like to have free shipping on orders over £50 which is easily setup in the shipping options.

However, when a customer uses a coupon code or discount it can bring the order total below £50 but the shipping remains free.

So how can I set it up so that the free shipping is only applied after any discounts have been subtracted from the order total?

# Answer
> 0 votes
The best way to do this would be with a custom shipping plugin. You can copy the existing one and update the logic to look for the post-discount total.

1. Copy `Cartthrob_discount_free_shipping_over_x.php`and call it `Cartthrob_discount_free_shipping_over_x_after_discount.php`.
2. Rename `Cartthrob_discount_free_shipping_over_x` class to `Cartthrob_discount_free_shipping_over_x_after_discount`.
3. Change `$title` to `Free Shipping Over X After Discount`.

Then, change the following code:

```
if ($this->core->cart->subtotal() >= $this->core->sanitize_number($this->plugin_settings('order_over')))

```

to

```
if (($this->core->cart->subtotal() - $this->core->cart->discount()) >= $this->core->sanitize_number($this->plugin_settings('order_over')))

```

Feel free to let us know if you need help with that!

---
Tags: ee2, cartthrob, shipping, discounts, coupon-code
---


# Question
Title: File upload not working in expressionengine 2.10.0
i just got expression engine 2.10.0 and i made a channel with a file upload field, when i try to upload file i click on `Add File> Upload File> Brows`, after selecting my file when i click on `upload file` it does nothing and just waiting. i checked in browser developer area in `net> Html` tab i have this message:

```
Reload the page to get source for: mysite.com/system/index.php?/cp/content_files_modal/upload_file&S=1301649de23f656ed526f3d407847484

```

all permissions are right and upload destination is ok. any suggestion what could it be??

# Answer
I had a similar issue recently when PHP was reconfigured. It turned out PHP's fileinfo extension wasn't enabled. Fixing that fixed the upload problem I was having. Might at least be something to check on in your case too.
> 1 votes

# Answer
I'm one of the developers at EllisLab and I just tried uploading a file on a 2.10.0 install of mine and had no issues. Have you tried disabling extensions?
> 0 votes

---
Tags: file-uploads, ee2-upgrades, file-manager, ee, uploads
---


title: best setup for a 1M entries EE site?

text:
# Question
Title: best setup for a 1M entries EE site?
I have a EE site that has 62k entries. It's a directory site using open data sets. We are expanding to more countries and we expect at least 500k entries to be added in the next year and 400k plus on 2017.

I've being working with EE for years now. I read already this, and this (Looks like zocalo newspaper has 1M entries or so).

In your opinion; What's the best approch for that # of entries, categories and channels?

**Setup 1**

One EE install. We have 10 countries. Each country has between 20-50 channels. Each channel has 30-600 categories. Each country shares a unique custom field group between all channels with about 60 custom fields. Potential entries: 1M. What about using a SQL Cloud service like google or rackspace? that will help?

**Setup 2**

We have 10 different EE installs in different directories in same domain (domain.com/es, domain.com/de, etc). Problems: not sharing templates, not sharing user credentials, etc. Potential entries: 100k per EE install.

**Setup 3**

Will MSM help? Why? As far as i know; all the information will be at the same db as in setup 1, am I wrong? Is it possible to define each msm license to a directory, or only to a different domain or subdomain?

Thanks in advance,

Sorry for my english; it's not my primary language.

# Answer
My suggestion would be to use services such as AWS. You would utilise RDS managed MYSQL services, Amazon S3 (Cloud based file storage), EC2 instances, auto scaling groups and a load balancer.

I know that there are plugins available to utilise Amazon S3 for Expression Engine, although it has been a while in all honesty since I have even installed Expression Engine, so I wouldn't be able to help you on that front. I'm positive a simple google will find it.

You would create a fully configured server in an EC2 instance and image it, this would allow you to effectively build the web server and deploy the application once, then clone it an unlimited amount of times in just minutes.

Ideally in order to keep costs low and make sure you have both an efficient and scalable environment you would design an autoscaling group. This would allow you to define triggers to enable the environment to scale from 1 server during low traffic to hundreds if your heart so desired.

This is a very rough overview of the process and resources that i would use in your situation. In my corporate environment we have very resource intensive web application which has periodic spike throughout the day, dependent on media coverage etc.

If you have any questions please don't hesitate to ask.
> 1 votes

# Answer
> What about using an SQL Cloud service like google or rackspace? Will that help?

It's not so much the size of the db, I think, as the expected traffic. You will certainly have to consider you hosting options carefully. Not all hosts are created equal ...

I certainly wouldn't want to install EE 10 times. Licensing costs apart, it'd be a monstrous task to maintain, no (simple) asset sharing between sites, etc.

Will MSM help? I think it might be an option worth considering. Yes, everything would be in the same database, but you could still have "separate" sites, if you will: separate URLs, separate editorial staff, etc. It would probably make things easier down the road. Each MSM site gives you a new site, and it's up to you how to access it: this could be a different (sub)domain or a separate part (like a subdirectory) of an existing site. In either case it would be trivial to map, say, example.com/de to de.example.com.
> 1 votes

---
Tags: channel-entries, multi-site-manager, database, loading-time
---


title: Unable to load the Chart Data via AJAX

text:
# Question
Title: Unable to load the Chart Data via AJAX
I just installed the Solspace Tracker module in my ExpressionEngine installation (v2.7.0), and I am getting the following error on my publish page:

> Unable to load the Chart Data via AJAX

I have deleted and reinstalled the themes folder, but I am still getting this error. Does anyone have any suggestions?

# Answer
> 0 votes
Can you give me an update if this issue has been solved?

I get "Unable to load the Chart Data via AJAX" in EE CMS as well when trying to get tracking information older than 3 months. My client wants to see "Most read articles this year" but it tracks down to 3 months ago.

Best regards,

Harold Kuiper

---
Tags: solspace, solspace-tracker
---


# Question
Title: How to build a "featured content" system?
I want to provide a way for content managers to easily select and unselect "Featured Content" (choosing from existing entries) on our EE site. This content would come from about four channels, all of which use the same field group.

The field group contains a "File" field which is used to add an image to the entry. Not all entries have an image, but only entries with images are eligible for "Featured Content."

Ideally, we'll also be able to set a minimum and maximum number of featured entries.

I thought about setting up a "Featured Content" channel, and adding a single "Featured Content" entry to it, using a multi-select Relationships field to add or remove featured entries. However, this does not limit entries to only those containing images, rendering the system cumbersome (as managers would have to check entries individually for images before featuring them) and prone to error (in case they don't do so carefully enough.) I'm willing to look into this further if anyone knows how to work around this limitation.

The second thought I had was to somehow use a Channel Form to do the job. The idea would be to use a Channel Entries tag to pull in recent entries that contain images, display enough information about them for managers to decide what to feature, and add a checkbox beside each one to feature or un-feature it. While this obviously addresses the "must contain image" requirement, I'm not sure how to handle almost anything else about the system. How would they actually be set as "Featured?" How could we enforce the minimum and maximum featured entries? Can a Channel Entries tag even be nested within a Channel Form? Etc.

We're also open to other possibilities not yet explored (including PHP in templates or even stepping outside of EE if necessary - although obviously not preferred.)

I'm working on this at the moment and will answer this question myself if I find a solution. Otherwise, I'd very much appreciate any other answers the community can provide!

# Answer
Well, it took a bit of effort, but building from sheferd's comments, I was able to create a really nice little system. Here are the features:

* Separate lists of entries available to feature, and currently-featured entries
* Uses Channel Entries tag to build the list of featureable entries, meaning any criteria that can be used in the tag can be applied to what can be featured.
* Includes a single button to feature or un-feature each entry.

It does NOT limit the number of featured entries.

The page loads kind of slowly, but it works and is very easy to use. Just set up a checkbox field for "Featured" and give it a value of "Yes." Here's some skeleton code, which will obviously need to be modified to match whatever fields it's supposed to work with:

```
<div class="col-md-6">
    <h2>Available to Feature:</h2>
    {exp:channel:entries channel="foo|bar" search:featured="not Yes" search:image_field="not IS_EMPTY" limit="10" cache="yes" refresh="1440" orderby="date" disable="categories|member_data"}
        {snp-pagination}
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td valign="top">
                    <a href="{url_title}"><img src="{image_field}" width="120" /></a>
                    <div>
                        {exp:channel:form channel="{channel_short_name}" entry_id="{entry_id}" include_jquery="no" return="same/page"}
                            <input type="hidden" name="featured" value="Yes" />
                            <center><input type="submit" name="submit" value="Set Featured"></center>
                        {/exp:channel:form}
                    </div>
                </td>
                <td valign="top">
                    <h4>
                        <a href="{url_title}">{title}</a>
                        <span class="small">
                            By {author}
                        </span>
                    </h4>
                    {exp:ce_str:ing trim truncate='350|…' remove_tags_except='a'}{content}{/exp:ce_str:ing}
                    <br /><div class="label label-default">{channel}</div> <div class="label label-default">{entry_date format="%F %d, %Y"}</div>
                </td>
            </tr>
        </table>
    {/exp:channel:entries}
</div>

<div class="col-md-6">
    <h2>Current Features:</h2>
    {exp:channel:entries channel="foo|bar" search:featured="=Yes" limit="10" cache="yes" refresh="1440" orderby="date" disable="categories|member_data"}
    <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="top">
                <a href="{url_title}"><img src="{image_field}" width="120" /></a>
                <div>
                    {exp:channel:form channel="{channel_short_name}" entry_id="{entry_id}" include_jquery="no" return="same/page"}
                        <input type="hidden" name="featured" value="" />
                        <center><input type="submit" name="submit" value="Un-Feature"></center>
                    {/exp:channel:form}
                </div>
            </td>
            <td valign="top">
                <h4>
                    <a href="{url_title}">{title}</a>
                    <span class="small">
                        By {author}
                    </span>
                </h4>
                {exp:ce_str:ing trim truncate='350|…' remove_tags_except='a'}{content}{/exp:ce_str:ing}
                <br /><div class="label label-default">{channel}</div> <div class="label label-default">{entry_date format="%F %d, %Y"}</div>
            </td>
        </tr>
    </table>
    {/exp:channel:entries}
</div>

```
> 1 votes

# Answer
Have a field (checkbox or anything) called 'featured', if you want an entry Featured check the box. the feature template would then look for any entry that had that field checked AND had an image (though presumably you'd have added an image if you wanted it featured).

Alternatively create an entry specific for home page content, with a field group for home page areas (specifically the feature area in this case), and make a relationships field (or fields) then when ever you want to update the feature you go to one entry (the home one) instead of each of the entries that you want featured. down side of this is you can't filter for entries with images. to get around this have a generic image that is used if no image is found.
> 2 votes

---
Tags: ee2, channel-entries, safecracker
---


# Question
Title: How can I uninstall demo templates of User module (Solspace)?
I have installed the demo templates just to have a look at each template and what it delivers at the frontend.

But for my site, I do not want all these pages to be available to the user. There seems to be no option of uninstalling these demo templates. I uninstalled the user module and reinstalled it ( I didn't installed the demo templates again) but the demo templates are still showing up those user pages.

Any suggestions welcome.

Thanks in advance.

# Answer
> 1 votes
Do as Jim recommended. You can just delete them. If you want to keep them just move them to a different template group and set those templates to redirect to 404 for everyone. Only superadmins will be able to view them after that. For reference (EE 2 docs):

https://docs.expressionengine.com/v2/cp/design/templates/template\_preferences\_manager.html#modify-preferences-and-access

---
Tags: solspace-user
---


title: Help with date conditionals

text:
# Question
Title: Help with date conditionals
Need help to get this to work:

```
{if {current_time} >= {exp:str_to_time date="November 6th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="January 7th, {current_time format='%Y'}"}}
6 Jan

{if:elseif {current_time} >= {exp:str_to_time date="January 6th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="February 21st, {current_time format='%Y'}"}}
20 Feb

{if:elseif {current_time} >= {exp:str_to_time date="February 20th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="March 28th, {current_time format='%Y'}"}}
27 Mar

{if:elseif {current_time} >= {exp:str_to_time date="March 27th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="May 16th, {current_time format='%Y'}"}}
15 May

{if:elseif {current_time} >= {exp:str_to_time date="May 15th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="August 4th, {current_time format='%Y'}"}}
3 Aug

{if:elseif {current_time} >= {exp:str_to_time date="August 3rd, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="September 12th, {current_time format='%Y'}"}}
11 Sept

{if:elseif {current_time} >= {exp:str_to_time date="September 11th, {current_time format='%Y'}"} && {current_time} <= {exp:str_to_time date="November 7th, {current_time format='%Y'}"}}
6 Nov
{/if}

```

# Answer
> 0 votes
You'll need to quote all of your plugin-generated variables inside your conditionals and remove the braces from `current_time`.

Also, I don't think you need all the `elseif` conditions - you should be able to do this with a series of `if` statements since they are all mutually-exclusive - that will read a little cleaner.

```
{if current_time >= '{exp:str_to_time date="November 6th, {current_time format='%Y'}"}'
    && current_time <= '{exp:str_to_time date="January 7th, {current_time format='%Y'}"}'}
        6 Jan
{/if}

{if current_time >= '{exp:str_to_time date="January 6th, {current_time format='%Y'}"}'
    && current_time <= '{exp:str_to_time date="February 21st, {current_time format='%Y'}"}'}
        20 Feb
{/if}

```

Etc.

# Answer
> 0 votes
You may need to specify the format you are comparing against.

For example 'current\_time' will look like

```
1454583625

```

so you need to make sure that

```
{exp:str_to_time date="November 6th, {current_time format='%Y'}"}

```

is outputting a number comparable to that

also sometimes I find wrapping my variables in quotes makes them work when they otherwise wouldn't

```
{if "{current_time}" >= "{exp:str_to_time date='November 6th, {current_time format='%Y'}'}" && "{current_time}" <= "{exp:str_to_time date='January 7th, {current_time format="%Y"}'}"}

```

you may also need to bracket your if statmnt

```
{if ("{current_time}" >= "{exp:str_to_time date='November 6th, {current_time format='%Y'}'}") && ("{current_time}" <= "{exp:str_to_time date='January 7th, {current_time format="%Y"}'}")}

```

also try

```
 {if ("{current_time}" >= "{exp:str_to_time date='November 6th, {current_time format='%Y'}'}") AND ("{current_time}" <= "{exp:str_to_time date='January 7th, {current_time format="%Y"}'}")}

```

but also conditions can be a little finicky with variables inside them so there is a plugin I use called ifElse on devotee

you may also find switchee helpful as it takes conditionals case by case, istead of checking EVERY if statment.

**BUT** also if your date is 'hardcoded' anyway could you not just make a timestring of that?

```
{if "{current_time format="%y%m%d"}" >= "{current_time format="%y"}1106"}

```

**Edit Edit** dammit this thread is soo old! why does stack exchange do that - put old threads to the top?

---
Tags: conditionals, date
---


# Question
Title: Matrix Playa MSM limit playa children to once per loop
### I am running

* EE 2.5.2
* Playa 4.3.3
* Matrix 2.4.3

I have a matrix field inside channel entries pair tag. The first column in that matrix is a playa field type. That playa field relates to a matrix on another site that is run by MSM.

This is all generating a table in my template.

### what i have so far

I have successfully pulled the playa children using the following:

`{matrix_field}

 {if plhotel}

 {exp:playa:children site="mysite" field="hotels" limit="1"}
 {hotel-name}
 {/exp:playa:children}

 {/if}
 {other matrix value}
 {other matrix value}

{/matrix_field}`

### my issue

I need for the playa tag to pull one child per row. This is almost certainly an issue with how I've constructed the loop, I'm openly admitting this. I can't seem to prevent the playa loop from displaying all children in the first row. As you'll see I've even tried setting limit="1" in the tag which I almost knew would fail. This produced the same child in all rows of the table (still not correct).

Any advice is appreciated.

# Answer
> 0 votes
Not sure if this will create any parse issues, but here's a restructure for you:

```
{matrix_field}
{if plhotel} <!--playa column-->
{exp:playa:children site="mysite" field="hotels"}
<tr>
    <td>
        {hotel-name} <!--desired playa value-->
    </td>
    <td>
        {other matrix value}
    </td>
    <td>
        {other matrix value}
    </td>
</tr>
{/exp:playa:children}
{/if}

{!-- and if you still need to output something even if not plhotel, just use an if:else and repeat your structure --}

{/matrix_field}

```

I don't have a particular playa/matrix set up in mind I can test the possible parse issues in, so give it a whirl.

---
Tags: matrix, playa, multi-site-manager, loop
---


# Question
Title: Freeform Pro Composer - retain field values on error
I have a form which was built using composer - there is about 12 fields in it and at the minute if completed without a required field or there is an error in the form the form is loaded again blank to complete. What is the best way to retain those values or is it best with some sort of validation?

Form code below:

```
{exp:freeform:composer
    form_name="food_network"
    composer_template_name="food_network"
    return="/foodnetwork/join-us/join-us-thank-you"
    form:class="form-horizontal contact-form"
}
    <div class="ff_composer">
{composer:page}
    {composer:rows}
            <div class="line">
        {composer:columns}
                <div class="unit size1of{composer:column_total}">
                {if composer:field_total == 0}

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

```

# Answer
> 0 votes
Someone raised this issue previously, the answer from Solspace at the time was no. I always submit via Ajax, then I can smoothly show errors, or feedback messages.

Although I stumbled across this question which indicates that values are stored in a {freeform:field:short\_name} tag...? Not tried.

Another Solspace response.

Other solutions: Using JavaScript & PHP \- the issue here is that Freeform posts to an ACT url, not the actual page, so wouldn't be able to use GET or POST back onto the same (return) page.

JQuery Cookie Plugin

localstorage (same link as above, 2nd answer)

JQuery Cookie

But to be honest, it'll be far easier to just use Ajax than any of the above.

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


# Question
Title: Solspace Super Search - Special Characters
How can we make sure that special characters like ä,ö,å would be noticed while searching for content on a webpage. We are getting no results at the moment. I would appreciate any help! Thank you!

# Answer
> 0 votes
Note: I'm the dev of Low Search.

If you look at the comparison table (which I helped set up together with the Solspace team), then you'll see that "Accent-insensitive (diacritics)" -- the special characters you're referring to -- is not supported by Super Search. As far as I'm aware, Low Search is the only search solution in EE that allows for this functionality.

---
Tags: solspace, supersearch
---


# Question
Title: Trying and failing to use stash value as channel entries category parameter
So, apologies I know this has been covered extensively BUT I've been pulling my hair out all day and still don't get why I can't get this to work.

I simply want to use a stash variable set in one channel entries call as a parameter value for categories in a channel entries call later on in the template.

I've set this in stash:

```
{!-- set some parameters --}
{exp:channel:entries channel='super_hub' limit='1'}
    ...
    {!-- set the cfp id --}
    {exp:stash:set name='cfpid'}
        {shub_cfp_category:category_id}
    {/exp:stash:set}

```

Then I'm trying to parse the value in a later channel entries call:

```
{!-- pull in recent CFPs --}
{exp:channel:entries channel='call_for_papers' limit='3' sort="desc" dynamic='no' category="{exp:stash:get name='cfpid'}" parse="inward"}

```

But this either doesn't call the right category entries, or doesn't run at all. I've tried different ways of setting the value and calling the value, and attempted using {exp:stash:parse} as well - all with no luck.

It feels like this is a scope issue, but what puzzles me is that I can display the stash value within the content of the second channel entries, but not use it as a parameter value in the call itself.

This seems like such a simple thing and I'm sure I'm doing something daft here. Please can someone help?

EDIT: thought I fixed it with Mark's help, but I've broken it again. Any inclusion of stash:parse just breaks the whole page. Below is the whole code:

```
{!-- retrieve layout --}
{embed='layouts/.default'}

{!-- set some parameters --}
{exp:channel:entries channel='super_hub' limit='1' parse_depth='2'}

    {!-- set the title --}
    {exp:stash:set name='title'}
        {shub_display_title} |
    {/exp:stash:set}

    {exp:stash:set name='cfpid'}{shub_cfp_category:category_id}{/exp:stash:set}

    {!-- set content --}
    {exp:stash:set name="content"}

        <article>
            <div class="wrapper">

                <header>
                    {!-- Add in display title and associated subtitles --}
                    <h1>{shub_display_title}</h1>
                    {!-- add in sharing buttons --}
                    {cpb_ptl_shr}
                </header>

                <div class="content">
                    <section class="shub">
                        {shub_playa_campaigns}
                            <div class="shubitem{switch=' ie-switch-alpha| ie-switch-beta'}">
                            {exp:switchee variable='{channel_short_name}' parse='inward'}

                                {!-- campaign page --}
                                {case value='campaign_page'}
                                    <div class="item__img">
                                        {if '{campaign_hero_image}' != ''}
                                            {exp:ce_img:single src="{campaign_hero_image}" crop="yes|left,top|0,0"}
                                        {if:else}
                                            {exp:ce_img:single src="/assets/img/bdg/TFO-placeholder-hero.png" crop="yes|left,top|0,0"}
                                        {/if}
                                    </div>
                                    <h3 class="item__header"><a href="{page_url}">CAM {campaign_display_title}</a></h3>
                                    <a href="{page_url}"><div class="item__description">
                                        {exp:ce_str:ing allow_eecode remove_html truncate="200"}{campaign_introductory_copy}{/exp:ce_str:ing}
                                    </div></a>
                                {/case}

                                {!-- hub page --}
                                {case value='hub_page'}
                                    <div class="item__img">
                                        {if '{hub_hero_image}' != ''}{hub_hero_image}<img src="{url}">{/hub_hero_image}{/if}
                                    </div>
                                    <h3 class="item__header"><a href="{page_url}">HUB {hub_display_title}</a></h3>
                                    <a href="{page_url}"><div class="item__description">
                                        {exp:ce_str:ing allow_eecode remove_html truncate="200"}{hub_introductory_copy}{/exp:ce_str:ing}
                                    </div></a>

                                {/case}

                                {!-- listing page --}
                                {case value='listing_page'}
                                    <div class="item__img">
                                        {if '{listing_hero_image}' != ''}{listing_hero_image}<img src="{url}">{/listing_hero_image}{/if}
                                    </div>
                                    <h3 class="item__header"><a href="{page_url}">LIS {listing_display_title}</a></h3>
                                    <a href="{page_url}"><div class="item__description">
                                        {exp:ce_str:ing allow_eecode remove_html truncate="200"}{listing_introductory_copy}{/exp:ce_str:ing}
                                    </div></a>
                                {/case}

                            {/exp:switchee}
                            </div>
                        {/shub_playa_campaigns}
                    </section>
                </div> {!-- /.content --}
                {!-- close channel entries --}
                {/exp:channel:entries}

                {!-- secondary content --}
                <div class="secondary">
                    <!-- CFP feed -->
                    <aside>
                        <h2>Call for papers</h2>

                        <div class="cfp-feed">

                        {!-- pull in recent CFPs --}
                        {exp:channel:entries channel='call_for_papers' limit='3' sort="desc" dynamic='no' category="{exp:stash:get name='cfpid'}" parse="inward"}

                            <div class="cfp-feed__item{switch=' ie-switch-alpha| ie-switch-beta'}">

                                <div class="cfp-feed__item__img">
                                    {exp:playa:children field="cfp_journal"}
                                        <a href="#{entry_id}">
                                        {!-- <img class="cover" src="/uploads/images/journals/covers/{journal_acronym}.jpg" alt="{title}"/> --}
                                        <img src="http://placehold.it/90x120">
                                        </a>
                                    {/exp:playa:children}
                                </div>

                                <div class="cfp-feed__item__description">
                                    <a href="#{entry_id}">{cfp_display_title}</a><br>
                                    <em>{cfp_journal}{title}{if journal_subtitle}: {journal_subtitle}{/if}{/cfp_journal}</em><br>
                                    {if cfp_deadline}<time datetime="{cfp_deadline format="{DATE_W3C}"}">Deadline: {cfp_deadline format="%j %F %Y"}</time><br>{/if}
                                </div>

                            </div>
                        {/exp:channel:entries}

                        </div>

                    </aside>

                    <aside class="subject-profile">
                        <h2>Social Media for this subject</h2>
                        <ul class="iconic">
                            <li><i class="fa fa-facebook fa-2x"></i> <a href="#">Facebook</a></li>
                            <li><i class="fa fa-twitter fa-2x"></i> <a href="#">Twitter</a></li>
                        </ul>
                    </aside>

                    <aside class="promotion">
                        <h2>Sign up to stuff</h2>
                        <ul class="iconic">
                            <li><i class="fa fa-envelope"></i> <a href="#">Link to a bulletin or something</a></li>
                            <li><i class="fa fa-rss"></i> <a href="#">Perhaps an RSS feed?</a></li>
                        </ul>
                    </aside>

                </div> <!-- /.secondary -->

            </div> {!-- /.wrapper --}

        </article>

        <footer>
            <div class="wrapper">
                <!-- {cpb_ptl_pub_date} -->
            </div>
        </footer>

    {/exp:stash:set}

```

# Answer
It's counter-intuitive but EE parses module tags form the outer layer inwards, rather than a block of tags at a time. This is called recursive parsing, or as I like to think of it, peeling an onion:

```
{!-- this tag is parsed first --}
{exp:channel:entries channel='super_hub' limit='1'}

    {!-- this tag is parsed third - set 'cfpid'  --}
    {exp:stash:set name='cfpid'}
        {shub_cfp_category:category_id}
    {/exp:stash:set}

{/exp:channel:entries}

{!-- this tag is parsed second - 'cfpid' does not yet exist --}
{exp:channel:entries
   channel='call_for_papers'
   limit='3' sort="desc"
   dynamic='no'
   category="{exp:stash:get name='cfpid'}"
   parse="inward"
}

   ...

{/exp:channel:entries}

```

First you need to ensure that 'cfpid' has been set before you use it, then you must ensure that the value you capture has no surrounding whitespace. There are two ways to do this in the same template, both of which use `{exp:stash:parse}`:

```
{!-- parse everything inside to a depth of 2 layers --}
{exp:stash:parse parse_depth="2"}
  {exp:channel:entries channel='super_hub' limit='1'}
      {exp:stash:set name='cfpid'}{shub_cfp_category:category_id}{/exp:stash:set}
  {/exp:channel:entries}
{/exp:stash:parse}

{exp:channel:entries
   channel='call_for_papers'
   limit='3' sort="desc"
   dynamic='no'
   category="{exp:stash:get name='cfpid'}"
   parse="inward"
}

   ...

{/exp:channel:entries}

```

Or

```
{exp:channel:entries channel='super_hub' limit='1'}
    {exp:stash:set name='cfpid'}{shub_cfp_category:category_id}{/exp:stash:set}
{/exp:channel:entries}

{!-- delay parsing of this block of tags until the end of parsing --}
{!-- since Stash is doing the parsing, we can use {stash:cfpid} --}
{exp:stash:parse process="end"}
  {exp:channel:entries
     channel='call_for_papers'
     limit='3' sort="desc"
     dynamic='no'
     category="{stash:cfpid}"
  }

     ...

  {/exp:channel:entries}
{/exp:stash:parse}

```
> 0 votes

# Answer
Ah, if shub\_cfp\_category is a relationship field try adding 'parse\_depth="2"' to your stash tag

```
{exp:stash:set name='cfpid' parse_depth='2'}
    {shub_cfp_category:category_id}
{/exp:stash:set}

```

It may not work, but this has definitely caught me out so many times
> 0 votes

# Answer
So I rearranged the code a bit so the parse order made more sense. You all helped in answering this, but Mark helped me understand so I've given him the green hexagon. :) Thanks all!

Here's the working code:

```
{!-- retrieve layout --}
{embed='layouts/.default'}

{!-- set some parameters --}
{exp:channel:entries channel='super_hub' limit='1' parse_depth="2"}

    {!-- set the title --}
    {exp:stash:set name='title'}
        {shub_display_title} |
    {/exp:stash:set}

    {!-- grab the cfp category id --}
    {exp:stash:set name='cfpid'}{shub_cfp_category:category_id}{/exp:stash:set}

{!-- close channel entries --}
{/exp:channel:entries}

{!-- set content --}
{exp:stash:set name="content"}

    {!-- set some parameters --}
    {exp:channel:entries channel='super_hub' limit='1'}
    <article>
        <div class="wrapper">

            <header>
                {!-- Add in display title and associated subtitles --}
                <h1>{shub_display_title}</h1>
                {!-- add in sharing buttons --}
                {cpb_ptl_shr}
            </header>

            <div class="content">
                <section class="shub">
                    {shub_playa_campaigns}
                        <div class="shubitem{switch=' ie-switch-alpha| ie-switch-beta'}">
                        {exp:switchee variable='{channel_short_name}' parse='inward'}

                            {!-- campaign page --}
                            {case value='campaign_page'}
                                <div class="item__img">
                                    {if '{campaign_hero_image}' != ''}
                                        {exp:ce_img:single src="{campaign_hero_image}" crop="yes|left,top|0,0"}
                                    {if:else}
                                        {exp:ce_img:single src="/assets/img/bdg/TFO-placeholder-hero.png" crop="yes|left,top|0,0"}
                                    {/if}
                                </div>
                                <h3 class="item__header"><a href="{page_url}">CAM {campaign_display_title}</a></h3>
                                <a href="{page_url}"><div class="item__description">
                                    {exp:ce_str:ing allow_eecode remove_html truncate="200"}{campaign_introductory_copy}{/exp:ce_str:ing}
                                </div></a>
                            {/case}

                            {!-- hub page --}
                            {case value='hub_page'}
                                <div class="item__img">
                                    {if '{hub_hero_image}' != ''}{hub_hero_image}<img src="{url}">{/hub_hero_image}{/if}
                                </div>
                                <h3 class="item__header"><a href="{page_url}">HUB {hub_display_title}</a></h3>
                                <a href="{page_url}"><div class="item__description">
                                    {exp:ce_str:ing allow_eecode remove_html truncate="200"}{hub_introductory_copy}{/exp:ce_str:ing}
                                </div></a>

                            {/case}

                            {!-- listing page --}
                            {case value='listing_page'}
                                <div class="item__img">
                                    {if '{listing_hero_image}' != ''}{listing_hero_image}<img src="{url}">{/listing_hero_image}{/if}
                                </div>
                                <h3 class="item__header"><a href="{page_url}">LIS {listing_display_title}</a></h3>
                                <a href="{page_url}"><div class="item__description">
                                    {exp:ce_str:ing allow_eecode remove_html truncate="200"}{listing_introductory_copy}{/exp:ce_str:ing}
                                </div></a>
                            {/case}

                        {/exp:switchee}
                        </div>
                    {/shub_playa_campaigns}
                </section>
            </div> {!-- /.content --}
            {!-- close channel entries --}
            {/exp:channel:entries}

            {!-- secondary content --}
            <div class="secondary">
                <!-- CFP feed -->
                <aside>
                    <h2>Call for papers</h2>

                    <div class="cfp-feed">

                        {!-- pull in recent CFPs --}
                        {exp:channel:entries channel='call_for_papers' limit='3' sort="desc" dynamic='no' category="{exp:stash:get name='cfpid'}" parse="inward"}

                            <div class="cfp-feed__item{switch=' ie-switch-alpha| ie-switch-beta'}">

                                <div class="cfp-feed__item__img">
                                    {exp:playa:children field="cfp_journal"}
                                        <a href="#{entry_id}">
                                        {!-- <img class="cover" src="/uploads/images/journals/covers/{journal_acronym}.jpg" alt="{title}"/> --}
                                        <img src="http://placehold.it/90x120">
                                        </a>
                                    {/exp:playa:children}
                                </div>

                                <div class="cfp-feed__item__description">
                                    <a href="#{entry_id}">{cfp_display_title}</a><br>
                                    <em>{cfp_journal}{title}{if journal_subtitle}: {journal_subtitle}{/if}{/cfp_journal}</em><br>
                                    {if cfp_deadline}<time datetime="{cfp_deadline format="{DATE_W3C}"}">Deadline: {cfp_deadline format="%j %F %Y"}</time><br>{/if}
                                </div>

                            </div>

                        {/exp:channel:entries}

                    </div>

                </aside>

                <aside class="subject-profile">
                    <h2>Social Media for this subject</h2>
                    <ul class="iconic">
                        <li><i class="fa fa-facebook fa-2x"></i> <a href="#">Facebook</a></li>
                        <li><i class="fa fa-twitter fa-2x"></i> <a href="#">Twitter</a></li>
                    </ul>
                </aside>

                <aside class="promotion">
                    <h2>Sign up to stuff</h2>
                    <ul class="iconic">
                        <li><i class="fa fa-envelope"></i> <a href="#">Link to a bulletin or something</a></li>
                        <li><i class="fa fa-rss"></i> <a href="#">Perhaps an RSS feed?</a></li>
                    </ul>
                </aside>

            </div> <!-- /.secondary -->

        </div> {!-- /.wrapper --}

    </article>

    <footer>
        <div class="wrapper">
            <!-- {cpb_ptl_pub_date} -->
        </div>
    </footer>

{/exp:stash:set}

```
> 0 votes

---
Tags: channel-entries, categories, stash
---


# Question
Title: Creating different email notifications on CartThrob for different products
Is it possible to create different notifications for different products on CartThrob? I have products I'm selling in a products channel and services which are also offered that's within another channel. I would like the successful transaction of the products to shoot a different email notification than the service purchase, but I can't differentiate the two different orders because there's only "successful transaction" as the trigger. Any help on this would be greatly appreciated! Thanks!

# Answer
(I'm with Vector; we own CartThrob)

There are two ways to do this, depending on how much customization you need:

1. You can use conditionals inside the order notification template. Something like `{if channel_id == '2'}{/if}` (of the purchased item) in the code, and then have different content based on that.
2. For a lot more customization you can turn off the default notifications, and use the post-purchase hook with a custom extension to send your own emails. This way you can run through the purchased items and do whatever you need.

Also, is it possible to order both items at once on your site? If so you'll want to think through what happens then.
> 0 votes

---
Tags: cartthrob, ee
---


# Question
Title: WYGWAM 4 is throwing PHP and Fatal errors on 2.10.3
Today I updated an old site from 2.2.1 to 2.10.3. I attempted to update some Add-Ons but ran into an issue with Wygwam. I downloaded Wygwam 4 from Devotee. Follow the update instructions but ran into errors. The first one below was easily solved as the add-on didn't have this define properly in the package.

This is how the file looks:

> 'wygwam\_module\_name' =\> WYGWAM\_NAME,
>
> 'wygwam\_module\_description' =\> WYGWAM\_DESC,

I got rid of that error.

Next I went to update the module and came down with this error:

> **Fatal error:** Class 'PT\Wygwam\Helper' not found in /home/xxx/xxx.com/system/expressionengine/third\_party/wygwam/upd.wygwam.php on line 27

Any tips on what might be going wrong here? Thanks!

# Answer
> 1 votes
The minimum required EE version for Wygwam 4 is EE 3.1.0, which is why you're getting the errors.

If you need to download an EE 2.x compatible version of Wygwam, you can via Devot:ee like so: https://twitter.com/devot\_ee/status/695657856733990912

---
Tags: pixelandtonic, wygwam
---


# Question
Title: Display Wordpress blog entries inside Expression Engine template?
I have a prospective client whose current site is a combination of HTML pages and a Wordpress news blog. The blog has hundreds of entries and the client wants to leave that in WP rather then attempt to import to EE. Importing would mean a massive amount of tedious manual transfering of data.

So the question is - is it possible to run an EE site that incorporates a WP blog? Can WP run in a subdomain then somehow display WP posts inside an EE template?

I know this is not ideal but this is what they want.

# Answer
Just to add to @jrothafer's answer, this should hopefully sort your import issue:

Data Grab

Article on importing Wordpress site into EE

And I'd have to highlight his statement regarding maintenance - you **have** to keep Wordpress up-to-date otherwise it's a security risk, although it's good to keep EE up-to-date, it's not essential due to it's security and stability. So will increase maintenance and support time/costs.
> 2 votes

# Answer
Well, there are ways to run the two next to each other, or even easier is one inside the other. For example; you create a sub-folder in your main EE installation and run WP in that:

```
ExpressionEngine --> www.domain.com/
WordPress -->        www.domain.com/blog/

```

Your WP site would need to be configured to run the blog roll as it's home page. You'll be able to share CSS and JS assets between the two easily enough, but you'll have to manually update templates in both EE and WP when you make changes you want to match in your global (combined EE+WP) site.

I have personally imported WP posts into an EE channel before. It was a pain in the ass and basically required constructing a bunch of regular expressions to separate out different parts of the WP posts and input them in to corresponding EE entries and fields. It did require some manual review to fix little content issue imports, but it was by-and-large an automated import and not a full manual import. The viability of writing an import script depends on your use cases and also on the consistency of the blog posts.

You could, say, create a channel with matching fields to a WP post (title, url-title, featured image, content (as, say, a Wygwam field)) and just directly import them like that. Again, depending on the blog use-case and consistency, this is possibly viable.

Another possibility is to use the `query` tag to query the WP posts in a special template for the blog. But this is barely scratching the surface of the complexity of creating a template group that scrapes from the WP posts table. But I see this possibly doable. It also depends on how complex the WP blog is (WP posts are flat, or are there all sorts of categories a post could be tagged as? How about file assets?).

Overall, I would personally recommend writing an import script. You say `hundreds of entries`; that's pretty easy to review after a script import. If it were thousands than I'd not consider it.

If import really isn't an option, running WP inside of a sub-folder of the EE web-root is your next best option. It will require a lot more maintenance if the site is to have a global matching theme and header/footer element structure.

Past that, I wouldn't touch it. Why is the client moving to EE if they don't want to utilize it's advantages over WP? And the legacy maintenance of watching a single blog... and I haven't even touched the worst part: are they going to want to write new news blog entries in EE, but still have them mixed with the old WP posts? Not happening (welllll sure, doable, but crazy amount of hours writing a very complex custom module to mix the EE Channels Entries tag with hand-written WP posts reader methods and... oh god, WHY?).

**Edit**

Oh and if you wanted to run WP on a sub-domain and just import rendered views instead of moving the installation to a sub-folder, you can use `mod_proxy`. But this is another rabbit hole; use a sub-folder for this option.
> 1 votes

---
Tags: ee2, templates
---


# Question
Title: Conditionals in Low Seach examples giving php errors
I'm having two PHP Errors while testing a basic Low Search example. The code can be found here.

The errors shows **only while logged in** (afaik as super-admin). I'm using EE 2.8.1. Results are working fine.

> **A PHP Error was encountered**
>
> Severity: User Warning
>
> Message: Invalid EE Conditional Variable: {if low\_search\_category ~ '/\b'.category\_id.'\b/'}
>
> Filename: libraries/Functions.php
>
> Line Number: 2640
>
> **A PHP Error was encountered**
>
> Severity: Warning
>
> Message: Cannot modify header information - headers already sent by (output started at /home/colegios/public\_html/system/codeigniter/system/core/Exceptions.php:170)
>
> Filename: core/Common.php
>
> Line Number: 442

Found this at EE bug; but I don't know how to solve it? Should I upgrade to a newer EE2 version? 2.8.1 is stable for me and I want to avoid problems with others addons.

# Answer
To quote the top of the example page in the Low Search docs:

> **Note**: these examples feature conditionals using the Matches Operator introduced in EE 2.9.0. If you’re using an older version of ExpressionEngine, you can use the IN conditionals instead.

So, either use the IN conditionals and continue using EE 2.8.1, or upgrade EE to v2.10.3, which is the latest v2 version at the moment.
> 2 votes

---
Tags: low-search
---


title: Template Route Regex

text:
# Question
Title: Template Route Regex
What's the syntax for excluding phrases from segments in template routes?

For example, let's say I have a template group called "fruit."

I have a template A with the template route: "/fruit/{fruit:alpha-dash}" and that route matches:

* /fruit/apples
* /fruit/oranges
* /fruit/tomatoes

But I'd like to exclude just tomatoes from using template A so that it can match template B which is the next sequential template.

What would the regex look like to exclude tomatoes?

# Answer
> 0 votes
There is a top-down order for how template routes are processed. So what you need to do is create your `tomato` route rule, and make sure it is **above** your regular `alpha_dash` rule. I couldn't find a simple solution for ignoring specific segments in a regex rule using the carat and didn't bother testing further; EE would yell at me for using some regex modifiers and such. The other way around was easier. Here's what worked for me in your example.

This is an example of a couple of rules in your `My site -> CP Home -> Design -> Template Manager -> Template Route Manager` that works for your exmample:

```
Group     Template          Route                            Segment Req
-------------------------------------------------------------------------
fruit     special_fruit     /fruit/{fruit:regex[(tomato)]}   Yes
fruit     regular_fruit     /fruit/{fruit:alpha_dash}        Yes

```

This will match `/fruit/tomato` to your `special_fruit` template. When that doesn't match (say `/fruit/apples`), it tries the next rule and will match and render your `regular_fruit` template.

---
Tags: template-routes, regex
---


# Question
Title: Exp:resso Store Send Order Emails To Different Email Addresses
Is it possible to supply dynamic BCC's on Exp:resso store order confirmation emails?

I have an ecommerce site that tutors can list courses on, and students can buy courses. When a course is purchased the student gets an email, but I need to notify the tutor too (which is an EE member).

I have got as far as writing an extension that taps into **store\_order\_complete\_end**, which means I have access to the **Store\Model\Order** and **Store\Model\Email** objects... but I'm not sure what to do from there. Thanks.

# Answer
> 1 votes
Oh it appears it is very straightforward. So in the extension grab the store emails (I'm just getting all for development) then you can set the BCC attribute as per below.

```
$emails = Store\Model\Email::whereIn('id', [1])->where('enabled', 1)->get();
foreach ($emails as $email) {
    # For my IDE
    $email instanceof Store\Model\Email;
    $email->setAttribute("bcc", "myaddress@mydomain.com");
    $sent = ee()->store->email->send($email, $order);
}

```

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


title: Freeform Pro - display reqired fields

text:
# Question
Title: Freeform Pro - display reqired fields
In Freeform I use the loop to display all my fields:

```
{freeform:all_form_fields}
    <dt>
        <label>{freeform:field_label}</label>
    </dt>
    <dd>
        <!-- place holder for ajax errors-->
        <div class="error_message"></div>
        {freeform:field_output}
    </dd>
{/freeform:all_form_fields}

```

how can I display an asterix beside fields which are required? Form called and required fields displayed like:

```
{exp:freeform:form
    form:id="ajax_form"
    form:class="form-horizontal"
    form_name="enq_form"
    required="business_name|business_category|contact_person|email_address"
    }

```

# Answer
> 0 votes
You've hard-coded the required fields in the template by including them in the template tag, so why not hard code it in your loop?

```
<label>
    {freeform:field_label}
    {if freeform:field_name == "business_name"
        || freeform:field_name == "business_category"
        || freeform:field_name == "contact_person"
        || freeform:field_name == "email_address"}
        <span class="required">*</span>
    {/if}
</label>

```

I didn't say it was a great solution! In the docs there's no mention of freeform:field\_required variable :(

I'd strongly recommend you use the Composer though - especially as you have the Pro version. It is really great, and you can create a template that is fully flexible for any type of form your editor/admin wants to create. And it has a variable to detect if a field is required. So nothing is hard coded in the template! See an example here, or you want more example code, raise another question.

---
Tags: solspace-freeform
---


# Question
Title: {member_group} not working in conditional
I have the following code:

```
{exp:member:custom_profile_data}
        <div class="profile">
            {member_group}
            {if member_group == "Super Admins"}You are a Super Admin{/if}
        </div>
{/exp:member:custom_profile_data}

```

Member group is being displayed correctly, but it doesn't work in conditional. I would appreciate if anyone can explain what I'm doing wrong or how else to add a member group specific content.

# Answer
OK I've figured it out, so {member\_group} displays the name of the member group, but placed in conditional it requires an ID of the member group. Works now!
> 0 votes

---
Tags: templates, members, conditionals
---


title: How to secure uploaded files

text:
# Question
Title: How to secure uploaded files
I'm looking for the best way to secure files uploaded via a front-end form into a standard *File* field.

I need users to be able to upload a file, but I only want members of certain member groups to be able to access those files from the control panel. I also need the files to not be generally accessible from the front end.

1. Can I put an upload destination above web root.
2. If so, can those files still be accessed via the Control Panel?
3. Is there any way those files could be made available on the front end to members of authorized groups?

Also, is there another better way to do this?

# Answer
> 0 votes
Short and sweet: Link Locker Does everything you want and more.

---
Tags: file-uploads, security
---


title: How to create a member group admin?

text:
# Question
Title: How to create a member group admin?
What i try to achive is to have the following user structure:

Member Group 1: Group Admin, User 1, User 2,...
Member Group 2: Group Admin, User 1, User 2,...
Member Group 3 ...
...

I want the group admin to be able to add/remove/edit members only within his group.

I know this will not be possible with bare EE install, but I hope that with some ad-ons and a bit of tinkering will be doable. I've looked on the devot:ee website, but most of the plugins are quite cryptic in description and I would love someone would point me in the right direction.

So given the problem above, how would you approach the solution. Which plugins to use? Is it even possible without writing custom extension?

# Answer
Even if an existing addon can do this, what you want seems so specialised to me that you may be better off with a module/extensions combination. I think you would need a module to hold the group/member combinations. And I think you will need more than one extension. The extensions would use the group/member combinations to control who the logged-in admin can register, edit and delete.

For security, access to the module CP would have to be limited, possibly to superadmins, otherwise your intention to limit admins to the groups they can manage would be insecure.

Whichever way you look at this, there is quite a bit of coding required, because registration, deletion and editing all have different extension hooks that would have to be brought into play, and assigning/unassigning multiple users to the group/member combinations could be a challenge on a site with many members.

EDIT Here's another issue - there would have to be a way to prevent other admins from re-assigning members to their own groups.

Looks like a minefield to me.
> 0 votes

---
Tags: members, extension, admin, member-management, groups
---


title: $_POST empty but transferred

text:
# Question
Title: $_POST empty but transferred
I am trying to access PHP's $\_POST array from a template, using PHP within the template and have the expiration\_date of the entry updated. The $\_POST is empty, although the form is submitting to the same URL.

This is the EE template:

```
 {exp:channel:form channel="auction" return="auction/new"}
    <input name="title" type="text" />
    <input name="auction_description" type="text" />
    <input name="auction_price" type="text" />
    <input type="submit" value="Submit" />
 {/exp:channel:form}

```

This is the HTML of the Form:

```
<form id="publishForm" method="post" action="http://123.123.123.123/auction/new"  enctype="multipart/form-data" >
<input type="hidden" name="RET" value="http://123.123.123.123/auction/new" />
<input type="hidden" name="URI" value="auction/new" />
<input type="hidden" name="return_url" value="auction/new" />
<input type="hidden" name="author_id" value="1" />
<input type="hidden" name="channel_id" value="1" />
<input type="hidden" name="entry_id" value="0" />
<input type="hidden" name="ACT" value="8" />
<input type="hidden" name="return" value="auction/new" />
<input type="hidden" name="site_id" value="1" />
<input name="title" type="text" />
<input name="auction_description" type="text" />
<input name="auction_price" type="text" />
<input type="submit" value="Submit" />

```

This is the PHP code:

```
<?php
if (!empty($_POST['title'])) {
ee()->db->update(
    'exp_channel_titles',
    array(
        'expiration_date'  => '123'
    ),
    array(
        'entry_date' => $_POST['entry_date']
    )
);
}
?>

```

.htacess:

```
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

The PHP parse stage is set to Input and the template's name is the same as the channel's action.

Any help would be highly appreciated. I've been struggling with this for almost a week now.

# Answer
> 0 votes
It may be posting to the same URL, that is true - but when you end up back at that URL it's actually the result of a post-submission redirect, hence your `POST` array being empty. (The presence of an `ACT` parameter in the `POST` request triggers the actual form submission process inside EE, which then performs the redirect.)

What you really want to do is write a simple extension which uses the before\_channel\_entry\_save (or if you're on EE2, channel\_form\_submit\_entry\_start) hook to look at the data (using the hook's passed data, not `$_POST`) and do what you need to do.

---
Tags: ee2, php, forms, htaccess
---


title: Reorder Entry Fields in Channel

text:
# Question
Title: Reorder Entry Fields in Channel
I have a channel with several entry fields.

FieldType 1 FieldType 2 FieldType 3

I would like to reorder them in the CP so when a user creates a new entry the fieldtypes follow a different order.

FieldType 3 FieldType 1 FieldType 2

In EE2, I only had to change the "order" for each entry field.

I cannot find this option in EE3 anywhere. That said, how can I accomplish this?

Thanks in advance.

# Answer
> 1 votes
I found the answer (after a little digging around). It's still possible to reorder the entry fields, but it is now found under the channel manager in 'layouts'. :)

---
Tags: ee3, custom-order-fields
---