# Question
Title: Does replace_tag fire for single tags if there is no $data?
I'm having a problem with a custom field type where I want to return 'some value' on the condition of there being no value in data. This works when I use a tag pair, but not when I use a single tag.

i.e.

```
{my_field}something here{/my_field}

```

will call replace\_tag even when $data is empty, but...

```
{my_field}

```

will not even call replace\_tag unless $data is not empty. In this case I want to force a 'default' value if the field is empty but it appears impossible.

Is this a bug or intended behaviour to improve performance? Is there some workaround I can use to trick ExpressionEngine into thinking $data has some value before the template is parsed to force it to call replace\_tag on single tags?

Edit:

Trawling through the ExpressionEngine core files gives me the impression that what I'm trying to achieve is impossible though I guess there's a mild chance that an extension might be able to rescue me.

# Answer
> 1 votes
It does *not* fire if the field data is empty. You could probably use the `channel_entries_row` hook to modify your field value to show the default if blank. I wouldn't do this, though, as that hook will run on *every* channel:entries loop and can be quite expensive.

I'd suggest updating your database manually with the default value, and then change your FT's `save` method to add a default value if blank.

SQL to set a default value on an existing field (change XX to your actual field ID):

```
UPDATE exp_channel_data SET field_id_XX = 'your default' WHERE field_id_XX = '';

```

Save function setting a default if blank:

```
public function save($data)
{
    return $data ?: 'your default';
}

```

---
Tags: add-on-development, fieldtype
---


title: php cli & expression engine

text:
# Question
Title: php cli & expression engine
i just installed EE 2.8.0 on a server running php cli. It seems that this is causing issues with creating new templates & uploading files in general.

Hosting provider is not willing to make any changes. Any ideas?

# Answer
> 1 votes
This is a permissions problem unrelated to the original question as it was asked.

The solution is to set the read/write permissions for the template directory via FTP (or shell access) which will allow EE to create template files as required.

---
Tags: assets, file-uploads, hosting
---


# Question
Title: Parent page showing content from child page instead
I am using Structure to create and order the pages.

I am having an issue where the parent page is displaying the data of the child page instead of it's own data.

All 3 pages uses the same channel.

```
Parent
 - Child 1
 - Child 2

```

Eg instead of displaying the title `Parent` it is displaying `child 2`

```
 {exp:channel:entries channel="page" dynamic="off" url_title="{segment_2}" limit="1"}
   {title}
  {/exp:channel:entries}

```

# Answer
> 1 votes
Do not add url\_title, Structure places the right data for you.

---
Tags: channel-entries, structure, pages
---


title: Grid Field Type PHP Error

text:
# Question
Title: Grid Field Type PHP Error
I got the following error after using the grid fieldtype. I started over and it went away. However, it happened again the next day when I went in and add ed another row. Again, I starred over again and its working now. Any ideas on how to fix it? Running 2.8.1

# Answer
See this in the bug reports at ellislab.com : https://support.ellislab.com/bugs/detail/20284/when-going-to-edit-an-entry-with-a-grid-field-on-it-i-get-php-and-mysql-err

> Known Solution
>
> The problem happens when an extra empty column gets added to the grid. It has no name, no short name, no data at all. It’s impossible to add an empty column through the editor, but it looks like it’s cropped up due to some third party add-ons.
>
> Just delete the null column in the field editor (Admin- Channel Admin- Channel Fields) and you should be good.
> 0 votes

---
Tags: grid
---


title: Search: Simple Form

text:
# Question
Title: Search: Simple Form
I'm not sure what is happening. I have used the Simple Search successfully before but am not having any luck with it and EE 2.8.1. Hopefully someone can assist me with this as I'm sure I'm missing something simple :)

Snippet containing the simple search tag:

```
{exp:search:simple_form channel="blog" result_page="blog/search" search_in="everywhere" status="open" where="all" show_expired="yes" show_future_entries="yes"}
<input type="text" id="keywords" name="keywords" placeholder="Enter your search" class="pull-left">
<input type="submit" id="submit">
{/exp:search:simple_form}

```

Here's my `/blog/search` template which was taken directly from the documentation:

```
<table border="0" cellpadding="6" cellspacing="1" width="100%">
    <tr>
        <th>{lang:title}</th>
        <th>{lang:excerpt}</th>
        <th>{lang:author}</th>
        <th>{lang:date}</th>
        <th>{lang:total_comments}</th>
        <th>{lang:recent_comments}</th>
    </tr>

{exp:search:search_results switch="resultRowOne|resultRowTwo"}

    <tr class="{switch}">
        <td width="30%" valign="top"><b><a href="{auto_path}">{title}</a></b></td>
        <td width="30%" valign="top">{excerpt}</td>
        <td width="10%" valign="top"><a href="{member_path='member/index'}">{author}</a></td>
        <td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
        <td width="10%" valign="top">{comment_total}</td>
        <td width="10%" valign="top">{recent_comment_date format="%m/%d/%y"}</td>
    </tr>

    {if count == total_results}
        </table>
    {/if}

    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}

{/exp:search:search_results}

</table>

```

I'm attempting to search within a GRID field and have my Field Marked as Searchable as well as the column I want to search in. I have several Blog Entries setup with various content. Most of them have the word "Testing" in them yet when I search for that word I get no results.

What else could I be missing?

## #

What's also weird is that sometimes the "Error" page (which pulls in the User Message Template) has the Heading missing at times like so. I doubt it's related but still strange!

# Answer
> 3 votes
Looks like this was a FREEBIE issue. I set "search" to always parse and POOF! Thanks to Kevin @ Ellis Lab for the help on this one!

# Answer
> 0 votes
Try replacing search\_in="everywhere" with search\_in="entries" in the exp:search:simple\_form tag. I remember having problems with this with EE 2.8.1. Also try removing where="all".

I hope this helps

# Answer
> 0 votes
We had the same issue with our search form and it ended up being we had stickies turned off in our server, so our session was pointing to another server when we hit submit. Thus shooting this type of error because it was looking for something that didn't exist in that server. -- I hope this helps.

---
Tags: simple-search
---


title: load->view not working in some cases

text:
# Question
Title: load->view not working in some cases
I have a function in my module.php file:

```
public function evo_admin_pb() {
        $this->EE->load->library('db/cache_mproc', '', 'qodb');
        $this->EE->load->model('store');
        $this->EE->cp->set_breadcrumb($this->_base_url, lang('qo5_module_name'));
        $this->EE->cp->set_variable('cp_page_title', lang('evo_admin_pb'));

        $data = array(
            'pizza_type_form_action' => $this->_form_base . AMP . 'method=evo_select_pizza_type'
        );
        $data['_theme_base_url'] = $this->_theme_base_url;

        $results = $this->EE->db->query("SELECT type_extra_id, friendly_desc FROM exp_qo5_pbev_type_extras WHERE extra_type = 'Finisher' ORDER BY friendly_desc");

        if ($results->num_rows() > 0) {
            foreach ($results->result_array() as $row) {
                $data['finishers'][$row['type_extra_id']] =  $row['friendly_desc'];
            }
        }

        $data['crust_images'] = $this->get_asset_dir('evo_pb/crust/', '', TRUE);

        if(isset($_SESSION['evo_pb_admin_crust']) && isset($_SESSION['evo_pb_admin_size']) && isset($_SESSION['evo_pb_admin_finisher'])){
            $data['evo_selected_crust'] = $_SESSION['evo_pb_admin_crust'];
            $data['evo_selected_size'] = $_SESSION['evo_pb_admin_size'];
            $data['evo_selected_finisher'] = $_SESSION['evo_pb_admin_finisher'];
        }
        else if ($this->EE->input->post('action', TRUE) == 'edit') {
            error_log("edit");
            $data['evo_selected_crust'] = $this->EE->input->post('crust', true);
            $data['evo_selected_size'] = $this->EE->input->post('size', true);
            $data['evo_selected_finisher'] = $this->EE->input->post('finisher', true);
        }
        error_log("data going into view")        ;
        error_log(print_r($data, 1));
        return $this->EE->load->view('pizzabuilder/evo_admin_pb', $data, TRUE);
    }

```

The function is called two ways: first way is from a link that changes the URL directly so something like http://my\_site.com/ap.php?C=addons\_modules&M=show\_module\_cp&module=qo5&method=evo\_admin\_pb. This works correctly and loads the template as shown in the last line of the function.

The other way is from another javascript function:

```
function editCrustConfig(size, crust, finisher) {
    $.ajax({
            type : 'POST',
            url : EE.BASE + '&C=addons_modules&M=show_module_cp&module=qo5&method=evo_admin_pb',
            dataType : 'json',
            data: {
                action: 'edit',
                size: size,
                crust: crust,
                finisher: finisher
            }
        });
}

```

There are a series of HTML table rows generated in another view that each has a link which calls the js function like this: `javascript:editCrustConfig( 'M', 'H', 'MA')`. This doesn't work correctly, and I'm not sure why. `editCrustConfig` is running, and calling the `evo_admin_pb` function. It's getting all the way to the end of the function, and the error logging of the data being passed in to the view is correct. The only thing that isn't happening is the view actually loading.

