# Question
Title: jQuery tabs and each tab as a content post
I have a site built on EE2 where one page has used jQuery tabs (example: http://childrensmedgroup.com/index.php/meet\_us/). Main problem is with updating that page because within WYSIWYG editor user can see only first tab.

My idea it to make a separate channel for that particular page and create content post for each tab so user can populate it in a very easy way and I will just add EE tags to display each tab/post on that page template.

Does it will work? Or maybe there are extensions which will provide similar functionality?

Thanks

# Answer
That may just be a limitation of the WYSIWYG editor - not all of them work with more complex UI widgets that require jQuery to function. You may have to have your users learn how to view the source, and add/edit content within the code-view window.

If I were building something like this, I'd build in additional entry fields for the tab title, and for the tab content. Then the template would use conditional tags to add extra tabs to the jQuery tab widget. (For performance/usability's sake, I'd only allow for a maximum of five tabs on a page/single-entry template.) It requires some re-engineering, but it makes things easier for the users.
> 1 votes

# Answer
Just a thought here, but if I were building this, the first thing that comes to mind is using embeds for the other channels and building out the jQuery UI tabs with the EE tags in proper places for the content to render.

In other words, you have two tabs there for "Our Providers". That would be simple enough the list the providers by name from a single channel/entry/whatever you have and split them across the two tabs as required just using the EE channel\_entry tags.

Your next tab was "Support Staff". Use an embed to build that tab "title" and supporting content. (Note: Due to the jQuery UI structure, you may have to use either multiple embeds, or preload your variables.

Lastly, you have "Departments". Again, like the "Support Staff", this can be done the same way.

I have done a very similar thing with different support videos in which I had multiple channels, categories, and tags. (It was yucky) :)

I hope this makes sense.

**EXAMPLE:**

This may not be the best way of doing this, but maybe it will get you going. You would need to decide how you want to structure your blocks. (Use embeds or segments)

You could use Low Alphabet to retrieve the needed groups : http://devot-ee.com/add-ons/low-alphabet

```
{exp:channel:entries
    channel='whatever_channel_your_primary_page_copy_is_in'
    limit='1'
    status='open'
    require_entry="yes"
}
    {if no_results}
        {redirect="404"}
    {/if}
{/exp:channel:entries}
    <div id="tabs">
        <ul>
            <li><a href="#tab-a-n">Our Providers A-N</a></li>
            <li><a href="#tab-o-z">Our Providers O-Z</a></li>
            <li><a href="#tab-ss">Support Staff</a></li>
            <li><a href="#tab-dept">Departments</a></li>
        </ul>
        <div id="tab-a-n">
            {exp:low_alphabet:entries
                channel='whatever_channel_your_providers_are_in'
                status='open'
                orderby='title'
                alpha_filter='a-n'
                sort='asc'
            }
                {title}
            {/exp:low_alphabet:entries}
        </div>
        <div id="tab-o-z">
            {exp:low_alphabet:entries
                channel='whatever_channel_your_providers_are_in'
                status='open'
                orderby='title'
                alpha_filter='o-z'
                sort='asc'
            }
                {title}
            {/exp:low_alphabet:entries}
        </div>
        <div id="tab-ss">
            {exp:channel:entries
                channel='whatever_channel_your_support_staff_is_in'
                status='open'
                orderby='title'
                sort='asc'
            }
                {title}
            {/exp:channel:entries}
        </div>
        <div id="tab-dept">
            {exp:channel:entries
                channel='whatever_channel_your_departments_are_in'
                status='open'
                orderby='title'
                sort='asc'
            }
                {title}
            {/exp:channel:entries}
        </div>
    </div>
{exp:channel:entries
    channel='whatever_channel_your_primary_page_copy_is_in'
    limit='1'
    status='open'
    require_entry="yes"
}
    The rest of your page here...
{/exp:channel:entries}

```
> 1 votes

---
Tags: ee2, jquery
---


# Question
Title: Just upgraded a site from 2.4 to 2.7.2, get errors when trying to view front-end freemember forms
Has Freemember been updated to work with EE 2.7.2? This is the error I get when trying to access a freemember form on the front end...

```
Error

Unable to load the requested class: safecracker_lib

```

Was using FreeMember 2.0.1 and upgraded to 2.3.0.

# Answer
> 4 votes
If you were using 2.4 you probably need to update FreeMember to the latest version to address changes in EE for the 2.7.x releases. Safecracker is now part of the channel module.

You can download the latest version at https://github.com/expressodev/freemember

# Answer
> 1 votes
bah, had an older version of Freemember installed. Installed new version and things seem to be working ok so far.

# Answer
> 0 votes
When I google "ExpressionEngine Freemember" I get this page, which shows the last update to this plugin being in May 2013. So I'm guessing that, no, it hasn't.

---
Tags: error, freemember, expresso
---


# Question
Title: REElocate: Fatal error: Call to undefined function ee()
Good Afternoon,

I'm trying to install the REElocate module. I see it in the Control Panel, but when I click *Install*, I get the following error:

> Fatal error: Call to undefined function ee() in \[omitted\]/expressionengine/third\_party/reelocate/upd.reelocate.php on line 39

upd.reelocate.php line 39:

```
ee()->db->insert('modules', array(

```

Line 39 context:

```
public function install()
{
    // register module
    ee()->db->insert('modules', array(
        'module_name' => 'Reelocate',
        'module_version' => $this->version,
        'has_cp_backend' => 'y',
        'has_publish_fields' => 'n'));

    return true;
}

```

I'm running v2.1.3 build 20101220.

The docs at https://github.com/expressodev/reelocate state:

> Requirements
>
> ExpressionEngine 2.1.3+

Many thanks,
Andrea

# Answer
> 3 votes
Derek is right, the docs were out of date. The latest version of Reelocate now requires EE 2.6 (this has now been corrected in the README).

If you need to use Reelocate with an older version of ExpressionEngine, you can download older versions here:

https://github.com/expressodev/reelocate/releases

# Answer
> 3 votes
If an add-on is calling `ee()`, it requires 2.6+. My guess is that Adrian never got around to updating the docs.

---
Tags: add-on
---


# Question
Title: Error on CP homepage from core/EE_Exceptions.php
I'm trying to secure my install of EE by following the instructions here, which involve moving my system directory above my web root, and renaming it.

My site loads fine, and I can even navigate to parts of the control panel by deep-linking into CP sections. However, when visiting the CP home, I get the following PHP error:

```
Fatal error: Call to a member function send_ajax_response() on a non-object in
/Users/charlesgallant/ ... path ... /stem/expressionengine/core/EE_Exceptions.php
on line 62

```

-- EE 2.6.1, running on Apache 2.2.3, with php 5.3.2 (and have tested 5.4.10)

I've checked:

* File Permissions
* Disabling plugins
* Others who have found this error have mis-named some folders or failed an upgrade, but that doesn't appear to be the case here.
* Making sure the paths in all my config files are correct (which they MUST be, if I can access my site AND sections of my control panel).

I've tried commenting out some offending blocks of code around line 62, and I was able to raise this error:

```
Unable to load your default controller. Please make sure the controller
specified in your Routes.php file is valid.

```

...and yes, this file appears valid to the best of my knowledge.

Any thoughts are appreciated - thanks in advance =)

**==UPDATE==**

I can subvert this error and at least render the login page by adding blank query parameters to the url:

Visiting `myDomain.com/admin.php?S=0&D=cp&C=login` works,

Visiting `myDomain.com/admin.php?` throws the above fatal PHP error. How is this possible!?!? Either way, I still can't see the actual homepage for my control panel, so I can't accept this workaround.

# Answer
Per lealea's comment above, a solution is here: https://support.ellislab.com/bugs/detail/19630

There's a zip to download, so if you need this fix, visit that link.
> 1 votes

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


# Question
Title: Assets in Wygwam not displaying on front end in EE 2.6/Assets 2.1.1/Wygwam 2.7.1
Just updated to EE 2.6 today, also updated Assets and Wygwam to 2.1.1 and 2.7.1 respectively.

I have images in my Wygwam fields, if I var dump the raw data, the code stored looks like this: `{assets_86:{filedir_2}faculty-staff-stats.png}`

When it gets rendered, it looks like this: `http://mysite.dev/uploads/assorted/faculty-staff-stats.pngfaculty-staff-stats.png}`.

Same code worked perfectly prior to upgrading.

# Answer
If you are on EE 2.6, 2.6.1, or 2.6.2 and using Assets 2.1.1, you should update to the latest versions of both. If you're stubborn, Rob's fix above will work for you.

If you even more stubborn and on EE 2.5.5 or below, then stop being stubborn and update. Said with kindness in my heart.
> 2 votes

---
Tags: assets, wygwam, pixelandtonic
---


# Question
Title: Solspace SuperSearch giving 'You are not allowed to search' on live site
Using Solspace SuperSearch in ExpressionEngine site works OK on test site.

When running behind the network firewalls and load-balancing systems produces "You are not allowed to search."

The form POSTS, but then does not redirect onto the results page. Any suggestions?

# Answer
> 1 votes
Per the comments above by new2EE, this was caused by a blacklist setting in EE.

---
Tags: solspace, supersearch
---


# Question
Title: Assets Module only grants Super Admin access
Assets v2.1.4 ExpressionEngine v2.5.5

I'm experiencing issues when trying to access the assets module when logged in as any user other than Super Admin. The other member group's privileges and preferences have all been set to yes so they are allowed access to the module. However, accessing Assets from Modules or an entry, none of the images are displayed. When logged in as a Super Admin, these images are available. Thanks in advance for the help.

# Answer
> 1 votes
Update to at least Assets 2.2 and EE 2.7.2 for a fix.

---
Tags: assets, admin
---


# Question
Title: Matrix sort parameter + Zoo Visitor not working as expected
I've followed the documentation outlined here:

http://docs.pixelandtonic.com/matrix/templating/field.html

Where my custom field is `member_companyname` and is assigned as a matrix fieldtype.

```
{member_companyname sort="desc" limit="1"}
<input type="text" name="member_companyname" id="member_companyname" class="form-text" value="{member_companyname}" />

<input type="hidden" name="member_companyname[row_order][]" value="row_new_{count}">
<input type="hidden" name="member_companyname[row_new_{count}][col_id_20][]" value="[{entry_id}] [{url_title}] {title}">
{/member_companyname}

```

