# Question
Title: Google Maps for EE stopped plotting markers for new entries in the control panel
I've just noticed that the Google Maps for ExpressionEngine fieldtype no longer seems to be plotting markers onto the map for new entries in the control panel. When I enter a location and search, nothing happens. It should plot a marker on the map. I have a few sites that use this add-on, and the same issue is happening on each of them.

Any ideas what's going wrong with this? I know the add-on is no longer supported, but if anyone has run into the same issue and knows a fix, please let me know. I suspect it might be a Google API change or even a call-back to the Objective HTML servers/services that is suddenly causing this issue.

I'm using ExpressionEngine 2.7.2 and Google Maps for EE 3.3.8.

# Answer
There seems to have been a recent change in the gmap API. See if this thread can shed some light on your issue.

Apparently changing

```
$this->EE->theme_loader->javascript('https://maps.google.com/maps/api/js?sensor=true');

```

to

```
$this->EE->theme_loader->javascript('https://maps.google.com/maps/api/js?v=3.22&sensor=true');

```

in `gmap/ft.gmap.php` might help.
> 6 votes

# Answer
I ran into the same issue multiple times. Most recently yesterday. Creating an API key and including it in the code solved my issue.

After you create a key and set your credentials (make sure you add your domain) edit ft.gmap (expressionengine \> third\_party \> gmap \> ft.gmap.php) and change the following line:

```
$this->EE->theme_loader->javascript('https://maps.google.com/maps/api/js?v=3.22&sensor=true');

```

to

```
$this->EE->theme_loader->javascript('https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_GOES_HERE&sensor=true');

```

If you need help with a key see these Google directions.
> 1 votes

---
Tags: control-panel, google-maps-for-ee
---


title: Expresso Store & PayPal SHA-256

text:
# Question
Title: Expresso Store & PayPal SHA-256
My client just received an email from PayPal regarding SHA-256 as follows:

"At PayPal, security and safety are our top priorities and, as a result, we’re implementing a series of security upgrades throughout 2016 and 2017. To comply with industry standards, we need to move our endpoints to stronger encryption known as SHA-256 by 30 September 2016.

In preparation for our transition to SHA-256, we'll be undertaking critical testing between 17 June and 29 September 2016. During this period, if your systems aren’t SHA-256 compatible, your business’ ability to accept payments with PayPal may be temporarily impacted. We strongly recommend that your systems are compatible with SHA-256 by 17 June to ensure that your business isn’t interrupted. If your systems aren’t SHA-256 compatible by the full cutover on 30 September, your business will be unable to accept payments with PayPal until changes are made. For more details about our transition to SHA-256, please go to 2016-2017 Merchant Security Roadmap Microsite."

The site is running EE v2.7.3 and Store v2.2.0 using PayPal Express as the gateway.

Is there anything that needs to be done to make the site SHA-256 compatible?

# Answer
> 0 votes
The only thing that you should need to do is contact your host to make sure that they are SAH-256 and G5 compatible. PayPal has a document on their resource website about the changes being implemented and when.

PayPal has already changed over their Sandbox sites to require SHA-256 encryption so if you have a dev site setup on the same server you can test with Sandbox API credentials to see if everything is compliant before the June 17th start dates.

# Answer
> 0 votes
I wrote to my webhost, Nexcess, regarding that email from Paypal, and they said that this pertains to the SSL encryption used on the server. And you can test your site for compatibility here:

https://shaaaaaaaaaaaaa.com/

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


title: Output the repeat rule for an event

text:
# Question
Title: Output the repeat rule for an event
Is it possible to output the repeat rules for recurring events with Solspace Calendar?

For example, instead of listing all of the occurrences, output something like "Repeats Daily", "Every Monday and Friday", etc.

Or should I just add an extra text field where the author can enter their own description of the schedule?

# Answer
> 0 votes
There currently isn't a way to do this, but might be in a future version of Calendar. :)

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


# Question
Title: https and Control Panel mixed content error
I've got a site in SSL but when I visit the Control panel it is completely unstyled and looking in the inspector I see a mixed content error and js/css is being blocked.

Not sure why this is happening, but in case it's relevant am using FocusLab Master Config for EE3

\**** **UPDATE** \*****

I added this to config.prod.php and no change

```
$env_config['cp_url'] = 'https://www.domain.com/admin.php';

```

\**** **UPDATE 2** \****

This is in response to @jrothafer about the config settings. Here is the relevant code from config.master.php

```
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
$base_url = $protocol . $_SERVER['HTTP_HOST'];
$base_path = $_SERVER['DOCUMENT_ROOT'];

```

# Answer
This is always a themes folder and protocol issue, I've found. You mentioned this:

```
$env_config['cp_url'] = $env_config['base_url'] . '/admin.php';

```

What are you parameters for various `$env_config` array entries? Make sure that array is using `https` for that URL, and also your themes folder **must** also be behind SSL.

**Update**

Hey, so are you *forcing* SSL for all connections? If not, you should be! Otherwise,

```
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
$base_url = $protocol . $_SERVER['HTTP_HOST'];
$base_path = $_SERVER['DOCUMENT_ROOT'];

```

This set up will respect the HTTP protocol request and load assets over plain HTTP. You need to force that SSL! Best using `.htaccess` rules, or equivalent nginx rules:

```
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://mydomain.com/ [R=301,L]

```
> 4 votes

# Answer
With help from @jrothafers answer. I hardcoded the themes path in config.master.php and it's working now.

```
$env_config['theme_folder_url'] = https://www.domain.com/themes/';

```

Ideally I wouldn't have to do that, but it works.
> 0 votes

---
Tags: ee3, focus-lab-master-config, ssl, secure
---


# Question
Title: Channel forms {error:my_field_name} with parameter error_handling="inline" doesn't display errors
I cannot make {error:my\_field\_name} to work. It is like it doesn't parse. Here is my code :

```
{exp:channel:form channel="mychannel" return="test/index" error_handling="inline"}
<div>
        <label for="concerne">Concerne <span class="champs_requis">*</span></label>
        <div>{instructions:concerne}</div>
        <div class="error">{error:concerne}</div>
        {field:concerne}
    </div>
{/exp:channel:form}

```

If I use

```
{custom_fields}
{if error}<p class="error">{error}</p>{/if}
{/custom_fields}

```

it gives me error validation messages but I need manually constructed fields so I can't use {custom\_fields} loop.

Is this happening to someone else (and I have to report the bug) or just me? If so, what am I doing wrong?

EE version : 3.3.2

# Answer
In fact it was a bug of the EE version. The bug has been fixed in EE 3.3.3 release.
> 0 votes

# Answer
In your first code example you're using a `<div>` tag for the error styling but in the second code example you're using a `<p>` tag. I suggest inspecting your code to make sure CSS isn't hiding the .error class in your first code example.
> 0 votes

---
Tags: safecracker, ee3
---


title: Output unique categories

text:
# Question
Title: Output unique categories
I am outputting a list of categories for entries which have prices using the code below, how can I filter it to only show unique categories? Right now it is showing multiple categories with the same name.

```
{exp:channel:entries channel="channel_name" dynamic="off"}
{if price}
        {exp:gwcode_categories entry_id="{entry_id}" style="linear"}{if depth == 2}{cat_url_title}{/if}{/exp:gwcode_categories}
{/if}
{/exp:channel:entries}

```

# Answer
Ok, found a way using Stash and unique filter.

```
 {exp:stash:set_list name="products" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="channel_name"}
        {if price}
            {exp:gwcode_categories entry_id="{entry_id}" depth="2"}
            {stash:parent_item_title}{parent_url_title}{/stash:parent_item_title}
            {stash:item_name}{cat_name}{/stash:item_name}
            {stash:item_url}{cat_url_title}{/stash:item_url}
            {/exp:gwcode_categories}
        {/if}
    {/exp:channel:entries}
    {/exp:stash:set_list}

    <form>
        <select><option value="">Step 2. Select Option</option>
            {exp:stash:get_list name="products" unique="yes" orderby="item_name" sort="asc"}
            <option class="{parent_item_title}" value="{item_url}">{item_name}</option>
            {/exp:stash:get_list}
        </select>
    </form>

```
> 0 votes

---
Tags: gwcode-categories
---


title: MoreEvents PayPal Transaction Failed

text:
# Question
Title: MoreEvents PayPal Transaction Failed
We have just started to reuse our renewals templates for 2016. Last year everything worked successfully and we processed thousands of transactions. I have just carried out a few tests and i'm getting an error in the models/more\_event\_cp\_data.php program.

Can anyone identify the likely cause?

The code in question is as follows:-

---

```
public function get_event_tx($event_tx_id='')
{
    $this->EE->db->where("id", $event_tx_id);
    $q = $this->EE->db->get("moreevents_tx")->row_array();

    $c = MoreEventCurrency::get($q['currency']);

    $q['amount_paid'] = $c['htmlEntity'].number_format($q['amount_paid'], 2);
    $q['price'] = $c['htmlEntity'].number_format($q['price'], 2);

    $str = "<ul>";
    foreach(unserialize($q['attendees']) as $attendee){
        $str .= "<li>". $attendee['name']."</li>";
    }
    $str .= "</ul>";

    $q['attendees'] = $str;

    $q['raw_response'] = "<pre>".print_r(unserialize($q['raw_response']), TRUE)."</pre>";
    $q['last_activity'] = date("r", $q['last_activity'] );

    unset($q['success_template']);
    unset($q['fail_template']);

    return $q;
}

```

---

# Answer
My guess is that you have an event which has no attendees, and the code assumes that each event will *have* attendees, hence the error.

Try replacing:

```
$str = "<ul>";
foreach(unserialize($q['attendees']) as $attendee){
    $str .= "<li>". $attendee['name']."</li>";
}
$str .= "</ul>";

$q['attendees'] = $str;

```

With:

```
if($attendees = unserialize($q['attendees'])
{
    $str = "<ul>";
    foreach($attendees as $attendee){
        $str .= "<li>". $attendee['name']."</li>";
    }
    $str .= "</ul>";

    $q['attendees'] = $str;
}

```
> 0 votes

---
Tags: ee2
---


title: Google maps API key not being added

text:
# Question
Title: Google maps API key not being added
I'm updating an EE site from 2.3.x to 2.10.3 and as part of that I'm upgrading mx\_google\_map from 1.4 to 1.5.3.

Using the field type on the front end I get the following console error:

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

I have this in

```
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="/themes/third_party/mx_google_map/mxgooglemap.js"></script>

```

