# Question
Title: Editing entry in backend: "The file cannot be found"
When I try to edit one specific entry in the CP I get the error "The file cannot be found".

The URL the CP produces is something like www.xyz.com/admin.php?S=0&D=cp&C=content\_publish&M=entry\_form&channel\_id=5&entry\_id=4616

That's exactly the same URL-structure as in every other entry when edited (except for the entry\_id).

The entry is published and can be viewed correctly. In the database I see the entry correctly with something like

```
SELECT * FROM `exp_channel_data` WHERE entry_id = 4616
SELECT * FROM `exp_channel_titles` WHERE entry_id = 4616

```

When I turn on "output and debbuging" in the CP I get absolutely no output, just the Message

> An Error Was Encountered The file cannot be found

(When I edit other entries the output and debugging produces output at the and of the page.)

The guy from the hosting-company says that he doesn't find anything in the server logs which could be related to the problem.

I had the problem with one entry about half a year ago. I ende copy-paste from the database in a new entry.

So anybody has any idea what this strange error could be? Thanks in advance!

# Answer
> 2 votes
I communicated with the EllisLab-support meanwhile. Indeed, as @Mats Mikkel Rummelhoff also assumed, the problem are special chars in files (in my case it was also with Assets, an image with an "ä" in the filename).

EllisLab told me it was a bug known in 2.9. and should be fixed with the latest EE-version. As Mats I was running 2.10.1, but the latest is 2.10.3. I upgraded but yet had no time to test extensively. Due to the EllisLab-support the problem should disappear with an upgrade to 2.10.3 (or to 3.x).

# Answer
> 3 votes
I recently encountered the same issue, and it was a tough nut to crack.

From the error message, I assumed I was dealing with a missing file – presumably something uploaded via Assets. I first attempted to re-index Assets. That didn't help.

Then, I did a `grep` search for "This file cannot be found" on the /assets folder:

```
$ grep -r "This file cannot be found" *

```

The `grep` operation revealed that the error message was mapped to an error code called `file_not_found` in /assets/language/english/assets.lang.php. I did another `grep` for `file_not_found` on the /assets folder to figure out where Assets threw the exception, but there wasn't actually any exceptions thrown for that key in Assets, that I could find.

