# Question
Title: Why are email notifications not being delivered?
I recently moved a number of sites to a new host and with that move have begun to have issues with email notification: new member, profile edit, new entry. The curious thing is that the notification issues are limited to domain-specific email accounts. For example, if I put a person from the client organization in the notification list as well as myself, and they have a company email associated with the domain and I include my email, which is not, I will get the notification but they don't.

Has anyone experienced this? If so, what could be the root cause? It is a challenge to take this issue to the hosting provider because they will see it as an Expression Engine problem, which of course they wouldn't support.

I am open to any and all suggestions for a solution to this.

# Answer
The problem here has nothing to do with Expression Engine, but rather is an issue related to hosting multiple sites on a single account running Plesk. The solution requires some SSH into the server as noted here: http://www.serveridol.com/2011/03/16/disabling-email-service-for-a-domain-in-plesk/. Following those instructions resolved the problem.
> 0 votes

# Answer
Postmaster paired with Mandrill is a nice solution for bulletproof email, so you don't have to deal with server issues like this. Not a direct solution to your problem, but, this approach has served me well recently.
> 0 votes

---
Tags: notification
---


# Question
Title: Entries no longer have a "Status" option, and disappear when saved
I recently upgraded to Expression 2.7.1. I'm experiencing problems with publishing, or in this case, republishing entries. In the "Options" tab, the "Status" dropdown is now empty.

When I changed something in a particular entry, it loses it's "Open" status and becomes unpublished, and I'm unable to swtich it back to "Open."

My local test site doesn't have this issue, but my live production site does.

Any ideas or places I should look first?

Thanks, Jason

# Answer
Check your permissions within the status group. Each group that is creating/editing content needs to have permission to each status. So, if the open status is only available to Super Admins and your account isn't a Super Admin, then it won't show Open as an option for you.
> 2 votes

# Answer
I'd suggest starting by updating to 2.7.2, which I believe came out in the last day or so. I was having issues setting some field preferences in 2.7.1 that the update seems to have fixed.
> 0 votes

# Answer
I'm not able to comment as yet, so 'commenting' here.

The accepted answer and especially sonictombs comment on that answer really helped me. I had just updated a website from EE1 to EE2.7.2. All was fine, till I changed a word in an entry on the home page - which promptly disappeared. I saw this comment, dived in and it solved the issue.

I checked my other channels and some had the default status group assigned and some did not, so had to check each individually. I could see no obvious correlation to other assignments... hope this is helpful!
> 0 votes

# Answer
Sounds like this question is resolved for you, but I thought I'd note my experience with this as help to others in the future.

*NOTE: this **only** happens if you are in a member group that is **NOT** the super admin group.*

**When you don't have the open/closed options for the "status" field there can be a few problems**:

1. The channel has to have a status assigned to it (as Jeremy mentioned):
    * Go to Admin\>Channel Administration\>Channels, click on each channel's "Edit Group Assignments" link, and under the dropdown for "Status Groups" choose "Statuses" (or whatever you want.)