On the live site the api key is included but in the updated site it doesn't appear to work.

The test site I'm using is on a sub-domain and I wonder if that's the cause of the problem or is it down to the extension.

Should I specify the API key somewhere, am I missing something obvious?

Thanks.

# Answer
Try adding the key as a GET parameter to the API source script tag:

```
https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_GOES_HERE&sensor=true

```

I've seen this issue in some places, as well as right here! :

Google Maps for EE stopped plotting markers for new entries in the control panel
> 2 votes

---
Tags: mx-google-map
---


# Question
Title: Cannot associate events to calendars in Solspace Calendar
I have just installed Solspace Calendar 1.8.14 for EE 2.10.1.

I have added three calendars, and three events. When I try to associate an event to a calendar, nothing happens. When I click "Add Rule" nothing happens. Also, when I manually set the dates and times, nothing happens. In each scenario after I click submit, I am returned to the submission confirmation page... the "Edit This Entry, Return to Filtered Entries, Publish Another Entry or View Comments (0)" page. AND when I choose to edit, the updates are not there.

The editor page looks like something is broken, see attached screen grab. Any suggestions as to what I should check? or do? Is this a bug with EE? Calendar or a conflict with an existing module?

I have set permissions for admins and contributors to be able to post to the channel. I am a super admin so permissions shouldn't matter anyway.

Any help is greatly appreciated.

# Answer
This looks like it did not install correctly. Specifically some things from the themes seem to be missing. Make sure you uploaded the /themes/third\_party/calendar folder.
> 1 votes

---
Tags: solspace-calendar
---


title: Freeform and Dynamic Email Recipients

text:
# Question
Title: Freeform and Dynamic Email Recipients
I have a Freeform form that is a request for information. There are checkboxes in the form for various locations on the site. I want to dynamically send emails based on the checkboxes that are checked. Is that possible?

It is poorly written the way it is now. After the form is submitted, the coder added raw php to the response template to parse the locations and build a string for the "to" variable for the dynamic recipients. The mail was sent using the php "mail" command. They also put it inside a freeform entries tag pair. What happens is sometimes the mail does not send at all, and sometimes it sends duplicates, which are also sent at different times.

Any suggestions either with or without Expression Engine?

# Answer
Freeform Pro has it's "Composer" form editing tool that includes a field for dynamic recipients. Otherwise if you're using hard coded forms (or the free version of Freeform) you can use the recipients variables - https://solspace.com/docs/freeform/form/#freeform\_recipient\_value1 \- that would also negate the need for PHP in templates.
> 0 votes

# Answer
Here is what I did. I create a select box in the form populated with channel data and using custom field for optn text and entry\_id as option value. Then created an EE extension that listens for freeform\_module\_admin\_notification hook. Then use the entry\_id value from the form to find the email address from channel data table. Then pass that email address into $vars\['recipients'\]. Then freeform sends an email to any email address in the $vars\['recipients'\] array.
> 0 votes

---
Tags: solspace-freeform, php, email
---


# Question
Title: Does Assets support the category image field
I'm trying to attach category images from the edit category function in EE. I noticed that while adding an image category images only displays the EE file manager. I'm using Assets (S3) however as the main image source.

Does Assets support category images or is there any other way to achieve this?

# Answer
> 0 votes
No, it does not. You'd have to write an add-on that invoked the Assets sheet on the category edit screen, but it's be tricky (injecting a bunch of javascript into the page essentially).

# Answer
> 0 votes
I thought I'd spare others from a little bit of false hope and lost time, and share a workaround that did not pan out:

My thought was to add a 'New Category Field' to the Categories I was interested in using Category Images in, using 'Assets' as the field type. Well, sadly 'Assets' is not an option there.

Unless there's some way of expanding which field types are allowed as 'Category Fields' ..?

Rats.

# Answer
> 0 votes
My workaround was to just put the full Amazon S3 (or Cloudfront) url into the category description, then call in on the page like so:

```
{if category_description}<img src="{category_description}" alt="{category_name}" />{/if}

```

It's hacky but it works.

---
Tags: assets
---


# Question
Title: query : how to get the value of a custom field within a relationship field?
I have a channel 1 and a channel 2. In channel 1 I have a relationship field that relate to channel 2.

