title: Assets Channel Form errors

text:
# Question
Title: Assets Channel Form errors
Heyo,

I've got an Assets field in a Matrix. I can upload to S3 and Local upload directories while in the CP. When I try to upload to either S3 or local directories in my Channel Form page, I get the following error message:

"Could not upload the file - server returned an unexpected response. Please check the server settings".

If I replace the Assets field with a EE File fieldtype, it works fine, but we'd prefer to be using S3, hence the love for Assets.

\*I haven't tried just a stand alone Assets field instead of a field in a matrix, but I don't think that will fix the problem.

# Answer
It turned out that the fix mentioned above only fixed in my local install. The issue was in the actual PDF file itself. I was able to turn of XSS detection on uploaded files for the time being, and it fixed my issue.
> 0 votes

---
Tags: assets, pixelandtonic, channel-form
---


# Question
Title: Expresso Store: 'Variants' 3rd Party Dev Question
Following on from a question I had a couple months back (Disable certain Combination Variations), I now actually need to do it, and i'm kinda stuck a bit.

What i need to do is this:

Add a product with all its options. Disable certain variations from control panel. Set a price for a certain variation. Give a particular variation a description field Prevent users from selecting a particular variation on the front end (obeying the disabled variation option on the front end). Display description for a particular variation. Charge variation price.

It *looks* like I can do a lot of this with the *stock* section. I could use the SKU field for the description. Ok, its a hack, but it'd work.

I could also use the 'limit stock' button to disable a variation , but then, this kind of means that i'm using what may in future be a useful feature, so i'd like to avoid that.

My thinking is to replicate the 'stock' section in a way, with its own table, with all the fields i need.

So, I'm thinking hooks aint gonna cut it. I'm thinking that I probably am best to look at this as a new expression engine fieldtype that just so happens to require store to run.

I guess i'm just looking for any thoughts, or perhaps even a bit of confirmation that a new ee fieldtype would be the best way to approach this (and then using hooks to override product pricing).... because a big concern is whether or not i'll actually be able to do the frontend stuff too.

I obviously want to do this in a way that means it can be reused... (and not get overwritten every time store release an update)

---

To furnish this question with a little more info about the original problem, here's my original question.

Disable certain Combination Variations

I'm selling a series of products, one of which is configurable. It has four options, but not all combinations are available, and different combinations will result in a different price.

# Answer
> 2 votes
Peter is right - how many products and variations you have will make a big difference to how you should approach this. For example, instead of using the SKU as a description, why don't you just have a single option group for each product. There's no harm in having options called "300mm - Mahogany" and "500mm - Plywood" and specifying prices for each one.

Of course this would quickly get out of hand if you have dozens of variations for each item, but if you're going to have to review each option anyway there isn't much difference really.

Another way you can approach this is to set it up as two separate channels, so each Store product only has a single variation/SKU. For example, you can create a channel called "Products", with a single entry called "Table". You can then create another channel called "Product Options", with custom fields for "Size" and "Material", and a relationship back to the original "Table" product. You can then create an entry in the Product Options channel, with Size=300mm, Material=Mahogany (both standard custom fields), and then set only the price in the Store Product Details field, and ignore Store's modifiers altogether.

This method works well if you only have a few main products, and lots of potential variations. It's much more flexible, with a slight trade-off of ease of entry for your client. However, it's also fairly easy to understand, and we've used it successfully in the past.

I wouldn't recommend creating your own custom field unless you're fairly confident with PHP and MySQL. It's certainly possible, but the way modifiers, options, and stock items work in Store is pretty complicated. To get an idea, take a look at the `exp_store_product_modifiers`, `exp_store_product_options`, `exp_store_stock` and `exp_store_stock_options` tables. If you can get your head around that first, then you should be ok.

---
Tags: expresso-store
---


# Question
Title: channel:entries and segment with Low Variables
This is my Low Variable **var="lv\_article"**:

```
{exp:channel:entries limit="1" channel="{segment_1}"}
     <h1 class="title">{title}</h1>
{/exp:channel:entries}

```

When it's parsed inside Stash, the channel data is not parsed when channel="{segment\_1}" is used:

```
{embed="structure/.model"}

{exp:stash:set name='main'}
   {exp:ifelse parse="inward"}
          {if segment_1 == 'science' AND segment_2 == ''}
                  {exp:low_variables:parse var="lv_article"}
          {/if}
  {/exp:ifelse}

{/exp:stash:set}

```

I tried {exp:channel:entries limit="1" channel="{segment\_1}" parse="inward"}, it doesn´t resolved the problem. Does someone knows how to resolve this problem??

Thanks in advance,

Stéphane

# Answer
> 2 votes
Looking at the content of your `lv_article` variable, you could just use the variable syntax instead of the tag syntax:

```
{lv_article}

```

Having early parsing enabled has no effect when using the tag syntax, only when using the above variable syntax.

---
Tags: channel-entries, stash, low-variables, parsing
---


# Question
Title: Safecracker error after upgrading from 2.6.1 to 2.7
I changed my tag pair from {exp:safecracker} to correspond with the new docs {exp:channel:form}. I even removed my tag pair and used the Basic Example from the docs with the same results.

```
A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$channel_form_lib

Filename: channel/mod.channel.php

Line Number: 5259

Fatal error: Call to a member function entry_form() on a non-object in /Users/bsartain/Documents/git/whitetailslam/admin/expressionengine/modules/channel/mod.channel.php on line 5259

```

I noticed some others having similar issues but none with the same error message as above.

Any help would be greatly appreciated!

# Answer
Ok, I've updated the error-ed line number 5259

from

```
return ee()->channel_form_lib->entry_form();

```

to

```
return ee()->channel_form->entry_form();

```

At the moment everything seems to be working correctly. Hope this helps!
> 1 votes

# Answer
I had this exact same error when I upgraded to 2.7 as well. For me it was a conflict with using a third party plugin specifically Profile:Edit. When I used any of the profile:edit tags on the same page as a channel:form tag it would throw that error. So I simply used one or the other on my different pages and not both at the same time.

I'm not 100% sure what the exact problem is but I think it has something to do with the $channel\_form\_lib being called more than once.
> 0 votes

# Answer
When you upgrade EE, installer automatically changes your all templates, but it only changes the templates in database. If you use templates in files, you have to change manually all your templates and replace {safecracker} tags with new {exp:channel:form} tags. Actually you can open the template in control panel, and copy/paste the automatically updated code to the template in file. It took my one night and few more grey hairs :) Hope this helps.
> 0 votes

---
Tags: safecracker, 2.7.0
---


# Question
Title: After upgrading to CartThrob 2.5, cart_items_info no longer working
I'm using EE 2.7.2, and just updated to CT2.5. After the update, the cart no longer populates product data inside the `{exp:cartthrob:cart_items_info}` tag pair.

For example, if I add an item using `{exp:cartthrob:add_to_cart entry_id="{segment_3}" quantity="1" return="cart/index"}`, as I have always done, I'm redirected to the cart, where I see a new line item, the title is blank, and item\_price, item\_subtotal and cart\_subtotal dollar amounts all return $0.00. If I add the same item again, the quantity updates, but the title is still missing as are the dollar amounts; similarly, if I add a different item the cart shows a new line item, but all the same data is missing.

Any insight would be great.

# Answer
> 2 votes
I looked into this further and it seems that the dynamic options are nor being picked up. I managed to create a fix for this to mod.cartthrob.php by adding:

```
$option_value = ($item) ? $item->item_options($field_name) : '';

```

after

```
$this->EE->TMPL->tagdata = $this->EE->TMPL->swap_var_single('option_field', $field_name, $this->EE->TMPL->tagdata);

```

on line 5021.

I haven't yet seen any problems with this.

---
Tags: cartthrob, checkout
---


title: Text excerpts in body text

text:
# Question
Title: Text excerpts in body text
I have news items and want to limit the body to 100 characters. Is there a built-in function to create text excerpts?

# Answer
> 2 votes
There used to be, not sure currently but I use this add on regularly; http://devot-ee.com/add-ons/hacksaw

Does all that and more:)

---
Tags: formatting, textarea
---


title: linking members and channel entries

text:
# Question
Title: linking members and channel entries
Is there a way within core EE or a third party add-on that can link members and channels?

Am building functionality where a member can upload personal files that will be stored as channel entries. The files will be accessed from the member home area by another member type.

Any help appreciated on how to tackle!

# Answer
> 2 votes
Zoo visitor and Profile:Edit are two third-party modules which allow you to store members in channel entries; relationships to other channel content then become as simple as a relationship field in the user channel. (this of course also means that you can leverage things like categories and status for members).

IF you didn't want to go down the route of third party stuff, as long as the logged-in member was uploading their own file, you could access their stuff only within their profile by using the author\_id="CURRENT\_USER" parameter of the channel:entries tag pair.

---
Tags: channel-entries, members
---


# Question
Title: Replace CE Image with Assets resizing images in templates?
This is probably a newbie question but I checked the docs and am a little unclear.

I'm currently using CE Image to resize images in templates. I'm upgrading a site to use Assets for file management - I am wondering if Assets allows for the same type of image manipulation in tempts. That is can it:

* Resize images when they are called in the template?
* Cache the resized image for efficiency?
* Accept a max-width and max-height parameters and resize to scale?
* Accept a resize quality parameter for the quality?

If not, is there another solution for using Assets alone?

Bonus question: Can it do these things using S3 for storage?

Many thanks in advance!

# Answer
> 5 votes
Assets does *none* of your four bullet points - these are all best done via CE Image as you're doing now (and it does all with aplomb). Why do you want to replace it? It's bar-none the best EE add-on for image manipulation (in the same way that Assets is the best file manager for EE).

Re: S3 - Assets *can* store your files in an S3 bucket, but if you're going to be resizing dynamically, then just store your master files locally and use CE Image's S3 integration instead.

---
Tags: assets, ce-image
---


# Question
Title: Load more tag related entries using Ajax
I am using Tag module (v 4.2.3) with EE (v 2.5.2),and I have requirement wherein on a products details page I have to show its 6 related products based on tags which I am achieving using the following expression

{exp:tag:related\_entries channel="product" entry\_id="{embed:entry\_id}" orderby="relevance" limit="6"} {title} {/exp:tag:related\_entries}

Now we have a button below the 6 related products,and on click of it we have to load 6 more related products.I am not able to exclude the existing 6 products on the page,I have the already loaded products entry\_ids but I am not able to write a expression of tag related entries with which I can exclude the already loaded products and load the next batch of 6 products. Please help me out in achieving that,I would be really thankful

Cheers Nisar