What am I doing wrong? (We're on 2.5.2.)

# Answer
It's most likely a missing CSRF token that's tripping you up. You can test whether this is the cause by temporarily turning off Secure Forms in Admin \> Security & Sessions. If that is indeed the cause, try adding this to your data in editCrustConfig:

```
        data: {
            XID: EE.XID,
            action: 'edit',
            size: size,
            crust: crust,
            finisher: finisher
        }

```
> 1 votes

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


# Question
Title: Solspace Super Search - Blank results appearing in pagination
We display all the entries on our site using a Super Search loop inside an embed called results.html which we embed on the main page on our site. These display our posts by default, instead of using a standard channel entries tag... *(I think we originally took this approach as we were using AJAX searching, but we have since abandoned this and are just using standard searching now).*

We're trying to make Super Search search multiple channels (Teachers, Schools and Zoo Visitor), but we only want to display results for two of these channels (Schools and Zoo Visitor) when keywords are being searched for. This is because we don't want to have a list of posts populated by the less important content from these channels, but we still want to keep the channels searchable.

We have managed to get this working by using the setup outlined below, and more specifically, the following condition allows us to detect if keywords have been searched for and

```
{if:elseif channel_name == 'schools' && segment_2 == "search&keywords={super_search_keywords}"}

```

and

```
{if:elseif channel_name == 'zoo_visitor' && segment_2 == "search&keywords={super_search_keywords}"}

```

This is working! However, at the last hurdle, we're running into a final problem where we get blank results when no search has been run (i.e. keywords). It seems the channels which we are ignoring when no search has been run because of the condition above (Schools and Zoo Visitor), seem to be being counted in the pagination.

So our first page of results contains one entry and then the second page has a whole load of entries from the Teacher channel etc...

How can we get round this and stop these channel results being counted in the pagination?

Thanks for your time!

**--------------------- results.html ---------------------**

```
{exp:super_search:results channel="teachers|schools|zoo_visitor" status="not closed" orderby="date" sort="desc" limit="29" author_indicator="screen_name" keyword_search_author_name="yes" paginate="bottom" status="Members-id5|Members_Verified_-id6|Members_Pro-id7|open"}

  {if super_search_no_results}
     Sorry, no results message...
  {/if}

  {if channel_name == 'teachers'}

  <article>

    {title}

  </article>

{if:elseif channel_name == 'schools' && segment_2 == "search&keywords={super_search_keywords}"}

      <article>

      {title}

      </article>

  {/if}

    {if:elseif channel_name == 'zoo_visitor' && segment_2 == "search&keywords={super_search_keywords}"}

      <article>

      {exp:zoo_visitor:details}

      {member_lastname}

      {exp:zoo_visitor:details}

      </article>

  {/if}

{paginate}
Page {current_page} of {total_pages}   {pagination_links}
{/paginate}

{/exp:super_search:results}

```

# Answer
> 0 votes
**Summary**: display searched entries from 3 channels if a keyword search was conducted, and display entries from 2 channels if keyword search was not conducted yet.

There may be other solutions, but one way could be to use `{super_search_keywords}` in a conditional to control both situations. You could, for example:

```
{if super_search_keywords == ""}
    {exp:super_search:results channel="channel_1|channel_2"}
        // Your data
    {/exp:super_search:results}
{/if}

{if super_search_keywords != ""}
    {exp:super_search:results channel="channel_1|channel_2|channel_3"}
        // Your data
    {/exp:super_search:results}
{/if}

```

Since you can use `{super_search_keywords}` *inside* `{exp:super_search:results}` as well (see http://www.solspace.com/docs/super\_search/results/#variables), you could do this:

```
{exp:super_search:results channel="channel_1|channel_2|channel_3"}
    {if super_search_keywords == ""}
        // Your conditionals for channels 1 & 2
        // No need for a funky conditional for checking segment_2
    {/if}

    {if super_search_keywords != ""}
        // Your conditionals for channels 1 & 2 & 3
        // No need for a funky conditional for checking segment_2
    {/if}
{/exp:super_search:results}

```

Other `{exp:super_search:results}` parameters were omitted above for clarity.

---
Tags: solspace, pagination, supersearch
---


# Question
Title: Objective HTML, Google maps info window height and width
I am using Objective HTML Google Maps i have a title getting pulled through on my map markers when they are clicked it displays the info window, how can i increase the size of the info box window because at the moment the info box is too small and i have to scroll to see all the text.

```
{exp:gmap:marker id="map" latitude="{latitude}" longitude="{longitude}" clustering="true"}
<a href="{page_uri}">{title}</a>
{/exp:gmap:marker}

```

Thanks.

# Answer
You can use CSS to change the info window size and styling as needed.
> 1 votes

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


# Question
Title: Simple Search and Grid field not returning results
EE v2.8.1 - Build Date: 20140314

I have a Grid field that is set to searchable, the columns are also set to searchable. It is in the about channel and is populated using the pages module. I have a simple search form and I continue to get '0' results. I even went so far as to specify the exact channel of the entry I was testing, copy and paste the text from the entry form itself, and still I return nothing.

I went into the field to re-save the field type thinking something was "off". I then went into the entry and re-saved the entry to make sure nothing was "out-of-sync".

My simple form is here:

```
            {exp:search:simple_form
                channel="about"
                where="any"
                form_id="searchForm"
                result_page="search/results"
                no_result_page="search/no-results"
                results="20"
                show_future_entries="no"
                status="open"
            }
                <div class="input-group">
                    <input type="text" class="form-control search" name="keywords" id="keywords" value="" placeholder="Search...">
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-default"><i class="icon icon-search"></i></button>
                    </span>
                </div>
            {/exp:search:simple_form}

```

I am currently using this to see what is returned, if anything.

```
            <h2>Your search for <em>{exp:search:keywords}</em> had <em>{exp:search:total_results}</em> results.</h2>

```

Am I doing something wrong here? I've never fought something so simple for so long.

*** EDIT ***

I have done some further testing with a new channel, new fieldset, and new entries. It appears that the rich text field inside of the grid is NOT being included in the search. I have ALL searchable fields selected and am not able to return any results from these entries.

# Answer
> 3 votes
WOW!!! I feel a little embarrassed on this one. I will still post the answer since I have seen several other posts in various sites, be it EllisLab support, here, or others. Another fine example of forgetting something very simple and why reviewing the docs on a regular basis is a great idea. ;)

Adding the following allowed the search of the entry inside the context of that entry:

```
  search_in="entries"

```

Per the docs:

> **search\_in=**
>
> search\_in="entries", search\_in="everywhere", search\_in="titles"
>
> This parameter specifies which fields you would like to include in the searching. There are three possible values:
>
> ***entries***: The search will be conducted in the entry fields and titles of your channel. The associated comments will not be included.
>
> ***everywhere***: The search will be conducted in the title, entry fields, and in associated comments.
>
> ***titles***: The search will be conducted in the title of your entries. The channel entry fields and any associated comments will not be included. If this parameter is not set, the search will default to only search by “titles”.

*** CONCLUSION *** Changing my search tag to the following worked:

```
            {exp:search:simple_form
                channel="not bogus"
                search_in="entries"
                where="any"
                form_id="searchForm"
                result_page="search/results"
                no_result_page="search/no-results"
                results="20"
                show_future_entries="no"
                status="open"
            }

```

*** ADDED BONUS *** If you would like to search in all channels of the site and don't want to worry about forgetting to go back and add one to your search parameters later, if a channel is added, add the following to your search parameters:

```
channel="not bogus"

```

By using the ***not*** in conjunction with a channel name not used, you will search in all channels not named that. Then you simply have to set your searchable flags accordingly in your field sets.

---
Tags: ee2, search, simple-search, no-results
---


# Question
Title: Why is Simple Search not getting results from the Grid field in 2.7.2?
I have a site setup with a search box. The search looks in a channel field made with Grid. For some reason the results are not being displayed from the Grid, even though all other channels work as planned. Is this a bug in 2.7.2?

# Answer
I've run into a very similar instance in which I didn't specify `search_in="entries"` as a parameter so that the search runs into the entry fields rather than just the titles.

Without seeing your search form code, it is hard to say, but it sounds like this is your issue. If you are expecting to see results from content inside custom fields and aren't seeing it, try entering a search term for the title of your entry. If it yields results, change your search form to include the above parameter and try again. ;)

Per the docs:

search\_in=¶

> **search\_in**="entries", **search\_in**="everywhere", **search\_in**="titles" This parameter specifies which fields you would like to include in the searching. There are three possible values:
>
> ***entries***: The search will be conducted in the entry fields and titles of your channel. The associated comments will not be included.
>
> ***everywhere***: The search will be conducted in the title, entry fields, and in associated comments.
>
> ***titles***: The search will be conducted in the title of your entries. The channel entry fields and any associated comments will not be included. If this parameter is not set, the search will default to only search by “titles”.
> 0 votes

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


# Question
Title: SQL Query to get entries with their categories
I have the following query that is grabbing entries, but I would also like a 'categories' column that will show a pipe seperated list of the categories assigned to each entry.

I have tried using CONCAT\_WS as below, but the results just duplicate each entry for every category assigned to that entry. I was wondering if someone could tell me where I'm going wrong?

```
SELECT exp_channel_data.entry_id AS entry_id, exp_channel_titles.title AS title, exp_channel_titles.url_title AS url_title, CONCAT_WS('|',cp.cat_id) AS categories
FROM exp_channel_data
LEFT JOIN exp_channel_titles ON exp_channel_titles.entry_id = exp_channel_data.entry_id
LEFT JOIN exp_category_posts AS cp ON exp_channel_data.entry_id = cp.entry_id
LIMIT 100

```

# Answer
I believe this is what you're looking for:

```
SELECT exp_channel_data.entry_id AS entry_id, exp_channel_titles.title AS title, exp_channel_titles.url_title AS url_title, GROUP_CONCAT(cp.cat_id SEPARATOR '|') AS categories
FROM exp_channel_data
LEFT JOIN exp_channel_titles ON exp_channel_titles.entry_id = exp_channel_data.entry_id
LEFT JOIN exp_category_posts AS cp ON exp_channel_data.entry_id = cp.entry_id
GROUP BY entry_id
LIMIT 100

```
> 6 votes

---
Tags: mysql, query
---


# Question
Title: Is it possible to attach a PDF to user notifications in Freeform Pro
Is it possible to send a user notification with a pdf attached to users who fill in a form via Freeform Pro?

It would be the same pdf for every user (terms and conditions for a site i'm working on)

I thought a way round it might be to have it as a hidden field on the form and create a file upload field within that form. As I can see that it is possible to add attachments to the user notification if any files are uploaded when the form is submitted. But the problem would be that forms would take a little longer to submit for the user and I'd end up with potentially hundreds of copies of the pdf on the system.

Could anyone offer any advice or solution? Thanks.

# Answer
I don't think it's possible to do this but you can approach it in a different way which would probably be less problematic in the long run too.

PDFs really bulk up the size of email and are a highly ranked trigger for spam filters. Because of this, you'd most likely end up with delivery problems.

Since you say the PDF would be the same for all users, a different, and possibly better solution, would be to include a link to the PDF which would be hosted on your site somewhere (it can be hidden away). That way you aren't sending a comparatively large file in a small email and thus running less risk of tripping a filter.

A second approach might be to simply include the T&Cs as text within the email. Is there a specific reason it needs to be a PDF?
> 0 votes

---
Tags: solspace-freeform, file-uploads
---


# Question
Title: Get Filesize when using Matrix flle field
How do you get the filesize of the file when using Matrix?

```
{downloads}
  {download_name} {file_size} {size}
{/download}

```

returns

```
Download name {file_size} {size}

```

Thanks

# Answer
It looks like you need to use the particular file as a tag pair around file\_size. Something like this:

```
{downloads}
  {download_name} {download_file}{file_size}{/download_file}
{/downloads}

```
> 0 votes

---
Tags: matrix
---


# Question
Title: Can SuperSearch use Matrix fields in {excerpt}?
I am using SuperSearch with "Use Smart Excerpts?" set to "Yes", and a Matrix field with "Is field searchable?" set to "Yes". My search results contain pages with matrix field content as expected. However, the contents of the Matrix fields do not appear in the {excerpt} output. Is there a way to do this?

thanks!

# Answer
> 0 votes
Answering my own question:

Each channel has its own setting for the field used by {excerpt} under *Admin \> Channels \> Edit Preferences \> Which field should be used for search excerpt?*. Matrix field types can be selected and used like any other type.

However, using a Matrix field here does give erratic results compared to a textfield. The excerpt sometimes starts with the search term, truncating content before it. Other times it makes no truncation and just prints the first X characters of all tabs combined instead, even if they don’t include the search term. Sometimes it doesn't bold the search term.

---
Tags: matrix, supersearch
---


# Question
Title: All CartThrob settings screens are white screened
About a month I was working on a client site and was able to access and edit all of the CartThrob settings screens, including Shipping, Taxes, and Payments. Now, as of last week, whenever I try to access any of them they are all white screens. No changes were made to system files in that time (i.e. no commits to the repo).

I have turned on all debugging with no results and upgraded all the plugins and extensions that I can with no change.

This was originally on an EE 2.7.2 platform, so I tried a direct upgrade to the latest 2.9.0 and was completely unable to access the control panel due to the following error: `An Error Was Encountered. Unable to load the requested class: services_json` Unable to resolve that issue I reverted back to 2.7.2 and tried the next sequential update to 2.7.3. That update worked but the CartThrob settings pages are still white screened. I've emailed EllisLab to request the install files for 2.8.0 to try the next sequential update.

I can't find any reference to conflicts between CartThrob and another extension but maybe someone here has come across something before. Here's a list of current modules:

Extensions:

and Plugins:

# Answer
> 0 votes
It turns out I missed the devot:ee Monitor accessory, and in looking to upgrade that one came across this blog post from devot:ee that Monitor has been retired.

As soon as that was uninstalled, I was again able to access CartThrob.

It seems like there should be a better, faster way to determine which extensions are causing conflicts. Is this something that should be integrated in each extension (in this case, CartThrob) or in EE itself?

---
Tags: cartthrob, white-screen-of-death
---


title: Playa - If no parent conditional

text:
# Question
Title: Playa - If no parent conditional
I'm using Zoo Visitor and Playa.

I have tried lots of different conditionals for "if no playa parent" to show the title of a parent entry for a Zoo Visitor member.

I'd like to display something else if there is no parent. However, can't seem to find a technique that works. Techniques 1, 2 and 3 all print out the parent title, but they don't print out the else condition.

Any solutions or ideas would be much appreciated.

Thanks!

**1)**

```
{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"}

{if count == 1}

    {title}

{if:else}

    Do something else

{/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

```

**2)**