2. The User must have permissions to that status (as noted in comment here: Custom Member's Channel Entries Defaulting To "Closed" Status)
    * CP -\> Admin -\> Channel Administration -\> Statuses -\> \[Status Group\] -\> \[Status\] --make sure the user group in question has permission to view the status.
3. For some weird reason neither of these worked for me in one case, where the status group wasn't getting saved to the DB, and I had to manually go into the database to set the status group for each channel. NOTE: don't try this if you're not comfortable in the DB.
    * I went into the exp\_channels table, located the status\_group column. It said NULL even though I had done step #1 as mentioned above.
    * I edited each channel so the status\_group field = 1
    * check to make sure you use the right status group id in the status\_group column. You can check this in the exp\_statuses table, see the group\_id column.
> 0 votes

---
Tags: entries, status
---


title: How to Install OpenGateway and Membrr

text:
# Question
Title: How to Install OpenGateway and Membrr
I'm trying to install Membrr and OpenGateway on an existing EE site to allow us to accept payments through PayPal for subscriptions to different Member Groups. I'm following the instructions documented by Membrr and OpenGateway here:

http://www.membrr.com/docs/installation

First I'm wondering what license.txt file I should upload as there is no license now that OpenGateway is open source and I didn't pay them or Membrr for one. Does this mean that I should upload an arbitrary license.txt file? I've tried uploading one with filler text and am unsure if this is somehow holding up the install.

Second, I've tried going through the install steps and was unsuccessful in accessing /install directory (step 6 in docs)—browsing to the path only led me to my site's 404 page. Assuming the license.txt file isn't affecting this are there any other ways I could troubleshoot why this isn't working?

I've done all other steps outlined in the installation.

Thanks in advance for any help!

# Answer
> 1 votes
We do not recommend using Membrr and OG. You have two seperate system, two logins and it is a big pain. There is a reason it is now FREE. You get what you pay for. If you are just using PayPal why not just use EE native Simple Commerce?

# Answer
> 0 votes
Did you download everything from github? If so you should not need license.txt file...

I'm guessing that your error has to do with something else.

if you have place opengateway in the root of your site then you should access:

http://www.mysite.com/opengateway/install

# Answer
> 0 votes
Have you built the server with IonCube Loader installed? We accidentally skipped over this the first time...

# Answer
> 0 votes
I've used Membrr with PayPal in the past and had zero issues. I was really impressed with the functionality & flexibility. It's true that it's now abandon-ware, but the main issue with that as far as I can see is if EE changes in a way to make it stop working. I have also used aMember which worked, but is less integrated with EE than Membrr is.

I wish Ellislab would take over Membrr and just build it into EE, just sell it as an extra like the forum. Paid memberships is such an important feature to so many applications these days, especially serving media (sound and video). EE with its customisable fields really lends it's self to that kind of application. I built a paid video podcast site a few years ago with EE and aMember and it worked really great! Even having EE serve content directly to iTunes.

---
Tags: membrr
---


title: CartThrob - Multiple Languages

text:
# Question
Title: CartThrob - Multiple Languages
Does anyone know whether CartThrob supports additional languages from a front-end perspective? It would be great to know whether it is possible to localise all product and checkout content within the same add-on.

Thanks, Adeeb

# Answer
Since Cartthrob uses regular channels and entries there is no reason it would not work with one of the multi-language add-ons such as; Multi language support or Multilanguage Module

You could even create your own system by adding some extra fields to your entries.

For example, if you have a text field for a product description named {product-description} you could create a French version called {fr-product-description}.

Then create your url structure and templates to use a language code within the urls. So the English version might be /en/products/my-product and the French version would be /fr/products/my-product.

You can then look for the first url segment and inject it into any custom field tags that you output to the template, or use conditionals to switch out the different language content.

EDIT: I'm going to have to test this now as I'm unsure whether it will work. Worth a try though if you don't want to use an add-on.
> 0 votes

---
Tags: cartthrob, ecommerce, localization
---


# Question
Title: Performance with Store variables and Low Search
I'm looking at performance for a few list pages, and finding that low search is being called to find some Store variables within a channel entries tag. For example, getting {product\_details:price} in a channel entries tag results in Low\_search\_ext/custom\_field\_modify\_data being called 2x for each entry.

So getting 4 Store tags in a channel entries list of 24 products ends up having a bit of overhead (relatively):

```
(abbreviated from the graph example below)
    {exp:channel:entries
        channel="products"
        limit="24"
    }
        {product_details:price}
        {product_details:regular_price}
        {product_details:sale_price}
        {product_details:on_sale}
    {/exp:channel:entries}

```

Template debug (called 190+ times):

```
begin: (0.145485/13.82MB) - Calling Extension Class/Method: Low_search_ext/custom_field_modify_data
...
end: (0.351349/14.96MB) - Calling Extension Class/Method: Low_search_ext/custom_field_modify_data

```

Graph view (courtesy of EE Debug Toolbar):

I am using caching so once it's cached it's not a big deal, but am trying to find ways to speed this up for the pre-cached page load.

# Answer
> 3 votes
It's rather awkward that hook is being called every time. Low Search uses the hook to update collections when a channel field is deleted; it's the only hook that can be used to for that action. However, the same hook appears to be called for other reasons too, but LS won't take any action there.

You can disable LS for that hook only by setting the `enabled` column to `n` in the `exp_extensions` table for class `Low_search_ext` and method/hook `custom_field_modify_data`. Then EE won't call LS for that hook, which should improve things. Do keep in mind that if you delete a field that is part of a search collection, you then need to update the collection manually.

However, the most ideal solution would be for EE to call a separate hook for field deletion, so LS can use that instead of this multi-purpose hook.

---
Tags: expresso-store, low-search, performance, ee-debug-toolbar
---


# Question
Title: Freeform, Structure, Transcribe and Freebie - how to return to correct language on contact form
I have an English site that uses Structure and Transcribe. The 2 language translations, French and German, are about to go live except for one little issue. On one page I have a contact form using Freeform Pro that also contains the 'Thank you' text that is shown once the form has been submitted, using a Freebie tag. It has been working fine for the English (default) version of the site. The form goes from www.mysite.com/contact-us to www.mysite.com/contact-us/thanks once the form is submitted.

The code I've used. is below:

```
                {if freebie_last == "thanks"}
                    <p>{contact_thanks}</p>
                {if:else}
                    {contact_info}

                    {exp:freeform:form
                        form_id="1"
                        required="name|email|country|area_of_interest|user_enquiry"
                        return="{segment_1}/thanks"
                        inline_errors="yes"
                        form:class="well"
                    }

```

Unfortunately I can't work out how to get the translations to show the correct 'Thank you' page. When I'm on www.mysite.com/de/kontakt and hit Submit I am taken to the 404 page because it's trying to direct to www.mysite.com/kontakt/thanks. It should be www.mysite.com/de/kontakt/thanks - it's not including the 'de' segment of the url.

I've tried several variations of the return path but none seem to direct me to www.mysite.com/de/kontakt/thanks. The language segment is always being removed, but I need to keep the return="{segment\_1}/thanks for the English version of the site to work. I was thinking an {if} statement would be needed but nothing seems to be working.

I've tried:

```
                        {if '{transcribe:language_abbreviation}' == 'de'}
                        return="{freebie_1}/{freebie_2}/thanks"
                        {if:else}
                        return="{segment_1}/thanks"
                        {/if}

```

or:

```
                        {if '{transcribe:language_abbreviation}' == 'de'}
                        return="{segment_1}/{segment_2}/thanks"
                        {if:else}
                        return="{segment_1}/thanks"
                        {/if}

```

Does {if:else} not work here? If not, what does? Or am I going about this in totally the wrong way by using Freebie (I'm a bit unsure how it works). I've tried adding fr|de to the breaking segments to no avail.

Any help would be appreciated. Thanks

# Answer
> 2 votes
You can simply make entries for the return pages, and have transcribe handle it for you.

What i do is to embed the form: {embed="\_inc/.contact\_form" thepath="{exp:transcribe:uri path='/contact/thank-you/'}"}

```
{exp:forms_js_validation:init lang="{transcribe:language_abbreviation}"}
    {exp:forms_js_validation:add
     selector="form"
     require_class="required"
     email_class="require_email
    }
    {exp:freeform:form
    form:id="2"
    form:class="custom"
    form_name="more_info"
    return="{embed:thepath}"
    }
{/exp:freeform:form}

```

# Answer
> 1 votes
An `{if:else}` conditional won't work here (or with any other tag to try to change a parameter) because it's parsed *after* `{exp:...}` tags. This is often called an **advanced conditional**. You can see this by **turning on Template Debugging**: the parameters should look unparsed or partially parsed for the tag.

I don't have experience with Transcribe, Structure and Freebie, but if de/fr/en are considered URL segments (i.e. {segment\_1} is de, fr, or en, for example), then you could use **simple conditionals**, which parse before `{exp:...}` tags, to control parameters. Eg.

```
return="{if segment_1 == "de"}/de/kontakt/thanks{/if}{if segment_1 == "fr"}/de/contact/thanks{/if}{if segment_1 == "en"}/contact/thanks{/if}"

```

**Note**: `{if:else}` and conditionals containing `&&`, `||`, `AND`, `OR` are considered **advanced conditionals** and wouldn't work.

---

Alternatively, you could wrap the whole Freeform code in whatever Transcribe/Structure/Freebie conditionals/tags you want. This would repeat a lot of the same code multiple times, but would also get around your problem.

---
Tags: solspace-freeform, solspace, structure, transcribe, freebie
---


title: Cartthrob php orders when logged in

text:
# Question
Title: Cartthrob php orders when logged in
EE 2.7.2 CT 2.5

I'm working on a live cartthrob site that I inherited and there are php errors on the checkout pages, but only when logged in. Is there a known fix for this?

```
A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Template.php

Line Number: 3784

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Template.php

Line Number: 3784

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Template.php

Line Number: 3784

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /path/to/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 /path/to/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 /path/to/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 /path/to/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 414

```

# Answer
I would update Cartthrob to V2.6 if i were you Sean!
> 1 votes

---
Tags: cartthrob, php-errors, checkout
---


# Question
Title: Styled `span` elements injected into comment output
Does anyone know of a way to stop EE from injecting spans (with inline styles) into code blocks in comments? I'm fine with the `div` wrapping the `code` (that's not that big of a deal), but the spans are completely unnecessary.

Example output from EE:

```
<div class="codeblock">
    <code>
        <span style="color: #000000">
            <span style="color: #0000BB">This is code</span>
        </span>
    </code>
</div>

```

Edit to update: I've worked around this problem by using the following CSS to override the inline styles, so really this is just a matter of "I don't want junk in my markup" over broken functionality. (Also, a matter of pride, because `!important` is !embarassing.)

```
.codeblock code, .codeblock span {
    color: #ddd !important;
}

```

# Answer
> 0 votes
Per this EE bug report: "...code tags are being parsed...\[a\]nd we add our own styling when that’s done."

So this is expected behavior, but overrideable with CSS:

```
.codeblock code, .codeblock span {
    color: [YOUR COLOR HERE] !important;
}

```

---
Tags: comments, formatting
---


# Question
Title: Limit displayed image(s) from one entry/category
I have a 'projects' channel, that contains a 'Channel Images' field. An entry can belong to one of four categories.

On my home page, all I want to display is two of the images from the most recently added project. When you click on either small image it directs to the page of that entry.

I cannot work out how to display the two images from just the one category. My code below displays one image from one entry belonging to each category. How do i limit it to only display the image (2) from the latest entry (whatever category it belongs to)?

```
{exp:channel:categories channel="project" style="linear"}
{exp:channel:entries channel="project" category="{category_id}"  disable="pagination|member_data" limit="1"}

<div class="{switch="w1|w2"}"><a href="projects/{category_url_title}/{url_title}" title="{title}">{proj_img}<img src="{image:url:sml}" alt="{image:title}" width="112" height="112" border="0" />{/proj_img}</a></div>

{/exp:channel:entries}
{/exp:channel:categories}

```

Any help is very appreciated.

Update: Kerry's answer below is close to correct, i had to make a slight alteration.

```
{exp:channel:entries channel="project" disable="pagination|member_data" limit="1" parse="inward"}
{exp:channel_images:images entry_id="{entry_id}" field="proj_img" limit="2" sort="asc"}
  <div class="{image:switch='w1|w2'}">
    <a href="projects/{categories}{category_url_title}{/categories}/{url_title}" title="{title}">
      <img src="{image:url:sml}" alt="{image:title}" width="112" height="112" border="0" />
    </a>
  </div>
{/exp:channel_images:images}
{/exp:channel:entries}

```

# Answer
> 1 votes
If you're just pulling the latest entry from the Project channel without any category restrictions and want to pull the latest 2 images from that latest entry, and your categories are only 1 level deep, you can try this:

```
{exp:channel:entries channel="project" disable="pagination|member_data" limit="1" parse="inward"}
    {proj_img limit="2"}
        <div class="{image:switch='w1|w2'}">
            <a href="projects/{categories}{category_url_title}{/categories}/{url_title}" title="{title}">
                <img src="{image:url:sml}" alt="{image:title}" width="112" height="112" border="0" />
            </a>
        </div>
    {/proj_img}
{/exp:channel:entries}

```

---
Tags: categories, channel-images
---


# Question
Title: Expresso Store: Shipping Confirmation email template - tracking number
Is there any way to pass to shipping confirmation email template a tracking number from the order? I have try to use order custom field but it comes as not editable at the store back end so when order is shipped then tracking number can be pasted.

# Answer
I have used `{order_status_message}` in that case as other fields cannot be edited.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Expresso Store: Order Confirmation email template - order date
Is there any way to get displayed order date in the order confirmation email template? I know about `{order_date}` tag but it comes as unix datestamp and I have no clue how to convert it to regular date.

Thanks

# Answer
You need to use the `format` parameter. You can find the entire list of formatting codes here.

Something like:

```
{order_date format="%F %j %Y"}

```

Would output August 15 2014 if you purchased something today.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Cartthrob Subscriptions 5017 Rebill Sage Pay Error
Have an installation of Cartthrob Subscriptions 2.6 installed and semi working with a SagePay Offsite test account which has token and repeat enabled and a continuous authority merchant number attached. I can successfully purchase a subscription using the Sage Pay test CC details, however when it comes to rebill the subscription the following error appears:

> The transaction was not registered because although the data sent to the payment gateway was formatted correctly, some information supplied was invalid. E.g. an incorrect vendor name or currency code was sent.5017 : The Security Code(CV2) is required.

Anybody else seen this before with Sage Pay or have any ideas?

Many thanks

# Answer
> 0 votes
yep I came across this bug too. Was a long time ago, and had hoped they would have fixed it by now, but here's what I did:

Open up /third\_party/cartthrob/payment\_gateways/Cartthrob\_sage.php

**Bug #1**: 3DSecure check must be disabled for rebills, so find `'Apply3DSecure' => 0` and change the `0` to `2` (weird that it's not supposed to be zero, but there you go... You can see the values in this ancient document p.38). On my old copy it's at line 379.

**Bug #2**: Then just after the $post\_array variable is set (line 381 for me) we need to switch off the CVV2 check for rebills but keep it on for the initial transaction. Buried deep in the old CT forums is a solution as follows:

```
    if ($this->order('CVV2'))
    {
        $post_array['CV2'] = $this->order('CVV2');
    } else {
        $post_array['ApplyAVSCV2'] = 2;
    }

```

---
Tags: cartthrob, subscriptions, sagepay
---


# Question
Title: Creating Confirm Email Field that Matches Email Field
Is there a way to create a matching email address field? I want to create a "confirm email" field to ensure the user is correctly inputting his/her email. I'm using the form composer as well, so I'm hoping there's an easy way to set this up versus having to manually create a form template and manually create each form field. Thanks!

# Answer
> 0 votes
There is the 'matching\_fields' parameter which allows you to do just that. See the documentation for details: http://www.solspace.com/docs/freeform/form/

# Answer
> 0 votes
Unfortunately it's not possible to add a matching field requirement when using the Freeform Composer, unless you have a situation where:

1. you know the exact names of the fields that would need to match, which you could hard-code in a custom Composer Template, or
2. you know that for your form, all field of a specific fieldtype (eg. all text inputs) would *all* require a matching field, which in this case you would also need to create a custom Composer Template.

You will also need the `matching_fields=""` parameter.

**For 1**, you would create a custom Composer Template (either through the CP or by using {exp:freeform:composer} as a tag pair, see documentation), and add something like the following where appropriate:

```
...
{if:else} {!-- snippet code from default Composer Template --}
    {if composer:field_name == "email"}
        <input type="text" name="email" value="" />
        <input type="text" name="email_confirm" value="" />
    {if:else}
        <p>{composer:field_output}</p>
    {/if}
{/if}

```

As you can see, you would need to know the name of the field beforehand. It's not automagic.

**For 2**, the approach is similar, but using `{composer:field_type}` instead of `{composer:field_type}`

Of course both approaches are not "set and forget" ways of adding this functionality when using Composer. I recommend submitting this as a **Feature Request** under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on:

http://support.solspace.com/support/discussions

---
Tags: solspace-freeform
---


# Question
Title: Unexpected results when using {redirect=404} and template layouts
It appears that when using the recommended method of `{if no_results}{redirect=404}{/if}` in a template that uses the template layout feature, it duplicates the layout, if a layout is also used on the actual 404 template. The 404 template lives at `errors/404` it includes the following:

**errors/404 template**

```
{layout="_layouts/master}
404 Error Content Here

```

When viewing a normal page that 404s (sitename.com/pagedoesntexist) it works as expected.

**\_layouts/master template**

```
{layout="_layouts/_global}
   {embed="_embeds/header"}
     {layout:contents}
   {embed="_embeds/footer"}

```

On instances that do not work as expected it's set up like the following:

**Sample template using the 404 redirect tag**

```
{layout="_layouts/master}
{exp:channel:entries}
   Content Here

   {if no_results}
     {redirect=404}
   {/if}
{/exp:channel:entries}

```

This results in the file rendering the master layout twice (double header + footer in my instance) because the `{redirect=404}` tag is essentially copying the results of the /errors/404 template into the template that contains no results instead of displaying the 404 page as usual.

Is there a way around this bug, preferably that doesn't require enabling php in templates?

# Answer
> 5 votes
This is a known bug in EE 2.9.0: https://support.ellislab.com/bugs/detail/20471/site-index-template-is-rendered-after-the-404-template

The fix from that thread:

Open system/expressionengine/libraries/Template.php and find this code on line 2236:

```
ee()->output->out_type = "404";
ee()->output->set_output($out);
ee()->output->_display();

```

And REPLACE it with this:

```
ee()->output->out_type = "404";
ee()->output->set_output($out);
ee()->output->_display();
exit;

```

---
Tags: 404, error-pages, template-layouts
---


# Question
Title: BrilliantRetail: Is pagination of Customer Orders & Downloads possible?
Does anyone know if it is possible to paginate the customer orders and downloads listings on the customer facing orders and downloads pages in BrilliantRetail?

I know you can limit the number of results returned using `limit=“n”`, but can you paginate the results like a standard channel entries tag to allow customers to browse through their entire order and download history?

# Answer
> 0 votes
According the response I received from a support ticket to BR, this is not possible at the moment (BR 1.6.\* release) but is a feature request and should appear sometime in the 1.7.\* dev release.

---
Tags: brilliantretail
---


# Question
Title: PHP Error in File Upload Preferences after upgrade
After upgrading from 1.6.3 to 2.9.0, I'm getting the following errors when I try to bring up the Site Upload Preferences:

```
A PHP Error was encountered
Severity: Warning
Message: array_merge() [function.array-merge]: Argument #2 is not an array
Filename: models/file_upload_preferences_model.php
Line Number: 111

A PHP Error was encountered
Severity: Warning
Message: array_merge() [function.array-merge]: Argument #2 is not an array
Filename: models/file_upload_preferences_model.php
Line Number: 111

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/mysite.com/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 442

```

My issue started with the fact that I was using Mark Hout's File extension, and I was going to try to implement this fix:

https://ellislab.com/forums/viewthread/218268/

and I needed to get the upload directory's ID from the File Upload Preferences.

# Answer
> 0 votes
Solved my issue. Something during the upgrade process inserted this line into my system/expressionengine/config/config.php file:

```
$config['upload_preferences'] = 'Array';

```

I commented that out and no more errors. Hope this helps someone else.

---
Tags: upgrade, php-errors
---


# Question
Title: Channel Categories: Display all categories so each parent is a header and children are a list
I am displaying all of a channel's parent and child categories. The client's design is kinda tricky so the goal is each parent group is in a row, each parent name is in a tag and its children are in a list...

```
<div class="row">
   <h3>Breakfast</h3>
   <ul>
      <li>Coffee</li>
      <li>Bakery</li>
   </ul>
</div>

<div class="row">
   <h3>Lunch</h3>
   <ul>
      <li>Sandwiches</li>
      <li>Salads</li>
   </ul>
</div>

```

I have *kinda* output this result with channel categories...

```
<div class="row">
   {exp:channel:categories channel="catering" style="linear"}
      {if "{parent_id}" == 0}
         <h3>{category_name}</h3>
      {if:else}
         <li>{category_name}</li>
      {/if}
   {/exp:channel:categories}
</div>

```

It comes out like...

```
<div class="row">
   <h3>Breakfast</h3>
      <li>Coffee</li>
      <li>Bakery</li>
   <h3>Lunch</h3>
      <li>Sandwiches</li>
      <li>Salads</li>
</div>

```

But how do I get each parent group properly wrapped in a `<div>` and the `<li>` items wrapped in `<ul></ul>` tags? Are there more advanced conditionals I need to be using?

Thank you for any suggestions.

# Answer
Ok... This can be confusing.

Can you try this, please?

```
{exp:channel:categories channel="catering" style="linear"}
    {if parent_id == 0 OR count == 1}
        {if count > 1 AND count != total_results}
                </ul>
            </div>
        {/if}
        <div class="row">
            <h3>{category_name}</h3>
            <ul>
    {/if}
    {if parent_id != 0}
        <li>{category_name}</li>
    {/if}
    {if count == total_results}
            </ul>
        </div>
    {/if}
{/exp:channel:categories}

```
> 0 votes

# Answer
Confusing indeed, but yes, that pretty much did the trick.

Except the parent category was repeating as the first item in the list, so I added `&& parent_id != 0` to the second `{if parent_id}`

This is the final working code...

```
{exp:channel:categories channel="catering" style="linear"}
    {if parent_id == 0 OR count == 1}
        {if count > 1 AND count != total_results}
            </ul>
            </div>
        {/if}

        <div class="row">
        <h3>{category_name}</h3>
        <ul>
    {/if}
    {if parent_id && parent_id != 0}
        <li>{category_name}</li>
    {/if}
    {if count == total_results}
        </ul>
        </div>
    {/if}
{/exp:channel:categories}

```

Many thanks for your help!
> 0 votes

---
Tags: categories, parent, child-categories, category-name
---


# Question
Title: Detect if url is that of the Pages Module
Is there a way to know if the current url being called is that of the Pages Module?

For example I'd like to do something like this:

```
{if pages_module =="TRUE"}
     This is a page generated from the pages module!
{else:if}
     This is not a page
{/if}

```

I looked for an add-on though, maybe I'm missing it or maybe I'm missing a simple tag in the docs?

# Answer
You should be able to do:

```
{exp:channel:entries}
    {if page_uri} {!-- or {if pages_url} --}
         This is a page in the pages module
    {if:else}
         This is not
    {/if}
{/exp:channel:entries}

```
> 3 votes

---
Tags: module, pages, page-uri
---


# Question
Title: Freeform - make file_upload field required
I'm trying to create a form with Freeform Pro containing a File Upload field that is required. So the form should only submit when the user actually uploads a file.

Setting the field to required in template parameter seems to have no effect.

Bug or missing feature? Any workarounds?

```
{exp:freeform:form form_name="feedback" secure_action="yes" secure_return="yes" required="some_picture|email" form:id="some_form" admin_notification_template="feedback_notify" admin_notify="foobar@example.com" prevent_duplicate_on="email" inline_error_return="group/template" inline_errors="yes" return="group/feedback_thanx"}

<label for="fmail">
<span class="frage"{if freeform:error:email} style="color:red;"{/if}> E-MAIL </span>
{freeform:field:email id="fmail"}
</label>

<label for="some_picture">
<span class="frage" {if freeform:error:some_picture}style="color:red;"{/if}>Please upload! </span><br><br>
{freeform:field:some_picture id="some_picture"}
</label>

<input type="submit" name="submit" value="Absenden" />
{/exp:freeform:form}

```

# Answer
> 1 votes
You can make it required by adding an hidden input with the same name as your file input:

```
{exp:freeform:form required="file_upload"}

  {freeform:field:file_upload show="1"}
  <input type="hidden" name="file_upload">

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

{/exp:freeform:form}

```

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


title: Login Form|| Potential Bug || 2.9.0

text:
# Question
Title: Login Form|| Potential Bug || 2.9.0
So I'm using this code to have users login from the front-end:

```
<div class="row">
    <div class="container">
        <div class="col-lg-12 col-md-12">
            {if logged_out}
            {exp:member:login_form class="login" id="login_form" return="/login"}
            <input type="hidden" name="auto_login" value="1">
                <div class="form-group">
                    <label for="username">User Name</label>
                    <input type="text" name="username" placeholder="Username" class="form-control"/>
                </div>
                <div class="form-group">
                    <label for="password">Password</label><br />
                    <input type="password" name="password" placeholder="Password" class="form-control"/>
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            {/exp:member:login_form}
            <p> </p>
            <p><a href="{site_url}{admin_path}.php?S=0&D=cp&C=login&M=forgotten_password_form">Forgot Password?</a></p>
            {/if}

            {if logged_in}
            <h2>You Are logged in as {screen_name}</h2>
            <ul>
                <li><a href="{site_url}{admin_path}.php" target="_blank">Control Panel</a></li>
                <li><a href="{site_url}{admin_path}.php?/cp/content_publish/entry_form&channel_id=3&entry_id=7" class="cp" target="_blank">Edit Global Elements</a></li>
                <li><a href="{site_url}">Homepage</a></li>
                <li><a href="{path='logout'}">Logout</a></li>
            {/if}
        </div>
    </div>
</div>

```

But I'm not actually getting logged in. So it's like the `{if logged_in}{/if}` isn't actually working.

I'm using that same code in older builds so it must be a bug right? :) My settings for "Control Panel Session Type" and "Website Session Type" are set to COOKIES ONLY.

I'm also using the same `.htaccess` I've always used as well.

# Answer
> 1 votes
Looks like it was a good ole `htaccess` issue.

I was mistakenly rewriting the URL (only needs to be done on LIVE, not DEV) when it's launched and since this is on a DEV environment I commented this out:

```
# <IfModule mod_rewrite.c>
#   RewriteCond %{HTTPS} !=on
#   RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
#   RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# </IfModule>

```

Wa-laaa!

# Answer
> 1 votes
I just tested it with *ExpressionEngine v2.9.0 - Build Date: 20140715*, with "Control Panel Session Type" and "Website Session Type" are set to COOKIES ONLY.

Works as expected for me. So check if you really not login. Can be that you was not login in CP, but on site.

---
Tags: login
---


# Question
Title: expired form error when return from offline payment in cartthrob payment plugin
i create payment plugin for cartthrob in EE. in this plugin we need to send parameter to gateway website with POST and gateway website will return result with posting parameter to url we gave it. everything goes OK but when gateway send parameter to our url we get error.

```
This form has expired. Please refresh and try again.

```

gateway post data to:

http://example.com/themes/third\_party/cartthrob/lib/extload.php/Mellat

when we call that URL without post data its working...

thanks and sorry for my English.

# Answer
EE's "secure forms" feature requires that all POST requests contain a valid `XID` (or `crsf_token` in 2.8+). The POST back from your gateway contains no such token, hence the issue.

So you either need to disable secure forms (not recommended), or register an action for your payment plugin, and set `crsf_exempt` to `1` when you do so. Then use that action URL for your gateway to POST back to.
> 2 votes

---
Tags: cartthrob, error, expire
---


# Question
Title: Fieldtype display_field() function converting to htmlentities()?
I'm having some trouble where my `display_fields()` function is converting my json encoded data from `$data` into `htmlentities()`.

Here's my function:

```
function display_field($data)
{
    error_log($data);
}

```

Return:

```
[{"approved":true}]

```

Stored in database as:

```
[{"approved":true}]

```

# Answer
> 2 votes
The comments on the official documentation page note the following:

> Just a note that on `display_field` the data has htmlspeciachars on it if you’re trying to `deserialize` or `decode_json` so make sure you do this:
>
> `htmlspecialchars_decode($data)`
>
> Before you try and decode it.

So to apply that same thing in your case, you'd need:

`function display_field($data)
{
 error_log( htmlspecialchars_decode($data) );
}`

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


# Question
Title: Forcing Preload-Replace variables to parse before conditionals in 2.9.0
I've been using Low's technique of combining snippets and preload variables (as described here) in order to be able to use a particular snippet repeatedly (and DRYly). The snippet contains conditionals and preload\_replace variables form part of the criteria for those conditionals, so the criteria can change depending upon the template in which the snippet is used.

Up until the point that I upgraded to 2.9.0 it worked just fine, because the Conditionals were advanced and so parsed long after the preload replacement had taken place. Now, under 2.9.0's new conditional parsing regime, it would appear that the conditionals are firing before the preload replacement has taken place, and the template throws an error.

Does anyone have a method of forcing the preload replacement to take place before the conditional are parsed, like in the old days? I'm trying to avoid using an embed if possible, but accept that there might be no other way. Still, I'd be interested to see if anyone has an alternative.

Thanks.

**UPDATE:** In response to the requests in the first couple of replies, here is some code. It's not the entire template, just the relevant channel entries loop and the problem snippet. (The rest of the template is pretty mundane).

CE loop:

```
{exp:channel:entries channel="news"}
    {!-- ...some other fields... --}
    {preload_replace:pre_gridfield="name_of_grid_field"}
    {snp_gridfield_output}
    {!-- ...some more fields... --}
{/exp:channel:entries}

```

Snippet snp\_gridfield\_output:

```
{{pre_gridfield}}
    {exp:typogrify:widont}{{pre_gridfield}:text}{/exp:typogrify:widont}
    {if {pre_gridfield}:image}
        {if {pre_gridfield}:caption != "" || {pre_gridfield}:credit != ""}
            <figure>
                <img src="{if {ress} < 480}{{pre_gridfield}:image:mobilesize}{if:else}{{pre_gridfield}:image}{/if}" alt="{{pre_gridfield}:alt}" title="{{pre_gridfield}:caption}">
                <figcaption>{{pre_gridfield}:caption}<span>{if {pre_gridfield}:credit != "" && {pre_gridfield}:caption != ""} / {/if}{if {pre_gridfield}:credit}© {{pre_gridfield}:credit}{/if}</span></figcaption>
            </figure>
        {if:else}
            <img src="{if {ress} < 480}{{pre_gridfield}:image:mobilesize}{if:else}{{pre_gridfield}:image}{/if}" alt="{{pre_gridfield}:alt}" title="{{pre_gridfield}:caption}">
        {/if}
    {/if}
{/{pre_gridfield}}

```

The various Grid fields that this snippet might reference all have the following columns: text|image|alt (for image alt text)|caption|credit. What's going on in this snippet's code is that once the preload replacement has correctly set the name of appropriate Grid field, the Grid loop will first place the text, then look to see if there is an image. If there *is* then it checks to see whether the image has a caption and/or a credit. If it does, then a \<figure\> element is used (with \<img\> and \<figcaption\> elements inside), otherwise the \<img\> element is used on its own. There is also some degree of content negotiation based upon the screen size (the {ress} tag) which can be seen in the img element's src attribute.

The preload replace is definitely the problem; if I do the replacement manually inside the snippet (ie. search-and-replace '{pre\_gridfield}' with 'name\_of\_grid\_field') and do away with the preload\_replace tag entirely, the problem disappears. But so does my flexibility for reusing the snippet.

Hope this helps.

# Answer
> 0 votes
I recently had the same problem. Through the process of elimination I discovered it was an apostrophe in my Entry that was causing this error to happen.

i.e.

```
            {if '{cancerstreated_sec1_studies}{cancerstreated_sec1_studies:medicalprof_sec1b_title}{/cancerstreated_sec1_studies}'!=''}
            <div class="twelveRightSection">
                <div class="topTitle">
                    <p>Related Studies</p>
                </div>
                <div class="bottomTable">
                    <table class="relatedStudies">
                        {cancerstreated_sec1_studies}
                        <tr class="{cancerstreated_sec1_studies:switch='|oddRow'}">
                            <td class="studyName">{cancerstreated_sec1_studies:medicalprof_sec1b_title}</td>
                            <td class="studyAuthor">{cancerstreated_sec1_studies:medicalprof_sec1b_author}</td>
                            <td class="studyCTA"><a href="{cancerstreated_sec1_studies:medicalprof_sec1b_url}" title="Read Story" target="_blank">Read Study</a></td>
                        </tr>
                        {/cancerstreated_sec1_studies}
                    </table>
                </div>
            </div>
            {/if}

```

I was using an IF to check if the following Grid field existed. IF it existed, show the content.**{cancerstreated\_sec1\_studies:medicalprof\_sec1b\_title}**

By removing the apostrophe from my entries title name, the error went away. I'm now checking for the Author's name instead of the entry title for this conditional. Not ideal, but it works.

in EE V2.9 Grid has been such a headache...

I hope this helped!

---
Tags: conditionals, parse-order, 2.9
---


# Question
Title: DevDemon Channel Images---When using Rackspace are files also stored onsite?
I'm working on a site that is image heavy. I've switched to using DevDemon's Channel Images and am wondering if I use rackspace as a CDN if the images currently on the site are deleted after the copies are uploaded to Rackspace Cloud.

Even if they aren't I could manually delete them, but I want to make sure that copies are not kept in both places. Since the local site mapping option is removed I'm thinking that copies are not kept locally, but it would be nice to have this confirmed.

Currently the site is over 2G and I'm having trouble transferring offsite backups to rackspace via CE Cache. I've been messing with outrageous keep alive times that are not reasonable to keep on a live site. A CDN seems like the answer as long as image copies aren't kept locally.

Appreciate any helpful feedback Jules

# Answer
> 0 votes
I guess you are using the Image Transfer feature from the Channel Images control panel?

If yes, the images are not deleted after you move the images. You have to manually delete them. But make sure all images where uploaded correctly!

Note:
If you have a lot of images to transfer (3GB+) we have an internal script that does the transferring outside of EE (or even via shell).
The EE CP has a annoying timeout that cannot be disabled.

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


# Question
Title: "Undefined Index" PHP errors after upgrade from 1.6 to 2.9
After upgrading from 1.6 to 2.9, I’m getting a set of the errors below when displaying a page containing images, one set for each image. I’m running PHP 5.4.x and it says “Fast CGI” after the 5.4.x.

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: upload_date
Filename: file/ft.file.php
Line Number: 303

A PHP Error was encountered
Severity: Notice
Message: Undefined index: modified_date
Filename: file/ft.file.php
Line Number: 304

```

I also had Mark Huot’s File extension running in 1.6. I “resubmitted” or updated the field type for one custom field as “File” and I also ran the fix in this thread on this one custom file field, but only the part regarding the line breaks:

https://ellislab.com/forums/viewthread/218268/

and to see those in my template, I have to use the tag pair, or else nothing is output:

```
{myFileFieldName}{url}{/myFileFieldName}

```

I didn’t run the part about including the file directory, because EE is not parsing my {filedir\_x} tag.

In all other cases of file fields, where I didn’t run the fix or update/resubmit the custom field type as File, I can get output by just using the stand-alone tag, but I still get the errors:

```
{myFileFieldName}

```

UPDATE:

I did some more digging. So this error/warning is taking place at lines 303 and 304 of expressionengine/fieldtypes/file/ft.file.php in a function called:

```
replace_tag($file_info, $params = array(), $tagdata = FALSE)

```

and here’s where it chokes in that function:

```
$date_vars = array(
   'upload_date' => $file_info['upload_date'],
   'modified_date' => $file_info['modified_date']
);

```

I know next to nothing about PHP, but I reckon $file\_info has a problem, so I did an echo on $file\_info and it returns what looks like just a string: “Array”.

Not sure where to go from here to fix that. The upload\_date and modified\_date columns in exp\_files table are filled with data, so I can't imagine what's up.

# Answer
> 0 votes
I had to do two things to resolve the issue:

1. Apply both steps (adding the {filedir\_x} and searching replacing new lines/line breaks) of the fix from this EllisLab forum thread across the board, to all File fields not just to one File field: https://ellislab.com/forums/viewthread/218268/
2. I went into the Admin for channel fields and re-submitted each custom field that was a File field type.

Something about that exercise appears to have fixed the issue. Hope this helps someone else.

# Answer
> 0 votes
Sounds like you need to "re-sync" your files to force EE to generate the date data that it's looking for.

In the control panel, navigate to `Content ‣ Files ‣ File Upload Preferences ‣ Synchronize Files`.

Complete details are in the EE docs here:
https://ellislab.com/expressionengine/user-guide/cp/content/files/sync\_files.html

> The Synchronize Files page allows you to synchronize the file records in the database with the files stored in a given upload directory. When submitted, all allowed file types in the directory will be checked against the file records in the database. If there is no record in the database, one will be added. For images, any additional sizes will be generated and watermarked according to the file upload preferences for that directory. Lastly, any records in the database that do not have a corresponding file in the main directory will be deleted from the database along with any existing resized images. Existing images may also be set to regenerate resized images from this page.

---
Tags: custom-fields, fieldtype, upgrade, php-errors
---


title: Master config – blank screen

text:
# Question
Title: Master config – blank screen
I am using FL master config and works a treat (brilliant) on local (MAMP) but when uploading/accessing the dev server just a blank screen appears and also the same for the system login (so can't turn on debug), I know EE works okay on this host (and the db is okay – EE runs fine using a default fresh install). I tried another host and the master config approach works fine! so can only think that the dev host has a prob with the master config approach, checked and dbl checked settings so can't be that, looking into using reelocate but spoilt by the ease of FL's master config approach (so easy!), so wondered if anyone had come across this before and found some possible solutions?

Thanks.

# Answer
A WSOD after installing a Master Config probably means that the new config isn't being loaded correctly. This could be because the include path in EE's `config.php` doesn't correctly refer to the Master Config file, or because the environment-based path generated by the master config doesn't correctly refer to an environment config file. It could also be a syntax error somewhere in any of the config files.

Some troubleshooting steps:

1. In your EE config.php, before you include the master config file, `echo()` the path in your include statement. If you see the path displayed when you reload the page, it means EE's `config.php` is being loaded properly, but your Master Config file (`config.master.php`) file isn't. There's probably a typo in the path, such as an extra/missing slash, an extra/missing `...`, etc.
2. In your Master Config file, insert an `exit("test")` at the very beginning. If when you reload the page you see this message (probably twice), it means your Master Config file is being loaded properly, but some setting is causing an error.
3. Try block-commenting out config settings until it works. If you comment out all your config items and still have a WSOD, probably there's an error loading your environment config file, so the troubleshooting process repeats, one layer recursed...
4. First, check to make sure the domain name you're accessing matches the hostname of an environment you have specified, and that the environment has its `env` variable/constant defined. If it does, check to make sure your `config.[env].php` file actually exists.
5. In the Master Config file, just before the `include` statement that includes the environment config file, `echo()` that path, and check as before to make sure it doesn't have typos.
6. Try adding a `exit("test");` at the top of your environment config file. If you see that message when you reload the page, it means the config file is being loaded properly, but some setting is causing issues. Start block-commenting out config directives until it works.

(Since you mention that this Master Config works on your local machine, but not on the server, it's probably an issue with the hostname not matching up with a defined environment/`env` in the master config. In that case, you could skip to step 4, but I'm including the whole process for the sake of completeness...)

p.s. Also double-check to make sure that files on your server are exactly the same as the files on your local machine... I know that sounds obvious, but I cringe at how many times (before the age of easy Git deployments) I saw a WSOD because I forgot to upload a file...
> 1 votes

---
Tags: focus-lab-master-config
---


# Question
Title: Solspace color coding events by Category
I have a handful of events I need color coded.

**Here is my setup:** Solspace Calendar using the Full Calendar theme, and setup by using this guide.

Currently, everything works beautifully.

I am gathering events by using *multiple* .ics files under the Calendar Module section. Each .ics file will be all the events for that category. ***Example:*** publicevents.ics would post all the Public Events, and publicmeetings.ics would post all the Public Meetings, and so on.

So far I've created all needed categories under Admin \>\> Channel Administration \>\> Categories.

**Here are my questions:**

1. Can I color code these events by category on the front end with this set up?
2. How would I link each separate .ics file to a class so that it can display that color?

I'm assuming I can just use...

`{if category_id="13"}
 class="category1"
{/if}`

...once I can figure out how to link each separate .ics file with a class?

Any help is greatly appreciated and thank you for your time.

# Answer
> -1 votes
So, after many many... many days (too many days) of trying to figure this out, I finally did and the answer was literally right under our noses the entire time. We just didn't search through Full Calendar's documentation long enough. It is incredibly simple.

```
color: 'yellow',
textColor: 'black'

```

Full Calendar Documentation

# Answer
> 1 votes
Calendar will not support the automated import/assigning of EE Categories through ICS import. You would have to enter these all in manually after the fact to get it to work.

I am not exactly sure how your workflow is, and how you're currently using the built in "calendars" option (where you create and manage calendars (channel entries) that events get assigned to), but I would suggest that you use calendars as your "categories" if possible. And because the use of calendars is expected, you'll have much better support for that functionality throughout the Calendar add-on. :)

---
Tags: solspace, channel, solspace-calendar, categories
---


title: Filtering and Ordering

text:
# Question
Title: Filtering and Ordering
I'm working on a site that's going to list events. These events will have the following data:

* Title
* Type
* Date
* Location

I'd like to give the user the ability to filter by any one (or combination) of these fields.

I'd also like to give the user the ability to order the remaining results by any one of these fields.

Any thoughts on a good solution to do this? I'm thinking there must be a good plugin that does this?

Any thoughts are appreciated!

# Answer
Remember you can always use Dynamic Parameters to sort data on the fly - https://ellislab.com/expressionengine/user-guide/add-ons/channel/dynamic\_parameters.html
> 1 votes

# Answer
Potentially look at implementing your Events using Low Events (http://gotolow.com/addons/low-events). The template tags allow to set date parameters as well as order\_by and sort parameters (http://gotolow.com/addons/low-events/docs/tags) that should allow you to do what you're looking for.
> 0 votes

# Answer
After posting this question I realised that this is more of a front-end question as opposed to a back-end one. Therefore rather than looking for an expression engine add-on, I can simply output all the entries and then allow a jQuery plugin to take care of the rest.

Having looked around, https://mixitup.kunkalabs.com/ seems to be a really good option, offering filtering and sorting with nice animations to make things look great.
> 0 votes

# Answer
We have used the Solspace Supersearch add-on to accomplish this. We chose not to do ajax/animated filtering, but to filter based on page/url. Let me know if you need more details.
> 0 votes

---
Tags: channel-entries, custom-fields, filter
---


# Question
Title: What to do with deprecated encrypt_input and decrypt_input in Profile:Edit
Working on a site where we're using Profile:Edit to register users using the {exp:profile:register}. In this particular case, we're using the parameter 'group\_id' to register a user into a particular member group, which can be done by an admin on the front end through a restricted access dashboard.

Running into an error:

```
Fatal error: Call to undefined method Channel_form_lib::encrypt_input() in
/path/to/system/third_party/profile/mod.profile.php on line 880

```

A quick bit of research tells me that that method was deprecated as of EE v2.6, and we have just upgraded to EE v2.8.1/2.9 (and soon to v2.9). This also goes hand-in-hand with the Channel\_form\_lib::decrypt\_input() method that is also being user in mod.profile.php

Can any EE developer/programmers point me in the right direction of a simple change to the method I can move to?

# Answer
I scheduled a support call with Mighty Big Robot for this morning, and before I started it had an email with an updated version of Profile:Edit in my mailbox to test.

Basically this included updates to cater for the deprecated functions as well as a minor hack I had made to a local version so that I could use the {exp:profile:view} tag on the same template as {exp:channel:form}.

The current version is now v1.2.0 and suspect it will be made available through the MBR website soon for those that might be experiencing the same problems.

Should note that I did need to hit the Module settings page for Profile:Edit and re-submit the settings for it to work 100%.

(Many thanks to Chris Barrett for working with us at such short notice)
> 0 votes

---
Tags: safecracker, profile-edit
---


title: Files disappear from assets

text:
# Question
Title: Files disappear from assets
EE 2.4 Assets 1.1.5

Following a server upgrade from PHP 5.2 to PHP 5.4 all files in the Assets addon have gone from a clients installation. All the images in the channel entries have also vanished. Could you please tell me if a an upgrade to the latest version of Assets will solve this?

# Answer
Assets 1.1.5 reads files from the disk, so, most likely, this is a permission issue or an issue of wrong server path set for the upload folder.
> 1 votes

---
Tags: assets
---


# Question
Title: Zoo Visitor / Store 2 validation based on radio value
I have a registration and checkout page where I give users the choice to register as a business or a private person (radio input).

If the user clicks on the 'business' radio, a pane slides down with inputs for company name and VAT number.

I would like to make these fields required, if chosen for business registration type.

I can do this with jQuery but can it be done with conditionals / hard coded too, in the template?

# Answer
Based on my previous findings (Zoo Visitor: confirm delete user account) this **is** possible using Stash.

When you post a form, use the post info. In the redirect template you could check to see if a value exists and display an error message or redirect back/contunue

In a conditional you could so something like:

```
// Check to see if radio button 'is_business' is checked with value 'business'
// check to see if company name field is empty
{if "{exp:stash:get name='is_business' dynamic='yes'}" == 'business' AND "!{exp:stash:get name='company_name' dynamic='yes'}"}
    // error
{/if}

```

This way you can in any case provide a hard-coded way to validate you form.
> 1 votes

# Answer
Unfortunately you can't make the required fields conditional. The Store/Zoo Visitor/Channel Form fields provide an option to set specific fields as being required but if you set these then they will always be required on form submission regardless of which option the user selected.

For this reason the best solution is to NOT set them as required fields in the template tags (server-side) but use JS/jQuery to handle this instead. That way EE wont grumble about form fields not being filled out when they're set to be required. You can then handle it all conditionally on the front-end and react to user selection.
> 3 votes

---
Tags: expresso-store, zoo-visitor
---


title: How To Add Two Store Tags

text:
# Question
Title: How To Add Two Store Tags
If I need to add two store tags together to make up a sum, how would I go about this? This is what I want to achieve:

{order\_discount} + {order\_you\_save} = R total savings

Is this possible? I still obviously need the total savings to reflect on the total amount of the order.

# Answer
There is nothing built into Store that I know of that would allow you to do this. You could however use something like MX Calculator or a similar add-on to calculate the total.

Something along the lines of:

```
{exp:mx_calc expression="{order_discount_val} + {order_you_save_value}" parse="inward"}
 Total Savings of {calc_result}
{/exp:mx_calc}

```

Notice that I added `_val` to each of the tags so that they will be outputted without the currency symbols, you will need to do this or the math will not work correctly.
> 1 votes

---
Tags: expresso-store, tags, ee
---


title: Related entries using Playa

text:
# Question
Title: Related entries using Playa
We have Playa installed on our site and I wanted to use it to create a Related Articles box.

Here is the code I have in an embedded template:

```
<!-- Related Articles Box -->
{if related_articles!=""} <br>
    <div id="related-articles">
        <h4>Related Articles</h4>
        <div class="col">
        <div class="cat">For more information about this topic see the following articles:</div><br>
        {exp:channel:entries channel="whats_happening|learn_more"}
            <ul>
        {exp:playa:children  field="related_articles" field_id="52" }
            <li><h3><a href="{path=library/article/{url_title}">{title}</a></h3></li><br>
            {/exp:playa:children}
            </ul>
        {/exp:channel:entries}
        </div><!-- end .col -->
</div><!-- end #related-articles -->

```

I know the parent template is calling this embedded one correctly because when I view Page Source I see my comments and but nothing in between gets displayed so it's gotta be a problem with this code right?

Thing is I had this working a few weeks ago and at some point it stopped working. I didn't notice until a coworker asked me what happened to it. The only thing I remember doing on the site was updating a couple of plugins so I rolled back to the previous versions but it still doesn't work now.

I can't think of what else to try. Can anyone help?

# Answer
Looks like your missing `dynamic="no"` parameter on the `exp:channel:entries` tag. However, it seems like you might be over complicating things as the `exp:playa:children` would work by itself if you pass a embedded variable with the `entry_id` of the parent to the embedded playa:children tag:

```
{exp:playa:children entry_id="{embed:entry_id}"}

```
> 3 votes

---
Tags: playa, relationships
---


# Question
Title: sidebar ajax calendar - only loads one month and fails
I've got a calendar on the sidebar of every page and am attempting to load it with ajax and have partially succeeded.

Currently I can load either the next or the previous month once and only once and then it loads a new page with just the calendar visible. Trying to go back with the calendar loads nothing but on second click returns to the original page. Am stuck and have no idea how to fix this. Used this gist as a starter (everything else I tried didn't work).

Added a screencast where you can see it load correctly the first time but not the second https://www.screenr.com/SqON

My template code looks like this.

**Sidebar Template**

```
<article>

    <div id="cal_container">
        {embed="embeds/full_calendar"}
    </div>

</article>

```

**Embedded Template**

```
{exp:channel:calendar channel="events" dynamic="yes" show_future_entries="yes" switch="calendarToday|calendarCell" year="" month=""}

  <table class="calendarBG table" border="0" cellpadding="6" cellspacing="1" summary="My Calendar" id="calendar">

    <tr class="calendarHeader">
        <th>
            <div class="calendarMonthLinks">
              <a href="{previous_path='/embeds/full_calendar'}" id="prev" rel="#cal_container"><<</a>
            </div>
        </th>
        <th colspan="5">
            <center>{date format="%F %Y"}</center>
        </th>
        <th>
            <div class="calendarMonthLinks">
                <a class="calendarMonthLinks" href="{next_path='/embeds/full_calendar'}" id="next" rel="#cal_container">>></a>
            </div>
        </th>
    </tr>

    {calendar_rows}
        {row_start}<tr>{/row_start}

        {if entries}
            <td class='{switch} calEntry' align='center'>

        {!--
        // need to use embed in order to get this to work
        // with structure and page_url variable
        --}
                {embed="embeds/_calendar_entry"
                    day="{day_number}"
                    entry_id="{entries}{entry_id}{/entries}"
                    }
            </td>
        {/if}

        {if not_entries}
            <td class='{switch}' align='center'>{day_number}</td>
        {/if}
        {if blank}
            <td class='calendarBlank'>{day_number}</td>
        {/if}
        {row_end}</tr>{/row_end}
    {/calendar_rows}
  </table>

{/exp:channel:calendar}

```

And javascript inside scripts.js

```
$(function(){

  $('#prev, #next').on('click', function(e){ // catch the click, and bind that click-event to the variable "e"
    e.preventDefault(); // stop the event from firing (so user doesn't get forwarded to the actual link)

    var elem = $(this),
      link = elem.attr('href'),
      target = elem.attr('rel');

    $.get(link, function(data){ // do a GET-request
      $('#cal_container').html(data); // put the results in the target-element
    });

  });

});

```

**Changed the javascript** to the following (shorter) and it works exactly the same as the first including not going more than one month

```
$(document).ready(function() {
  $('#prev, #next').on('click', function(e){ // catch the click, and bind that click-event to the variable "e"
    e.preventDefault(); // stop the event from firing (so user doesn't get forwarded to the actual link)

    $('#cal_container').load($(this).attr('href') + ' #calendar');
  });
});

```

# Answer
> 2 votes
Move the click handler to the wrapping div.

```
    $('#cal_container').on('click', '#prev, #next', function(event) {
       event.preventDefault(); /* Act on the event */
});

```

Has to do with the original event handler in your code not being passed to the dynamically inserted html. There's a good explanation found here: http://toddmotto.com/attaching-event-handlers-to-dynamically-created-javascript-elements/ and in the jquery docs for the .on method here: http://api.jquery.com/on/

By moving the click handler to an element that's unchanged in your original html (i.e. #cal\_container) you can work around it.

---
Tags: ajax, calendar
---


# Question
Title: Trying to upgrade from EE 2.5.5 to 2.9.90 - the infamous white screen problem
So Im trying to upgrade an EE site and when I follow the instructions... All I get is a black white page. No error messages, nothing.

Interesting when I enable debug=1 in index.php, I do see this error: Parse error: syntax error, unexpected T\_STATIC, expecting T\_STRING or T\_VARIABLE or '$' in /var/www/vhosts/default/htdocs/run/EllisLab/ExpressionEngine/Core/Autoloader.php on line 46

Any ideas or hints really appreciated.

I dont have any special modules or plugins.

Paul

# Answer
The error points you to line 46 of the Autoloader.php file. That line of code is:

```
if ( ! isset(static::$instance))

```

This line of code will only run in PHP 5.3.0 or newer.

---

**ExpressionEngine 2.9 requires PHP 5.3.10 or newer** and you're getting the error because your PHP version is older than this.
> 3 votes

---
Tags: ee2-upgrades
---


# Question
Title: Adding Google Analytics tracking code to website footer
Everytime I add the tacking code to the source code on the websiet, EE strip it out. Is there anyway to get it to stay without using a plugin?

# Answer
Just to echo Johnathan's answer, I put my Google Analytics tracking code in a Global Variable (usually called footer) which is added to each template.
> 4 votes

# Answer
Put it in the template as opposed to in a field type. If you need to be able to change the number, just make that a field instead. Just put this in the template and replace {yourfieldhere}

```
 <script>
  var _gaq=[['_setAccount','{yourfieldhere}'],['_trackPageview']];
  setTimeout("_gaq.push(['_trackEvent', '15_seconds', 'read'])",15000);
  (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
  g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
  s.parentNode.insertBefore(g,s)}(document,'script'));