I want (by making a query, for reasons I won't explain here because this is not important) to trace the content of a custom field (named "client") of the channel 2.

I know I have to look into `exp_relationships` table but don't know how to build my query because the columns of `exp_relationships` are not very relevant to me :D

What I have as material to use at this stage is the ID of the parent entry.

Anyone can help me on this please? Thanks in advance.

# Answer
The `exp_relationships` table’s two relevant columns are `parent_id` and `child_id`. In your example, the `entry_id` of the entry in Channel 1 is the `parent_id` and the `entry_id` from Channel 2 is the `child_id`.

So you’ll build your query by selecting fields from the `exp_channel_data` table, joining to `exp_relationships` via the `child_id`, and specifying the entry via the `parent_id`. I’m using SequelPro, and something like this appears to do the trick…

```
select field_id_N
from exp_channel_data
inner join exp_relationships on exp_channel_data.entry_id = exp_relationships.child_id
where exp_relationships.parent_id = NNN

```

There are variations. Let’s say you are looking for the `title` of the child entry, you can skip the `exp_channel_data` table and go straight for the jugular by linking to the `exp_channel_titles` table instead, like this…

```
select title
from exp_channel_titles
inner join exp_relationships on exp_channel_titles.entry_id = exp_relationships.child_id
where exp_relationships.parent_id = NNN

```
> 0 votes

---
Tags: relationships, query, query-module
---


# Question
Title: DevDemon Subscriptions automatic emails: template caching issue and access to member data
Does anyone know how to clear the cache to be able to make changes to the email templates and have them update immediately? Right now, the templates are caching and changes don't show in the actual sent emails unless I create a new template and update the Action.

Also, how can I get access to the Member info from within the email template? For example, we want to confirm the username and email address they registered with, but the standard {username} and {email} tags doesn't work.

Thanks in advance, Justin

# Answer
Are the {username} & {email} tags wrapped within something like this:

```
{exp:subs:subscriptions hash="{subs:subs_hash}" status="ALL"}
  {exp:member:custom_profile_data member_id="{subs:member_id}"}
      Member ID: {member_id}<br>
      {member_group}
  {/exp:member:custom_profile_data}
{/exp:subs:subscriptions}

```

The above works in my templates.
> 0 votes

---
Tags: devdemon, subscriptions, devdemon-subscriptions
---


# Question
Title: Issue setting entry_date via channel form
I'm getting a problem with the entry\_date field when creating an entry via a channel form.

I have set the following parameters on the channel form:

```
  include_jquery="no"
  include_assets="no"
  datepicker="no"

```

and I am initializing the date picker field myself as I want to set the date format and date range myself:

```
        //init our datepicker setting date range
    $date.datepicker({ minDate: -90, maxDate: "+0D"});

    //set our date format based on locale
    var locale = navigator.language || navigator.userLanguage;
    if (locale === "en-US") {
            var dateformat = 'mm/dd/yyyy';
        }
        else {
            var dateformat = 'dd/mm/yyyy';
        }
        $date.datepicker({dateFormat: dateformat});

```

After submitting the form When I look in the database (exp\_channel\_titles) it has the correct values for the year, month and day columns but the entry\_date column is saving a timestamp that is always a day **behind**.

If I change the channel form to use the native EE implementation of the date picker, i.e set my parameters to :

```
  include_jquery="no"

```

thereby having EE initialize the date picker field then the date is saved correctly but this way I am unable to set the date format or date range.

Any suggestions?

# Answer
> 0 votes
OK, I found the issue, unlikely that someone else will run into it but you never know.

So we migrated our site from 2.7.2 \> 2.10.2. During the migration I did a straight copy of the entire exp\_member table. However the column structure of this table has diverged across the new versions. My table was missing two columns relating to localization settings (date format & hours). Adding these back in fixed my issue.

---
Tags: safecracker, jquery, date
---


# Question
Title: Pagination and keeping list/table view until user changes view
I am working on a site that has an articles page. On this page a user is given the option of viewing in list view or table view. However there's pagination on the page.

What happens is, when the user selects a view and paginates ti the second page, the default view is set again.

Is it possible to keep the users chosen view until they change it again? and can this be done without the use of cookies?

thanks

# Answer
If you don't want to use cookies, you'll have to add an extra segment to your URL to indicate the layout, and then check for the value of that segment when deciding which layout to use.

For example: **/articles/list/P10** vs **/articles/grid/P10**.

```
{if segment_2 == 'list}
    // Template for list view
{if:else}
    // Template for grid view
{/if}

```
> 0 votes

---
Tags: pagination
---


title: Categories as dropdown

text:
# Question
Title: Categories as dropdown
How can I make the categories a select box?

Thanks

# Answer
I don't think it's possible, as by default, categories are 'multiple-choice', hence the checkboxes.
> 0 votes

---
Tags: categories, fields
---


title: can I format member profiles?

text:
# Question
Title: can I format member profiles?
can I format a profile in the bio section of a member profile without resorting to html tags? We often need to use **bold**, *italic* and especially links.

# Answer
> 0 votes
No, it is a plain text field in the database, and it is rendered as plain text in the control panel.

---
Tags: members, profile
---


# Question
Title: EE2 Control Panel Error: Unable to load the following extension file: ext.rte.php
I am trying to migrate EE2 application to a new server. There are a bunch of errors. When I try to open the CP(EE system folder), it shows up without loading CSS correctly. After I login, it gives error message below:

> **Error**
>
> **Unable to load the following extension file:**
>
> **ext.rte.php**

Does anyone have an idea how to solve that error? Thanks.

# Answer
Reupload your themes folders and/or check file permissions of said folder
> 0 votes

---
Tags: control-panel
---


title: Parent relationship in grid field type

text:
# Question
Title: Parent relationship in grid field type
I have a channel called 'models' containing a grid field called 'size\_chart'. I have another channel called 'photos' with a grid field called 'photo\_meta' inside which I have a relationship field called 'model' which is related to entries in the 'models' channel.

I want to be able to loop through the models and only show photos they are in, however I can't seem to get the right syntax with the relationship field buried away inside the the grid field type. This is as far as I have got..

```
{exp:channel:entries channel="models"}
  {title}
    {parents channel="photos" field="photo-meta:model"}
       <!-- Photo and title -->
      {parents:title}
      {parents:image}
      <!-- Model info -->
      {size_chart:height}
      {size_chart:waist}
    {/parents}
{/exp:channel:entries}

```

# Answer
> 1 votes
Just noticed a line at the bottom of the docs for Relationships which answers my own question:

"The Relationships field can be used as a Grid field column. Currently it is not possible to get the parents of a relationship field that is inside of a Grid field. You can also not use Relationships inside of a Grid field that does not store Channel data."

# Answer
> 1 votes
I made a quick simple plugin that works around this issue. The plugin returns a pipe-separated list of entry ids which can then be used in a channel entries tag's `entry_id` or `fixed_order` parameters.

https://github.com/thisisjamessmith/ee-grid-relationship-parents

I'd recommend then integrating that list of ids into your preferred Stash coding pattern, probably using `match` and `against` to filter against a larger list.

# Answer
> 0 votes
Bringing up a stale topic, you can totally achieve parent relationships within a grid field. You just need to use PHP to circumvent the Grid itself! The relationship data is 100% ok, it's just the parents tag doesn't resolve to the right place (a grid instead of an entry).

The syntax is actually quite straight-forward so I've included an example here.

What we're going to do is get the parents ourselves with PHP, and utilize the EE parse order to process an embed that will display the parents info.

For this example I've deliberately kept things simple, I've made 2 channels (`parent_channel` and `child_channel`), the `parent_channel` has a grid on it with a label(text) and child(relationship) column on it. I've populated my entries as so:

* Even Children (parent\_channel)
    + Child 2 (child\_channel)
    + Child 4 (child\_channel)
    + Child 6 (child\_channel)
* Odd Children (parent\_channel)
    + Child 1 (child\_channel)
    + Child 3 (child\_channel)
    + Child 5 (child\_channel)

So now, as we expect from the OP we are iterating some child entries, we have a pretty standard channel entries loop here:

*PHP is **ON**, parsed on **Output***

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

    <h2>{title}</h2>

    <strong><em>Parents</em></strong>
    <br />
    <?php
        $res = ee()->db->get_where('relationships', array('child_id' => '{entry_id}'));

        foreach($res->result_array() as $parent){
            print '{embed="templates/.parent" eid="'.$parent['parent_id'].'"}';
        }
    ?>
    <hr />
{/exp:channel:entries}

```

Here, please note the simple query that interrogates the relationship table. this gets out relevant parents. In this example each child only has one parent however if you note the foreach loop will take care of multiple parents. Also note how we print the embed tags with php, this way we can avoid any unforeseen 'PHP inside an embed tab, inside a channel entries tag on a template' hell, though it may not be required!

So now for that embedded template, here it really is as simple as it gets, no need for PHP but it's a standard template, as standard as it gets so you can use PHP, any EE tags, whatever you want my friends!

```
{exp:channel:entries dynamic="no" entry_id="{embed:eid}"}
    {title}
{/exp:channel:entries}

```

There you have it, winner winner, chicken dinner! To make my answer 110% complete, heres the output I get (please note I'm using EE2.8.1 in my sandbox, but this all should be correct for EE 2.9.X too).

## Child 6

***Parents***
Even Children

---

## Child 5

***Parents***
Odd Children

---

## Child 4

***Parents***
Even Children

---

## Child 3

***Parents***
Odd Children

---

## Child 2

***Parents***
Even Children

---

## Child 1

***Parents***
Odd Children

---

Please do vote up, and/or click as the answer @Kenny (if your still active around here) if this helps y'all!

Also, Kenny, specifically notice how the embedded template is simply the parent in a channel entries loop? This means you should be able to then access your `size_chart` relationship in the normal, child fashion...

---
Tags: relationships, grid
---


# Question
Title: How can I make dynamic Grid (or Matrix) fields in the control panel?
I have two Grid fields, the first of which is a Relationship field. I need the second Grid field's format to change based on the selection made in the first field.

For exmample:

* If Grid Field 1 = A then Grid Field 2 = Text Input
* If Grid Field 1 = B then Grid Field 2 = Time
* If Grid Field 1 = C then Grid Field 2 = Date

...and so on.

Is this possible?

# Answer
It is not. The simplest solution is to have all four columns and simply instruct the content manager to use the appropriate 2nd, 3rd, or 4th column based on the value of the 1st.
> 1 votes

---
Tags: matrix, relationships, control-panel, grid, dynamic
---


# Question
Title: How do you Subscribe to a Calendar generated by Solspace Calendar
Maybe I am missing something as I am surprised this has not been more documented, but how do you "subscribe" to a calendar feed generated by Solspace Calendar?

My expected result would be that after adding a calendar by URL in Google Calendar, any changes I make to the calendar's events in EE would be reflected in Google Calendar.

The URLs I have tried (as per this question) are:

* `http://mydomain.com/events/icalendar-template`
* `webcal://mydomain.com/events/icalendar-template`

where /events/icalendar-template looks like this `{exp:calendar:icalendar}{/exp:calendar:icalendar}` and spits out the .ics file on direct visit via http://

On adding the calendar in Google Calendar, the events are correctly pulled through initially, but then don't update when I make changes in the EE.

I have also tried using a query string for the URL (as per this thread) just in case the problem was Google Calendar's but that hasn't fixed it.

EE version: 2.9.0, SC version: 1.8.9

# Answer
> 0 votes
Frustratingly, having tested this now also in OS X Calendar, the syncing seems to be working fine (I set the refresh rate to every 5 minutes as a test). It seems then like this is just an issue with Google Calendar - either that it is not syncing or is syncing very rarely.

Looks like I'll be spending a bit of time having a look through this thread!

So in summary, it seems like the above URLs (`http://mydomain.com/events/icalendar-template` and `webcal://mydomain.com/events/icalendar-template`) *do* work to subscribe to a calendar generated by Solspace Calendar with the above template `{exp:calendar:icalendar}{/exp:calendar:icalendar}` code. I should not that I have not thoroughly tested or explored the difference between the two protocols.

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


# Question
Title: CartThrob incorrect entry date format for Purchased items
I have EE 3.3.3 and CartThrob 3.0.2. The entry date for purchased items is not formatted. They appear e.g. 1466609887. Is this a bug or I need to fix a setting somewhere?

# Answer
> 1 votes
I think it has always looked like that in the Control Panel, because that's how the database stores dates, as unix timestamps.

But if you want it formatted nicely in a template, you can apply all of EE's standard date formatting tricks, e.g `{item:entry_date format="%F %d %Y"}`

---
Tags: cartthrob
---


# Question
Title: Expression engine 3 - plugin not being picked up
I am trying to create a simple plugin, however EE is not picking it up so I cannot enable it.

```
class Age_gate
{
  public static $name         = 'Age Gate';
  public static $version      = '1.0';
  public static $author       = 'Me';
  public static $author_url   = 'http://example.com/';
  public static $description  = 'Makes people verify their age.';
  public static $typography   = FALSE;

    public $return_data = "";

    public function __construct()
    {
        $this->return_data = "Hello World";
    }
}

/* End of file pi.plugin_name.php */

```

# Answer
> 4 votes
you need to add a addon.setup.php file to the folder. https://docs.expressionengine.com/latest/development/addon\_setup\_php\_file.html

---
Tags: plugin, ee3, custom
---


title: Query Module: Error escaping quotes

text:
# Question
Title: Query Module: Error escaping quotes
We recently moved over some of our templates to use the Query module to reduce the number of DB queries happening.

However I'm now experiencing an issue where some of the field data is being returned un-escaped and when I try and output the result using PHP's json\_encode() function I'm getting a PHP error.

```
:  syntax error, unexpected 'flying' (T_STRING), expecting ')' in

```

Here's my question:

1. Should the Query Module escape strings?
2. If not why not and how should I overcome this?
3. I'm not able to use MySQL REPLACE(column, '"', ''') as this causes the QUERY module to throw and SQL error. Any other way I can escape the quotes?

# Answer
Ok, so I managed to find a solution using Low Replace, this handy plugin escapes the strings before my PHP code gets to it hence fixing the issue.

```
{exp:low_replace find="QUOTE|NEWLINE" replace="\QUOTE|SPACE" multiple="yes"}

```
> 0 votes

---
Tags: query-module
---


# Question
Title: Expression Engine 2.7 FreeForm Hidden Captcha
My client has just come back to be with a new requirement to not use the EE captcha functionality and instead implement a hidden captcha.

Is this possible with freeform, if not how would you tackle it?

I have done some research but I cannot find anythign with regards to a hidden captcha and freeform.

Thanks in advance

# Answer
You're looking for the Snaptcha add-on.
> 1 votes

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


title: Channel Images with EE3

text:
# Question
Title: Channel Images with EE3
I'm in the process of upgrading a client's website with EE3 and see that a version of Channel Images is available. However the channel images documentation still references the EE2. If there is a channel images EE3 version, how do I install it and are there other changes I should be aware of and is there any documentation for the EE3? I'm hesitant to upgrade my client's site without further instructions as channel images is an important component.

# Answer
I use both version (for EE2.x and 3.x) on few site and there's not so many difference.. Installation is quick simple and pretty straight forward. (You got a /system and /themes folder..
> 0 votes

---
Tags: channel-images
---


# Question
Title: Calling plugin function depending upon input to template
I have a template that takes input from a form and and does several operations. These operations call plugin functions and I'd like one of them to call a different function if one of the input parameters is set.

This is the template code:

```
{if segment_2 == 'submit'}
    <?
      $embed_params = 'email="' . $_POST['email'] . '"';
      $embed_params .= 'PID="' . $_POST['PID'] . '"';
      $embed_params .= 'DOB="' . $_POST['DOB'] . '" Site="" site="'.$_POST['site'].'"';
    ?>
    {embed='/forgot_password_form' message='{exp:forgot_password:send_email code="{segment_3}" <?=$embed_params?>}' <?=$embed_params?>}
{if:elseif segment_2 == 'reset'}
    {embed='/forgot_password_reset' email='{exp:forgot_password:check_code code="{segment_3}"}' code="{segment_3}" <?=$embed_params?> site="<?=$_POST['site']?>"}
{if:elseif segment_2 == 'reset_submit'}
    {embed='/forgot_password_reset' message='{exp:forgot_password:update_password code="<?=$_POST['code']?>" password="<?=$_POST['password']?>" site="<?=$_POST['site']?>" }' }
{if:else}
    {embed='/forgot_password_form' }
{/if}

```

They get an email with a reset code when the `send_mail` plugin function s called and then when they click the reset link, it calls `forgot_password/reset` to load a reset form and when they submit the reset form, it calls the forgot\_password/reset\_submit to update their password.

Now, if the `$_POST["email']` is set, I want to call `exp:forgot_password:send_email`, if it is not set, I want to call `exp:forgot_password:show_pass`.

I'm going to return their actual username and password to show vs. having them reset it.

How would I call `show_pass` instead of `send_email` if the email address is not set here? Or should I just use the plugin code to determine?

# Answer
It is highly advisable to avoid using PHP in templates, in this instance it's even more important as you're taking raw POST data and doing no validation or security checks on it so opening your website up to security vulnerabilities.

Use the Mo' Variables add-on (EE2 and EE3 compatible) to capture the POST data, which will sanitize it as well.

```
{if segment_2 == 'submit'}
    {embed='/forgot_password_form'
        message='{exp:forgot_password:send_email code="{segment_3}"
            email="{post:email}"
            PID="{post:PID}"
            DOB="{post:DOB}"
            Site="{post:site}"}'
        email="{post:email}"
        PID="{post:PID}"
        DOB="{post:DOB}"
        Site="{post:site}"}

{if:else}
    {if segment_2 == 'reset'}
        {embed='/forgot_password_reset'
            email='{exp:forgot_password:check_code code="{segment_3}"}'
            code="{segment_3}"
            email="{post:email}"
            PID="{post:PID}"
            DOB="{post:DOB}"
            Site="{post:site}"}
    {if:elseif segment_2 == 'reset_submit'}
        {embed='/forgot_password_reset'
            message='{exp:forgot_password:send_email code="{segment_3}"
                code="{post:code}"
                password="{post:password}"
                Site="{post:site}"}'}
    {if:else}
        {embed='/forgot_password_form'}
    {/if}
{/if}

```

I'm not actually sure where you want to call `send_email` or `show_pass` in all this, but here it is:

```
{if "{post:email}"}
    {exp:forgot_password:send_email}
{if:else}
    {exp:forgot_password:show_pass}
{/if}

```

How are you going to show the password as EE uses 1 way encryption? Or is this not related to EE membership?

All the above is based on your code, but personally, I would refactor the lot and place it in your add-on to process it. You don't need to pass any POST, segment or site variables then as they'll all be accessible from within your add-on. Then you could simply have:

```
{exp:forget_password}
    {if "{route}" == "form"}
        Display the form content in this template instead of embed using variables
        output from your tag pair plugin (with post data correctly sanitized using
        correct EE form class).

    {if:else}
        Display the reset content in this template, as above
    {/if}
{/exp:forget_password}

```
> 0 votes

---
Tags: templates, plugin
---


# Question
Title: Simple Search "You are not permitted to use the search engine." if I am not logged in
I have a simple search form installed on EE3, and I am only allowed to use the site search if I am logged in to the control panel. Is there a permissions setting I am missing somewhere? I don't have any URLs blacklisted.

# Answer
Take a look at Members › Member Groups › Guests › Access search utility.

Should solve your problem
> 5 votes

---
Tags: search, simple-search
---


# Question
Title: Where to set the ""APPPATH" or "PATH_THIRD"" or "PATH_THIRD" variable?
There are lots of places used global variables like "APPPATH" or "PATH\_THIRD"

> $path = ($native) ? APPPATH.$type.$pkg\_name.'/' : PATH\_THIRD.$pkg\_name.'/';

I am having trouble with the $path value as it returned null. So I want to figure out where to set APPPATH variable?

---

> **Context:**
>
> In extensions.php, EE try to load modules. However, $path returns null

Thanks guys!

# Answer
> 0 votes
It looks like you're using a custom path to your third party add-on folder. My guess is that you have not updated `$config['third_party_path']` to reflect the path as it exists in your new server environment.

---
Tags: ee2
---


title: Hard-code encoded query in results

text:
# Question
Title: Hard-code encoded query in results
How can one encode the search query to hard-code it in the results tag?

I would like to have a "related content" section on a page whereby the related content is gathered by low search.

The keywords are based on the entry `title` of the entry the related content is shown on. At the moment i'm embedding the related content section and passing the `{title}` to the embed. I would like to use the `{title}` as search query.

If 'Encode query' is set to 'yes', this does not work, because the query is not encoded (if set to no, it works).

# Answer
> 1 votes
Just specify the `keywords` parameter on the `results` tag and omit the `query` parameter.

```
{exp:low_search:results keywords="{embed:title}"}

```

---
Tags: low-search
---


# Question
Title: Captcha validation fails with the rating form
I just installed Solspace Rating module and included the rating form like this:

```
{exp:rating:form entry_id="{entry_id}" allow_duplicates="no" anonymous="yes" collection="neueroeffnungen" return="bewertung_danke"}
    {if not_duplicate}
        {if logged_out}
            <input type="hidden" name="name" value='Guest_{current_time format="%U"}' />
        {/if}

        <select name="rating" id="rating">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
        </select>

        {if captcha}
            {captcha}
        {/if}

        <input type="submit" name="submit" class="submit" value="Rate" />
    {/if}
{/exp:rating:form}

```

It works great if I don't require a captcha, but if I do, I always get:

> The captcha you submitted is incorrect.

Any idea what I'm missing?

EE v2.8.1 - Build: 20140314
Solspace Rating 3.2.3

# Answer
> 0 votes
Try setting the module preferences here:

Modules \> Rating \> Preferences

Use Captcha? set to "yes"

# Answer
> 0 votes
You are missing the captcha input, where the value for validation should go.

Something like:

```
<input type="text" name="captcha" value="{captcha_word}" autocomplete="off" size="20" required />

```

And as far I have some experience with Solspace products you should check what expression they are using for captcha. For example if you're using freeform - it is something like:

```
  {exp:freeform:captcha}

```

or something.

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


# Question
Title: Email Notifcations, characters replaced by equals sign
I've an issue with email notifications sent from the server in that the content has some characters replace by '=' if the email client used is Microsoft based, e.g. Outlook, Hotmail. The following approaches have not helped solve the issue

Setting newline in the tools\_communicate.php file

```
$this->email->set_newline( "\r\n" );

```

updating config.php to include

```
$config['email_newline'] = "\r\n";

```

defining different charsets in the head meta tags

```
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

```

Any suggestions appreciated, Thanks!

# Answer
> 0 votes
Search among various resources led me to believe the issue was caused by misinterpretation of line ends by microsoft powered mail clients (outlook, hotmail). No issues were observed in e.g. gmail or yahoo. As none of the above approaches worked the easiest option was then to set the mail to be plain text rather than html via the settings in MX Notify, the plugin used to trigger sending the mail notifications.

---
Tags: notification, html-email, character-encoding
---


# Question
Title: Need quick Fix for captcha security flaw in EE 2.x
1. On the registration form page, you take note of the captcha code and fill the form with errors (i.e.: unmatched passwords).
2. Reload the page , you now have a new captcha image.
3. Fill the form correctly (i.e.: matching passwords) and enter the old captcha code you got in step 1
4. submit the form

The form submits, while it should not. The security guys don't like that and I need a way to fix this.

Any ideas ?

---

Side note : I'm using freemember extension and reCaptcha extension does not seem to play nicely with free member. (the problem occurs even on default EE install)

# Answer
> 0 votes
What I've done is delete all existing captchas for current IP before creating new one. Drawbacks are minors, except it's a hack...

I post here as it might help others.

Around line 1530 in expressionengine/libraries/Functions.php

add following line

```
ee()->db->query("DELETE FROM exp_captcha WHERE ip_address = '".ee()->input->ip_address()."' OR date < UNIX_TIMESTAMP()-1200");

```

before

```
ee()->db->query("INSERT INTO exp_captcha (date, ip_address, word) VALUES (UNIX_TIMESTAMP(), '".ee()->input->ip_address()."', '".ee()->db->escape_str($word)."')");

```

---
Tags: freemember, registration, captcha
---


# Question
Title: EE Calendar Not Displaying Custom Fields Inside Channel Entries
I am trying to setup some templates to use the EE Calendar module from Solspace. I am calling the calendar data with {exp:calendar:cal and I get my event custom field no problem with this is by itself. If I nest this {exp:calendar:cal inside a exp:channel:entries tag or structure:entries tag I lose the custom field. Basically something like this

> {exp:channel:entries disable="member\_data|categories|category\_fields" \>require\_entry="yes"} {exp:calendar:cal backspace="3" date\_range\_start="year-month-01" \>date\_range\_end="3 months"}

Dropping the exp:channel:entries line it works, but I need data from that since I am trying to integrate calendar data in an existing template. Help is appreciated.

# Answer
Try using the calendar bit as an embedded template.
> 0 votes

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


# Question
Title: Expresso Store: Grab the shipping rule description based on chosen shipping method
In Store, when you set up a Shipping Rule, there's a Description field that our client would like to take advantage of. However, I'm not seeing a tag (or some other way) to display the text that is in that description field.

Screenshot:

Basically, we want to show the contents of the Description field based on what the user has chosen for their Shipping Method.

Not sure how to do that. Could use another set of eyes on this. Thanks!

Using Store 2.5.1, EE 2.10.1.

# Answer
If you don't mind modifying the store module itself you can do the following (for Store v 2.5.1)

In file \system\expressionengine\third\_party\store\src\Service\ShippingService.php line 139, in function `get_order_shipping_methods` \> `foreach ($methods as $method)` \> `if ($rule) {` add line

```
    $option->rule_description = $rule->name;

```

In file \system\expressionengine\third\_party\store\src\Model\OrderShippingMethod.php line 53, in function `toTagArray` add line

```
    $attributes['rule_description'] = $this->rule_description;

```

In file system\expressionengine\third\_party\store\src\Model\ShippingRule.php line 16 in `protected $fillable = array(...` add 'name' string to array so line looks like:

```
    'percent_rate', 'min_rate', 'max_rate', 'enabled', 'name');

```

Then add `{rule_description}` to your `{shipping_methods}` tag. Example:

```
    {shipping_methods}
    <li>
    <input type="radio" name="shipping_method" class="shipping-methods" value="{method_id}" id="shipping-method-{method_id}" {if method_selected}checked{/if} />
    <label  for="shipping-method-{method_id}">{method_title} {method_price} <em>{rule_description}</em></label>
    </li>
    {/shipping_methods}

```
> 0 votes

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


# Question
Title: EE3 Multiple database settings without core 'hack'
SO I am trying to build out a master config file to use with deployment similar to that in EE2 for EE3. In the include, I have the following:

```
$config['database'] = array (
    'expressionengine' => array (
        'hostname' => 'localhost',
        'username' => 'local-UN',
        'password' => 'local-pw',
        'database' => 'local-db',
        'dbdriver' => 'mysqli',
        'dbprefix' => 'exp_',
        'pconnect' => FALSE
    ),
    'localhost' => array (
        'hostname' => 'localhost',
        'username' => 'local-UN',
        'password' => 'local-pw',
        'database' => 'local-db',
        'dbdriver' => 'mysqli',
        'dbprefix' => 'exp_',
        'pconnect' => FALSE
    ),
    'production' => array (
        'hostname' => 'external-server',
        'username' => 'ext-UN',
        'password' => 'ext-pw',
        'database' => 'ext-db',
        'dbdriver' => 'mysqli',
        'dbprefix' => 'exp_',
        'pconnect' => FALSE
    )
);

```

The reason I left the 'expressionengine' database in there is because of the call for it in DBConfig.php which I'll show in a moment. I know the databases are being populated because when I output `print_r(ee()->config->config);` I get the database array as this:

```
[cache_driver] => file
[database] => Array
    (
        [expressionengine] => Array
            (
                [hostname] => localhost
                [username] => local-UN
                [password] => local-pw
                [database] => local-db
                [dbdriver] => mysqli
                [dbprefix] => exp_
                [pconnect] =>
            )

        [localhost] => Array
            (
                [hostname] => localhost
                [username] => local-UN
                [password] => local-pw
                [database] => local-db
                [dbdriver] => mysqli
                [dbprefix] => exp_
                [pconnect] =>
            )

        [production] => Array
            (
                [hostname] => external-server
                [username] => ext-UN
                [password] => ext-pw
                [database] => ext-db
                [dbdriver] => mysqli
                [dbprefix] => exp_
                [pconnect] =>
            )

    )

[db_port] =>

```

The issue I'm having is getting around the following inside the DBConfig.php file:

```
/**
 * ExpressionEngine Database Config Class
 *
 * @package    ExpressionEngine
 * @subpackage Core
 * @category   Core
 * @author     EllisLab Dev Team
 * @link       https://ellislab.com
 */
class DBConfig implements Config {

    protected $delegate;
    protected $active_group;

    protected $defaults = array(
        'port'     => 3306,
        'hostname' => '127.0.0.1',
        'username' => 'root',
        'password' => '',
        'database' => '',
        'dbdriver' => 'mysqli',
        'pconnect' => FALSE,
        'dbprefix' => 'exp_',
        'swap_pre' => 'exp_',
        'db_debug' => TRUE,
        'cache_on' => FALSE,
        'autoinit' => FALSE,
        'char_set' => 'utf8',
        'dbcollat' => 'utf8_unicode_ci',
        'cachedir' => '', // Set in constructor
    );

    /**
     * Create new Database Config object
     *
     * @param ConfigFile $config Config\File object
     */
    public function __construct(ConfigFile $config)
    {
        $this->delegate = $config;
        $this->active_group = $this->delegate->get(
            'database.active_group',
            'expressionengine'
        );

        $this->defaults['cachedir'] = rtrim(APPPATH, '/').'/user/cache/db_cache/';
    }

```

Is there a way to dynamically pass the `$active_group` into the DBConfig class?

# Answer
> 1 votes
In your dynamic config, define the `$config['database']['expressionengine']` group conditionally. Have a look TJ Draper's dynamic config, specifically these lines

```
// Set up the database
$db = array(
    'hostname' => 'localhost',
    'dbdriver' => 'mysqli',
    'dbprefix' => 'exp_',
    'pconnect' => FALSE
);

// Require environment config file
require 'config.' . ENV . '.php';

// Set the database array to the config
$config['database'] = array (
    'expressionengine' => $db,
);

```

In your `config.foo.php` files, specify the `$db` array, overriding any settings necessary:

```
$db['username'] = 'xxxxxxxxxxxxxx';
$db['password'] = 'xxxxxxxxxxxxxx';
$db['database'] = 'xxxxxxxxxxxxxx';

```

# Answer
> 1 votes
@derek-jones Thanks for the nudge... I ended up with the following in mine.

```
/*
|-----------------------------------------------------------
| Database and Multi-environment
|-----------------------------------------------------------
| You can have whatever environments you need.
| First, build out your environment arrays.
| Then set your $active_environment to which you need to use.
*/
    $active_environment = 'production';

    $localhost = array (
        'hostname' => 'localhost',
        'username' => 'local-un',
        'password' => 'local-pw',
        'database' => 'local-db',
        'dbdriver' => 'mysqli',
        'dbprefix' => 'exp_',
        'pconnect' => FALSE
    );

    $production = array (
        'hostname' => 'remote-host',
        'username' => 'remote-un',
        'password' => 'remote-pw',
        'database' => 'remote-db',
        'dbdriver' => 'mysqli',
        'dbprefix' => 'exp_',
        'pconnect' => FALSE
    );

    $config['database'] = array (
        'expressionengine' => $$active_environment
    );

```

---
Tags: database, ee3, development
---


# Question
Title: Load data from "File System" rather than "Database"? Modify template file is not working
I am migrating an EE application to a new server. However, it shows the previous version. And if I modify the template file, it's not showing on the site.

Someone said it's because it's loaded from Database rather than File system. I tried to get rid of Database connection. Then it will show nothing.

Does anyone know what is wrong in this case? Thank you guys!

# Answer
I finally get it working. The problem is **$env\_config\['tmpl\_file\_basepath'\]** setting in the config file is wrong. It works after I modified this. Hope this will help someone who need it. Maybe no one will need this. LOL
> 0 votes

---
Tags: database
---


# Question
Title: Script to change member password on many different sites
We host around 20 different expressionengine run sites for a variety of clients. In those sites we have an admin account with the same username on each site. When one of our employees leaves the company we have to go and manually change the passwords on each site which is manual and time consuming.

I am thinking of writing a script to do this automatically. My plan would be to create an object or array of all the sites db connections and loop through them and run a sql query to change to password where exp\_members.username equals our admin username.

Before I go through this process I am wondering how others manage this as maybe there is a better way.

Thanks

# Answer
How would you intend on changing the password through database updates? From installation to installation, the actual cryptography used for password hashing can vary depending on what's available on the server. EE2 uses `sha512`, `sha256`, `sha1`, and `md5` depending on the server/environment. I'm not sure about EE3. To appropriately handle this situation I would suggest writing a custom add-on that can function as a micro-service API; basically you hit it's ACTion id, validate somehow, pass it a new password, and then use EE to programatically change a user's password. But for true security reasons this would only be smart if every site you need to hit is behind an SSL certificate, and even then you'd have to write a script to hit these services instead of manually copy/pasting 20 urls to hit in your browser.

Are all of these application in one data center? If all of your MySQL servers and application servers are cordoned safely, you wouldn't have to worry about MiTM attacks and not need SSL on every site, but you'd have to be connected to that network to safely transmit data (be at work, VPNed in, etc).

I don't know if EE invalidates sessions when a password is changed programatically, so the safe thing to do would be delete all sessions for that user in the databases as well.

```
DELETE FROM `schema`.`exp_sessions`
    WHERE member_id = XXX;

```

It would log some people out; but that's not the end of the world.

You could just dump dummy data (through MySQL/SSH) in so the offending ex-employee loses access, but everyone else does as well until you hit each sites `forgot password` functionality.

Honestly, I would not recommend the current route you are in; sharing credentials and one admin user anonimizes the work being done and makes it harder to attribute events to employees (think: who edited my entry!?). I suppose you could have a deployment system and repository for your installations to take care of tracing file editors, but content edits are lost to your one user.

I also have no idea what your employee head count is and how much user credential provisioning you'd need to do. It's possible to use the multi-site manager for serving multiple sites in one EE install; then users are shared across the system and would solve your problem. I would be interested to hear the reasoning behind this workflow for your company.

The sophisticated answer would be a custom add-on that validates specific users against a separate, secure entity such a separate EE install. Then, you just modify that one EE member in your master install and then no other EE install can validate against it if it doesn't provide the updated password. There are extension hooks for taking over member credential validation, which you would only do selectively for your "master" members, and leave each install to use native members auth for everyone else.

One last time though; remember, if you are passing un-encrypted passwords in any form, **get behind SSL**.
> 1 votes

# Answer
I would either 1) just delete their account. 2) move them to a user group that does not have access to anything. So even if they are able to change their password, they will not be able to get to anything.
> 0 votes

---
Tags: password, administration
---


# Question
Title: channel entries loop doesn't display entries added by channel form when their status is closed
I made a channel form. In the CP I configured the "allow guests to submit entries" and choose a guest default user in the list. In the channel preferences I choose "closed" as default status for new entries.

When I post a new entry by channel form, it creates the entry (closed) by the author I set and I can see the newly created entry in the entries list in the CP. But... when I want to display the entries in a template

```
{exp:channel:entries channel="mychannel" status="open|closed" orderby="entry_date" sort="desc"}
{title}
{/exp:channel:entries}

```

the ones created by channel form don't show up.

I tried to create some new entries by the CP, in this case they show up in my entries loop in my template.

What am I missing?

EE version : 2.9.0

# Answer
Finally, I found the solution :

On my entries loop I added the parameter `transcribe="disable"` and it did the trick. I have Transcribe add-on on my site and I think it interfers here because an entry added by Channel form isn't related to any trnascribe language unless I go to the CP and click on "Save" button (then it associates the entry to the default language). And, as we visit the website in 'fr' it doesn't show the entries not related to 'fr'.

So glad I have the solution. Hope this answer would help someone.

Ideally we should have a parameter (like 'transcribe\_language="fr"' for example) into channel form exp tag to associate the entry created to the language we want.
> 0 votes

---
Tags: safecracker, channel, status
---


# Question
Title: Wygwam - Applying style to Unordered List
How can I apply a style in Wygwam editor so that the following code

```
<ul>
    <li>Here's bullet point number one</li>
</ul>

```

Changes to this

```
<ul data-bullet="ti-arrow-right" class="lead">
    <li><i class="ti-arrow-right"></i>Here's bullet point number one</li>
</ul>

```

# Answer
I do not believe you can without a parsing the data after it is submitted. Addone would be needed.

My only thoughts would be to use the style drop down. So for example they paste the list in, then highlight it, and in the WYGWAM styles drop down they select a style which allpies what you want:

http://docs.ckeditor.com/#!/guide/dev\_styles
> 0 votes

---
Tags: ee2, pixelandtonic, wygwam
---


# Question
Title: Possible to access fields in Composer to customize?
We have a form built using Composer. One of the fields is a phone number. Is there any way to access the field with Javascript to adjust the phone number formatting using Composer? Thanks.

# Answer
Once created through composer - you will be able to check the field ID and then assign JS to that ID.

Or you could use JS to auto format all phone number fields within a form tag... That is if you want all phone number fields to adhere and not just one like above!
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: Is there a way to add the recipient_email field using the composer in Freeform
Is there a way to add the recipient\_email field using the composer in Freeform. We want the customer to be able to use the composer to edit a form and need to be able to send email notifications based on a dropdown selection field on the form.

# Answer
I have done this in the past with JavaScript - dynamically selecting fields etc. This is some example of ways you could do it:

Dynamic recipients: https://solspace.com/expressionengine/freeform/docs/form/#recipients

using JS Getting Recipient Names/email address in Notification

Composers: Freeform and Dynamic Email Recipients
> 0 votes

---
Tags: solspace-freeform
---


title: Pagination plus offset

text:
# Question
Title: Pagination plus offset
In EE3.3, I am currently running a news "latest" page where the most recent article is displayed big. While the following 9 articles are displayed in a smaller 2 column layout.

For ease I used two separate EE Entries tags, and used an Offset="1" parameter on the second. This works fine till I come to use pagination! Pagination does not take into account offset. Annoying, but I could understand why.

Apart from rebuilding using a single tag and loads of queries to identify first, last entries, and so forth, does anyone have any good ideas here?

# Answer
You could use conditionals with one channel entries call:

```
{if count == "1"}
Show the Latest article
{/if}
{if count > "1"}
show the remaining articles
{/if}

```
> 0 votes

---
Tags: pagination
---


title: Question on Wygwam from Pixel & Tonic

text:
# Question
Title: Question on Wygwam from Pixel & Tonic
We use Wygwam for client to enter their content to EE. Client would like to enter order list type with A,B,C,D instead of 1,2,3,4. Can someone give me a hint how can I add option to client to choose order list type on the icon bar?

Thanks, Angela

# Answer
Following along with the Wygwam documentation you should be able to do this using the style set.
https://docs.pixelandtonic.com/wygwam/using/style\_set.html

Your style set code would need to look something like:

```
CKEDITOR.stylesSet.add( 'my_styles',
[
        { name : 'Ordered List', element : 'ol', attributes : { 'class' : 'list-alpha' } },
]);

```

Once you've made your list, highlight it and click the Styles dropdown. You should see your newly created style.

Once selected if you check the source you should see it attached to the element.

From here you'll need to add some css to that element. Something like:

```
.list-alpha {list-style-type: upper-alpha;}

```
> 0 votes

---
Tags: wygwam
---


title: Custom Individual Content for Members

text:
# Question
Title: Custom Individual Content for Members
I want to know if the Expression Engine Member Management will allow me to create custom content for each individual member of my site?

For example, I would like to be able to upload documents and images for specific individual users. If I uploaded photos for UserX, I want only UserX to be able to see those.

Is this possible?

# Answer
> 1 votes
There are many ways you can do this - but simply you can use their member id and search based on that. Displaying different content accordingly. Maybe even a channel to query against relating that id to a document.

Liekwise you could maybe use a custom field within the member group, and then do the special content for each user there.

Or perhaps have a channel where you make the member the author. and then you upload your content under them as the author. in the template you query author to display as required.

So yes it can be done - but will take some thinking. More complicated ways - programme a plugin, or maybe find one on devot-ee

# Answer
> 0 votes
\[I was going to comment but I don't have enough rep so I had to make a post.\]

Kinda echo'ing what Nevsie-Modeten said.

I've done something similar to this using:
http://www.ee-zoo.com/add-ons/visitor/
https://devot-ee.com/add-ons/visitor (ee3 version)

and also making a custom field type that lists members from another member group and on submit adds itself as a custom field to that member.

---
Tags: member-management
---


title: Freeform Saves Email but Doesn't send

text:
# Question
Title: Freeform Saves Email but Doesn't send
Freeform 5.0.3 EE 3.3.3

I've put my freeform form into a blank template with nothing else except the form and am still unable to receive any messages. When I test the form all entries are saved and viewable in the freeform CP. The form is redirecting correctly after submission.

I've looked at the troubleshooting guide and there are no error logs after form submission. I am able to recieve email using the communicate option in EE.

This is my form:

```
        {exp:freeform:form
            form_id="2"
            required="name|email"
            return="{segment_1}/{segment_2}"
            notify_admin="yes"
            admin_notify="myemail@domain.com"
            admin_notification_template="send-reel"
            recipient_template="send-reel"
            notify_user="yes"
            user_email_field="reciever_email"
        }

           <input type="hidden" name="reel_entry_ids" value="" />

          <fieldset>
            <!-- Form Name -->
            <legend>Email Reel</legend>

            <div class="col-sm-6">
                <div class="form-group">
                  <label class="control-label" for="sender_email">Your Email</label>
                  <input id="textinput" name="sender_email" type="email" placeholder="Your Email" class="form-control input-md">
                </div>

                <div class="form-group">
                  <label class="control-label" for="sender_name">Your Name</label>
                  <input id="textinput" name="sender_name" type="text" placeholder="Your Name" class="form-control input-md">
                </div>
            </div><!-- /.col-sm-6 -->

            <div class="col-sm-6">
                <div class="form-group">
                  <label class="control-label" for="reciever_email">Receiver Email</label>
                  <input id="textinput" name="receiver_email" type="email" placeholder="Receiver Email" class="form-control input-md">
                </div>

                <div class="form-group">
                  <label class="control-label" for="receiver_name">Receiver Name</label>
                  <input id="textinput" name="receiver_name" type="text" placeholder="Receiver Name" class="form-control input-md">
                </div>
            </div><!-- /.col-sm-6 -->

            <div class="col-sm-8 col-sm-offset-2">
                <div class="form-group">
                  <label class="control-label" for="subject">subject</label>
                  <input id="textinput" name="subject" type="text" placeholder="subject" class="form-control input-md">
                </div>
            </div><!-- /.col-sm-8 col-sm-offset-2 -->

            <div class="col-sm-12">
                <div class="form-group">
                  <label class="control-label sr-only" for="message">Message</label>
                  <div class="">
                    <textarea class="form-control" id="textarea" name="message" placeholder="Enter Your Message Here"></textarea>
                  </div>
                </div>
            </div><!-- /.col-sm-12 -->
          </fieldset>

          <!-- Button -->
          <div class="form-group">
            <div class="col-md-4">
              <button id="singlebutton"  type="submit" name="singlebutton" class="btn btn-primary">Submit</button>
            </div>
          </div>
        {/exp:freeform:form}
        {!--end send reel form--}

```

\**************** UPDATE \*******************

I changed the form to one of the example forms from the docs which you can see below. The email module is installed and I can **send/recieve email using communicate** \- reciving almost instantaneously. Entries are getting saved to the database but no email is being sent. Have checked spam folders and triple checked email addresses.

```
{exp:freeform:form
    form_id="2"
    return="{segment_1}/{segment_2}"
}
    <dl>
    {freeform:all_form_fields}
        <dt><label>{freeform:field_label}</label></dt>
        <dd>{freeform:field_output}</dd>
    {/freeform:all_form_fields}
    </dl>
    {if freeform:captcha}
        <p>Please enter the word you see in the image below:</p>
        <p>
            {freeform:captcha}
            <input type="text" name="captcha" />
        </p>
    {/if}
    <p>{freeform:submit}</p>
{if freeform:no_results}
    <p>
        Specified form was not found. Please make sure you have specified the
        correct short name of the form in the <b>form_name</b> parameter.
    </p>
{/if}
{/exp:freeform:form}

```

Here is a screenshot of the form settings in the CP:

\**************** UPDATE 2 \*******************

Changed development server from my server to a subdomain of the live site on Nexcess and nothing has changed. Can still receive email via communicate but cannot receive any from the freeform form.

\**************** UPDATE 3 \*******************

Requested screenshot of notifications

# Answer
We discussed this over a support ticket, and the issue was that `recipient_template="send-reel"` was being used instead of `user_notification_template="send-reel"`, and that the Outgoing Email EE setting was empty as it was being overridden by a blank in master config.
> 1 votes

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


# Question
Title: Cartthrob saving price as base64 in purchased items channel
I *think* this may be a bug, but it's not a biggy.

I have a product channel with a price by member group field. My orders get saved to Orders and Purchased items channels, both based on standard setup iirc. My purchased items channel includes a Price field {purchased\_price} type: CartThrob Price - Simple.

If someone places an order where the price is ZERO (registered members can book event places for free), then the purchased item stores the price as e.g. `YToyOntpOjA7YToyOntzOjEyOiJtZW1iZXJfZ3JvdXAiO3M6MToiNSI7czo1OiJwcmljZSI7czoxOiIwIjt9aToxO2E6Mjp7czoxMjoibWVtYmVyX2dyb3VwIjtzOjA6IiI7czo1OiJwcmljZSI7czoxOiI1Ijt9fQ==` not £0 as expected.

I realised that is a base64 encoding of something, that turns out to be e.g `a:2:{i:0;a:2:{s:12:"member_group";s:1:"5";s:5:"price";s:1:"0";}i:1;a:2:{s:12:"member_group";s:0:"";s:5:"price";s:1:"5";}}` \- which appears to be the array of member prices available.

The orders channel correctly stores the total order price as £0.00, and the {order\_items} price is also 0, this only affects the purchased items channel. If an order is placed for any price \> 0, then it stores the selected member price as expected. So i suspect 0 is being taken for null somewhere?

`{exp:cartthrob:debug_info}` shows price as **0 (uses customer price)** all the way thru the process.

Like I say, it's not critical for me, as the one place I am using a report of individual items, I can use the hilarious grep workaround `{if purchased_price ~ "/..................../"}£0{if:else}{purchased_price}{/if}` (assume long strings are not for billion pound orders!) but it would be good to know whether it's a real thing or not.

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

Thanks for reporting this! I've logged it in our bug tracker and, if it's a global issue, we'll evaluate it for fix in the next CT3 release!
> 0 votes

---
Tags: cartthrob
---


title: New Worldpay API with Cartthrob

text:
# Question
Title: New Worldpay API with Cartthrob
We're setting up a new website that uses Cartthrob (v2.70 currently installed) and need to use Worldpay as the payment gateway.

Selecting 'RBS Worldpay Redirect Payment Gateway' and testing seems to hook us into what looks like a legacy part of Worldpay. I believe they have a new API that looks and works in a much nicer way.

Do newer versions of Cartthrob have the newer payment gateway? Can we get around this by upgrading?

Or, do we have write our own payment gateway for this?

Any advice gratefully received!

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

The newer CTs use the same Worldpay API as 2.7, so upgrading wouldn't change that. You'd have to write your own, or consider contacting us (support@cartthrob.com) if you'd like us to do it!
> 0 votes

---
Tags: cartthrob, worldpay
---


# Question
Title: Installation’s version (3.3.1) is not consistent with the reported version (3.3.3)
A couple of weeks ago I updated ExpressionEngine from 3.3.1 to 3.3.3. I followed the update guide https://docs.expressionengine.com/latest/installation/update.html exactly when doing this.

The upgrade went fine and in the footer of the Admin panel it is showing the version as 3.3.3.

Today I logged in and at the top of the Admin panel it has a warning message which says: "Your ExpressionEngine installation’s version (3.3.1) is not consistent with the reported version (3.3.3). Please update your installation of ExpressionEngine again."

The footer is still showing that version 3.3.3 is installed.

Does anyone know why this would suddenly start appearing and what to check to see the actual version installed? As far as we're aware no rollbacks or files in system/\* have been modified other than template files and some CSS used by the frontend of the site.

# Answer
Figured this out myself and was my own error but thought I'd post this in case it happens to anyone else.

I needed to review some settings in `system/user/config/config.php`. This contains the following

`$config['app_version'] = '3.3.3';`

Unfortuantely I was using NetBeans and it hadn't re-synchronised the files from the server to my local copy after the upgrade. So the value of this variable was 3.3.1 as opposed to 3.3.3. When the file was re-uploaded it obviously used the local copy. After changing the value back to 3.3.3 the error disappeared.

Interestingly there are other places that the "app version" appears in the code, such as `/system/ee/legacy/libraries/Core.php`
> 1 votes

---
Tags: upgrade, ee3
---


title: Front end member area

text:
# Question
Title: Front end member area
I am creating a site that is ONLY for members, does every template have to be wrapped in a

```
{if logged_in} template {/if}
{if logged_out} {redirect='login'} {/if}

```

Is there a better and more flexible way? I will be having multiple member groups and I am using layouts, does that mean my if statement has to be in the wrapper template because whenever I do an "if" statement around the layout tag it does not work.

# Answer
I have no idea what your actual setup is, but I general find that a best practice is to utilize embeds for control features as well as consistency. Here is an example: Two template groups, one call `embeds`, one called `pages`.

1. Embeds
    1. index.html (unused)
    2. \_header.html
    3. \_footer.html
2. Pages
    1. index.html
    2. random\_template.html

Your `pages` template will all look like this:

```
{embed="embeds/_header"}

    Whatever you want in here, cochise.

{embed="embeds/_footer"}

```

and then your `_header.html` template looks like this:

```
{if logged_out && segment_1 != "login"}
    {if segment_1 == "account" && segment_2 == "password"}

        <!-- don't redirect, we're on a password reset request page -->

    {if:elseif segment_1 == "account" && segment_2 == "reset_password"}

        <!-- don't redirect, we're on a the actual page were you set a new password -->

    {if:else}

        <!-- not logged in and not trying to reset password -->
        {redirect="login"}
    {/if}
{/if}
<!DOCTYPE html>
<html language="en">
    <head>
    <!-- and so on -->

```

In this example, any user that is not logged in gets forced to the log in page, and it automatically will be processed on every page you embed your header on. I'm not familiar with layouts really so this may not apply perfectly. Also this example works for an application where registration is closed and users are manually registered by an admin; you could just add some extra conditionals to allow for a registration page.
> 2 votes

---
Tags: templates, members, login, logout, template-layouts
---


title: {body} does not output <p> tags

text:
# Question
Title: {body} does not output <p> tags
I am having trouble figuring out how to get my paragraphs to wrap in \< p \>\< /p \>

Need to implement **p** tags inside \< content \> element: http://www.free-times.com/arts/rss\_arts

Using EE v2.7.2

# Answer
Whereabouts is the content coming from? If it's in a WYSIWYG field, check the source to see if it includes `<p>` tags within the markup. If it does these should be output to your template.

The alternative might be to place a `<p>` tag in your template with the correct output block inside, e.g. ``<p>`{body}`</p>``
> 0 votes

---
Tags: html
---


title: Help with EE Ajax form

text:
# Question
Title: Help with EE Ajax form
I have an ajax form set up for my EE contact form which requires that the email and message field be filled in. I need to have "name" and "subject" required too. Please help

```
 // Contact form to use AJAX.
    $(document).ready(function()
    {
        /* helper function to display a message describing the results of the form submit */
        function displayAjaxMessage(message)
        {
            $("#ajax-message").html(message);
            $("#ajax-message").fadeIn(1000);
        }

        /* attach a submit handler to the contact form. By default, EE generates the ID "contact_form" */
        $("#contact_form").submit(function(event)
        {
            /* stop the contact form from submitting normally */
            event.preventDefault();

            /* hide any left over message from a previous submit */
            $("#ajax-message").hide();

            /* send the form data using post and check the results for any errors*/
            $.ajax(
            {
                url: "/",
                type: "post",
                dataType: "html",
                data: $(this).serialize(),

                /* If there was some kind of an AJAX error, display an appropriate message or take some other action of your choice */
                error: function(jqXHR, textStatus, errorThrown)
                {
                    displayAjaxMessage("Sorry, a mistake in form");
                },

                /*  parse the HTML returned by EE to see if they forgot to enter an email address or a message.
                    If so, the HTML will contain a specific error string we can match, and then we can display our own message */
                success: function(html, textStatus, jqXHR)
                {
                    if (html.match(/<title>Error<\/title>/))
                    {
                        var error = $(html).find('ul li:first').text();
                        if (error == "A valid sender email is required")
                        {
                            displayAjaxMessage("Vennligst oppgi en gyldig mailadresse");
                        }
                        else if (error == "Email Message is Required")
                        {
                            displayAjaxMessage("Legg inn en melding");
                        }
                    }
                    else
                    {
                        displayAjaxMessage("Takk for at du kontakter oss");
                    }
                }

            });
        });
    });

```

# Answer
> 1 votes
Looks like you can add a name=required\[\] parameter to each form field you want to make required:

https://ellislab.com/expressionengine/user-guide/add-ons/email/contact\_form.html#required

# Answer
> 1 votes
read much more in details in this site here - http://watabelabs.com/blog/view/submitting-expressionengines-contact-form-with-ajax

---
Tags: forms, javascript, ajax
---


title: How to increase Username Limit

text:
# Question
Title: How to increase Username Limit
Can anyone recommend the file I need to hack in order to increase the username limit? I believe it is 25 characters and I need it increased.

# Answer
I'm not at my workstation, so I can't search for you, but here is a technique I've used for tracking down code specifics inside a code base. SSH in to an EE app server and navigate to `system/expressionengine`. If you can figure out a specific expression that is related to limiting user name length (such as `count($username) >`) you can use `grep` to search through text/PHP files for instances of that expression:

```
grep -nr . -e "count($username) >"

```

You probably have to escape the expression because it is a regex search. But that command should recursively search and return what file and line number the expression is found in.
> 0 votes

---
Tags: members, username
---


title: Detect super search in URL

text:
# Question
Title: Detect super search in URL
Is there a way to detect if a URL contains a Super Search query?

I have a template that displays super search results, but analytics are also showing a bunch of non-existent URLs showing up in the same template group and I'd like to be able to detect if a URL contains a search query and if it doesn't, redirect to the 404 template.

Examples:

```
site.com/tours/made-up – bad
site.com/tours/search&keywords=island – good

```

I'm also having trouble with URLs that contain super search queries *and* `gclid` querystrings *and* pagination. There's a stable of sites that are very similar. On one site, this works fine:

```
<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /

# Redirect index.php Requests
  RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
  RewriteCond %{THE_REQUEST} ^GET
  RewriteRule ^index\.php(.+) $1 [R=301,L]

# Force the www
  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

# HTTPS Redirects
  RewriteCond %{SERVER_PORT} 80
  RewriteRule ^(.*)$ https://www.site.com/$1 [R=301,L]

# Add a trailing slash to paths without an extension
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
  RewriteRule ^(.*)$ /$1/ [R=301,L]

# Standard ExpressionEngine Rewrite
  RewriteCond %{REQUEST_URI} ^/
  RewriteCond %{QUERY_STRING} ^(gclid=.*)
  RewriteRule ^(.+) /index.php?/ [L,PT]
  RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond  $1 !^(themes|index\.php|admin\.php|favicon\.ico|index\.php|path\.php|php\.ini) [NC]
  RewriteRule ^(.*)$ /index.php?/$1 [L]

</IfModule>

```

i.e., when you click on a pagination link, it removes the `gclid` querystring and adds PXX to the URL and you get the updated results.

But on other sites with the exact same rules in place, the PXX just gets added after the `gclid` querystring and you still get the same first page of results.

Anyone know why that might be? Or have a foolproof method for this scenario?

# Answer
> 1 votes
Something you could do inside the Results template is make a conditional dependent on there being a keyword and/or custom field search. And if not, redirect the user:

```
{if super_search_keywords}
{if:else}
{redirect="good/bye"}
{/if}

```

OR

```
{if super_search_my_custom_field}
{if:else}
{redirect="good/bye"}
{/if}

```

OR

```
{if super_search_keywords AND super_search_my_custom_field}
{if:else}
{redirect="good/bye"}
{/if}

```

All of these searches check to see if the corresponding field(s) exist as queries in the URL. :)

---
Tags: solspace, supersearch
---


# Question
Title: SuperSearch in multiple custom fields with just one checkbox
So, I'm doing a filtration of my search results. I'm using checkboxes.

In order to get the colours I need to filter with, I loop through all the entries and run it through stash to get rid of duplicates. Then I put these values in a checkbox-input.

This works great when just looking in one custom field, but with 4 custom fields, not so much.

I can loop out everything as I'm supposed to, but the submitting value needs to be the name of the field it should search in. Meaning the name="farg\[\]" should be name="frg\_2\[\]" and so on.

The colour "Yellow" can be in any/all of the customs fields, hence me having to run it through stash to get rid of duplicates.

Running supersearch 3.1.4 and EE 3.3.3. Any suggestions?

Here's the code.

```
        {!-- Loops out all the colours and stores in list --}
            {exp:stash:set_list name="farger" trim="yes" parse_tags="yes"}
                {exp:channel:entries search:typ="keramik" channel="produkter"}
                    {if farg != ''}
                        {stash:farger}{farg}{/stash:farger}
                    {/if}
                    {if frg_2 != ''}
                        {stash:farger}{frg_2}{/stash:farger}
                    {/if}
                    {if frg_3 != ''}
                        {stash:farger}{frg_3}{/stash:farger}
                    {/if}
                    {if frg_multi != ''}
                        {stash:farger}{frg_multi}{/stash:farger}
                    {/if}
                {/exp:channel:entries}
            {/exp:stash:set_list}

        {!-- Get list, loop out with color name, avoid duplicates --}
            <div class="filter-holder">
                <h6>Färg</h6>
                {exp:stash:get_list
                    name="farger"
                    orderby="screen_name"
                    sort="asc|desc"
                    sort_type="string|numeric"
                    unique="yes"
                    parse="start"
                }
                    <div class="filter-name">
                            <input
                            type="checkbox"
                            name="farg[]"
                            value="{farger}"
                            id="{farger}"
                            class="checkbox"
                            {if super_search_farg == '{farger}'}checked{/if}
                            />
                            <label for="{farger}"><span></span>{farger}</label>
                    </div>

                {/exp:stash:get_list}
            </div>

```

# Answer
Solved it! So, once again, I'll answer my own question.

Instead of having the colours in 4 different custom fields, I put them all in one grid, with 4 fields. That way, I can do a search in the grid, and not on a specific color-field.

Boom! Magic! :) Hope this helps someone else too.
> 0 votes