# Answer
> 1 votes
Have you tried the `offset=""` parameter? For example, to get the next 6 related entries:

```
{exp:tag:related_entries
   channel="product"
   entry_id="{embed:entry_id}"
   orderby="relevance"
   limit="6"
   offset="6"}

```

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


title: Master config produces Blank Screen

text:
# Question
Title: Master config produces Blank Screen
Same Issue as Master config – blank screen

I've also been having the exact same issues. I'm trying to run the files in a folder such as webaddress.com/staging/site\_name. I add this address to the environment config file, but I can't get anything other than a white screen on both the homepage and the CP login page. I have tested running the files at site root (public\_html) and this works perfectly. I assume the white screens have something to do with running the site within folders (ie. path problem in the env file). I have tested this on 2 different servers with the same results. Is there any reason why I wouldn't be able to use the following path for the staging environment...

```
case 'webaddress.com/staging/site_name' :
    define('ENV', 'stage');
    define('ENV_FULL', 'Staging');
    define('ENV_DEBUG', FALSE);
break;

```

I'm completely baffled and have tried everything. Any thoughts?

# Answer
> 3 votes
The switch in the `config.env.php` is based on the `$_SERVER['HTTP_HOST']` variable, which only contains the host name, not the subdirectories below it.

You'd need to do some serious reconfiguration of Master Config in order for it work with with different directories as environments, as it's designed to be using different servers for environments, such as somesite.dev, staging.somesite.com, www.somesite.com.

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


# Question
Title: Expresso Store for food ordering/delivery service?
Has anyone successfully used Expresso Store for food ordering/delivery? The biggest complication I can foresee is with choosing realistic time slots which the restaurant can easily control during their busy times.

# Answer
We were building a table booking/on-line food ordering system a-top Expresso Store for Our Canberra but we hit a number of problems, and ended up deciding to start developing our own shopping cart plugin from scratch.

We've performed a solid years worth of market research and usability testing with both end-users, restaurants and their staff and Expresso:Store just doesn't have the flexibility to really suit the online ordering workflow.

Early design alpha screenshot of our site:

The notable issues we faced:

* Expresso:Store backend management is horrible and too simple. You need to be able to edit orders, and preferably have complete design control over the layout.
* It's not really suited for allowing customers to edit line items in a sensible fashion, which you really require for food ordering. E.g. "No pickle on burger" and such.
* It's not flexible enough and the custom fields becomes a limitation really quickly.
* No ability to create phone/telephone orders from the backend (frontend isn't an option)

So, we've decided to start from scratch and built a plugin that:

* Has a Print interface allowing us to perform functions such as pragmatically send print jobs to kitchen/impact printers. (We're using Raspberry Pi's as the Print Receiver for the printers)
* Allows more complicated items to be created, such as attaching ingredients and components to the item for sale so the customer can customise it (e.g. Remove the pickle)
* Multiple backend layouts to suit the restaurant, E.g. for iPad layout, POS friendly layout (touch screen), desktop layouts, etc.
* Allows backend manual order/telephone order creation.
* Allows backend order modifications.
* SMS notification integration.
* Android delivery app (Shows delivery information + map to the driver)
* A whole bunch more that we're currently working on.

Here's a look at the backend as it looks currently (I've spliced 2 screenshots together). The entire backend is customisable, allowing us to create layouts suitable for specific business types (retail shop, MOTO business, cafe/restaurant, etc)

So all in all, if you want to do it properly - I really recommend you create the functionality from scratch with your own custom plugin.

I'll also point out, **none** of the businesses we originally approached were interested in partnering with us at the start, **until** we came back and showed them the printer integration. Restaurants just want the order to pop-out their printer, and be on their way. None of them wanted to have to use any other method to capture the orders information.

Here's what comes out the docket printer at the restaurant:
> 1 votes

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


# Question
Title: exp:cartthrob:is_in_cart always returns true
I am running EE 2.7.3 and Cartthrob 2.4

Trying to use this tag

```
{exp:cartthrob:is_in_cart entry_id="1234"}

```

But not matter what entry\_id I use the tag always returns true (1 actually)

The only way I can get to return false (0) is to leave the entry\_id param blank

I could be missing something but I think this is a bug?

---

## UPDATE

I set up a minimal test case with this being the only template code

```
{exp:cartthrob:is_in_cart entry_id="XXXX"}
{exp:cartthrob:debug_info}

```

I put 3 items in the cart entry\_id 3517 entry\_id 3518 on the fly dynamic item with no entry id

passing 'XXXX' to the tag is not a valid entry ID, but the tag still returns 1

if the cart is empty the tag returns 0 as expected

if I remove the on the fly product the tag returns 0 as expected

sounds like the issue has to do with on the fly products, does that help at all with troubleshooting?

# Answer
> 3 votes
There's a bug in CartThrob core files causing this. It's been corrected for the next release. You can go to:

cartthrob \> cartthrob \> core \> Cartthrob\_cart.php

find:

```
    public function find_item(array $data)
{

    return current($this->filter_items($data));

```

replace with:

```
    public function find_item(array $data)
{
    $filtered_items = $this->filter_items($data);
    if (!empty($filtered_items) && count($filtered_items) >0)
    {
        return current($filtered_items);
    }
    return FALSE;

```

That should fix it for you until the next release comes out with that fix included.

---
Tags: cartthrob
---


# Question
Title: Accessing MSM install without a domain/subdomain
We're developing the site on a test URL (server IP). Is it possible to access the the MSM site without setting it up as a sub-domain or domain - ie. is there a path I can use while it's in development?

e.g. 000.000.000.000/index.php/msm-site-two/

Hoping it's obvious, it's been a very long day and I've just installed it all... (copied relevant templates/channels...)

Ta.

# Answer
> 2 votes
You just need to create subfolder **msm-site-two** and put inside index.php with

```
$assign_to_config['site_name']  = 'msm-site-two';
$assign_to_config['site_url'] = 'http://000.000.000.000/msm-site-two/';

```

and your second site will be available by url 000.000.000.000/msm-site-two/

# Answer
> 0 votes
Thanks to Max it led me to a couple of things

On my server I needed to set the config paths in index.php like this:

```
$system_path = '../my_system/';
$assign_to_config['site_name'] = 'msm-site-two';
$assign_to_config['site_url']  = 'http://000.000.000.000/msm-site-two/';

```

**AND** *(this where I was going wrong and there's little in the docs, even though it's obvious:)*

In the MSM site's Cpanel General Configuration:

```
URL to the root directory of your site: http://000.000.000.000/msm-site-two/index.php/

```

**The trailing slashes were important for me. I guess that might be a server thing.**

---
Tags: multi-site-manager, server, subdomain, ip
---


# Question
Title: CartThrob 2.5 with Profile:Edit 1.1.8 Member Field Mapping Issue
I am using CartThrob 2.5 with Profile:Edit 1.1.8 and it will not let me map the the Profile:Edit member fields. All the dropdown menus are blank. Is this a bug?

Has anyone found a solution for this issue? I ma using EE 2.7.3, CT 2.5 and PE 1.1.8 and still can't map PE fields in CT. I have many fields setup in the channel but they do not show up on mapping page. Can anyone help?

# Answer
To sum up the fix:

1. Open P:E's config.php file. Change the file number from 1.1.8 to 1.1.81.
2. Go to EE \> addons \> modules \> run module updates

That should fix the whole thing. The root of the problem is that EE changed their extension hooks from safecracker to channel form from 2.5 to 2.7. P:E's set to change the hook, but it looks like it had been updated before EE had. Basically the hook in the database was wrong. CT was looking to see if P:E was installed based on the existence of that hook. There's a few places we'll fix in CT and P:E to rectify this for the next release. In the meantime, you can run the fix above if this happens to you.
> 1 votes

---
Tags: cartthrob, profile-edit
---


title: Cartthrob PHP Error when checking out

text:
# Question
Title: Cartthrob PHP Error when checking out
I have an issue with Cartthrob. When checking out, everything seems to be working ok. An email is fired, order entry created, but I am not returned to confirm page. I am using offsite payments.

The issue seems to be when creating an entry in the order entry and the fieldtype that is responsible with posting that.

Other things to note: CT v2.5 EE v2.7 I'm using Publisher by BoldedMinds Matrix for pricing options with CT

Anyone had this issue?

```
A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: cartthrob_order_items/ft.cartthrob_order_items.php

Line Number: 80

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at     /Volumes/Sites/www.domain.dev/system/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 809

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at     /Volumes/Sites/www.domain.dev/system/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 809

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /Volumes/Sites/www.domain.dev/system/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 809

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /Volumes/Sites/www.domain.dev/system/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 414

```

# Answer
> 1 votes
Having reviewed the problem and the relevant code, it appears that the data that's

Because the configuration is fairly complex I suggest you schedule a Phone/Skype appointment with the CartThrob/Mightybigrobot support team at http://support.mightybigrobot.com. A member of our support team can speak with your personally and will custom tailor a suitable solution to this issue.

In the order items field\_type you could find:

```
        foreach ($data as $i => $row)

```

around line 80 and change it to:

```
        if (!is_array($data) || empty($data))
    {
        $this->EE->load->remove_package_path(PATH_THIRD.'cartthrob/');
        return $data;
    }
    foreach ($data as $i => $row)

```

But I think what you'll find then is that order items aren't being created for some reason. Normally we'd expect order items to be created during the checkout process (if items exist in the cart), but I'm guessing here that for some reason the items aren't being created, or no data is being passed to the pre\_processor (which is in the field type)

If we can have a call, one of us can take a look at your specific setup and nail down the issue.

---
Tags: matrix, cartthrob, publisher
---


# Question
Title: CartThrob Multipage Checkout Example Templates?
I'm looking to create a checkout process with CartThrob over multiple pages. Checkout process will use a number of gateways, Paypal, Offline Payments as well as posting directly to an offsite gateway.

Page 1 will collect Billing and Shipping info. Then in the case that we need to take credit card details to post to the gateway, this will be done on page 2.

Wondering if anyone has some example code that may help me here. I'm still looking into the correct way of implementing this but some examples would help loads as the documentation only briefly mentions this in relation to the save\_customer\_info\_form tag, but is not giving me any clues on how to implement it.

# Answer
If you use the example installation for CartThrob, the default templates have an example of a multi-page checkout:

Assuming you do have that installed, you can go to:

cartthrob settings \> installation \> template variables and set the checkout page to "shipping" and a shipping page will show up as the first step in the checkout. There's a lot going on in those templates though, and frankly I prefer to start from scratch myself.

So to sum up the process:

1. You can use save\_customer\_info\_form (but I never do) I just use update\_cart\_form which will do the same thing, but will also allow you to update products if you need to.
2. Add whatever fields you want to capture. (you can find a list of all default acceptable fields here: http://cartthrob.com/docs/tags\_detail/save\_customer\_info\_form/) You can also add custom fields using the following syntax:
3. put a return parameter to take you to whatever next page you need or want in the flow. That could be a final checkout page, or a second page in the flow. Whatever you want. The return parameter is what you need.
4. For the payment page, you will need to make sure you've captured all of the required fields. Each gateway lists the required fields on its settings page. I've noted that in the comments below.

Here's a bare-bones example of a 3 page checkout

```
Billing (page 1)
{exp:cartthrob:update_cart_form return="store/shipping"}

         First Name: <input type="text" name="first_name"   value="{customer_first_name}" />

        Last Name: <input type="text" name="last_name"  value="{customer_last_name}" /><br />

        <input type="submit" name="Submit" />
{/exp:cartthrob:update_cart_form}

Shipping (page 2)

{exp:cartthrob:update_cart_form return="store/checkout"}

         Shipping First Name: <input type="text" name="shipping_first_name"  value="{customer_shipping_first_name}" />

        Shipping Last Name: <input type="text" name="shipping_last_name"  value="{customer_shipping_last_name}" /><br />

        <input type="submit" name="Submit" />
{/exp:cartthrob:update_cart_form}

Checkout (page 3)

{exp:cartthrob:checkout_form return="" }

<!-- you'll need to get the remaining required fields from the settings for your specific gateway
go to cartthrob settings > payments > select a gateway to edit / view its settings. If there are any required fields, they will be listed right above: Sample HTML of all fields accepted for this payment processor
-->
<!-- you won't need the automated gateway_fields output since you're capturing data as you go {gateway_fields} -->

<!-- example fields ... you may not need these… just depends on the gateway -->
Credit Card Number Number<input type="text" value="" name="credit_card_number" />
expiration year {exp:cartthrob:year_select name="expiration_year"  selected="{customer_expiration_year}"}
expiration month {exp:cartthrob:month_select name="expiration_month" selected="{customer_expiration_month}"}
<input type="submit" value="Checkout" />

{/exp:cartthrob:checkout_form}

```
> 4 votes

---
Tags: cartthrob
---


# Question
Title: How to add categories to a SQL query that outputs channel entry data
I'm trying to create a query that will output all the entries in a channel. I'm wanting to output the title, some custom fields, and the categories that the entry belongs to. Each entry will belong to one category in Category Group 1, and one category in Category Group 2 (as I'm using the excellent Category Field add-on to ensure this).

I'm not great with SQL, so I've only worked out how to output the title and custom fields so far. I'm getting stuck on how to output the category names from each category group that each entry belongs to, so was hoping that someone could help me out with this.

Here's my SQL so far (stripped back as far as I can), and the two commented-out category fields are where I'd like the category names to appear (except I can't figure out how to add the extra joins to pull this information in - linking the entry ID with the exp\_category\_posts table, and pulling in the category name from the exp\_categories table). Thanks in advance for any help with this.

```
SELECT
  title AS 'Entry Title',
  field_id_1 AS 'Custom Field 1',
  # exp_categories.cat_name AS 'Category Group 1 Category Name',
  # exp_categories.cat_name AS 'Category Group 2 Category Name',

FROM exp_channel_data cd
INNER JOIN exp_channel_titles ct ON cd.entry_id = ct.entry_id
WHERE ct.channel_id = 4;

```

# Answer
> 6 votes
Not sure if it is best way to do this, but something like this:

```
SELECT
  ct.title AS entry_title,
  cd.field_id_6 AS custom_field_6,
  (SELECT ca.cat_name FROM exp_category_posts cp INNER JOIN exp_categories ca ON cp.cat_id = ca.cat_id WHERE entry_id = cd.entry_id AND ca.group_id = 1 LIMIT 1) AS cat_1,
  (SELECT ca.cat_name FROM exp_category_posts cp INNER JOIN exp_categories ca ON cp.cat_id = ca.cat_id WHERE entry_id = cd.entry_id AND ca.group_id = 1 LIMIT 1) AS cat_2
FROM exp_channel_data cd
INNER JOIN exp_channel_titles ct ON cd.entry_id = ct.entry_id
WHERE cd.channel_id = 2;

```

---
Tags: categories, query, sql
---


# Question
Title: Query error for CT Admin, Error # 1104: SELECT would examine more than MAX_JOIN_SIZE rows
When we visit Cartthrob CT Admin (D=cp&C=addons\_modules&M=show\_module\_cp&module=ct\_admin&method=orders), it throws following sql error( error no 1104)

```
A Database Error Occurred
Error Number: 1104

The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay

SELECT ect.entry_id, ect.title, em.member_id, field_id_38 AS first_name, field_id_44 AS last_name, field_id_34 AS email, ect.status, field_id_23 AS order_total, entry_date FROM exp_channel_titles ect, exp_channel_data ecd LEFT JOIN exp_members em ON field_id_34 = em.email WHERE ect.entry_id = ecd.entry_id AND ecd.channel_id = '4' GROUP BY ect.entry_id ORDER BY entry_date DESC LIMIT 0, 10

Filename: third_party/ct_admin/libraries/Ct_admin_orders.php

Line Number: 198

```

Somebody suggests to run the following query before that query

```
SET SQL_BIG_SELECTS=1

```

But i don't want to change the code. is there any other setting we can do in my.conf so that it will be resolved?(Also i don't want to set any query which need to run again if we restart mysql server).

Btw, We're using EE 2.5.3 and Cartthrob 2.1.5 PHP 5.4.6 and Mysql 5.6.12

Thanks

# Answer
> 3 votes
You can just add it into your my.conf:

```
max_join_size=#
sql_big_selects=1

```

but is better to ask CT Admin dev team to add it into code.

---
Tags: cartthrob
---


title: Creating A-Z index for entries

text:
# Question
Title: Creating A-Z index for entries
sorry again for my bad english...

i'd like to create a A-Z list for my entries (recipes) and show them if i click on the related letter. This code below showing entries by first letter and it's ok but how can i show also empty letters as well?

```
<?php $temp = ''; ?>
    {exp:channel:entries channel="recipes" orderby="title" sort="asc"}
    <?php
    $letter = strtoupper(substr('{title}', 0, 1));
    if ($temp != $letter) {
        echo "<button data-role='letter-loader' class='button-big button-overlay'>" . $letter . "</button>";
        $temp = $letter;
    }
    ?>
    {/exp:channel:entries}

```

i need something like this, where inactive letters are showing as well:

Thank you all

# Answer
> 2 votes
Low Alphabet is great and you will get excactly wat you want

# Answer
> 2 votes
Low Alphabet was created for this exact purpose.

---
Tags: ee2, php, list
---


# Question
Title: Trying to move a matrix field to another channel
We are using expressionengine as a cms. I'm trying to split a big channel into separate channels. At the moment we have several events with an agenda (which is a matrix field). Now I'm trying to "migrate" or "move" the complete matrix field into an own channel called "agenda" and replace it with an playa field in the original "events" channel.

Does anybody has a suggestion to do this?

# Answer
The way I do this is via phpmyadmin. In exp\_channel\_fields change the group id to the group you would like it to be in. Hope this helps
> 1 votes

# Answer
I can't give you a fish, but can show direction. Not sure regarding Playa part (don't have it) but something like this (*make sure that you have DB backup before run this code*), run from EE template:

```
<?php

$new_channel_id = 2;
$new_field_group = 2;
$field_id = 10;
$playa_field_id = 11;

// array where we keep rel between old entry and new one (for playa)
$entry_rel = array();

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

#get all matrix records
$query =$this->EE->db->query( "SELECT DISTINCT(entry_id)
                                           FROM exp_matrix_data
                                           WHERE field_id = $field_id
                                           " );

if ($query->num_rows()) {
    foreach ($query->result()  as $field)
    {
        //create new entry
        $data = array(
            'title'         => 'my new  entry with matrix',
            'entry_date'    => time(),
            'edit_date'     => time()
        );

        if (ee()->api_channel_entries->submit_new_entry($new_channel_id, $data) === FALSE)
        {
            print ('An Error Occurred Creating the Entry');
        }

        // get new entry_id
        $entry_id = $this->EE->api_channel_entries->entry_id;
        $this->EE->api_channel_entries->entry_id = NULL;

        $query =$this->EE->db->query( "UPDATE exp_channel_data
                                       SET field_id_$field_id = 1
                                       WHERE entry_id = $entry_id
                                     " );

        // link matrix record to new entry
        $query =$this->EE->db->query( "UPDATE exp_matrix_data
                                       SET entry_id = $entry_id
                                       WHERE entry_id = $field->entry_id
                                     " );

       $entry_rel[$field->entry_id] = $entry_id;
    }

    // link field to new group
    $query =$this->EE->db->query( "UPDATE exp_channel_fields
                                       SET group_id = $new_field_group
                                       WHERE field_id = $field_id
                                     " );
    // do playa rel.
    foreach ($entry_rel as $old_entry => $new_entry)
    {
            $data_rel = array (
                        'parent_entry_id' => $old_entry
                        'parent_field_id' => $playa_field_id
                        'child_entry_id' => $new_entry
            );

            $query =$this->EE->db->query( "UPDATE exp_channel_data
                                       SET field_id_$playa_field_id = "[$new_entry][my new  entry with matrix][my_new_matrix_url_title]"
                                       WHERE entry_id = $old_entry
                                     ");

            $this->EE->db->insert('exp_playa_relationships', $data_rel);
    }
}
?>

```
> 1 votes

---
Tags: matrix, playa
---


title: Conditionally set a Stash value

text:
# Question
Title: Conditionally set a Stash value
I'm using Stash to set a value like so;

```
{exp:stash:set_value name="head_title" value="{title}"}

```

However, I have now added a new channel field {news\_meta\_title} and would like to pass this as the value of "head\_title" if it has been entered, otherwise just use {title}.

I have tried doing this, but it didn't work;

```
{if news_meta_title}
    {exp:stash:set_value name="head_title" value="{news_meta_title}"}
{if:else}
    {exp:stash:set_value name="head_title" value="{title"}
{/if}

```

I was wondering if anyone had any pointers?

I know that it's all down to parse order, but not sure on how to resolve this.

# Answer
> 1 votes
There is in fact a `default=""` parameter available for Stash set, however it only comes into play if you define a match parameter to test the value being set against a regular expression:

Thus this will do what you want:

```
{exp:stash:set name="head_title" match="#^\S+#" default="{title}"}{news_meta_title}{/exp:stash:set}

```

One problem with this approach however is that if you pass a variable as a default value (e.g. `{title}`) - and that value contains double quotes - that will blow up the parameters and throw a template parse error.

Switchee provides a simple way around this problem because you can pass a *reference* to the Stash variable to evaluate (rather than the variable value itself) by prefixing the name with `stash:`

```
{exp:stash:set name="head_title"}{news_meta_title}{/exp:stash:set}

{exp:switchee variable="stash:head_title" parse="inward"}
    {case value=""}
        {exp:stash:set name="head_title"}{title}{/exp:stash:set}
    {/case}
{/exp:switchee}

```

Alternatively, blocks allow you to provide a fallback value when you *get* the variable - this can be useful if alternative markup is required when the default value is used:

For example:

```
{exp:stash:set name="head_title"}{news_meta_title}{/exp:stash:set}
{exp:stash:set name="entry_title"}{title}{/exp:stash:set}

{exp:stash:block name="head_title"}
    {!-- fallback value if "head_title" is empty --}
    {exp:stash:entry_title}
{/exp:stash:block}

```

# Answer
> 1 votes
I guess you could wrap that whole block with `{exp:stash:parse process="end"} ... {/exp:stash:parse}` to make it all parse at the end. Like this

```
{exp:stash:parse process="end"}
    {if news_meta_title}
        {exp:stash:set_value name="head_title" value="{news_meta_title}"}
    {if:else}
        {exp:stash:set_value name="head_title" value="{title"}
    {/if}
{/exp:stash:parse}

```

Mark's docs are here.

# Answer
> 1 votes
I **think** this might be due to using an advanced conditional, which I guess could result in parse order issues.

Maybe this would work:

```
{if news_meta_title}
    {exp:stash:set_value name="head_title" value="{news_meta_title}"}
{/if}
{if news_meta_title == ""}
    {exp:stash:set_value name="head_title" value="{title}"}
{/if}

```

If not, have you tried adding `parse="inward"` as Mark mentions in the documentation?

Alternatively, you could try this set-up instead, which works for me:

```
{exp:stash:set name="head_title" parse_conditionals="yes"}
    {if news_meta_title}
      {news_meta_title}
    {/if}
    {if news_meta_title == ""}
       {title}
    {/if}
{exp:stash:set}

```

---
Tags: stash, conditionals, switchee
---


title: Control Panel Speed

text:
# Question
Title: Control Panel Speed
There are many articles of advice about how to speed up the front end of an EE site, but very little about how to improve the performance of the Control Panel.

A client is constantly telling me their site's CP is slow. They're on a shared hosting plan - *at times* it does take a long time to load certain CP pages - such as adding and editing entries.

* Are there any hard, fast rules to speed up the CP?
* Is CP speed directly related to which addons are used / the amount of custom fields per entry?
* Does a faster server mean a faster CP?
* What would be an expected CP page load time?

I've just got a "Script executed in 0.5080 seconds - 211 SQL queries used" which seems pretty good, doesn't it? But the client reports (and I can confirm) that sometime page loads are 10 seconds plus+.

# Answer
> 10 votes
*Does a faster server mean a faster CP?*

**YES** In your case is "shared hosting" - sometimes can happens that some site which share the same resources (DB or CPU) just take it all. So best advice for this - change hosting.

*Are there any hard, fast rules to speed up the CP?*

On shared hosting is not too much ways to speed up CP. You need to analyse CP page one-by-one to find possible cure/reason.

For example you can try to disable Ellislab news/new version feed update.

If your publish page works slow - you can check if you don't have too many authors. Some site give authors right for Member group, but spammers can create thousandth accounts. As result - you will have a huge mysql select.

etc.

*Is CP speed directly related to which addons are used / the amount of custom fields per entry?*

**YES** \- some accessories or ext. can made your CP work slow.

*What would be an expected CP page load time?*

Is dependent on server resources/settings / specific CP page content.

---
Tags: control-panel, admin, speed
---


title: Error with Structure Listing entries

text:
# Question
Title: Error with Structure Listing entries
```
EE: 2.7.1
Structure: 3.3.12

```

Here's what I'm doing when I get the error below:

1. Created a Template group `listings` and a template in that group called `contacts`.
2. Created a channel `contacts` with a few fields.
3. Went to Structure CP

* Channel: Contacts
    * Type: Listing
    * Options: `listings/contacts`
4. Went to EE CP to create a new entry in the `contacts` channel.
5. Entered data into fields, then in the 'Structure' tab, I selected:

* Structure Page URL: \[autofilled from field entries\]
    * Structure Template: `listings/contacts`
    * Listing Channel: \[selected `Contacts`\]

And we're getting this error:

# Answer
> 1 votes
Make sure you're running the latest version of EE and Structure.

---
Tags: error, structure
---


# Question
Title: HTML emails not sending (Exp:resso Store v1.6.5)
For some reason, Exp:resso is not sending HTML emails. It sends plain text emails fine, and ExpressionEngine's Communicate is able to send HTML emails no problem.

I've trawled through the settings but can't find anything wrong.

Any help is greatly appreciated!

# Answer
> 1 votes
If plain-text emails are being sent and EE is also sending HTML emails then what's likely is that they're being sent but not reaching their destination for some reason. The best approach here is to use an SMTP sending service such as SendGrid which is not only more reliable in delivery but also able to provide you with information if there is a problem with the send for some reason. From this you'll be able to find out what the problem is.

I'm pretty sure it'll only be a minor detail. There's no reason why HTML emails wouldn't be getting through and giving things a test I can confirm they send fine from my local setup.

---
Tags: expresso-store
---


title: Error V6059 upon checkout within store

text:
# Question
Title: Error V6059 upon checkout within store
Whats this error supposed to mean? V6059

```
                    {if error:payment_method}
                        <div class='error-panel'>Error: {error:payment_method}</div>
                    {/if}

```

# Answer
From the error message it looks like you're using eWay Rapid as your payment gateway. Error code V6059 is a "Redirect URL Invalid" response.

Ensure that you're using the correct tags in your template. In particular you need to ensure you're using the `{exp:store:payment}` tag and not `{exp:store:checkout}`. This is to deal with their rather different *transparent redirect* gateway.

Also ensure that you have the other input fields named accordingly. More information on this in the docs.

Finally, if you're still having problems with the redirect getting back to your site it could be an issue with Secure Forms. You can try turning these off to test but it should be resolved in the latest version of Store (v2.2.0). If you're upgrading then be sure that you're running EE 2.7+ as that is now a minimum requirement.
> 1 votes

---
Tags: expresso-store, error
---


title: Using Transcribe with Store

text:
# Question
Title: Using Transcribe with Store
Does anyone have any guidelines/experience/hints for working with Expresso Store and Transcribe?

Are there any particular gotcha's or associated problems? For example, I am unsure how I would change the generated emails?

Many thanks if anyone has advice.

Tom

# Answer
There are a few gotchas that you'll have to get around.

The first is that Transcribe creates translations of entries by creating an additional entry for the translated content and then relates it to the original entry. So if you use Transcribe on the channel you use for products in Store, you will have duplicate products (one for each language). As you can guess this can complicate things on the backend for features like reports in Store.

Another problem are the error messages that are generated by Store during the checkout process. They are uni-lingual and you won't be able to translate them. In this case I just checked for their existence with a conditional and set a class on the input so I could at least visually highlight them:

```
class="required{if error:shipping_name} error{/if}"

```

Then depending on the payment gateway you use you'll have to figure out a way to translate those error messages (for example using Stripe I just checked for the JS error messages returned from the service and replaced them with static translation variables from Transcribe).

For the generated emails, I just used one of the additional order fields from Store to hold the current language ID from Transcribe as a hidden field:

```
<input type="hidden" name="order_custom5" value="{transcribe:language_abbreviation}" />

```

You can then use that field's value as a conditional in the email message template:

```
{if order_custom5 == 'es'}
    ¡Gracias!
{/if}

```

You can't use Transcribe static text variables in the Store email templates so the translations will have to be hard-coded in the message.
> 5 votes

---
Tags: expresso-store, transcribe
---


# Question
Title: Pre-Sales: multiple content moderators and security
I'm trying to check if Expression engine is the correct product for a new project. I received the request from a customer to build a portal for a sporting association. This company organizes activities for a lot of different sports. Each of these sports have their dedicated content page(s) (with submenu). Each of these sports also has dedicated content editor(s) meaning which don't have access to the other sports. Each sports section should also have a dedicated agenda.

The main site will also have content moderators and a dedicated agenda for overall activities.

Could you advice me if Expression Engine is the correct product. Are their other alternatives? I need to be able to manage the security vary granular, common components in templates should not be modified by lower level moderators, etc...

Thanks, Eric

# Answer
> 0 votes
It sounds like ExpressionEngine could meet your needs. One straightforward approach would be to create a separate channel and member type for each sport. You would then assign rights to edit only that channel to each associated member type. These content editors would not have access to any of the underlying templates or data. Users with SuperAdmin (or similar) credentials could act as content moderators. Note, you can have each channel share the same channel fields so can avoid some of the redundancy between related channels.

You can read more about member groups and setting control panel permissions here: http://ellislab.com/expressionengine/user-guide/cp/members/member\_groups\_edit.html

---
Tags: php, general-knowledge
---


# Question
Title: Need to add a Zoo Visitor to mailchimp on registration - options?
I'm using Zoo Visitor to handle membership on an EE2.6.1 site and my client would like members to have the option to add themselves to their mailchimp account when filling out the member registration form. I'm seeing a number of mailchimp add-ons on Devot-ee but none that mention zoo visitor. What are my options? Any one been succesful in doing this?

# Answer
> 2 votes
Does this help from the Zoo Visitor docs? http://ee-zoo.com/docs/visitor/tutorial/mailchimp-integration.html

# Answer
> 1 votes
I've tried to use that, but the extension is not really maintained, see http://devot-ee.com/add-ons/support/zoo-visitor/viewthread/8499. Would love to know if it works now, but I have my doubts.

If that still fails, you could insert a script directly in ext.zoo\_visitor.php on line 337 with the api file next to it:http://www.joshuawinn.com/subscribe-to-mailchimp-newsletter-option-on-contact-form/ But then maintenance might be an issue.

I ended up with a two step process: during subscription, if someone activates the tick box for mailing, after submit they will be directed to a page with hidden fields and the subscription button that leads directly to mailchimp. So that's one click extra.

Didn't see it was you Erwin, you can check it in Dutch here: http://divmo.nl/klanten/login (aanmelden)

# Answer
> 0 votes
I couldn't get the SL MailChimp Subscribe add-on to work in 2.7.2. I was able to do the following, though:

Setup a checkbox field, called `optincheckbox`, with a value of "y". Install MailChimp EE, and add something like this to your template in an area where your members will be logged in:

```
 {exp:zoo_visitor:details}
    {if visitor:member_optincheckbox == "y"}
        {exp:mailchimp_ee:subscribe
            api_key="KEY HERE"
            list_id="KEY HERE"
            email_address="{visitor:email}"
            interest_groups='GROUP HERE'
            merge_fname='{visitor:member_firstname}'
            merge_lname='{visitor:member_lastname}'
            double_optin='no'
        }
    {if:else}
        {exp:mailchimp_ee:unsubscribe
            api_key="KEY HERE"
            list_id="KEY HERE"
            email_address="{visitor:email}"
        }
    {/if}
{/exp:zoo_visitor:details}

```

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


# Question
Title: Solspace Freeform not updating, mySQL error?
I'm getting database errors when trying update Freeform.

I think I've narrowed it down to one specific mySQL statement, but I don't know enough about mySQL to know what's wrong, I just know that this section from `db.freeform.sql` causes a syntax error at line 4:

```
CREATE TABLE IF NOT EXISTS `exp_freeform_fields` (
    `field_id`                      int(10) unsigned    NOT NULL AUTO_INCREMENT,
    `site_id`                       int(10) unsigned    NOT NULL DEFAULT 1,
    `field_name`                    varchar(150)        NOT NULL DEFAULT 'default',
    `field_label`                   varchar(150)        NOT NULL DEFAULT 'default',
    `field_type`                    varchar(50)         NOT NULL DEFAULT 'text',
    `settings`                      text,
    `author_id`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `entry_date`                    int(10) unsigned    NOT NULL DEFAULT 0,
    `edit_date`                     int(10) unsigned    NOT NULL DEFAULT 0,
    `required`                      char(1)             NOT NULL DEFAULT 'n',
    `submissions_page`              char(1)             NOT NULL DEFAULT 'y',
    `moderation_page`               char(1)             NOT NULL DEFAULT 'y',
    `composer_use`                  char(1)             NOT NULL DEFAULT 'y',
    `field_description`             text,
    PRIMARY KEY                     (`field_id`),
    KEY                             (`field_name`),
    KEY                             (`site_id`)
) CHARACTER SET utf8 COLLATE utf8_general_ci ;;

```

Can anyone spot the issue?

Update: for what it's worth, I just tried to install the latest Freeform for the first time on a different EE installation and got the same error.

# Answer
I think perhaps there was a bad character in my version of the Freeform files. I was able to copy and paste the statement from above and run it successfully, but copy and pasting from the file itself throws an error.

Anyway — after running all the statements in `db.freeform.sql` individually, all seems well now, thanks for looking.
> 1 votes

---
Tags: solspace-freeform, solspace, mysql
---


title: Can't logout after EE 2.7.3 update

text:
# Question
Title: Can't logout after EE 2.7.3 update
I just upgraded one of my sites from EE 2.5.2 to 2.7.3 and everything seemed to go fine, but now on the front end when a user attempts to log out they get this error:

```
**The following errors were encountered**

You are not authorized to perform this action
Return to Previous Page

```

Anyone know why this is or how to fix it?

# Answer
> Based on @Max Lazar's comment I was looking over our "logout" code vs. the code given in EE's documentation and I noticed this difference, we use this code: Log Out, but the docs say to use {path='logout'}. Does it matter?

I solved the mystery. The question I made above ^^^ was key and I probably should have just tried it from the get go. Turns out it was the answer. While the `ACT=10` is the right action for logout in my install the problem is that the URL generated doesn't include the XID value which EE 2.7 now requires.

So you MUST use the EE tag `{path='logout'}` to generate logout URLs and link because it will also add an `XID={hash}` so that the logout submission is authorized.

**UPDATE** I discovered that you could also add the XID value to your path by using the `{XID_HASH}` global tag. So in addition to changing my logout link to use `{path='logout'}` I believe I could have also done:

```
<a href="{path='?ACT=10'}&XID={XID_HASH}">Log Out</a>

```
> 7 votes

# Answer
Check and update all your add-ons first. One of the difference between 2.5.2 & 2.7.3 is that now XID hash code is mandatory for all forms. Many add-ons don't used it before, as result - **You are not authorized to perform this action** after EE update. For member\_logout function XID is also mandatory.

```
$xid = ee()->input->get('XID') ? ee()->input->get('XID') : '';
    if ( ! ee()->security->secure_forms_check($xid))
    {
        return ee()->output->show_user_error('general', array(lang('not_authorized')));
    }

```

Possible you use something like FreeMember.
> 2 votes

---
Tags: ee2, members, ee2-upgrades, logout
---


# Question
Title: Getting around pagnation in parent relationships
I confirmed with EE that as of yet there isn't support for pagnation in a parent relationships.

Was wondering if anyone else encountered this issue and what solutions you've employed to get around it?

# Answer
Check out Better Pagination by Bold Minded/Brian Litzinger.

You should be able to achieve what you need using the limit and offset parameters with that add-on.

On GitHub: https://github.com/litzinger/better-pagination.eeaddon
> 2 votes

---
Tags: ee2, relationships, pagination
---


# Question
Title: How to return P&T Dropdown option label within Channel Form
I'm having trouble returning the option label within a Channel:form tag.

The selected option value returns correctly using {my\_drowpdown\_field\_name}.

However, the option label is not returned using {my\_dropdown\_field\_name:label}.

I'd also like to display a list of possible options using the following:

```
    {options:my_dropdown_field_name}
            <option value="{option_value}"{selected}>{option_name}</option>
    {/options:my_dropdown_field_name}

```

This doesn't seem to be looping through the options. I have tried replacing {option\_value} with {my\_dropdown\_field\_name}.

Using EE 2.7.3 and P&T Fieldpack 2.1.1.

Thanks for any help!

edit: just to clarify, {my\_dropdown\_field\_name:label} works fine within Channel:entries tags.

# Answer
> 1 votes
You're prefixing "options" to the field name instead of prefixing "options" with the field name.

i.e. use

```
{my_dropdown_field_name:options}

```

instead of

```
{options:my_dropdown_field_name}

```

---
Tags: pixelandtonic, channel-form, pt-dropdown
---


# Question
Title: How can I show rating:entries that contain both ratings AND reviews?
I'm using the Solspace Rating module and I'd like to be able to display rating:entries that contain a review.

It seems like I can exclude unrated or show only unrated, but how can I filter to show only rating:entries with both a numeric rating AND a review?

# Answer
You could do it with conditionals inside the rating:entries loop to test to see if the rating field is filled:

```
{if review}
Show the rating entry
{/if}

```

In the example above "review" is the name of the review field.

But that means you won't get an accurate `{if rating_no_results}` because the tag could still return results that are not displayed due to the conditional.
> 2 votes

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


title: Can't get Discussion Form Update to run

text:
# Question
Title: Can't get Discussion Form Update to run
I'm attempting to upgrade my EE Discussion Form Module from version 3.1.8 to 3.1.14 in my EE 2.7.3 environment. I followed the upgrade instructions, but when I access the `Add-ons > Modules > Discussion Forum` page in the CP nothing happens. The module doesn't seem to update. The only odd thing I see is that the change log for the module shows entries for 3.1.5 and then jumps to 3.1.14. There doesn't seem to be version 3.1.6 - 3.1.13 and I'm on version 3.1.8. So could the issue be that the module update scripts aren;t recognizing my version as one available for upgrade?

# Answer
> 0 votes
And once again it seems I was a bit too quick to post a question. I was able to force the update to run my clicking the `Run Module Updates` button on the Modules page. So I guess the follow up questions would be Why? and Shouldn't accessing the modules control panel page still triggered the update?

---
Tags: module, forum, updating, discussion
---


title: Date math using segments

text:
# Question
Title: Date math using segments
I need to take `{segment_n}` where the segment is either a Month, Day, or Year value and add values to it. For example, I need to be able to add values like so:

```
{embed="calendar/landing" month_start="{segment_2}" month_end="{segment_2} +1 month"}

```

# Answer
There wasn't really a question here, but... :)

If you're using Solspace Calendar, which I assume you are since you've tagged it as such, you don't have to do this calculation, it's already built into the addon. For instance, you could do this:

```
{exp:calendar:cal date_range_start="{year}-{segment_2}-first" date_range_end="+1 month"}

```
> 3 votes

---
Tags: solspace, date, solspace-calendar, date-format, mx-calculator
---


title: CE Cache only caching logged user

text:
# Question
Title: CE Cache only caching logged user
Installed CE Cache and deployed. Funny thing is that it only caches something when i'm logged on (changed to cache in db and found out). If i use another browser to simulate a logged off user, it doesn't cache.. What could be wrong?

# Answer
Doh! Found out that this option in config.php should be set to "yes":

```
$config['ce_cache_fragment_logged_in_only'] = 'no';

```
> 2 votes

---
Tags: ce-cache
---


# Question
Title: How do I use notifications in Solspace Rating?
I'm using Rating and I'd like to receive a notification email whenever a review is placed. It seems that there already is such a thing, but I don't know how to configure it. How do I select the email to which the email needs to be send? And how do I specify which templates needs to be used?

# Answer
The notification settings for each Rating form are set via the notify, admin\_template and owner\_template parameters.

The values which `admin_template` and `owner_template` correspond to are the notifications you setup in the Rating module control panel.

So, say you setup two different email notification templates called `admin_notification` and `owner_notification`, you could use these parameters on the Rating Form tag:

```
notify="admin@example.com" admin_template="admin_notification"

```

And/or:

```
owner_template="owner_notification"

```

The latter automatically sends an email using the specified template to the email address of the author of the entry being rated.
> 3 votes

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


# Question
Title: How do I find the full URL to an Structure managed entry via the regular channel loop?
```
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
    {exp:channel:entries channel="product" disable="member_data|categories|trackbacks|pagination|category_fields" rdf="off" dynamic="off" status="Open"}
     <url>
        <loc>{page_url} {title}</loc>
        <lastmod>{gmt_edit_date format="{DATE_W3C}"}</lastmod>
        <changefreq>weekly</changefreq>
        <priority>0.5</priority>
    </url>
    {/exp:channel:entries}
</urlset>

```

# Answer
> 1 votes
`{page_url}` should work; seems like an odd question, but, are you sure entries in the product channel have URLs? If they're managed by Structure as "Assets," they wouldn't have a URL, for example.

---
Tags: structure
---


# Question
Title: Exp-resso Store Shipping Select auto refresh
Can't seem to find an answer in the documentation, not sure a feature is even needed for this (might just need JS). Can't seem to figure it out though.

I'm using `{field:shipping_method}` to generate a select dropdown for shipping options. I'd like the total to update after a new shipping method is selected. How can I do this?

Right now I'm using:

```
$('#shipping_method').change(function(){
        location.reload();
 });

```

To reload the page but it's not retaining the information. It resets to default shipping option.

# Answer
> 2 votes
Not sure if the markup is entirely correct, but this works:

```
$("#shipping_method").change(function(e) {
    $(this.form).submit();
});

```

---
Tags: expresso-store, javascript, jquery
---


# Question
Title: Display image gallery on clicking separate image using Matrix
I've recently come across a bit of an issue that's got me stumped, here goes.

I have a Matrix field called {images} with the following fields within it;

* `project_image` (Assets fieldtype)
* `project_title`
* `project_additional_images` (Assets fieldtype)

On the front end of the site the `project_image` displays. However on clicking the `project_image` I would like to trigger a lightbox plugin (Swipebox) which in turn displays the multiple images added in `project_additional_images`.

My code is as follows

```
{images}

<li>
    <a class="swipebox" href="{project_additional_images:url}" rel="gallery-{row_id}">

                {exp:ce_img:single src="{project_image}"
                    crop="yes"
                    allow_scale_larger="no"
                    class="project-img" alt="{title}"
                    width="230"
                    height="230"
                    quality="100"
                    filter="auto_sharpen"}

     </a>

</li><!-- end item -->

{/images}

```

Is there a way to accomplish this. Looking at the code above, that currently only gets me halfway, in that it will only show a single image from the `project_additional_gallery` field. I would ideally need it to show multiple images. The `gallery-{row_id}` was a shot in the dark. If anyone offer some advice on this that would be much appreciated.

As you can see above, the chunk of markup also makes use of CE Image and Swipebox

Thanks Adam

# Answer
Since you're not displaying link to the other images anywhere in your template, you'll need to take a different approach. It looks like you can have Swipebox load images dynamically by passing it an array.

So start by adding your gallery images as a comma-separated list inside of a `data` attribute on your link:

```
{images}
<li>
    <a class="gallery" href="{project_additional_images:url}" data-images="{project_additional_images backspace="1"}{url},{/project_additional_images}">
        {exp:ce_img:single src="{project_image}"  crop="yes" allow_scale_larger="no" class="project-img" alt="{title}"  width="230" height="230" quality="100" filter="auto_sharpen"}
     </a>
</li><!-- end item -->
{/images}

```

Then your JavaScript gets a little bit more complex:

```
$('.gallery').each(function()
{
    images_string = $(this).data('images').split(',');
    images_array = [];
    $(images_string).each(function(index, el)
    {
        images_array.push({href: el});
    });
    $(this).click(function(e)
    {
        e.preventDefault();
        $.swipebox(images_array);
    });
});

```

Noticed I changed the class from `swipebox` to `gallery` so that the default Swipebox behaviour doesn't attach to the element.

This is untested, but it should get you close.
> 1 votes

---
Tags: matrix, assets, pixelandtonic, image-galleries
---


# Question
Title: solspace calendar: attach status or category to date specific date inside event
Is it possible to attach separate statuses, categories or some sort of unique hook to each **date** inside the same event when using solspace calendar?

I'm trying to use this for a theater, and the client wants to be able to label dates with stuff like "sold out", and "free" and so on. But these labels have to be attached to a specific date inside the event, not the event itself.

Possible?

# Answer
This can be done by visiting the **Events** tab in the *Calendar* control panel: http://www.solspace.com/docs/calendar/control\_panel/#events

In the **Occurrences** column, on the row associated with event you'd like to have occurrences adjusted, click on the *Edit* link. Then click on the occurrence for the given date/time you're wanting to adjust.

It loads up the Publish page and allows you to edit everything except for the Calendar date data itself. Once you Save that entry, it replaces the pseudo occurrence (that assumes data from the parent event entry) with an actual channel entry to store that different data. :)
> 1 votes