</script>

```
> 2 votes

---
Tags: tracking, google-analytics
---


title: Conditional Variable with Grid Field

text:
# Question
Title: Conditional Variable with Grid Field
I've got a navigation structure where I'm using the Title as the main navigation menu item and then using grid for any submenu items. So what I basically want to do is something like this:

```
{if "{submenu:field_total_rows}" == "0"}{if:else}Show the submenu{/if}

```

I've tried multiple variations on the above row - but both empty and non-empty submenus are behaving the same way. I'm sure its just a syntax issue but I can't find what is is.

# Answer
> 5 votes
If `submenu` is the grid fieldtype name, then all you need is:

```
{if submenu:total_rows > 0}submenu contents{/if}

```

You may need to add quotes and brackets around the condition if the above doesn't work

# Answer
> 3 votes
I tried a billion combinations as well. This is how I used it for meta data (functional):

```
{if articles_seo_meta_data:total_rows > 0}
    {articles_seo_meta_data}
        {articles_seo_meta_data:meta_title}
    {/articles_seo_meta_data}
{if:else}
    {title}
{/if}

```

# Answer
> 1 votes
Say you had a grid field named 'submenu' with 3 columns in it. One dropdown named 'Target' and two text fields named 'Link', and 'Text'.

You need to see if there are rows first like this:

```
{if submenu:total_rows > 0}