However, I did find found two matches for `file_not_found` in the file /expressionengine/libraries/Mime\_type.php (lines 119 and 146, ExpressionEngine 2.10.1.

In my case, the issue was indeed a missing file, causing the method `ofFile()` in Mime\_Type.php to throw the (not very helpful!) exception. In order to figure out which file was actually missing, I temporarily changed line 119 from

```
show_error(sprintf(lang('file_not_found'), $path));

```

to

```
show_error($e->getMessage());

```

...which output the original exception in the frontend, complete with the full filepath to the missing file.

Oddly enough, the file in question did actually exist – however, it had a special character in the filename (a Norwegian "å"), which I assumed had something to do with it.

I went into Assets in the CP, found the file in question, and renamed file (replacing the special character "å" with a regular "a". The error message still complained about the file missing, so I went back into Assets and renamed the file again to its original name (with an "å"). Then the error disappeared.

Not really sure about the root cause of the issue, but it had to have been an encoding issue of some sort, since EE wasn't able to read the file until I renamed it (to the same name!) via Assets.

Hopefully your issue is the same as mine, and you'll be able to figure out which file EE chokes on (either because it's actually missing or just unreadable to due to some obscure encoding issue with special characters).

# Answer
> 0 votes
We had the same error, but caused a simpler problem: a missing file in the uploads folder.

The file was selected via an Assets field and most likely for human error it got removed from our server. We restored the file and the entry was editable again.

---
Tags: control-panel, error
---


title: Multisite site home not loading

text:
# Question
Title: Multisite site home not loading
I'm missing something really simple... I have an MSM site that is `subdomain.domain.com`. These really simple .htaccess rules work ... kind of.

```
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)/index\.php/*(.*) /$1$2 [R=301,NE,L]

RewriteCond $1 !\.(gif|jpe?g|png|swf|pdf)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

The template routes work fine. For example, I have set a home template group at `pages` with `index` and `non-index` named templates. If you visit `subdomain.domain.com/pages/index`, it works just fine. Same with `subdomain.domain.com/pages/non-index`.

Now, I've set the `pages` template group to be the site home group, remember:

```
Make the index template in this group your site's home page? **Checked !!**

```

But when I visit `subdomain.domain.com`, I get:

```
Error

The page you requested was not found.

```

Soooo... these routes all work:

```
https://subdomain.domain.com/index.php/ ->
    loads pages/index

https://subdomain.domain.com/pages ->
    loads pages/index

https://subdomain.domain.com/pages/non-index ->
    loads pages/non-index

https://subdomain.domain.com/index.php/pages ->
    loads pages/index

https://subdomain.domain.com/index.php/pages/non-index ->
    loads pages/non-index

```

But yet the `pages/index` doesn't render on the homepage. I get the EE `page not found` error.

I've made sure my `site_url` is set to `https://subdomain.domain.com`, and that the name of my site index is blank.

I've tried a few variations on the last `RewriteRule` line (adding the question mark), but those either render the same or result in the issue where **only** the homepage renders for URLS (so `https://subdomain.domain.com` DOES load `pages/index`, but so does `https://subdomain.domain.com/pages/non-index`).

Like I said, I've tried a bunch of variations of rules to remove index.php and a variation of rules to route everything to index.php after removing it. Any one notice anything stupid I'm missing?

**Edit** Like I mentioned, modifying the last rewrite to something like:

```
RewriteRule ^(.*)$ /index.php?/$1 [L]

# or
RewriteRule ^(.*)$ /index.php?$1 [L]

# or (subdomain.domain.com is a folder in the web root)
RewriteRule ^(.*)$ /subdomain.domain.com/index.php?/$1 [L]

# or
RewriteRule ^(.*)$ /subdomain.domain.com/index.php?$1 [L]

# or any of those with the QSA flag

```

results in the issue where **only** the site index template renders.

**Edit** Last edit:

Here's how I load my subdomain folder from my main web root so this subdomain loads the MSM subdomain site. This is at the top of my web root `.htaccess` file.

```
RewriteCond %{HTTP_HOST} ^subdomain.domain.com [NC]
RewriteCond %{REQUEST_FILENAME} !subdomain.domain.com/
RewriteRule ^(.*)$ /subdomain.domain.com/$1 [L]

```

That has worked fine in other sites I've worked on and looked at.

# Answer
Ugh, so turning off Strict URLs fixed this issue. If anyone else has this issue and doesn't think to tick that off, try it.

If anyone reads through this and feels like commenting, please let me know if turning off Strict URLs has resulted in any issues, especially security ones, in your experience.
> 0 votes

---
Tags: multi-site-manager, htaccess
---


# Question
Title: Passing drop-down menu variable in URL to form
Is there a way to pass variable information through a url and have it pre-populate a drop down menu (selected) on a contact form?

I have a contact form in which I would like to have unique urls that have a particular department prefilled. The user can still change it, but this gives them a starting point so the question can go to the correct person.

# Answer
> 0 votes
Assuming some basics here but I'd do something like:

```
//Current URL = mycompany.com/contact/hr
//This is the template 'contact'
<form action="">
  <input type="text" name="name" />
  <select name="department">
    <option value="hr@company.com" {if segment_2 == "hr"} selected{/if}>HR</option>
    <option value="dev@company.com" {if segment_2 == "dev"} selected{/if}>Development</option>
  </select>
  <button type="submit">Submit</button>
</form>

```

Obviously you'll have other stuff in for template but the if statement is where the selection 'happens' - if nothing in the URL at segment 2 then it will be default.

---
Tags: solspace-freeform
---


title: Stash get_list set_list

text:
# Question
Title: Stash get_list set_list
I have a page where i want to output some quotes from certain channel within an other entries tag.

It seems to work sofar but stash is outputting the same entry over again, i wanted to use get\_list for the unique parameter.

Thanks for your time and effort

Here is my code:

```
     {exp:channel:entries channel="ffq" status="open"}
            {exp:stash:set_list name="quotes"}
            {stash:quote}{textarea}{/stash:quote}
            {/exp:stash:set_list}
        {/exp:channel:entries}

         {exp:channel:entries channel="story" orderby="random" category="4" status="open|featured"}
          {other ee stuff}

{if count % 2 == 0}
               {exp:stash:get_list name="quotes" unique="yes"}
                    {quote}
               {/exp:stash:get_list}
{/if}
     {/exp:channel:entries}

```

# Answer
I believe it's outputting the same thing over and over as you've only captured the last 'quote' – you are capturing inside the `{exp:channel…}` tag. So every time EE returns another entry, you are overwriting the last entry. Try instead:

```
{exp:stash:set_list name="quotes" trim="yes' parse_tags="yes"}
    {exp:channel:entries channel="ffq" status="open"}
        {stash:quote}{textarea}{/stash:quote}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

This should at least give you multiple quotes.

As for `{exp:stash:get_list}` what you have currently will output **all** unique quotes and not just unique quotes every 2 iterations. To achieve that will require some thought as you'd likely have use a combination of offset, limit & slice.

---

## **UPDATE**

```
{exp:channel:entries channel="story" orderby="random" category="4" status="open|featured"}
{other ee stuff}

{if count % 2 == 0}
    {exp:stash:get_list
        name="quotes"
        limit="2" //Limit to 2 Quotes
        offset="{count}" //Your outer count will be 2/4/6/8/etc so we offset the get_list by the same amount.
    }
        {quote}
    {/exp:stash:get_list}
{/if}

{/exp:channel:entries}

```

Obviously you'll encounter issues if you only on want one quote every 2 outer loops as we're using the outer count but them's the breaks !
> 1 votes

---
Tags: stash, list, get
---


title: url_title_path tag doesn't work

text:
# Question
Title: url_title_path tag doesn't work
I using EE 2.10 for a test site.

Is there any tag I can use to make this navigation work for all my pages other than placing the direct url in the href HTML tag? I tried using the "url\_title\_path" but it gives me a page not found. Also, if you look at the home page URL "http://www.mannachurch.org/ExpressionEngine/index.php" this site is being shared on a server under another domain. So, I guess this site is a sub-domain? Do I need to redirect the .htaccess file to remove any unnecessary "index.php" for the URL tags to work? Or can I use anything else? I am afraid of messing up my primary domain's website by uploading any new .htaccess files.

To be clear, below is what my code looks like for my navigation that I am trying to configure. The first two links for 'Home' and 'about' are direct links, this is what I want to avoid. The next three links ('News', 'Apply', 'Contact') are an attempt on my behalf that do not work apparently. How can I make those work?

Whenever I click on my failing url links links, I get a page cannot be found error and that's also the main domain's site no page found page, why is it going there? Please observe yourself.

# Answer
Firstly - the links. Assuming that `{url_title_path='pages/contact'}` etc is working at rending out the URL, albeit with index.php in it, then the only issue is your index.php and removing it. Although note that it's best to always use relative URLs, and personally I've never understood the point of using the url\_title\_path tag when you have to specify the path anyway - simply coding `/pages/contact` into your template is 18 characters less to type, less template parsing to do and just as 'hard coded' and flexible as specifying the template group/template!

Secondly the index.php rewrite.

On your main root website (http://www.mannachurch.org/), it already has an .htaccess in the root which rewrites the index.php so assume it's another EE build. Because you can access the `ExpressionEngine` folder, it's already been excluded in the .htaccess file, so no need to modify it. So you need to create a new .htaccess file in the `ExpressionEngine` folder that does the index.php rewriting. Best bet might be to copy the existing root .htaccess and modify it to include the sub folder. Something like:

```
<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 ^(.*)$ /ExpressionEngine/index.php/$1 [L]
</IfModule>

```

Should do it - modify the folder names to match . The official instructions are here.
> 1 votes

---
Tags: url, tags
---


# Question
Title: Activate Active Class on Menu When On Current Page
The code below shows all the pages in that channel active. I just want to show the page the users is on. As it is set up now all the items in the menu are .active. What am I doing wrong.

```
<div class="panel-body">
<ul class="nav nav-stacked">
{exp:channel:entries channel="{segment_1}" dynamic="no"}
<li class="{if segment_1 == "{segment_1}"}active {/if}"><a href="{comment_auto_path}/{url_title}">{title}</a></li>
{/exp:channel:entries}
</ul></div>

```

# Answer
```
{exp:channel:entries channel="{segment_1}" dynamic="no"}
    <li class="{if last_segment == url_title}active {/if}">
        <a href="{comment_auto_path}/{url_title}">{title}</a>
    </li>
{/exp:channel:entries}

```

Comparing last\_segment to the entries url\_title should give you an accurate match. You're currently comparing to the channel or first segment, which will be the same for all the entries.
> 0 votes

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


# Question
Title: Can't get Grid conditionals to work in 2.10.3
I've been trying to get a Grid conditional to work (using EE2.10.3) and no matter what I try, it's not working and the page crashes. My grid field is called "projects\_video" and I want to output something if it's not empty. Here's what I've been trying so far:

```
{exp:channel:entries channel="projects"}
     {if projects_video:total_rows >= 1}
          SOME DATA
     {/if}
{/exp:channel:entries}

```

Also I've tried:

```
{exp:channel:entries channel="projects"}
     {if "{projects_video:total_rows}" >= 1}
          SOME DATA
     {/if}
{/exp:channel:entries}

```

And:

```
{exp:channel:entries channel="projects"}
     {if {projects_video:total_rows} >= 1}
          SOME DATA
     {/if}
{/exp:channel:entries}

```

And:

```
{exp:channel:entries channel="projects"}
     {if projects_video}
          SOME DATA
     {/if}
{/exp:channel:entries}

```

Any ideas?

# Answer
Here's what eventually worked for me:

```
{exp:channel:entries channel="projects" limit="1" disable="categories|member_data|pagination"}
{if '{projects_test:total_rows}' > '0'}
    {exp:vmg_nested:channel:entries channel="projects" limit="1" disable="categories|member_data|pagination" prefix="test"}
        {projects_test}
            {projects_test:text}
        {/projects_test}
    {/exp:vmg_nested:channel:entries}
{/if}
{/exp:channel:entries}

```

Note the single quotes around the braces in the "if" statement.
> 0 votes

# Answer
If I'm not mistaken you could use the basics of:

```
{exp:channel:entries channel="projects"}
     {if projects_video}
       {projects_video}
          {projects_video:option}
          {projects_video:option2}
          etc...
       {/projects_video}
     {/if}
{/exp:channel:entries}

```

The if statement checks that there is something in the Grid field. Note that this will return true even if the user has created a row and put nothing in it.
> 0 votes

---
Tags: conditionals, grid
---


# Question
Title: Cartthrob 2.70's Auto-Install Template issue with Bootstrap and Affix
I recently installed Cartthrob version 2.70. I used the auto-install templates during installation and have been altering them to suit my needs from there but I can't seem to fix a problem with the store's left nav (the div that includes the total, subtotal, discounts, etc.) When the store is viewed on a tablet or mobile device, this left nav follows the page as you scroll down and completely overlaps the content underneath it.

I'm new to Bootstrap but all my research and reading has lead me to believe that the issue has something to do with Affix. I assumed if the screen width was small enough, the div wouldn't scroll and would remain fixed at the top of the page. I'm also not sure if the problem is on the css or javascript side (or both). Has anyone else noticed the same issue and if so, is there an easy resolution? Thank you!

# Answer
> 0 votes
I was able to solve this problem with a better understanding of how Scrollspy and Affix work. I didn't realize that you needed to account for smaller screen sizes within the CSS. Adding this to my stylesheet solved my problem:

```
@media (min-width: 768px) {
    .bs-docs-sidenav {
        position: fixed;
    }
}

```

The answer came from this thread: https://stackoverflow.com/questions/17394854/how-can-i-disable-bootstraps-affix-on-smaller-screens

Hope this helps someone else!

---
Tags: cartthrob, plugin, javascript, css, bootstrap
---


title: Changing Usernames

text:
# Question
Title: Changing Usernames
I'm interested in granting the permission to change usernames to one of my member groups but this doesn't seem possible. Is there anyway to grant permission to edit usernames for members that are not Super Administrators? Thanks!

# Answer
I was going down the wrong path on this one. The only reason the other member group needed to edit the usernames was because the stand-alone member registration module wasn't configured to set the desired username format. I simply made adjustments to that form and now the need to edit usernames will likely never arise and if it does I can handle a few isolated cases such as name changes etc.

Under EE 2.5.2 it does not seem possible to edit the username unless you are a Super Administrator or have modified the core files. Thanks!
> 0 votes

# Answer
In the Member Group settings under Control Panel access, do you have "Can access MEMBERS section" set to "Yes"

And in the Member Group settings under the Control Panel Administration section, do you have the "Can administrate members accounts" option set to "Yes"?

Those two settings should do it.
> 1 votes

---
Tags: users
---


title: Question about saving data

text:
# Question
Title: Question about saving data
I have a question about saving website coding data.

We want to save the data and html page coding of the pages we've created; so if I wanted to use that data to recreate the page, I could do so easily. The only way I know now is to go to each page and copy the html data from each page.

Is there a better and more efficient way to save the data, like a feature in the admin panel or something? I would appreciate any answers you can give me.

Thanks.

# Answer
> 0 votes
Yes, you can save your templates as files and edit them externally and EE will use them instead of the database version.

old article but might help

Documentation here. Also this tip for changing in bulk.

Once they're external it makes it far easier it utilise version control and backup, I'd strongly advise in looking into Git - bit of an old article but might help.

**Update**

If you want to copy an **entries** html, rather than the template, try MX Cloner EE2 only.

# Answer
> 0 votes
CE\_Cache has a static cache handler that saves the generated html to a file. You can then grab them from the cache folder. I don't know of any other addons that generate rendered html from pages. But they may exist.

# Answer
> 0 votes
You could use CE Cache which generates static html-files. From the CE Cache documentation:

> The server will check to see if the static driver has already made a flat html file of the requested page in the past. If a flat file is found, it will serve it up, completely bypassing ExpressionEngine®. If it has not, or if the page has expired, then the page will be requested from ExpressionEngine® and cached to a flat html file.

I use CE Cache but not with the static driver, because I always have some dynamic content here and there. So I am not sure how the cached data is structured, but as you can browse the files through the control panel I assume that they are structured in a handy way.

If you want to be sure just head over to the CE Cache support forum at devot-ee and ask Aaron himself.

---
Tags: saving
---


title: Channel Form CSS?

text:
# Question
Title: Channel Form CSS?
This might be a simple question, but with Channel Forms, the documentation says:

```
<link href="{path=css/_ee_channel_form_css}" type="text/css" rel="stylesheet" media="screen">

```

I see a channel\_form.css file in themes\>cp\_themes\>default\>css, but I'm wondering: how does Channel Form see that file? Or am I supposed to copy the file, rename, and place in css folder elsewhere? I guess I'm not getting how this "path" works.

# Answer
You shouldn't have to worry about location of the ee channel form css in a default ee install. The {path=css/\_ee\_channel\_form\_css} variable will automatically be replaced when the template is parsed and point to the correct css. Just use:

```
<link href="{path=css/_ee_channel_form_css}" type="text/css" rel="stylesheet" media="screen">

```

If you need to you can always override parts of it with inline css, other css loaded after, or through javascript.
> 1 votes

# Answer
Known bug for EE3. View temporary fix here: https://support.ellislab.com/bugs/detail/21711/channel-form-css-meta-not-working
> 0 votes

---
Tags: channel-form, css
---


title: ExpressionEngine2 with PHP7 and nginx?

text:
# Question
Title: ExpressionEngine2 with PHP7 and nginx?
Has anyone had any luck getting ExpressionEngine 2.x working with nginx and/or PHP7? I have a CentOS 7 server with PHP7 and nginx installed. I have another site hosted on the server that runs just fine. A simple "hello world" example written in PHP will work but any attempt to load ExpressionEngine results in a 500 error. Tailing the logs isn't leading me to anything useful (I've checked logs for php-fpm and nginx).

Any advice? Here's the config that is working for me on another site (running Laravel 5):

http://pastebin.com/SEcYCqwe

I've tried the recipes here, but nothing seems to stop the 500 errors from happening: https://www.nginx.com/resources/wiki/start/topics/recipes/expressionengine/

# Answer
> 4 votes
Try changing the PHP MySQL driver. Previous versions of EE use **`mysql`** but for php7 you need to change the setting to **`mysqli`**.

Find the setting in the /system/expressionengine/config/database.php file.

CHANGE

```
$db['expressionengine']['dbdriver'] = 'mysql';

```

TO

```
$db['expressionengine']['dbdriver'] = 'mysqli';

```

# Answer
> 0 votes
It looks as though only EE3.1 has full php 7 compatibility: https://ellislab.com/blog/entry/expressionengine-3.1.2-released#fn:php-7

---
Tags: nginx
---


# Question
Title: Postmaster - Switching from Mandrill to SendGrid
With Mandrill's new change of policies and pricing I'm moving away from using it for my transactional emails and am Switching to SendGrid.

I use the Postmaster add-on to trigger various emails as well as to send my EE system emails.

Switching the email service seems fairly straightforward, all I have to do is update each parcel and hook to use a new email service. I'm then required to enter my SendGrid username and password.

However it doesn't work.

Every email I try to send now get's this error:

> SendGrid Service - Error: The requested URL returned error: 400 Consult with SendGrid’s documentation for more information regarding this error.

Unfortunately their documentation doesn't mention Error 400.

**Does anyone have experience with Postmaster using SendGrid as the email service? What do I need to do to get this working?!**

# Answer
> 4 votes
Benek, i was in the same situation.. What i did was a bit simple (not sure if it's the best way or solution)

I simply hacked the Sendgrid.php located in /third\_party/postmaster/services/Sendgrid.php

Modified

```
    public $url  = 'http://sendgrid.com/api/mail.send.json';

```

to

```
    public $url  = 'https://api.sendgrid.com/api/mail.send.json';

```

as stated on Sendgrid's api docs Send Mail API page

Ciao

---
Tags: email, postmaster
---


title: how to set the subdomain in localhost?

text:
# Question
Title: how to set the subdomain in localhost?
I want **domainname.local/index.php** to **domainname.local/country code (domainname.local/us)** i am use the all do name start with **domainname.local/us/?do=index**

# Answer
> 1 votes
You need to provide more information as to what you need, also `?do=index` is not ExpressionEngine, so what are you doing to get that?

Multi-language using the method you state has been documented and asked many times. Top questions:

View all related questions:

Articles outside of Stack Exchange:

---
Tags: subdomain
---


# Question
Title: Trying to install EE on MAC localhost - getting error in Licence.php
I'm trying to install EE 3.2.1 on localhost on my Mac. But I'm getting the following 'undefined function' error. Through Google I can't find any mention of anyone else having the same issue. What might be the cause?

```
Call to undefined function EllisLab\ExpressionEngine\Service\License\openssl_verify()
in /Users/xxxxx/www/iffa/system/ee/EllisLab/ExpressionEngine/Service/License/License.php on line 248

```

My system versions are: Apache: 5.5.31 mySQL: 5.6.25

# Answer
`openssl_verify` is a PHP function, so you need to install it for PHP, normally it's installed as standard, so guess you're using an abnormal PHP installer...?

Here's a reference to a bug report that was created.

It may be as simple as you've not got the php.ini module line uncommented:

```
extension=php_openssl.dll

```

PHP OpenSSL Installation reference.
> 3 votes

---
Tags: install, localhost
---


# Question
Title: Benefit of Saving Templates as Files in Expression engine
Aside from being able to edit files without the Template Manager – is there any advantage to saving templates as files in ExpressionEngine?

Is that increase or decrease website speed? Does it improve performance, security, etc.?

Frm where website takes that page template file or database?

# Answer
> 1 votes
Don’t Save template as file – saving templates as files can marginally increase disk i/o as each template must be retrieved from disk in addition to the standard database query

# Answer
> 0 votes
No, that's the whole point, being able to edit files via an external editor. Should the db and the file version be out of sync, EE will use the file.

Theoretically disc i/o should be slightly slower than a db query, but it rarely matters in practice unless we are talking about really busy sites. With template caching enabled the difference should be close to nil.

To check it, enable the template debugger (CP Home -\> Administration -\> Output and Debugging Preferences) and look for "Retrieving Template from File" on the debugger section of the rendered template.

# Answer
> 0 votes
Please consider the following answer:

**Pros**

Editing through your favorite editor -\> faster

Enables you to version your files with a VCS

You can DIFF files

Easier to maintain code markup/layout

**Cons**

Slightly slower because EE needs to check the files for a new version (i guess it only uses the file versions in the latest EE releases).

Could be a lot slower on a provider with a slow file system.

Synchronization hassle

---
Tags: templates
---


# Question
Title: Conditional {if} and {if:else} Getting Error Message
I get an error message each time. "You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}." Stuck not sure what to do.

```
  {exp:channel:entries channel="{segment_1}"}
     {if banner}
     <img src="{banner}" alt="photo:{title}" class="margin-top-minus-20 img-responsive osd-border" />
     {/exp:channel:entries}
     {if:else}
      <!-- snippet-->
     {snp-banner-grid}{/if}

```

# Answer
> 0 votes
```
{exp:channel:entries channel="{segment_1}"}
     {if banner}
        <img src="{banner}" alt="photo:{title}" class="margin-top-minus-20 img-responsive osd-border" />
     {if:else}
        {snp-banner-grid}
     {/if}
{/exp:channel:entries}

```

# Answer
> 2 votes
You cannot close your exp:channel:entries-tag in a branch of the if-structure, because in case you have a banner (first branch) you finish the channel-loop and will not get to the end of the if-construct. Vice versa if you do not have a banner you will not end the channel-loop.

Therefore put the closing `{/exp:channel:entries}` after the very end of your code snippet and it will work.

---
Tags: conditionals, ifelse
---


# Question
Title: Site "forgot" what the default template was
I've had the same problem happen a few times, on several different EE sites, but I can't determine the cause so I'm turning to y'all.

Symptom: The site's main index page will fail to load and will display a blank white page with no output. When diagnosed, the problem turns out to be that the default template group "forgot" that it was the default template group. More specifically, the "is\_site\_default" field in the exp\_templates table, was set to 'n' for all template groups. (In order to function, it has to be set to 'y' for one template group for each site you are running.)

Has anyone had this happen to them, and if so, do you know what causes it, so I can avoid it recurring?

# Answer
> -2 votes
If you go to Templates and then click on the Template Group that you wish to make the index template the default template and click on Edit Group for that template group then you will see a simple edit page come up which will allows you to change the Template Group Name and also there is a checkbox to enable just what you need there.

---
Tags: templates, default, index
---


title: Images Not Saving in Channel Entry

text:
# Question
Title: Images Not Saving in Channel Entry
Bit of a weird problem. We are able to upload images successfully via the basic publish entry form, but if an edit is made to the entry (even if it's just a text edit), the image disappears from the entry. Worse, though the field is marked as required, no error is thrown to notify the user that the image isn't being saved in the entry. Permissions are correct, directories are correct--I'm at a loss.

-D

# Answer
Was a bug in 3.2.0; answer posted here and supposedly fixed in 3.2.1 -- https://support.ellislab.com/bugs/detail/21679/images-disappear-and-need-to-be-reentered-into-fields

-D
> 0 votes

---
Tags: channel, fieldtype, image, entry
---


title: Master Config on Mac with AMPPS

text:
# Question
Title: Master Config on Mac with AMPPS
I installed EE 2.11.1 on Mac with AMPPS, and am trying to set up the Master Config from FocusLabs. Following the directions from here everything works fine until I copy/paste the contents of system/expressionengine/config/database.php into my corresponding database.php file. When I do that, I get the white screen of death on both the front end and the control panel.

A few things I've tried:

* Turning on debug isn't giving me any info...still just the white screen.
* I added an `exit('here');` to the top of the config.local.php file...it is pulling in the file.
* I uploaded to the "dev" and "production" servers and it worked fine, so seems to just be isolated to my local environment.
* The database connection is working fine since I was using the same credentials when I installed EE, but before attempting to set up Master Config.

Any suggestions for further troubleshooting?

# Answer
mjr gave me a nudge in the right direction in the comments above. In case anybody comes across this same issue, I found the solution here on the AMPPS forum.
> 0 votes

---
Tags: focus-lab-master-config
---


title: Need help with a query to get data

text:
# Question
Title: Need help with a query to get data
I need a complex query and have gone beyond my scope of understanding.

Here is the gist...

There is a section of the site in which users can select various values available in entries of a particular channel. Some are 'Categories', some are 'Grid Fields', Lastly, one is a range.

I pass the variables to a template displaying the results and get the values selected using Mo' Variables by Rob Sanchez.

So the URL will look something like this:

```
/find-your-home/search?city=edmond&sub-division=stonebriar&school-district=edmond-public-schools&Bedrooms=4&Bathrooms=2&min=90000&max=400000

```

I can get the variables like this:

```
{!-- Get the key values from the query string --}
{exp:stash:search_city}{get:city}{/exp:stash:search_city}
{exp:stash:search_sub-division}{get:sub-division}{/exp:stash:search_sub-division}
{exp:stash:search_school-district}{get:school-district}{/exp:stash:search_school-district}
{exp:stash:search_bedrooms}{get:Bedrooms}{/exp:stash:search_bedrooms}
{exp:stash:search_bathrooms}{get:Bathrooms}{/exp:stash:search_bathrooms}
{exp:stash:search_min}{get:min}{/exp:stash:search_min}
{exp:stash:search_max}{get:max}{/exp:stash:search_max}

```

So far, so good...

So the houses are in their own channel so I want to query that id: `channel_id = '3'` (In this case)

The following are categories: `city, sub-division, and school-district`

I then have a grid field for details which is listed as comma separated values. This is where the `price, bedrooms, and bathrooms` are kept.

So basically, in the table `exp_channel_data`:

`entry_id`, and `field_id_23` seem to be the only fields I need.

`field_id_23` looks like this: `349900|4|3|1|2|0|3|2557`

In this instance, `349900` is the price that would need to fall between the `min` and `max` range passed.

Then the next two segments, `4` and `3` are the `Bedrooms` and `Bathrooms` respectively.

Then I will need the `exp_category_posts` table to get the categories for the entries. I should be able to join the two tables on the `entry_id`.

The category group I need to get is group 2. (If that matters)

The `City` category is a parent with an ID of '2'. Under this are (currently 4) child categories of which `Edmond` has an ID of `9`.

The `Sub-Division` category is a parent with an ID of '1'. Under this are (currently 6) child categories of which `Stonebriar` has an ID of `8`.

The `School Districts` category is a parent with an ID of '16'. Under this are (currently 3) child categories of which `Edmond Public Schools` has an ID of `17`.

I have tried to put this together, but I don't know the best way to get it all together. It would be nice to be able to pass it through a `{exp:channel:entries}` loop.

If I could get all of this filtered with the above and return a group of ids to run, I think it would work.

Something like this: `SELECT GROUP_CONCAT(DISTINCT exp_channel_data.entry_id SEPARATOR '|') AS entry_ids FROM exp_channel_data WHERE channel_id = '3'` only WITH the other query data filters applied as this one returns all the ids in that channel.

---

**EDIT**

I updated the drop downs to populate the categories with the `category_id` as the values to pass. This should simplify the category issue in the query. :)

So the URL will look like this now:

```
/find-your-home/search?city=9&sub-division=8&school-district=any&Bedrooms=4&Bathrooms=3&min=90000&max=400000

```

# Answer
> 0 votes
If anyone has a cleaner way of doing this, I'm all ears. :)

Ok, I was able to do this using nested queries with some of the MySQL string functions and checking for the IDs inside the looped results like this:

```
{exp:query sql="
    SELECT GROUP_CONCAT(DISTINCT exp_category_posts.entry_id SEPARATOR '|') as query_houses
    FROM exp_category_posts
    WHERE exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_channel_data.entry_id
        FROM exp_channel_data
        WHERE exp_channel_data.channel_id = 3
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_category_posts.entry_id
        FROM exp_category_posts
        WHERE exp_category_posts.cat_id = {get:city}
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_category_posts.entry_id
        FROM exp_category_posts
        WHERE exp_category_posts.cat_id = {get:sub-division}
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_category_posts.entry_id
        FROM exp_category_posts
        WHERE exp_category_posts.cat_id = {get:school-district}
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_channel_data.entry_id
        FROM exp_channel_data
        WHERE SUBSTRING_INDEX(exp_channel_data.field_id_23, '|', 1) BETWEEN {get:min} AND {get:max}
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_channel_data.entry_id
        FROM exp_channel_data WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(exp_channel_data.field_id_23, '|', 2), '|', -1) >= {get:Bedrooms}
    ) AND exp_category_posts.entry_id IN (
        SELECT DISTINCT exp_channel_data.entry_id
        FROM exp_channel_data
        WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(exp_channel_data.field_id_23, '|', 3), '|', -1) >= {get:Bathrooms}
    )"
}
    {query_houses}
{/exp:query}