```
{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"}

    {if count > 0}

        {title}

    {if:else}

        Do something else

 {/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

```

**3**

```
{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"}

{if {exp:playa:total_parents} > 0}

    {title}

{if:else}

    Do something else

{/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

```

**4)** Doesn't even echo out the title

```
{exp:zoo_visitor:details}
{exp:playa:parents channel="channel_name"}

     {if total_parents == 1}

            {title}

    {if:else}

            Do something else

   {/if}

{/exp:playa:parents}
{/exp:zoo_visitor:details}

```

# Answer
This should work:

```
{if total_results > 0}
    {title}
{/if}

{if no_parents}
    Something else
{/if}

```
> 0 votes

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


# Question
Title: Expresso store checkout process - shipping city and postal code validation (disallowed characters)
It looks like Expresso store during the checkout process allows to use disallowed characters in postal code and city fields for shipping. Also postal code allows to put only 2 characters when shorter in the world is 3 digits. It creates problems when UPS or FedEx modules are used for shipping calculation.

Any clue how to limit postal code when shipping is only in the States and validate city name if doesn't contains numbers etc?

Thanks

# Answer
> 1 votes
There are a couple of ways that you can validate your fields. You could use HTML5 validators such as `number` for zip codes. Something along the lines of

```
<input type="number" name="billing_postcode" maxlength="5" minlength="5" >

```

Personally though I prefer using the CodeIgniter Styled Validation Rules:

```
{exp:store:checkout
 rules:billing_postcode="required|numeric|min_length[5]|max_length[5]"
 rules:billing_city="min_length[3]|alpha"
 rules:phone="numeric" {!-- this would be applied to both shipping and billing fields --}
}

```

(Store documentation on Rules.)

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


# Question
Title: Expresso Store: Add PDF attachement to order confirmation emails
Is it possible to add an attachment to the order confirmation email in expresso store?

The attachment is just a generic terms and conditions type thing. So will be the same for all orders.

Thanks Dave

# Answer
You would need to create an extension if you wanted to include the PDF as an attachment.

I have done something similar in the past with PDF Press and a link in the email that when clicked would direct to a specific template (using the order hash) that would create the PDF and start the download.
> 1 votes

---
Tags: expresso-store, email, 2.8
---


# Question
Title: Low Search shortcut not setting default values in form or param
I'm starting to get the hang of Low Search, but am still running into a bit of confusion.

So, I have my `{exp:low_search:form}` and `{exp:low_search:results}` tags up and working fine. When I search, for instance, using keywords, the resulting page has my keyword in the keywords field, and my `{exp:low_search:param get="keywords" query="{segment_3}"}` tag is outputting the keyword, and my search results are valid.

However, if I create a shortcut for that exact search (created from the search log), my search results work fine, but my form doesn't have the values selected, and my param tag doesn't output anything...

Am I missing something, or is this just not yet a feature of Low Search? If I'm using a shortcut, how can I access the search parameters used so that I can have my field defaults set, and how can I display the params outside of the results tag?

I am using EE 2.9.0 and Low Search 3.2.0.

Thanks!

EDIT: Here is my `{exp:low_search:form}` tag in it's entirety... My url is like `/library/search/helen/`. I am seeing the correct search results in my results tag for this shortcut, but cannot set the pre-selected form fields for this search...

```
{exp:low_search:form
    query="{segment_3}"
    shortcut="{segment_3}"
    result_page="library/search"
    form_id="search"
    }
    <fieldset>
        <div class="form-group">
            <label for="keywords" class="the_label">Keywords</label>
            <input type="search" name="keywords" class="form-control" value="{low_search_keywords}" placeholder="Keywords">
            {if low_search_keywords_missing} Please enter keywords{/if}
            <input type="hidden" name="collection[]" value="library_content">
            <input type="hidden" name="loose_ends" value="right">
            <input type="hidden" name="search_mode" value="auto">
        </div> <!-- /.form-group -->

        <div class="form-group">
            <label for="keywords" class="the_label">State / Territory</label>
            <select name="search:library_state_territory" id="option" class="form-control">
              <option value="">-- Select State / Territory --</option>
              {exp:low_options:library_state_territory channel="library_content"}
                {if option:group != ''}<optgroup label="{option:group}">{/if}
                {options}
                  <option value="{option:value}"{if option:value == low_search_search:library_state_territory} selected{/if}>
                    {option:label}
                  </option>
                {/options}
                {if option:group != ''}</optgroup>{/if}
              {/exp:low_options:library_state_territory}
            </select>

        </div> <!-- /.form-group -->

        <div class="form-group">
            <label for="tag-group-2" class="the_label">Type</label><br />
            <select name="tag_name:group2[]" id="tag-group-2" size="5" multiple class="form-control">
              {exp:tag:cloud groups="1" tag_group_id="2"}
                <option value="{tag_name}"{if low_search_tag_name:group2 ~ '/(^|\|)'.tag_name.'($|\|)/'} selected{/if}>
                  {tag}
                </option>
              {/exp:tag:cloud}
            </select>
        </div> <!-- /.form-group -->

        <div class="form-group">
            <label for="date_range" class="the_label">Date range</label>

            <div class="input-daterange input-group" id="datepicker">
                <input type="text" class="input-sm form-control" name="range-from:library_date_published" value="{low_search_range-from:library_date_published}"/>
                <span class="input-group-addon">to</span>
                <input type="text" class="input-sm form-control" name="range-to:library_date_published" value="{low_search_range-to:library_date_published}"/>
            </div>

        </div> <!-- /.form-group -->

        <div class="form-group">

            <label for="tag-group-4" class="the_label">Population Group</label><br />
            <select name="tag_name:group4[]" id="tag-group-4" size="5" multiple class="form-control">
              {exp:tag:cloud groups="1" tag_group_id="4"}
                <option value="{tag_name}"{if low_search_tag_name:group4 ~ '/(^|\|)'.tag_name.'($|\|)/'} selected{/if}>
                  {tag}
                </option>
              {/exp:tag:cloud}
            </select>

        </div> <!-- /.form-group -->

        <button type="submit">Search</button>
    </fieldset>
{/exp:low_search:form}

```

Also, I have these tags set up to display the currently used search filters... but they don't work with the shortcut either.