```

Then open the grid field and loop through the rows like this:

```
{submenu}
    Your data...
{/submenu}

```

You would end up with something like this, depending on your markup and what you choose to qualify:

```
{if submenu:total_rows > 0}
    <ul class="subnav">
        {submenu}
            <li class="subnav-item">
                <a {if "{submenu:link"}!=""}href="{submenu:link}"{/if}{if "{submenu:target}"=="External"} target="_blank">{if "{submenu:text}"!=""}{submenu:text}{/if}</a>
            </li>
        {/submenu}
    </ul>
{/if}

```

---
Tags: conditionals, grid
---


title: Storing grid data with stash

text:
# Question
Title: Storing grid data with stash
I am using stash to store some common site data and would like to use a grid field to store one of the fields with the user having the option to input 0-4 rows. Is there a way to do this with stash?

So if I was stashing the variables is there anything I use like the switch statement with stash?

Something like:

```
{grid_field}
    {exp:stash:row_{switch='1|2|3|4'}_col_1}{grid_field:col_1}{/exp:stash:row_{switch='1|2|3|4'}_col_1}
    {exp:stash:row_{switch='1|2|3|4'}_col_2}{grid_field:col_2}{/exp:stash:row_{switch='1|2|3|4'}_col_2}
{/grid_field}

