title: Best way to tie images to entries?

text:
# Question
Title: Best way to tie images to entries?
As you will know, when deleting an entry with images, the images aren't deleted from the server. This is one aspect of Expression Engine that I really do not care for: The inexorable build up of redundant files in the system, with- as far as I can tell- absolutely no way of knowing which images are assigned to a channel entry. (Wouldn't it be nice if there were a little display next to each file on the file manager screen telling you which files were assigned to entries..). Here is a post from 2011 with people bemoaning the same issue, and a (great!) feature request which is now a dead link, so presumably met a dead end.

So how do others deal with this problem? How can I keep my image directory clean? and since I have NEVER, in all the sites I have built with EE, had a situation where one image needs to be re-used for more than one entry, I would MUCH prefer a method of locking images permanently to whatever entry they are assigned to. Is this beyond the bounds of Expression Engine?

# Answer
> 1 votes
Images attached to entries via a File field in ExpressionEngine aren't treated as relationships (unlike, say, Assets fields). They simply hold a text value like so:

```
{filedir_X}filename.jpg

```

It's not the most robust approach, but it's simple and low-overhead. But it also makes deleting images associated with an entry (but only if they're not in use in other entries) much trickier. Doable, but a pain.

You'd have to write an extension which taps into the `delete_entries_loop` hook to:

1. Find all File fields in that entry
2. Search all other File fields in the database for that matching value
3. If no matching values are found, parse the value of that file field to locate the image in the database
4. Delete it (from the database and on-disk) using the File library

However, while you may feel that the use case of multiple entries using a single image file is a rare one, I actually see this all the time. On the flip side, to me, a site which frequently deletes entries (and thus would have a build-up of unused images) is something that is *incredibly* rare.

So, use cases are in the eye of the beholder. Personally I don't see this feature making it's way into EE myself, but you could always file a feature request by emailing team@ellislab.com.

---
Tags: image
---


title: Store: One page checkout not working

text:
# Question
Title: Store: One page checkout not working
I'm having an issue with the checkout tag. If I use it and split the billing address and credit card information on two different templates/pages, then it works, but when I combine them into the same template I get the following error:

The store.payment field is required

Hoping someone can point out what I'm missing or doing wrong.

```
{exp:store:checkout
    form_class="form-horizontal"
    return="store/order/ORDER_HASH"
    require="billing_name|billing_address1|billing_state|billing_country|billing_postcode|order_email|payment"}

    {if no_items}
        {redirect="store/cart"}
    {/if}

    <input type="hidden" name="payment_method" value="Stripe" />

    <div class="grid grid_noMargin">
        <div class="grid-col grid-col_6of12">
            <div class="form-group">
                <label class="control-label" for="billing_name">Name</label>
                <div class="controls">
                    <input type="text" name="billing_name" id="billing_name" value="{billing_name}" class="form-control" />
                    {if error:billing_name}
                        <label for="billing_name" class="error">{error:billing_name}</label>
                    {/if}
                </div>
            </div>
        </div>
        <div class="grid-col grid-col_6of12">
            <div class="form-group">
                <label class="control-label" for="order_email">Email</label>
                <div class="controls">
                    <input type="text" name="order_email" id="order_email" value="{order_email}" class="form-control" />
                    {if error:order_email}
                    <label for="order_email" class="error">{error:order_email}</label>
                    {/if}
                </div>
            </div>
        </div>
    </div>
    <div class="grid grid_noMargin">
        <div class="grid-col grid-col_6of12">
            <div class="form-group">
                <label class="control-label" for="billing_address1">Address</label>
                <div class="controls">
                    <input type="text" name="billing_address1" id="billing_address1" value="{billing_address1}" class="form-control" />
                    {if error:billing_address1}
                        <label for="billing_address1" class="error">{error:billing_address1}</label>
                    {/if}
                </div>
            </div>
        </div>
        <div class="grid-col grid-col_6of12">
            <div class="form-group">
                <label class="control-label" for="billing_address1">Address 2</label>
                <div class="controls">
                    <input type="text" name="billing_address2" id="billing_address2" value="{billing_address2}" class="form-control" />
                    {if error:billing_address2}
                        <label for="billing_address2" class="error">{error:billing_address2}</label>
                    {/if}
                </div>
            </div>
        </div>
    </div>
    <div class="grid grid_noMargin">
        <div class="grid-col grid-col_3of12">
            <div class="form-group">
                <label class="control-label" for="billing_city">City</label>
                <div class="controls">
                    <input type="text" name="billing_city" id="billing_city" value="{billing_city}" class="form-control" />
                    {if error:billing_city}
                        <label for="billing_city" class="error">{error:billing_city}</label>
                    {/if}
                </div>
            </div>
        </div>
        <div class="grid-col grid-col_3of12">
            <div class="form-group">
                <label class="control-label" for="billing_postcode">Postcode</label>
                <div class="controls">
                    <input type="text" name="billing_postcode" id="billing_postcode" value="{billing_postcode}" class="form-control" />
                    {if error:billing_postcode}
                        <label for="billing_postcode" class="error">{error:billing_postcode}</label>
                    {/if}
                </div>
            </div>
        </div>
        <div class="grid-col grid-col_3of12">
            <div class="form-group">
                <label class="control-label" for="billing_state">State</label>
                <div class="controls">
                    <select name="billing_state" id="billing_state" class="form-control">
                        {billing_state_options}
                    </select>
                    {if error:billing_state}
                        <label for="billing_state" class="error">{error:billing_state}</label>
                    {/if}
                    {error:billing_state}
                </div>
            </div>
        </div>
        <div class="grid-col grid-col_3of12">
            <div class="form-group">
                <label class="control-label" for="billing_country">Country</label>
                <div class="controls">
                    <select name="billing_country" id="billing_country" class="form-control">
                        {billing_country_options}
                    </select>
                    {if error:billing_country}
                    <label for="billing_country" class="error">{error:billing_country}</label>
                    {/if}
                </div>
            </div>
        </div>
    </div>

    <div class="grid grid_noMargin verticalRhythm_md">
        <div class="grid-col grid-col_4of12">
            <div class="header">
                <h1>Payment</h1>
            </div>
        </div>
        <div class="grid-col grid-col_6of12 grid-col_push2of12">
            <div class="header">
                <h1>Cart</h1>
            </div>
        </div>
    </div>

    <div class="grid">
        <div class="grid-col grid-col_5of12">
            {if error:payment_method}
                <div class="form-group">
                    <div class="alert alert-danger">{error:payment_method}</div>
                </div>
            {/if}

            <p class="">
                We accept the following credit cards
            </p>
            <img src="{site_url}assets/images/design/credit-cards/visa_32.png" />
            <img src="{site_url}assets/images/design/credit-cards/mastercard_32.png" />
            <img src="{site_url}assets/images/design/credit-cards/discover_32.png" />
            <img src="{site_url}assets/images/design/credit-cards/american_express_32.png" />
            <img src="{site_url}assets/images/design/credit-cards/diners_club_32.png" />
            <img src="{site_url}assets/images/design/credit-cards/jcb_32.png" />

            <div class="form-group">
                <label class="control-label" for="payment_card_no">Card Number</label>
                <input type="text" id="payment_card_no" name="payment[card_no]" value="" class="form-control" />
            </div>

            <div class="form-group">
                <label class="control-label" for="payment_name">Name as it appears on card</label>
                <input type="text" id="payment_name" name="payment[name]" value="" class="form-control" />
            </div>

            <div class="form-group grid grid_noMargin">
                <div class="controls grid-col grid-col_6of12">
                    <label class="control-label" for="payment_exp_month">Expiration</label>
                    <select id="payment_exp_month" name="payment[exp_month]" class="form-control">
                        <option value="">Month</option>
                        {exp_month_options}
                    </select>
                </div>
                <div class="controls grid-col grid-col_6of12">
                    <label class="control-label" for="payment_exp_month"> </label>
                    <select id="payment_exp_year" name="payment[exp_year]" class="form-control">
                        <option value="">Year</option>
                        {exp_year_options}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label" for="payment_csc">CSC</label>
                <input type="text" id="payment_csc" name="payment[csc]" value="" class="form-control" />
            </div>

        </div>
        <div class="grid-col grid-col_6of12 grid-col_push1of12">
            {if no_items}
                <p>Your cart is empty!</p>
            {/if}
            <table class="table table-condensed">
                {items}
                    <tr>
                        <td>{item_qty} × {title}</td>
                        <td style="text-align:right">{item_subtotal}</td>
                    </tr>
                {/items}
                <tr>
                    <th>Total</th>
                    <th style="text-align:right">{order_subtotal}</th>
                </tr>
            </table>
        </div>
    </div>

    <div class="form-actions verticalRhythm_sm">
        <a href="{path='store/cart'}" class="btn btn-default">Back</a>
        <input type="submit" name="next" value="Place Order ({order_subtotal})" class="btn btn-primary" />
    </div>

{/exp:store:checkout}

```

# Answer
> 1 votes
Figured it out. The submit button needed to have the name="submit", not name="next". Per the docs submit will trigger the last step and process the payment. I also had "payment" as an option in the require parameter on the checkout tag, which isn't required for the validation to occur (since its handled by the payment processor.

---
Tags: expresso-store
---


# Question
Title: Strong Tags inserted into Expression Engine
Over the weekend, one of my sites has "strong" tags inserted everywhere. I checked the templates, they are the same. Any idea how they could have gotten in there?

# Answer
It sounds like you have some content wackery (just made that word up, I'm proud of myself!) going on. The content that gets rendered inside of a channel entries loop lives inside of a database table called `exp_channel_data`. When you call a channel entries loop, the rendered content comes from the database, and this is content that is generally editable by users who maintain your site.

Most likely what happened is someone went in to their control panel, and erroneously added `<strong>` tags in a bunch of places. Look over your channel entries to see if it's happened in more than one place. If you have a site with a lot of pages, you can search for instances of this tag with a MySQL query:

```
SELECT * FROM my_schema.exp_channel_data
    WHERE field_id_666 LIKE "%<strong>%";

```

Just change `field_id_#` to whatever your main content field id is (usually a field that gets called "Body" or "Main Content"), and you can do bigger searches to look for channel entries. If you have a small amount of entries, it's probably easiest to just use the Control Panel to investigate this data.
> 0 votes

---
Tags: templates
---


# Question
Title: Low search distance filter as results parameter?
I wanted to use geofinder to do a simple distance sorted search, but it looks like it's no longer compatible with EE 2.10.1

So I wanted to see if I could use low search to produce the same results. I have a search box in which I ask visitors to enter their postcode(uk)

I can then use the gmaps plugin to geocode that postcode into latlng values (and save as stash vars).

Ideally it would be great if I could pass in those latlng values to the low\_search:results tag as parameters, rather than posting them as hidden inputs with the search (as I don't have the values until the results page).

Does that make sense, and is there any way of doing it with low\_search?

# Answer
> 0 votes
You can use the Distance filter parameters as regular parameters on the Results tag, so that shouldn't be an issue. You might encounter some parse order issues with using tags as another tag's parameter value, but you could work around that with using an embed.

---
Tags: low-search, geofinder
---


# Question
Title: How to make a Freeform text field required
I must be missing something, but I can't figure out how to make a text field required using Freeform Pro. Thanks in advance for any help!

# Answer
> 0 votes
A quick sweep of them 'ol documentation thingies gives you the answer.

https://solspace.com/docs/freeform/form/#required

Use the required parameter when outputting your form.

```
{exp:freeform:form
    form_name="contact_form"
    required="name|email"}

    Form stuff goes here.

{/exp:freeform:form}

```

**Edit** If you are using the Composer tool, see this answer:

FreeForm Pro Composer require field

---
Tags: solspace-freeform
---


# Question
Title: updating from 2.5.5 to 2.10.1, ERROR 1048 Column ‘field_id_14’ cannot be null
I’m trying to update from Expression Engine 2.5.5 to 2.10.1 and I get this error:

> A Database Error Occurred Error Number: 1048
>
> Column ‘field\_id\_14’ cannot be null
>
> UPDATE `exp_channel_data` SET `field_id_14` = NULL
>
> Filename: D:\EE\_directory\system\codeigniter\system\database\DB\_driver.php
>
> Line Number: 382

# Answer
> 1 votes
Have you identified which field is id 14?

You can by looking at table `exp_field-types` or by looking at your field-groups inside the CP. Once you figure out the field in question, that may give you a clue. If unused, you can try getting rid of it.

Or you can change the **NULLs to ""** by running the following Query (backup your table before doing this, just in case):

```
UPDATE exp_channel_data SET field_id_14 = "" WHERE field_id_14 = NULL.

```

---
Tags: error, ee2-upgrades, codeigniter, update
---


title: Exp:resso Store Add a new Custom Report

text:
# Question
Title: Exp:resso Store Add a new Custom Report
The documentation suggests that you should be able to (fairly easily) create a custom report type and add it to the Exp:resso Store Reports section. But beyond the hook `$reports = ee()->extensions->call('store_reports', $reports);` I can find no other documentation on how to achieve this.

Following my nose I have created a new extension to tap into the hook and have added a new record to the reports array, (however there is no way in the new Class to assign what the Report Name and Description should be - this seems to be embeded in the translation files - which I am little concerned will be overwritten when performing an upgrade).

In order to get a good working base for my new report I've just copied an existing report, however when clicking through to view my report I can't prevent the error "Fatal error: Class '\Expresso\_store\_add\_location\_reports\_ext\LocationReports' not found in /path/from/server/root/expressionengine/third\_party/store/src/Cp/ReportsController.php on line 56" from appearing. I've tried adding my new report to the Store/src/Report folder, but the same error appears there too.

I'm clearly doing something quite wrong here, but in the absence of any documentation I'm at a loss as to how to proceed. Any pointers very much appreciated, thank you!

My Full Extension File:

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

/**
 * Expresso_store_add_location_reports Class
 */

class Expresso_store_add_location_reports_ext
{

    var $name           = 'Expresso Store - Add location reporting';
    var $version        = '1.0';
    var $description    = 'Shows a new report type to sort by location';
    var $settings_exist = 'n';
    var $docs_url       = ''; // 'https://ellislab.com/expressionengine/user-guide/';

    var $settings       = array();

    /**
     * Constructor
     *
     * @param   mixed   Settings array or empty string if none exist.
     */
    function __construct($settings = '')
    {
        $this->settings = $settings;

        $this->EE =& get_instance();
    }

    // --------------------------------------------------------------------

    /**
     * Activate Extension
     *
     * This function enters the extension into the exp_extensions table
     *
     * @see https://ellislab.com/codeigniter/user-guide/database/index.html for
     * more information on the db class.
     *
     * @return void
     */
    public function activate_extension()
    {
        $this->settings = array(

        );

        $data = array(
            'class'     => __CLASS__,
            'method'    => 'add_location_reports',
            'hook'      => 'store_reports',
            'settings'  => serialize($this->settings),
            'priority'  => 10,
            'version'   => $this->version,
            'enabled'   => 'y'
        );

        ee()->db->insert('extensions', $data);
    }

    /**
     * Update Extension
     *
     * This function performs any necessary db updates when the extension
     * page is visited
     *
     * @return  mixed   void on update / false if none
     */
    public function update_extension($current = '')
    {
        if ($current == '' OR $current == $this->version)
        {
            return FALSE;
        }

        if ($current < $this->version)
        {
            // Update to version 1.0
        }

        ee()->db->where('class', __CLASS__);
        ee()->db->update(
                    'extensions',
                    array('version' => $this->version)
        );
    }

    /**
     * Disable Extension
     *
     * This method removes information from the exp_extensions table
     *
     * @return void
     */
    public function disable_extension()
    {
        ee()->db->where('class', __CLASS__);
        ee()->db->delete('extensions');
    }

    public function add_location_reports($reports)
    {
        // call the development log?

        $reports["location_summary"] = "\Expresso_store_add_location_reports_ext\LocationReports";

        echo "<pre>";
        print_r($reports);
        echo "</pre>";

        return $reports;
    }

    public function options()
    {
        return $this->options;
    }

    // --------------------------------------------------------------------

    /**
     * Usage
     *
     * This function describes how the plugin is used.
     *
     * @access  public
     * @return  string
     */
    public static function usage()
    {
        ob_start();  ?>

        This plugin should add a location report to the reports area.

        <?php
        $buffer = ob_get_contents();
        ob_end_clean();

        return $buffer;
    }
    // END
}
/* End of file pi.expresso_store_most_popular_items.php */
/* Location: ./system/expressionengine/third_party/expresso_store_add_location_reports/ext.expresso_store_add_location_reports.php */
?>

```

My new Report file:

```
<?php

/*
 * Exp:resso Store module for ExpressionEngine
 * Copyright (c) 2010-2014 Exp:resso (support@exp-resso.com)
 */

namespace Store\Report;

use Store\DateTime;
use Store\Model\Order;
use Store\Model\OrderItem;

class LocationReports extends AbstractReport
{
    public function default_options()
    {
        return array(
            'from' => array('type' => 'month_select', 'default' => -12),
            'to' => array('type' => 'month_select', 'default' => -1),
        );
    }

    public function run()
    {

    }
}
?>

```

# Answer
It's not a file path, but a class path. In this function: `add_location_reports`, change:

```
$reports["location_summary"] = "\Expresso_store_add_location_reports_ext\LocationReports";

```

to:

```
$reports["location_summary"] = '\Store\Report\LocationReports';

```

I believe you also have to load the class before returning the variable:

```
$path = rtrim(dirname(__FILE__), '/') . "/LocationReports.php";
if (is_file($path)) {
    require $path;
}

```

Alas I've not found a way to set the name and description outside of Store, so have manually added the following entries to the language/english/store\_lang.php file in the store module:

```
'store.reports.location_summary' => 'My Custom Title',
'store.reports.location_summary_desc' => 'My Custom Description',

```
> 2 votes

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


# Question
Title: A Database Error Occurred Error Number: 1064 when Trying to delete an entry..
So, trying to delete an entry .. after the "ARE YOU SURE?"-page and the click on delete, I get the following error.

Anyone else had this problem? I'm afraid of mySQL, so this is freaking me out :(

A Database Error Occurred Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 2

DELETE FROM `exp_channel_entries_autosave` WHERE `original_entry_id` IN ()

Filename: libraries/api/Api\_channel\_entries.php

Line Number: 490

# Answer
Found the answer by doing things in ee...

So here it is: If you don't have a channel field group with a channel field in it associated with the channel.. it gives you this error.

So now you know :)
> 0 votes

---
Tags: error, mysql
---


# Question
Title: Unable to load requested field type file: ft.rel.php Tried all fixes listed
Getting this message whenever I try to do anything with field-types.

This was a 2.6.1 installation, I’ve tried updating to 2.10.1, but I get exactly the same error message.

I’ve tried all the common solutions I can think of, here is the exp\_fieldtypes table in my DB:

```
1 select 1.0 YTowOnt9 n
2 text 1.0 YTowOnt9 n
3 textarea 1.0 YTowOnt9 n
4 date 1.0 YTowOnt9 n
5 file 1.0 YTowOnt9 n
6 multi_select 1.0 YTowOnt9 n
7 checkboxes 1.0 YTowOnt9 n
8 radio 1.0 YTowOnt9 n

```

I can’t even get into addons - \> Field types as it just throws this error.

There is nothing using a relationship field anywhere as far as I can see. I’ve searched the entire codebase for any reference to ft.rel.php and ft.rel and I can’t find any references to it anywhere.

I assume it must be been referenced the DB somewhere but I can’t see it anywhere unless it is encrypted data somewhere.

Basically I can’t edit or change anything to do the with channel fields or this error comes up when I even try and view them.

Please help! I’m at my wits end trying to find a solution here!

# Answer
Solved, our sys admin did a s-trace on the php process and found it was looking for the file in 3 weird folders......

```
system/expressionengine/fieldtypes/rel/ft.rel.php
system/expressionengine/third_party/12/ft.rel.php
system/expressionengine/modules/rel/ft.rel.php

```

Copying the ft.rel.php file to the first one fixed it. No idea why it was looking there for it, we've never had anything at all living there..... No in fieldtypes I can see the two relationship(s) fieldtypes there, both uninstalled...... if they are uninstalled why is it looking for the files! :
> 0 votes

---
Tags: ee2, ee2-upgrades, ee
---


title: Missing thumbnails in Assets

text:
# Question
Title: Missing thumbnails in Assets
Images were working in EE's native File Manager, but were blank in Assets. I checked all the usual suspects, reindexed them with native EE File Manager and Assets, but the problem persisted. Andris at Pixel & Tonic pointed to the problem.

# Answer
> 2 votes
It turns out my database.php file had an extra blank line at the beginning. (see that extra line?) And this was corrupting output in EE.

Any php file that is included (called by the main php file) needs to have the opening php tag on the first line! Otherwise bad things will happen.

---
Tags: assets, pixelandtonic, file-manager, thumbnails
---


title: Troubleshooting relevance in Low Search

text:
# Question
Title: Troubleshooting relevance in Low Search
I have a simple keyword search, I would like for items with a match in the title to come up at the top of results. From reading other posts, it sounds like sorting by relevance is the default behavior for the results tag. I have my title weighted at 3 and all other searchable fields weighted at 1 and am not getting this result. I've upped the modifier, but haven't seen any effect. I'm looking for ways to troubleshoot this.

# Answer
MySQL's Fulltext relevance calculation is a bit of a black box. I've tried to find out exactly how it calculates it when I built the add-on, but couldn't find anything useful. Instead, I found out through trial and error, you can influence the score calculation by repeating text in the same field, which is what the weighting does in Low Search.

So, whilst weighting fields in LS will influence MySQL's relevance scoring of a search result, I have no control over what an actual person might find more relevant.

That said, take a look at the `keywords:match` parameter:

> If a valid field (native or custom) is given, entries where that field **exactly** matches the keywords given will be pushed to the top of the search results, regardless of score.

That won't apply to partial matches, but could help you nonetheless.
> 2 votes

---
Tags: low-search
---


# Question
Title: Select dropdown after low search form selected for custom channel field
```
<select name="store:price">
    <option value="0">PRICE</option>
    <option value="|10"{if low_search_store:price == "|10"} selected{/if}>up to $10</option>
    <option value="10|25"{if low_search_store:price == "10|25"} selected{/if}>$10 to $25</option>
    <option value="25|50"{if low_search_store:price == "25|50"} selected{/if}>$25 to $50</option>
    <option value="50|100"{if low_search_store:price == "50|100"} selected{/if}>$50 to $100</option>
    <option value="100|"{if low_search_store:price == "100|"} selected{/if}>$100 and up</option>
</select>

```

This works great, when the search form is submitted, it returns the results with the price select selected based on the query in segement 3.

I also want to be able to search based on color, that value is stored in the products channel custom field: cf\_product\_color and not as a store modifier.

```
<select name="search:cf_product_color">
    <option value="">COLOR</option>
    <option value="red" {if search:cf_product_color=="red"} selected{/if}>Red</option>
    <option value="orange" {if search:cf_product_color=="orange"} selected{/if}>Orange</option>
</select>

```

This does not work, when I select a color (I know the color exists in that custom field: cf\_product\_color for entries) and it does not select the color from the select color drop down after submitting like it does for the price select drop-down.

This leads me to think I need to create a collection since I have a price, color select dropdowns making it 2 pieces of data I am searching for. Is this the case?

# Answer
> 2 votes
You only need to create collections if you're using the Keywords filter.

The variables created based on the parameters need to be **prefixed** with `low_search_`, as per how params work in LS. So try this as a conditional instead:

```
{if low_search_search:cf_product_color == "red"}

```

---
Tags: expresso-store, low-search
---


title: Updater Crash - All pages blank

text:
# Question
Title: Updater Crash - All pages blank
I just attempted to use Updater 3.2.4 to update my test site from EE2.7.2 to 2.10.1. The process froze up while it was installing EE. Now all my pages, both CP and front end are just blank pages with empty html, head and body tags. I don't know if this is a database issue or a file issue. Has anyone seen this before? Any help is appreciated.

Thanks.

# Answer
I decided to go ahead and do a manual update and that seems to have cleared everything up. Also updated all add-ons. Not sure why Updater crapped out though.
> 0 votes

---
Tags: devdemon-updater
---


# Question
Title: low-search {auto_path} not picking up URL with sub-categories
When displaying results the the system doesn't seem to be getting the right URL for the different results.

For example is outputting

```
http://xxx.xx.dev.xx.net/blackberry-autumn-pudding

```

and the correct one is `http://xxx.xx.dev.xx.net/food/recipes/blackberry-autumn-pudding`

In another case is doing `http://ee.dev/index.php/xx-memphis-bbq-roadtrip-test` and the correct one is `http://xxx.xx.dev.xx.net/food/recipes/xx-memphis-bbq-roadtrip-test`

I guess is not picking up the categories from which that URL belongs to. How can I fix that?

```
{exp:low_search:results
                                    limit="8"
                                    query="{segment_2}"
                                    collection="article|food"
                                    status="open"
                                    keywords:inflect="yes"
                                    pagination_base="search"
                                    keywords:mode="auto"
            }

{auto_path}
{/exp:low_search:results}

```

# Answer
Make sure the paths are set correctly in your channel preferences: http://ee2docs.com/cp/admin/channels/channel\_edit\_preferences.html#search-results-url

Automatically applying categories is not possible at the moment.
> 1 votes

---
Tags: low-search
---


title: Duplicating an entry based on entry_id

text:
# Question
Title: Duplicating an entry based on entry_id
I'm having a small issue creating a script that take in an entry\_id, and based on that creates a new carbon copy entry with a new entry\_id.

I've got this working, however as it stands now i'm forced to updated the $entry\_data array everytime a new ee\_channel\_data field\_id\_# column is created.

```
ee()->load->library('api');
ee()->api->instantiate('channel_entries');
ee()->api->instantiate('channel_fields');

$entry_data = array(
    'title' =>  $get_channel_title_res['title'] . ' COPY',
    'url_title' =>  $get_channel_title_res['url_title'] . '_copy',
    'entry_date' => $get_channel_title_res['entry_date'],
    'edit_date' =>  $get_channel_title_res['edit_date'],
    'field_id_1' => $get_channel_data_res['field_id_1'],
    'field_id_2' => $get_channel_data_res['field_id_2'],
    'field_id_3' => $get_channel_data_res['field_id_3']
);

ee()->api_channel_fields->setup_entry_settings($channel_id, $entry_data);

$success = ee()->api_channel_entries->save_entry($entry_data, $channel_id);

```

I would prefer not to have to specify the fields, but simply tell EE's API Create a new entry, based on this old entry, and change it's title/url\_title to appent \_COPY.

I realize there's an addon for this, however that's not an option for me

Thanks!

# Answer
> 0 votes
Have you considered an answer like this?

```
$entry_data = array();

// select all column names from your exp_channel_data table
$col_names = ee()->db->query('SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='yourdatabasename' AND `TABLE_NAME`='exp_channel_data')->result_array();

foreach ($col_names as $column_name) {
    // conditionals
    switch ($column_name) {

        // don't add an entry_id, 'cause auto insertion (giggity)
        case "entry_id":
            break;

        // title string append
        case "title":
            $entry_data[$column_name] = $get_channel_title_res[$column_name] . ' COPY';
            break;

        // url_title string append
        case "url_title";
            $entry_data[$column_name] = $get_channel_title_res[$column_name] . '_copy';

        // add everything else
        default:
            if (isset($get_channel_title_res[$column_name])) {
                $entry_data[$column_name] = $get_channel_title_res[$column_name];
            }
    }
}

// continue along your merry way with your api wackery

```

**Edit**

There isn't a built in function to do what you're asking.

OK, what about something even simpler? Assuming you have the `entry_id` you want to clone...

```
// get old data
$entry_data = ee()->db->select()
                      ->from('exp_channel_data')
                      ->where('entry_id', $entry_id)
                      ->get()->result_array();

// fix our copy
$entry_data["entry_id"]   = "";
$entry_data["title"]     .= " COPY";
$entry_data["url_title"] .= "_copy";

// move along, nothing to see here

```

Adds a database call but looks nicer!

---
Tags: php, channel-entries-api, api
---


# Question
Title: Add HTML inbetween, {freeform:mp_data:FIELD_NAME}
Is it possible to output the previously selected values using 'mp\_data' and freeform multipage with some HTML separating the values?

At the moment I have a field with dates in, a user selects some dates, and on the second page either displays the values they selected OR if no values were selected show another 'textarea' field asking why they haven’t selected any dates.

At the moment, it just outputs all the values raw.

```
Monday 14th September Tuesday 15th September Wednesday 16th September Thursday 17th September Friday 18th September

```

Is it possible to add a comma or HTML element to separate them.

```
Desired Result:
Monday<br/>
Tuesday<br/>
Wednesday<br/>

Current Code:
{if freeform:mp_data:FIELD_NAME}{freeform:mp_data:FIELD_NAME}<br/>{/if}

Actual Result:
MondayTuesdayWednesday

```

# Answer
> 0 votes
Hrmmm... weird one (I think).

Try expanding and adding carriage returns to your code:

```
{if freeform:mp_data:FIELD_NAME}

    {freeform:mp_data:FIELD_NAME}

    <br/>

    TESTING !!!

    <span> SPANNING! </span>

    <!-- COMMENTING! -->

    <br/>

{/if}

```

What do you get?

# Answer
> 0 votes
If you're using manually-coded form fields (i.e. not using `{freeform:field:FIELD_NAME}`), and submitting an *array* of data in a field (i.e. your fields would have `name="my_field[]"` instead of `name="my_field"`), you might need to manually break down the data using PHP or a plugin that separates a string of data into iterable pieces of data. For example, this would output your data, broken down to an array, as a PHP variable dump (turn on PHP for your template!):

```
<?php $arr = explode("\n", '{freeform:mp_data:FIELD_NAME}'); ?>
<?php var_dump($arr); ?>

```

`var_dump()` isn't very useful outside of development/troubleshooting however: you would need to loop through your array data for better customization, like this for example:

```
<?php foreach($arr as $item) :?>
      <?php echo $item; ?><br />
<?php endforeach ?>

```

---
Tags: solspace-freeform
---


# Question
Title: Notice on admin after upgrading from 2.9.0 to 2.10.2
I upgraded the expression engine from version from 2.9.0 to 2.10.2.It started showing the notice in the admin:

> Your ExpressionEngine installation’s version (2.9.2) is not consistent with the reported version (2.10.1). Please update your installation of ExpressionEngine again.

What does this mean? Need help. PS: I am new to ee

# Answer
If I remember correct it is because $config\['app\_version'\] in config.php still has the old version number.
> 1 votes

---
Tags: ee2-upgrades
---


# Question
Title: Exp:resso Store - Customise Admin Order Print View
I'm trying to work out what the best way to edit the layout of the Order Print View is so that it can fit with my clients Packing Slip Paper (it has special sticker areas for the shipping address etc).

In earlier versions of Store there was a PDF view that I have been able to edit, but since 2.4.0 this has been replaced with an HTML print view. This HTML view seems to be the main display template with print CSS applied. I'm always lothe to start editing core files, so any pointers much appreciated.

Any pointers much appreciated.

# Answer
> 1 votes
One way to do it without editing Store source files is to write some javascript and/or css that manipulates the layout and then inject that into the order detail view with an add-on like CP CSS & JS or hijack.

---
Tags: expresso-store, templates, orders
---


title: Avoid <p> in output of channel fields

text:
# Question
Title: Avoid <p> in output of channel fields
I created a channel "project" with several channel fields. For my question I am using the example of a field called "White Header", the short name is `white_header` and is is of Type **Text Input**.

When I output the field in my template, the content of the field of an entry is surrounded by

elements, which I don't need.

```
{exp:channel:entries channel="projekt" limit="1" orderby="date" sort="desc"}
    <h2 class="content__header">{white_header}</h2>
{/exp:channel:entries}

```

The resulting HTML is:

```
<h2 class="content__header"><p>White Header Content</p></h2>

```

I would like the HTML to be:

```
<h2 class="content__header">White Header Content</h2>

```

What I tried:

* I changed the default text formatting from `Markdown` to `None`, but it didn't change anything
* Tried to find a solution in the documentation
* Tried to find a solution with google, but did only find an entry about "grid" (what is grid?) that didn't help in my situation.

**How can I avoid, that ExpressionEngine outputs HTML elements, that I do not need?**

What would alternatively help: Is there a way to assign a class to the auto generated `<p>` element?

# Answer
> 1 votes
It sounds like you would do best to make use of a WYSIWYG Field Type addon. There are several. I think the ones that get the most use are Wygwam, Expresso, and Wyvern.

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

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

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

They are all built on top of CKEditor. This field will allow content editors more freedom to build content, and also allow for markdown editing without any forced tags. They also allow for customization of the field type. Try out CKEditor to get a feel for the field. They will auto-add `<p>` tags when in editor mode, but that is generally customizable, and you can use the source mode to edit the HTML markdown however you'd like.

---
Tags: channel-entries, templates, html, channel-fields, text-formatting
---


# Question
Title: How to get all values of a field pack channel field
I've a `Channel Field`, I create a `field-pack drop-down list` that works great on the Article page back-end.

Now I need to get all values of that list and output it into the article temple if i do `{cuisine:label}` it will give me the selected value as set on the back-end when the article was created. But I need all values not only the selected one.

How can I get the full list of that particular channel field - drop down to output it into a template?

The rational is that in the front-end I need to recreate that list and then use those values for search queries. Hence I need value:label pairs so i dont have to replicate the data.

# Answer
I don't known your complete use case, but a drop down isn't really the right field type to go with, I suspect. You can't output it as you want, and would have to use some front-end jQuery-izing to take the field and convert it into a list.

I would use the Checkboxes field. Ref:

http://docs.pixelandtonic.com/fieldpack/fieldtypes/checkboxes/tags.html#ol-and-ul-tags

That will allow you to output your values as a list. But as a side note... ever hear of fusion cuisine? :p you might want to allow multiple selections for that field on a content level, because half the world does fusion.
> 0 votes

---
Tags: field-pack, channel-fields
---


# Question
Title: Use template at root directory using Template Route Manager
I use EE 2.10.1 and the Template Route Manager to show a specific template at the root of my site (e.g. `http://www.example.com/`).

My setup in the Template Route Manager resembles the screenshot:

I can open `/project`, `/imprint` a.s.o., but if I open the root `/` URL the template is not shown, but just an empty page.

If possible, I don't want to use the Pages modul to achieve that, as this is the only static page I have and it is hardcoded.

**How can I assign a template to the root of a page by using Template Route Manager?**

# Answer
I don't think you can. You also don't need to do that. The template file you are wanting to be your homepage is already called index.

http://www.ee2docs.com/cp/design/templates/new\_template\_group.html#default-home-page

Set your `site` template group as your default template group via this setting, and it automatically will make site/index your root.
> 1 votes

---
Tags: templates, template-routes, template-manager
---


title: Channel Image regeneration error

text:
# Question
Title: Channel Image regeneration error
I'm running Channel Images 5.4.18 with EE2.9.2. I'm working on a copy on a development server doing updates.

When I go to regenerate an image size, I'm getting error messages like this, and it won't regenerate the images:

> A PHP Error was encountered Severity: Warning
>
> Message: copy(/chroot/home/account/primarydomain.com/html/secondary/system/expressionengine/cache/channel\_images/imagefilename.jpg): failed to open stream: No such file or directory
>
> Filename: local/local.php Line Number: 111

I don't know how CI operates (obviously!) but I'm wondering why it would be looking in the cache for the images? This directory it's looking in doesn't exist, and it seems strange that it would look in a cache folder, which can be cleared.

Any help would be appreciated!

# Answer
The cache is used to generate the images and then copy them over. Most likely your paths and urls are incorrect. I would first use something like Deeployer Helper to make sure all the paths and urls are correct. Most likely you are having issue from this.
> 0 votes

---
Tags: devdemon, channel-images
---


title: Relationship field not parsing

text:
# Question
Title: Relationship field not parsing
I'm trying to pull some data from a relationship child (design) to the parent (packages), but it's simply not parsing anything.

```
{exp:channel:entries channel="packages" orderby="date" sort="asc" limit="3"}
    {design:title}
{/exp:channel:entries}

```

The above code renders nothing on the page, just white space in the source. The parent entries tag is correct, I have omitted other variables from the example.

I tried including the relationship as a tag pair:

```
{exp:channel:entries channel="packages" orderby="date" sort="asc" limit="3"}
    {design}
        {design:title}
    {/design}
{/exp:channel:entries}

```

Which renders the `{design:title}{/design}` preceded by a digit of which I can't figure out the significance. I don't think it's an entry ID or anything, but it seems to render in place of `{design}`.

Ultimately I'm trying to pull an image from the child's Channel Images field, but I can't seem to access anything.

The site is using EE 2.5.2 (old, I know).

# Answer
> 0 votes
I forgot that back in 2.5.2 the Relationship tag pair was {related\_entries}, not the short name of the field itself.

So the correct usage in my example, if anyone needs it, is as follows:

```
{exp:channel:entries channel="packages" orderby="date" sort="asc" limit="3"}
    {related_entries id="design"}
        {title}
    {/related_entries}
{/exp:channel:entries}

```

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


# Question
Title: EE 2.2.2, member group unable to access file manager
I have a site running ee 2.2.2. I've set up a new member group, but this group cannot see the file manager or upload files.

I've checked the group settings as below:

Can access CONTENT: File Manager - yes Can administrate file upload preferences - yes

I've gone into file manager and made sure the group can access the directory.

If they go to Content menu, they can't see the file option. If they click Browse Server in an entry, they get the following message:

# Answer
> 0 votes
You'll also need to ensure that member group has access to `upload files`:

That's found under `Content > Files > Files Upload Preferences > Edit the upload path` at the bottom of the page.

Also you shouldn't need to give them `Can access CONTENT: File Manager - yes Can administrate file upload preferences - yes`

Just `Can access CONTENT: File Manager` under Group Preferences is all that's needed.

# Answer
> 0 votes
I think it might be a bug in EE 2.2.2. I created a new member group, moved the accounts across to the new group, with the same permissions and it appears to be all ok now.

---
Tags: file-uploads, file-manager
---


title: Fixing Wyvern/CKEditor

text:
# Question
Title: Fixing Wyvern/CKEditor
I have run into an issue with the addon Wyvern where the field in the publish/edit pages doesn't display as described in this support ticket: https://boldminded.com/support/ticket/773

I figured my best option to resolve the issue is to follow the first response and reinstall Wyvern:

> You might have to set all your Wyvern fields to textarea, uninstall, then reinstall Wyvern and assign the fields back to Wyvern.

But before I do that I want to be sure that this process is safe. It would mean converting about a dozen fields to Textarea (Rich Text) and back. Would changing the filetype strip out anything that might be unique to Wyvern, or would it just leave the source code intact until Wyvern was reinstalled?

# Answer
Changing the fieldtype won't strip out data. Internally Wyvern, Wygwam, or any WYSIWYG editor just saves the data to a normal text column in the database. Changing the type to textarea just ensures that it contains the same blob of text that contains html, but nothing enacts on it or tries to modify it. So in short, yes you are safe in doing this.

Always backup your database though.
> 1 votes

---
Tags: add-on, fieldtype, ckeditor, wyvern
---


title: e-check to pay an invoice

text:
# Question
Title: e-check to pay an invoice
Has anyone set up CartThrob or Expresso or Brilliant Retail to collect payments of invoices with an e-check? I checked all three sites, it doesn't look like they do but thought it best to confirm.

I also searched Devotee and didn't see anything that would support e-checks (or ACH)

thanks.

# Answer
(I work at Vector Media Group; we make CartThrob)

This isn't something CartThrob supports out of the box, but it could be done via a custom gateway. Feel free to get in touch if you'd like to discuss that more!
> 0 votes

# Answer
I don't think any of the Big 3 (BrilliantRetail, Carthrob, Store) support ACH out of the box but all can be extended.

Below is a link to the BR docs on creating a custom gateway:

http://docs.brilliantretail.com/3-extending-brilliantretail/payment-gateways/index.html

Best, David
> 0 votes

---
Tags: expresso-store, cartthrob, brilliantretail
---


title: Free member on submit blank page

text:
# Question
Title: Free member on submit blank page
I'm using Freemember to register members. I have my return parameter set up correctly (see below). When I submit the form the the member does get registered in the back end but the page just goes blank and remains at form page, does not go to the return page. I had this working and have disabled/uninstalled any other add-ons that I added since setting up Freemember. I don't understand why this is happening. Please help. Thanks.

Here's the form code:

```
{exp:freemember:register form_id="jumpstart_register" form_class="form" form_name="jumpstart_register" return="jumpstart/guidelines" error_handling="inline" error_delimiters="<span class='form_error'>|</span>" require="first_name|last_name|phone|email|password" group_id="7"}

            <label class="req" for="first_name">First Name</label><br />
            {field:first_name}
            {error:first_name}<br />

            <label class="req" for="last_name">Last Name</label><br />
            {field:last_name}
            {error:last_name}<br />

            <label class="req" for="phone">Phone</label><br />
            {field:phone}
            {error:phone}<br />

            <label class="req" for="email">Email</label><br />
            {field:email}
            {error:email}<br />

            <label class="req" for="password">Password</label><br />
            {field:password}
            {error:password}<br />

            <label class="req" for="password_confirm">Confirm Password</label><br />
            {field:password_confirm}
            {error:password_confirm}<br />

            <p><strong>Important Notice:</strong> It is in your best interests, as well as Ganeden's, that you have fully read, understood, and comply with the Submission <a href="{path='jumpstart/view/terms-conditions'}">Terms & Conditions</a>. If there are any terms or conditions that you did not fully understand, please reread them, and if you are still uncertain, seek legal counsel before making a submission to this website.<br/>
            {field:accept_terms} <label class="req" for="accept_terms">I accept the <a href="{path='jumpstart/view/terms-conditions'}">terms & conditions</a></label><br />
            {error:accept_terms}
            </p>

            <input type="checkbox" name="us_based" id="us_based" value="yes" /><label class="req" for="us_based">I and/or my company are based in the U.S.</label>
            <span id="us_based_error" class="form_error"></span><br />

        <div>
            <input class="button" type="submit" value="SUBMIT" />
        </div>
    {/exp:freemember:register}

```

# Answer
> 0 votes
Turns out I also had mx-notify-control installed (not being used) and I missed it when I was going through and disabling add-ons. It was creating the conflict. Problem solved.

---
Tags: freemember
---


title: What Addons are compatible with EE 3.0?

text:
# Question
Title: What Addons are compatible with EE 3.0?
I am beginning the transition to EE 3.0 and have not been able to find a list of compatible plugins, add-ons, etc. Is there such a list?

# Answer
> 4 votes
I found the answer. Devotee has a list here.

---
Tags: add-on, wygwam, module, plugin
---


title: Assets Module Not Working

text:
# Question
Title: Assets Module Not Working
My Assets plugin is not working on EE 2.4. It continually loads. Also when I try to add an asset when adding an entry, nothing comes up when I click "Add File".  I have Super Admin access and when I click "Settings" I just get a blank field for "License Key"

# Answer
> 1 votes
> Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at . (Reason: CORS header 'Access-Control-Allow-Origin' missing).

By default browsers won't let JavaScript requests that originate on one domain make a call to another domain, so they'll show that error you're receiving.

In the case of EE and Assets, that usually means you're accessing the EE control panel from a different domain that's specified in your `Admin->General Configuration->URL to your "themes" folder` and `URL to the root directory of your site` settings.

And keep in mind that `www.domain.com` and `domain.com` are technically considered two different domains. That often trips people up.

# Answer
> 0 votes
This type of behavior is usually caused by a missing script asset. Open your browsers developer tools (F12 or Command+Alt+i) and look at the developer console or network tab to see if some files aren't loading. Also, you might see other errors in your console; perhaps you've recently added an accessory that is dumping extra scripts on the page that they are namespace collisions with something related to Assets.

Often, just re-uploading the third-party themes folder for an add-on resolves these issues.

---
Tags: assets
---


# Question
Title: Stash Variable as channel entries search parameter
I’m stumped on something. I’m trying to (using AJAX) allow users to filter events by their location. So you can choose either Region or Country from selects that are populated with the addon REEgion Select. Whatever you select then becomes `segment_3`. Pretty straightforward. If you chose a Region, it’s no problem to just use that segment as the search, but because there’s some overlap between the two letter codes (CA is Canada and California), I created a conditional to determine what is being returned, and am trying to use stash to get that conditional variable into the search function of the `{exp:calendar:events}` tag.

This is that tag: `{exp:calendar:events event_limit="30" channel="calendar_events" date_range_start="today" date_range_end="1 year" search:address='{exp:stash:get name='region_search' random}' dynamic="no”}`

Here’s the stash variables I created: `{exp:stash:set name="region_stash"}{exp:reegion_select:countries}{if segment_3 == "{region_alpha3}"}{region_alpha2}{/if}{/exp:reegion_select:countries}{/exp:stash:set}`

`{exp:stash:set name="region_search"} {if '{exp:stash:get name="region_stash" random}' == ''} "region":"{segment_3}" {if:else} "country":"{exp:stash:get name="region_stash" random}" {/if} {/exp:stash:set}`

`{exp:stash:get name="region_search" random}`

outside of the tag, this stashed variable works great and renders no problem. Do you guys know what I’m doing wrong?

Here it is in action. Thank you!

# Answer
Here you can find a description on how to solve your issue.
> 0 votes

---
Tags: channel-entries, stash, search, solspace-calendar, ajax
---


title: Low Events: wrong date displayed

text:
# Question
Title: Low Events: wrong date displayed
I have a site with the following url:

```
domain.com/theater/events/2016-01-13

```

On said page I have this tag:

```
{exp:low_events:entries channel="events" date="{segment_3}" limit="1"}
   <option>{title}/ {event:start_date}</option>
{/exp:low_events:entries}

```

Now `{event:start_date}` always displays `2015-12-01` no matter what happens in the `url_segment`.

Why is that?

If I replace `{event:start_date}` with `{segment_3}` It shows the right date but then I'can't reformat the date. Anyone had this problem before?

--

Edit:

I further examined the problem. If I remove `limit="1"` then there are two entries displayed. One is the correct date and one is always the `2015-12-01`. Ho can I just grab the date which matches the `url_segment`

# Answer
The URL has the date in `{segment_2}` and you're using `date="{segment_3}"`.

Also, if the entry/event spans multiple days, the start\_date will display the event's start date, not the current date given.

**Edit:** Note that using `date="..."` is specifically designed to display events according to a date range. Using `date="2016-01-13"` will display all events that are *active* on January 13th 2015. This includes events that start that day, that end that day and that are active during that day (start before and end after).

If you're after displaying a *single* entry/event, you can also just use the channel:entries tag like you would with any old single entry, and use the entry's url\_title to determine which entry/event you want to show.

**Edit 2:** After some investigation it turned out there *were* events that span multiple days (years even). Correcting those entries solved the issue.
> 1 votes

---
Tags: date, low-events
---


title: Store: Trouble with discounted products

text:
# Question
Title: Store: Trouble with discounted products
I'm trying to sell a product at a reduce price in a basic store:product tag. I just need a button that when clicked adds the product to the cart with the reduced price, however, it keeps getting added to the cart at the full $200 price, not the reduce amount of 150.00. Any help in figuring this out would be appreciated.

```
{exp:store:product entry_id="{entry_id}"}
    <input type="hidden" id="item_qty" name="item_qty" value="{min_order_qty}" />
    {modifiers}
        {modifier_options}
            {if option_name == "special"}
                <input type="text" name="{modifier_input_name}" value="{price_mod_val}" />
                <button name="update_cart" class="btn btn-primary">Your Price <span>({price_inc_mod})</span></button>
            {/if}
        {/modifier_options}
    {/modifiers}
{/exp:store:product}

```

# Answer
The issue was that the input value needed to be {option\_id}, not {price\_mod\_val}
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Custom Icons per Channel Entry on Google Map
I am using Google Maps for EE in a site that shows rental properties. On each property's listing page (the page that shows one specific property), the client would like to have a Google Map that shows all properties but highlight the one the customer is viewing. They would also like to have their office populated on the map and have a unique icon for that marker.

So, each property will have a map with 60 pins but two of those need to be custom icons. The others can be the default Google Map icons.

Does this add-on allow that functionality?

# Answer
In your channel entries tag where you output map markers you could add a conditional and add a class to the icon container.
> 1 votes

# Answer
Thanks Bluedreamer. To get the desired result I ended up having to not use the module and go with plain vanilla Google Maps code. I created a Stash variable using the channel entries tag to create an array, then added that Stash variable to the GM code.
> 1 votes

---
Tags: google-maps-for-ee
---


# Question
Title: Need query to get custom fields from one entry into another entries loop on basis of shared category
This one is a beast of my own design, but I could use some expert EE help to get this more efficient. Here's the deal. EE categories are not as functional as I would like, particularly when it comes to custom fields. I have a large number of products to display by category, and at a category level, the site needs to have a description, multiple images, an meta description to jump up into the footer, etc. So I resorted to using an entry for this info - one entry per category. I'm basically using categories in the site only to provide the connection between the two AND to provide parent/child relationships at the category level that would otherwise not be easily achieved. I'm using GW Code Categories to provide concatenation of the category URLS (though not on the product page, which I may revise.)

Yeah, I know - expensive to process, but much more functional on the data side. On the upside, each product only has one category.

So now, when I'm viewing a product, I'm passing that product's assigned category into an embed, then using an entries loop to get the custom fields I need for the category to display within the product entry (the images at a category level, and some other custom field data, get displayed within an individual entry, rather than repeating that info at a product level within the product entry).

Right now, my URL structure is two fold:

catalog/category-name/subcategory-name (this is done within the index template in the catalog group, and once I hit the end of the tree, the list of all products in the category displays from the products channel, and I only ever go up to 2 deep)

catalog/view/product-id It's within view this template that I need to grab the description and images of the category to which the product is assigned (which matches up with an entry in my "category intros" channel)

Can you EE experts out there envision using the query module to make this marriage of content in two channels more efficient to process?

# Answer
Before giving this query specifically, have you considered exclusively using entries for the categories (as you're doing) but then using Playa to link them together instead of real categories? Have a "Categories" channel, use it to store your category data (again, as you do now) and then either have a single relationship field on your products or a multiple relationship field on the categories to do the assignments. Then, you could use the siblings, parents, children, and other tags to do whatever you need.
> 0 votes

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


title: Relationship field entries total count

text:
# Question
Title: Relationship field entries total count
Is there a way to get the total number of items chosen in a multiple relationships field?

# Answer
> 10 votes
Did you try this tag:

`{relationship_field:total_results}`

Example:

```
{exp:channel:entries channel="xyz"}
        {relationship_field}
           {relationship_field:total_results}
        {/relationship_field}
{/exp:channel:entries}

```

# Answer
> 3 votes
In addition to Bhashkar Yadav's answer, this worked successfully for me:

```
{exp:channel:entries channel='channel_xyz' status='not closed'}
    {if relationship_field:total_results > 0}
        ...do something!
    {/if}
{/exp:channel:entries}

```

...that is, having it outside of the relationship field loop.

---
Tags: relationships
---


# Question
Title: How to show image label when paste it in Wygwam field?
I need to show label (img alt or title property text) under the image when paste this image in Wygwam. Does exists the way to do this?

# Answer
> 1 votes
I'm assuming you mean on the frontend of the website, rather than in the Wygwam field.

There's a few different approaches, personally the easiest and most straight forward for both the developer and CMS editors, would be to implement on the frontend via JavaScript (example), so parses the text area taking title and adding beneath as a p or label tag. Therefore no different for CMS editor to add images and nothing special needs to be done each time.

Alternatives would be...

Utilise an existing JQuery library

Adding custom parsing in PHP or in a plugin within the template (a lot more effort)

Or utilising Wygwam templates \- may be more complex for editors to add images each time and for you to build initially

Google "ckeditor", as Wygwam is based on it, a lot of its functionality and features can be utilised.

---
Tags: wygwam
---


# Question
Title: Template Routes Manager remove index.php and template group?
I've read all of the eecms documentation on Template Routes Manager to no avail. I don't see any simple tutorial on how to use template route manager to remove index.php or template\_group name.

Is there an easy example of how to do this?

This user guide is garbage: http://ellislab.com/expressionengine/user-guide/urls/template\_routes.html

I've read it three times and somehow know less about template routes manager than I did before.

I've asked this question multiple times before with crazy suggestions. Suggestions that aren't scalable or user friendly.

Any takers? Not looking to use anyone as a crutch... If there's an awesome article you've read on this, you can share that! Anything, as long as it makes sense!

As well, I don't want to use Structure. It has caused many of my sites to crash over the past few years.

# Answer
You can not use Template Routes to remove index.php from your URLs. To remove index.php from you URLs you need to set up a redirect in an htaccess file, there are instructions here.

Getting rid of the group name is where Template Routes comes in. Navigate to the Template Route Manager under *Design ‣ Templates ‣ Template Route Manager*. Locate the **Route** field for the Template you wish to change the URL for. In the **Route** field put the new URL you wish to access your template by and then click Update. For the simplest case of a static URL you would use something like:

```
/my-new-url

```

And now you should be able to access that template by going to

```
www.yoursite.com/my-new-url

```

Here is a blog post I wrote that walks through a couple examples of more complex Template Routes.

If you don't mind me asking, what did you find confusing about the documentation? We're always looking to improve our documentation, so if you have any suggestions we definitely want to hear them.
> 5 votes

# Answer
I agree the routing documentation truly is pretty terrible. No clear examples to even get a person started.

I just had a similar situation to yours that I just resolved. I have a product listing page and then an individual product page. My template group is products/index for the listing page, and products/view for the individual product page. So to view a product the default url would have been products/view/\[product\_name\], but I wanted it to be products/\[product\_name\].

In my Template Route Manager, I added this rule next to my products/view template: products/{product} and selected 'yes' for segment required.

That means that if the {product} variable is not in the url, that rule is not used and my products/index template takes over.

For some reason EE doesn't like certain variable names (the {product} part) in the template routing manager and will throw errors on the front end. I found this through experimentation, so I don't know what the deal is there.

Hope that helps.
> 0 votes

# Answer
Removing index.php from the URL can be done in the .htaccess file. This technique has worked for me on several occasions. See Ellislab's information page. https://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html
> 0 votes

---
Tags: templates, url, template-manager
---


# Question
Title: Displaying gift certificate info in Cartthrob's checkout/cart when buying a certificate
I'm doing some work on an existing site that uses Cartthrob and finishing off the gift certificate integration.

For the life of me I can't figure out how to show the details of a gift certificate that the customer is purchasing.

The certificate is a single "product" that can have a variable value which is selected when the customer adds it to their cart.

In the cart/checkout, I can show the product title and its price but I can't show the email address or message associated with the certificate.

There *has* to be a way to do that right?

# Answer
> 0 votes
Entirely depends on how the data was added to the order.

If you're passing on the fly data, then check out the Adding Custom Data to Purchased Items and Orders part of the docs, else if it's coming from a products channel, then you can access the product details with the {exp:cartthrob:cart\_items\_info} tag.

---
Tags: cartthrob, checkout, shopping-cart, giftcertificates
---


title: How to fix Structure navigation in CP?

text:
# Question
Title: How to fix Structure navigation in CP?
After playing with structure, the navigation tree was broken.

Unforchently we don't have a DB backup. Any advice how to fix it?

Thx!

# Answer
Most probable that some entries were deleted from the system, but still they still in structure exp\_structure table.

**One-step solution:**

```
DELETE FROM exp_structure WHERE entry_id not IN ( Select entry_id from exp_channel_titles )

```

**Two-step solution** (if u want to validate results):

1. Find missed records:

SELECT GROUP\_CONCAT(entry\_id) as entry\_ids FROM exp\_structure WHERE entry\_id NOT IN (Select entry\_id from exp\_channel\_titles)
2. Delete missed records, using results of the first query in next query (instead of **XXXXXXXX**)

DELETE FROM exp\_structure WHERE entry\_id IN ( **XXXXXXXX** )
> 2 votes

# Answer
This is from duplicate ordering values. Run our debug mode: http://buildwithstructure.com/documentation/debug\_mode\_for\_page\_data/
> 2 votes

---
Tags: structure
---


# Question
Title: EE2.2.0 | sort="asc" only shows 2 entries where sort="desc" shows all
There is a page with 6 entries that are supposed to show but only shows 2 when sorted in ascending order. I sort in descending order and all 6 entries show. What is going on here?

```
{exp:channel:entries
    channel="gcswim-meets"
    orderby="gym-date"
    sort="asc"}

    {if '{gym-date format="%Y-%m-%d %H:%i"}' >= '{current_time format="%Y-%m-%d %H:%i"}'}

    <tr>
        <td width="220">
            {title}
        </td>
        <td width="68">
            {gym-date format="%m/%j"}
        </td>
        <td width="68">
            {gym-time}
        </td>
        <td>
            {gym-location}
        </td>
    </tr>

    {/if}

{/exp:channel:entries}

```

# Answer
> 0 votes
Just found out there is a secret limit of 100 for entries. Adding limit="900" fixed it. This is pretty ridiculous, I have to say.

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


# Question
Title: EE3.0 - custom member field not showing up in registration form in CP
I have created a custom member field in the CP and set it to "required", "show in registration" and "show in profile". However, it doesn't show up in the form when I register a new member in the CP and it doesn't show up in their profile when I go to edit a member.

I can see that the field was created correctly because it is in the exp\_member\_fields table. Am I doing something wrong that it is not in the form to register anyone and that I can create a new member without filling out that field? I am not using any plugins currently (developing a new site).

Thanks for any help anyone can give!

# Answer
> 0 votes
Ok. I decided to look at this since we need this for our site. I have a fix for the new member registration page (not letting them be edited from the CP yet, that is next). Using EE3.0.0, in file system/ee/EllisLab/ExpressionEngine/Controller/Members/Create.php, there are two places that need to be changed.

To show fields, change function index() and add code to actually check for custom fields. Here is how I did it (I’m sure there are better ways):

Line 65 - 134 changed:

```
$tmp_final[] = array(
            'title' => 'member_group',
            'desc' => 'member_group_desc',
            'fields' => array(
                'group_id' => array(
                    'type' => 'select',
                    'choices' => $choices,
                    'value' => (isset($choices[5]) && $choices[5] == 'Members') ? 5 : '',
                    'required' => TRUE
                )
            )
        );
    $tmp_final[] = array(
            'title' => 'username',
            'fields' => array(
                'username' => array('type' => 'text', 'required' => TRUE)
            )
        );
    $tmp_final[] = array(
            'title' => 'mbr_email_address',
            'fields' => array(
                'email' => array('type' => 'text', 'required' => TRUE)
            )
        );
    $tmp_final[] = array(
            'title' => 'password',
            'desc' => 'password_desc',
            'fields' => array(
                'password' => array('type' => 'password', 'required' => TRUE)
            )
        );
    $tmp_final[] = array(
            'title' => 'password_confirm',
            'desc' => 'password_confirm_desc',
            'fields' => array(
                'confirm_password' => array('type' => 'password', 'required' => TRUE)
            )
        );

    //Get custom member fields
    $cust_fields = ee()->db->from('member_fields')->where('m_field_reg', 'y')->order_by('m_field_id', 'asc')->get();

    if ($cust_fields->num_rows() > 0) {
        // Have custom fields. Add fields to registration form and for validation.
        foreach ($cust_fields->result_array() as $row)
        {
            if ($row['m_field_type'] == 'select') {
                $choices = array();
                $value = 0;
                $choice = explode("\n", $row['m_field_list_items']);
                $c = 0;
                foreach($choice as $choi)
                {
                    $choices[$c] = $choi;
                    $c++;
                }
            } else {
                $value = '';
            }
            if ($row['m_field_required'] == 'n')
                $required = FALSE;
            else
                $required = TRUE;

            $tmp_final[] = array(
                'title' => $row['m_field_label'],
                'desc' => $row['m_field_description'],
                'fields' => array(
                    'field_id_'.$row['m_field_id'] => array(
                        'type' => $row['m_field_type'],
                        'choices' => $choices,
                        'required' => $required,
                        'value' => $value
                    )
                )
            );
            if ($row['m_field_required'] == 'y') {
                $tmp_validation[] = array(
                     'field'   => 'field_id_'.$row['m_field_id'],
                     'label'   => $row['m_field_label'],
                     'rules'   => 'required'
                 );
            }
        }
    }
    $vars['sections'][] = $tmp_final;

    $tmp_validation[] = array(
             'field'   => 'group_id',
             'label'   => 'lang:member_group',
             'rules'   => 'required|integer|callback_valid_group_id'
        );
    $tmp_validation[] = array(
             'field'   => 'username',
             'label'   => 'lang:username',
             'rules'   => 'required|trim|valid_username'
        );
    $tmp_validation[] = array(
             'field'   => 'email',
             'label'   => 'lang:email',
             'rules'   => 'required|valid_email'
        );
    $tmp_validation[] = array(
            'field'    => 'password',
            'label'    => 'lang:password',
            'rules'    => 'required|valid_password[username]'
        );
    $tmp_validation[] = array(
             'field'   => 'confirm_password',
             'label'   => 'lang:confirm_password',
             'rules'   => 'required|matches[password]'
        );

    ee()->form_validation->set_rules($tmp_validation);

```

Next, to get the fields to actually be inserted into the database, a couple of changes need to be made in function register\_member(), at lines 292-294:

`if ($this->input->post(‘field_id_’.$row[‘m_field_id’]) !== FALSE)
{
$cust_fields[‘field_id_’.$row[‘m_field_id’]] = $this->input->post(‘field_id_’.$row[‘m_field_id’], TRUE);
}` since the names of the columns in exp\_member\_data have dropped the ‘m\_’ prefix on the column names.

# Answer
> 0 votes
It's a known bug that has been reported to Ellislab - https://support.ellislab.com/bugs/detail/21118/member-custom-fields-not-showing-on-profile-edit

---
Tags: members, ee
---


# Question
Title: Freeform Pro disrupting Channel Entries count variable
I have a `{exp:channel:entries}` loop inside of an `{exp:freeform:form}` pair tag. When I call the `{count}` variable inside the channel entries loop, I'm expecting the count of the channel entries. Instead, it is only returning `1`.

When I use this same exact channel entries loop outside the freeform tags, it correctly increments the count with each entry. I know that `{freeform:count}` exists and the I presume this is done in order to not interfere with the CE count.

Does anyone have any idea why this might be happening?

# Answer
Try putting the channel entries loop in an embedded template.
> 1 votes

---
Tags: ee2, channel-entries, solspace-freeform
---


# Question
Title: Need help to stop inner conditionals from parsing with with nested conditionals and stash
I'm really stuck and I know it's likely something small that I'm missing. I read the page in the wiki that relates to stash conditionals (https://gist.github.com/croxton/9d012297096892ca5c10), but I have to admit, I don’t completely follow whether it would apply the same way to set\_list and get\_list. Here’s my setup - I’m using the older way of inserting the wrapper template, using a traditional EE embed rather than a stash embed (perhaps that too should change?):

MY LOGIC TEMPLATE (simplified slightly to strip out details you likely don’t need to zero in on my problem)

```
{embed="_layouts/.catalog-product-details"}
{exp:stash:context name="stock-parts-product-details"}

    {exp:stash:set_list name="main_page_body" context="@" scope="site" parse_tags="yes" parse_conditionals="yes" save="yes" parse_depth="3"}

        {exp:channel:entries channel="products" dynamic="no" limit="1" url_title="{last_segment}" disable="relationships|categories|pagination|member_data" cache="yes" refresh="720"}

            {stash:current_product_category_url_title}{if segment_6}{segment_5}{if:else}{segment_4}{/if}{/stash:current_product_category_url_title}
            {stash:current_product_category_id}{if segment_6}{segment_5_category_id}{if:else}{segment_4_category_id}{/if}{/stash:current_product_category_id}

            {stash:product_name}{title}{/stash:product_name}

            various other individual variables that are stashed for the single product

        {/exp:channel:entries}

    {/exp:stash:set_list}

```

MY WRAPPER LAYOUT TEMPLATE

```
{exp:stash:get_list name="main_page_body" context="@" scope="site" save="yes"}

    <h1>{product_name}</h1>

    and other items stashed for the product from the logic template}

    {exp:channel:entries channel="products" dynamic="no" limit="1" category="{current_product_category_id}" url_title="{last_segment}" disable="relationships|categories|pagination|member_data" cache="yes" refresh="720"}

        {exp:ifelse parse="inward"}
            {if current_product_category_url_title == "widgets"}
                Width (A): {cf_prod_width}
            {if current_product_category_url_title == "whosits"}
                Height (A): {cf_prod_height}
                Width (C): {cf_prod_width}
            {if current_product_category_url_title == "somethingelse"}
                Length (A): {cf_prod_height}
                Inside Width (B): {cf_prod_inside_width}{if cf_prod_inside_width_special}{cf_prod_inside_width_special}{/if}

            THIS PATTERN CONTINUES FOR A LONG TIME DOWN THE PAGE BECAUSE THERE ARE 120 CATEGORIES WITHIN WHICH THE SET OF VARIABLES TO DISPLAY COULD BE DIFFERENT

            {if:else}
            {/if}
        {/exp:ifelse}

    {/exp:channel:entries}

{/exp:stash:get_list}

```

As a test, if I comment out (using EE comments so they don’t parse at all) the inside of the outer if:else conditions, the page loads in less than a second. But when the inside of each condition is kept alive in the template, the page is incredibly slow. So I can tell am I failing to setup the template in a way that would allow the stashed variable, current\_product\_category\_url\_title to be evaluated first and prevent the inside of non-matching conditions from being parsed. The product\_category\_url\_title is being set in the logic template and retrieved in the layout template mainly because of my need to parse the segment data conditionally - it’s the “immediate parent” category that I’m after and it’s not always the same segment because I’m concatenating the URLs.

What is it that I’ve missed with the conditional setup? And could the conditionals actually be stored within the logic template (and would that make a difference?). Why are the inside conditionals parsing and how can i prevent that?

# Answer
> 0 votes
From what I can make out 'ifelse' is useful for early parsing conditionals, but still uses EE's conditional logic(?). This means that EVERY conditional (Pre 2.9) is evaluated even if the condition is met before they are all checked. (from tests I think I remember seeing they are even checked when commented out). (enable template debugging to see this).

There is an addon called switchee which handles this differently and might help with performance in your case.

---
Tags: stash, conditionals, ifelse, switchee, advanced-conditionals
---


title: EE Always Loading Site Default Template

text:
# Question
Title: EE Always Loading Site Default Template
I just did a DB upgrade from 2.4 to 2.10.1. And I switched my templates to save as files. And I am having issues where EE will always load the site default template index. I've removed Pages and Better Workflow to see if that would help. If I try to go to any page other than the site index, it loads the sites default template. The SQL Query below is ran on every template/template group I create. If I modify the query below I can get it to pull the correct template, but what is configured with EE that is making it load the site's default template/index on every other template I try to create?

```
SELECT `exp_templates`.*, `exp_template_groups`.`group_name`
FROM (`exp_templates`)
JOIN `exp_template_groups` ON `exp_template_groups`.`group_id` = `exp_templates`.`group_id`
WHERE `exp_template_groups`.`site_id` =  '1'
AND `exp_templates`.`template_name` =  'index'
AND `exp_template_groups`.`is_site_default` =  'y'
#APP/libraries/Template.php L:2381  EE_Template::fetch_template()

SELECT `exp_templates`.*, `exp_template_groups`.`group_name`
FROM (`exp_templates`)
JOIN `exp_template_groups` ON `exp_template_groups`.`group_id` = `exp_templates`.`group_id`
WHERE `exp_template_groups`.`site_id` =  '1'
AND `exp_templates`.`template_name` =  '.layout'
AND `exp_template_groups`.`group_name` =  'site'
#APP/libraries/Template.php L:2381  EE_Template::fetch_template()

```

# Answer
> 0 votes
In my config file I found that uri segments were being queried instead of allowing EE to automatically parse them.

---
Tags: templates
---


# Question
Title: Multiple comment forms on single page/template
I keep reading everywhere that the actual comment:entries tag and comment:form tag should be used on a single entry view template.

https://ellislab.com/expressionengine/user-guide/comment/#id38

Anyone had experience in developing something like a facebook feed where multiple comment forms are to be made available along with the users comments for multiple entries?

**UPDATE**

As also suggested by Derek I've tried to do this…

This is the parent

```
{exp:channel:entries channel="posts" status="open|featured"}
            {embed="site/comment" entry_id="{entry_id}"}
{/exp:channel:entries}`

```

This is the embed being called

```
{embed:entry_id} --THIS GETS PARSED AND I GET THE ID ON FRONTEND
{exp:comment:entries limit="20" entry_id="{embed:entry_id}"} --THIS ONE DOESN'T
    <h2 class="comment-user-name">{name}</h2>
    {comment}
{/exp:comment:entries}

```

I just can't get the entry\_id from the parent. It seems to not populate the comments tag. If I hardcode the value in the embed call (eg. `{embed="site/comment" entry_id="3"}`) it works as expected. I suspect is a parsing order issue.

**UPDATE2**

adding a `parse="inward"` parameter to the `{exp:comment:entries}` tag seems to to the trick, but the `{avatar_url`} (i'd love to integrate commenter avatar) seems to point to the avatar of the entry author which is not what i want.

# Answer
> 1 votes
Both the `comment:entries` and `comment:form` tags accept an `entry_id` parameter, so there's no reason you can't have multiple forms on a page, so long as you pass the correct `entry_id` to each.

You might also run into variable collisions, since you'll need to use them inside of a `channel:entries` loop, so you may need to embed the comments/form and pass the `entry_id` via an embed variable.

**UPDATE:** You'll also need to add `dynamic="no"` to your `comment:entries` tag.

---
Tags: ajax, comments, facebook
---


title: Do something after hook

text:
# Question
Title: Do something after hook
I'm making an ExpressionEngine extension that is supposed to return to a certain URL **after** the user logged in. I'm using this hook: member\_member\_login\_single. This returns me to the right url, but it doesn't finish the whole login process. In other words: it's not logging my user in! How am I supposed to do this? There doesn't seem to be a hook like member\_login\_end.

```
 function activate_extension()
{
    $this->settings = array(
        'prijs_per_kind'    => 5,
        'sluitingsdatum'    => '05-11-2016',
    );

    $hooks = array(
            "zoo_visitor_register_end" => "redirectToPayment",
            "member_member_login_single" => "checkClosingDate"
    );

    foreach ($hooks as $hook => $method) {
        $data = array(
                'class' => __CLASS__,
                'method' => $method,
                'hook' => $hook,
                'settings' => serialize($this->settings),
                'priority' => 10,
                'version' => $this->version,
                'enabled' => 'y'
        );
    }
    ee()->db->insert('extensions', $data);
}

function checkClosingDate()
{

        ee()->functions->redirect('http://sportvandemaand.local/account/profiel/verlopen');

}

```

# Answer
> 1 votes
Well, you are killing the process when you throw a redirect. The `redirect()` function basically causes a `die()` affect, ending code termination.

You know you can declare a redirect in the template with the log-in form?

http://ee2docs.com/add-ons/member/index.html#login-form-tag

You just add a `return="your_url"` parameter to the tag.

```
{exp:member:login_form return="your_url"}

    Form stuff here, see reference

{/exp:member:login_form}

```

# Answer
> 0 votes
If for some reason you really *do* need to set the redirect inside of your hook (perhaps, for example, you're performing some additional logic inside your method which you've excised for simplicity), try manually setting the value of `$_POST['RET']` inside your method.

```
$_POST['RET'] = 'account/profiel/verlopen';

```

This value will get processed inside of `Functions::form_backtrack()`, which is called by `Member_auth::_build_success_message()`, which is the last step of `Member_auth:member_login()`.

---
Tags: members, zoo-visitor, login, extension, hook
---


# Question
Title: Store: how to configure promotions in bulk?
I'm about to launch several EE sites with Expresso Store. Each site will basically have the same products. And when some of the products go on promotion, they need to happen across the individual sites.

Is there a way to quickly replicate the configuration of promotions (e.g. a 50% discount sale on 100 products) across multiple sites?

# Answer
> 2 votes
Have a look at the `exp_store_discounts` table in the database. You could write once query which inserts a new discount and run it on each database as required.

The only hitch would be if it were applied to specific categories or entry IDs, those may vary from site-to-site.

---
Tags: expresso-store
---


title: Conflict with Twitter Bootstrap

text:
# Question
Title: Conflict with Twitter Bootstrap
Is there a conflict with Solspace Calendar and Twitter Bootstrap 3.3.4? When I enable the date picker field on the channel form, the navigation loses all formatting from Bootstrap. I see current documentation calls for jQuery 1.3 while the new Bootstrap is using 1.11.2. Is there a way to have both?

# Answer
This is because Calendar uses ExpressionEngine's built in jQuery UI bundle to build the mini calendar popup. You will probably have to use some combination of the two with jQuery's noConflict method: http://api.jquery.com/jQuery.noConflict/
> 2 votes

# Answer
So the fix for now.... (Which has been fixed for Donovan) seems to be the following....

HISTORY: $.browser property is deprecated in jQuery 1.3, and bootstrap requires jQuery 1.9.1+ (Or similar)

SOLUTION: For some unknown reason this causes an issue when using Solspace Calendar with Twitter Bootstrap...(I assume there is a correlation in the Module and this depreciated plugin)

After loading jQuery.... add in the Script for the jQuery Migrate Plugin. (See following)

```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>

```

Hopefully this will help! (Only put the answer for other's to see, in case someone else had this issue.)

SOURCE FOR JQUERY MIGRATE: JQuery Migrate
> 0 votes

---
Tags: jquery, calendar, bootstrap
---


# Question
Title: Freeform Pro Won't Register Form Submissons
We have a relatively simple form that won't register any submissions even though there is no outward sign of an error. Manual submissions via the CP work just fine. I'm trying out FF to use FF Pro on a new site.

I have tried varying parameters with little to no luck. I've noticed some issues with Freeform so I'm assuming this is something on our end. EE 2.93 and FF Pro 4.2.4

The site is located at: http://www.apothekergroup.com/site/test

Thanks in advance for any assistance.

```
    {exp:freeform:form
form_id="3"
return="_forms/thank-you"
notify_admin="yes"
notify="justin@suissa.com"
admin_template="admin_user_registration_notication"
form_name="initial_event_registration"

    }

                                <div class="row mar-lr-none">
                                    <div class="large-12 columns">
                                        <label> <h6 class="bold primary-color"> STEP 1/3: </h6> </label>
                                    </div>
                                    <div class="large-12 columns">
 <p>
        <label>{freeform:label:full_name}</label>
        {freeform:field:full_name}

    </p>
                                    </div>
                                    <div class="large-12 columns">
   <p>
        <label>{freeform:label:email}</label>
        {freeform:field:email}

    </p>
                                    </div>
                                    <div class="large-12 columns">
   <p>
        <label>{freeform:label:confirm_email}</label>
        {freeform:field:confirm_email}

    </p>
                                    </div>

                                    <div class="large-12 columns">
   <p>

    </p>
                                    </div>

                                    <div class="large-12 columns text-right">
                                    <input type="hidden" name="XID" value="{XID_HASH}" />
                                {freeform:submit}

                        </div>
                                </div>

                        </div>
                        {/exp:freeform:form}

```

# Answer
> 0 votes
I'll take a shot at it.

A common issue...

When you visit `Members -> Member Preferences` in your Control Panel, is your `Require Terms of Service` preference set to `Yes`? If so, I think you need to put a checkbox in your FreeForm form to get past that in front-end registrations. Try setting that preference to `No`.

# Answer
> 0 votes
The cause here was an .htaccess file that needed tweaking (usually this is a good start: http://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html), and the removal of an outer `<form>...</form>` HTML tag pair unrelated to Freeform (can't have a form within a form in HTML).

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


# Question
Title: Assets field in a grid field PHP error message
I have a grid field named 'cf\_results', which has a column named 'file' which is an assets data type. The other columns are text types named 'link-text' and 'link-url'. There will either be a file or a link-url but not both. I'm getting a set of 3 PHP error notices for every entry on the page, regardless of there being data in the assets field of an entry or not see attached screenshot. But it all seems to be working otherwise.

This is the template code:

```
{if cf_results}
    <ul>
    {cf_results}
    <li>
        <a href="{cf_results:file}{cf_results:link-url}">{cf_results:link-text}</a>
    </li>
    {/cf_results}
    </ul>
{if:else}
    <p>Results will be available soon.</p>
{/if}

```

# Answer
> 0 votes
This is not really an answer, but editing the original question would have been really messy.

It seems that the error is nothing to do with the cf\_results Grid field. I kept removing bits of code from the page until I didn't get the PHP error, and it was the cf\_image field (which is an Assets fieldtype but is not in a grid) that was causing it. The key bit of code that needed to change was this:

```
<img src="{made}" alt="{cf_images:caption}{if cf_images:author}, Source:{cf_images:author}{/if}" />

```

to this

```
<img src="{made}" alt="{cf_images:caption}, Source:{cf_images:author}" />

```

The if condition was causing it, but exactly the same code is used on another template and works perfectly and without any error. It makes no sense to me.

---
Tags: assets, grid, php-errors
---


# Question
Title: Store modifier value not being output inside Matrix
I'm not sure if this is a problem with Matrix or Store.

With the following code:

```
{modifiers}
{if modifier_name=="Linen"}
{modifier_options}
<input type="radio" name="{modifier_input_name}" id="{modifier_input_name}-{option_id}" value="{option_id}">
<label for="{modifier_input_name}-{option_id}" class="swatch-label">
  {product_fabric_swatches search:product_type="=Linen" search:product_swatch_name="={option_name}"}
  <img src="{exp:ce_img:single src='{product_swatch}'">
  {/product_fabric_swatches}
</label>
{/modifier_options}
{/if}
{modifiers}

```

I get this output:

```
<label for="modifiers_13-61"> "}
    <img src="…/1-0003-0001_60_60.jpg" data-src="…/1-0003-0001_800_533.jpg">

```

You can see it outputs the label and associated image but it's not filtering on the `{option_name}` and there's a stray `"}` after the label which appears to be the closing of the Matrix tag.

If I replace `{option_name}` with one of the values entered into Matrix, then I get the output I expect, but obviously only for a single row.

# Answer
> 0 votes
Managed to solve this with an embedded template.

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


title: ExpressionEngine 3 .gitignore

text:
# Question
Title: ExpressionEngine 3 .gitignore
How are everyones .gitignore files looking in the latest iteration of EE?

Mine .gitignore is included below.

Is there anymore secret data / files that should not be in the repo?

```
# Capistrano
config
capfile

# Cache
system/user/cache/*

# Settings
system/user/config/*

#Images
images/avatars/*
!images/avatars/index.html
images/captchas/*
!images/captchas/index.html
images/forum_attatchments/*
images/forum_attatchments/index.html
images/member_photos/*
!images/member_photos/index.html
images/signature_attatchments/*
!images/signature_attatchments/index.html
images/smileys/*
!images/smileys/index.html
images/uploads/*
!images/uploads/index.html

```

# Update 09/11/15

Added cache above due to tip from @seavers

# Answer
Here's the cache directory:

system/user/cache/\*
> 3 votes

---
Tags: .gitignore
---


# Question
Title: Would like to have a divider between category names where there are more than 1 to show. (and no divider when there is only 1 category name)
This is the site with 2 category names in the blog:

http://www.hogarthlighting.co.uk/blog/article/melba-the-savoy-hotel-london

News Picture Lights.

I would like it to show this when there are 2 or more category names

News / Picture Lights

Would I use 'if' statements? I have tried but had no success.

# Answer
You can use some variables from the Channel Categories loop to execute this.

Ref:

http://ee2docs.com/add-ons/channel/categories.html#variables

Inside of your Channel Categories loop:

```
{category_name} {if count != total_results}/{/if}

```

This places a `/` after each category name until you reach your last sequence of the loop.

**Edit** Oops, of course you have it in a `{exp:channel:entries}` loop. Here is your answer:

http://ee2docs.com/add-ons/channel/channel\_entries.html#id149

Use the backspace param to cut off the end of your last loop. Example:

```
{categories backspace="2"}

    <a href="{path='blog'}">{category_name}</a> /

{/categories}

```

This will remove the last character of the last loop, the `/`. You might need to adjust the backspace number depending on your formatting.
> 2 votes

---
Tags: ee2, categories, loop
---


# Question
Title: Use discount code field for Gift Certificate redemption in Cartthrob
I've heard there is a way to use the discount code field of a checkout form to accept gift certificate codes within Cartthrob.

Despite Googling I can't find any reference to this. Does anyone know if this is possible or does the gift certificate redemption require its own form?

This makes it difficult to use in the checkout as that is itself a form. Forms in forms are bad! I know this could be done with Ajax but it seems silly to have to do that when a simple field on the checkout form will do.

# Answer
> 0 votes
This is not a supported feature that I'm aware of. The documentation for the gift certificate addon is here and specifically mentions using the dedicated form. I think it's best to use that method.

---
Tags: cartthrob, giftcertificates
---


# Question
Title: Channel Form refuses to set Status to entry
I found a year old post regarding this issue as well (Setting entry status with Channel Form) but no apparent solution.

Has anyone come upon one yet?

Basically I can do this:

```
{status_menu}
    <select name="status">
        {select_options}
    </select>
{/status_menu}

```

But no matter if I am logged in as a super admin, regular user or even a guest, the entry saves with the intended status. It's like the field is being ignored.

Any clues?

# Answer
> 0 votes
I found the problem.

I had set a specific status in Admin \> Channel Administration \> Channel Form, which it turns out, overrides anything in the template code.

When I returned this to "-- Use Channel Default --", it became possible to set the entry status as expected.

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


# Question
Title: Placeholder value of input cleared on error
I have a Low Search form with two required fields, and am declaring these as required using the form tag's "required" parameter.

One field is an input connected to a jQuery date picker. The other is a checkbox list. Selecting the date, but not choosing one of the checkbox options, then submitting the form gives me the expected error message. However, the value of the date input is cleared out.

How do I keep the value chosen in the date picker after the error message is fired?

# Answer
> 0 votes
Right now, you don't. Low Search will redirect back to the form in the state it was before it was submitted (and before it was filled out). There's currently no way to retain the value that was submitted. I will make note of it as a Feature Request, tho.

---
Tags: low-search
---