but it's not rendering it and spits it out as this:

`Company Name {member_companyname sort="desc" limit="1"} " />`

# Answer
This is not a Matrix issue, but a Zoo Visitor template tag issue. Here's the winning code per comments posted above. I'm posting here for all to see.

```
{exp:channel:entries entry_id="{zoo_visitor_id}" status="not closed" limit="1"}
  {exp:zoo_visitor:update_form}
    Company Name: <br />
    <input type="hidden" name="member_companyname[row_order][]" value="row_new_0">
    <input type="text" name="member_companyname[row_new_0][col_id_1]" value="{member_companyname sort="desc" limit="1"}{member_companyname}{/member_companyname}"/>
  {/exp:zoo_visitor:update_form}
{/exp:channel:entries}

```
> 1 votes

---
Tags: matrix, pixelandtonic, zoo-visitor, development, zoo
---


title: Playa: Future Entries Not Showing

text:
# Question
Title: Playa: Future Entries Not Showing
I wish to show future 'events' on a page. I have a channel, that contains a playa field that I use to associate the desired events.

I cannot seem to get it to show on the site. I'm convinced it must be something simple that I am overlooking, but I can't figure out why it won't work. Anyone have an idea what I'm doing wrong? :(

```
{exp:channel:entries channel="isp" limit="1" show_future_entries="yes" dynamic="no"}
    {events show_future_entries="yes"}
        {title}
    {/events}
{/exp:channel:entries}

```

# Answer
> 3 votes
Not sure if you are using Structure or native EE templating, but a sure way to remedy this is to make sure your outer `channel:entries` tag is actually pulling the playa:parent page.

```
{!-- Replace XX with the parent page's entry_id --}
{exp:channel:entries channel="isp" entry_id="XX"}
    {events show_future_entries="yes"}
        {title}
    {/events}
{/exp:channel:entries}

```

---
Tags: playa
---


# Question
Title: Persisting Playa relationship in Matrix row
I have a matrix field that has a single-select Playa field in one of its two columns. (The other column is just text).

In one particular situation, the value of the Playa field was changed, but the old relationship still remained in the exp\_playa\_relationships table along with the new one. Because of this, the exp:playa:parents tag returned both the old and the new associated entry. Note that this change was made simply by selecting a new value in the Playa dropdown and saving; **not** removing the row, saving, creating a new row with the new relationship and saving again.

Here's my EE setup:

* EE 2.5.3
* Playa 4.3.3
* Matrix 2.5.3
* Better Workflow 1.5.1
* PHP 5.3.10

I understand from this support post that something similar has been an issue in the past, but it should be fixed in the version that I have. At the moment, my only suspicion is that since I have Better Workflow installed, this could be messing with the functionality somehow.

Any suggestions or experiences with this issue?

Thanks!

# Answer
> 1 votes
If you are still running into the problem, you need update to the latest version of each add-on and EE. That'll get you fixed up.

---
Tags: matrix, playa, better-workflow
---


title: Low Search Multiple Parameter Search

text:
# Question
Title: Low Search Multiple Parameter Search
I'm trying to put together a search form with Low Search a few 1 to 1 form inputs with the idea of being able to search by Last Name, State, etc etc...

For some reason though, Low Search appears to ignore all form inputs and returns all results. Here's the form example:

```
{exp:low_search:form
    collection="member_profiles"
    search_mode="exact"
    result_page="search/members_results"
    form_class="form"
    exact="last_name|city|state"
    min_score="1"
    require_all="search:last_name|search:city"
}

<fieldset>
    <div class="row">
        <input type="text" name="search:last_name" id="last_name" placeholder="Smith" value="" />
        <input type="text" name="search:city" id="city" placeholder="City" value="" />
    </div>
    <div class="row">
        {exp:reegion_select:states name="search:state"}
        <span class="name">
            <input type="text" placeholder="Zip Code" name="search:postalcode" id="postalcode" class="code" />
        </span>
        <input type="submit" value="search" class="btn">
    </div>
</fieldset>
{/exp:low_search:form}

```

Now, when I check the Search Logs I do get confirmation that the search has no keywords recorded though I had thought that's what the `search:` inputs would do.

For extra info, here's the results tag set I'm using (using \_GET param passing):

`{exp:low_search:results query="" status="not closed" limit="10" disable="member_data"}`

But, as mentioned, that just loops over all the entries regardless of filter.

Anyone have any ideas?

# Answer
Stephen is right. The `search_mode` parameter only applies to keyword searches, so you can safely remove it. The same goes for the `min_score` parameter. And since the two input fields are single values, you can remove the `require_all` parameter as well, as that only applies to multiple values.

And since you're using GET variables instead of the encoded query, you can remove the `query` parameter in the Results tag (that's only used to pass through an encoded query from the URI).

Finally, make sure the `search:field_name` match the fields exactly. And when in doubt, turn on template debugging and see what Low Search logs.
> 2 votes

# Answer
Since you're defining the `exact=` parameter, I don't believe you need the `search_mode="exact"` parameter. `search_mode="exact"` is for `name="keywords"` searches. Not sure if that would kill your results, but maybe.

From the Low Search docs:

> If you’re using multiple `search:custom_field` selections in your form and you need the matching to be exact, add the field name to the exact parameter. Note, for exact *keyword* matching, use the `search_mode` parameter.
> 1 votes

---
Tags: low-search
---