```

# Answer
> 1 votes
WOW! I'm an idiot. lol

I read right past the lists in the docs. Thanks for a great add on and doc set Mark. ;)

https://github.com/croxton/Stash/wiki/Lists

```
{exp:stash:set_list name="mini_links" parse_tags="yes"}
    {mini_links}
        {stash:href}{mini_links:link}{/stash:href}
        {stash:text}{mini_links:title}{/stash:text}
    {/mini_links}
{/exp:stash:set_list}

```

Then:

```
<nav id="sub-menu">
    <ul>
        {exp:stash:get_list name="mini_links"}
            <li><a href="{href}">{text}</a></li>
        {/exp:stash:get_list}
    </ul>
</nav>

```

---
Tags: ee2, stash, grid, switch
---


title: Free orders with CartThrob 2.6?

text:
# Question
Title: Free orders with CartThrob 2.6?
Is the "Free Order" discount working for anyone else in CartThrob 2.6 and EE 2.8.1? It seems to be completely broken - the cart still uses the undiscounted amount as the total. It looks like CT recalculates the total from scratch if it sees that the total is \<= $0 in the total() function in cartthrob/core/Cartthrob\_cart.php, but I can't figure out how to make it stop without breaking calculations for normal (non-discounted) orders.

# Answer
I found a commented out line at the end of cartthrob/plugins/discount/Cartthrob\_discount\_free\_order.php. I uncommented that line and commented out the replacement line (`return 0;`). This seems to work, but I assume there was a reason it was commented out in the first place, so I'm not sure if I've broken anything else....
> 0 votes

---
Tags: cartthrob
---


title: Automatically removing old entries

text:
# Question
Title: Automatically removing old entries
I have a channel which is growing large through automatic daily imports. Is there any way to automatically remove (prune) entries older than X days? I've looked through the extension space without joy. It would certainly be possible to do this directly in the db but there are quite a few tables to deal with (sorry, that sounds whiny, eh?).

Anyway, I'd be glad for any thoughts or pointers. Thanks.

# Answer
Yes there is! Andrew Weaver's Purgedata plugin will do exactly this.

From his website:

> * Delete content from selected weblogs that is older than a specified time
> * Ideal to accompany FeedGrab, CSVGrab and XMLGrab.

It works by adding the plugin's tag to an EE template and visiting the URL.

```
{exp:ajw_purgedata
  channel="9"
  days="2"
  hours="0"
}