---
Tags: solspace-calendar
---


title: How to prevent idle session logout?

text:
# Question
Title: How to prevent idle session logout?
I can't seem to prevent auto logouts from happening (EE 2.7.1).

I have set the config item 'admin\_session\_type' to 'c', which is confirmed in the control panel (reads: 'Cookies only' in Security and Session Preferences).

I have also set the 'cp\_session\_ttl' to 3 days in the config, but logouts happen after 30 mins or so.

I have even printed config object in a template AND the control panel to double check that it's set right, and it is (output: \[user\_session\_type\] =\> c \[admin\_session\_type\] =\> c \[cp\_session\_ttl\] =\> 259200).

Anyone know why I'm being logged out all the time?

# Answer
On 30.01.2014 the EllisLab-Team published a patch which stops this behavior. Just upload a little Javascript and you are done - no more automatic logouts when you are idle!

Description + Download-Link here @ EllisLab Bugtracker
> 3 votes

# Answer
You should use "Stay Forever" extension.

http://johndwells.com/blog/stay-up-forever-take-control-of-ee-session-time-limit

http://devot-ee.com/add-ons/stay-up-forever

In this extension you can set control panel session length.
> 4 votes

# Answer
I found the solution to my problem. The logouts were caused by the login reminder feature, which detects if a session expires and allows you to quickly log back in. This quick login feature eventually expires and completely logs you out of the control panel.