# Question
Title: How to return to http when on https page?
When on a https section of an EE page (e.g. https://domain.com/account) and having a link back to the homepage somewhere in the header, how do I set up the links so that https is not automatically added?

I am using Focus Labs Master Config and in my header snippet I have the url set up like so:

```
<a href="{path=''}">Homepage</a>

```

I have already tried different other combinations like {path='site\_index'} but however I put it while on an https page the link turns out to be like

https://homepage.com

# Answer
Eventually I ended up finding this blogpost by Jonathan Dean which exactly scratched my itch. I configured my htaccess file accordingly and haven't had any problems with it until today. So, I might have come back here late but at least it is tested thoroughly now.
> 0 votes

# Answer
EE does not have any built-in link constructors that directly handle single sites spanning multiple domains / protocols / ports. So, to your question: EE doesn't understand that part of your site lives in HTTP, and part lives in HTTPS.

You may want to just use hand-entered URLs. For the home page, instead of using {path=''}, use literally: http://domain.com/.

And, for other pages, you may need to construct your URLs by building out with {url\_title} or {page\_uri}, e.g., http://domain.com/{url\_title} or http://domain.com{page\_uri}

If you need to conditionally check for HTTP vs HTTPS in order to construct the URL, the SSL Check add-on might help. Practically, if you need to do this kind-of conditional check in a bunch of places in a bunch of templates, you could move the conditional into a snippet. In pseudo-code:

```
if segment_1 != "account" and HTTPS
   return http://domain.com/
else if segment_1== "account" and HTTP
   return https://domain.com/
else
   return /

```

Finally, if you can't get EE to readily produce links with the right protocol, and you're willing to insert an extra redirect into requests that are to the incorrect protocol (HTTPS but should be HTTP, or vice versa), you can code this kind of redirect rule in your .htaccess:

```
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  #For HTTPS that should be HTTP
  RewriteCond %{SERVER_PORT} 443
  RewriteCond %{REQUEST_URI} !^/account(.*)$ [NC]
  RewriteRule ^(.*)$ "http://%{HTTP_HOST}/$1" [R=301,L]
</IfModule>

```

Adding an extra redirect isn't ideal, but if you have a rare case you need to "patch" this way, it's workable.
> 2 votes

# Answer
Try just using `/` instead of the `{path=""}` variable.
> 0 votes

---
Tags: ee2, ssl, http
---


# Question
Title: Limit display of Channel Field based on date
I am asking myself if there is a way of displaying a Channel Field based on date. I have a dedicated channel for the site's indexpage and randomly the client wants to display announcements eg for sweepstakes and the such.

Now I could put up a Field and a P&T Switch but I would like to have some kind of date logic so that the announcement disappears at a given time in the future.

Or should I really create a brandnew Channel just for announcements and pull those in the indexpage template? I can see the advantage of having sort of an Announcement archive then but it also feels a bit clumsy and overkill.

Any ideas on how to best do this logically, technically and best suited for client use?

Thanks and Cheers!

Marc

# Answer
You could create an announcement field along with 2 date fields (start and end dates).

```
{if current_time > announcement_start_time && current_time < announcement_end_time}
  {announcement}
{/if}

```
> 2 votes

# Answer
Two things to look at:

Have your client set an "Expiration Date" on the entries. If show\_expired="" is not set to "yes" on the entries tag, then these entries will automatically stop showing on the website at the set time/date.

Use the **start\_on="" parameter** to set a start date for the entries tag. Only entries from that date forward to present will show. To set a dynamic start date, you'll need to use PHP like this:

```
<?php
    $start_time = $this->EE->localize->decode_date('%Y-%m-%d %H:%i', $this->EE->localize->now - 86400);
?>
{exp:channel:entries channel="{my_weblog}" limit="5" sort="desc" start_on="<?php echo $start_time; ?>"}

```
> 2 votes

# Answer
Thanks Anna and Jason. I managed to solve this issue with Matrix in the end like this:

```
{if cell_1 >= current_time}
    {cell_2}
{/if}

```

Where cell\_1 is a "Date" Cell Type and cell\_2 is a "Text" Cell Type.

Since Jason's answer is correct and not relies on using third-party Modules I'll mark it as the accepted answer.
> 0 votes

---
Tags: channel, fields, date
---


# Question
Title: Update loop in 2.7.2 on AWS w/ load balancer
About a month ago I upgraded EE from 2.5.2 to 2.7.2 in my staging environment with absolutely no problems. The upgrade went smoothly and it's been running like buttah.

Last night, I attempted the same upgrade in our production environment following EE's update instructions to the letter. Things were fine until the update wizard ran (step 6 in the instructions). The update wizard would appear to complete its updates, I would remove the "installer" directory from the "system" directory, but then when I'd enter the URL to go to the control panel, the first screen on the update wizard would display instead *despite it actually being removed from the server*.

Both the staging and production environments are on AWS, but prod is load balanced on two servers, but linked to one database (I think). There's no caching, except using CE Cache.

I'm wondering now if it has to do with both web servers having the control panel on it? Anybody have any ideas?

# Answer
Clean up your browser cache just after the update.

If everything looks fine now, check the content expiring settings on your .htaccess files or the browser cache settings on Nginx.

I ran into the same issue some days ago.

In my case, it was:

```
server {
    [...]
    expires 1M;
    [...]

```

This `expires` setting on nginx was set to all the server, instead of just the static files `location`.
> 1 votes

---
Tags: 2.7.0, update, aws
---


# Question
Title: How to only execute some code within a specific time frame?
I have a site where users can use a SafeCracker form to submit an entry. Once they submit the entry, they are taken to a confirmation page that also includes some code to automatically send out a series of emails.

I'm running into a problem where users bookmark the confirmation page, and then every time they go back to it, the emails are sent again.

Is there a way I can compare the entry date/time of the post with the current time, so for example, the emails will only be sent out within five minutes of the original post?

I know I could do something like:

```
{if entry_date == current_time}
    email code here
{/if}

```

but that would only work if the times matched exactly. Is there a way to specify a range of a few minutes?

# Answer
You can try MX Calc

```
{exp:mx_calc expression="{current_time} - 600 "}
{if entry_date > {calc_result}}
 ....
{/if}
{/exp:mx_calc}

```

but still, this is not good solution because whats happens if user will refresh page many times in accepted timeframe? The perfect solution is made small plugin which will do indication that for current entry message was already sent. You can try do this using Remember Me

```
{if !{exp:remember_me:get entry_id='{entry_id}'}}
  Send message
{/if}

{exp:remember_me:set entry_id='{entry_id}'}

```
> 2 votes

# Answer
I never used Channel Form aka SafeCracker, but I found something on Member Module that can maybe help you.

```
{if last_entry_date == entry_date}

```

Probably you gonna have to use nested module tags or embeds to make this to work.

If this answers helps you, please, edit it with your final code.
> 0 votes

---
Tags: ifelse, entry-date, time, comparison
---


# Question
Title: Stash: how to overwrite a variable in set_list?
Is there a way to define default values in set\_list?

Basically, I want to set 3 variable to:

```
{stash:var_run_here}no{/stash:var_run_here}
{stash:var_type}none{/stash:var_type}
{stash:var_title}{url_title}{/stash:var_title}

```

Then overwrite them, depending on a playa value or checkbox values further in the set\_list grouping. Something like:

```
    {if is_global == 'y'}
            {stash:var_run_here}global{/stash:var_run_here}
    {if:else}
        {run_on_these_pages}
            {exp:switchee variable = "{url_title}" parse="inward"}
                {case value="{segment_2}"}
                    {stash:var_run_here}yep{/stash:var_run_here}
                {/case}
            {/exp:switchee}
        {/run_on_these_pages}
    {/if}

    {exclude_from_these_sections}
        {exp:switchee variable = "{option_name}" parse="inward"}
            {case value="{url_title}"}
                {stash:var_run_here}yep{/stash:var_run_here}
            {/case}
        {/exp:switchee}
    {/exclude_from_these_sections}

```

So that this is the get\_list part:

```
{exp:stash:get_list name="fma_list" parse_conditionals="yes" unique="yes" process="end" orderby="var_type" sort="asc" limit="999"}
  Title: {var_title}<br>
  Run On This Page: {var_run_here}<br>
  Type: {var_type}<br>
{/exp:stash:get_list}

```

# Answer
> 2 votes
Yes, you can do this. Just put those default values at the top. Those values will be replaced if they're set later in the order.

```
{exp:stash:set_list name="fma_list" ... }
    {exp:channel:entries ... }
        {stash:var_run_here}no{/stash:var_run_here}
        {stash:var_type}none{/stash:var_type}
        {stash:var_title}{url_title}{/stash:var_title}
        {if is_global == 'y'}
            {stash:var_run_here}global{/stash:var_run_here}
        {if:else}
            {run_on_these_pages}
                {exp:switchee variable = "{url_title}" parse="inward"}
                    {case value="{segment_2}"}
                        {stash:var_run_here}yep{/stash:var_run_here}
                    {/case}
                {/exp:switchee}
            {/run_on_these_pages}
        {/if}

        {exclude_from_these_sections}
            {exp:switchee variable = "{option_name}" parse="inward"}
                {case value="{url_title}"}
                    {stash:var_run_here}yep{/stash:var_run_here}
                {/case}
           {/exp:switchee}
        {/exclude_from_these_sections}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

---
Tags: stash
---


# Question
Title: Channel form problem with file fleld flagged as required
I've send the same question on Ellislab Forum but without answers...

I’m testing the new **channel form** and i’ve seen that if a *file field* is flagged as **required** field the form don’t pass the check.

```
The form you submitted contained the following errors
The xxxx field is required.
Return to Previous Page

```

The same problem also in a grid field or a matrix field that contain a column where file field is flagged as required field.

If I remove the flag (required field) all are ok.

Does anyone have the same problem?

Tested with:

* Expressionengine v2.7.2
* Matrix v2.5.8

This is the template:

```
{exp:channel:form channel="box" return="box/index" entry_id="{segment_3}" class="channel_form" include_assets="yes"}
    {field:box_photohead}
    {field:box_intructions}

{/exp:channel:form}

```

# Answer
It’s accepted as Bug: https://support.ellislab.com/bugs/detail/19837 and it will be Fixed in Upcoming Release.
> 0 votes

# Answer
This could be related to another bug regarding the file field. Why is an un-required field required?

That bug prevents an entry being posted if:

1. The upload directory is set to a specific directory
2. A specific file type (e.g. image) is specified.

Changing either of these conditions allow the entry to be submitted.

So I would suggest setting the upload directory to "Any" and the file type to "Any" and see if that makes a difference.
> 0 votes

# Answer
This is now also being addressed in an EE bug report. Check for the final answer there as it unfolds.

https://support.ellislab.com/bugs/detail/19837
> 0 votes

---
Tags: matrix, file-uploads, channel-form, file-field
---


# Question
Title: low seg2cat on MSM site segment_x_cat not working
Just upgraded a site from EE 2.5 something to 2.7.2 it is running MSM all the subsites pull content from the main site. Each subsite has no content or categories of its own. (This is the way I inherited it) When I did the update I also updated low seg2cat from 2.6.1 to 2.8.0 The code below is a template in a subsite and it used to work just fine.

```
{if "{segment_1_category_id}" != ""}
  {exp:channel:entries channel="channel_name" site="site_name" category_group="11" category="{segment_1_category_id}" status="top_page"}
    <h2>{if long_title}{long_title}{if:else}{title}{/if}</h2>
{if article_img}<div class="article_img" style="width:{article_img_width}px">{if article_source}<a href="{article_source}">{/if}{if article_img_link}<a href="{article_img_link}">{/if}{article_img wrap="image"}{if article_img_link}</a>{/if}{if article_source}</a>{/if}<br/><p class="caption">{article_img_caption}</p></div>{/if}
    {body}
{if more_info}<hr style="border-top: 2px dotted #555; background:none;" /><h3>For more information:</h3>{more_info}{/if}
    <p><em>Tagged with: {exp:tag:tags entry_id="{entry_id}" type="weblog" site="sitenames" backspace="2" orderby="clicks" sort="desc" limit="10"}<a href="http://earthworksaction.org/tags/tag_entries/tag/{websafe_tag}" title="{tag}">{tag}</a>, {/exp:tag:tags}</em></p>
    {embed="site_name:includes/fb-twitter"}
  {/exp:channel:entries}
{/if}

```

Now {segment\_1\_category\_id} returns nothing. I rolled back the seg2cat version to 2.6.1 and then it produces the proper output. Only problem is it also creates php errors even though everything seems to work anyways. This is the error

```
Severity: Warning

Message: call_user_func_array() expects parameter 1 to be a valid callback, class 'Low_seg2cat_ext' does not have a method 'template_fetch_template'

Filename: libraries/Extensions.php

```

Any suggestions on a solution? I have a feeling it is now treating categories as site specific and because the subsite has no categories and technically it is referencing a category from the main site it is not returning anything.

# Answer
Low Seg2Cat has always been site specific. However, some have made a slight alteration to the extension file to search through all sites. To do this in the latest version, comment out (or remove) line 218 of ext.low\_seg2cat.php, which reads:

```
->where('site_id', $this->site_id)

```

Also make sure the Category Groups setting is set to *--All--*.

The `call_user_func_array` error you mentioned is a result of the rollback. The new version added another hook/method to call. The old version doesn't contain the newly inserted method reference. Just use the new version with the above hack to allow for cross-site matching.
> 4 votes

---
Tags: multi-site-manager, low-seg2cat
---


# Question
Title: Bug in Grid row_id as a limiting parameter?
I'm getting some odd behaviour from my Grid field in the template (unless I'm misunderstanding the Grid docs). I have a custom Grid field used for placing images (columns are file, alt text and caption). In one of my channel entries I have three images set via this field. The following template code displays all three images, as expected:

```
{my_image_grid}
<figure>
    <img src="{my_image_grid:file}" alt="{my_image_grid:alt}">
    <figcaption>{my_image_grid:caption}</figcaption>
</figure>
{/my_image_grid}

```

And, also as expected, this code displays only the contents of the **first** row of the grid field:

```
{my_image_grid row_id="1"}
    <figure>
        <img src="{my_image_grid:file}" alt="{my_image_grid:alt}">
        <figcaption>{my_image_grid:caption}</figcaption>
    </figure>
{/my_image_grid}

```

However, when I try to display all rows *other than* row 1, with the following:

```
{my_image_grid row_id="not 1"}
    <figure>
        <img src="{my_image_grid:file}" alt="{my_image_grid:alt}">
        <figcaption>{my_image_grid:caption}</figcaption>
    </figure>
{/my_image_grid}

```

I get just the first row again. Just the first row is also displayed if I try to display a specific row other than 1:

```
{my_image_grid row_id="3"}
    <figure>
        <img src="{my_image_grid:file}" alt="{my_image_grid:alt}">
        <figcaption>{my_image_grid:caption}</figcaption>
    </figure>
{/my_image_grid}

```

Can anyone else verify this behaviour before I report it as a bug? Or am I doing something wrong (eg. misunderstanding how rows are ID-ed)? This is EE 2.7.2.

Thanks.

# Answer
> 0 votes
It seems row\_id works on the database table ID, not on the row number.
Use the offset parameter and {gridfield:count} variable instead.

~~In my opinion it's a bug, because if you only provide one row, the grid-parser will not take "not" into account somehow. To circumvent this bug add a zero in front so that it 'thinks' it has multiple entries. \`\`\` row\_id="not 0|1" \`\`\`~~

(ps. bug filed: https://support.ellislab.com/bugs/detail/19852 )

---
Tags: grid
---


title: 2.7.2 Idle message when logged into CP

text:
# Question
Title: 2.7.2 Idle message when logged into CP
I've just upgraded from 2.6.1 to 2.7.2 of EE and when I log in I get this message at the bottom of the screen below the EE copyright message:

```
    You've gone idle, please enter your password to continue

```

If I enter my password I am logged out and when I log back in I see the same message at the bottom of the screen. Yet I am logged in and can continue working. Not a show-stopper but it is an indication that something has gone wrong. Any ideas what is causing this?

Cheers,

Dorothy

# Answer
Silly me, I hadn't copyied up my new version of the themes folder. Hopefully this will be of help to someone else with a short-term memory!
> 4 votes

# Answer
It might be a CSS cache problem. Is the new version of the file "/themes/cp\_themes/default/css/global.css" loaded? It includes style declaration to hide the issued area.

---

The cause of my problem is that I copied DB from production environment to development one and then updated only development server. I can see development site at, for example, "https://development.example.com/admin.php", but it keeps production site's setting that the url is "http://production.example.com/". So, my browser loads CSS files from production site which have not been updated yet. That's why I asked you to check CSS file cache.

Regards,

IKEDA Tatsunobu
> 1 votes

---
Tags: control-panel, login
---


# Question
Title: how to parse segment_3 in tag stash:embed:
This is my setup. My URL **my-site/index.php/group/template-x**

Template-x must call two different pieces of code. I want that to happen by using the third segment, which shall be NL or BE. So **my-site/index.php/group/template-x/NL** or **my-site/index.php/group/template-x/BE**.

The two pieces of code are stored as Stash Templates. The names are consumenten-NL.html and consumenten-BE.html. I can show the code by calling them hard coded, like `{stash:embed:registration:consumenten-NL}` but I want to use `segment_3` dynamically.

In template-x I can grab segment-3.

```
{exp:stash:set name="segment-3"}{segment_3}{/exp:stash:set}

```

and show it in the template

```
{exp:stash:get name="segment-3"}

```

Now calling the embeds in template-x:, I do not seem to be able to do this:

```
{stash:embed:registration:consumenten-{exp:stash:get name="segment-3"}}

```

gives

```
error
Stash: the file "../stash_templates/registration/consumenten-M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr.html" was not found.

```

I tried several other methods, but the documentation is too high for me, so I ask for a little assistance here. Much appreciated.

Thanks.

# Answer
Maybe I've misunderstood, but why make segment\_3 a stash variable? It's already an early-parsed global variable. Thus:

```
{stash:embed:registration:consumenten-{segment_3}}

```
> 1 votes

# Answer
Is the both occurrences of `{exp:stash:get name="segment-3"}` on the same template? In this case, I know how to fix this.

This is a trick peculiarity of eecms template parser that sometimes bites us.

The template parser, when fount some tag to parse, looks for all another instances of the same tag, with the same parameters and the same content on the template and replaces every one of them by a temporary marker, to avoid to parse the same code more than once.

In your case, `{exp:stash:get name="segment-3"}` is being replaced by `M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr`. So:

```
{exp:stash:get name="segment-3"}
[...]
{stash:embed:registration:consumenten-{exp:stash:get name="segment-3"}}

```

Become:

```
M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr
[...]
{stash:embed:registration:consumenten-M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr}

```

Then, the parser founds `{stash:embed:registration:consumenten-M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr}` and replaces it by another marker.

In the time of parsing the first tag, its occurrence inside the second one isn't there yet, so it remains not parsed.

The solution is to prevent this "caching" on the second occurrence. Try this:

```
{stash:embed:registration:consumenten-{exp:stash:get name="segment-3" random}}

```

`random` is an undocumented parameter that sometimes saves the day. Just use it when you really need it!

You can read about it here, here and here.
> 2 votes

# Answer
You may just need to add `process="end"` to your stash embed tag:

```
{embed:stash:registration:consumenten-{exp:stash:get name="segment-3"} process="end"}

```

UPDATE

Two more options.

1. Don't store segment\_3 in stash since it's already a global variable. Use `{segment_3}` in your stash embed tag instead.

{embed:stash:registration:consumenten-{segment\_3} process="end"}
2. Use `set_value` (docs) tag in template-x.

{exp:stash:set\_value name="segment-3" value="{segment\_3}" parse="inward"} {embed:stash:registration:consumenten-{segment-3} process="end"}

UPDATE 2

Try putting double quotes around `{segment_3}` like this:

```
{embed:stash:registration:consumenten-"{segment_3}" process="end"}
{!-- OR without process parameter --}
{embed:stash:registration:consumenten-"{segment_3}"}

```
> 1 votes

---
Tags: stash, segments
---


# Question
Title: Submit useragent information with Freeform or similiar
I am maintaining an ecommerce site running with EE and CT. We have a Freeform Form set up on the Contact page. A lot of incoming emails from that form center around technical problems, e.g.. people not able to checkout for whatever reason.

To nail the problems down and to be able to better reproduce the problems I'd would ideally have the user-agent info at hand directly. I am thinking about (probably secretly) submitting this whenever a user fills out the Freeform form so I don't have to ask the people and send emails back and forth (it's tedious and to be honest most people having problems are the not so tech-savvy so telling them where to find the information needed isn't easy and most of the time results are never returned or are incomplete, like "I'm using Firefox on Windows").

I am totally open on what to use here. This means I don't necessarily have to use Freeform although it's pretty nice. I'd probably even upgrade to Freeform Pro for this but couldn't find any valuable information on the website regarding this.

Thanks and Cheers!

# Answer
You could have a hidden field (create a new text field in the CP and on the front end just use a hidden field in its place so it records) and inject the UA via JS from the onsubmit param of the form:

```
{exp:freeform:form form_name="my_form" form:onsubmit="document.getElementById('ua').value=window.navigator.userAgent;"}

<input type="hidden" name="ua" id="ua" value="" />

//rest form stuff
{/exp:freeform:form}

```
> 2 votes

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


# Question
Title: Installing MSM 2.1.4 onto EE 2.7.0 Getting blank wwhite screen
I have installed MSM 2.1.4 onto EE 2.7.0 and I can see the menu when I click on the site name (top-right) in the c-panel but when I click Edit Sites I get a blank screen.

without upgrate is there any solution

# Answer
Follow the guidelines from EE's Troubleshooting -\> Blank Pages
> 1 votes

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


# Question
Title: Why does Template Morsels not seem to work?
Template Morsels works (incredibly well) when I manually cache via its CP panel, but then after the scheduled 5 minutes passes the page takes as long to display as it would without Template Morsels. Am I misunderstanding how it works?

Edit--I set interval to 0 and now the cache sticks. Will have to see if editing or adding entries refreshes cache. Preferences is set up for this so fingers crossed.

Edit Again--Tried adding an entry and it works but, wow, every time you click the publish button it takes as long to publish as it would to load the front end page without Template Morsels. I get why this is, but that kind of makes it unworkable.

# Answer
> 1 votes
Template morsels needs to run the entire template to be able to cache it at some point. When the cache expires, after 5 minutes as you had it set before, it must load the template in order for it to re-cache. The same thing has to happen on publish due to it changing data.

You could run a cron-job at the set intervals so it would lessen the chance that it happens on the front end.

> I get why this is, but that kind of makes it unworkable.

If it didn't do this, then your data in the morsel wouldn't be updated after you published a new entry. Why is it unworkable? Is publish speed a major concern of the end client?

Most heavy data work with EE add-ons tends to happen on publish because thats when new data is introduced and its the most expected place for longer processing to happen.

---
Tags: solspace
---


# Question
Title: Upgrading to FreeForm Pro 4.1.2 Styling not working
I have a testing server that duplicates our live server and I updated our FreeForm 3 to 4.1.2 on the testing server and everything went smoothly. When I deployed those changes to our live server the styling for the CP area is broken and I am unable to use the new composer for 4.1.2

I have included screen shots so you can see what is happening. Any help would be much appreciated.

Thanks!

# Answer
> 2 votes
Check the console for missing files or errors. Most likely it's not loading all the assets for you.

---
Tags: solspace-freeform
---


title: Resetting entry_id count

text:
# Question
Title: Resetting entry_id count
Is there a way to reset the entry\_id count for newly created entries?

I'm importing entries with Datagrab and need them to have entry\_id's starting from 1. There are no other entries in the system.

# Answer
> 5 votes
If you have MySQL access, you can run the following query:

```
ALTER TABLE exp_channel_titles AUTO_INCREMENT = 1

```

You can also run this command from the CP using the Database Query Form under

> Tools \> Data \> SQL Manager \> Database Query Form

---
Tags: ee2
---


# Question
Title: Error in Zoo Visitor entries after installing Field Pack, remains after uninstall
I installed Pixel & Tonic's Field Pack v2.1.1 for better checkboxes. I only installed the checkbox field type. Immediately after, when I try to edit a channel entry within my Zoo Visitor channel, I get a white screen with the following error:

```
A 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/checkboxes/ft.checkboxes.php
Line Number: 312

```

When I uninstall Field Pack checkboxes and delete all the Field Pack files, the error still appears.

It looks to me that the error is within the native EE checkboxes fieldtype file, but the last modification date on that file is long before I installed Field Pack, so I don't think the addon modified the file and broke something.

I'm at a loss. Thanks for any help!

# Answer
> 2 votes
It turns out the issue was that in a checkbox field, neither "Populate the menu manually" or "Populate the menu from another channel field" was selected. I'm not sure how I managed to not have either radio button ticked, but that was the problem.

---
Tags: pixelandtonic, zoo-visitor, field-pack
---


title: Freeform Pro: Field Placeholder

text:
# Question
Title: Freeform Pro: Field Placeholder
is it possible to add placeholder text (i.e. placeholder="Your Name") in a Freeform Pro: Composer Form Field?

# Answer
Yes, if you replace `{composer:field_output}` with `{freeform:field:{composer:field_name} attr:placeholder="Your Name"}` in the Composer Template.

If you're using the *Freeform channel custom field* (i.e. using the field in {exp:channel:entries}), you'll have to select your custom Composer Template (containing the above code) in the top left dropdown of the Composer Editor in the Freeform Control Panel. That way, that Composer Template is used when calling the Freeform custom field in {exp:channel:entries}.
> 5 votes

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


title: "{if item == ... " not parsing

text:
# Question
Title: "{if item == ... " not parsing
```
{exp:channel:entries channel="games" limit="1" dynamic="yes"}
{game_platforms}
    {if item == "PS3"}test{/if}
    <span>{item}</span>
{/game_platforms}
{/exp:channel:entries}

```

I set this up in a testing template and oddly, the curly braces aren't even parsing, here's what I'm getting:

```
{if "PC" == "PS3"}PS3{/if} PC {if "PS3" == "PS3"}PS3{/if} PS3 {if "Xbox 360" == "PS3"}PS3{/if} Xbox 360

```

Am I doing something wrong?

# Answer
This is a bug noted in EE2.5.3+ - https://support.ellislab.com/bugs/detail/18336 \- I ran into this one myself.

It's been fixed as of EE2.7.2 - http://ellislab.com/expressionengine/user-guide/about/changelog.html#version-2-7-2 (bug #19624)
> 1 votes

# Answer
You may get this to work:

```
{if game_platforms == "PS3"}PS3{/if}
{if game_platforms == "PC"}PC{/if}
{if game_platforms == "XBOX"}XBOX{/if}

```
> 0 votes

---
Tags: parsing
---


title: Issue with Assets on Client end only

text:
# Question
Title: Issue with Assets on Client end only
My client is experiencing a really weird issue. When they are publishing or editing an entry with an Assets custom field it displays only a white box. They experience this issue in both their limited access member account and in my account which is super admin.

I however do not experience this in both my clients account and my super admin.

The client sees this issue on multiple computers, multiple browsers and again under both accounts.

The site is running EE 2.5.5, MSM 2.1.3 and Assets 2.2.1. It is using basic config (EE default), EE suggested .htaccess with 5 301 redirects.

In the config I have the following:

```
$config['assets_site_url'] = 'http://www.domain.com/';
```

Only stuff out of ordinary in the 2nd sites index.php is ce image related doc root and regex settings.

Under console in Ghrome there are two errors; both are:

> Failed to load resource: the server responded with a status of 403 (Forbidden)

And seem to be dealing with Google Plus.

Not sure what else to check.

Thanks

# Answer
Client was accessing the control panel via the subdomain and not the main domain.
> 1 votes

# Answer
If you're getting HTTP 403, rather than the cross-domain error, then you might be hitting the incompatible session bug. Assets uses Ajax to do a lot of things and that is processed via Frontend by EE, so if your Control Panel Session and User Session types are not compatible, the Ajax requests will think you're not logged in.

Can you go in Admin -\> Security and Privacy -\> Security and Sessions and check settings for "Control Panel Session Type" and "User Session Type"? Can you try changing the first to "Cookies And Session Id" and the other to "Cookies only"?

This should fix this for you.
> 2 votes

---
Tags: assets, pixelandtonic, multi-site-manager
---


title: Tables for product data

text:
# Question
Title: Tables for product data
I am wanting to have a predefined tablelike fieldtype for ecommerce products. I am talking about data that needs to be entered for every product like SKU, EAN, lenght, weight, height, color and so on.

I have looked at this thread and I am using Content Elements but I am missing the possibility to predefine the tables first row.

Anybody having an idea about this?

Thanks!

# Answer
> 1 votes
In this case matrix or the native grid field might be better suited to what you're trying to accomplish.

The thread you referenced is aimed at having a variable set of columns and rows. However, in this case you have predefined columns (SKU, EAN, ect.) and only a variable amount of rows.

# Answer
> 0 votes
Another way to approach this is to add separate custom fields for product data type. eg

Field - SKU Field - Height Field - Width Field - Length

You could then use this data several ways:

1. On a product detail page, simply list of the values
2. In a data table for multiple products, eg

SKU Height Width Length {exp:channel:entries channel="products"} {cf\_sku} {cf\_height} {cf\_width} {cf\_length} {/exp:channel:entries}

(sorry SE doesnt allow table tags but you get the idea)

---
Tags: html, table
---


title: Auto opt-in Freeform mailing list

text:
# Question
Title: Auto opt-in Freeform mailing list
I'm having issues with implementing the auto opt-in mailinglist feature with Solospace's Freeform 4.

I have set up the mailing list called "jrp-mailinglist" and a landing page with the freeform on it with basic content "first name, last name, email & categories". I do not wish to have a checkbox to confirm sign-up. Eg. If they are filling out this form then have confirmed that they wish to sign up.

The freeform syntax I have used is:

```
{exp:freeform:form
mailinglist_opt_in="no"
mailinglist="jrp-mailinglist"
form_id="3"
required="first_name|last_name|email|sign_up_categories"
return="sign-up/thanks"
}

```

But am unsure how to use the mailinglist field type.

I have gone through the Freeform4 docs (http://www.solspace.com/docs/freeform/default\_fieldtypes/#mailinglist) but am unable to see where it clearly outlines how to implement the auto opt-in for my selected mailinglist.

Any help or advise would be greatly appreciated.

Thanks, Dan

# Answer
> 2 votes
You have to tell Freeform which mailing list you want the user to subscribe to in this way:

```
<input type="checkbox" name="mailinglist[1]" value="y" checked="checked"/>

```

Note: **mailinglist\[1\]** should be replaced with your short field name and the number of the mailing list you want the user to opt into.

You can also have Freeform spit it out automatically by using this tag:

```
{freeform:field:mailinglist}

```

I hope that helps!

# Answer
> 1 votes
Have you tried removing this parameter? mailinglist\_opt\_in="no" Make sure you have the "Opt in by default" checked.

If you don't want the field to display. You will probably have to code that into a hidden field.

Hope this helps.

Jim

# Answer
> 1 votes
In Freeform 4, the mailing list options are in the mailinglist field creation area: http://cl.ly/image/2o3o153c3S0q

Freeform 4 differs from Freeform 3 in that the Mailinglist options are all custom field based and no longer parameter based.

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


title: Allow Duplicate Screen Name

text:
# Question
Title: Allow Duplicate Screen Name
I'm importing new members using the Member Import Utility, but get errors for duplicate screen\_name. These members won't be posting so screen name is not used and email is username.

I've added a condition in Validate.php and EE\_Form\_validation.php to stop the validation:

```
if (1 == 2 && strtolower($this->cur_screen_name) != strtolower($this->screen_name))

```

this works okay when a single member registers via front end form, but not when importing XML file.

so I then hacked tools\_utilities.php, commenting out:

```
                            /*
                        case 'screen_name':
                            $this->validate->screen_name = $tag->value;
                            if ( ! in_array($tag->value, $s))
                            {
                                $s[] = $tag->value;
                            }
                            else
                            {
                                $this->errors[] = array(lang('duplicate_screen_name').$tag->value);
                            }
                            break;
                            */

```

Seems to work, but has anyone had other issues with this? it would be good to know before I import 10K members.

# Answer
I'm more inclined to follow Robs suggestion. I don't know if this would work (Need to test it), but maybe something along the lines of this:

```
case 'screen_name':
$this->validate->screen_name = $tag->value;
if ( ! in_array($tag->value, $s))
{
        $s[] = $tag->value;
}
else
{
    $emailUserName = $member->children['email']->value;
    if ( ! in_array($emailUserName, $s))
        {
            $s[] = $tag->$emailUserName;
        }
        else{
            $this->errors[] = array(lang('duplicate_screen_name').$tag->value);
        }
}
break;

```

instead of commenting it out completely... Just make a NOTE in your CP sidebar notes or something along the lines of when/where/why you made the change so you can trace back to issues that may come up. I would think that "forcing" the email as the username would be better than ignoring it though. Especially since you are using the email as username anyway.

Like I said, debug that write up though. ;)
> 1 votes

---
Tags: members, import
---


# Question
Title: Sending email forms using Postmaster - missing some key info on parsing fields
I am trying to build a multi enquiry form i which the same message plus some custom data is sent to multiple email addresses.

The email addresses and custom data are retrieved from existing entries.

My strategy so far has been to create the form like so; (the {exp:remember\_me} tag simply provides a pipe delimited list of entry IDs - this bit works fine.

```
{exp:postmaster:email_form:open
      action="/favourites/enquiry"
   method="post"
   field="email"
   data_field="data"
  }

   {exp:channel:entries channel="properties" entry_id="{exp:remember_me:get}" parse="inward"}

    <input type="text" name="email[entry_id]" value="{email}" />
    <input type="test" name="data[entry_id][to_name]" value="{author}" />
    <input type="text" name="data[entry_id][property-ref]" value="{property-ref}" />
    <input type="text" name="data[entry_id][title]" value="{title}" />
   {/exp:channel:entries}

    <p><label for="name">Name</label><input class="text" type="text" name="from_name" value="" id="name"></p>

    <p><label for="phone1">Telephone</label><input class="text" type="text" name="from_phone1" id="phone1"></p>

    <p><label for="email">Email<span class="req">*</span></label><input type="text" name="from_email" value="" id="email"></p>

    <p><label for="date_from">Date from</label><input class="datepicker" type="text" name="date_from" id="date_from"> <label for="date_to">Date to</label><input class="datepicker" type="text" name="date_to" id="date_to"></p>

    <p><label for="number_in_group">Number in your group</label><input type="text" name="number_in_group" id="number_in_group"></p>

    <p><label for="message">Message<span class="req">*</span></label><textarea name="message" id="message" value="" rows="12" cols="40"></textarea></p>

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

  {/exp:postmaster:email_form:open}

```

This certainly triggers an email for each entry but I can only get them to send if I hardcode a recipient email address into the hook set up and I need to use the email field from each entry.

In addition I am also unable to include any of the custom data or form data within the emails. As I understand the documentation I believe I simply need to do something like this;

```
<table cellpadding="4" border="0">
<tr>
<td colspan="2"><b>Property enquiry from Big Holiday House</b></td>
</tr>

<tr><td><b>From</b></td><td>{from_name}</td></tr>
<tr><td><b>Email</b></td><td>{from_email}</td></tr>
<tr><td><b>Phone</b></td><td>{from_phone1}</td></tr>
<tr><td><b>Property Ref</b></td><td>{property_ref}</td></tr>
<tr><td><b>Property</b></td><td>{property_name}</td></tr>
<tr><td><b>No. in group</b></td><td>{number_in_group}</td></tr>
<tr><td><b>Date from</b></td><td>{date_from}</td></tr>
<tr><td><b>Date to</b></td><td>{date_to}</td></tr>
<tr><td valign="top"><b>Message</b></td><td>{message}</td></tr>
</table>

```

However, none of the tags get parsed - I just get the tag names in the email received.

I'm clearly really doing something wrong here and not understanding some fundamental aspect of using Postmaster.

How do I do it?

# Answer
> 3 votes
Your fundamentals are correct, you are just getting hung up on the details. A couple issues:

1) The following is incorrect:

`email[entry_id]` `data[entry_id][some_var]`

The following is correct:

`email[0][]` `data[0][some_var]`

In the context of a channel entries loop, you should do it this way:

```
<input type="hidden" name="email[{count}][]" value="test@example.com" />
<input type="hidden" name="data[{count}][your_custom_var_1]" value="1" />
<input type="hidden" name="data[{count}][your_custom_var_2]" value="2" />

```

*To be clear, this would go inside your channel entries loop and the idea is to build a multiple dimensional array that matches up by the first index.*

2) When parsing any variable within a hook, always prefix the variable with `hook:`. So your template should be:

```
<table cellpadding="4" border="0">
<tr>
<td colspan="2"><b>Property enquiry from Big Holiday House</b></td>
</tr>

<tr><td><b>From</b></td><td>{hook:from_name}</td></tr>
<tr><td><b>Email</b></td><td>{hook:from_email}</td></tr>
<tr><td><b>Phone</b></td><td>{hook:from_phone1}</td></tr>
<tr><td><b>Property Ref</b></td><td>{hook:property_ref}</td></tr>
<tr><td><b>Property</b></td><td>{hook:property_name}</td></tr>
<tr><td><b>No. in group</b></td><td>{hook:number_in_group}</td></tr>
<tr><td><b>Date from</b></td><td>{hook:date_from}</td></tr>
<tr><td><b>Date to</b></td><td>{hook:date_to}</td></tr>
<tr><td valign="top"><b>Message</b></td><td>{hook:message}</td></tr>
</table>

```

---
Tags: postmaster
---


title: Expresso Store: "No items are on sale"

text:
# Question
Title: Expresso Store: "No items are on sale"
Searching for all items that are on sale, as of Express Store 2.0.4, is currently MIA, despite the presence of the `search:on_sale` parameter in the docs. That is, this code...

```
{exp:store:search channel="products" search:on_sale="yes"}
    {title}
{/exp:store:search}

```

... returns all items in the products channel, not just products on sale.

You can hack around this by using looping through all products and checking each one using the `on_sale` conditional:

```
{exp:channel:entries channel="products" orderby="title" sort="asc" disable="member_data|pagination" limit="99"}
    {exp:store:product entry_id="{entry_id}" disable_form="yes" disable_javascript="yes"}
            {if on_sale}
                {title}
            {/if}
    {/exp:store:product}
{/exp:channel:entries}

```

But has anyone figured out how to display a *Sorry, no items are currently on sale message* when no items are on sale? I've tried a PHP (input), PHP (output), and a variety of Stash syntax. Something very strange is happening either with parse order or the way that `on_sale` works. For example, you would think this would work:

```
{exp:channel:entries channel="products" orderby="title" sort="asc" disable="member_data|pagination" limit="99"}
    {exp:store:product entry_id="{entry_id}" disable_form="yes" disable_javascript="yes"}

            {if on_sale}
                {exp:stash:set_value name="sale_items_exist" value="true"}
                {title}
            {/if}

    {/exp:store:product}
{/exp:channel:entries}

{if "{exp:stash:get name='sale_items_exist' process='end'}" != "true"}
    <p>Sorry, no items are currently on sale</p>
{/if}

<p>Debug: the stash variable is {exp:stash:get name='sale_items_exist' process='end'}</p>

```

When I use that code, if there *is* an item on sale, that last line outputs nothing (and so my "no items on sale" message shows up even though it shouldn't). Somehow Stash is not setting `sale_items_exist` to `true`.

Has anyone solved this problem some other way?

# Answer
Another wild idea if you can't figure it out with parse order. Use Javascript!

```
if ($(".product-list-item").size() == 0) {
    $(".product-no-items").show();
}

```

Not the most elegant solution, but if you're up against a deadline then it will certainly work.
> 3 votes

# Answer
This might be overkill (and someone better at parse order than me may have a better solution), but you should be able to put no items bit inside an embed. That's my usual solution to get around parse order problems.

```
{embed="shared/no_items" items_exist="{exp:stash:get name='sale_items_exist' process='end'}"}

```

Then in your `shared/no_items` template:

```
{if "{embed:items_exist}" != "true"}
    <p>Sorry, no items are currently on sale</p>
{/if}

```

Like I said, there's probably a cleaner way around this, but I usually find parse order issues like this are just trial and error until you find something that works.
> 1 votes

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


# Question
Title: Playa - multiple selections - limit to 4
EE 2.5.5 PLaya 4.4.1 Zoo Visitor 1.3.23

On this site I have members who can edit their profile and select divisions that they belong to (playa). On the front end I can easily limit the display of their profile to only 4 divisions - :)

However on the divisions section of the site - Each division lists all members of that division using exp:playa:parents. The issue is how do I limit it so that a member only appears in the first 4 divisions that they have selected? As it stands I have a test member who is in 10 divisions and **they appear in all divisions**, however on their member profile only the first 4 divisions are displayed.

Ideally when setting up the playa field and selecting Allow multiple selections I could limit the number of selections but that doesn't appear to be possible.

# Answer
Could you simply have 4 playa fields limited to a single selection each?
> 1 votes

# Answer
looks like this options is still not in Playa.

*Solution:*

\*/themes/third\_party/playa/scripts/droppanes.js\*

replace

```
var selectItems = function($items) {

```

with

```
var selectItems = function($items) {

    obj.limit = $items.parents("label:first").data('limit');
    obj.totalSelect = obj.selectionsSelect.$items.length + 1;

    if (obj.totalSelect > obj.limit) {
        obj.optionsSelect.deselectAll(true);
        return false;
    }

```

SafeCracker/Zoo Visitor template code (*data-limit* is how many options can user choose)

```
       <label class="input" data-limit="3">
                {field:playa_field}
       </label>

```
> 1 votes

# Answer
Doing this without building a custom add-on will probably be quite tricky. The only way I can think of is by using a Matrix field limited to 4 rows, with a single-select Playa field in one of the columns. Not a particularly great experience for editing your profile, but it would work.

Edit to add: the upside would be that you could store extra data against each selection very easily, should the site's requirements ever grow.
> 0 votes

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


# Question
Title: Checking registrants email address for a particlular domain?
I have a potential project coming up that will most likely use either Membrr or CT Subscriptions.

Users will have to register for a particular account depending on the level of access they require. For example one might be a 12 month subscription and another would be a month to month subscription which are both fine to setup.

However, the one unusual aspect is that they want to offer a free subscription account for healthcare users, where they would need to have an existing/live email address ending with .nhs.uk to be able to signup for the free account.

I'm looking for ideas as to the best way to tackle this healthcare user signup scenario?

Thanks in advance!

# Answer
Just made simple ext which will check users email at the end of registration and if user email domain is in white list - send them validation email. After validation put them into the group which has full access.

hooks:

member\_member\_register

member\_register\_validate\_members
> 3 votes

# Answer
You'll need to write a custom add-on for this.

After doing a cursory google search, I found this article, which suggests pinging the domain's mail server, submitting the email address and using the server's response to validate.

I did another google search to see if there are PHP functions available to perform these actions. This Stack Overflow question & answer suggests using PHP's getmxrr function and PEAR's Net\_SMTP package.

So then you'd just run the add-on either on form submission or, better yet, use an ajax call to do a "live" validation.

There seems to be a lot of info on this subject available via Google, I'd recommend searching around a bit to find a more comprehensive answer.
> 1 votes

# Answer
I'd look at the simple approach and not sure of how your signup process is working.

Lets say you have some checkbox \[free acct\] \[other acct\] Via JS if they choose free, display a fixed input with an append like:

```
<input type='text' placeholder="your email"><span class="add-on">@.nhs.uk</span>

```

Very much like the Twitter bootstrap preprend/append treatment.

This illustrates to the user that the email needs to be an @nhs.uk email account. You could then inform them that an email will be sent to that address to verify them as valid and maybe a link to the site to signup for an @nhs.uk email account.
> 1 votes

---
Tags: cartthrob, registration, membrr, subscriptions
---


# Question
Title: Why does the control panel require a query string for log-in?
On multiple ExpressionEngine installs I have noticed that there is a **problem logging in** when the following query string parameters are omitted:

```
http://www.url.net/admin.php?s=0&D=cp&C=login

```

With just `admin.php` alone (or its renamed aequivalent), I get the following error:

> Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.

The EE installations affected are set up according to the user guide (but have index.php removed, if that may contribute to the problem).

Ideas?

# Answer
You didn't mention your EE version but sounds like it might be this bug:
https://support.ellislab.com/bugs/detail/19630

Instead of logging in with "http://www.url.net/admin.php", try using "http://www.url.net/system" instead... NOTE: "system" should be changed to whatever you renamed your system directory if you renamed it.

---

OR update to the most recent version of EE is you are using EE 2.6.1.
> 1 votes

---
Tags: control-panel, authentication
---


title: Sort by multiple dates

text:
# Question
Title: Sort by multiple dates
I have a Newsroom page that combines "In the News" channel entries and "Press Release" channel entries and I need to sort by different dates. Press Releases use the entry\_date because they go live on a specific date. In the News entries have their own pub\_date date field since article publication dates might not necessarily align when the article is posted to the site (entry\_date). While I could use entry\_date for In the News entries, in the future an Events channel field will be added and included in this list. Events can't use the entry\_date because they need to be listed on the site much earlier, however, the request is to have the date listed and sorted by be the event start date.

Is there a way to sort entries by multiple dates like this? I tried:

`{exp:channel:entries channel="in_the_news|press_releases" orderby="pub_date|entry_date" sort="desc"}`

but the entries listed all In the News article sorted by pub\_date then all the Press Releases sorted by entry\_date, not a mix of the two sorted by pub\_date is ones existed then entry\_date it not.

**UPDATE:**

Current code based on @stuartmcd69's answer below.

```
{exp:stash:set_list name="newsroom" parse_tags="yes"}
    {exp:channel_entries channel="in_the_news|press_releases" dynamic="no"}
        {!--  create stash variables --}
        {stash:news-article_title}{news-article_title}{/stash:entry_title}
        {stash:news-publication_name}{news-publication_name}{/stash:entry_title}
        {stash:pr-title}{pr-title}{/stash:entry_title}

        {!-- capture dates from both channels and convert to a universal date variable --}
        {stash:universal_date}
            {exp:switchee variable="{channel_short_name}" parse="inward"}
                {!-- News Article dates --}
                {case value="in_the_news"}
                    {news-publication_date}
                {/case}

                {!-- Press Release dates --}
                {case value="press_release"}
                    {entry_date}
                {/case}
            {/exp:switchee}
        {/stash:universal_date}
    {/exp:channel_entries}
{/exp:stash:set_list}

<dl id="news_list" class="dl-horizontal">
{exp:stash:get_list name="newsroom" orderby="universal_date" sort="desc"}

    {!-- Display entry based on channel name --}
    {switchee variable="{channel_short_name}" parse="inward"}

        {!-- News Articles --}
        {case value="in_the_news"}
            <div class="news_item in_the_news year-{year}">
                <dt>
                    <h4>{news-publication_date format="%F %j, %Y"}</h4>
                </dt>
                <dd>
                    <h4><a href="{news-link_to_article}" target="_blank">{news-article_title}</a></h4>
                    <p>{news-publication_name}, {news-publication_date format="%F %j, %Y"}</p>
                </dd>
                <hr />
            </div>
        {/case}

        {!-- Press Releases --}
        {case value="press_releases"}
            <div class="news_item press_releases year-{year}">
                <dt>
                    <h4>{entry_date format="%F %j, %Y"}</h4>
                </dt>
                <dd>
                    <h4><a href="{page_uri}">{pr-title}</a></h4>
                </dd>
                <hr />
            </div>
        {/case}
    {/switchee}
{/exp:stash:get_list}
</dl>

```

# Answer
> 1 votes
I'd use stash fo sure!

The following is a guide and not a verbatim copy/paste solution. Theory is capture a list of the items you want to capture & display AND also capture the relevant date to use to display relevance.

```
{exp:stash:set_list name="recent_news" parse_tags="yes"}
 {exp:channel_entries ...}
  {stash:entryid}{entry_id}{/stash:entryid} //Declare Entryid
  {stash:entry_title}{title}{/stash:entry_title} //Declare Title
  // Capture as much or as little as required. etc etc…
  {stash:alpha_date} //Capture relevant date for particular channel
    {exp:switchee variable="{channel_short_name}" parse="inward"}
      {case value="press_release"}
        {entry_date}
       {/case}
       {case value="in_the_news"}
         {pub_date}
       {/case}
    {/exp:switchee}
  {/stash:alpha_date}
{/exp:channel_entries}
{/exp:stash:set_list}

```

Then further down the template, spit it out by the captured "alpha\_date":

```
{exp:stash:get_list name="recent_news" orderby="alpha_date" sort="desc"}
  {title}/{entryid}
{/exp:stash:get_list}

```

# Answer
> 0 votes
Using two dates will rarely work because every datestamp will be different (down to the seconds value).

The solution may be only to use pub\_date in the entries loop and sort by that. Then use the entry\_date solely for specifying when the item is published. You would have to always have a pub\_date for each entry.

---
Tags: date, orderby
---


# Question
Title: Cartthrob -Stuck with adding additional info to order channel before checkout
I am sorry to ask again here, but facing a deadline and I am at the beginning of panic. And this is my first site with Cartthrob. I cannot get my head behind how to add additional info at an order before checkout.

What I want: The customers might choose another delivery address. When so, they pay no shipping costs.

Solution: Let them add the information to a field in the order channel, on submit return segment\_3 = delevery or = pick-up. Set in the checkout form this conditional:

```
{if segment_3 == "pickup"}
    {set_shipping_plugin value="single_flat_rate"}
{if:else}
    {set_shipping_plugin value="by_quantity_threshold"}
{/if}

```

I made in the order channel a new field, called nieuw\_bezorgadres. I pull information from a Profile:edit channel, showing the addresses as options, code like this:

```
<select name="nieuw_bezorgadres">
{exp:channel:entries channel="member_profiles" category="8"}
<option value="{member_company} {member_address} {member_city} {member_country}">{member_company} {member_address} {member_city} {member_country}</option>
{/exp:channel:entries}
</select>

```

Problem: But how can I save the information in the order channel for the current transaction?

Thanks a lot for looking at this, it must be simple, that is why I run in circles.....

# Answer
Make sure your Select is inside the checkout\_form tag like this:

```
{exp:cartthrob:checkout_form}
    <select name="nieuw_bezorgadres">
        {exp:channel:entries channel="member_profiles" category="8"}
            <option value="{member_company} {member_address} {member_city} {member_country}">{member_company} {member_address} {member_city} {member_country}</option>
        {/exp:channel:entries}
    </select>
{/exp:cartthrob:checkout_form}

```

Then, try renaming the select field to `name="custom_data[nieuw_bezorgadres]"`. I used that for custom order data on a much earlier CartThrob site... not sure if it will work with your version. To print out the variable in the template or the email use `{custom_data:nieuw_bezorgadres}`.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: MSM delete site 500 error if it has entries
EE v2.7.2 Build Date: 20131008

MSM 2.1.6

When I try to delete a site from MSM, I get a 500 Server error. However, if I manually delete everything, then delete the site, it works. I have tested all stages of a site build to find that this only happens if I have an entry in the site. There doesn't have to be anything in regards to templates, channel field groups, channel fields, etc...

To reproduce this all I have to do is create a new site, add a channel, create entry, (entry has nothing but a name and url), try to delete... 500

Has anyone had this happen? What could be causing it? I looked at the server records, but they told me nothing. It's just happening at the POST on confirmation...

```
2013-10-28 18:06:42 W3SVC3 [PRIVATE] POST /index.php S=af6796b5075bdafba2d73bf3136677cb5ebf5d39&D=cp&C=sites&M=delete_site 80 - [PRIVATE] HTTP/1.1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/30.0.1599.101+Safari/537.36 - http://adminDomain/index.php?S=af6796b5075bdafba2d73bf3136677cb5ebf5d39&D=cp&C=sites&M=site_delete_confirm&site_id=106 adminDomain 500 0 0 1405 787 1201

```

*** UPDATE *** I have traced it to this portion in the sites.php file (line 1972)

```
// Just like a gossipy so-and-so, we will now destroy relationships! Category post is also toast.
if (count($entries) > 0)
{
    // delete leftovers in category_posts
    $this->db->where_in('entry_id', $entries);
    $this->db->delete('category_posts');

    {!-- 1972 --}
    // delete parents
    $this->db->where_in('parent_id', $entries);
    $this->db->delete('relationships');

    // are there children?
    $this->db->select('relationship_id');
    $this->db->where_in('child_id', $entries);
    $child_results = $this->db->get('relationships');

    if ($child_results->num_rows() > 0)
    {
        // gather related fields
        $this->db->select('field_id');
        $this->db->where('field_type', 'relationship');
        $fquery = $this->db->get('channel_fields');

        // We have children, so we need to do a bit of housekeeping
        // so parent entries don't continue to try to reference them
        $cids = array();

        foreach ($child_results->result_array() as $row)
        {
            $cids[] = $row['relationship_id'];
        }

        foreach($fquery->result_array() as $row)
        {
        $this->db->where_in('field_id_'.$row['field_id'], $cids);
        $this->db->update('channel_data', array('field_id_'.$row['field_id'] => 0));
        }
    }

    // aaaand delete
    $this->db->where_in('child_id', $entries);
    $this->db->delete('relationships');
}

```

*** UPDATE ***

So I ported this to Apache and was given a 'clear' error:

```
A Database Error Occurred
Error Number: 1146

Table 'db.exp_relationships' doesn't exist

DELETE FROM `exp_relationships` WHERE `parent_id` IN ('217')

Filename: C:\TEST-ENV\DOMAIN\system\codeigniter\system\database\DB_driver.php

Line Number: 330

```

# Answer
> 0 votes
Try clearing the "Cached Relationship Entries" before you delete a site.

You can do this from the **Clear Cache** page in the control panel.

The relationship cache template in the database can become very large and is possibly the cause of the 500 error.

---
Tags: ee2, multi-site-manager, delete, iis, error-500
---


title: Update Expresso Store SKU

text:
# Question
Title: Update Expresso Store SKU
Is it possible to update the SKU for products in Expresso Store? Is there something I am missing? Inputting a new value and hitting submit on an entry isn’t saving the new value… HALP!

# Answer
Sounds like this is fixed by updating to Expresso Store version 2.0.3
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Refreshing on checkout page empties cart and redirects
I know why it's redirecting (b/c the cart is empty) but I'm not sure why refreshing on the checkout page is causing the cart to be emptied. Any idea? Latest install of all of the above, just upgraded.

# Answer
The question poster added a comment with the resolution... I'm posting it here as an answer:

**"Seemed to be an issue with our custom shipping module. Resolved"**
> 1 votes

---
Tags: add-on, cartthrob
---


# Question
Title: White screen of death when accessing Accessories in CP
I have been having this issue with multiple EE installs since about 2.5.5.

Everytime I try to go to Accessories in the CP, I get a white screen with no errors. I tried turning debugging on in my index.php but get no errors output. Any ideas?

I have nothing except safecracker on my site right now, I uninstalled and deleted everything else that wasn't default (add-ons/extensions/etc) to see if that would help also. My cache folder & contents are set to 777 permissions, my accessories folder is 755 (haven't changed that). I have no idea why I can't access the page.

# Answer
> 2 votes
I'm moving the question poster's comment here as an answer:

"... I can access the accessories page now. I believe it was a problem attached to the Devot:ee monitor add-on. I removed the cache for it and reinstalled it and was able to access the page again."

# Answer
> 3 votes
Have you tried disabling all extensions via the config file?

**/system/expressionengine/config/config.php**

```
$config['allow_extensions'] = 'n';

```

That will temporarily stop the extensions from loading but it doesn't remove them.

If you look in the database at the table `exp_accessories` what is listed in there? Try deleting any rows in there except the default EE Info, reload and try again. (If you do have any extensions that you wish to keep just make a note of them and install them again afterwards).

Reload and try again. Still a white screen of death?

---
Tags: add-on, control-panel, white-screen-of-death
---


# Question
Title: Expresso Store: Destination based sales tax
My client lives in Washington State and they have destination-based sales tax, meaning anytime they ship something to a customer within the state, taxes must be calculated based on the customers address (not just zipcode - that would be too easy). It's my understanding that roughly 20 states are now doing this with new ones adopting the process monthly.

This isn't something to snub our noses at -- it's the law in many of our states and our clients can get into serious trouble if they don't comply. Disappointingly I've emailed Exp:resso about this issue three times now asking for help and even offering to pay them to develop this, but have received zero response.

Does anyone have a solution for this growing problem?

# Answer
There are two issues here. The first is that in Store 1, taxes were calculated based on the billing address rather than the shipping address. This has been fixed in Store 2, and taxes are now calculated based on the shipping address.

Secondly, there is the problem that some states in the US have extremely complicated tax laws, where the correct tax rate must be determined based on the specific address (and even ZIP codes are not always granular enough to determine the correct tax rate). The only real solution to this is to use one of the API services available which will return up to date tax rates for each address. Store doesn't currently integrate with any of these services, but it would certainly be possible to build using the extension hooks.
> 1 votes

---
Tags: add-on, expresso-store
---


title: Field editor breaks grid

text:
# Question
Title: Field editor breaks grid
I use the "field editor" plugin a lot.

But it doesn't seem to work with the new grid fieldtype.

So it now just messes up channel fields with grid. I now can't delete the messed up field group.

```
A Database Error Occurred
Error Number: 1091
Can't DROP 'field_id_21'; check that column/key exists
ALTER TABLE `exp_channel_data` DROP `field_id_21`
Filename: libraries/api/Api_channel_fields.php
Line Number: 495

```

How do I delete the fieldgroup anyway?

# Answer
I think it will be enough to delete field record in exp\_channel\_fields table.

Go to EE CP SQL manager (CP Home \> Tools \> Data \> SQL Manager \> Database Query Form) or phpMyAdmin or any other mysql manager:

```
DELETE FROM exp_channel_fields where field_id = 21;

```

if you want to be sure that any pieces of your grid field was removed, execute query bellow line-by-line. Not all of them give you successful message, because not all records exist.

```
ALTER TABLE exp_channel_data DROP field_ft_21;
ALTER TABLE exp_channel_data DROP field_id_21;
DELETE FROM exp_channel_fields where field_id = 21;
DELETE FROM exp_grid_columns where field_id = 21;
DROP TABLE exp_channel_grid_field_21;

```
> 3 votes

---
Tags: add-on, grid, database-error, field-editor
---


title: Incorrect URL's being generated

text:
# Question
Title: Incorrect URL's being generated
I have an ee site, and in google webmaster tools it's generating some really random urls - and causing a big problem with duplicate title tags - but I can't figure out where they are coming from - an example url is:

http://www.oceanindependence.com/yacht-sales/yachts-for-sale/caprice/P12

but then google seems to keep finding more links the same but with different pagination on the end, ie /P108 /P216 etc... I have added in a 301 redirect to get the page to point correctly, but this doesn't fix where the link is coming from in the first place

The weird part is, that the 3rd segment should be the pagination eg ( http://www.oceanindependence.com/yacht-sales/yachts-for-sale/P12 ) but somehow an extra segment is being added in before this and google is finding it from somewhere

In the template for yachts-for-sale, the only link code is: - which for me all seems to work correctly

Am hoping someone may have encountered something like this before and maybe have a solution?

I am using ee 2.7.0 and structure (but I don't think this is structure related)

Cheers Jonny

# Answer
I just check your site using Integrity and it looks like you don't have this urls any more. Possible you had something in your old templates (I can see that Google cache had another design for pages like /caprice/P12).

I believe soon all old links will be removed by Google because of Status : 301. Just need to wait.

I saw also that you start using

```
<link rel="canonical" href=""/>

```

which will protect your urls from duplication.
> 3 votes

---
Tags: error, url, pagination
---


# Question
Title: How to optimise channel entries call with custom fields and lots of matrix data
The following call is proving problematic from a page load perspective:

```
{exp:channel:entries channel="channel" limit="1000" disable="categories|member_data|trackbacks|pagination" search:product_year="2004|2005|2006|2007|2008" dynamic="yes"}

```

Firstly, I call this in a simple if conditional based on url\_segments so it should be parsed early but the use of else means it is advanced and not simple in EE speak.

```
{if segment_2 == ""}

{if:elseif segment_4 == "archive"}

***the code***

{if:else}

{/if}

```

I cannot disable custom\_fields as I need to search them as shown.

Bug debugging the template shows that 5 of the 6 seconds it takes this page to load is repeated calls by Matrix to grab this data.

```
(0.418034 / 43.67MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata

```

etc etc

Annoying it only happens on the template\_group/index/ page as the category indexes are limited to just the number of entries for that category and not the site total (approx. 4000). Essentially all the matrix data is loaded for all entries on the index page even though I am only outputting categories.

Anyway I can disable specific custom fields or only make these data calls where it is required? I tried using an embed for the code, but according to the debug the matrix calls are still made.

UPDATE:

Managed to solve this - tried the embedded templates again and it worked this time.

# Answer
> 2 votes
Using embeds to ensure they are parsed after advanced conditional eventually worked for me.

---
Tags: matrix, conditionals, parse-order
---


# Question
Title: Matrix multi upload - cells not appearing
im running expression engine 2.7, matrix 2.5.6 with matrix multi upload 1.1.1

matrix fields can upload images no problem, but matrix multi upload doesnt create new cells once the images upload. I don't get any errors, the upload files show images are uploaded but the cells do not appear.

Please help, thanks in advance.

# Answer
> 2 votes
I've noticed Matrix MultiUpload is very fussy about paths and domains:

On a site (with identical build versions as yours) that is set up to be accessed via "www." and without prefix, or via an alternate domain alias, the control panel worked fine using either address, too – except for Matrix MultiUpload.

So, you might want to make sure that your site url configuration is identical to the hostname you entered in order to access the control panel.

---
Tags: matrix, pixelandtonic
---


# Question
Title: Linking EE Members with a Bulk Email/SMS Application
I would like to export/link member data to an Email/SMS app. When a member registers I would like it to automatically add the new member details to the app and also be able to update details through the API from the EE site.

I have an API guide from them which has all the Restful API & XML requests but need an idea of were I should go from here: http://live.everlytic.net/api/2.0/docs/classes/Contacts.html#CreateContact

Any idea where I should start? Useful tutorials or extensions to use.

# Answer
> 1 votes
I don't know if there are existing add-ons that support what you want to accomplish. You will most likely need to create a custom extension using:

---

For example (*I haven't tested this code*):

```
require_once PATH_THIRD . 'you_ext/lib/subscription_api.php';

function member_member_register ($data, $member_id)
{
    $url = 'http://live.everlytic.net/api/2.0';
    $apiKey = 'zyb8IwQVRf71siy1Pv8HO5szmv0jqppW';

    $api = new MailerSubscriptionApiV1_0($url, $apiKey);

    // Contact - create
    $contact = array();
    $contact['contact_mobile'] = '333333333';
    $contact['contact_email'] = $data['email'];
    $contact['contact_name'] = $data['screen_name'];
    $contact['contact_lastname'] = '';
    $listIds = array(1, 2);
    $result = $api->createContact($contact, $listIds);
}

```

---
Tags: php, export
---


# Question
Title: CE Img breaking pages in Grid/Matrix when size parameters specified
I've tried setting up an image gallery using CE Img and the new Grid fieldtype but it's giving white screens. The code looks like:

```
{image_gallery}
    <li class="item">
        {exp:ce_img:pair src="{image_gallery:image_file}" width="300"}
        <a href="{image_gallery:image_file}" class="img-fb" rel="gallery">
            <img src="{made}">
        </a>
        {/exp:ce_img:pair}
    </li>
{/image_gallery}

```

I've found that the same code works fine in the standard content entries, but not in the blog channel.

I've tried stripping out all the other template code apart from the above code inside a minimal channel entries tag pair, but it still gives white pages with no HTML in it. I've tried on local and development servers. I've tested the CE Img is working on other images and it is fine. I've tried switching to Matrix instead of Grid, but still breaks (altho also breaks in content channel too now) I've also tried the {exp:ce\_img:single} tag and it still breaks.

What does work: I've tried the Grid code with and it's fine. I've tried the Grid code, with the exp:ce\_img:single tag but **without** specifying the width or height and it **does** work. As soon as I specify a width/height in the ce\_img tag it breaks.

The above code snippet, without the width="300" works fine.

So what could be causing the page to break, simply by specifying the width or height of the image?

(Running EE 2.7.2 build 20131008 and CE Img 2.4.4)

# Answer
> 1 votes
> "Blank pages in ExpressionEngine, where the source is also empty, are usually the result of a suppressed PHP error."

Here are instructions for troubleshooting blank pages in EE:
http://ellislab.com/expressionengine/user-guide/troubleshooting/general/blank\_pages.html

---

With CE Image a white screen would indicate that PHP is running out of memory while resizing the image. The memory limit can be increased in your .htaccess file or php.ini file (depending on your server setup). More detail can be found here: http://brandnewbox.co.uk/support/details/increasing\_php\_memory\_limits

# Answer
> 0 votes
I don't think this has anything to do with the Grid fieldtype, but rather the allotted amount of memory that PHP has on your server(s) in relation to the size (and/or complexity of the manipulations) of the images that are being processed. Please take a look at this other StackExchange answer: https://expressionengine.stackexchange.com/a/13129/936

When not specifying a width or height, the original image will be used. In other words, PHP will not run out of memory when a width or height are not specified, because PHP will not be resizing the image.

---
Tags: matrix, ce-image, grid
---