```
<div id="active-search-filters-container" class="clearfix">
    <label class="pull-left">Search Parameters:</label>
    {if '{exp:low_search:param get="keywords" query="{segment_3}" shortcut="{segment_3}"}' != ''}
        <div data-member-id="1" class="search-parameter keyword">
            <button type="button" class="btn btn-default btn-xs">
                <strong>Keyword(s):</strong> {exp:low_search:param get="keywords" query="{segment_3}"}
                {!--<span class="glyphicon glyphicon-remove"></span>--}
            </button>
        </div>
    {/if}
    {if '{exp:low_search:param get="search:library_state_territory" query="{segment_3}" shortcut="{segment_3}"}' != ''}
        <div data-member-id="1" class="search-parameter state">
            <button type="button" class="btn btn-default btn-xs">
                <strong>State:</strong> {exp:low_search:param get="search:library_state_territory" query="{segment_3}"}
                {!--<span class="glyphicon glyphicon-remove"></span>--}
            </button>
        </div>
    {/if}
    {if '{exp:low_search:param get="range-from:library_date_published" query="{segment_3}" shortcut="{segment_3}"}' != ''}
        <div data-member-id="1" class="search-parameter date-range">
            <button type="button" class="btn btn-default btn-xs">
                <strong>Date Range:</strong> {exp:low_search:param get="range-from:library_date_published" query="{segment_3}"}
                {if '{exp:low_search:param get="range-to:library_date_published" query="{segment_3}"}' != ''}
                    - {exp:low_search:param get="range-to:library_date_published" query="{segment_3}"}
                {/if}
                {!--<span class="glyphicon glyphicon-remove"></span>--}
            </button>
        </div>
    {/if}
    {if '{exp:low_search:param get="tag_name:group2" query="{segment_3}" shortcut="{segment_3}"}' != ''}
        <div data-member-id="1" class="search-parameter type">
            <button type="button" class="btn btn-default btn-xs">
                <strong>Type:</strong> {exp:low_search:param get="tag_name:group2" query="{segment_3}"}
                {!--<span class="glyphicon glyphicon-remove"></span>--}
            </button>
        </div>
    {/if}
    {if '{exp:low_search:param get="tag_name:group4" query="{segment_3}" shortcut="{segment_3}"}' != ''}
        <div data-member-id="1" class="search-parameter pop-group">
            <button type="button" class="btn btn-default btn-xs">
                <strong>Population Group:</strong> {exp:low_search:param get="tag_name:group4" query="{segment_3}"}
                {!--<span class="glyphicon glyphicon-remove"></span>--}
            </button>
        </div>
    {/if}
</div> <!-- /#active-search-filters-container -->

```

# Answer
> 1 votes
You need to include the parameter shortcut="\[shortcut name\]" in your {exp:low\_search:results} tag. The value can be taken from your url segments.

e.g.

If the url was www.mysite.com/search/bacon and you had a shortcut set up for "bacon" then your search results tag would be

```
{exp:low_search:results shortcut="{segment_2}"}

```

You can combine this with the regular query parameter. A site I am currently working on has this:

```
{exp:low_search:results
    query="{segment_2}"
    channel="products"
    limit="18"
    paginate="bottom"
    dynamic="no"
    orderby="title"
    sort="asc"
    status="not closed"
    cache="yes"
    refresh="120"
    disable="member_data"
    require_all="category"
    shortcut="{segment_2}"
}

```

Which might be overkill, but works a treat!

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


title: Check field length

text:
# Question
Title: Check field length
I want to display one field, called {gearboxx\_body}, unless that field has more then 300 characters, in which case I want to display a field called {article\_blurb}. I'm pretty sure there isn't a way to do this just in EE fields and conditionals, so I tried some PHP, which I'm just starting to learn:

```
<?php

  $info = array('{gearboxx_body}','{article_blurb}');

  if(mb_strlen($info[0]) <= 300)
    echo($info[0]);
  }

  else {
   echo($info[1]);
  }

?>

```

So that works well, but there's a problem. If the tag includes any apostrophes or quote marks, it ends the string and the page won't load. So what can I do about this? I've tried to replace the quote marks in the string, but I have to have loaded the string from the fields first, and as soon as I do that the page is already broken.

Hopefully that made sense. Any suggestions?

EDIT: I should also mention that I **do not** want to install an external plugin.

# Answer
You say you don't want to do this with a plugin but the fact is that it's the best way to do it. Not least because you can avoid the problem you have with Parse order.

The plugin needs a single line of PHP In the constructor, and returns a number;

```
public function __construct() {
    $this->EE =& get_instance();

    return strlen($this->EE->TMPL->tagdata);
}

```

That's it.

You can quickly get the framework for your own plugin from http://pkg.io

Then you can use it like so

```
{if "{exp:stringlength}{my-custom-field}{/exp:stringlength}" > 200}
    More than 200 characters
{if:else}
    Less than 200 characters
{/if}

```

Because you are effectively outputting the field contents to your template and **then** getting its length you avoid the problem of characters prematurely terminating the comparison.

\** Update \** In a quiet moment I wrote a quick and dirty plugin to provide a wrapper around PHP's strlen() function which might prove useful in this case. http://devot-ee.com/add-ons/stringlength
> 1 votes

---
Tags: php, fields
---


# Question
Title: The form you submitted contained the following errors
I am a new user of Expression Engine and the version I am using is 2.5.2 and whenever I try filling the contact us form unto submission, I have the following error.

Kindly note that CAPTCHA is not enabled and I dont know what else might be the problem.

Can you point me in the right direction?

Another issue is that, the CAPTCHA Image is not coming up.

While trying to save a change made under the CAPTCHA preferences, I got the error message below;

# Answer
If CAPTCHA is enabled and the image isn't showing then it could be a couple of things.

1. Your CAPTCHA directory isn't writeable so EE can't create the image.
2. You don't have the CAPTCHA code in your form.

Since you are getting the error message I would guess that it's option 1.

But, **please post your template code** otherwise it's all guesswork on our part.
> 1 votes

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


# Question
Title: Restrict Low Search toggles to one selection per group
We have a channel with categories that we are filtering on using Low Search, some of the category groups in which assignments are made for an entry are exclusive, i.e. the entry can only ever belong to one category in that group (Country for example).

We need to let users toggle categories on and off to filter results (Show me all mills in 'England' which are 'Water' mills) but we do not want to allow a user to apply multiples in certain categories (Show me all mills in 'England AND Scotland' which are 'Water' mills).

```
{exp:low_search:filters query="{segment_3}"}
    <ul>
        <li>Countries
            {exp:gwcode_categories
                id="FilterCountries"
                group_id="9"
                show_empty="no"
                orderby="cat_name"
                parse="inward"
                style="nested"
                }
                <li {if cat_id IN ({low_search_category})}class="current_filter"{/if}>
                    <a href="{low_search:url result_page='/results' toggle:category='{cat_id}'}">{cat_name}</a>
                </li>
            {/exp:gwcode_categories}
        </li>

```

We then repeat the list item for each category group we are using, so we have subsequent groups as per the above for 'Power Sources', 'Rivers' and 'Types'. Some of these (Type for example) may have more than one category assignment so we need a solution that allows us to restrict the additive toggle 'per group'.

Any ideas?

# Answer
> 2 votes
First of all, instead of using a single `category` parameter for all groups, try giving each group its own parameter using Category Groups. So, for example, use `category:sources`, `category:rivers` and `category:types`.

Each group parameter like that will be combined with AND, as per usual with parameters. But for each group, you can choose to either have *any* or *all* categories match, by using the `require_all` parameter.

Also, per group and using the URL tag, you can choose to either set the entire value, or toggle a value. Toggling a param value will look at the parameter, if the given value is not present, LS will add it, and vice versa. But *not* using `toggle:` will set the entire param to the given value.

I'm assuming you're using multiple gwcode\_categories tags to output the different groups. As an example, using native tags:

```
{exp:low_search:filters query="{segment_2}" result_page="search"}

    {!-- Allows you to select multiple categories in this group --}
    {exp:channel:categories category_group="1"}
        <a href="{low_search:url toggle:category:group1="{category_id}"}">{category_name}</a>
    {/exp:channel:categories}

    {!-- Will only select a single category in this group --}
    {exp:channel:categories category_group="2"}
        <a href="{low_search:url category:group2="{category_id}"}">{category_name}</a>
    {/exp:channel:categories}

{/exp:low_search:filters}

```

# Answer
> 1 votes
Could you use Javascript/jQuery to disable or remove links within one category group if any of the other categories in that group are selected?

I did something the other day with jQuery to look within a list of links and open the group if there was a selected filter in that group. I imagine that it would be quite similar to what you want to do.

Each of my filter groups is being output like this (this is group 6):

```
{exp:channel:categories channel="products" category_group="6"}
    {if count ==  1}<h4 class="filter closed">Product type</h4>
    <ul class="filter-set">{/if}
        <li{if '{low_search_category}' ~ '/(^|\|)'.category_id.'($|\|)/'} class="selected"{/if}>
           <a href="{low_search:url toggle:category='{category_id}'}">{category_name}</a>
        </li>
    {if count == total_results}</ul>{/if}
{/exp:channel:categories}

```

So if a particular filter is selected, its parent li gets the class "selected".

I've then got some jQuery which does this;

```
$('.filter-set').find('.selected').parent().slideDown();

```

This 'opens' the list if there is a selected item within it.

So to get the other filters in a list we could do

```
$('.filter-set').find('.selected').siblings('li');

```

Now, to get rid of the links is a bit more tricky. I think you'd need a function that took the link text, removed the link node and then wrote the link text back in. Of course, you'd need to do the reverse when the selected filter was deselected.

There must be a simpler way of doing that bit though...

How about (not tested)...

```
$('.filter-set').find('.selected').siblings('li').find('a').removeAttr('href');

```

---
Tags: categories, low-search
---


title: Keeping Expression Engine DB's In Sync

text:
# Question
Title: Keeping Expression Engine DB's In Sync
We have a very large EE installtion for one of our clients.

Our server set up / workflow is Local \>\> Staging \>\> LIve

We need to carry out some work for the client. So we pull the database and files down from live. We make the changes and then we push the database and templates from staging back up to live.

HOWEVER in doing this, if the client has added anything else to live while we were working on staging, this is lost when we push the database and templates back up and overwritten with our version.

What work flows do people have for getting round this?

# Answer
> 2 votes
I typically make database changes on the live site and then copy that from live to live to staging/local and then do templates/css/js work before pushing it back to staging/live.

This has worked well for me. The only way that I would see it not working is if the database changes that needed to be made would affect the live site on the front end. But typically creating new fields/channels will not affect the live site until the template changes are made.

If it is absolutely crucial you could request a content freeze from the client while doing your work.

# Answer
> 1 votes
We are using a method where any changes we make to the dev database are logged to a file, and then we can just run those same sql queries against the production database to update it. Here's a plugin that offers to do the logging for you, though I can't personally vouch for it.

https://github.com/fccotech/ee-db-trace

# Answer
> 0 votes
One option we have discussed is for example..

07:55-08:00 - Content team freeze working. Dev team pulls down database to staging
08:00-15:00 - Dev team exclusively works on the staging site
15:00-15:05 - Dev team push up to production
15:00-08:00 - Content inputers enter content on production as they please till the following morning

---
Tags: database, sync
---


