# Question
Title: In Solspace Superseach Use the ampersand as the separator like this: pie&&cheese
In the docs if I want the search to include all of the words it says:

Use the ampersand as the separator like this: pie&&cheese.

When I use it, it defaults with a "+" not "&" so how do I change in the search form? It works in the URL (If I change manually) so this is all I need to complete.

Thanks Guy

# Answer
Keyword searches are inclusive by default (whether or not you see the **+** or **&&**), unless disabled with the inclusive\_keywords parameter, but there isn't a way to automatically make custom field searches inclusive, aside from having the user actually type && instead of space(s).
> 0 votes

---
Tags: solspace, supersearch
---


# Question
Title: Expression Engine file manager - Error on browsing uploaded images
I'm running EE v2.10.1

After a migration the File Manager, while selecting a file in an entry, stopped functioning. The File Manager opened via Content -\> Files -\> File manager gives no issues.

When I use the file manager via Content -\> Publish -\> Page(= channel name) -\> link 'Add File'. This opens the file manger popup. The first thing that I notice is that the wrong channel image are being displayed. Secondly I'm not able to search. And at last the pagination does not work and refreshes the whole page and shows the error "The page you requested was not found." The URL is changed to http://sitename.dev/C=content\_publish&M=filemanager\_actions&action=directory\_contents&tbl\_offset=15

The console doesn't show any javascript errors.

I search for a solution and tried a couple of solutions, like:

* Clear all chache
* Deleted the themes folder and get a fresh version
* Run Module Updates
* Updated all extensions and modules
* Checked the configuration

The following third party modules are installed (latest version):

* cp\_css\_js
* ending
* entry\_type
* forms
* forms\_linked
* loopee
* low\_seg2cat
* publisher
* publisher\_drivers
* publisher\_language\_control
* stash
* streeng

I'm a bit lost on how to solve this since it appeared after a migration.

# Answer
I just encountered this issue last week, and EllisLab confirmed it as a bug that can present itself under certain conditions (related to a special character in a file name causing `json_encode()` to fail). They fixed it in my problem install, so if you have a support plan I'd suggest you open a ticket with them.

Kevin said it would be fixed in the next point release.
> 1 votes

---
Tags: image, file-manager
---


title: Solspace Tracker - by member group?

text:
# Question
Title: Solspace Tracker - by member group?
Is there a way to view stats broken per member group or individual member?

# Answer
Unfortunately that's not possible. Tracker tracks entry views, but doesn't collect information about the visiting user. Google Analytics or something open source such as Piwik could provide that kind of functionality.
> 1 votes

---
Tags: solspace
---


# Question
Title: Total entry views for all entries in a given category
We have a basic query, which get us; cat\_id, parent\_id, cat\_name and the total entry\_count which is then displayed in the form of a report... the current query is:

```
SELECT c.cat_id, c.parent_id, c.cat_name, count(t.entry_id) AS entry_count
FROM exp_categories c
JOIN exp_category_posts p ON p.cat_id=c.cat_id
LEFT JOIN exp_channel_titles t ON p.entry_id=t.entry_id AND  t.channel_id IN (2,6,7,8,9,10)
WHERE c.group_id=1
GROUP BY c.cat_id

```

This works, however we also want to get the TOTAL view\_count\_one for all entries in a given category...

Any ideas how this would be expanded to achieve this?

# Answer
> 2 votes
You *should* be able to simply add:

```
SUM(t.view_count_one) as view_count

```

... to your `SELECT` statement.

---
Tags: database, query, count, query-module
---


# Question
Title: Focus Lab's EE Master Config Error with MAMP
I'm getting the following error:

`Fatal error: Call to undefined method CI_Config::site_prefs() in ...Dev/cms/ee.dev/system/expressionengine/libraries/Core.php on line 122`

My setup is as follows: MAMP, EE 2.10.1

```
ee.dev
- config
- public_html
- system

```

`Dev` is my MAMP `htdocs` folder and I have custom virtual hosts setup as follows:

```
<VirtualHost *:80>
  DocumentRoot "/Dev/cms/ee.dev/public_html/"
  ServerName ee.dev
</VirtualHost>

<Directory "/Dev/cms/ee.dev/public_html/">
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Order allow,deny
        Allow from all
</Directory>

```

---

I was originally getting another error, so I updated the system paths in the main `index.php` and `admin.php`:

Changing `$system_path = './system';` to `$system_path = '../system';`

# Answer
> 0 votes
don't use the sample config file from that repo. Here's the issue you seem to be experiencing https://github.com/focuslabllc/ee-master-config/issues/2

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


# Question
Title: Assets: Cannot upload file using "simple file input" method
I have an assets field called "member\_thumbnail" on my "members" channel (created by zoo visitor). When I make a channel:form edit form or the equivalent edit form from zoo visitor, I am able to successfully upload files using the native full assets field ({exp:assets\_field\_name}) but not with the simple file input method outlined at the docs here:

http://docs.pixelandtonic.com/assets/templating/channel\_form.html

I found a workaround here: Simple HTML file field uploads with Assets and Safecracker

The workaround is to add a hidden input with NULL value for the field name you want to affect. Unfortunately, when you submit the form without changing the photo this way, the photo is cleared, naturally. So this workaround causes too many problems.

I want to use the simple method to avoid showing visitors all the uploaded files in the directory they are uploading to. Otherwise I would be happy to use the full assets field.

# Answer
> 3 votes
This is due to a change in how EE validates Channel Form fields (not sure when this was implemented). When you upload a file via a `file` field, that field name isn't actually populated in the `$_POST` array, so EE doesn't know it's been submitted, and hence won't call the fieldtype which owns that field.

It works around this issue for native File fields inside the Channel Form library like so:

```
if (in_array($field['field_type'], $this->file_fields))
{
    // trick validation into calling the file fieldtype
    if (isset($_FILES[$field['field_name']]['name']))
    {
        $_POST[$field['field_name']] = $_FILES[$field['field_name']]['name'];
    }
}

```

Thankfully there is a way to add additional fieldtypes to the `file_fields` array (which by default includes only File fieldtype). Just add this line to your **config.php** file:

```
$config['safecracker_file_fields'] = array('assets');

```

Voila. This method will now work for adding new uploads to an Assets field, *or* leaving the existing data alone without losing it on update:

```
<input type="file" name="my_file_field" />
<input type="hidden" name="my_file_field_filedir" value="1" />

```

**UPDATE:** Nothing's ever easy - there appears to be an EE bug which may *still* remove existing file selections. Reported here.

---
Tags: assets, pixelandtonic
---


# Question
Title: Database Error 1364 in Solspace Calendar
We recently had a server failure that resulted in having to rebuild the server services. Ended up going from mySQL 5.1 to 5.6.23. Since that issue occurred, one of our clients is reporting that Calendar gives him this error when trying to create new events:

A Database Error Occurred Error Number: 1364

Field 'last\_date' doesn't have a default value

Client reports that entry gets made, just doesn't have an date info in the Calendar field.

It's EE 2.8.1 and Calendar 1.8.9.

# Answer
The issue shown here was resolved by adding a default value (0) into the exp\_calendar\_events table, 'last\_date' field. Not sure how it got gone, perhaps it was a result of the mysql version change or maybe the missing value wasn't an issue until the version change, but adding the default value resolved the issue for me.
> 1 votes

---
Tags: solspace-calendar
---