I don't see why this feature should be active when I'm using cookies instead of sessions, and I don't think it's getting my 3 day session correct, but anyway, there's a hidden configuration variable to disable it:

$config\['login\_reminder'\] = 'n';

I haven't been auto logged out all day!
> 3 votes

# Answer
there is a hidden variable; john, the guy who has written this addon 2 years ago (and btw. is responsible for the most nice Minimee), has mentioned it.

in the file system/expressionengine/config/config.php try

```
$config['cp_session_ttl'] = 60000;

```

the number is the time in seconds.
> 2 votes

---
Tags: control-panel
---


# Question
Title: Expression Engine doesn't save changes when I click the Submit/Update button
Fairly regularly, when in the admin panel editing a template, creating post content, or even creating a channel entry - when I click the Update or Submit button it takes me to the admin panel home page and none of my changes have been saved. This happens several times a day. I have 3 different EE installs that I've tried from several computers and have the same problem on all three. One of the EE installs is completely vanilla with zero add-ons.

As a new EE user, I am really liking it except for when this happens because it eats up my time tremendously. Has anyone in the EE community had an issue like this before, or better yet have a solution? Thanks!

# Answer
> 0 votes
What version of EE is installed. I used to have the same issue on 2.7.2, but recently upgraded to 2.7.3 and haven't had the issue since *knock on wood*