```

This will delete all entries from channel with the id 9 which are more than 2 days old.

To run this automatically, you could try using a CRON job run wget as described here: https://stackoverflow.com/a/13259564/1013978
> 2 votes

# Answer
You can set "expiration date" to hide entries from displaying on front-end after certain date. And there could be an extension that will remove expired entries, if you worry about database growing too large. Though personally I would keep all entries, at least just for the record.
> 1 votes

---
Tags: database, entries
---


title: How To Get Promo Code Value

text:
# Question
Title: How To Get Promo Code Value
I am displaying a promo code that the user submits by using `{promo_code}`, but now I also want to display the '*base discount*' value for the promo code. I tried to use `{promo_code_value}`, but this seems to be blank even though the R100 value of the promo code is reflected in the `{order_discount}` tag.

Any other suggestions on what I could try?

# Answer
> 1 votes
The tag {order\_discount} should give you the amount of money that's being discounted from the customers cart?

This will be formatted for currency, if you just want it as a numeric value, simply use {order\_discount\_val}.

You have:

* {order\_subtotal} (The amount before the discount)
* {order\_discount} (The amount of the discount being applied)
* {order\_total} (The total after the discount has been applied and after tax/shipping).

Or have I misinterpreted the question?

---
Tags: expresso-store, ee2, checkout, discounts
---


# Question
Title: Expression Engine Core (Free Version) Templates
I downloaded Expression Engine Core, the free version of EE.

Does this version save templates as files or only in the database?

# Answer
> 1 votes
You can save templates as files in Core. https://ellislab.com/expressionengine/user-guide/templates/templates\_as\_files.html

---
Tags: ee2, templates
---


title: {order_discount} Not Resetting

text:
# Question
Title: {order_discount} Not Resetting
Currently I am using Expresso Store for my checkout module using EE2. When I add a product - which got a 50% discount - to the cart, the `{order_discount}` tag displays half the price of the product which is correct.

However, when I remove the product from the cart and remove the sale from that product via the backend and re-add the product (which previously had the sale), the `{order_discount}` still displays half the price as this discount is already recorded in the database. Should the removal of the product not reset/retract the discount from the `{order_discount}` tag or database? Is there a way to work around this?

# Answer
> 1 votes
Make sure that you have cleared your cart to reset the session which should then reset the `{order_discount}` tag

---
Tags: expresso-store, ee2, checkout, discounts
---


# Question
Title: Rabo Omnikassa support for exp:resso store
I bought a license of Exp:resso Store, with the idea that it supports Rabo OmniKassa payment gateway, as mentioned by Exp:resso itself in there release notes.

Now I want to setup the payment gateway information and notice that it is not available in store 2.x.

So I contacted Exp:resso about this and they said that the payment gateway was dropped as of version 2.x. But they also told me that will look at it at try to re-implement it.

That's what they said 6 weeks ago. But radio silence since that last e-mail.

I e-mailed them a couple of times, but only receiving a default answer but no real answer. In my opinion, the support is very bad voor Exp:resso store.

Hopefully, they well fix my issue. But until then, maybe I have to fix it myself. But how will I be able to do so, of does anyone already have done this? Implementing support for Rabo OmniKassa.

# Answer
Usually additional gateways are sponsored before they are developed so you could talk to them about sponsoring the creation of the new gateway.

The docs also mention that Store 2 payment library was rewritten and that not all gateways are supported.

> Most officially supported gateways have been included, but any third-party gateways will need to be rewritten in the new format.

Having said that Store uses Omnipay which is an open source payment library so you could easily develop your own Rabo Omnikassa gateway using their API. You can look at the included gateways to see how the payment gateway should be structured.

If all else fails they do have a have a return period, and would probably make an exception if you have passed that threshold.
> 1 votes

---
Tags: expresso-store, payment-gateway
---


# Question
Title: Geotagger 2.6 support (EE fieldtype error in developer log)
Found an error caused by Mighty Big Robot's Geotagger in the EE developer's log. It seems that this issue might have existed since 2.6.

Here's my error:

Deprecated function EE\_Fieldtype() called in system/expressionengine/third\_party/geotagger/ft.geotagger.php on line 47. Deprecated since 2.6. Use EE\_Fieldtype::\__construct() instead.

Does anyone know anything about their update or if its easy to change the code to work to the 2.6 fieldtype?

Thanks!

# Answer
In **ft.geotagger.php**, inside the `__construct()` function, change:

```
parent::EE_Fieldtype();