---
Tags: solspace, supersearch
---


# Question
Title: SQL-Error when submitting an entry with Tags
When trying to create an entry which has a Tag-field in it, I got the following error. (Please note, when creating a entry in a channel that has NO Tag-field, I get no error).

```
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sv_dev.t.tag_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by:
SELECT `t`.`tag_id`, COUNT(e.tag_id) AS count FROM (`exp_tag_tags` t) LEFT JOIN `exp_tag_entries` e ON `e`.`tag_id` = `t`.`tag_id` GROUP BY `e`.`tag_id`

```

Additional info: Database server Server: Localhost via UNIX socket Server type: MySQL Server version: 5.7.12-0ubuntu1 - (Ubuntu) Protocol version: 10 Server charset: UTF-8 Unicode (utf8)

Web server Apache/2.4.18 (Ubuntu) Database client version: libmysql - mysqlnd 5.0.12-dev PHP version: 7.0.4-7ubuntu2.1

# Answer
> 2 votes
After google'ing this (and being a MySQL-n00b), I got an answer from Solspace that confirmed what I needed to do:

> Hi Pontus,
>
> I spoke with a developer here and mentioned that this has to do with MySQL 5.7 having SQL\_MODE set to "only\_full\_group\_by". If this is the particular issue, the only way around it would be disabling that by running this query in your database:
>
> `SET GLOBAL sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION";`
>
> Otherwise, there's nothing we can really do about the issue for Tag unfortunately.
>
> Kelsey Martens Director of Software Operations