---
Tags: ee2
---


title: jQuery LazyLoad for Assets images

text:
# Question
Title: jQuery LazyLoad for Assets images
I have an EE site that is using Assets to display large images (1080px wide) that stack vertically. I would love to use this LazyLoad jQuery script, however it is required to change the "src=" in the tag to "data-original="

In my EE install, I am using Assets to manage these images along with CE Image to resize. In my template, I have this Assets tag pair to output the images. I would wish to keep the CE Image single tag, only because I want it to output both the width (which should stay at 1080px), and variable height using "add\_dims=" parameter.

```
{gallery_items var_prefix="file"}
  {exp:ce_img:single src="{file:url}" alt="{file:alt_text}" max_width="1080" itemprop="image" add_dims="yes" class="lazyload"}
{/gallery_items}

```

If I simply change out the "src=", nothing seems to output. Any help would be great!!

# Answer
You need to use pair tag for this:

```
{gallery_items var_prefix="file"}
{exp:ce_img:pair src="{file:url}" max_width="1080" itemprop="image"}
<img data-original="{made_url}" class="lazyload" alt="{file:alt_text}" width="{width}" height="{height}" />
{/exp:ce_img:pair}
{/gallery_items}

```
> 2 votes

---
Tags: assets, pixelandtonic, jquery, ce-image
---


title: My First Plugin

text:
# Question
Title: My First Plugin
I am writing my first EE plugin and have finally hit a roadblock. Here is how it looks

```
        class Thank_you {

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

            $entries = $this->EE->db->from('channel_titles')->get();
    }
public function contacts()
    {

        $db2   = $this->EE->load->database('ext_db', TRUE);
        $query = $db2->select('FirstName, LastName, MealType')->order_by('id','DESC')->get('contact',10);

        $contacts = $query->result();

        return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $contacts);
    }

```

So the goal here is to pass an array of contacts to the template and iterate from there. All that I get with

```
{exp:thank_you:contacts}
        {FirstName}
    {/exp:thank_you:contacts}

```

Is an output of {FirstName}. Where am I going wrong on this.

Thanks!

# Answer
You need to loop through the query result and build an array containing your variables. Using the following code after your query should work.

```
if ($query->num_rows() == 0)
{
    return $this->EE->TMPL->no_results();
}

foreach ($query->result() as $row)
{
    $vars[] = array(
        'FirstName'     => $row->FirstName,
        'LastName'      => $row->LastName,
        'url_title'     => $row->MealType
    );
}

return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $vars);

```
> 3 votes

---
Tags: plugin
---


# Question
Title: Solspace pad_short_weeks and error with simplistic date formatting
We're starting our `cal` entry loop like so:

```
{exp:calendar:cal
  date_range_start="{embed:month_start}-{embed:day_start}-{embed:year_start}"
  date_range_end="{embed:range_end}"
  pad_short_weeks="y"}

```

So for something like `02-05-2014` and `+1 month` what is returned consists of exactly what we need (with a padded start to whatever Sunday happens to be for the given week).

However, when we use `pad_short_weeks="n"` in order to start the day at a specified time that is not whatever the current day is, it only goes until the range end from whatever the actual day is, irrespective of what is specified.

For example:

* today is the `5th`, and if the loops starts as `date_range_start="02-11-2014" date_range_end="+7 days" pad_short_weeks="n"` ends not on the `18th` as it should, but instead it ends on the `12th`, which is 7 days away from today. If it were the `6th` it would end on the `13th`, and so on.
* If we make the `pad_short_weeks="y"` it returns the correct range from the specified date (today, a later date, etc), **however** this has the undesired effect of starting on the beginning of the week instead of the specified date.
* And finally, if the date specified is more than `date_range_end` away, then nothing shows up (if and only if `pad_short_weeks="n"`).

Is this a bug or are we implementing it wrong?

Thanks.

# Answer
> 2 votes
The format for `date_range_start=""` and `date_range_end=""` parameters is **YYYY-MM-DD**, not MM-DD-YYYY.