```

to

```
EE_Fieldtype::__construct();

```

That's it.
> 1 votes

# Answer
I've started a thread in the EE forums: http://ellislab.com/forums/viewthread/244991/

There has been one solution posted, but it requires a hack to the native EE text fieldtype code (/system/expressionengine/fieldtypes/text/ft.text.php) from

```
 $field = array(
   'name'  => $this->field_name,
   'value'  => $this->_format_number($data, $type),
   'dir'  => $this->settings['field_text_direction'],
   'field_content_type' => $type
  );

```

to

```
 $field = array(
   'id'  => $this->field_name,
   'name'  => $this->field_name,
   'value'  => $this->_format_number($data, $type),
   'dir'  => $this->settings['field_text_direction'],
   'field_content_type' => $type
  );

```

But I don't know what impact that would have to the system. I've posted the question to the developer, and will update the thread if there are any other solutions suggested.

Thanks Derek for jumping in on this. I don't have enough reputation points to add a comment to your answer, so I'll just edit my entry.

The hack was required in addition to the function change suggested by the developer log to make the add-on fully functional.

Updating the function name as you suggested does allow the fieldtype to install successfully, but it still doesn't work right. The fieldtype loads in the entry, but when you put in any address information and hit "Geocode Entry" it yields no results. That's why it was suggested to hack the fieldtype code. Like you, I do not recommend a system hack ever, so I am trying to find the portion of the add-on that EE 2.7+ does not like.

I've never built an add-on, so I am at a loss for where to go from here.
> 0 votes

# Answer
CG11 posted a better solution on my forum thread, so I'm adding it here This one does not requiring hacking the fieldtype.

It's a 2-step solution. You still have to change the construct function as Derek suggested. The other part is to change the javascript in the themes folder.

Here is a link to the updated script

Hope that helps everyone!
> 0 votes

# Answer
The developer updated the addon to version 3.06 in April and this is working for me on EE 2.9.0 http://mightybigrobot.com/products/detail/geotagger
> 0 votes

---
Tags: error
---


# Question
Title: Pagination and conditionals in entry tag not working
I want to use pagination to paginate article in the "news" section but only those that have a "Yes" statement in the calendar\_add field. calendar\_add is a switch (pill) field where you can choose from Yes and No.

Pagination does not work. If I remove {if calendar\_add == "Yes"} is works fine but paginates all the entries.

Here is the code:

```
{exp:channel:entries channel="news" limit="1" status="open" orderby="date" sort="desc" disable="categories|category_fields|member_data|trackbacks""}

    {if calendar_add == "Yes"}

      {title}

      {paginate}
           {exp:string:set name="pagination"}
        {if next_page}
            <a class="button pagination" href="{auto_path}">NESTE SIDE »</a>
        {/if}
        {if previous_page}
            <a class="button pagination" href="{auto_path}">« FORRIGE SIDE</a>
            {/if}
        {/exp:string:set}
      {/paginate}

      {/if}
      {/exp:channel:entries}
      <div class="article-block">{embed="hjem/pagination"}</div>

```

# Answer
> 1 votes
Try using the search tag instead of the conditional. (Make sure the field is set to searchable in the field settings)

```
{exp:channel:entries channel="news" limit="1" status="open" orderby="date" sort="desc" disable="categories|category_fields|member_data|trackbacks" search:calendar_add="Yes"}

```

Alternatively you could move the pagination links outside of the conditional so it showed all the time but that would show blank pages if an entry was not marked yes.

---
Tags: pagination
---


title: Changing error language in Store

text:
# Question
Title: Changing error language in Store
Is there any out of the box way to change error language for the front end of Store, i.e. "expiry" to "expiration"?

# Answer
You can modify the store/language/English/lang\_store.php file or if you are just wanting to modify error messages you can do something along the lines of:

```
{if error:field_name}Your custom error message here{/if}

```
> 1 votes

---
Tags: expresso-store
---


title: CartThrob Database Error

text:
# Question
Title: CartThrob Database Error
Posting here as CartThrob say they monitor this section daily.

Clicking on "Reports" in my CartThrob Extension menu gives the following database error. Is there anything I can do about this or is it a CartThrob bug?

```
A Database Error Occurred
Error Number: 1054

Unknown column 'status' in 'where clause'

SELECT `template_id`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `exp_templates`.`site_id` = '1' ORDER BY `group_name`, `template_name`

Filename: models/template_model.php

Line Number: 819

```

I'm on CartThrob v2.5, EE 2.8.1

Thanks!

# Answer
> 1 votes
Is CartThrob compatible for EE 2.8.x yet? That could be an issue. But i'd just check if the *Select* the SQL is trying to do, actually exists. e.g. Does the table \*exp\_templates\* exist. Best way of debugging it.

# Answer
> 0 votes
Similar error for me. When selecting the report tab in the CartThrob CP the error is "Unknown column 'status' in 'where clause'" Checking the tables **exp\_templates** and **exp\_template\_groups** and there is not a column in either table.

```
Unknown column 'status' in 'where clause'

SELECT `template_id`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `exp_templates`.`site_id` = '1' ORDER BY `group_name`, `template_name`

Filename: models/template_model.php

Line Number: 818

```

I am not about to modify line 818 of a EE file. Might if it was a cartthrob file. Accessing templates works just fine via EE Design tabs.

---
Tags: cartthrob
---


# Question
Title: How do I display matrix fields inside of a relationship field (channel entry)?
Anybody have an answer? I am trying to do this in EE 2.6, but the matrix fields don't display. I have a channel (fruit) with a relationship field to another channel. That channel (kinds) has a matrix field called locations. Inside of locations is a column called state. I'm trying to get a list of states to display.

```
{exp:channel:entries channel="fruit" limit="1"}

{related-entry-kinds} <-- name of field inside of fruit channel

{related-entry-kinds:title} <-- this displays fine

{related-entry-kinds:locations} <--name of matrix field

{related-entry-kinds:locations:state} <--doesn't render

{/related-entry-kinds:locations}

{/related-entry-kinds}

{/exp:channel:entries}

```

# Answer
Matrix doesn't do the inheritance like that. Just simply used the fields as you would a regular matrix field

```
{exp:channel:entries channel="fruit" limit="1"}

   {related-entry-kinds} <-- name of field inside of fruit channel

      {related-entry-kinds:title} <-- this displays fine

      {related-entry-kinds:locations} <--name of matrix field

         {state}

      {/related-entry-kinds:locations}

   {/related-entry-kinds}

{/exp:channel:entries}

```

If you are paranoid, you can use the var\_prefix parameter (check it out on here). They do something similar but with playa. It should work the same for relationships
> 2 votes

---
Tags: channel-entries, matrix, relationships, multiple-channels
---


title: CT 2.6 not working with EE 2.9.0?

text:
# Question
Title: CT 2.6 not working with EE 2.9.0?
Just installed CT 2.6 onto a EE 2.9/0 site to quickly check out the Price Modifiers Configurator FieldType and ran into some trouble. In CartThrob' section of the CP, I cannot access the Products and Reports tabs in a normal way.

---

Products tab

The Products tab does not display properly. Looks like the style sheet is gone and many of EE's CP controls are gone. And the page display several PHP Warnings.

First one

```
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /chroot/home/brighto1/brightorangethread.com/html/ZZiPQdPOmvcCaY/expressionengine/third_party/cartthrob/views/settings_form.php:80)