# Question
Title: Focus Lab Master Config vs System Config
My base template path doesn't appear to be working, and I'm not quite sure what I should have in the `system/../config.php` file? (I started with a `config.php` file from another project that doesn't use the Focus labs master config.)

My `config.master.php` is unchanged. I can access the CP but templates don't seem to be loading despite the master config: `$env_config['tmpl_file_basepath'] = $base_path . '/../templates';`

My setup is on MAMP with vhosts, and looks like this:

```
ee.dev
- config
- public_html
- system
- templates

```

`system/config/config.php` is as follows:

```
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| ExpressionEngine Config Items
|--------------------------------------------------------------------------
|
| The following items are for use with ExpressionEngine.  The rest of
| the config items are for use with CodeIgniter, some of which are not
| observed by ExpressionEngine, e.g. 'permitted_uri_chars'
|
*/

$config['app_version'] = '2.10.1';
$config['install_lock'] = "";
$config['license_number'] = "XXXX-XXXX-XXXX-XXXX";
$config['site_label'] = 'ee';
$config['cookie_prefix'] = '';
$config['cache_path'] = '';

$config['mail_protocol']= "smtp";
$config['smtp_server']  = "smtp.postmarkapp.com";
$config['smtp_port']    = "25";
$config['cookie_httponly'] = 'y';
$config['hidden_template_indicator'] = '.';
$config['cache_driver'] = 'file';

// END EE config items

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "";

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of "AUTO" works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'       Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'     Uses the REQUEST_URI
| 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';

/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/urls.html
*/

$config['url_suffix'] = '';

/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';

/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
*/
$config['charset'] = 'UTF-8';

/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the "hooks" feature you must enable it by
| setting this variable to TRUE (boolean).  See the user guide for details.
|
*/
$config['enable_hooks'] = FALSE;

/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries.  For more information please see the user guide:
|
| http://codeigniter.com/user_guide/general/core_classes.html
| http://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'EE_';

/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible.  By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\\-';

/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The two other items let you set the query string "words" that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['directory_trigger'] = 'D';
$config['controller_trigger'] = 'C';
$config['function_trigger'] = 'M';

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
|
|   0 = Disables logging, Error logging TURNED OFF
|   1 = Error Messages (including PHP errors)
|   2 = Debug Messages
|   3 = Informational Messages
|   4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;

$config['debug'] = "0";
ini_set('display_errors', 0);
error_reporting(0);

/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/logs/ folder.  Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';

/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';

/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| system/cache/ folder.  Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class or the Sessions class with encryption
| enabled you MUST set an encryption key.  See the user guide for info.
|
*/
$config['encryption_key'] = 'XXXXXX';

/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = FALSE;

/*
|--------------------------------------------------------------------------
| CSRF Protection
|--------------------------------------------------------------------------
|
| Determines whether Cross Site Request Forgery protection is enabled.
| For more info visit the security library page of the user guide
|
*/
$config['csrf_protection'] = FALSE;

/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads.  When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| VERY IMPORTANT:  If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts.  For
| compression to work, nothing can be sent before the output buffer is called
| by the output class.  Do not "echo" any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;

/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are "local" or "gmt".  This pref tells the system whether to use
| your server's local time as the master "now" reference, or convert it to
| GMT.  See the "date helper" page of the user guide for information
| regarding date handling.
|
*/
$config['time_reference'] = 'local';

/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files.  Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = TRUE;

/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy IP
| addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR
| header in order to properly identify the visitor's IP address.
| Comma-delimited, e.g. '10.0.1.200,10.0.1.201'
|
*/
$config['proxy_ips'] = "";

/**
 * Require the Focus Lab, LLC Master Config file
 */
require $_SERVER['DOCUMENT_ROOT'] . '/../config/config.master.php';

/* End of file config.php */
/* Location: ./system/expressionengine/config/config.php */

```

# Answer
> 0 votes
Solved it.

Annoyingly, I hadn't put the templates inside a `default_site` subfolder.

So the setup should in fact be:

```
ee.dev
- config
- public_html
- system
- templates
-- default_site
--- * templates go in here! *

```

All working now.

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


# Question
Title: Upgrade to EE 2.10.1 - An Error Was Encountered Non-existent class: Template
I successfully upgraded a site from EE 2.9.1 to 2.10.1, but when I go to the home page I get the following error:

> An Error Was Encountered Non-existent class: Template

I can access the control panel but I can't get past the error notice on public facing pages. I have searched and find only one old reference to this error. Can anyone shed light on the cause and solution to this?

# Answer
> 1 votes
Turns out that expressionengine/libraries/template.php was empty on the server. Something must have happened in transit that wiped the file clean. I uploaded a fresh copy and everything was a good as new.

---
Tags: error, ee2-upgrades
---


title: Multi-Language lang switch Transcribe

text:
# Question
Title: Multi-Language lang switch Transcribe
I have a issue with my language switcher when i'm in a entry page.

In this page, i rewrite the last-segment url witch is my product name with this script :

```
    <?php
    $outvar = "";
    $langvar = "{transcribe:language_abbreviation}";

    if ($langvar == "fr") {
    $outvar = $outvar . 'search:url-title-fr="{transcribe:last_segment}" ';
    }

    if ($langvar == "nl") {
    $outvar = $outvar . 'search:url-title-nl="{transcribe:last_segment}" ';
    }
    ?>

    {exp:channel:entries channel="products" <?php echo $outvar ?>}

```

The url become this :

FR : /fr/detail/MYPRODUCTNAMEINFRENCH
NL : /nl/detail/MYPRODUCTNAMEINDUTCH

Suppose my website is in French, when i click on my language switch (to show dutch version) i made with transcribe, i have :

/nl/detail/MYPRODUCTNAMEINFRENCH

the last segment stay in French.

Can you help to change this last segment when i switch language ?

Thanks

Jérôme

# Answer
> 0 votes
I think you're going about it in the wrong way. If you have an entry for the french language, you should relate that entry to a new/existing entry under the transcribe tab. The default transcribe language switcher will show the correct entry if the relationship was made. If you haven't made the relationship it will default to the homepage. there should be no need for php

# Answer
> 0 votes
Thank you for your answer.

The problem is i don't want to duplicate all my channel fields because i have common custom fields for both languages. For example, i have a custom field for the product number and the code is the same for all languages. So i don't think transcribe is really useful in my case except for page and variable translation. But my client want two different url depend of languages for one product ans that's all the problem :-)

thanks.

---
Tags: segments, transcribe, language
---


# Question
Title: File exceeds maximum dimensions and is not resizable
Site was moved to a different server. Trying to add/upload an image via the wygwam field but get the below error after selecting the image:

> File exceeds maximum dimensions and is not resizable.

Any help is appreciated.

# Answer
A solution but not always an option based on who your hosting provider/server is is to manually set a `php.ini` file on your server dir.

In many cases this can work to manually override default settings set by the host. With some cloud hosting solutions though they will often restrict the override function of manually made php.ini files.

Here's an example of what to begin with for your php.ini

```
memory_limit = 512M //change this value in mb to suit

```

PHP ini Documentation
> 0 votes

# Answer
It's now been a little while since i posted this question. I cannot recall which project this was in relation to but i think it was resolved. I think it was in relation to some server settings, which were completely different to what i was used to / the server admin did not adjust on initial move.

I should have updated this post but it would have taken awhile before it was solved (if at all) and i didn't get a correct answer here.
> 0 votes

---
Tags: wygwam, file-uploads, image
---


# Question
Title: How to set up a "sticky" email or tel type field in Freeform Pro
I'm using Freeform Pro, and I'd like to keep the fields mobile friendly. So an email field *should* be an email type, a phone field *should* be a tel type, etc.

However, Freeform Pro doesn't have the option for an email or tel type field - even if selected as text/email in the admin, it still outputs it as a plain text field.

If I just create the field without freeform tags, it of course is not going to be "sticky" - and that is a problem too.

I also tried using the tag pairs to make the field sticky (that works), but it just converts my email type to text in the html output.

**In my template:**

`{freeform:field:email}
 <input id="freeform_email"
 name="email"
 type="email"
 value="{freeform:data:value}">
{/freeform:field:email}`

**The html output:**

`<input type="text" name="email" value="" id="freeform_email" maxlength="150" />`

UPDATE:

I've also tried with php (unsuccessful at making it sticky):

```
<input
 id="freeform_email" name="email" type="email"
 value="<?php if(isset($_SESSION['email'])) echo $_SESSION['email'];?>"
 >

```

Any ideas on how to make a custom type field like this be sticky in Freeform Pro?

**Note:** *"sticky" means that the form will hold the field values if say there is an error, on page reload the data will remain. Otherwise, it takes the user back to a blank form and they would have to fill out it all over again.*

# Answer
This seems like a front-end thing, but I kind of have no idea what a sticky is. Try this:

Make a sticky field output on your form. Use your developer console (F12 on Windows with Chrome or Firefox), and investigate the sticky input. I'm going to bet it has a sticky class, something like:

```
<input id="whatever" class="whatever whatever-sticky">

```

So whatever the sticky class is, add it to your manual input field.
> 0 votes

---
Tags: solspace-freeform
---


title: Dev Demon - Forum Subscribe

text:
# Question
Title: Dev Demon - Forum Subscribe
Having so much trouble with this plugin, no notifcation emails being sent, also when i subscribe or unsubscribe to a forum i get the following.

```
Fatal error: Call to undefined method EE_Functions::remove_double_slashes() in /var/www/vhosts/domain.co.uk/system/expressionengine/third_party/forum_subscribe/mod.forum_subscribe.php on line 315

```

Using MSM and EE version 2.9

# Answer
Weird. I believe the function call should be:

```
reduce_double_slashes()

```

not:

```
remove_double_slashes()

```

I couldn't find a `remove_double_slashes` in the function library, but found a `reduce_double_slashes` inside of the CI `string_helper` library.

This sort of thing is usually:

A) A faulty installation of the addon (a file didn't get uploaded, etc). But this doesn't seem likely since it is calling an EE core function, not one within the addon's codebase.

B) Incompatible version of the addon and EE. This seems most likely in this case.

Have you reached out to devdemon with these concerns?

**Edit**

Yup, that function has been deprecated since EE 2.6. Reference:

https://ellislab.com/expressionengine/user-guide/development/usage/functions.html#remove-double-slashes

Devdemon needs to get their codebase updated. You can possibly manually update that function call, but there's probably a bunch of other deprecated function calls too; you paid for it, right? They should fix their shit.
> 1 votes

# Answer
Our DB is updated every hour with purchases for support if you buy them on Devot-ee. If you contact us we will provide you an updated version. Thanks!
> 0 votes

---
Tags: devdemon
---


title: Cron for Solspace Calendar and Importer

text:
# Question
Title: Cron for Solspace Calendar and Importer
Would like to setup an EE template that I can run cron jobs through. With Solspace Calendar's {exp:calendar:ics\_update}, I can create a template to include selected calendars and can dynamically set different update cycles (e.g. one a week, twice a week, daily) on the template via a custom channel field for calendar\_calendars.

Some calendars which we want to import from don't have ICS files or have more information on other export formats so we use Solspace Importer for these. The only way I see setting up cron jobs for these is doing it directly and not with a template.

I think I know the answer, but would there be a way to do the same for Importer imports as Calendar imports? If not, would be great to add a similar feature for Solspace Importer.

# Answer
> 0 votes
Importer does not support importing Calendar entries. Only ICS files can be used for import.

I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. :) http://support.solspace.com/support/discussions

As for your templates using `{exp:calendar:ics_update}`, you could use your server's `wget` command in your cron job to access the URL that contains this Calendar tag to update calendars with ICS files.

---
Tags: solspace-calendar, solspace-importer, cron
---


# Question
Title: CartThrob - how are orders and members linked?
Can anyone please help me to determine how CartThrob orders are linked to site members?

We are creating a custom data feed between the site and Sage for a particular project, however we are struggling to pinpoint the exact link(s) between the 3 DB tables below?

**Orders** \- exp\_cartthrob\_order\_items

**Customers** \- exp\_member\_data

**Products** \- exp\_channel\_data

Thanks.