# Question
Title: Using Datagrab module with Structure and blueprints, it is throwing error on edit channel entry
I am having a CSV file and i am using Datagrab module to importing CSV for a channel (eg: XYZ) . It works fine.

Also i am using Structure and blueprints module in my project. After successful CSV import, when i access the channel (named as eg: XYZ), it is showing that entries BUT when i edit a entry then i am getting following errors :

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: 4318
Filename: blueprints/ext.blueprints.php
Line Number: 174

A PHP Error was encountered
Severity: Notice
Message: Undefined index: 4318
Filename: structure/tab.structure.php
Line Number: 164

```

How can i remove the errors?

# Answer
> 0 votes
Make sure you're running the latest version of Structure and EE, otherwise you'll need to test adding entires without datagrab and see if that's the issue. If they stay, please start a Structure support ticket.

---
Tags: channel-entries, structure, datagrab, csv
---


title: Assets within a relationship field

text:
# Question
Title: Assets within a relationship field
I have tried everything I can think of, but can't get an assets field to output from a relationship.

```
{suggested_products}
    {suggested_products:product_images}
        {product_images:url}
    {/suggested_products:product_images}
{/suggested_products}

```

I found a few other threads on here, but none of the suggestions worked: Assets 2 field not working properly within 2.6 relationship

I am using EE 2.8.1 with Assets 2.4

Can anyone show me where I am going wrong here?

# Answer
> 1 votes
I had the exact same problem. And I might have the solution for you:

```
{suggested_products}
    {suggested_products:product_images parse="inward"}
        {url}
    {/suggested_products:product_images}
{/suggested_products}

```

---
Tags: assets, relationships
---


title: MySQL Script to identify old accounts

text:
# Question
Title: MySQL Script to identify old accounts
Need help with creating a MySQL query to create a list of users that have not logged into the site within the past 6 months.

Needs to contain Username, Email address and last login date.

Will use the list to send email regarding upcoming site purge.

Can use the CP and see them, but need to export to a XLS or CSV file.

Thanks!

# Answer
Using 60 seconds × 60 minutes × 24 hours × 30 days × 6 months:

```
SELECT username, email, last_visit
FROM exp_members
WHERE (UNIX_TIMESTAMP(NOW()) - last_visit) > (60*60*24*30*6)
ORDER BY username
LIMIT 2000

```

Using 600000000 as MDDHHMMSS:

```
SELECT username, email, last_visit
FROM exp_members
WHERE ((NOW() + 0) - (FROM_UNIXTIME(last_visit) + 0)) > 600000000
ORDER BY username
LIMIT 2000

```

I used `NOW() + 0` to convert dates like `2007-12-15 23:50:26` to `20071215235026.000000`.

It possible to have little differences on the results of both queries, due to its precision, but it shouldn't be a problem if you want to run them more than one time.

If you customized the table prefix, you gonna need to adapt the query.

You can use this query to create a template which lists this users.
> 1 votes

---
Tags: mysql, users
---


# Question
Title: DevDemon Forms - On form submit, URL is stripping out the : from the http://
Using DevDemon forms. Have used before on other sites. When click submit, its stripping out the : from the http:// on the redirect. Any ideas where this is stored as it seems to be taking a default value from somewhere. Have tried to override with return="/contact/thanks" but not recognising this. Thanks in advance. Steve

# Answer
Currently forms doesn't support external redirects. You need to redirect to a template and on that template redirect to an external site.

If you are trying to redirect to an internal page and it isn't working you should contact our support as there might be an issue with your htaccess.
> 1 votes

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


# Question
Title: Channel Forms - How to set Custom Form attributes
How do I set custom form attributes for `{exp:channel:form}` tag?

I want to set this attribute `role="form"`

# Answer
This plugin does that, but I don't think it supports the role param. It would be real easy to add though.

https://github.com/jazonv/SafeCracker-HTML5-Attributes
> 1 votes

# Answer
If you are using Channel Forms (EE 2.7+), than this should work for you: https://github.com/tobystokes/EE-SafeCracker-HTML5-Attributes
> 0 votes

---
Tags: channel-form
---


# Question
Title: How to exclude a category within channel:form
I am using the following code within channel:form on EE 2.9

Categories: {category\_menu} {select\_options} {/category\_menu}

The issue is that all my categories show up, I would like the limit it to one of my categories.

I have tried using category\_group and category="5" but nothing worked.

thanks in advance

# Answer
According to the documentation you should be able to set `category="5"` take a look at the bit about parameters.

Please update your question with your template code.
> 1 votes

# Answer
If you don't want people to be able to choose categories in your channel form, you can just use the category="y" parameter in your channel form tag as Mark said:

```
{exp:channel:form category="y"...}

```

But, if you do still want to show a select menu etc: It's not documented from what I can see, but you can use the show\_group parameter within the categories tag (an alternative to the category\_menu tag see https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/index.html#categories).

Then you could use a conditional within that to only output a certain category. Try the following code:

```
{categories show_group="x"}
{if '{category_id}' == y}
 <option value="{category_id}"{selected}>{category_name}</option>
{/if}
{/categories}