```

Which, in THIS instance I ran resulted in the following that I can pass to the `{exp:channel:entries}` tag as the `entry_id` parameter.

**30|35|37|38**

# Answer
> 0 votes
This is the MSSQL query I came up with, but it looks like you're using MySQL so you'll have to convert a few things.

```
declare @search_city varchar(50) = 'edmond'
declare @search_subdivision varchar(50) = 'stonebriar'
declare @search_schooldistrict varchar(50) = 'edmond-public-schools'

select (select distinct ltrim(str(cd.entry_id)) + '|'
    from exp_channel_data cd
    inner join exp_category_posts cp on cd.entry_id = cp.entry_id
    where cd.channel_id = 3
          and (cp.category_id = 2 and cp.searchName = @search_city
               or cp.category_id = 1 and cp.searchName = @search_subdivision
               or cp.category_id = 16 and cp.searchName = @search_schooldistrict)
    --order by cd.entry_id
    for xml path(''), type
   ).value('.', 'varchar(200)') as 'entry_ids'

```

---
Tags: channel-entries, categories, query, query-module, querystring
---


title: Minimum Order Spend

text:
# Question
Title: Minimum Order Spend
Currently we are having our website built and the CMS is ExpressionEngine. I have requested to condition the site that no orders can be processed unless the order amounts to $50 or more. However, I have been advised that setting up a minimum order spend is difficult. Can someone please confirm if there is plug in or rule that can be applied to have this requirement in the store settings?

# Answer
> 1 votes
I don't believe there is a fumction within the module but this seems like a solid logical work-around:

---
Tags: shopping-cart
---


title: How to translate country names

text:
# Question
Title: How to translate country names
We are using expresso store with the german translation.

During checkout and also in the backend all country names are in english and are not translated within the german translation file.

How can we translate the country names both within the checkout and the control panel?

# Answer
> 0 votes
Alas you can't easily on the backend - the list is defined in the countries.php file in the config folder and not relevant to the language. You could possibly write an extension to get round this, but might want to just put up with English on the backend due to the development time. There is another way using JavaScript if all you want is to show the customer country in the correct language, similar to an approach mentioned below - use the CSS&JS add-on to inject custom code onto your page. Target the Select dropdown or value shown for the selected customer on the specific field you're displaying, and swap out with your JS array. The problem comes if you want to show the translated country within emails or you want to be able to edit the country lists within the Control Panel...!

Frontend though, you're free to do whatever you like. I've used the Reegion add-on in the past and defined separate lists for each language, alternatively there's Multi-Language Country Lists, which I've never used so can't comment on. You could even use JavaScript to replace the Expresso Store list on the frontend with your own stored as a JS array. Whichever approach, as long as the Country codes remain the same, there will be no problem with what is stored in the DB associated with the customer.

**Edit**

Just checked with an existing build, the customer data held with the order holds the address entered, but not the Country full name, just the Country Code, so it still uses the lookup to get the name (which is fixed as English). As well as the config file, there is a exp\_store\_countries table which allows the admin in the control panel to select which countries are valid - again this isn't related to language.

---
Tags: expresso-store
---


title: Uploading images to sub folders

text:
# Question
Title: Uploading images to sub folders
Is it possible to upload images to subfolders? Client wants to organize each entries images. Any help would be appreciated!

# Answer
> 1 votes
Yes, as different upload locations. Content -\> Files -\> File Upload Preferences menu (EE2). Alternatively defined via config file.

In EE Control Panel...

As Folders...

Even more straightforward in EE3...

Or if you want sub-folders in sub-folders, then you'll have to opt for a third-party add-on like Assets (EE2 only).

---
Tags: channel-entries
---


# Question
Title: Expression Engine 3 pagination with page_uri
I have looked for a while for a solution to this, but have been unsuccessful so far. Not sure if it's me, or if there's a problem with the pagination functionality.

**What I'm trying to do**

When on a page within a certain channel, I want to have 'prev' and 'next' buttons to click through to the next article in the channel. These links must use the page\_uri set for each page.

**What I've tried**

I have a channel full of pages. In the template, I have added:

```
{exp:channel:entries channel="project" dynamic="no" orderby="date" sort="desc" limit="1" paginate="bottom"}
    <div class="container-fluid project-section pagination-bar">
        <div class="container">
            <div class="col-md-12">
              {paginate}
              {pagination_links}
              <ul>
                {previous_page}
                <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
                {/previous_page}

                {next_page}
                <li><a href="{pagination_url}" class="page-next">Next Page</a></li>
                {/next_page}
              </ul>
              {/pagination_links}
              {/paginate}
            </div>
        </div>
    </div>
    {/exp:channel:entries}