# Answer
(I'm with Vector, the company behind CartThrob).

How familiar are you with you the basic ExpressionEngine table setup? CartThrob uses standard ExpressionEngine entries to store orders and member data, so familiarity with that would help.

All orders are stored as new rows in `exp_channel_titles` and `exp_channel_data`. This has the same setup as any other ExpressionEngine entry-- metadata about the order is in `_titles` while specific custom field data is in `_data`. `exp_channel_titles.author_id` is the `member_id` of the user that placed the order. The order ID/number is the `entry_id`, which is the primary key on both tables.

If you have an order from `_data` and `_titles`, you can grab the `author_id` and look that up as the `member_id` in `exp_members` and `exp_member_data`, which are standard ExpressionEngine tables for storing member information.

And, with the order ID/`entry_id`, you can also query `exp_cartthrob_order_items` to see what specific products were ordered as part of the orders.

Let me know if you need any further information! And, feel free to let us know if we can be of more project-specific help.
> 1 votes

---
Tags: cartthrob, members
---


# Question
Title: remove index.php on Windows 2012 iis 8 using URL Rewrite
I have the latest version of EE installed on a Windows 2012 Server with the URL Rewrite module installed. I'm migrating over to this server from an older apache installation that used Mod Rewrite successfully.

EE is installed in a subdirectory one level down from root (ee) and each dept's index.php file is in another directory (dept1, dept2, etc).

E:/data/web1/ee
E:/data/web1/dept1
E:/data/web1/dept2

We have a bunch of extra EE 'sites' added for various internal departments so I need the rewrite to handle those as well.

```
<rule name="EE rewrite" stopProcessing="true">
    <match url="^/(dept1|dept2|dept3|dept4|dept5)/(.*)$" ignoreCase="true" />
    <conditions logicalGrouping="MatchAny">
        <add input="{R:1}" pattern="^(index\\.php|images|css|js|favicon\\.ico)" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    </conditions>
    <action type="Rewrite" url="/{R:1}/index.php/{R:1}/{R:2}" />
</rule>

```

I've tried importing the apache conf file and that didn't work so I've been bashing my head over this for a while.

With this current iteration above it loads the admin control panel and loads dept home pages ok but fails to load department subpages and links. They return 404.

this works: http://test.example.edu/dept2/
this fails: http://test.example.edu/dept2/blah/stuff

What am I missing?

After resolving the main issue, what can be improved upon?
Might it be an EE config or IIS config?

# Answer
These are the steps I took to get it to work.

1. edit EE system config.php:

$config\[‘uri\_protocol’\] = ‘QUERY\_STRING’;
2. Expression Engine control panel:
Force URL query strings = Off
3. rewrites:

rule 1:

```
^(dept1|dept2|dept3)/?(.*)$
{R:1}/index.php?/{R:1}/{R:2}

```

rule 2:

```
^(.*)$<br/>
ABC/index.php?/{R:1}

```

I also added 'ignore if file' and 'ignore if folder' so the site would display correctly and so I could get into the EE admin control panel.

The entire block of rules is viewable here where I posted the same question on the Ellis Labs site.
> 0 votes

# Answer
I stay 70 million miles away from IIS, but some general research tells me:

http://www.helicontech.com/isapi\_rewrite

purchasing that module for IIS will give your best shot at handling EE with IIS. Also:

http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/expressionengine-on-iis

Not sure why you'd want to run PHP on a less powerful agent (I assume not your choice) and very clearly less supported openly (I can whip up anything you want in .htaccess like magic, but XML? Lolwut?). I know this isn't the most helpful answer, but I don't know how many IIS ringers you are going to find here. To be honest, you'd probably be better off asking this on StackOverflow.
> 0 votes

---
Tags: iis, rewrite, mod-rewrite
---


# Question
Title: Not able to log into EE 2.9.0 when Cookie Consent is enable
I've recently updated a site from EE 2.7.3 to 2.9.0. A client has pointed out to me that she can't log into the CP but instead get's the message:

**This form has expired. Please refresh and try again.**

I didn't get this message using Opera but managed to repeat the error using Firefox (on OSX).

After much fruitless searching around and playing with session settings with the CP, I tried disabling Cookie Consent and suddenly was able to log in using Firefox.

The problem is that I really need to have Cookie Consent enabled because of the nature of the client's business. So I'm wondering if anyone has had this same problem and has found a work-around?

I'm also using the latest version of Cookie Consent 1.1

# Answer
I'm having this problem too. What I do is, um, refreshing the form.

You may find this bug report useful
> 1 votes

# Answer
Also helpful is this bug report and workaround by on Github by diogomiguel: https://github.com/EllisLab/Cookie-Consent/issues/2

(I found the line numbers a little off, with line 111 actually needing to be line 107 and line 98 actually 96)

> Cookie consent tries to clear csrf token preventing forms from being submitted on newer versions of Expression Engine (tested with 2.8). Possible workaround solution, is to add an if statement to prevent csrf token from being cleared. If extension-\>end\_script is called on the same function, the problem will occur during the first submission too.
>
> Temporary suggested solution:
>
> add to ext.cookie\_consent.php (Line 111):
>
> if ($name == $data\['prefix'\] . 'csrf\_token') { continue; } comment out on same file (Line 98)
>
> //$this-\>EE-\>extensions-\>end\_script = TRUE;
> 0 votes

---
Tags: cookies
---


# Question
Title: Using wygwam with readmore under contentelements
```
{content_a}
    {wygwam:excerpt}
        {value}
    {/wygwam}
    {wygwam:extended}
        {value}
    {/wygwam}
{/content_a}

```

I wanted to have a readmore button instead, The code above outputs everything from the entry id Can you help me?

Legend: Content\_a = contentelement field Wygwam = wygwam under contentelement field

# Answer
> 0 votes
There's two ways to go about this that I can think of.

## Option A

You can have **separate Content Element code** for the listing page vs the single-entry page:

Listing page:

```
{content_a}
    {wygwam:excerpt}
        {value}
    {/wygwam}
    <a href="#">Read More...</a>
{/content_a}

```

Single-entry page:

```
{content_a}
    {wygwam} // shows the entirety of the Wygwam field
        {value}
    {/wygwam}

    // Also include the other field types:
    {image} ... {/image}
    {video} ... {/video}
{/content_a}

```

## Option B

You can have an entirely separate Wygwam field (called `content_summary` here) for the summary/excerpt, leaving the Content Elements field dedicated to the full article content:

Listing page:

```
{content_summary}
<a href="#">Read More...</a>

```

Single-entry page:

```
{content_a}
    {wygwam}
        {value}
    {/wygwam}

    // Also include the other field types:
    {image} ... {/image}
    {video} ... {/video}
{/content_a}

```

---
Tags: wygwam, content-elements
---


# Question
Title: MX Cloner : Clone results in undefined URL (404)
MX Cloner running on EE 2.9.2 with Zenbu installed (also running Zenbu MX Cloner support extension) When we select the clone option the site gives us a 404 page with the following structure

`http://www.domain.com/undefined&clone=y&use_autosave=n`

We've got this installed on another 2.9.2 site (also running Zenbu) and it's working fine - any ideas about where to look to resolve?

We've uninstalled and reinstalled both cloner extensions to no avail

# Answer
I've got the identical error, and I've also upgraded to EE 2.10.1. But disabling the Zenbu MX Cloner Support Extension doesn't work for me. I've also tried disabling and re-enabling MX Cloner.

What's the URL supposed to look like? It's as if MX Cloner isn't reading the Control Panel URL site setting.

**EDIT:** Max Lazar, the author, guided me to the Github repository for the plugin, where MX Cloner is up to 1.2.8 and resolves this issue when the extension is updated.
> 1 votes

# Answer
Have upgraded EE site to 2.10.1 and *disabled* the Zenbu MX Cloner support extension and this seems to have resolved the issue.
> 0 votes

# Answer
EE 2.10.1 and MX Cloner 1.2.8 with Zenbu: still 404. Solution: in acc.mx\_cloner.php, find line 42. Replace:

```
 _href = $(this).children("td:first").next().children("a:first").attr("href")+"&clone=y&use_autosave=n";

```

with:

```
_href = $(this).children("td:first").nextAll().eq(1).children("a:first").attr("href")+"&clone=y&use_autosave=n";

```
> 0 votes

---
Tags: mx-cloner
---


title: Field Pack List in a Channel Form

text:
# Question
Title: Field Pack List in a Channel Form
Using a Field Pack List fieldtype in a channel form fails due to the need to hit enter to add a new line per list item.

How does one prevent the entire form from submitting when a user hits enter?

# Answer
> 0 votes
Had to add jQuery UI myself on the page as the EE version is outdated and doesn't include sortable.

---
Tags: pixelandtonic, field-pack
---


# Question
Title: Discussion Forum Theme is stuck on Default
Even though I have changed the default theme to something else, for me and me only, it is stuck on the old theme. When I log in as another member, I see the new forum theme, but as soon as I switch back to my account I see the old theme still. Is there a database table created where it associates that particular member with that theme? If so, where can I find it?

Cheers.

# Answer
> 0 votes
Found out why. You just need to revert the 'forum\_theme' in the 'exp\_members table' to NULL and then multiple forums will work with their default theme instead of being explicitly set to one theme throughout.

---
Tags: forum, discussion
---


# Question
Title: How to select Low Reorder set from content of {segment_n}?
I have a set of categories within a single group that I apply to entries in a channel to differentiate different classes of document (FAQs, Case-Studies etc.).

I've set up a listing page that uses Low Segment2Cat to pull just the channel entries within a particular category into a list. The channel tag looks like this:

```
{exp:channel:entries channel="resources" category="{segment_2_category_id}" dynamic="no" require_entry="no"}

```

This works just fine, but I would like to reorder the entries pulled by this request. So I've created a Low Reorder set to do this for each category - so there is a reorder set called "faqs" that reorders the resource entries with category "faqs" - in total one Low Reorder set for each relevant category, each named the same as the category\_url.

With all this set up, I had hoped that I could then use the {segment\_2} value to select which Low Reorder set to pull list entries from - and so get them in the right order. However, this tag-pair

```
{exp:low_reorder:entries set="{segment_2}"}

```

simply doesn't work - it produces no results at all.

Anyone got any ideas how I can get this tag-pair to work?

Thanks in advance for any help.

# Answer
> 0 votes
In cases like this, it is good practice to turn on the template debugger and look for any messages that might indicate why the tag returns no results.

First off, `{segment_2}` must be identical to the Low Reorder set name. If it isn't, then no results will be returned.

If the name is correct, but the set has the option of "Show entries per single category" enabled, then a category ID is required as well. If no category="" param is set, then no results will be returned.

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


# Question
Title: Template Debugging: which entry is actually slow?
I'm trying to see why it takes almost 3-4 seconds for my template render. I enabled template debugging. Looking at the output, I have computed 0.7 seconds between two steps in the templating process:

I'm not exactly sure what it means. Did the HTML Minification take .7 seconds? Or was it Mo' Variables?

Also, should I be concerned about memory usage when trying to figure out bottlenecks in my templates?

# Answer
> 2 votes
As a general rule in reading debugging logs, output statements that are designed to allow developers to profile the speed of their web application are always placed at the start of methods. Not the end. So in your case it is the HTML minification process that is taking the 0.7 secs to execute. Which depending on the complexity of your HTML is not too bad.

To speed things up, I would consider using caching for this page. CE Cache by Causing Effect is a fantastic caching solution for EE giving you great control - especially the neat cache breaking feature.

In regard to the memory usage of the PHP instance, this should also be taken into account. The more memory you use for a single PHP instance, the longer it will take for the server to process. Using too much memory can also result in RAM swapping when the system is under high load. Something you definitely want to avoid especially considering the cheapness of adding extra RAM to your server (especially if it's in the cloud).

---
Tags: templates, speed
---


title: Low Alphabet and bootstrap layout issue

text:
# Question
Title: Low Alphabet and bootstrap layout issue
I have an issue when using Low Alphabet in Bootstrap with the layout, which i don't get if I take Low Alphabet out of the code.

The issue is at the end of this page URL below, the last two images do not line up and instead one drops and the other goes to the right, when it should flow to the left.

http://www.historyandpolicy.org/sandbox

The code I'm using is below. The Low Alphabet codeworks perfect, however its the formatting that is the issue and this only happend when using Low Alphabet.

```
<div class="row">
{exp:low_alphabet:entries channel="who-we-are" alpha_filter="{title}" orderby="surname" limit="20"}
<div class="col-lg-4 portrait">
<a href="{url_title_path='who-we-are/profile'}">
<img class="img-responsive" src="{profile_thumbnail}" />
<h3 class="entry-title">{first_name} {surname}</h3>
</a>
<h5>{profile_position}</h5>
</div>
{/exp:low_alphabet:entries}
</div>

```

I would be very grateful if anyone could help.

# Answer
> 1 votes
This has nothing to do with Low Alphabet. It's a layout issue where you're not taking two lines of content into account with floats. See this screenshot:

You can see that Simon's description spans 2 lines, which makes the containing box larger, mis-aligning the box below. In the source, I edited the description to be only one line:

Voilà, everything lines up just fine.

Change your css to take this into account, and that should solve it.

---
Tags: bootstrap, low-alphabet, twitter-bootstrap, layouts
---


# Question
Title: Cartthrob display fields only if shipping or tax has a value greater than $0.00
Working on our new Cartthrob install, I want to hide the shipping and tax fields on both the cart page and the checkout page if either the shipping or tax are $0.00...

I tried this for shipping:

```
{if exp:cartthrob:cart_shipping != "$0.00"}
    <tr>
      <td>
        Shipping
      </td>
      <td>
      {exp:cartthrob:cart_shipping}
      </td>
   </tr>
   {/if}

```

But doesn't seem to do what I want... Any suggestions or maybe I'm just not using the tag correctly?

# Answer
> 0 votes
OK - after futzing around a bit I got something that works for what I want.

```
       {if {exp:cartthrob:cart_shipping prefix="" decimals="0"} != 0}

       YES

       {if:else}

       NO

       {/if}

```

---
Tags: cartthrob
---


# Question
Title: expresso store orders between date range
Is it possible to filter Expresso Store 2 orders between two dates in a template? EG the customer wants to see all their orders between 2013 and 2014.

Many thanks

# Answer
You could do this pretty simply with this:

```
{exp:query sql="SELECT order_hash FROM exp_store_orders WHERE order_completed_date > 1356998400 AND order_completed_date < 1420070400"}
{exp:store:orders order_hash="{order_hash}"}
Order #{order_id}
{/exp:store:orders}
{/exp:query}

```

Brad
> 3 votes

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


# Question
Title: Freeform 4.x Fileupload forgets my file after error validation
I have a problem.

I've got a form with some input fields. One of them is a file upload field. When the user submits the form, every field will be validated and the page gets reloaded with the error messages (inline errors), but all fields still showing the users input but the file input forgets the selected file. Is there any solution to fix this problem?

Thank you!

# Answer
> 0 votes
Their is no valid "value" parameter on an `input` with file field type anymore, and because the field is populated through browser interaction with the operating system, it is probably not possible to tell the browser to repopulate that field.

There's also a host of vulnerabilities from letting a server tell your browser to relocate a file on request on a local machine. That type of stuff usually requires custom browser extensions. I won't even try to grok some of the possibilities their.

What you want to do, is to **force** validation before submission. By making the user fill in all fields before moving forward, you can prevent these issues. It sounds like your form not repopulating that field is a problem for your particular clientele. It will be a pain, but can stop some of these issues.

Another option is to upload the file on the spot. However, I don't think there is any field type addons for FreeForm to connect it to something like Assets. You could probably develop one (and sell it too, I bet!).

---
Tags: solspace-freeform
---


# Question
Title: {field:payment_method} doesn't output anything
I'm struggling to get a payment method to be output in the checkout tag.

I'm using this code:

```
<div class="field">
    {field:payment_method}
    {error:payment_method}
</div>

```

I just get an empty select element:

I've got the "server" option enabled in the backend:

Though there doesn't seem to be any extra option that I have to pass, shouldn't there be a username/password normally?

# Answer
In the end I hard coded the payment methods as radio inputs with the values as the payment method name. It's still worth keeping the error:payment\_method tag as I think it gives gateway errors. I don't know what expression store do now, it was constantly breaking and changing all the time when I developed this site.
> 0 votes

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


# Question
Title: Color issue on native image manipulation
I have just used EE's native image manipulations for the first time and boy did they work great. However, my client looked at the site after I replaced the old images with the resized ones and her nice white backgrounds on products no longer looked white. It's very subtle, I have to look at my monitor at an angle to see it, but apparently it is quite noticeable on certain monitors. When I color sample these white backgrounds, I get an occasional #fefefe pixel. So on some monitors, it is giving the whole image background a yellow cast. I'm wondering if anyone has advice about increasing the quality of the image manipulations, or other ways of managing this particular problem. I see that I can specify a different library, but it's unclear to me if that would help. The images are jpg and I imagine that increasing the quality of the jpg might help, but I don't see settings for that.

# Answer
> 1 votes
By default I think EE sets the quality of the image at 90

You could try editing system/codeigniter/system/libraries/image\_lib.php LINE 36 and change the `var $quality` to 100

Other than that if you are using GD2 Image Resizing Protocol, try switching it to ImageMagick (if on your server) which may give a slightly better result.

# Answer
> 1 votes
I've seen odd things happen with images when the color profile is set to something other than sRGB. Check to make sure the color profile is using sRBG and not something like Adobe RBG or ProPhoto RBG. If you're using any type of Save for Web feature it will usually set the color profile to sRGB automatically.

---
Tags: image, image-manipulations
---


# Question
Title: How to log/view all frontend login sessions?
Does EE stores all frontend login actions somewhere?

Checking in Control Panel \> Tools \> Logs \> Control Panel I can see it lists all users that have logged into the CP but not the ones logged in using {exp:member:login\_form} or {exp:zoo\_visitor:login\_form}.

I was thinking of creating an extension that logs all new sessions in a separate table but though it was worth asking here just in case is there an easier way.

Cheers, Al

# Answer
> 1 votes
Control Panel Logs is existed not just to show logged users but logged all critical activities(not only login) in CP. EE keeps this records in \_cp\_log table.

For front-end is not such functions from the box.

But you can try module called Audit Pro

> Audit tracks:
>
> Member Logins, including Control Panel & **front-end**
>
> Member Logouts, including Control Panel & **front-end**
>
> New Entries, including Safecracker
>
> Updates to Entries, via the Publish screen or multiple entries via the \>Edit screen, including Safecracker
>
> Deleting Entries
>
> New Members
>
> Deleting Members
>
> Editing of Members
>
> Changing Templates (editing a template, not its preferences)

---
Tags: zoo-visitor, login, sessions
---


title: Can I import fields into freeform?

text:
# Question
Title: Can I import fields into freeform?
I'm overhauling a legacy ee 1.7 site and they use freeform pretty heavily; currently they have about 170 freeform fields(!) - is there a way to import them into a fresh install of freeform? I haven't tried to go through an upgrade path with this and I'm using a clean 2.10 build with datagrab to pull content in.

I don't want to pull in the legacy freeform data particularly but if I could import all those fields it would save a lot of time/sanity!

# Answer
> 0 votes
If you were on the latest/last version of Freeform 3 and then updated to Freeform 4, there is a Migration Tool under the **Utilities** tab in the Freeform module in the CP that should allow you to transfer your Freeform 3.x data and fields over to Freeform 4.x, which is EE2-compatible.

---
Tags: solspace-freeform, solspace, fields, datagrab, import
---


# Question
Title: What's the best way to get yesterday's date?
I am using Solspace's Date Field Filter to group sales on a site. I need to display everything from yesterday (relative to current date) and older. I also need to do this moving forward (forecasting), so tomorrow (relative to current date). All of the dates being checked are custom date fields in EE's native date fieldtype though.

So instead of something like this:

```
{exp:channel:entries
    date_field="{sale_dates_and_times:date}"
    date_field_start="{current_time format='%Y-%m-%d %h:%i %A'}"
    channel="sales"
    limit="5"
    orderby="{sale_dates_and_times:date}"
    sort="desc"
    paginate="bottom"
    dynamic="no"
}

```

I would need the `date_field_start` to be yesterday or tomorrow.

Is there a way to do this easily? I think I am making this harder on myself than it needs to be.

Thanks

\****UPDATE\****

So I have the date coming in like I need it now, but I am not receiving filtered results...

I used the DT Plugin, thanks to Sam for pointing that out, to get the dates needed. I verified the dates by rendering them out. Since it didn't work, I even tried to use Stash to pass that into the channel entries tag. Still no good. Is there something I am doing wrong Solspace? My date field is in a grid like this:

Grid Field = `{sale_dates_and_times}`

Sub Fields = date | opening\_time | closing\_time or

`{sale_dates_and_times:date}` `{sale_dates_and_times:opening_time}` `{sale_dates_and_times:closing_time}`

I have this now:

```
{exp:stash:set name="previous"}{exp:dt day='-3' format='%Y-%m-%d %h:%i %A'}{/exp:stash:set}

```

This renders as `2015-09-11 12:57 PM`

```
{exp:channel:entries
    date_field="{sale_dates_and_times:date}"
    date_field_start="{exp:stash:get name='previous'}"
    channel='sale'
    limit='5'
    orderby="{sale_dates_and_times:date}"
    sort="asc"
    paginate="bottom"
    dynamic="no"
}

```

In my test I should just see 1 entry since there is one set to a previous date range, one set to current date ranges, and one set for a future date range. However, I am getting all entries returned.

These are with the following dates:

Entry-1:

```
Friday 09-11-2015 — 9:00am-9:00am
Saturday 09-12-2015 — 9:00am-9:00am
Sunday 09-13-2015 — 8:00am-8:00am

```

Entry-2:

```
Tuesday 09-01-2015 — 9:00am-9:00am
Wednesday 09-02-2015 — 9:00am-9:00am
Thursday 09-03-2015 — 8:00am-8:00am

```

Entry-3:

```
Friday 09-25-2015 — 9:00am-9:00am
Saturday 09-26-2015 — 9:00am-9:00am
Sunday 09-27-2015 — 8:00am-8:00am

```

Why would all three be rendering in this case?

Thanks

# Answer
If you have the Calendar module installed, you could use the `{exp:calendar:date}` tag to calculate yesterday's date: https://solspace.com/docs/calendar/date/

You might need to put your code in an embed and pass the result of `{exp:calendar:date}` in this embed, since in EE you can't put `{exp:...}` tags inside another `{exp:...}` tag's parameter (even if someone says they managed to pull that off, it's not recommended ;)).
> 0 votes

---
Tags: solspace, date
---


# Question
Title: Problems with Admin CP after updating from v2.2.2 to v2.10.1
After the update the Admin CP is not working properly anymore. The 'Edit' under 'Content' dropdown is broken. Alle the labels have cpmm\_ as prefix. And the links are linking to new pages instead of edit.

What could be the problem?

Thanks in advance.

Grtz, Martijn

# Answer
This type of thing is almost always an issue with a failed upload during the upgrade process. Those labels (cpmm whatever) exist because the language file is missing those entries in a PHP array.

EE language method replacement fails back to the array key when it can't find a `key => val` pair.

Did you make sure you followed the upgrade instructions exactly? Try reuploading your system folder. I could tell you the exact file if I was at my desk.
> 0 votes

---
Tags: control-panel, update
---


# Question
Title: Solspace Freeform: redirect to URI other than template_group/template
I have a form at the URL `https://domain.tld/segment_1/segment_2/form`, and would like to redirect (on success) to `https://domain.tld/segment_1/segment_2/form/thank-you`.

When I do: `return="segment_1/segment_2/form/thank-you"` it doesn't work. Is this possible?

# Answer
I presume this is a bug, but my opening tag is this:

```
{exp:freeform:form
        form_name="artwork_information_enquiry"
        form:role="form"
        form:id="request-info-form"
        form:novalidate="novalidate
        return="{segment_1}/{segment_2}/{segment_3}/success"
        required="first_name|last_name|email|enquiry_artwork_title|enquiry_artwork_img_url|enquiry_country"
        secure_action="yes"
        secure_return="yes"
        inline_errors="yes"
}

```

If I change the order of the return param (more towards the top) it works!

```
{exp:freeform:form
    form_name="artwork_information_enquiry"
    return="{segment_1}/{segment_2}/{segment_3}/success"
    form:role="form"
    form:id="request-info-form"
    form:novalidate="novalidate
    required="first_name|last_name|email|enquiry_artwork_title|enquiry_artwork_img_url|enquiry_country"
    secure_action="yes"
    secure_return="yes"
    inline_errors="yes"
}

```
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: Solspace importer : A Unique Field Element with valid EE Field Are Required
I'm using solspace importer (latest version) to import members in EE v2.10.1

In the importer settings form, I have a row **Additional Member Fields** There is a select where I can select custom fields and a button \[Add field\].

When I click the Add Field button I get this error :

An Error Was Encountered A Unique Field Element with valid EE Field Are Required.

I don't have a clue about what it means...

**EDIT : In fact clicking that button submits the form while there are still blank fields. Is that a bug ?**

# Answer
Thanks to a hint from Nicolas @ solspace's support, we found that a little htacces was blocking access to a javascript file.

**Below code breaks solspace's importer** (and everything member related)

```
# Prevent direct access to EE Member area
# ------------------------------
RewriteCond %{REQUEST_URI} (member)
RewriteRule ^(.*)$ http://%{SERVER_NAME}/404 [R=301,L]

```

As these two lines are quite widely used It might help someone else running into the same issue.
> 2 votes

---
Tags: solspace, solspace-importer
---


title: Https problem with channel form

text:
# Question
Title: Https problem with channel form
I have a problem with a channel form working over https.My form allows users edit their profiles for a staff directory and has a lot of fields including some assets , wygwam and matrix fields.When i go to the page over https all of those fields aren't working and i get errors like

```

Blocked loading mixed active content "http://mysite/themes/third_party/wygwam/lib/ckeditor/ckeditor.js"

Blocked loading mixed active content "http://mysite/themes/third_party/assets/scripts/matrix.min.js?2.5"

```
So the obvious problem is that these fields are requesting files over http rather than https but im not sure why this is happening.

I have setup my site to convert relative paths in my config

```

  $protocol                          = (isset($_SERVER['HTTPS']) &&     $_SERVER['HTTP'] == 'on') ? 'https://' : 'http://';
  $base_url                          = $protocol . $_SERVER['HTTP_HOST'];
  $base_path                         = $_SERVER['DOCUMENT_ROOT'];
  $system_folder                     = APPPATH . '../';
  $images_folder                     = 'images';
  $images_path                       = $base_path . '/' . $images_folder;
  $images_url                        = $base_url . '/' . $images_folder;

  $env_config['index_page']          = '';
  $env_config['site_index']          = '';
  $env_config['base_url']            = $base_url . '/';
  $env_config['site_url']            = $env_config['base_url'];
  $env_config['cp_url']              = $env_config['base_url'] .
'admin/index.php';
 $env_config['theme_folder_path']   = $base_path   . '/themes/';
 $env_config['theme_folder_url']    = $base_url    . '/themes/';
 $env_config['third_party_path']    = $base_path   '/admin/expressionengine/third_party/';

```

I have also set secure\_return="yes" and secure\_action="yes" in my form header so im not sure where I am going wrong

Thanks for any help

# Answer
> 1 votes
Ok I have decided to set https as my default protocol So i changed this

```
 $protocol= (isset($_SERVER['HTTPS']) &&     $_SERVER['HTTP'] == 'on') ? 'https://' : 'http://';

```

to this

```
 $protocol=  'https://';

```

This has sorted my issues and I hope to move the whole site to https soon

# Answer
> 1 votes
The issue is that your CP and themes folder are not set to run https.

Make sure your cp url and themes folder are set to run https://

You'll possibly run into the same thing with any "ACT=" urls if the protocols don't match.

---
Tags: assets, safecracker, wygwam, ssl
---


# Question
Title: BrilliantRetail: Stripe gateway is not working
I'm trying to process a payment with Stripe, but am getting an error after the form submits:

```
Fatal error: Call to a member function retrieve() on a non-object in /home/redchair/ee/expressionengine/third_party/brilliant_retail/core/gateway/gateway.stripe.php on line 406

```

Any thoughts what the issue may be?

Thanks!

p.s. BrilliantRetail 1.8.0

# Answer
You possibly use a new Strip API, but BR is not supported it. I get this errors before, so you can try my patch.
> 1 votes

---
Tags: brilliantretail
---


# Question
Title: to which member group would belong pending members?
**SHORT ANSWER :** YOU CAN'T TELL

---

I have 2 member groups.

When a registration is not complete, (email not confirmed) the registred user is placed in Pending member group.

How can I know which group it would have been assigned to if he had completed the registration process ?

As a side note : I use MSM, is there any way to know at least which site the member tried to register to ?

# Answer
> 1 votes
If you use default EE registration, you can setup **Default Member Group Assigned to New Members** in *Members -\> Member Preferences*.

Regarding site - is no such function from the box. You can add hidden field on reg page where you will keep site id or site name.

---
Tags: members, multi-site-manager, registration
---


# Question
Title: Solspace FBC not using "real" email addresses for passive registration
I've setup Solspace Facebook Connect to do passive registration. However, when I test this by logging in with my facebook account the email used for the EE member registration is the facebook email like `c414b91c90b55584f779f052531f225b@facebook.com` instead of the user "real" email account, even though I'm including "email" in the permissions parameter on `{exp:fbc:login}`

Is there something else I have to do to get the real email address to be used for EE member passive registration?

# Answer
> 0 votes
The answer was supplied in comments from Solspace. The "real" email address was not being used for passive registration because the email address was already in use for another EE member account. If the email address is unique it works fine.

# Answer
> 0 votes
I was getting the same issue and was able to resolve it by using an FB app created several months earlier (just for testing purposes) that used the corresponding 2.2 Facebook API.

---
Tags: solspace, solspace-facebookconnect
---


title: Pagination remains mysterious

text:
# Question
Title: Pagination remains mysterious
This is probably a newbie question...

I have a blog of fifty entries, and I want to be able to have people click through them using previous/next links, but I also want people to have random access to all of them in a sidebar menu.

I have a standard pagination tag pair:

```
 {paginate}
   <p style="text-align:right">     {if previous_page}
            <a href="{auto_path}">Previous Page</a>
        {/if}
         {if next_page}
            <a href="{auto_path}">Next Page</a>
        {/if}
        </p>
    {/paginate}

```

inside a standard channel entries pair:

```
{exp:channel:entries channel="md" limit="1" disable="member_data" orderby="author_last" sort="asc"  paginate="top" } ...

```

And it works--but only because I start the series with a hard-coded link to a 'P1' pagination style link.

However, I also have a full menu of all entries in a sidebar using the channel entries tag and urls thusly:

```
{exp:channel:entries channel="md" orderby="author_last" sort="asc" disable="member_data" dynamic="no" }
<p>{author_last}: <a href="{url_title_path="md/post"}">{title}</a></p>...

```

With the result that if a person clicks on any of the entries from the sidebar menu, pagination links disappear.

Is there any way to have it both ways?

thanks

# Answer
If you are just showing one entry, try prev-next entry linking instead of pagination https://ellislab.com/expressionengine/user-guide/add-ons/channel/entry\_linking.html
> 1 votes

---
Tags: pagination
---


title: Bulk Import to Expression Engine

text:
# Question
Title: Bulk Import to Expression Engine
I'm a software developer but I don't specialise in PHP and have had no real prior experience with Expression Engine. A friend of mine who runs an estate agents has had a new website built in EE, but the people doing it are more front-end/graphic design experienced and were unable to implement one bit of much-needed functionality - automatically importing properties to the site.

Specifically, they have some property management software that will export a file in RightMove BLM (v3) format containing details of all the properties, along with associated images for each property, to an FTP server. There is a CodeIgniter module available to parse this format (http://biostall.com/codeigniter-rightmove-blm-parser-library), and it is also specified on the RightMove website. They would want some process to look at these files and do a full refresh of their Lettings channel within EE.

Is it possible to achieve this with EE? My initial thought was to write a standalone script to do the importing, but I don't know how to use the EE API from 'outside' EE.

Any help or pointers would be greatly appreciated.

Many thanks

# Answer
There are a couple of add-ons for importing data that you could look at. I imagine you'd need some further customization though to scoop up that format.

https://solspace.com/software/expressionengine/importer/

http://brandnewbox.co.uk/products/details/datagrab
> 1 votes

# Answer
It's very possible, I'm doing something similar with a UK jobs board (Broadbean) which POSTs XML and populates an ExpressionEngine channel. It even accepts an update (has it seen this ID before) and will update the entry.

In my case I didn't create an ExpressionEngine Module but rather a script that would accept the POSTed feed from an authenticated user, purely as it meant it was one less thing to update or worry about when EE changed and I wanted it to be fire and forget.

Hope that puts your mind at rest.

John
> 0 votes

---
Tags: ee2, channel-entries, import
---


title: Tag Cloud - Total Results

text:
# Question
Title: Tag Cloud - Total Results
I have the below code to display the tags that are returned inside of low\_search:results.

```
{exp:low_search:results query="{segment_3}" limit="100" orderby="title" sort="asc" status="not closed" disable="category_fields|member_data" paginate="bottom" collection="library"}

    <!-- Keywords -->
    {if low_search_keywords}
        Keyword searched for <strong>{low_search_keywords}</strong>.
        <br>
    {/if}
    <!-- Categories -->
    {if low_search_category}
        {exp:channel:categories show="{low_search_category}" style="linear"}
          Type searched for: <strong>{category_name}</strong>.
        {/exp:channel:categories}
        <br>
    {/if}
    <!-- Tags -->
    {if low_search_tag_id}
        Tag searched for:
        {exp:tag:cloud tag_id="{low_search_tag_id}"}
             <strong>{tag}</strong>{if count != total_results}, {/if}
        {/exp:tag:cloud}
        <br>
    {/if}
    <!-- Total -->
    Total results: <strong>{absolute_results}</strong>.

{/exp:low_search:results}

```

But instead of returning the total number of tags, the total\_results variable is returning the total number of search results.

Is there any way to remedy this? Thank you.

# Answer
total\_results always belongs to the outer most tag in nested situations. It is a common variable and this is also true for count and possibly some others I can't remember. Try playing around with using an embed to get around this problem.

```
{if low_search_tag_id}
  {embed="embeddedtemplate" passedid="{low_search_tag_id}"}
{/if}

```

Even with that there may be parse issues I am not sure sometimes using parse="inward" can help there. Without having these plugins to play around with I can't give exact answer but this should put you on the right path.
> 0 votes

---
Tags: solspace-tag
---


# Question
Title: Display different templates as entries on the index page
I'm trying to figure out a way to display each entry in a channel on one page but allow for those entries to utilize different templates. The templates would be various layouts for a section and each section would be an entry.

I'm currently using the pages module so I can select a different template but I want to display it on the home page. Each template is just a variation of the next with rows and columns for content. I'm basically trying to make the home page modular.

====== MORE DETAIL =======

At this point it's done in the back end. My goal is to eventually move it to the front end but for now I just need to get it working.

The home page has a layout for the header, nav, call-to-action row, and footer that will stay consistent on the home page. The user has some layout options to choose from globally but the area I need to address is the entries that will appear on the home page through the "home" channel.

I want to create various layout options for the content row and each entry would display a new row of content. No different how a news channel would work other than the option to choose a different row layout for the entry.

I would like the user to go in and create a new "home" entry from the content menu and select the template they want to use for that specific entry in the pages module template dropdown. It could one column or two, whichever fits their need.

If the client created a new entry with a one column template then it will appear on the home page in the designated content area for the "home" channel entries. Every entry would be a new row based on the template selected. Again, we are talking about if the row will have 1, 2, or three columns and the width of those columns that are defined in the template.

Does this help?

I would think it would be as easy as displaying the entry but selecting a different template outside of the index seems to be throwing it off.

# Answer
So let me get this straight... You want to load different templates based on user choices? So the homepage could be `template1` or `template2` depending on a condition? Weird.. But ok. Have you considered just embedding template parts?

```
{if condition_a}
    {embed="embeds/template_a"}
{if:else}
    {embed="embeds/template_b"}
{/if}

```

If you could expand on the purpose of subjectively loading different templates, I can hone my answer in.
> 0 votes

# Answer
You could put a field in the home channel entries with the layout options. Then code your page so that it displays differently based on the layout option that was selected.
> 0 votes

# Answer
Try this. Within your exp:channel:entries loop on your homepage template that you are using to display the homepage entries. Output the custom field you have setup for better pages.

```
{exp:channel:entries channel="homepage" dynamic="no"}
  <h2>This is the template id {my_better_pages_field}</h2>
{/exp:channel:entries}

```

If my understanding of better pages is correct this is the id for the template you have assigned to that entry. Now using this information you can create your conditionals on your homepage template for example

```
{exp:channel:entries channel="homepage" dynamic="no"}
  {if {my_better_pages_field} == "1"}
    Enter output of the first style
  {/if}
  etc etc.
{/exp:channel:entries}

```

Normally when you assign a template to a page using the pages module it displays the page using the corresponding template when you call up that pages url. You are wanting it to use the template while displaying a different page. If you actually want to use the templates you have assigned you could use the above code with an embed. for example replace "Enter output of first style" with {embed="template\_1" passedid="{entry\_id}"} and then use the {embed:passedid} variable within your template. Hope that works for you.
> 0 votes

---
Tags: templates, entries, pages, index
---


title: Playa related entries count

text:
# Question
Title: Playa related entries count
We are running reports and need a query - we're using playa and I want to get the total number of child\_entries where channel\_id = 16 and where the 'parent\_field\_id' = 68.

My current query is:

```
SELECT exp_channel_titles.entry_id, exp_channel_titles.title, count(exp_playa_relationships.child_entry_id) AS entry_count

FROM exp_channel_titles LEFT JOIN exp_playa_relationships ON exp_channel_titles.entry_id = exp_playa_relationships.child_entry_id

WHERE exp_playa_relationships.parent_field_id = 68 AND exp_channel_titles.channel_id=16

```

What I expected to see was:

* Event Title - Entry ID 1218 - total articles: 788
* Event Title - Entry ID 2866 - total articles: 605

What I am getting is:

* Event Title - Entry ID - total articles: 1393

Any thoughs how this would be achieve and what I missed?

# Answer
For reference the working query was:

```
SELECT
    t.entry_id,
    t.title,
    count(r.child_entry_id) AS entry_count

FROM
    exp_channel_titles AS t

INNER JOIN
    exp_playa_relationships AS r
    ON t.entry_id = r.child_entry_id

WHERE
    r.parent_field_id = 68
    AND t.channel_id = 16

GROUP BY
    r.child_entry_id

```
> 0 votes

# Answer
You're getting the total of all related articles because you're not specifying that you need to group the results by entry. Try:

```
SELECT
    t.entry_id,
    t.title,
    COUNT(r.child_entry_id) AS entry_count
FROM
    exp_channel_titles AS t
INNER JOIN
    exp_playa_relationships AS r
    ON t.entry_id = r.child_entry_id
WHERE
    r.parent_field_id = 10
    AND t.channel_id = 1
GROUP BY
    t.entry_id

```

I also changed the join from LEFT to INNER to avoid potential issues when some data has not been cleaned up properly and missing entries still have relationship records.
> 1 votes

---
Tags: database, query, sql, count, query-module
---


# Question
Title: orderby="random" same results being displayed every time
I am trying to select 3 random entries from a few channels. I have:

```
{exp:channel:entries limit="3" channel="X|Y|Z" status="open" orderby="random" disable="categories|category_fields|member_data|pagination" dynamic="no" cache="no"}

    ....

{/exp:channel:entries}

```

The issue I have is that the same 3 entries continue to be displayed, in varying order. I assume the query must be cached somewhere? I can't figure it out though.

I do have memcached enabled for EE, and I think this is where the issue lies. If I disable caching, every refresh of the page actually displays 3 random items.

Is there a way to prevent EE from caching this query? In my 'Template Manager', this particular template has "No" for "Enable Caching?"

# Answer
> 2 votes
So it looks like I have to disable "Cache Dynamic Channel Queries?" in Admin-\>Channel Administration-\>Global Channel Preferences

For random ordering to function properly

---
Tags: channel-entries, orderby, random
---


# Question
Title: Replacing Entries: Updating Playa/Wygwam from {page_x} to {page_y}?
Let's say you've got a bunch of entries in the "Original Generic Page" channel, which are getting replaced by pages with the same URLs in the "New Generic Page" channel. Assume also that entries are linked to one another in various ways (anchors in Wygwam fields; relationships via Playa fields, mainly).

For example, when the old "About" page (entry 5 in the Original Generic Page channel) is closed and replaced with the new one (entry 2000 in the New Generic Page channel), is there a good method for updating all of the other entries that previously referenced entry 5 to point to entry 2000 instead?

This change-over isn't happening all at once, and I suspect it'll be ongoing for quite a while as different channels/layouts are introduced over time.

We're using Structure and Publisher (site is multi-lingual) to possibly complicate things further.

Thoughts, any? Are there any add-ons that can help manage this?

# Answer
Since Publisher is installed it just means whatever is updated in exp\_channel\_data also needs to occur in exp\_publisher\_data for each corresponding entry. Same for exp\_sites (site\_pages column) and exp\_publisher\_site\_pages.

Are all the entries Structure based? If they are, and they all share the same URL, then it means you just need to update the entry\_ids in the site\_pages array. So you may need to create an array map of all the old entry\_ids to the new entry\_ids, and iterate over the site\_pages array and make the updates to that array, then save it back to the database.
> 1 votes

---
Tags: playa, wygwam, structure, publisher
---


title: Remove 'home' folder from home page url

text:
# Question
Title: Remove 'home' folder from home page url
I have a url like this www.example.com/home/ and I cannot get rid of the home folder from the URL. The best I can do results in which causes the page to crash.

I've been working with the htaccess file and tried numerous variations. Seems like it should be a simple fix but I'm having no luck.

I'm open to non-htaccess based solutions.

You can view a copy of the htaccess at http://www.spikewebdesign.com.au/htaccess-example.html

Thank you.

# Answer
> 1 votes
OOOOk... so did you try setting a default template group? If you set your default template group to "Home", the index template in their will be resolved at `www.example.com` as well as `www.example.com/home`.

---
Tags: htaccess, redirects
---


title: Zoo Visitor Multiple Member Groups

text:
# Question
Title: Zoo Visitor Multiple Member Groups
I want to setup a zoo visitor form where users can select which member type (member group) they want to be part of. I've setup as described in the documentation setting the allowed member groups (5|8) and the select input.

However, when I test it and activate the account, it always sets them to member group 5, despite selecting 8?

# Answer
> 0 votes
I was being a complete and utter doughnut.

I was using `group_id="5|8"` in the registration form tag instead of `allowed_groups="5|8"`

Now working perfectly!

---
Tags: zoo-visitor, zoo
---


# Question
Title: Add character limit on a channel entry tag field?
I want to add a character limit on the display portion of expression engines channel field, not on the back end entry.

for example, If i have a field "Description" I want to be able to display a "preview" of it, at 50 characters, and then if clicked, or on another page, I want to show that same field, but with no character limit to display the full text.

# Answer
there are loads of character limit/string manipulation plugins here https://devot-ee.com/search/results?keywords=character+limit&addon\_version\_support=ee2
> 2 votes

---
Tags: channel-fields
---


title: AJAX Call on ExpressionEngine Install

text:
# Question
Title: AJAX Call on ExpressionEngine Install
```
$(document).ready(function () {
$.ajax({
    type: "POST",
    url: "/ajax/customcss",
    data: {channel: currentChannel},
    })
    .done(function( data ) {

        var jsonObj= JSON.parse(data);

        console.log(jsonObj);

});
});

```

I get this error:

```
POST http://mywebsite.com/ajax/customcss 403 (Forbidden)

```

Which is a cross scripting error. Any ideas?

# Answer
That is **not** a cross scripting error necessarily, but probably is in your case. I can think of a bunch of ways to send out 403's from my server. Anyways, what script does that post to? Is that an EE template group ("ajax") and template ("customcss")?

Not sure why you are going about it that way, but POSTing to templates should always bounce without a CSRF token. Add one!

```
....
data: {channel: currentChannel, csrf_token: "{csrf_token}"},
....

```

https://ellislab.com/expressionengine/user-guide/development/guidelines/security.html#id13
> 0 votes

---
Tags: php, javascript, ajax
---


# Question
Title: How to change "P4" paging number format in url?
In our site we have a news section, where we are showing a list of 10 news per page.

The pagination is created OK, but when I click on page number link it creates urls like `http://example.com/news/P10` we want to change it to something more readable by users and Google as `http://example.com/news/page=1`, `http://example.com/news/page=2` something like this.

We tried a few plugins but most of the plugins are out-dated and doesn't work.

Can anyone please tell us the correct way to fix this?

# Answer
Have you tried:

If they don't work for you, then you'll have to write your own extension, possibly using the above as reference to approach.

**Update**

You do not want to update the core - problematic for future updates. Ideally you'd need to write an extension that probably used 2 hooks Pagination and session. Session to interpret the custom paginated element and the Pagination hook to output the formatted pagination segment you want. You might need the channel hook to query result.

If you really do want to dip into the core:

* system/expressionengine/libraries/EE\_Pagination.php

and/or

* system/codeigniter/system/libraries/Pagination.php
> 0 votes

---
Tags: pagination
---


# Question
Title: solspace rating, never displays "name", "screen_name", "fullname" tied with rating
The following NEVER displays a name, how can I get it to output a name? Here is what I have:

```
{exp:rating:entries
    limit="10"
    entry_id="{embed:the_entry_id}"}

    <h4>{if screen_name}
            {screen_name}
        {if:elseif fullname}
            {fullname}
        {if:elseif name}
            {name}
        {/if}</h4>
{/exp:rating:entries}

```

This is the form I am using, which does actually save the name in the ratings module within the backend.

```
{exp:rating:form
    entry_id="{embed:the_entry_id}"
    collection="Products"
    return="product/thanks"
    form:class="form validate"
    status="closed"
    anonymous="yes"
    allow_duplicates="no"}

    <input type="text" name="name" value="{name}" class="required" />
{/exp:rating:form}

```

I heard somewhere deleting the name field, then recreating it with the same name seemed to fix it, though I've not experienced that myself.

# Answer
First, you don't need a limit if you are explicitly setting one entry\_id. 2nd, have you turned on template debug to check that you are getting the values correctly passed to your embed? 3rd, try eliminating the conditionals, and just leave all 3 variables and see what you get back. 4th, make sure you have submitted some ratings for that entry. :-}

Also go to tools/data/sql manager and look at the exp\_ratings table and see what your data looks like. i. e. was a name saved?
> 0 votes

# Answer
No idea why its broken, still a mystery to me, though here is what I did to fix.

In my initial template create an embed and pass it the rating\_id :

```
{embed="product/.testimonial_name" the_rating_id="{rating_id}"}

```

Then in that:

```
{exp:query sql="SELECT name FROM exp_ratings WHERE rating_id='{embed:the_rating_id}'"}
    {if name}
        <h4>{name}</h4>
    {/if}
{/exp:query}

```
> 0 votes

---
Tags: solspace, solspace-rating
---


title: Show Entries per author and per month

text:
# Question
Title: Show Entries per author and per month
Is it possible to create a table that shows a count of the entries made per author and per month. Example would be:

Author | Jan | Feb | Mar

John Doe | 5 | 8 | 4
Mad Man | 6 | 3 | 8

Would be needed for a complete year

Any help greatly appreciated even if an add-On is needed

# Answer
I have achieved it with the fantastic add-on from laisvunas called "Entries Number" available at devot:ee

For anyone with the same problem, for me the solution looked as follows:

```
{exp:channel:entries channel="your_channel" parse="inward" limit="123"}
{author}{author_id}
{exp:entries_number channel="your_channel" author_id="{author_id}"start_on="2015-01-01 00:00" stop_before="2015-01-31 23:59"}
{entries_number}
{/exp:entries_number}
{/exp:channel:entries}

```
> 0 votes

---
Tags: channel-entries, date, count, author
---


# Question
Title: {no_results} doesn't work if channel:entries uses category="" as parameter
I have a very strange issue. When using the first EE channel:entries code my no\_results tag works, but when using the exact same channel:entries tag together with the category="" parameter the no\_results tag doesn't work. Any ideas?

The {last\_segment\_category\_id} variable being empty, of course.

Works:

```
{exp:channel:entries channel="channel_name" dynamic="no" disable="pagination|member_data"}
{if no_results}
<i>No results...</i>
{/if}
{/exp:channel:entries}

```

Doesn't work:

```
{exp:channel:entries channel="channel_name" category="{last_segment_category_id}" dynamic="no" disable="pagination|member_data"}
{if no_results}
<i>No results...</i>
{/if}
{/exp:channel:entries}

```

# Answer
Here is a work around you can do to get the same desired results:

```
{exp:query limit="1 sql="SELECT entry_id FROM `exp_category_posts` WHERE cat_id = '{last_segment_category_id}"}
    {exp:channel:entries channel="channel_name" category="{last_segment_category_id}" dynamic="no" disable="pagination|member_data"}
       <h1>Title</h1>
    {/exp:channel:entries}
    {if no_results}
       No Results....
    {/if}
{/exp:query}

```

What i'm doing here is querying the database to check to see if any entry\_ids exist connected to a given category. If so, it will parse the expression engine tags, if not it will display the exp:query no results content.

Hope this helps.
> 1 votes

# Answer
This has been reported to EllisLab as a bug. It is not working as it should. https://support.ellislab.com/bugs/detail/21106
> 1 votes

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


title: Return PLAYA field name?

text:
# Question
Title: Return PLAYA field name?
Is there any way to return the playa field's name (or an ID / short name / anything similar) within a playa loop? I basically need to pull two different playa fields, but treat them differently.

Readability-wise, I'd love to keep this as a single playa loop, but that isn't strictly necessary and might be my backup plan.

Ideally, I'm looking for something like:

```
{exp:playa:children field="missed|content" status="open" limit="10"}
  {if field == "missed"}
    display missed field one way
  {if:elseif field == "content"}
    display content field a different way
  {if:else}
    ...
  {/if}
{/exp:playa:children}

```

I'm hoping I'm just not seeing something. Thank you!

# Answer
> 0 votes
Can you check for the presence of a field or a status that's present in one type of entry, but not the other? For instance, if you're pulling from two separate channels, you could do something like this...

```
{if some_var_in_channel_1}
   ...
{if:elseif some_Var_in_channel_2}
  ...
{/if}

```

If it's channel based, could also use {channel\_short\_name} to compare against.

---
Tags: playa
---


# Question
Title: How can I use http parameters to create a new record in EE
I need to get the parameters from a http post url sent to my site and use the data to create a new entry in Expressionenegine.

# Answer
> 0 votes
You need to use the Channel Entries API. This will allow you to programatically create new Channel Entries.

https://ellislab.com/expressionengine/user-guide/development/api/api\_channel\_entries.html

The correct way to do it would be to create a custom module, and then have wherever this data is coming from ping that ACTion url.

https://ellislab.com/expressionengine/user-guide/development/module\_tutorial.html

Make sure when you do your database inserts for your ACTion ID, you make sure to set the `csrf_exempt` column to `1`, otherwise you will not be able to post to your website from a different domain. **HOWEVER**, you **MUST** replace that protection with something else. The simple thing would be to use something akin to an API key. Here's an example to run with for you custom module:

```
class My_module
{

    $channel_id = "666";

    function __construct()
    {
        // instantiate your channel entries api
        ee()->load->library('api');
        ee()->api->instantiate('channel_entries');
    }

    function my_module_method_for_making_channel_entries()
    {
        // bail if you don't get your trusted api key
        if ( ee()->input->post('api_key') != 'random_api_key_youll_make_up' )
        {
            show_404();
        }

        // go ahead an use the channel entries api
        $title = ee()->input->post('title');
        $data = array("title" => $title);

        // save entry
        ee()->api_channel_entries->submit_new_entry($this->channel_id, $data);
    }
}

```

---
Tags: channel-entries, php, http
---


# Question
Title: Calendar:Month_List to display only months that contain events
I am using the following code to display an archived list of months from my calendar with clickable links.

```
<ul>
    {exp:calendar:month_list date_range_start="{today}"}
        <li>
            <a href="{path='events/archives'}/{month format="%Y/%m"}"/>
                {month format="%F, %Y"}
            </a>
        </li>
    {/exp:calendar:month_list}
</ul>

```

I only want to display months that have events in them. Does anyone know how this can be done?

# Answer
> 2 votes
The **`{exp:calendar:cal}`** tag can do a lot in Calendar: it's the first go-to tag to consider. I would use it since it provides a `{month_event_total}` variable you could use here. For example:

```
{exp:calendar:cal date_range_start="2015-01-01" date_range_end="2015-12-31"}
    {display_each_month}
        {if month_event_total > 0}
            // Your month header
        {/if}
    {/display_each_month}
{/exp:calendar:cal}

```

That should just display months that have events in them.

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


# Question
Title: CartThrob / SagePay sudden error 5006 after server move?
After a recent server move and a new dedicated IP address configuration the site no longer works with SagePay (offsite server), we now get the following error(s) after entering payment details at SagePay:

HTTP Status Code: 500 HTTP Status Message: The request was unsuccessful due to an unexpected condition encountered by the server.

Error Code : 5006 Error Description : Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.

The IP address is valid within SagePay and I have checked that the return path from the checkout\_form is correct, both are ok.

I'm not sure why this has stopped working, any help please? Thanks.

EE v2.7.3 and CT v2.5 - I have tried the new SagePay code provided by Vector Media Group but the same errors are issued.

# Answer
I would suggest making sure all your paths are correct in the server move, especially as listed here: `themes/third_party/cartthrob/lib/extload.php`. That's usually the issue in this kind of situation.
> 1 votes

---
Tags: cartthrob, payment-gateway, sagepay
---


# Question
Title: Prevent first entry to be shown conditional
I'm trying to prevent that the first entry has a certain class in this case the class 'wide'. I call the class from a channel-field called {format}. But i want the use the param orderby="random" in the entries tag.

Now sometimes the first entry with the class 'wide' is still shown, how can i prevent this?

This my code so far..

```
{exp:channel:entries channel="work" orderby="random"  status="open|featured"}

{if count == 1 AND '{format}' != 'wide'}
<div class="item {format} photography">
  <div class="item-content" style="background-image:url({beelden limit="1"}{url}{/beelden})"></div>
                            <div class="item-overlay">
                                <span class="item-title">{templates}</span>
                                <span class="item-title">{title}</span>

                            </div>
                        </div>
{if:else}
<div class="item {format} photography">
<div class="item-content" style="background-image:url({beelden limit="1"}{url}{/beelden})"></div>
                            <div class="item-overlay">
                                <span class="item-title">{templates}</span>
                                <span class="item-title">{title}</span>

                            </div>
                       </div>
{/if}

  {/exp:channel:entries}

```

# Answer
Use two channel entries tags with one in an embed.

```
{!-- Main template; First entry --}
{exp:channel:entries channel="work" orderby="random" limit="1" search:format="=not wide" status="open|featured"}

  <div class="item {format} photography">
    <div class="item-content" style="background-image:url({beelden limit="1"}{url}{/beelden})"></div>
    <div class="item-overlay">
      <span class="item-title">{templates}</span>
      <span class="item-title">{title}</span>
    </div>
  </div>
  {embed="TEMPLATEGROUP/TEMPLATE" first_entry_id="{entry_id}"}
{/exp:channel:entries}

```

.

```
{!-- Embedded template: TEMPLATEGROUP/TEMPLATE --}
{exp:channel:entries channel="work" orderby="random" entry_id="not {embed:first_entry_id}" status="open|featured"}
  <div class="item {format} photography">
    <div class="item-content" style="background-image:url({beelden limit="1"}{url}{/beelden})"></div>
    <div class="item-overlay">
      <span class="item-title">{templates}</span>
      <span class="item-title">{title}</span>
    </div>
  </div>
{/exp:channel:entries}

```
> 0 votes

# Answer
Maybe a bit wasteful but you could just hide the first entry with the "wide" class using CSS.

*Note: if you're using pagination or using other conditionals related to the count or total number of entries then this won't be helpful.*

First, get all your entries as normal but add a special class *(.first-entry)* to the first entry that is output....

```
{exp:channel:entries channel="work" orderby="random" status="open|featured"}
    <div class="item {format} {if count==1}first-entry{/if} photography">
        <div class="item-content" style="background-image:url({beelden limit="1"}{url}{/beelden})"></div>
        <div class="item-overlay">
            <span class="item-title">{templates}</span>
            <span class="item-title">{title}</span>
        </div>
    </div>
{/exp:channel:entries}

```

Then apply a bit of css to find anything with the first-entry AND the .wide class.

```
.first-entry.wide{
    display:none;
}

```

If the first entry doesn't have the wide class then nothing will change. If it does have the wide class then it will be hidden.

It's the simplest, if not the most efficient, way of doing it.
> 0 votes

---
Tags: conditionals, orderby
---


title: Password Reset Not Sending Emails

text:
# Question
Title: Password Reset Not Sending Emails
My login suddenly stopped working, despite me using the same credentials and not having changed them. So, I have tried to reset my password by going thru the "forgotten password" process. I get this from EE:

> If this email address is associated with an account, instructions for resetting your password have just been emailed to you.

I receive no emails. I tried password resetting another account; also no emails. Checked spam, too.

The site was recently copied over from one hosting to another. Is there anything in the EE database that stores hosting specific mail configuration when initially installed? Perhaps that might be causing the problem?

# Answer
If you were logged in on the site at the old host when the database backup was taken it could be that the new site thinks you're still logged in. If you then have the security preference to allow only one login at a time for each account this could stop you logging in.

The fix for this would be to look in the exp\_sessions table and remove any rows in there for your member ID.

You may also want to switch the login method from sessions to cookies (or vice versa) and see if that helps. You can do this via your config file.

The reset email may not arrive for a number of reasons. It could be a misconfiguration, improper credentials, or simply a spam filtering issue. I'd crack the login problem first then look at the email problem second. Examine the server logs and maybe use a transactional service such as Mandrill so you can see what's happening to the emails.
> 1 votes

---
Tags: email, forgot-password
---