---
Tags: solspace, solspace-calendar, date-format
---


# Question
Title: Making: View {# of entries} in {# of categories with entries}
Looking to create an overall stat statement that can return these stats:

View {# of entries in channel "distributors"} in {# of categories with entries within channel "distributors"}

Need it to only count the categories that have entries, not the empty ones. I know I can do that first portion, but wonder how to do the second. Also, can't quite figure out what combination of exp:channel tags I'd need to use.

# Answer
The most simple way in this case is use exp:channel:categories tag

```
{exp:channel:categories channel="news" style="linear" show_empty="no"}
    {if count == 1} {total_results} {/if}
{/exp:channel:categories}

```
> 1 votes

---
Tags: categories
---


# Question
Title: Zoo Visitor: Display Member Fields After Registration, Before Logging In?
When a new user registers for the site using Zoo Visitor, is it possible to grab any information from that profile and display it to the user before they complete the rest of the registration process (clicking link in confirmation email, logging in, etc.)?

For example, our registration template looks something like this:

```
{if last_segment == "success"}
   <h1>Thank You!</h1>
   p>In a moment, you'll receive an email from us with a link to activate your new account.</p>
{/if}

```

Is there a way to change `"Thank You"` to "`Thank You, {username}!"`?

Zoo Visitor's `{exp:zoo_visitor:details}` has parameters for selecting the user via different segments, etc., but, not sure how those might be used in this situation.

# Answer
> 1 votes
I think is safe enough just take the last record in DB:

1:

```
{exp:query sql="SELECT entry_id as member_entry_id FROM exp_channel_titles WHERE channel_id = 1 ORDER BY entry_id DESC LIMIT 1" parse="inward"}
        {exp:zoo_visitor:details member_entry_id="{member_entry_id}"}
            Thank You, {visitor:member_firstname} {visitor:member_lastname}!
        {/exp:zoo_visitor:details}
{/exp:query}

```

2:

```
{exp:query sql="SELECT username FROM exp_members ORDER BY member_id DESC LIMIT 1"}
        Thank You, {username}!
{/exp:query}

```

3:

```
{exp:zoo_visitor:members limit="1"}
    Thank You, {visitor:member_firstname} {visitor:member_lastname}!
{/exp:zoo_visitor:members}

```

# Answer
> -1 votes
Does this work.

Thank you {exp:zoo\_visitor:details}{visitor:username}{/exp:zoo\_visitor:details}.

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


title: Change path for cached images

text:
# Question
Title: Change path for cached images
My images are on this folder:

```
http://localhost/images/uploads/blog/

```

After i resize them using CE Image, they end up here:

```
http://localhost/cache/images/uploads/blog/

```

Is there any way i can exclude /images/uploads (using the plugin, not with .htaccess)? So that CE Image can save them in:

```
http://localhost/cache/blog/

```

# Answer
> 2 votes
You can try to play with parameter hide\_relative\_path and cache\_dir. Based on what u use for upload, you can make this like:

```
{news_image}
     {exp:ce_img:single src="{path}{file_name}" cache_dir="/cache/{location}/" hide_relative_path="yes"}
{/news_image}

```

---
Tags: ce-image
---


# Question
Title: Storing images entries on Google Drive or Amazon S3
sorry again for my bad english..

I'd like to use Amazon S3 or Google Drive as CDN for my images posts. I have a script that adds dynamic parameters at the end of the url image.

So if i have an image like:

```
<img src="http://mysite.it/images/image.jpg" alt="{title}">

```

my script automatically returns:

```
<img src="http://mysite.it/images/image.jpg&s=1200" alt="{title}">

```

Google drive do a fantastic scaling images on the fly *(try to change the number at the end of the image)*:

http://lh6.ggpht.com/VMLEHAa3kSHEoRr7AchhQ6HEzHVTn1b7Mf-whpxmPlpdrRfPW216UhYdQy3pzIe4f8Q7PKXN79AD4eRqu1obC7I=s200

or

http://lh6.ggpht.com/VMLEHAa3kSHEoRr7AchhQ6HEzHVTn1b7Mf-whpxmPlpdrRfPW216UhYdQy3pzIe4f8Q7PKXN79AD4eRqu1obC7I=s500

So... how can i upload images from CP to google drive? I have purchased channel images by devdemon and CE Image but they do it only on Amazon S3.

There's a way to use Amazon S3 with url parameters for scaling images?

please, someone let me know if I can do it thank you! Valerio

# Answer
I figure it would be possible to do this, but you probably need to write quite a large extension to channel images to make it possible.

What's your skill level?
> 1 votes

---
Tags: image, channel-images, ce-image, image-path
---


# Question
Title: How do I create new image upload destination via config bootstrap file?
I am running expression engine on MSM at the moment. I have got the deployment and ebvironments working properly, my only issues is that there are literally about 30 different file upload paths all together on the whole site. The site environments are:

* Local
* Staging
* Live

The idea would be that I have the upload paths set for the different environments but this is not working at all on the config\_bootstrap.php file in this area:

```
if ('local' === NSM_ENV) {

    // Environment DB configuration
    $env_db_config = array(
        'hostname' => 'localhost',
        'username' => 'root',
        'password' => 'root',
        'database' => 'ngrto-stage2',
    );

    // Environment global vars
    // These will be available in youre templates
    // 'global:' is not required, it's just a naming convention we use @Newism
    // Example: 'global:cm_subscriber_list_slug' will be available in templates as {global:cm_subscriber_list_slug}
    // Overrides anything in $default_global_vars
    $env_global_vars = array(
        'global:cm_subscriber_list_slug' => ''
    );

    // Environment config variables
    // Overrides anything in $env_config
    $env_config = array(

        'upload_preferences' => array(
            1 => array(                                                            // ID of upload destination
                'name'        => 'Staging Image Uploads',                          // Display name in control panel
                'server_path' => '/home/user/example.com/staging/images/uploads/', // Server path to upload directory
                'url'         => 'http://staging.example.com/images/uploads/'      // URL of upload directory
            )
        )
    );

}

```

Can anyone think why this would not work and a better solution to it?

Thanks,

# Answer
I use the Focus Labs 'master.config' system rather than the Bootstrap one but it's basically just a variation on the same theme AFAIK so hopefully this input will still be applicable. What I've found is that whilst, in theory, you're supposed to create the upload destinations before you can redefine them with your config file, in practice it *is* possible to define the destinations in the config first and *then* create them in the CP.

If I define an upload destination in my master.config file and then go to the CP and look at the File Upload destinations, it is not visible. But as soon as I create a new upload destination via the File Upload Preferences, I find that I am able to type any old random gibberish for the name, path, URL etc (i.e. any of the parameters that your config specifies) and once I hit 'Submit' to create the destination directory I find that the system will have picked up on the info from the config file and created the destination with those parameters, not the gibberish that I typed.

Assuming that you are starting with no Upload Destinations, the CP, as it creates then, assigns them array numbers, and if config data exists for that array number then it will apply it. So if I define three destinations in the config with array numbers of 1, 2 and 3, then I create three upload destinations in the CP, the first destination will use the parameters that I predefined for #1, the second will use the parameters for #2, etc.

It gets bit more complicated if you have created a destination but then deleted it, because I think the system still considers that array number as 'used', so a newly created destination (via the CP) might not be assigned the array number that you were expecting. But adjusting the array numbers assigned to the destination in the config can solve that.
> 2 votes

---
Tags: multi-site-manager, config, uploads, image-path
---


# Question
Title: How to stop EE Sending "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
Full Story:

I'm backing an HTML application with expression engine, using the wonderfully unreliable appcache tech. It works in firefox and chrome, but not IE and i've nailed (using charles proxy debugger) it down to the fact that IE is refusing to cache the page because it has the above cache-control headers.

So, I need to stop that happening. Of course, there is a setting in EE:

```
Admin > Output & Debugging > Generate HTTP Page Headers?

```

But changing that has no effect.

I have tried using meta tags for cache-control, but of course, that is no longer valid html, and it would have no effect, anyway (despite knowing this, i did try it, and it did have no effect).

I am certain it is EE causing it, since opening /index.php in the root and doing the following results in the correct headers (though, obviously, no markup).

```
header("Cache-Control:public");
die();

```

If i leave the above header line in place, the incorrect headers are being sent, conclusion being that EE is sending its own headers, after I'm sending that one, meaning it is being overwritten.

I've found declaration in EE\_Output.php, but this isn't where the headers are being sent for templates.

So, I need to find where they are being sent... and I can't seem to find anywhere obvious - which is obviously irritating.

If you guys can offer any assistance, that'd be really useful.

# Answer
> 2 votes
I was able to drill through the ee code and find a place where I can overwrite the headers.

If you need to do the same... open this file:

```
ee_system_folder/codeigniter/system/core/Output.php

```

Look for this function:

```
function _display($output = ''){

```

Look for this code:

```
// Does the controller contain a function named _output()?
// If so send the output there.  Otherwise, echo it.
if (method_exists($CI, '_output'))
{
    $CI->_output($output);
}
else
{
    echo $output;  // Send it to the browser!
}

```

Immediately before that code, i added my own header in (in this case a public header).

```
header("Cache-Control: public");

// Does the controller contain a function named _output()?
// If so send the output there.  Otherwise, echo it.
if (method_exists($C....

```

This successfully overrides wherever the headers are coming from, so it *works* even if its not ideal.

---
Tags: ee2, php
---


title: Can we get tags in supersearch results?

text:
# Question
Title: Can we get tags in supersearch results?
I am using EE (v 2.5.2),super search (v 2.0.8) and Tag module (v 4.2.3),I want to know if we can get the tags of any channel entries in search result?,if yes then how to do that because I was not able to find any documentation in getting tags in search results using SUPER SEARCH

Cheers Nisar

# Answer
You can use any standard fieldtype, module, or plugin tags within Super Search results - use them just as you would within a `channel:entries` loop.

```
{exp:tag:tags entry_id="{entry_id}" backspace="1"}{tag}, {/exp:tag:entries}

```
> 1 votes

---
Tags: solspace, supersearch
---


# Question
Title: Conditionally displaying nested relationships
I have a bit of a complex relationship situation I'm trying to figure out in EE.

My channels consist of **case-studies**, **clients**, and **services**.

* I have a relationship field within each case-studies entry where I relate a **client** and **service**.
* Within the **clients** channel I relate items from the **service** channel.

I want to create tab-based clients page that lists **clients** segmented by the 4 **services**, with a link under each client to a page that lists their related **case-studies**.

Now I can list the clients fine, and the tabs are working the way they should, the problem I'm having is checking whether a client has related case studies or not and only displaying a link to that page **IF that client has some related case-studies**.

```
{exp:channel:entries channel="services" entry_id="4"}
<!-- I'm in the services channel, now I want to loop through the clients that are related to this service -->
  {parents field="client_related_service"}
    <div class="col-xs-12 col-sm-6 col-md-3 client-details">
    <p> <img src="{parents:client_logo}" class="img-responsive" alt="{title}"/></p>
    <p> {parents:client_description} </p>
    <!-- ONLY ADD THIS IF CLIENT HAS CASE-STUDIES RELATED TO IT, CAN'T FIGURE OUT HOW TO DO THIS-->
    <p> <a href="{site_url}index.php/clients/{parents:url_title}">See how we helped {parents:title}</a> </p>
    </div>
  {/parents}
{/exp:channel:entries}

```

# Answer
Relationship tags are nest-able by continuing with the colon syntax:

```
{parents:parents field="case_study_related_client"}
<p><a href="{parents:parents:title_permalink="case-studies/index"}">See how we helped {parents:title}</a></p>
{/parents:parents}

```
> 1 votes

---
Tags: relationships, nesting
---


# Question
Title: Custom event listeners with Google Maps For ExpressionEngine field type
I need to add a custom event listener (to trigger a modal window) to a Google Map that is generated and managed using Google Maps for ExpressionEngine. To this end I'd like to output my own Javascript using values from the field but not the marker scripts injected by the add-on.

Is there a simple way (using EE tags) to get individual bits of data, say, the formatted address, latitude or longitude, from a Google Maps for ExpressionEngine field?

For instance, I have a GMap4EE field named conf\_map - this is storing JSON data retrieved from Google Maps.

Now, on my template if I used the field tag {conf\_map id="map"} it would do what it's supposed to and create a map marker on the map with the id of "map". However can I use something like {conf\_map:latitude} to get the latitude of the marker?

I know I can create additional fields and have the add-on store latitude and longitude data in there when I save an entry but since I will also want address data, icon data etc. it would seem like I need to directly access the json data. I was hoping to avoid having to make some kind of parser for the data since I think that's a bit beyond me!

# Answer
I've just discovered the parse paramter which will let me get the bits of data I need to create my own javascript for creating markers an modal windows.

https://www.objectivehtml.com/google-maps/fieldtype

Use it like so...

```
{exp:channel:entries channel="conf"}
    {conf_map parse="markers"}
        {markers}
            {marker:latitude}, {marker:longitude}
        {/markers}
    {/conf_map}
{/exp:channel:entries}

```

UPDATE: I've got this working now so here's my solution in case anyone else might need to do a similar thing.

Note: This site is using Foundation Reveal to create modal popovers.

Basically what I did was use the markers tag pair to loop through each marker in the field and output it's own bit of javascript to generate a map marker and attach an event listener which triggered a modal.

To make life easy, each run through the loop also creates a block of modal HTML which gets shown when the marker is clicked. Less efficient but easier than trying to pass data into the modal.

```
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=true&key=&language=en"></script>

<div id="map" class="" style="width:100%;height:400px"></div>

<!-- First create the map itself -->

        <script type="text/javascript">

            google.maps.visualRefresh = true;

            var map_options             = {zoom: 12, center: new google.maps.LatLng(0,0), mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false};
            var map_canvas              = document.getElementById("map");
            var map_map                 = new google.maps.Map(map_canvas, map_options);
            var map_bounds              = new google.maps.LatLngBounds();
            var map_markers             = [];
            var map_window              = {};
            var map_windows             = [];
            var map_responses           = [];
            var map_html                = [];
            var map_waypoints           = [];
            var map_regions             = [];
            var map_geocoder            = new google.maps.Geocoder();
            var map_directionsService   = new google.maps.DirectionsService();
            var map_directionsDisplay   = new google.maps.DirectionsRenderer({map: map_map});
            var map_clusterOptions      = {maxZoom: 0, gridSize: 0, styles:[]};
            var map_cluster             = new MarkerClusterer(map_map, map_markers, map_clusterOptions);

        </script>

<!-- Now create the markers
     All marker data is stored within the GMap4EE field type in a single entry
     So we first grab the entry, then output the field and within that use the {markers} tag pair to loop through each one and create the Javascript needed
-->

{exp:channel:entries channel="conference"disable="member_data|pagination|categories|category_fields"}

    {conference-venue-map parse="markers"}

        {markers}
            <!-- Create a marker on the map -->
            <script type="text/javascript">
                var index = map_markers.length;
                map_markers[index] = new google.maps.Marker({
                    map: map_map,
                    position: new google.maps.LatLng({marker:latitude},{marker:longitude}),
                    icon: "{marker:icon}"
                });

                map_markers[index].entry_id = {embed:entry};
                map_markers[index].index = {marker:count};
                map_bounds.extend(new google.maps.LatLng({marker:latitude},{marker:longitude}));

                if (index > 0) {
                    map_map.fitBounds(map_bounds);
                } else {
                    map_map.setCenter(map_bounds.getCenter());
                    map_map.setZoom(map_options.zoom);
                }
                        (function () {
                            var obj = map_markers[index];
                            google.maps.event.addListener(obj, 'click', function(e) {
                                var modal = '#markermodal'+obj.index;
                                $(modal).foundation('reveal','open');
                            });

                        })();

                </script>

    <!-- Create a modal window for this marker -->

                <div id="markermodal{marker:count}" class="reveal-modal small">
                    <h1>{marker:title}</h1>
                    <p>{marker:formatted_address}</p>

                    {marker:content}
                    <a class="close-reveal-modal">×</a>
                </div>

        {/markers}
    {/conference-venue-map}
{/exp:channel:entries}

```
> 2 votes

---
Tags: google-maps-for-ee, json
---


# Question
Title: Expresso Store orders not getting past checkout 3 to Paypal for only SOME users
I've had this problem once before, on a website using Store on 1&1, where the checkout didn't redirect to PayPal, but got hung up on the final step and just refreshed the page (see original question/answers here: Expresso Store orders suddenly not getting past checkout 3 to Paypal). The problem was sorted after contacting the host, but they didn't tell me what they did to solve the problem.

I have another website, which is hosted on Clook, and for only some users, Store is getting hung up on Checkout 3 and not going to PayPal. The page just reloads. I can't replicate the problem, and neither can my client, but he's getting several complaints from people who can't buy on the site. I am not getting any errors on the page. ExpressionEngine v2.5.5 Store v1.6.3

Anyone have any ideas?

# Answer
> 2 votes
Per the comments: It sounds like a missing email address was the source of the problem.

`order_email` is always a required field in Store to submit orders. Therefore, if you ask for customers to enter `order_email` on a different page of the checkout, you should always make it required there (by specifying `require="order_email" in the checkout tag)`. Otherwise there will be a validation error when they finally try to "submit" the order.

In general, if the checkout is refreshing without anything happening, it is usually a validation error. The first step is to remove `error_handling="inline"` from your checkout tag to see if there are any errors not being displayed correctly.

# Answer
> 1 votes
This happened on another site as well recently. The problem was in Firefox only, no other browsers. Using Adrian's suggestion of removing the error handling inline I was able to narrow the problem down to a shipping rule the client had created incorrectly. The other browsers were able to ignore it and go to PayPal, but Firefox would get stuck and just reload the order review page (checkout3). Once I sorted the shipping rule, the problem disappeared.

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


title: Output categories in tagger?

text:
# Question
Title: Output categories in tagger?
I'm using DevDemon Tagger to output a list of categories. Everything is working fine but I am acing trouble getting categories to out put. Other items output no problem.

My code is below:

{exp:tagger:entries tag="{get:tag}" custom\_fields="categories|dl\_authors"}

{tagger:entry\_title}
{tagger:categories}{tagger:category\_url\_title} {/tagger:categories}

{/exp:tagger:entries}

Does anyone have any ideas?

# Answer
Update:

Discovered I can use exp:tagger:entries\_quick with a standard exp:channel:entries inside it and then access items like normal, but this seems inefficient especially if the tag has many items?

{exp:tagger:entries\_quick tag="{get:tag}"} {exp:channel:entries entry\_id="{tagger:entry\_ids}" channel="the channel" status="open" show\_future\_entries="no" show\_expired="no"} // Normal stuff in here {title} {tagger:categories}{tagger:category\_url\_title} {/tagger:categories}

{/exp:channel:entries}
{/exp:tagger:entries\_quick}
> 1 votes

---
Tags: tags, devdemon
---


# Question
Title: Freeform Pro - General error at top of page as well as inline errors?
I'm using freeform pro and I have a functioning form, built using the form tags. I have the inline errors working as hoped, but what doesn't work from a UX perspective is lack of a general error at the top of the page as well as the inline errors.

If the inline error is visible to the user as the page reloads, then it is fine. If the error is below the fold, there is nothing telling the user why their form didn't successfully submit **until** they scroll down and notice the inline error.

Is it possible to get a general error at the top as well as the inline errors, so the user knows to scroll down to find the specific error? The general\_errors tag pair seems to be place that errors will be displayed if they are not picked up by a specific inline error. If an inline error shows and that is the only error, then nothing is output by the general\_errors tag pair.

I want something at the top of the form like "There were some problems with your form. Please scroll down to view the errors". I would want something like:

```
{if freeform:error:any}
 <span>Error Message<span>
{/if}

```

Any thoughts? Thank you.

# Answer
OK, I think I got it. By adding the following parameter to the form:

```
inline_error_return="/template-group/template-with-form/errors"

```

Then I can use the following to get what I need:

```
{if segment_3 == "errors"}
    <p class="error">There were some errors with your submission. Please make the necessary corrections and re-submit.</p>
{/if}

```

MY only last question would be is there a problem with doing it this way? It seems EE doesn't throw 404 errors for made up pages like this with no corresponding template, it just shows the previous parent template. Is this a bad practice for any reason?
> 2 votes

# Answer
If you look at the example for inline errors in the docs, it shows that you can show a general error message as well as an error for each individual field.

There is no reason you could not put this at the top of the page with the general errors message:

{if freeform:error:name} {freeform:error:name} {/if}

as well as have it live with the input field.
> 0 votes

# Answer
You could add a general check against all the possible errors at once. Something like so:

```
{if freeform:error:name1 OR freeform:error:name2 OR freeform:error:name3 }
   <div class="generalerror">
     Please make sure all the appropriate fields below are filled incorrectly.
     (or other generic message here)
   </div>
{/if}

```

Then include your regular inline errors below.
> 0 votes

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