```

This is adding the links to the bottom of the page, but when clicking on them the URLs are just loading the same URL you're currently on, then adding /P1 to the end.

I need it to use the page\_uri added in the CMS so that it clicks through properly and doesn't affect SEO on the site.

Any help appreciated on this one, thanks

# Answer
Take a look at the documentation for previous/next linking https://docs.expressionengine.com/latest/channel/entry\_linking.html
> 1 votes

---
Tags: pagination, ee3
---


# Question
Title: Solspace FreeForm 4.2.4 (Free) - Cannot create new fields - PHP Errors
EE v2.10.3

Freeform Free 4.2.4

Having trouble creating new fields.

When I hit the "New Field" button I get the following errors...

```
    A PHP Error was encountered
Severity: Notice
Message: Undefined index: checkbox
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: checkbox_group
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: country_select
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: hidden
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: multiselect
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: province_select
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: radio
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: select
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Notice
Message: Undefined index: state_select
Filename: libraries/Freeform_fields.php
Line Number: 246

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /path/to/public_html/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 475

```

The Field Type select box is also populated with php errors.

I have tried a fresh install of the addon too, by removing the existing system + theme folders and uploading fresh.

Thanks

# Answer
> 0 votes
It sounds like something didn't get installed correctly. Check and see if the exp\_freeform\_fieldtypes table was created and populated.

Edit: It looks like Freeform "Free" was installed over a previously installed Pro version and the fieldtypes table contained all the Pro fields which the Free version does not use. Removing the extraneous rows from the fieldtypes table resolved the issue.

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


# Question
Title: conditional if statements for channel fields
Im running into a bit of a problem,

i have two channels which are called on a single page, displaying the latest entries from each. these two channels have different fields setup for descriptions and title eg. {channel1\_title} {channe2\_title}.

when i call channel1 and all its fields it appears correctly, and also when i call channel 2.

when i combine them however i have a problem in calling both fields in all channels

{exp:channel:entries channel="channel1 | channel2" orderby="date" sort="des" dynamic="off"}

all channel entries for both fields are called but my problem is the channels have differences, channel2 fields are video related and channel1 are image related.

what i am trying to do is loop the src and description fields so they appear but in an if statement.

Is this the correct approach or is there another way of achieving this.

# Answer
> 0 votes
Try something like this:

```
{if channel == "Channel1"}
    show channel 1's fields
{/if}
{if channel == "Channel2"}
    show channel 2's fields
{/if}

```

---
Tags: conditionals, entries, loop
---


# Question
Title: Channel Entries pagination - breaking into an embed file
I would like to break out my pagination code into a separate embed file as the same code is used in multiple templates. However when I do it's just spitting out EE tags into the page rather than parsing them.

Is this a parse order issue? Is it possible to achieve this?

```
{exp:channel:entries
    channel="events"
    orderby="date"
    sort="desc"
    paginate="bottom"
    disable="category_fields|member_data|relationships"
    limit="5"
    dynamic="no"
  }

  <div class="card card-horizontal clearfix event-list
    {if segment_2 == 'weekly'}hidden-xs-up{/if}"
    {if segment_2 == 'weekly'}data-day="#{event_start_date  format='%D'}"{/if}
    >
    <div id="events-carousel" class="carousel slide" data-ride="carousel">
    {event_images cover_only="yes"}
      <a href="/iba-kids/events/{url_title}">
        <img class="card-img-top img-fluid" src="{image:url:medium}" alt="{image:title}">
      </a>
    {/event_images}
    </div>
    <div class="card-block">
      <h4 class="card-title">{title}</h4>
      <p class="card-text">{exp:power_truncate length="110" cut_words="n" suffix="..."}{event_snippet}{/exp:power_truncate}</p>
      <a class="btn btn-primary category" href="/iba-kids/events/{url_title}">Read Article</a>
    </div>
  </div>

  {embed="inc/_paginate-full"}

  {/exp:channel:entries}