```

There may well be another parameter for the categories tag which just lets you limit to a particular ID directly without looping.
> 0 votes

# Answer
Try this:

```
{category_menu}
<select name="category[]" size="10" multiple="multiple">
{exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE group_id='5'"}
<option value='{cat_id}'>{cat_name}</option>
{/exp:query}
</select>
{/category_menu}

```

In the past, I've tried different versions of category\_group=”#” or cat\_id=”#” or category=”#”, but all versions returned all categories.
> -1 votes

---
Tags: categories, safecracker
---


title: MSM - Only super admin can switch sites

text:
# Question
Title: MSM - Only super admin can switch sites
I'm running MSM on MAMP PRO and I though everything was setup correctly.

I have configured 3 sites, and when logged into the CP using the super admin account, I can switch between them without a problem.

However when logged in with a member assigned to another member group (which as far as I can see has pretty much all the same privileges as the SA), switching between sites no longer works.

Instead I just get "An Error Was Encountered - You are not authorized to access this page"

Any idea as to where I can start looking to fix this?

Thanks!

# Answer
Apologies. I think the issue has been solved. I set all 3 sites to cookies only, cleared the browser and now it appears to be working.
> 0 votes

---
Tags: multi-site-manager
---


title: Link to CPanel from templates

text:
# Question
Title: Link to CPanel from templates
From my templates, I want to link to my CPanel. The template is only accessible by those who do have permission to access the CPanel. How do I link to the CPanel from the template? The URL I see generated when I log in seems to include a session id.

# Answer
> 4 votes
Starting from version 2.8.0 you can use standard global variable for this

```
{cp_session_id}

```

if you want to make link to edit entry, don't forget about special tag for this which available from version 2.9.0

```
{cp_edit_entry_url}

```

You can also output the cp main url (like example.com/admin.php) using global variable (from ee 2.8.0)

```
{cp_url}

```

# Answer
> 0 votes
You can get the session id via PHP by using

```
$this->EE->session->userdata['session_id']

```

You are probably best wrapping this in a plugin

---
Tags: templates, cpanel
---


# Question
Title: Wrong selected value inserted into a Grid via Channel Form using custom select dropdowns
For reasons I won't go into, I need to insert data into a Grid field using a Channel form. However, I cannot use the 'default' Grid field and instead need to use separate, custom select dropdowns.

I've managed to get this working except for one thing.

The Grid field in question has 3 simple text columns. Two of these are populated by select dropdowns.

The second select seems to work OK and the data from the select is inserted correctly. But the first select field of the first row is always gets the very first option inserted. All other columns/rows appear to be OK.

The different rows are generated with jQuery and the second select of each row is dynamically generated from an Ajax lookup but I can't see this being the issue as everything else seems to work OK.

The HTML I'm using is thus (ignore the data attributes, they are from a previous iteration and I've not yet removed them);

```
<div id="product-selections">

    <div id="product-selection-1" class="product-selection">

        <select class="product-purchased" name="customer-invoice-purchases[rows][new_row_1][col_id_1]">
            <option value="">--Choose a product--</option>
            <option data-product="554" value="Product 1">Product 1</option>
            <option data-product="553" value="Product 2">Product 2</option>
            <option data-product="551" value="Product 3">Product 3</option>
            <option data-product="550" value="Product 4">Product 4</option>
            <option data-product="549" value="Product 5">Product 5</option>
            <option data-product="548" value="Product 6">Product 6</option>
        </select>

        <select id="" class="product-variant" name="customer-invoice-purchases[rows][new_row_1][col_id_2]">
            <option data-product="553" data-points="20">2 port</option>
            <option data-product="553" data-points="30">3 port</option>
            <option data-product="553" data-points="40">4 port</option>
            <option data-product="553" data-points="50">5 port</option>
            <option data-product="553" data-points="60">6 port</option>
            <option data-product="553" data-points="70">7 port</option>
            <option data-product="553" data-points="80">8 port</option>
            <option data-product="553" data-points="90">9 port</option>
            <option data-product="553" data-points="100">10 port</option>
            <option data-product="553" data-points="110">11 port</option>
            <option data-product="553" data-points="120">12 port</option>
        </select>

        <a class="remove button pink small" href="#" title="Remove this item">×</a>
    </div>

    <div id="product-selection-2" class="product-selection">

        <select class="product-purchased" name="customer-invoice-purchases[rows][new_row_2][col_id_1]">
            <option value="">--Choose a product--</option>
            <option data-product="554" value="Product 1">Product 1</option>
            <option data-product="553" value="Product 2">Product 2</option>
            <option data-product="551" value="Product 3">Product 3</option>
            <option data-product="550" value="Product 4">Product 4</option>
            <option data-product="549" value="Product 5">Product 5</option>
            <option data-product="548" value="Product 6">Product 6</option>
        </select>

        <select id="" class="product-variant" name="customer-invoice-purchases[rows][new_row_2][col_id_2]">
            <option data-product="551" data-points="60">2 port</option>
            <option data-product="551" data-points="70">3 port</option>
            <option data-product="551" data-points="80">4 port</option>
            <option data-product="551" data-points="90">5 port</option>
            <option data-product="551" data-points="100">6 port</option>
            <option data-product="551" data-points="110">7 port</option>
            <option data-product="551" data-points="120">8 port</option>
            <option data-product="551" data-points="130">9 port</option>
            <option data-product="551" data-points="140">10 port</option>
            <option data-product="551" data-points="150">11 port</option>
            <option data-product="551" data-points="160">12 port</option>
            <option data-product="551" data-points="170">13 port</option>
            <option data-product="551" data-points="180">14 port</option>
            <option data-product="551" data-points="190">15 port</option>
            <option data-product="551" data-points="200">16 port</option>
            <option data-product="551" data-points="210">17 port</option>
            <option data-product="551" data-points="220">18 port</option>
            <option data-product="551" data-points="230">19 port</option>
            <option data-product="551" data-points="240">20 port</option>
        </select>

        <a class="remove button pink small" href="#" title="Remove this item">×</a>
    </div>
</div>

```

This is what gets inserted (ignore the quantity column for the moment).

Does anyone have an idea as to why the first field of the first row might always get the first option inserted regardless of what has been selected?

# Answer
> 0 votes
This was actually a problem with how I was creating the field rows.

I had a 'template' field set within the page (only containing the initial first select) which was cloned as needed (the second select then being inserted via Ajax as required).

This had the effect of overriding whatever was in the first 'real' row.

---
Tags: safecracker, grid
---


title: Low Search loose_ends

text:
# Question
Title: Low Search loose_ends
Am i right in thinking

```
loose_ends="right"

```

Takes no notice of anything to the right of what you searched for?

Here is the matrix field i am searching.

Basically this would be an example search.

What i was hoping is that the \[loose\_ends="right"\] would take no notice of the "HE" and return the entry with "LL28 3" in one of the rows but it doesnt at the moment.

In order for it to work i need to type "LL28 3" and submit the search. It will then return the entry.. is there a way that i can get it to work with the "HE" or whatever else letters is added after?

This is my code i have at the moment.

SEARCH:

```
 {exp:low_search:form result_page="search/results" form_id="postcodesearch"}
                <fieldset>
                    <label>Enter your postcode:</label>
                    <input type="search" name="keywords" placeholder="Enter your postcode here" class="postcode-entry" />
                    <button type="submit" class="white-button postcode-button"><span class="fa fa-search icon"></span>Search your postcode</button>
                </fieldset>
  {/exp:low_search:form}

```

RESULTS:

```
{exp:low_search:results query="{segment_3}" limit="1" collection="franchise" loose_ends="right" channel="franchise"}

    {if count ==  1}<ol>{/if}
    <li><a href="{comment_url_title_auto_path}">{title}</a></li>
    {if count == total_results}</ol>{/if}
    {if no_results}No search results{/if}

{/exp:low_search:results}

```

Thanks

# Answer
> Am i right in thinking `loose_ends="right"` takes no notice of anything to the right of what you searched for?

No. To quote the docs:

> `right`: lion will match lions and lionized.

...which means the search term *lion* will return entries that contain *lions* or *lionized*.

Based on your description, you're expecting the opposite: eg. *lionized* will also return *lion*. That wouldn't be desirable behaviour.

> is there a way that i can get it to work with the "HE" or whatever else letters is added after?

Only if you change the submitted keywords yourself, either with JavaScript on form submit, or using an extension which hooks onto the low\_search\_pre\_search hook.
> 1 votes

---
Tags: low-search
---


title: Expresso Store checkout won't complete

text:
# Question
Title: Expresso Store checkout won't complete
I'm using Expresso Store to take invoice payments with two forms, one to add the amount of the invoice to the cart (with invoice amount being set by the quantity field which is then multiplied by the product's price of $1) and then a second `checkout` form which captures payment details.

The first form works fine, but the second one on submit, keeps getting returned to itself and never redirects to the page set in the return parameter. It's like there's some error that prevents the form from submitting correctly but no errors are reported (`error_handling="inline"` is disabled).

In the CP, an order is actually created and shows the correct amount and custom field information, but with an order status of Incomplete and when viewing the details of the order, for every attempt at submitting the second form, there's a row under Transactions with a status of Failed (payment method is correctly reported as Dummy which is what I'm testing with).

**First form**

```
{exp:store:product
  entry_id="130" {!-- fixed ID of the invoice 'product' --}
  empty_cart="yes"
  payment_method="Dummy"
  return="{segment_1}/{segment_2}/payment-details/"
}
    <fieldset>
    <label class="formLabel" for="billing_first_name">First Name:</label>
    <input name="billing_first_name" type="text" id="billing_first_name" title="Enter the patient's name here" />
    </fieldset>
    <fieldset>
    <label class="formLabel" for="billing_last_name">Last Name:</label>
    <input name="billing_last_name" type="text" id="billing_last_name" title="Enter the patient's name here" />
    </fieldset>
    <fieldset>
    <label class="formLabel" for="patientId">SKG Patient ID:</label>
    <input name="order_custom1" type="text" value="SKG" id="patientId" title="Enter the patient's id here" />
    </fieldset>
    <fieldset>
    <label class="formLabel" for="invoiceNo">Invoice Number(s):</label>
    <input name="order_custom2" type="text" id="invoiceNo" title="Enter the invoice number(s) here" />
    </fieldset>
    <fieldset>
      <label class="formLabel" for="payAmount">Amount you wish to pay ($):</label>
      <input name="item_qty" type="text" id="payAmount" title="Enter the amount you wish to pay here." />
    </fieldset>
    <fieldset>
      <input type="submit" name="submit" value="Pay invoice" tabindex="5" class="btn" />
    </fieldset>

{/exp:store:product}

```

**Checkout form**

```
{exp:store:checkout
  return="{segment_1}/{segment_2}/ORDER_HASH"
  payment_method="Dummy"
  disable_javascript="yes"
  form_class="payment-form"
}

  {items}
    <dl class="invoice-details">
      <dt>Patient name</dt>
      <dd>{billing_first_name} {billing_last_name}</dd>
      <dt>Patient ID</dt>
      <dd>{order_custom1}</dd>
      <dt>Invoice number</dt>
      <dd>{order_custom2}</dd>
      <dt>Invoice total</dt>
      <dd>{order_total}</dd>
    </dl>
  {/items}

  <fieldset class="first">
    <label class="formLabel" for="payment_name">Name</label>
    <input type="text" id="payment_name" name="payment[name]" placeholder="As it appears on card">
  </fieldset>
  <fieldset>
    <label class="formLabel" for="payment_card_no">Card Number</label>
    <input type="text" id="payment_card_no" name="payment[card_no]" placeholder="12 digits no spaces">
  </fieldset>
  <fieldset>
    <label class="formLabel" for="payment_exp_month">Expiry</label>
    <select id="payment_exp_month" name="payment[exp_month]" style="width:50px">
      <option value=""></option>
      {exp_month_options}
    </select>
    <select id="payment_exp_year" name="payment[exp_year]" style="width:75px">
      <option value=""></option>
      {exp_year_options}
    </select>
  </fieldset>
  <fieldset>
    <label class="formLabel" for="payment_csc">Security code</label>
    <input type="text" id="payment_csc" name="payment[csc]" placeholder="3 digits on the back of card">
  </fieldset>

  <fieldset>
    <input type="submit" name="submit" value="Complete payment" class="btn" />
  </fieldset>

{/exp:store:checkout}

```

The site is also using Structure but I've tested accessing the pages directly at their template\_group/template URLs and get the same result.

Anyone have an idea about what might be tripping it up?

# Answer
> 1 votes
Your templates looks fine for the most part and you are on the right track to remove `error_handling="inline"` if you are having issues with the form reloading without submitting as that usually means that there is an error but you don't have the error message logic in your template. Having said that you will want to add

```
{error:payment_method}

```

in your checkout template to have gateway specific errors displayed to you (especially important for off-site gateways).

The dummy gateway works with a limited number of test card numbers so you should use a card number that ends in an even number like 4242424242424242 will be approved while odd numbers like 4111111111111111 will be declined.

---
Tags: expresso-store
---


# Question
Title: Low Yearly Archives - Select year from a drop-down menu
I would like to create a yearly archives for my blog in this format:

A drop-down menu with all the years, with the current year selected. When a year is selected, it show up a list with all the months that have entries in that year. When another year is selected, the months list change automatically, and so on.

I used Low Yearly Archives with this format:

```
<select name="year">
{exp:low_yearly_archives channel="blog" start_month="1" status="not closed" sort="desc"}
<option value="{year}">{year}</option>
{/exp:low_yearly_archives}
</select>
{exp:low_yearly_archives channel="blog" start_month="1" status="not closed" sort="desc"}
<div>
{months}
<div>
<a href="{path='blog'}/{year}/{month_num}/" title="{num_entries} entries in {month} {year}">{month_short}</a>
</div>
{/months}
</div>
{/exp:low_yearly_archives}

```

How can I show only the months related to the year selected?

I thank all those who can help me.

# Answer
I resolved using JS.

Here's my updated HTML with new id and classes added:

```
<select name="year" id="choose_year">
{exp:low_yearly_archives channel="blog" start_month="1" status="not closed" sort="desc"}
<option value="{year}">{year}</option>
{/exp:low_yearly_archives}
</select>
{exp:low_yearly_archives channel="blog" start_month="1" status="not closed" sort="desc"}
<div>
{months}
<div class="month year{year}">
<a href="{path='blog'}/{year}/{month_num}/" title="{num_entries} entries in {month} {year}">{month_short}</a>
</div>
{/months}
</div>
{/exp:low_yearly_archives}

```

and here's my script:

```
$(document).ready(function(){
var currentYear = (new Date).getFullYear();
$(".month").not(".year" + currentYear).hide();
$("#choose_year").change(function () {
var choose_year = $("#choose_year").val();
$(".monthg").not(".year" + choose_year).hide();
$(".year" + choose_year).show();
});
});

```
> 0 votes

# Answer
Try outputting a regular list with LYA and use JavaScript to generate the drop-down based on that list. That is behaviour that falls outside of the scope of LYA, to be honest. But with the output it can generate, and some creative JS, creating that behaviour shouldn't be too difficult.
> 1 votes

---
Tags: html, low-yearly-archives
---


# Question
Title: EE Reset password form works properly, but returns user to reset password form
We have a reset/forgot password form (let's call this Form A) in a template that allows the user to enter the email address they signed up with (below) - this works by the way.

**Form A**

```
{exp:user:forgot_password}

    <input type="text" name="email" id="email" placeholder="Email Address"/>
    <input type="submit" name="submit" value="Submit" />

{/exp:user:forgot_password}

```
* Once completed, this sends the user a unique link to reset their password (example.com/member/reset\_password?&id=XXXXXXXX), which when you click on takes you to a dynamically created EE "Please Enter A New Password Page" with a form (**Form B**) for which there is no template that I can see.
* When you create your new password within this page, this works, but it redirects the user back to the original custom reset/forgot password form specified above that they completed (Form A).

This is pretty bad UX, so we'd like to redirect the users to a login page, or at very least to the site homepage. How can we do this there's no template that allows us to intervene?

Thanks!

# Answer
You can add parametr **password\_reset\_template=**

```
{exp:user:forgot_password password_reset_template="user/reset_password/%id%" }

    <input type="text" name="email" id="email" placeholder="Email Address"/>
    <input type="submit" name="submit" value="Submit" />

{/exp:user:forgot_password}

```

and then create template for reset password where you can set url for return

```
<h2>Reset Password</h2>
<p>
    This form will allow you to reset your password.
</p>

{exp:user:reset_password
    reset_code="{segment_3}"
    return="user/reset_success"
}
    {if user_no_results}
        <h4>The reset token provided is invalid.</h4>
    {/if}

    <h4>Reset Password</h4>

    <p>
        <label for="password">New Password</label><br/>
        <input type="password" name="password" />
    </p>

    <p>
        <label for="password_confirm">Confirm New Password</label><br/>
        <input
        <input type="password" name="password_confirm" />
    </p>

    <p>
        <input type="submit" value="Submit" class="submit" />
    </p>
{/exp:user:reset_password}

```
> 3 votes

---
Tags: members, solspace-user, forgot-password
---


# Question
Title: Category Related Categories (Category Siblings)
I have a channel where I'm filtering entries by category and then 'stacking' categories to produce an ever decreasing list of results, i.e. showing all entries with category A and B etc.

In the right hand column I display a list of all categories which the user uses to filter the results, however as I start to stack categories (show all entries with category A and B) the category list on the right starts to more often than not return 'no results' (as expected).

What I would like to achieve is a list of categories on the right which displays only categories which are siblings of those already selected. This is much better for usability because it will guide the user to the categories with results for the stack they are creating.

**EDIT:**

I guess essentially it's two queries to return a list of 'related' category IDs:

`SELECT * FROM exp_category_posts WHERE cat_id IN ({current_category_ids}) GROUP BY entry_id`

to get the {entry\_ids} related to the current categories ({current\_category\_ids}) and then:

`SELECT cat_id FROM exp_category_posts WHERE entry_id IN ({entry_ids}) GROUP BY cat_id`

To get the categories associated with those entries, the question is of course... how does that perform with 1,000's of entries and categories!

Any thoughts? Or am I barking up a very tall tree?

# Answer
Ok, well I kinda wrote a plug-in to do exactly this...

https://github.com/ninefour/category\_siblings.pi.ee\_addon

:)
> 0 votes

---
Tags: categories, related
---


# Question
Title: Please help me debug this 2.7.3 Upgrade. TypeError: d.ee_focus is not a function
**UPDATE** September 25, 2014: I reverted once, but now I'm trying again with an update to 2.9.0 and facing the same issue. If anyone has any insight it would be appreciated!

**UPDATE 2** I think I may have found the source of the issue. It appears that a parallel install of the site used for QA, was interfering. When I renamed the folder containing that site, the problem went away. Now I need to track down why it was loading from the wrong place. Perhaps a bug in my config\_bootstrap.

**UPDATE 3** The theme\_folder\_path variable is set to the location in one of the other installs, so that explains why it was loading incorrectly, now I need to figure out where in the blazes that is being set. None of the usual suspects seem to have it.

**UPDATE 4** I searched my entire database for what I could think of (probably serialized data, and I don't know where to look), and I searched all my configuration files and I couldn't find anywhere that `theme_folder_path` was being set. I tried saving an update in the control panel and the change held, so my best guess is that the wrong value was in the database somewhere. I've now improved my config\_bootstrap setup so that it should set the correct themes folder for each version of the site automatically. Is there any way to see where config items shown in the control panel are being loaded from? I will post an answer to the question that will hopefully help people with this issue in the future, and will probably award the bounty to Rob Sanchez who put the most effort into trying to help me.

---

I upgraded from 2.5.5 or thereabouts to 2.7.3 on my local environment some time ago. After I got my relationship related addons, queries, and templates sorted out it all worked fine.

Today I finally got around to updating the production site, and after applying the above mentioned fixes the front end of the site works fine, but the back end has some issues:

1. On every page of the control panel I get an `TypeError: d.ee_focus is not a function` error
2. On entry form pages, the format buttons don't load and the image and write mode buttons don't work
3. clicking on accessories pops me to the top of the window but accomplishes nothing else.

There were some permission errors during upload of the files for the new version of EE, but at this point I think I've reuploaded everything at least 3 or 4 times. I suspected the themes folder, but have reuploaded from 2 different sources of 2.7.3 and nothing fixes it. I've disabled pretty much all the addons I can without losing data and that hasn't fixed it either.

I've searched the entire systems folder and themes folder for ee\_focus and cannot find it. I do find it in themes/javascript/compressed/jquery/plugins/ee\_navigation.js from older versions, but not in 2.7.3.

Where is the error coming from? Is it causing all the other control panel strangeness? Help me Obi Wan Kanobi, you're my only hope!

# Answer
> 1 votes
Here is some preamble about the process of discovering the issue, but the quick thing to check that worked for me is in the heading below, so feel free to skip ahead to see if that gives you the solution before reading the preamble.

Google searches turned up sparse results for this issue, but all results pointed to an old version of the themes folder being used instead of the current version. I tried very hard to make sure that the themes folder I had was the most current one, and that no other themes folder could be being loaded somehow by mistake by reuploading the current themes folder form EllisLab and deleting all older backups of the themes folder (`themes_old` if you follow the upgrade instructions to the letter). None of this seemed to work.

I tried uploading a fresh copy of the nerdery theme to see if that might make a difference, and noticed that the list of available themes did not match my list. The thing that really tipped me off was that the nerdery theme was listed as Nerdery-Theme-master and the install I had just made was in a folder called nerdery. When I selected Nerdery-Theme-master in the list and submitted I got a bunch of errors about things not being found. I remembered having noticed in the past that I had for some reason installed nerdery with a weird name (that reason is lost to time) so I went looking for that folder in the cp\_themes libraries of other site installs and found it in my dev install.

## TLDR; This is the important bit

I'm sure at some point during debugging this I had looked at Admin-\>General Configuration, but I hadn't noticed the problem. Looking again this time, I found the site path of my dev server in the **Theme Folder Path** field. This seems to have been stored in the database, as I could see no evidence of it existing in my configs anywhere. Updating the entry to the correct path corrected the problem, and I then added it into my config\_bootstrap to make sure each version of the site gets the correct themes folder everytime going forward.

# Answer
> 0 votes
I remember having this issue; I was able to resolve it by copying the file from an older version of EE (replace the version in your installation).

If you're not comfortable with that, try switching to a different CP theme -- I recommend Nerdery (http://devot-ee.com/add-ons/nerdery) -- and see if that fixes the issue?

# Answer
> 0 votes
Do you have Zoo Flexible Admin installed? Older versions of this will trigger a `d.ee_focus is not a function` error on EE 2.7+

---
Tags: ee2, control-panel, 2.7.3
---


# Question
Title: Accessing 'Calendar' field types with the channel:entries tag
I'm trying to make an all-in-one feed for the home page of a site that would pull together all the latest entries (whether they be blog posts, events etc.)

So I've got a entries loop that goes like so:

```
{exp:channel:entries
    channel="posts|calendar_events"
    sticky="no"
    status="open|featured"
    limit="10"
    disable="categories|member_data|category_fields"
}

```

calendar\_events being the channel created by the Solspace Calendar add-on. The channel field with of Calendar type is called event\_time. I want to know if there was a way to display the event start times **and end times** through the entries tag using my `event_time` variable.

When I just put `{event_time}` it displays the Calendar ID. I'd rather not be embedding a template for every event that appears but I suppose I could use the event\_time and/or entry\_id to display the time via embed variables.

Any help would be great! Thank you!

# Answer
> 1 votes
Calendar data can only be pulled from Calendar tags. The Calendar widget custom field does not output any useful data (unless you need the calendar ID) if directly used in `{exp:channel:entries}` like a regular field variable (eg. {event\_time}).

You could pass the `{entry_id}` from `{exp:channel:entries}` into the `event_id=""` parameter of a Calendar tag, such as `{exp:calendar:cal}` or `{exp:calendar:events}`. Quick example (you might need to tweak for your own situation):

```
{exp:channel:entries
    channel="posts|calendar_events"
    sticky="no"
    status="open|featured"
    limit="10"
    disable="categories|member_data|category_fields"
}

   {if channel_name == "calendar_events"}
      {exp:calendar:events event_id="{entry_id}"}
         Very first start date: {event_first_date format="%Y.%m.%d"}
         Very last end date: {event_last_date format="%Y.%m.%d"}
      {/exp:calendar:events}
   {/if}
{/exp:channel:entries}

```

---
Tags: channel-entries, solspace, solspace-calendar, entries, date
---


# Question
Title: Error Number: 1054, Expression Engine 2.7.3
This happens after I submit a channel form:

```
Database Error Occurred

Error Number: 1054
Unknown column 'field_id_0' in 'field list'
SELECT `field_id_0` FROM (`exp_channel_data`) WHERE `channel_id` = '0'
Filename: fieldtypes/select/ft.select.php
Line Number: 156

```

I did not make any updates, just changed some fields.

# Answer
It appears that one of the channel fields was at fault.

1. To narrow it down, I removed field by field from the template
2. After the error disappeared, I deleted the channel field and recreated it with the same settings.
3. Now just revert all changes to the template and you're good to go.

The error has since disappeared.
> 3 votes

# Answer
The issue is that in a checkbox field, neither "Populate the menu manually" or "Populate the menu from another channel field" has been selected. Choose any of them and the error will be gone :D
> 1 votes

---
Tags: error
---


# Question
Title: Assets 2 field not working properly within 2.6 relationship
I've got an assets field within a single relationship, using the new 2.6 tags, and I'm having a couple of problems:

1. The assets tag pair only loops once, regardless of how many assets are in the field
2. The inner assets tags aren't outputting anything

I've tried all of these combinations, without success:

```
{relationship_field:assets_field}
    {relationship_field:assets_field:url}
{/relationship_field:assets_field}

{relationship_field:assets_field}
    {assets_field:url}
{/relationship_field:assets_field}

{relationship_field:assets_field}
    {url}
{/relationship_field:assets_field}

```

Other relationship tags (e.g. `{relationship_field:title}` ) output as expected.

Am I doing it wrong, or is this a bug?

# Answer
embed this in your index.html

{exp:channel:entries channel="name\_of\_your\_relationship\_channel" dynamic="off"}

```
{parents field="relationship_field"}

{title}
<img src="{asset_field_name}" alt="">

{/parents}

```

{/exp:channel:entries}

if this is not clear for u then look up here http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#id18
> 1 votes

# Answer
You could try this. It worked for me, allowing multiple image selection in assets.

```
{relationship_field}
    {relationship_field:assets_field parse="inward"}
        {url}
    {/relationship_field:assets_field}
{/relationship_field}

```
> 0 votes

---
Tags: pixelandtonic, relationships, assets
---


# Question
Title: Categories not selected correctly with if statements
Currently I'm trying to use if statements to determine what category to filter on. I'm using a combination of freebie and embed. However, I can't seem to find the right syntax to filter correctly. I have tried different orders for the if statements.

Broken: {exp:channel:entrieschannel="resources" {if freebie\_break\_1}category='{freebie\_break\_1}'{if:else embed:category}category='{embed:category}'{/if} {if freebie\_break\_2}category2="{freebie\_break\_2}"{/if}... normal channel params}

Works:

```
{if embed:category}category='{embed:category}'{/if}

```

Can someone let me know if category selection simply won't allow me to have this syntax?

# Answer
> 2 votes
You can 't use freebie this way because the freebie segments are parsed after the Channel Module.

My suggestion is to use freebie before the embed, on the parent template.

I tried to suggest you a code, but I couldn't figure what is the `category2` parameter.

This is the closest I could get:

```
{embed="foo/bar"
    {if freebie_break_1}
        category="{freebie_break_1}"
    {if:else}
        category="DEFAULT_CATEGORY"
    {/if}
}

```

---
Tags: categories, conditionals
---


# Question
Title: Datagrab doesn't import relationships consistently
I've got datagrab set to import from a google doc spreadsheet in csv mode. There isn't much data in the grand scheme of things and only 250 records, but there are about 5 columns that are for relationship columns matching to other fields.

Now, i have php memory limit of 512mb and plenty of processing time but it has serious issues in not importing the data for the relationships.

I can't see any way to resolve this :(

# Answer
In the import settings, it says to reduce batches to roughly 20 if having memory issues. Well, let me be clear, you will need to reduce that to more like 5-10! It seems to use serious amounts of memory to do the relationship fields. Still having issues? Reduce it even further.
> 0 votes

# Answer
I'm going to go out on a limb and say that something else is wrong with what you're doing/trying to do. I import ~1400 records, comprising over 40,000 lines of xml, and I only split the XML file into 3 files.

If you up your PHP memory limit (512MB is well more than enough; mine is 128MB) and it's not importing your records properly, then there's possibly an issue with the way you have your fields mapped in your import configuration.

Alternately, you may have *set* your PHP memory allocation to 512MB, but it might not be set in the correct location or it might be being overridden by a config elsewhere. Create a php file that you can visit in your browser and add the following:

```
<?php
$memory_limit = ini_get('memory_limit');

echo $memory_limit;
?>

```

It will output what the server is seeing as the PHP memory limit.

Finally, there while you can set PHP to have 512MB of RAM as its limit, this means nothing if you don't have that much available on your host/server. You might be running out of system memory, and not necessarily PHP-allocated-memory. Does that make sense?
> 0 votes

---
Tags: relationships, datagrab
---


# Question
Title: CartThrob: Pass custom field through checkout to be email recipient
My client wants to set email notifications based on product. So Product A would be mailed to bob@blah.com, and Product B would be mailed to john@blah.com. They would enter the recipient in the product entry.

At first I tried passing this data through the cart as a hidden input:

```
<input type="hidden" name="custom_data[notification_email_recipients]" value="{notification_email_recipients}" />

```

Then created an email notification within CartThrob's notifications panel with this as the To Email:

```
{custom_data:notification_email_recipients}

```

But CartThrob sends out an email notification to:

```
 {notification_email_recipients)@blah.com

```

Which is kicked back by the email servers as undeliverable (obviously).

My question is: How can I pass a custom entry field through the shopping cart and then let CartThrob pull that field to send an email notification?

My second question is: Is there an easier way to accomplish this without passing hidden variables?

# Answer
I'm not sure you can do this without a custom extension/module.

I had a similar scenario where different ordered products needed to be notified to various email addresses.

What I did was add a hidden product option field with a unique variable, in my case with unique values of either "xProduct" or "xEvent". This gets stored as a custom field in the order data.

The value is written to the admin email template, just output as a data field somewhere.

All order emails go to a central mailbox but I then used server side email filtering, any emails that contained the (unique) word xEvent would be cc'd to events@domain.com, and any that contained xProduct cc'd to orders@domain.com.
> 0 votes

---
Tags: email, notification, custom-data
---


# Question
Title: ZooVisitor Registration issue (password confirmation)
I'm having issues with the password confirmation in Zoo Visitor Registration. If I enter two separate passwords for the password and password\_confirm fields then the user is still registered.

Any thoughts why this might be happening or how to fix?

Code sample at https://gist.github.com/cole007/5d68d989545cb5cfc45a

Cheers,

Cole

# Answer
Did you disable "require password confirmation" in the settings? http://ee-zoo.com/docs/visitor/start/overview.html#flexible-member-data-settings
> 0 votes

# Answer
on your code sample you're using a conditional for the password and password\_confirm value attribute.

```
{if password}value="{password}"{/if}
{if password_confirm} value="{password_confirm}"{/if}

```

The value attribute should be empty.
> 0 votes

---
Tags: zoo-visitor, password, register, zoo
---


# Question
Title: Low Search - Cannot add collection from channels from category group
I'm working on an older site that was setup using Low Search. There are two main categories, and I need to add the blog into a collection, so that I can set the overall site search to pull entries from the blog. However, when I go to low search and attempt to set up a collection from the "blog" channel, that channel, and any other within its "blog" category are not available to create a collection.

I've been searching for a while, and can't seem to find the answer to this specific question, however I also don't have much experience with this particular plugin, so I apologize if I'm overlooking something simple.

Can I only create collections from channels within one category group?

This site is running an older version of Low Search, v1.1.0.

# Answer
I'm not entirely sure what you mean by *"that channel, and any other within its "blog" category are not available to create a collection"*, but Low Search Collections do not take categories or category groups into account. Collections are made *per channel*, regardless of category, category group, status, etc.

In any case, I recommend upgrading to the latest version.
> 1 votes

---
Tags: categories, channel, low-search, low, category-group
---


title: Low Alphabet and ajax

text:
# Question
Title: Low Alphabet and ajax
I would to know if it's possible to use ajax with Low Alphabet. I did a alphabet glossary, each time the letter is clicked, the whole page is loaded. How to use ajax to reload only the Low Alphabet window?

# Answer
> 1 votes
This actually has little to do with the workings of Low Alphabet itself. Rather, it's a JavaScript question, along with some smart templating to allow for proper ajax requests. Steps to take:

* Create 2 templates: 1 for the full page, and 1 just for the low\_alphabet:entries tag.
* Embed the latter in the former, but make sure the second template is also approachable directly.
* In the main template, add the AZ-List tag, with regular links.
* With JS, add an onclick event to those links, triggering an Ajax call to embedded template, and add the output to the main page.

The same principle could be applied to any EE content that needs to be called via Ajax.

---
Tags: ajax, low-alphabet
---


title: Set playa entry dynamically

text:
# Question
Title: Set playa entry dynamically
I have set an extended set of segments based on playa parent/child relationships

http://example.com/template-group/template/playa-parent/playa-child

I would like retrieve the content of an entry based on segment 4 but

1. I'm not sure I can do this and
2. I'm not sure if what I am doing is right?

```
{exp:channel:entries channel="countries" dynamic="yes" limit="1"}
{exp:playa:parent dynamic="yes" limit="1" channel="cities"}
{title}
{/exp:playa:parent}
{/exp:channel:entries}

```

I expect cities to yield the entries title ("London") based on the following URL

http://example.com/template-group/template/england/london

\[EDITED: Typo fixed for limit syntax\]

# Answer
Answering my own question in case others have a similar issue.

I reverted to only using the {exp:channel:entries} tag with the url\_title peremeter set to {last\_segment} like this

```
{exp:channel:entries
    channel="cities"
    dynamic="no"
    url_title="{last_segment}"
}

```

Simple.
> 1 votes

# Answer
Not sure if it's a typo, but the first thing I noticed was your limit parameter is a minus, not an equal symbol to equal the value 1 on the channel entry pair tag. Countries are the parent as stated, so wouldn't you want to use?

`{exp:channel:entries channel="countries" dynamic="yes" limit="1"}
{exp:playa:children field="[your_country_field_relationship_to_city_entry]"}
{title}
{/exp:playa:children}
{/exp:channel:entries}`

P.S. With the exp:playa:children you can pretty much use any parameter the channel entries tag has available. So even a url\_title parameter with segment\_4 might work in this case.
> 0 votes

---
Tags: playa
---


title: URL Changes (Host is not changing)

text:
# Question
Title: URL Changes (Host is not changing)
I have a site that I'm working on for the Boy Scouts: LHCBSA.info, they have a current site: LHCBSA.org. We are ready (almost) to switch over to the new site (LHCBSA.org would then point to the host for LHCBSA.info). When we are ready to do this I will simply change the DNS recorded for LHCBSA.org (no problem there, just changing where the @ record points to). My question is this... what will I need (if anything) to change in EE to make sure that when someone is visiting our site they will always have a .org address (we are keeping the .info address, i just don't want any one to use it)? EE was setup using the .info address so I'm assuming that after i change over to the .org address there will be something i will need to change.

Thanks!

# Answer
Nicholas,

The easiest thing for your to do is to change all your relevant paths/urls using either Deploy Helper $15 or Reelocate (free). My presonal preference is for Deploy Helper.

If you've set your site up using a multi environment such as the FocusLab Master Config set up then there'll be nothing you need to do as everything will just work.
> 2 votes

---
Tags: url
---