This worked for me, hope it helps people with similar issues.

---
Tags: solspace, solspace-tag
---


title: Fetching a dynamic stash list

text:
# Question
Title: Fetching a dynamic stash list
I am trying to build out a list of categories that I need to include in the nav as well as other sections of a site. I had it done with embeds and `{exp:category}` loops, but I would rather be able to pull what I need using stash if possible.

I want to create two separate lists. One will be the locations (or parent categories. The second will be the category children. I need to be able to relate the category children. This is why I have the kid's list being created using the parent category name.

I am getting what I need by doing the following:

```
{!-- LOCATIONS --}
{exp:stash:set_list name="locations" parse_tags="yes"}
    {exp:channel:categories
        category_group='2'
        style='linear'
        parent_only='yes'
    }
        {stash:location}{category_name}{/stash:location}
        {stash:url}{category_url_title}{/stash:url}
    {/exp:channel:categories}
{/exp:stash:set_list}

{!-- LOCATIONS KIDS --}
{exp:stash:parse}
    {exp:channel:categories
        category_group='2'
        style='linear'
    }
        {if parent_id == '0'}
            {if count > '1'}
                {/exp:stash:set_list}
            {/if}
            {exp:stash:set_list name="{category_name}_kids" parse_tags="yes"}
        {if:else}
            {if count == total_results}
                    {stash:kid}{category_name}{/stash:kid}
                    {stash:kid_url}{category_url_title}{/stash:kid_url}
                {/exp:stash:set_list}
            {if:else}
                {stash:kid}{category_name}{/stash:kid}
                {stash:kid_url}{category_url_title}{/stash:kid_url}
            {/if}
        {/if}
    {/exp:channel:categories}
{/exp:stash:parse}

```

I can pull the locations manually, and I can pull the kids manually. What I NEED to be able to do is pull them dynamically by relationship. I tried this, but it doesn't render the kids.

```
{exp:stash:get_list name='locations'}
    <li class="dropdown-submenu">
        <a href="{site_url}find-your-home/{url}">{location} <b class="caret-right"></b></a>
        <ul class="dropdown-menu">
            {exp:stash:get_list name='{location}_kids'}
                <li>
                    <a href="{site_url}find-your-home/{url}/{kid_url}">{kid}</a>
                </li>
            {/exp:stash:get_list}
        </ul>
    </li>
{/exp:stash:get_list}

```

Is there something I am missing or can I not build out a dynamic list call?

# Answer
I think you need to take in account the fact that you're nesting.

```
{exp:stash:get_list name='locations'}
    <li class="dropdown-submenu">
        <a href="{site_url}find-your-home/{url}">{location} <b class="caret-right"></b></a>
        <ul class="dropdown-menu">
            {exp:stash:get_list:nested name='{location}_kids'}
                <li>
                    <a href="{site_url}find-your-home/{url}/{kid_url}">{kid}</a>
                </li>
            {/exp:stash:get_list:nested}
        </ul>
    </li>
{/exp:stash:get_list}

```
> 0 votes

# Answer
I am dealing with the same situation, however some of the main menu items (parent categories) dont have children (sub categories)

How can I make the caret display conditionally only if there are sub menu items?

Thanks so much, this has helped me a lot already!
> 0 votes

---
Tags: categories, stash, ee3, nested-list
---


# Question
Title: Pagination won’t work on dynamic URLS that have 2 segments
I’m building a site that has the following URI structures:

domain.com/case-studies - this page loads ALL case studies and pagination works fine as there is only one segment.

domain.com/case-studies/residential - this uses seg2cat on category\_2 to load the case studies for residential. If there are more than 6, I click the next page and get the URI domain.com/case-studies/residential/P6

This TOTALLY breaks the page and I get “Error, The page your requested was not found”

Here is the pagination code I’m using:

```
{exp:channel:entries channel="case_study" category="{segment_2_category_id}” orderby=”date” sort=”desc” paginate=”bottom” limit=”6” dynamic=”yes”}

{paginate} <nav> <ul class=”pager”> {if previous_page} <li class=”previous”>← Older</li> {/if} {if next_page} <li class=”next”>Newer →</li> {/if} </ul> </nav> {/paginate}

```

I’m totally stuck, can anyone help at all?

# Answer
In order for this to work, I had to set my channel entries tag to `dynamic="no"` and also set a custom template route for my Case Studies template like this `/case-studies/{category:alpha_dash}/{page:pagination}`

Works fine!

Andy
> 1 votes

---
Tags: ee2, pagination
---


title: Return Variables to a Template

text:
# Question
Title: Return Variables to a Template
I have created a module for **Expression Engine 3**, which includes two functions.

1. `search_form`
2. `search_results`

`search_form` returns a form into my template.

`search_entries` is *actioned* by `search_form` upon the forms submission. This function then completed my queries, returning an array of `entry_id`.

**My question, is how can I then return those entry ids back to the template, and output them through a channel entries tag?**

# Answer
I had similar situation this week. I've made two functions - one for the form template tag and second is action callback that works with form data.

In this manner I could output information with `ee()->output->show_message()`. Like this:

```
$data = array(
  'title' => 'Search Results',
  'heading' => 'Search Results',
  'content' => "content as a string. wrapped as system message"
);
ee()->output->show_message($data);

```

That was not what I was looking for :( So I've switched to post-\>redirect-\>get pattern and added another template tag for showing search results.

In general, now I have 3 methods inside base module class:

`search_form` constructs html for the form and returns it

`search_submit` is processing data passed after form submit, saves results into `$_SESSION` variable and redirects user to template with search results tag.

`search_results` reads data from `$_SESSION`, creates `$variables` array and returns it with `ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $variables)`.

```
class Custom_search {
  function search_form() {
    $action_id = ee()->functions->fetch_action_id('Custom_search', 'search_form_submit');
    $form_data = array(
      'action' => ee()->functions->create_url(ee()->uri->uri_string),
      'hidden_fields' => array(
         'ACT' => $action_id,
         'return_url' => ee()->functions->create_url('template_group/search_results')
       )
    );
    $tag_data = ee()->TMPL->tagdata;
    $form = ee()->functions->form_declaration($form_data) . $tag_data . "</form>";
    return $form;
  }

  function search_form_submit() {
    //do something with input
    session_start();
    $_SESSION['custom_search']['query'] = "search query here";
    $_SESSION['custom_search']['results'] = $results;
    ee()->functions->redirect(ee()->input->post('return_url'));
  }

  function search_result() {
    session_start();
    //create $vars array from your results here
    session_unset();
    session_destroy();
    return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $vars);
  }
}

```

And you'll have two template files - one with search form template tag

```
{exp:custom_search:search_form}
  <input type="text" placeholder="Search..." name="query" />
  <input type="submit" name="submit" value="go" />
{/exp:custom_search:search_form}

```

and another with results tag

```
{exp:custom_search:search_result}
  <p>Your query: {query}</p>
  <p>Results found: {total_results}</p>
  {results}
    <h4>{title}</h4>
    <p>{description}</p>
  {/results}
{/exp:custom_search:search_result}

```
> 1 votes

---
Tags: templates, add-on-development, module, ee3
---