```

Embed Code:

```
        {paginate}
        <nav>
        {pagination_links}
          <ul class="pagination pagination-lg">
            {first_page}
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="First Page">First</a>
            </li>
            {/first_page}
            {page}
            <li class="page-item">
              <a class="page-link {if current_page}active{/if}" href="{pagination_url}">{pagination_page_number}</a>
            </li>
            {/page}
            {last_page}
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Last Page">Last</a>
            </li>
            {/last_page}
          </ul>
        {/pagination_links}

        {pagination_links}
          <ul class="pagination pagination-lg pull-xs-right">
          {previous_page}
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Previous">Previous</a>
            </li>
          {/previous_page}
          {next_page}
            <li class="page-item">
              <a class="page-link" href="{pagination_url}" aria-label="Next">Next</a>
            </li>
          {/next_page}
          </ul>
        {/pagination_links}
        </nav>
      {/paginate}

```

# Answer
Most likely a parse order issue http://loweblog.com/downloads/ee-parse-order.pdf Embeds are processed after module tags.
> 0 votes

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


title: Solspace: Calendar

text:
# Question
Title: Solspace: Calendar
I have a mini Solspace calendar that shows correctly here, but does not display all days of the month here.

Here is the code:

```
   <div id="mc_wrap">
{exp:calendar:cal
{if segment_2 == "calendars"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "edit"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "create"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "event"}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == ""}
date_range_start="year-month-01" date_range_end="year-month-last"
{/if}
{if segment_2 == "month"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
{if segment_2 == "week"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
{if segment_2 == "day"}
{if segment_3 == ''}date_range_start="year-month-01" date_range_end="year-month-last"{/if}
{if segment_3 != ''}date_range_start="{segment_3}-{segment_4}-01" date_range_end="{segment_3}-{segment_4}-last"{/if}
{/if}
dynamic="off"
}
<div id="mc_calendar">
{display_each_month}
<table id="mini-cal">
<thead>
<tr  id="mc_head">
<th colspan="1">{if segment_2 != "calendars"}<a id="mc_prev_month" class="icon left" href="{path=''}mini-cal/month/{prev_month format="%Y/%m"}/">«</a>{/if}</th>

<th colspan="5"><a href="{path='calendar'}/{month format="%Y/%m"}/">{month format="%F %Y"}</a></th>

<th colspan="1">{if segment_2 != "calendars"}<a id="mc_next_month" class="icon right" href="{path=''}mini-cal/month/{next_month format="%Y/%m"}/"> »</a>{/if}</th>
</tr>
<tr id="mc_days">
{display_each_day_of_week}
<th class="{if day_of_week_is_weekend}weekend{/if} {if day_of_week_is_current}current{/if}">{day_of_week_one}</th>
{/display_each_day_of_week}
</tr>
</thead>
<tbody>
{display_each_week}
<tr>
{display_each_day}
<td class="
{if !day_in_current_month == FALSE}mc_pad{/if}
{if day_event_total > 0}has_events{/if}
{if count == 7}selected{/if}
{if day_is_today}today{/if}
"><div class="mc_date">{if day_in_current_month}
{if day_event_total}<a href="{path='calendar/day'}/{day format="%Y/%m/%d"}/">{/if}
{day}
{if day_event_total}</a>{/if}
{if:else}
<strong class="middot">·</strong>
{/if}</div></td>
{/display_each_day}
</tr>
{/display_each_week}
</tbody>
</table>
{/display_each_month}
</div>
{/exp:calendar:cal}
</div>

```

Not sure what I am missing here but I am open to suggestions.

# Answer
You need a check for the "search-results" segment:

```
{if segment_2 == "search-results"}
   date_range_start="year-month-01" date_range_end="year-month-last"
{/if}

```
> 1 votes

---
Tags: solspace-calendar
---


title: Entries mysteriously closing

text:
# Question
Title: Entries mysteriously closing
I'm really sorry this is a bit of a vague question, but I'm wondering if anyone has any thoughts that may shed some light on this issue.

I recently installed the "Better Workflow" plugin on a client's website. I literally only installed it and enabled it - I didn't change any configuration - or tweak any other settings. I left it for them to configure the workflow as they wished.

A few days later they informed me that some entries in their EE site were mysteriously going missing. We believed it to be caused by the Workflow plugin automatically submitting entries as Closed. They hadn't yet configured the Workflow themselves - so I disabled both the Add-on and the Module. They're both still disabled as of this moment.

In the week that followed we noticed:

* Some entries still closing themselves on update
* Some entries closing themselves overnight (they came back on Monday after the weekend to find several entries auto-closed whilst they were gone)
* Some entries vanishing from the database completely and irreversibly (not closing - literally deleting)

The client is technically competent and I am certain there's not a rogue user simply deleting entries. But things are going missing - either automatically closing in seemingly mysterious circumstances or vanishing entirely.

So my question is...

* Could this have anything to do with Better Workflow modifying configurations?
* Could this have anything to do with Better Workflow at all, or is that a red herring?
* Are there any EE settings that auto-set expiry dates for tours or auto-close them?
* Have you seen anything like this before, or do you have any suggestions for how to begin to tackle this issue?

Thanks!

# Answer
Perhaps when you deleted a member their entries were deleted as well? This is an option in the "delete member" interface.

See screenshot.

Strangely in my testing *neither* radio button is selected when the page loads. I haven't gone as far as to hit the delete button so I am not certain what the result is... this is on EE 2.8.1 for me.

This could be an explanation for your entries being deleted but it would not seem to explain status changes or expiry dates changing, if that is indeed what your client is experiencing.
> 3 votes

# Answer
In my case `Status Groups` was never set in the `Channel Administration` section of EE. This meant when a member updated an entry, as they had no assignment to `Status Groups` it defaulted to `Closed` and did not show `Open` in the `Status` field therefore closing the entry on every revision or update.

In my case this only occurred on user interaction as there were no cron jobs or plugins installed that would read/update entries on it's own.

The following answer corrected the issue.

@bhashkar-yadav: Custom Member's Channel Entries Defaulting To "Closed" Status

> Check if that channel is assigned a status group from CP -\> Admin -\> Channel Administration -\> Channels -\> Edit Group Assignments.
>
> Here make sure that you have selected a status "Status Groups".
> 2 votes

---
Tags: channel-entries, better-workflow
---


title: Conversion tracking in Expresso Store

text:
# Question
Title: Conversion tracking in Expresso Store
I'm trying to figure out how to get Expresso:Store to add the necessary Google Analytics Ecommerce tracking code after checkout.

Although the docs say you simply have to enable the Conversion Tracking within the Expresso:Store control panel this doesn't seem to do anything.

The standard Google Analytics code is there but no specific product data is tracked.

Is this something that *should* be happening or am I expecting more than it's meant to do. The docs aren't very detailed.

# Answer
> 0 votes
I discovered that it's necessary to output the order details on the "thank you" page in order for it to output the necessary GA product tracking code.

---
Tags: expresso-store, ecommerce, google-analytics
---


# Question
Title: Updating Member preferences for one member group resets other member groups
I'm running 2.6.1 (can't update right now) I have 2 member groups (+ admin)

Each time I update the channel publishing preferences the preferences of the other channel all revert to no access.

Is there a config file for member prefs or DB table I can edit?

Thanks

# Answer
Found the solution. I was searching the wrong thing, turns out it was 2.5.3 and this was the solution:

Changing channel assignments for one member group disables them for other member groups
> 0 votes

---
Tags: members, config
---


title: Assets 2.6 Uploading Fails

text:
# Question
Title: Assets 2.6 Uploading Fails
**could not upload the file - server returned an unexpected response. please check the server settings**

I have read every single post about Assets upload fails here (I think!), but sadly, nothing is working. My client is running EE 2.10.3 and Assets 2.6.

The paths are accurate and there is/isn't a trailing slash

I've synced the directories

I've updated her software and run module updates.

I've updated the indexes

I've made sure the htaccess is accurate and tried Brandon's fixes for index.php removal and all that stuff.

I've checked with the host and made sure the server requirements are met.

I've made sure the folder and subfolder permissions are correct.

I'm at my wit's end. But my client is launching a new book today and I can't get her images to upload and I've been researching this for weeks.

Does anyone else have any other ideas? This used to work until I upgraded her recently. (I even ran the upgrade again, in case there was some sort of hiccup.)

Help?

# Answer
> 0 votes
The solution for this was making sure the FileInfo module for php was enabled on the host server. Thanks to Andris at pixel & tonic for helping me sort that out.

---
Tags: assets
---


# Question
Title: Trying to display specific code based on current language
I'm using Transcribe 1.6.2 with EE 2.10.3.

Our site is in both English and French, and due to differences, I need to adjust some of the template code slightly depending on the current language.

I'm trying to validate based on {exp:transcribe:language\_abbreviation}, whether it's "en" or "fr".

```
{if '{exp:transcribe:language_abbreviation}' == "en"}
    {exp:low_replace find="\<li\>|\<\/li\>" replace="<li><div class=QUOTEc_rotator-contentQUOTE><h1 class=QUOTEv_whiteQUOTE>|</h1></div></li>" regex="yes" multiple="yes"}
{if:elseif '{exp:transcribe:language_abbreviation}' == "fr"}
    {exp:low_replace find="\<li\>|\<\/li\>" replace="<li><div class=QUOTEc_rotator-contentQUOTE><h1 class=QUOTEv_white v_h2QUOTE>|</h1></div></li>" regex="yes" multiple="yes"}
{/if}

    {cf_static_headline}
{/exp:low_replace}

```

Basically, if it's French, throw in an extra style class on the h1 tag that will change the font size because with the current styling, in French it takes up too much space.

I've also tried using preload text replacements, with no success. In either case, it only takes what the first statement is.

The same if statement works fine for another bit of code that I've used it for (changing the way the date is displayed), but I don't understand why it's not working for this.

Thanks.

# Answer
Thanks to Tom at EEHarbour, my problem has been solved.

I didn't realize that there was any difference at all between the two tags {exp:transcribe:language\_abbreviation} and {transcribe:language\_abbreviation} and it seems like using the second is the way to go in this case.
> 2 votes

---
Tags: ee2, transcribe, low-replace
---


# Question
Title: Why doesn't navigation conditional work?
I am working on a sidebar navigation here. The navigation works correctly but I am trying to highlight the active entry.

In the past I have been able to use a segment\_3 conditional to tag the active entry with a class="active", however, something is missing in my approach this time.

I have tested for segment\_3 and I have tested for {url\_title} but when I put them together like this, I don't get any results:

```
<ul>
 {exp:channel:entries channel="services" sort="asc" dynamic="no" }
    <li {if segment_3 == "{url_title}"} class="active" {/if} ><a href="/services/detail/{url_title}">{title}</a></li>
 {/exp:channel:entries}
</ul>

```

I would appreciate some guidance on how to resolve this.

# Answer
See if wrapping segment\_3 in matching quotes and curly brackets helps. I think I remember stumbling upon that issue in my early EE days and it dealing with parse order; keeping it matching helped in my case and was something I got in the habit of doing. I believe with EE 2.9+ they recommend not to put quotes around variables as they've updated the template parser to behave more as you'd expect it to. Anyway, I'm rambling as if this is the solution and I'm almost confident it is, but let us know if it still fails.

```
<ul>
 {exp:channel:entries channel="services" sort="asc" dynamic="no" }
    <li {if "{segment_3}" == "{url_title}"} class="active" {/if} ><a href="/services/detail/{url_title}">{title}</a></li>
 {/exp:channel:entries}
</ul>

```
> 2 votes

---
Tags: conditionals, advanced-conditionals
---


# Question
Title: Populating tag parameter with date via math
I am having an issue getting a dynamic field to populate a parameter inside a tag. From what I have read it is because of parsing order.

Specifically I am try to force a subscription via DevDemon Subscriptions plugin to start the bill cycle on a specific day of the next month. There is a parameter called "next\_billing\_date" which will force this, but since it is a parameter, I would have to change this manually every month, I cant seem to use javascript or php or other methods to calculate this date.

things I have tried:

* embedded templates and javascript using moment.js or php like datediff to calculate the difference and output a new date, which works to get the date, but when embedded it only spits out the code and doesnt parse the script/php and fails.
* {next\_date format="%Y-%m-01"} -This actually works but will only work on the 1st day of the month (i.e. if someone subscribed on 2016-04-12 it will put out 2016-05-01, great, but if I wanted to renew on the 15th of the month using {next\_date format="%Y-%m-15"} and someone subscribed on 2016-04-12 it would output 2016-05-15, meaning they would miss the next billing period.

Any ideas?

# Answer
If I understood correctly on the first point, you calculated the proper date and passed it as an embed variable to an embedded template that has the DevDemon Subscription module code within it. But DevDemon Subscriptions doesn't like being inside an embed and is throwing errors? Javascript wouldn't work within the template as that's client-side code and EE parses the template server-side. I don't know about DevDemon Subscriptions throwing errors but here is what I would try:

**Outer template:** \<-- You'll have to enable PHP on that page (and any parent template that the PHP code may be snippet/embed of) and set PHP Parsing Stage to Input

```
<?php $calc_date = calculate new date using PHP ?>
.
.
.
{embed="includes/dd_subs" next_bd="<?=$calc_date; ?>"}

```

**Embed Template**

```
{exp:subs:subscribe next_billing_date="{embed:next_bd}" register_member="yes" plan="{segment_3}" payment_method="stripe" return="/account/subscription/%SUBS_HASH%"}

<h1>Subscribe to: {subs:plan:label}</h1>
<p>
    Every <strong>{subs:plan:recurring_interval_count} {subs:plan:recurring_interval}</strong> {subs:plan:recurring_amount} {subs:plan:currency}
</p>
<hr>

{if subs:total_errors}
<ul class="errors">
    {subs:form_errors}
    <li>{subs:error}</li>
    {/subs:form_errors}
</ul>
{/if}

<h3>Credit Card</h3>

<label>Credit Card Number</label>
<input name="card_number" type="text" value="{subs:card_number}">

<label>Name on card</label>
<input name="card_name" type="text" value="{subs:card_name}">

<label>Expires</label>
<select name="card_exp_month">{subs:month_options}</select>
<select name="card_exp_year">{subs:year_options}</select>

<label>Security Code</label>
<input name="card_cvc" type="text" value="{subs:card_cvc}" size="5">

<button type="submit">Subscribe</button>

{/exp:subs:subscribe}

```
> 0 votes

---
Tags: devdemon, parse-order, subscriptions, parse, devdemon-subscriptions
---


# Question
Title: EE Matrix filepicker error: Cannot read property 'rows' of null
I'm getting the following error when opening the file picker in a Matrix field. It's broken the keyword search box and pagination within the file picker.

```
TypeError: Cannot read property 'rows' of null
http://www.example.org/admin.php?S=0&D=cp&C=javascript&M=combo_load&ui=datepicker,resizable,draggable,droppable&plugin=tmpl,ee_table,ee_filebrowser,ee_fileuploader,markitup,toolbox.expose,overlay,ee_url_title&file=cp/publish,cp/date,files/publish_fields,cp/publish_tabs,cp/publish_admin&v=1386674008:263

```

EE v2.7.3 Matrix v2.6.1

**Update #1:**

It seems the error is caused by the following PHP error:

```
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: libraries/Filemanager.php
Line Number: 882

```

**Update #2**

Here's the line responsible for the error:

```
$dirs = $this->directories(FALSE, TRUE);
$dir = $dirs[$params['dir_id']]; // error occurs here

```

The definition of $this-\>directories is as follows:

```
function directories($ajax = FALSE, $return_all = FALSE, $ignore_site_id = FALSE)

```

Seems odd that it's passing $ajax as FALSE when it's being called by ajax. Could this be the problem?

# Answer
> 1 votes
Have you tried updating to the latest version of Matrix? Perhaps it's a compatibility issue. https://docs.pixelandtonic.com/matrix/changelog.html

---
Tags: ee2, matrix, file-uploads
---


title: Multi SIte Manager and Grid Field

text:
# Question
Title: Multi SIte Manager and Grid Field
I'm using multi site manager to duplicate a site but when I create the site all the grid field types data are missing.

I used the option to duplicate channel and channel entries when creating the new site and other fields have copied correctly.

I'm using ExpressionEngine 2.9.2 and Multiple Site Manager 2.1.7.

Is there a issue with MSM and the grid field type?

# Answer
Most likely when you duplicated the channel this did not automatically duplicate the exp\_channel\_grid\_filed tables because that would not make any sense, as the entry\_id(s) would be different.

Duplicating channels with grid fields is a little more complicated. Take a look at your table structure in mySQL to see what has happened. I hope that that helps you to see what you can do.
> 0 votes

---
Tags: multi-site-manager, grid
---


# Question
Title: How to add HTML5 validation to Freeform Pro Composer Bootstrap template
This is the code for a Freeform Pro Bootstrap Composer template. How to add HTML5 validation for all the possible 'required' instances: textfield, textarea, radios, checkboxes, selects?

Normally, in static Freeform templates I would use Bootstrap js validation. But when it comes to flexibility and ease of use for clients to compose forms with required fields it is more easy to use HTML5 validation as there are no variables required in scripts. And last but not least, it is much easier to use HTML5 validation in a multi language site.

So, I hope someone can help me with this: how to add HTML5 validation to this Freeform Pro Composer Bootstrap template?

```
    <style type="text/css">
    .freeform_composer .form-group.required .field_label:after { content: "*"; color: red; }
    .freeform_composer ul.dynamic_recipients { list-style: none; padding: 0; }
    .freeform_composer ul.dynamic_recipients label { font-weight: normal; }
    </style>
    <div class="freeform_composer">
    {composer:page}
    {composer:rows}
    <div class="row">
    {composer:columns}
    <div class="{if composer:column_total == "1"}col-sm-12{if:elseif composer:column_total == "2"}col-sm-6{if:elseif composer:column_total == "3"}col-sm-4{if:elseif composer:column_total == "4"}col-sm-3{/if}">
    {if composer:field_total == 0} {/if}
    {composer:fields}
    {if composer:field_type == 'nonfield_title'}
    <h3>{composer:field_output}</h3>
    {if:elseif composer:field_type == 'nonfield_paragraph'}
    {composer:field_output}
    {if:else}
    <div class="form-group{if composer:field_required} required{/if}">
    {if composer:field_label}
    {if composer:field_type == 'nonfield_captcha'}
    {if freeform:captcha}
    <label class="field_label" for="freeform_captcha">
        Captcha
    </label>
    {/if}
    {if:elseif composer:field_type == 'checkbox'}
    {!-- We'll display its label later down the page --}
    {if:else}
    <label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
    {composer:field_label}
    </label>
    {/if}
    {/if}
    {if composer:field_output}
    {if composer:field_type == 'nonfield_captcha'}
    {if freeform:captcha}
    <div class="row">
    <div class="col-sm-6">
        <input type="text" name="captcha" id="freeform_captcha" class="form-control" placeholder="Enter the word you see in the image" />
    </div>
    <div class="col-sm-6">
        {freeform:captcha}
    </div>
    </div>
    {/if}
    {if:elseif composer:field_type == 'checkbox_group'}
    {freeform:field:{composer:field_name}
    wrapper_open="" wrapper_close=""
    row_wrapper_open="<div class='checkbox'><label>" row_wrapper_close="</label></div>"
    label_wrapper_open="" label_wrapper_close=""
    input_wrapper_open="" input_wrapper_close=""
    order="CL"
    attr:id="freeform_{composer:field_name}"
    }
    {if:elseif composer:field_type == 'checkbox'}
    <div class="checkbox">
    <label>
        <input type="hidden" name="{composer:field_name}" value="n" />
        <input type="checkbox" name="{composer:field_name}" id="freeform_{composer:field_name}" value="y">
        {composer:field_label}
    </label>
    </div>
    {if:elseif composer:field_type == 'radio'}
    {freeform:field:{composer:field_name}
    wrapper_open="" wrapper_close=""
    row_wrapper_open="<div class='radio'><label for='%id%'>" row_wrapper_close="</label></div>"
    label_wrapper_open="" label_wrapper_close=""
    input_wrapper_open="" input_wrapper_close=""
    order="RL"
    attr:id="freeform_{composer:field_name}"
    }
    {if:elseif composer:field_type == 'file_upload'}
    {composer:field_output}
    {if:elseif composer:field_type == 'nonfield_dynamic_recipients'}
    {composer:field_output}
    {if:elseif composer:field_type == 'nonfield_submit'}
    <button type="submit" class="btn btn-success">Submit</button>
    {if:elseif composer:field_type == 'nonfield_submit_previous'} {!-- for multi-page forms --}
    <input type="submit" name="submit_to_previous" value="Previous" class="btn btn-success" />
    {if:else}
    {freeform:field:{composer:field_name}
    attr:id="freeform_{composer:field_name}"
    attr:class="form-control"
    attr:placeholder="{composer:field_label}"
    }
    {/if}
    {/if}
    </div>
    {/if}
    {/composer:fields}
    </div>
    {/composer:columns}
    </div>
    {/composer:rows}
    {/composer:page}
    </div>

```

# Answer
https://solspace.com/legacy\_docs/freeform-4/composer/

"Using the HTML5 required attribute with composer

If you want to use the HTML5 required attribute with required fields in Composer you can use a conditional pair to check that it's required and is a custom field, then add the attributes to the field:"

```
<p>
{if composer:field_name AND composer:field_required}
    {freeform:field:{composer:field_name} attr:required="required" attr:class="required"}
{if:else}
    {composer:field_output}
{/if}
</p>

```
> 0 votes

# Answer
This works for a textfield and textarea.

```
    {freeform:field:{composer:field_name}
    attr:id="freeform_{composer:field_name}"
    attr:class="form-control"
    attr:placeholder="{composer:field_label}"
    {if composer:field_name AND composer:field_required}
    attr:required="required"
    {/if}
    }

```

**But this does not work for a radiogroup, no required is added.**

```
   {if:elseif composer:field_type == 'radio'}
   {freeform:field:{composer:field_name}
   wrapper_open="" wrapper_close=""
   row_wrapper_open="<div class='radio'><label for='%id%'>"
   row_wrapper_close="</label></div>"
   label_wrapper_open="" label_wrapper_close=""
   input_wrapper_open="" input_wrapper_close=""
   order="RL"
   attr:id="freeform_{composer:field_name}"
   {if composer:field_name AND composer:field_required}
   attr:required="required"
   {/if}
   }

```
> 0 votes

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


title: Facebook Dynamic Open Graph Meta Data

text:
# Question
Title: Facebook Dynamic Open Graph Meta Data
I want to dynamically add content to the facebook open graph meta data. Here's my code, but the content field shows up blank on page load.

```
<meta property="og:title" content="{exp:channel:entries}{title}{/exp:channel:entries}">

```

I tried the other solutions and SEO Lite has very bad documentation so I'm not sure what to do.

# Answer
> 1 votes
Well, first of all, your `{exp:channel:entries}` tag has zero parameters, meaning you have little control over what's being loaded unless it is detecting it from the URL. I'm also guessing it's possible this Channel Entries loop lives inside of another one, which won't work. You'll have to provide significantly more information for us to give you a real answer...

But without more details, I'm going to guess you have a nested Channel Entries loop. Use an embed if you need to pull a different channel entry title in, or just use the `{title}` tag if it's already in a loop.

If it isn't nested and you're not sure what's going on, try hard coding an `entry_id` and test a few parameters to see if you get an output. Try these parameters on the tag:

```
{exp:channel:entries entry_id='1' dynamic='no' limit='1'}{title}{/exp:channel:entries}

```

Use a known `entry_id` that has a status of **open**. See if that gets you somewhere.

---
Tags: facebook, metadata
---


# Question
Title: Search form with Croxton Search Fields help
Has anyone used Croxton's Search Fields plugin? This is my first time using it. I'm trying to get a search form working and am running into difficulties getting it to pull results. Ordinarily I'd just use the normal Simple Search module, but I need different search fields to search specific custom fields.

Here is what I have so far:

```
    <form>
    <p>
            <label for="keywords">Property Name:</label><br>
            <input type="text" name="keyword" id="keyword" />
    </p>
    <p>
            <label for="keywords">County:</label><br>
            <input type="text" name="county" id="county" />
    </p>
    <p>
            <input type="hidden" name="XID" value="{XID_HASH}" />
            <input type="submit" value="submit" class="submit">
    </p>
    </form>
    {exp:search_fields
    search:title="keyword"
    search:county="county"
    channel="available_site"
    operator="OR"
    parse="inward"}{search_results}
      {exp:channel:entries entry_id="{search_results}" disable="member_data|categories" dynamic="no" orderby="title" sort="asc" limit="10"}
        <a href="{page_url}">{title}</a>
      {/exp:channel:entries}
    {/exp:search_fields}

```

I'm sure I've just missed something simple, but I can't find it. Thanks!

**UPDATE:**

I've adjusted it again to more closely resemble the example in the readme, but I'm still not any results.

Here is my search page:

```
        <form method="post">
    <p>
            <label>Property Name:</label><br>
            <input type="text" name="search:title" />
    </p>
    <p>
            <input type="hidden" name="XID" value="{XID_HASH}" />
            <input type="submit" value="submit" class="submit">
    </p>
    </form>
    {embed="properties/search_results" search='{exp:get_parameters post="search"}'}

```

and the embedded search results template

```
{exp:search_fields
search:title="{embed:search}"
operator="OR"
channel="available_site"
parse="inward"}

<p>Search results for ‘<em>{embed:search}</em>’</p>
{exp:channel:entries channel="available_site" entry_id="{search_results}" disable="member_data|categories" dynamic="no" orderby="title" sort="asc" limit="10"}

    <a href="{page_url}">{title}</a>

    {paginate}
    <div class="pagination">
        <ul>
            <li class="previous">{if previous_page}<a href="{auto_path}">Prev</a>{/if}</li>
            <li class="next">{if next_page}<a href="{auto_path}">Next</a>{/if}</li>
        </ul>
        <p>Page {current_page} of {total_pages}</p>
    </div>
    {/paginate}

{/exp:channel:entries}

{if no_results}
    <p class="intro">Sorry, no matches were found for ‘<em>{embed:search}</em>’.</p>
{/if}

```

{/exp:search\_fields}

But I just get the message "Sorry, no matches were found for ." It doesn't look like any information at all is being passed from the form to the results template.

any ideas?

# Answer
From what I can see, you're mixing up two different methods of using Search Fields. You can use the dynamic parameters parameter without using the get\_parameters plugin. I've never done this, but it should work. Your code would look like this:

```
<form method="post">
    <p>
        <label for="keywords">Property Name:</label><br>
        <input type="text" name="search:title" id="keyword" />
    </p>
    <p>
        <label for="keywords">County:</label><br>
        <input type="text" name="search:county" id="county" />
    </p>
    <p>
        <input type="hidden" name="XID" value="{XID_HASH}" />
        <input type="submit" value="submit" class="submit">
    </p>
</form>
{exp:search_fields
    dynamic_parameters="title|county"
    channel="available_site"
    operator="OR"
    parse="inward"
}
    {exp:channel:entries entry_id="{search_results}" disable="member_data|categories" dynamic="no" orderby="title" sort="asc" limit="10"}
        <a href="{page_url}">{title}</a>
  {/exp:channel:entries}
{/exp:search_fields}

```
> 0 votes

---
Tags: search
---


title: Low Seg to cat (if category not found)

text:
# Question
Title: Low Seg to cat (if category not found)
If the seg\_to\_cat can't be analyzed, (the category doesn't exist), the resulting page shows all the entries in the channel. What can be done to show instead a "no results found" page?

# Answer
You can conditionally check your segment variables from the extension:

```
{if segment_2_category_name}

    This category exists.

    {exp:channel:entries category="{segment_2_category_id}"}
        ...{title}...
    {/exp:channel:entries}

{if:else}

    No results code, or {redirect="404"}

{/if}

```
> 1 votes

---
Tags: low, low-seg2cat
---


title: Database rollback

text:
# Question
Title: Database rollback
Working on a site with a staging environment. a quick question, is there a way to roll back a database change to previous import for testing purposes.

eg. i test something on local which alters the database, i push files and other non db relevant changes to staging, i change db on staging to accommodate local changes, i find there's some issues on staging with the db changes?

how would be able to rollback or undo database changes on staging?

# Answer
Slightly confusing question. Unless you are employing a migrations tracking tool like Phinx, you are left to your own devices. As for DB migrations with EE, there isn't any easily deployable tools for us. It's slightly annoying. Here is a general workflow:

1. Test on local developer instance of site making code and database schema changes.
2. Make schema changes to target (staging or production) server, then push code.
3. If reversion is required, rollback your deployed branch on target, and undo schema changes manually (delete Channel, delete Field Group, etc...)

The key to this system is to be additive until your current task is complete and in place, and only then should you remove any unused tables or columns. The idea is that if you have to develop a new iteration of an appliance already in place and in production, but it requires schema changes, simply add new columns/tables to accommodate your new iteration of this appliance. Then once it's complete, import your data from the old appliance tables into the new one, and then point all old references to the old appliance towards the new one. Then you can safely remove the old version's database columns / tables.

BUT, for the future... if you need to be extra careful between local and staging, simply export your target's database as a backup before making any schema changes. Then if it goes ary and you don't know what tables and columns and rows to manually remove, you can simply import your backup.
> 0 votes

---
Tags: database, workflow
---


title: new password is still not working

text:
# Question
Title: new password is still not working
I changed password correctly according to the procedure but the new password still not working. I can not access control panel of my website to change some contents. Please help

# Answer
> 0 votes
How did you change password? which steps did you folllow?

you can check this thread possible duplicate: Change admin password programmatically using PHP or MySQL

---
Tags: password
---


title: Expresso Store, price for US customers

text:
# Question
Title: Expresso Store, price for US customers
We're using Store 2.3.1 for a company based outside the US, but who sells to the US market. They've asked if we can reduce the price of the product by 18.7% if the customer is from the US. Is this possible?

# Answer
> 1 votes
There isn't really a way to apply a discount based upon a users location but you should be able to do this fairly easily via a tax setting of 18.7% other then the US. Other then that you would have the option to either create a discount then pragmatically apply it after a user entered their shipping/billing details or the more robust option of creating an extension to apply the discount based upon a users location.

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


# Question
Title: Custom AddOn, Using SimplePie to display an enclosure
I need to display an RSS feed on my site. I could use the built in RSS\_Parser add-on, however that add-on does not appear to support adding an item enclosure (image). This is a requirement for this project.

I have elected to write my own. I have loaded the SimplePie library and I have it essentially working, just like the native Add-On, but the enclosure is not working.

I'm trying to put all the attributes into an array, like so:

```
        $items[] = array(
            'item_title'        => $item->get_title(),
            'item_link'         => $item->get_permalink(),
            'item_date'         => $item->get_date('U'),
            'item_content'      => $item->get_content(),
            'item_img'          =>  $item->get_enclosure(),
            'item_description'  => $item->get_description(),
            'item_categories'   => $categories,
            'item_authors'      => $authors
        );
    }
    return $items;

```

However, when using the item\_img tag in the template, it returns a string of gibberish. Anyone know how to get it to return the url to the enclosure?

The feed i'm trying to parse is here: http://tntoday.utk.edu/feed/

I have done this with straight-up PHP, but having it as an add-on, easily accessible to content editors throughout the site would be greatly preferred.

# Answer
Figured it out. Basically the error was being cause when an entry did not have an enclosure. The answer was to check if it *had* an enclosure first.

So it goes something like this:

```
if ( $enclosure = $item->get_enclosure() ) {   // If there is an image.
        $items[] = array(
                'item_title'            => $item->get_title(),
                'item_link'             => $item->get_permalink(),
                'item_date'             => $item->get_date('U'),
                'item_content'        => $item->get_content(),
                'item_description'  => $item->get_description(),
                'item_categories'   => $categories,
                'item_authors'      => $authors,
                'item_img'          =>  $item->get_enclosure(0)->get_link()
        );
  } else {   // if there is not

            $items[] = array(
                'item_title'            => $item->get_title(),
                'item_link'             => $item->get_permalink(),
                'item_date'             => $item->get_date('U'),
                'item_content'        => $item->get_content(),
                'item_description'  => $item->get_description(),
                'item_categories'   => $categories,
                'item_authors'      => $authors,
                'item_img'      => '/images/interface/no-thumb.jpg'
            );
    }
  return $items;

```
> 1 votes

# Answer
Try a simple test like

```
$feed = new SimplePie();
$feed->set_feed_url('http://tntoday.utk.edu/feed/');
$feed->init();
$feed->handle_content_type();

foreach ($feed->get_items() as $item)
{
    if ($enclosure = $item->get_enclosure())
    {
        echo $enclosure->embed();
    }
}

```

What do you get?
> 0 votes

---
Tags: add-on-development, rss
---


# Question
Title: Listing grid fields as a relationship choice
I'm building a site for a legal firm and I'd like to have each practice area display the lawyers that handle that type of law.

For example, if you went to the page that dealt with business law, it would list the 2-3 attorneys that specialize in that area of law.

Currently, I have a channel that handles the list of legal staff. This channel has a channel entry that has a Grid field with three columns... name, headshot and bio.

On the entry pages for the "practice area" pages, I have a Wygwam field for content and a Relationship field I'd like to connect to the channel entry that contains the staff Grid field.

Right now, when I connect the relationship field to the channel entry (staff listing), all I see in the select box for the Relationship field is the name of the channel entry.

Is it possible to have a relationship that lists the individual grid rows?

# Answer
> 2 votes
I don't think you'll be able to solve it this way. The intent of relationships is to relate **Channel Entries** together, not relate different data points in a specific entry to another entry.

I would recommend making a staff channel where each member has their own channel entry. That allows for way more leeway in what you're trying to do; It's also how I've seen every "staff listing" style implementation in any EE site I've built or worked on.

---
Tags: relationships, grid
---


# Question
Title: Display only unique values from a Matrix column
Am trying to display only unique values from a matrix column

Is it possible with using the Query module?

# Answer
Well, the query module gives you direct access to SQL querying your database tables, so this seem quite possible. It depends on the complexity: Are you looking to isolate rows based on a unique column? Isolate entirely unique rows? We'd need more details to help better.

But, without more info, a good start is learning about the `DISTINCT` clause available in MySQL queries: http://www.mysqltutorial.org/mysql-distinct.aspx
> 2 votes

---
Tags: matrix, pixelandtonic
---


# Question
Title: How to prevent Assets uploads within Wygwam for specific user group(s)?
I have created a restricted user group for external bloggers; I want to be able to prevent them from uploading images via Assets, but I'm not sure how. I've restricted access to the Assets module for that particular user group (in Module Access Privileges), so while they can't access it directly, it still appears when they click on the image icon in Wygwam.

Regardless, they have full access to the content of Assets, including the ability to upload.

How do I restrict this? Ideally they wouldn't have access to Assets at all, but if I could keep them from uploading, that would be OK as well.

Currently running EE 2.7.2, with Assets 2.1.4 and Wygwam 3.2.1

# Answer
> 0 votes
Oh right, this is an easy one. You won't be able to take away the button in Wygwam for this solution as your regular editors need it, but the answer is a no brainer. You need to edit your **File Upload Preferences**.

EE2 Docs

EE3 Docs

Simply change the privileges for your guest bloggers' Member Group for all upload paths.

---
Tags: assets, wygwam, file-uploads, users
---


title: How to turn on blog function?

text:
# Question
Title: How to turn on blog function?
there! We are using a very dated version of EE (2003- 2010). I am not proficient in web management, so I need a lot of help getting this website updated. First thing's first... How do I start blogging? Thanks! NFM

# Answer
In short, there's not a "blog function". Content in ExpressionEngine is stored in channels, or weblogs in older versions of EE. A channel contains a collection of entries, which could be blog posts, pages, or any other type of content. Entries are made up of a set of fields, which represent the different information you put into an entry, such as title, body, description, image, etc.

I'd suggest reading the documentation or some tutorials to get a better handle on how EE works, and then come back here with more specific questions later, which I'm sure someone will be happy to help you with.
> 1 votes

---
Tags: how-to
---


# Question
Title: Special Characters in Template Group Name (Chinese Characters)
We have a translated page in Chinese just so we can give the Chinese users a quick understanding in there language what the website is about. We want to display it here: domain.com/中文

Where 中文 = chinese so that part of the URL is also in there language.

Easiest way I'd of thought would be to make a Template group and give it the name 中文 and then create and index page and boom - its done.

Expression Engine however only seems to accept unicode characters or something because characters with accents and Chinese, Japanese Korean etc characters are not allowed. Anyone know of a work around or a way for Chinese characters to be accepted?

# Answer
You can't use template groups like that, it can't handle double byte characters, only alphanumeric.

Ideally you need to use a multi-language add-on like Publisher or Transcribe which allow for translated URLs.

Just tried it with Construct and it crashes it, so that's not an option :(

On a simpler solution, I've just tried it with Template Routes (built into EE2 and EE3 versions), which does allow you to set up specific routes from your "/中文" page to a specific template - therefore you can mask the template name. But this may get complex if you have lots of pages you want to implement this with. The issue is also compounded in Entries can only have alphanumeric for the url\_title - so how will you match dynamic content?
> 0 votes

---
Tags: templates, multi-language, language, template-manager
---


# Question
Title: File field acting like it's required when it's not
I've got a channel set up that includes a couple of file fields that allow editors to add images to entries. I have these fields set up to accept images only and as not required, but when I try to publish entries, I'm seeing error messages on those fields saying "You did not select a file to upload."

If I choose an image for both fields, I'm able to Submit the entry form and save the entry.

Also, once the entry is saved, If I edit it, I'm able to remove the images from the fields and re-submit and the entry will save.

But if I edit the entry again and try to submit it without re-adding the images, I'm unable to save.

Has anyone else run into this issue? Any ideas?

This site is running EE 2.7.1 and I'm seeing this issue on both production and local environments.

# Answer
This is a bug: https://support.ellislab.com/bugs/detail/19732

I ended up setting the allowed upload directories to "all" per the recommended workaround.
> 0 votes

---
Tags: ee2, control-panel, file-uploads
---


# Question
Title: Web Crawlers detecting published pages with "closed" status.
I want to begin using the page scheduler to set the "closed" status to pages to "open" once a specific date comes. My question is, will web crawlers still be able to find published pages if the entry status = "Closed"?

# Answer
> 1 votes
In EE content lives in Channels Entries - do you mean Channel Entries rather than Pages in your post?

For channel entries, if you make the channel entry status equal to 'closed' normally anything external to EE won't see it (page crawlers included). Similarly if you set the publish dates for an entry it won't be shown to anything external except during the period that the publish dates are valid.

As with most things in EE a lot depends on how your templates are designed - as it is possible to override or change the behaviour attached to 'open' / 'closed' status and regarding publish dates - so if you want some unusual behaviour regarding these two elements you can program it into your template design.

A "Page" in EE normally refers to a channel entry tied to a specific URL form that overrides the standard routing protocols for a channel entry within EE. Content set up using the Page feature will follow same logic as for a Channel Entry with regard to publish dates (which also can be over-ridden within the Template design if required).

If by "Page" you mean EE content created with something like "Structure" (an add-on that makes EE behave a bit like Wordpress) I guess you need to check its documentation, but I'd imagine it would follow normal patterns.

If you want to show some content to web crawlers that you don't show to visitors (?why?) I guess you could set up some logic within your template to sniff for the User Agent string and send different information to the crawler as required.

HTH

# Answer
> 0 votes
In theory they shouldn't be accessible but I have sometimes come across it when the URL is still there but with no content.

This can be overcome by adding this into your entries loop.

{if no\_results} {redirect="404"} {/if}

So if there are no entries in the loop, or all or set to closed then you will get redirected to your 404 page.

---
Tags: channel-entries
---


# Question
Title: Will Focus Lab EE Master Config work as-is on EE3?
I have used Focus Lab's EE Master Config on every EE2 site I've built, since I heard about it. Now I am working on a site in EE3, and wondering, will this setup work as-is for EE3, or will it require any modifications? Or is there an updated version out there?

Thanks!

# Answer
Yes! There's an EE3-ready version available on GitHub now: https://github.com/focuslabllc/ee-master-config/tree/EE3
> 2 votes

---
Tags: focus-lab-master-config, ee3, config-overrides
---


title: if statements that can alter a layout

text:
# Question
Title: if statements that can alter a layout
Im working on a project where there are two divs next too each other (not worried about the styling for now) but my question is the following.

div 1 | div 2

if there's no channels fields in div 2 hide the div and make div 100%. i tried adding the if statements before the div and also tried the if results == statement, nothing changed.

Anyone who has experienced this issue and solved it.

# Answer
Assuming 2 fields firstname and lastname...

```
<div class="{if lastname}half{if:else}full{/if}">
  {firstname}
</div>
{if lastname}
  <div class="half">
    {lastname}
  </div>
{/if}

```

Or if either field could be missing/empty...

```
{if firstname}
  <div class="{if lastname}half{if:else}full{/if}">
    {firstname}
  </div>
{/if}
{if lastname}
  <div class="{if firstname}half{if:else}full{/if}">
    {lastname}
  </div>
{/if}

```
> 2 votes

---
Tags: conditionals, template-layouts
---