Filename: core/Common.php

Line Number: 446

```

Second one

```
Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: helpers/form_helper.php

Line Number: 324

```

---

Report tab

Nothing displays. I just get

```
Error Number: 1054

Unknown column 'status' in 'where clause'

SELECT `template_id`, `template_name`, `group_name` FROM (`exp_templates`) JOIN `exp_template_groups` ON `exp_templates`.`group_id` = `exp_template_groups`.`group_id` WHERE `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `status` NOT IN ('closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed', 'closed') AND `exp_templates`.`site_id` = '1' ORDER BY `group_name`, `template_name`

Filename: models/template_model.php

Line Number: 818

```

Checking the tables exp\_templates and exp\_template\_groups and there is not a column in either table. Which seems similar to this issue.

# Answer
Have you installed the products channel and orders channel? It can be installed from the settings.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: Does Playa Children tag support the Categories variable pair from EE Channel Entries module
The below code is parsing the Title & ENTRY ID variables but not the categories pair. The Playa documentation says it supports "nearly all" variables etc for the EE Channel Entries module.

```
{exp:playa:children field="log_skill"}
                            <p>{title}</p>
                            <p>{entry_id}</p>
                            <p>{categories}{category_name}{/categories}</p>
                        {/exp:playa:children}

```

# Answer
> 0 votes
Discovered the answer on this post : Categories not appearing in playa:children

Playa disables categories by default so you need to explicitly name them.

---
Tags: playa
---


title: freeform pro paginate problem

text:
# Question
Title: freeform pro paginate problem
I want to use freeform pro entries tag to list all attendees. But seems to be a problem to combine freeform:paginate together with a table. I need to loop around the 'TR' tag. It shows the paginate links well, but both top and bottom links are above my table. I tried the variable pair {freeform:all\_form\_fields} but this doesn't work

Anyone who nows a solution here? Thank you. Pixelman.

```
              <table>
                <thead>
                  <tr>
                    <th width="200">Name</th>
                    <th>Forum Account</th>
                    <th width="">Company</th>
                    <th width="">Job title</th>
                    <th width="">Country</th>
                    <th width="">Type</th>
                    <th width="">Show</th>
                    <!-- <th width="">confirmed</th> -->
                  </tr>
                </thead>
                <tbody>
{exp:freeform:entries form_name="regtest" sort="asc" orderby="last_name" limit="100" paginate="top" search:listings="not Don't share my details" search:confirmed="y"}
                  <tr>
                    <td>{freeform:field:first_name} {freeform:field:last_name}</td>
                    <td><a href="#" target="_blank">{freeform:field:mibusouser}</a></td>
                    <td>{freeform:field:company}</td>
                    <td>{freeform:field:jobtitle}</td>
                    <td>{freeform:field:country}</td>
                    <td>{freeform:field:registrartype}</td>
                    <td>{freeform:field:listings}</td>
                    <!-- <td>{freeform:field:confirmed}</td> -->
                  </tr>
                  {freeform:paginate}
                  <p>
                    Page {freeform:current_page} of {freeform:total_pages} pages   {freeform:pagination_links}
                  </p>
                  {/freeform:paginate}
{/exp:freeform:entries}
                </tbody>
              </table>

```

# Answer
> 0 votes
Pagination with `paginate="both"`, for example, will place the code you have between `{freeform:paginate} ... {/freeform:paginate}` right **above and below** your main `{exp:freeform:entries}` code. In your case, the `<p>...</p>` content would show right after your opening `<tbody>`, and right before your closing `</tbody>` tag. HTML tables do not correctly display data that isn't wrapped in or , because it's not the correct way to build an HTML table. A simple look at your HTML source code would reveal this.

You can handle this in different ways. If you want the pagination to be part of your table, starting with your code above you could use:

```
{freeform:paginate}
<tr>
   <td colspan="7">Page {freeform:current_page} of {freeform:total_pages} pages   {freeform:pagination_links}</td>
</tr>
{/freeform:paginate}

```

This will place a row above and below your table rows, but still inside your `<tbody> ... </tbody>` tags, so everything is semantically correct.

Alternatively, if you want your `<p>...</p>` to show up completely above and below the `<table>...</table>` code, you will need to put your opening and closing table code *inside* `{exp:freeform:entries}` tag pair.

You might ask:

> *But, wouldn't the opening and closing `<table>` tags loop more than once if they're inside `{exp:freeform:entries}`?*

You can make these display once using a conditional along with `{freeform:count}`:

```
{exp:freeform:entries /* your other parameters */}
    {if freeform:count == 1}
      <table>
         <thead>
             <tr>
               <th width="200">Name</th>
               <th>Forum Account</th>
               <th width="">Company</th>
               <th width="">Job title</th>
               <th width="">Country</th>
               <th width="">Type</th>
               <th width="">Show</th>
               <!-- <th width="">confirmed</th> -->
             </tr>
           </thead>
           <tbody>
    {/if}

    // ... the rest of your table ...

    {if freeform:count == freeform:total_results}
         </body>
      </table>
    {/if}

    {!--
         == Pagination ==
         This will be extracted from the tag pair and
         placed above and below the exp:freeform:entries tag
    --}
    {freeform:paginate}
       <p>
          Page {freeform:current_page} of {freeform:total_pages} pages   {freeform:pagination_links}
       </p>
    {/freeform:paginate}
{/exp:freeform:entries}

```

Same principle as when using other EE tags, such as `{exp:channel:entries}`.

---
Tags: solspace-freeform
---


title: Solspace Multi-mini-cal

text:
# Question
Title: Solspace Multi-mini-cal
Using Solspace Calendar, Is there any way to correctly display multiple calendars on one page? I am using the cal tag and the direct copy of solspace code gives me a single calendar on the page. When I use the following tag below I get very bizarre errors.

The current month is shown, and the following 6 months, with month names in place. The day numbers from next month onward are not listed, but are all dots, even though the right number of days are shown. The next month's days don't start on the correct day either.

Its like the tags are counting the correct months and number of days, just not rendering them in the correct grid and without the numbers in anything but this month.

Surely you can show more than one month on a page? Is this a bug? If not, does this mean I have to make 6 calls to this very expensive tag to get the 6 cals to show on a page? Is there an alternative?

```
<ul class="slider--programme">
   {exp:calendar:cal calendar_id="3" date_range_start="today" show_months="6"}
       {display_each_month}
       <li>
       <table>
          <thead>
             <tr>
                <th colspan="7"><h2>{date format="%F %Y"}</h2></th>
             </tr>
             <tr id="mc_days">
                {display_each_day_of_week}
                <th class="{if day_of_week_is_weekend}weekend{/if} {if day_of_week_is_current}current{/if}">{day_of_week_one}</th>
                {/display_each_day_of_week}
             </tr>
          </thead>
          <tbody>
             {display_each_week}
             <tr>
                {display_each_day}
                <td cellpadding="0" cellspacing="0" class="{if day_event_total > 0}has_events{/if}">
                    <div class="mc_date">
                   {if day_in_current_month}
                     {if day_event_total}<a href="/programme/day/{date format='%Y/%m/%d'}/">{/if}
                       {day}
                     {if day_event_total}</a>{/if}
                   {if:else}
                        <strong class="middot">·</strong>
                   {/if}
                   </div>
                  </td>
                {/display_each_day}
             </tr>
             {/display_each_week}
          </tbody>
       </table>
       </li>
       {/display_each_month}
   {/exp:calendar:cal}
  </ul>

```

# Answer
> 0 votes
The issue is with the calendar padding, which only pads the first month. Padding is the addition of extra days in a calendar row to make a complete, 7-day row, regardless whether the day is in the month or not. For example, the row at Aug 31 gets padded with September days from Sep 1st to Sep 6th to complete the calendar table.

After the first month is padded, each subsequent month doesn't get "re-padded" with days from the padded first month. That's when the calendar table layout breaks since there are missing days. Unfortunately this is an issue with Calendar, based on the way it makes its calculations for days.

The solution is to indeed repeat the `{exp:calendar:cal}` tag as many times as months you want to display.

---
Tags: solspace-calendar
---