# Question
Title: Basic conditional adding a full second to load time
I have the following code in my blog index template:

```
<section class="blog-listing">
    {if "{freebie_2}" == ""}
        {exp:channel:entries
            channel="blog"
            disable="categories custom_fields member_data pagination"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            parse="inward"
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
        }
            {article_snippet}
        {/exp:channel:entries}
    {/if}
    {if "{freebie_2}" == "column"}
        {exp:channel:entries
            channel="blog"
            category="{exp:freebie:category_id segment='3'}"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
            parse="inward"
        }
            {article_snippet}
        {/exp:channel:entries}
    {/if}
</section>

```

Currently this page is taking on average 2.97 seconds to load. I started removing pieces here and there to see if I could get to the bottom of what's slowing it down, and I just may have. It seems it may actually be the basic `{if}` statements!

If I remove the second one completely the page load time averages out to 1.58 seconds. I thought it might be Freebie, so I changed it to `{if "columns" == "column"}` and it took just as long.

Is this a known issue? What might be the root cause of this? I'm on *blazing fast* servers and this shouldn't be happening.

Suggestions?

# Answer
To a conditional to be considered a simple one, it needs to use snippets or early parsed variables. This isn't the case when you're using **freebie**. Unlike **Low Seg2cat**, that parses really earlier on parsing stages, Freebie parses together with all modules.

Can you remove freebie? If you can, try this:

```
<section class="blog-listing">
    {if segment_X == ""}
        {exp:channel:entries
            channel="blog"
            disable="categories|custom_fields|member_data|pagination"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            parse="inward"
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
        }
            {article_snippet}
        {/exp:channel:entries}
    {/if}
    {if segment_X == "column"}
        {exp:channel:entries
            channel="blog"
            category="{exp:freebie:category_id segment='3'}"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
            parse="inward"
        }
            {article_snippet}
        {/exp:channel:entries}
    {/if}
    {if segment_X != "column" AND segment_X != ""}
        {redirect="404"}
    {/if}
</section>

```

The unnecessary `exp:channel:entries` will be removed before parsing.

I thought about to put the conditionals inside the `exp:channel:entries` opening tag, but this will allow its parsing in case of `segment_X != 'column' AND segment_X != ""` and the first step to get better performance is to prevent unnecessary parsing. I added a `return="404"` just to emphasize this case and remind you that it's possible for you to have an empty `<section>`.

If you can't remove freebie, switchee is your alternative:

```
<section class="blog-listing">
{exp:switchee variable = "{freebie_2}" parse="inward"}
    {case value=""}
        {exp:channel:entries
            channel="blog"
            disable="categories|custom_fields|member_data|pagination"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            parse="inward"
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
        }
            {article_snippet}
        {/exp:channel:entries}
    {/case}

    {case value="column"}
        {exp:channel:entries
            channel="blog"
            category="{exp:freebie:category_id segment='3'}"
            dynamic="no"
            limit='{exp:low_variables:parse var="articles_per_page"}'
            status='{exp:stash:get
                name="preview_status"
                file="yes"
                parse_tags="yes"
                parse_conditionals="yes"
            }'
            parse="inward"
        }
            {article_snippet}
        {/exp:channel:entries}
    {/case}
    {case default="yes"}
                {redirect="404"}
    {/case}
{/exp:switchee}
</section>

```

Please, let me to know if any of the suggestions doesn't work.
> 5 votes

# Answer
Templates are parsed in a certain order of functionality - not a top down approach.

In your instance the two exp:channel:entries tags are being parsed first (so double the performance hit), then EE looks at the conditionals and removes the output of the irrelevant part of the conditional.

So **either** you have to place a single channel entries in an embed - embeds don't get included and parsed until after conditionals (so no double call overhead)...

***blog/index template:***

```
<section class="blog-listing">
{if "{freebie_2}" == ""}
    {embed=blog/listing
        category=""
        limit='{exp:low_variables:parse var="articles_per_page"}'
        status='{exp:stash:get
            name="preview_status"
            file="yes"
            parse_tags="yes"
            parse_conditionals="yes"
        }'
    }
{if:elseif "{freebie_2}" == "column"}
    {embed=blog/listing
        category="{exp:freebie:category_id segment='3'}"
        limit='{exp:low_variables:parse var="articles_per_page"}'
        status='{exp:stash:get
            name="preview_status"
            file="yes"
            parse_tags="yes"
            parse_conditionals="yes"
        }'
    }
{/if}
</section>

```

***blog/listing template:***

```
{exp:channel:entries
        channel="blog"
        category="{embed:category}"
        disable="categories|custom_fields|member_data|pagination"
        dynamic="no"
        limit="{embed:limit}"
        parse="inward"
        status="{embed:status}"
    }
    {article_snippet}
{/exp:channel:entries}

```

...Or try merging both channel entries into a single call using simply conditionals...

```
<section class="blog-listing">
    {exp:channel:entries
        channel="blog"
        category="{if segment_2 == "column"}{exp:freebie:category_id segment='3'}{/if}"
        disable="categories|custom_fields|member_data|pagination"
        dynamic="no"
        limit='{exp:low_variables:parse var="articles_per_page"}'
        parse="inward"
        status='{exp:stash:get
            name="preview_status"
            file="yes"
            parse_tags="yes"
            parse_conditionals="yes"
        }'
    }
        {article_snippet}
    {/exp:channel:entries}
</section>

```

Your disable tag is incorrect btw:

```
disable="categories custom_fields member_data pagination"

```

should be

```
disable="categories|custom_fields|member_data|pagination"

```

ref
> 1 votes

---
Tags: conditionals, speed
---


title: Solspace Calendar Pagination

text:
# Question
Title: Solspace Calendar Pagination
I have a list of Solspace Calendar events that I would like to paginate. According to the documentation, the pagination parameter and variable pair should work the same as channel:entries. I am able to limit the events to 10 with the limit="" parameter, but the {paginate} variable pair does not display the pagination links.

```
{exp:calendar:events calendar_name="Events" limit="10" date_range_start="" orderby="event_start_date" sort="ascending"}
            <div>
                <h4><a href="{page_url}">{title}</a></h4>
                <h5>{event_start_date format="%j %F %Y :: %g:%i%a"}–{event_end_date format="%g:%i%a"}
                <p>{event_location}</p>
                </h5>
            </div>
            <hr />
            {paginate}Page {current_page} of {total_pages} pages   {pagination_links}{/paginate}
{/exp:calendar:events}

```

# Answer
Instead of `limit="10"`, try using `event_limit="10"`. From the {exp:calendar:events} documentation:

http://www.solspace.com/docs/calendar/events/#event\_limit
> 3 votes

# Answer
You are missing the paginate parameter on your opening `calendar:events` tag. Try adding `paginate="bottom"` and see if that fixes your issue.
> 2 votes

---
Tags: pagination, solspace, calendar, solspace-calendar, events
---


# Question
Title: Addon to "package" data like Channels, Addons, etc across sites
I have 2 installations of one site.

I have channels and addons that exist in one site but not in the other.

Is there an easy way or an addon that enables me to basically "export" the data from one of the sites to the other?

# Answer
> 0 votes
I haven't personally used this, but saw someone demoing it and it may be exactly what you are looking for: https://github.com/ckimrie/Site-Manager

---
Tags: import, export
---


title: Integrating my code with EE?

text:
# Question
Title: Integrating my code with EE?
I have two select boxes and a submit button.On click of this submit button,I redirect the user to a page which is populated by data feeded from an admin panel.

Yes,I have created an admin panel which populates these select boxes and also has some data related to every single selectboxes(images,reviews etc) which will be displayed on click of submit on the redirected page.Hope I am clear.

I have done this thing with conventional way of using php,javascript.But I am trying exp engine for the first time just for learning.

I have created the admin panel and feeded quite a lot of data.

**MyQuestion**:Its the integration that I have no clue about.

**1**.I want to assign all the value belonging to a certain column in my table to the select boxes.

**2**.On click of submit button,want to populate a page with data related to both select boxes.

I dont have any clue about how to integrate my code with a template that I have using Expression Engine.

Hope I am not Misunderstood.

Please correct the tagging.I am new to this stack exchange network.

# Answer
> 3 votes
Create a category group in EE called "Cars" (assumes cat group ID of 2 in code below). In there you create categories with the **Make**. You then create child categories of each Make with the relevant **Model**. You can then create children of the models if there are **variants** of the model.

Channel Categories

Main landing page template has this code:

```
{!-- MAKE --}
<select id="make">
{exp:channel:categories
    style="linear"
    category_group="2"
    parent_only="yes"}
    <option value="{category_id}">{category_name}</option>
{/exp:channel:categories}
</select>

{!-- MODEL --}
<select id="model">
    {!-- TO BE POPULATED VIA AJAX --}
</select>

{!-- VARIANT --}
<select id="variant">
    {!-- TO BE POPULATED VIA AJAX --}
</select>

```

Separate template in "car" template group, called "model-list" template, called via Ajax on the following URL: */car/model-list/#* The number is the category ID selected from the #make select above.

/car/model-list template:

```
{exp:channel:categories
    style="linear"
    category_group="2"
    show_empty="no"
    show="{segment_3}"
    parent_only="yes"}
    <option value="{category_id}">{category_name}</option>
{/exp:channel:categories}

```

Pulled via Ajax then inserted into the relevant part of the main template/page.

Then once the model is selected, the same process to get any variants but calling this URL: */car/variant-list/#* (again the number indicates the category ID ...

/car/variant-list template:

```
{exp:channel:categories
    style="linear"
    category_group="2"
    show_empty="no"
    show="{segment_3}"}
    <option value="{category_id}">{category_name}</option>
{/exp:channel:categories}

```

Once you have all the category IDs from either 2 or 3 of the selects, you can then combine them to form the category parameter in a channel:entries tag, either via JS to combine and submit or append as URL segments, or leave as separate form fields submitted to the next page and use a third-party add-on (Mo' Variables is a great one) to get the POST values.

Car Details template (car/details)

```
{exp:channel:entries
   dynamic="no"
   category="{post:make}&{post:model}{if {post:variant}}&{post:variant}{/if}"}
   {title}
   ...
{/exp:channel:entries}

```

The car entry would need to have the relevant categories selected obviously! One negative would be that the car details doesn't have a unique URL, but that could be solved by calling a lookup Ajax call after the variant is selected (or if variant options don't exist) that calls something similar to the last code above that outputs {url\_title} - this is then used on a URL for the Submit button (/car/details/{url\_title}) and therefore giving you a unique URL for each car.

Another alternative would be to output the entire category tree as a JS variable (from the EE template) and then parse it in JS to populate the relevant select boxes, this avoiding the Ajax calls.

You might also be able to approach it using relationships but I've not explored that option!

---
Tags: ee2, templates, php, channel
---


# Question
Title: Cart Throb: The totals of the cart item amounts do not match order amounts. 10413- when shipping is included
I thought I had this error fixed ages ago but found out I did not.
EE 2.5.2 CT 2.2.2

When checking out with paypal express I get the error

The totals of the cart item amounts do not match order amounts. 10413

This error ONLY occurs when I have a shipping charge. Currently shipping is defined per product. **If Shipping is not required I do not get this error.**

SOLVED an EE and CT upgrade seemed to fix this issue

# Answer
> 1 votes
an EE and CT upgrade seemed to fix this issue

---
Tags: cartthrob, shipping
---


# Question
Title: Default recipient.email when no checkboxes are selected
I am selecting recipients based on checkbox selections. This works great except when no checkboxes are selected at all. How can I check if no selection has been made, and give recipient.email\[\] a default value if nothing is selected? Thanks.

# Answer
You could add a hidden field with the same name before the checkboxes to add the default value.

```
<input type="hidden" class="hidden_recipient" name="recipient_email[]" value="{freeform:recipient_value1}">

<input type="checkbox" class="check_recipient" value="{freeform:recipient_value2}" name="recipient_email[]"/> John Smith
<input type="checkbox" class="check_recipient" value="{freeform:recipient_value3}" name="recipient_email[]"/> Mary Smith
<input type="checkbox" class="check_recipient" value="{freeform:recipient_value4}" name="recipient_email[]"/> Jane Doe

```

Then you could use a little jQuery to clear the value of the hidden field when one of the checkboxes is checked.

```
$("input[type=checkbox]").on( "click", function(){
    var count = $("input.check_recipient:checked").length;

    if(count > 0)
    {
        $('.hidden_recipient').val('');
        // You'll need to store the value somewhere in the meantime in case they uncheck again
    }
    else
    {
        // You'll need to restore the original value here
    }
});

```
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: "Is Default" EE 2.7+ and Grid compatible field - Alternatives to MX Lone Star
I was looking for some fieldtype that is supported by Grid to act as a "is\_default" flag in my Grid rows. This field would only allow 1 row checked.

Looking at this page, I thought that MX Lone Star would do the job. But after trying it out and doing some investigative work, it is only compatible as a fieldtype in 2.7+ but *not as a fieldtype that is supported by Grid*.

Are there any alternatives out there?

# Answer
There isn't a Celltype for Grid that does this yet as far as I know. But you can easily make this happen using a bit of jQuery. You can add the jQuery directly into the custom field's instructions or use CP CSS & JS.

This will ensure that only one checkbox remains checked across a particular column in your Grid field (tested with EE 2.7.1):

```
<script type="text/javascript">
    $(function() {
        var checkboxes = $('#field_id_28 td[data-column-id=2] input');
        $('#field_id_28 td[data-column-id=2] input').change(function(event) {
            checkboxes.prop('checked', false);
            $(this).prop('checked', true);
        });
    });
</script>

```

Just be sure to set `field_id-x` and `data-column-id-x` in the selector to match your field and column.

**Important note:** If you are entering this jQuery snippet in a custom field's Field Instructions make sure it does not use space characters for the indentation. If you copy and paste directly from here it will and they will be encoded to ` ` which will cause a JavaScript error.
> 2 votes

---
Tags: 2.7.0, grid, mx-lone-star, 2.7.1
---


# Question
Title: Only the first upload directory shows in assets when used with wygwam
When using the main assets window, all of the available upload directories are available to choose from in the left hand navigation. (See Screenshot 1)

When using the popup generated by wygwam when adding a link or inserting an image only the first upload directory defined is available (See screenshot 2)

Is it possible to list all upload directories in the wygwam popup?

Thanks,

Colin

# Answer
Go to Add-Ons \> Modules \> Wygwam \> \[your config name\], and set the “Upload Directory” setting to blank, and Wygwam will start showing all of your upload directories.
> 2 votes

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


title: Freeform Pro v4.0.12 Filtering Issues

text:
# Question
Title: Freeform Pro v4.0.12 Filtering Issues
Using EE v2.6.1 MSM Freeform Pro v4.0.12

When login EE CP using Chrome or Firefox – Under FreeForm Pro Entries listing, when filter using the search keywords or filter selection it kick you out of EE and required to login again.

Is this an error on FreeForm Pro or is this new version functionality? Please advise, thank you.

# Answer
> 1 votes
This was a bug that was fixed in Freeform 4.1.0: http://www.solspace.com/docs/freeform/change\_log/#v4.1.0

---
Tags: solspace-freeform
---


# Question
Title: Freeform Pro 4.0.12 IE8 and IE9 comparability issues
Using EE v2.6.1 MSM Freeform Pro v4.0.12

When login EE CP using IE8 or IE9, I'm getting compatibility issue, form listing and entries listing does not show like in Firefox or Chrome. Also when tried to filter entries by search or by filter selections, it does not filter at all.

Is this an error on FreeForm Pro or FreeForm Pro does not work on IE browsers? Please advise and thank you.

# Answer
IE8 cannot support CSS3 styles, so it gets a plain look because its not a good browser. IE9+ supports the advanced visual styles so it should look the same as Chrome and Firefox there.

I was able to reproduce the entry filtering bug you mentioned in ie8.

IE's JavaScript interpreter fails on some keywords. In this instance 'export'. On line 600 of ./system/expressionengine/third\_party/freeform/views/entries.html, change:

```
'title'     : langItems.export,

```

to:

```
'title'     : langItems['export'],

```

Making this change fixed the errors for me in IE.

This will be fixed in the next release of Freeform, 4.1.3.
> 1 votes

---
Tags: solspace-freeform
---


title: Members on EE Core

text:
# Question
Title: Members on EE Core
Has anyone tried to implement basic membership system within the Core version of Expressionengine. Basicly, I need login / logout functions to be executed within the frontend.

As I understand Solspace User provides such functionality for EE Core users, but, is it possible to implement such features without paying for EE license / buying expensive addons (such as Solspace Member).

Thanks!

# Answer
There aren't any add-ons that I know of that would add front-end member functionality to the Core version of ExpressionEngine. Solspace User, as well as Zoo Visitor and Profile:Edit all build on top of EE's existing member module, and therefore don't work on EE Core.

I do have to ask though, what kind of project are you working on where EE's price tag makes it too expensive? With the amount of work EE saves in building custom functionality, I've never come across a project where the price of EE would eclipse that of adding on to something free.
> 3 votes

# Answer
I'm working on a small website with EE-core for a non-profit theater-group and also needed some basic member login / logout functionality to allow members to login and see members-only templates and members-only `{if logged_in}` content. Members can be added and edited via the control panel by an admin.

You can try-out a mashup i made of an older version of the freemember plugin, for use in EE-core.
(yes it's beta) via this Gist:

**Core\_member**
https://gist.github.com/GDmac/6829953
> 2 votes

# Answer
As was mentioned in a previously deleted question, all of the free member management solutions (and indeed, all of the commercial ones too) build on top of EE's integrated member management functions. Therefore it's not possible to add member management to EE core, without a *lot* of work re-implementing all this functionality.

That said, you'd be crazy not to spend the $299 and save yourself a lot of work. Plus you're supporting EllisLab and the continued development and support of ExpressionEngine :)
> 1 votes

---
Tags: members, core
---


title: Solspace Calendar and SEO Lite

text:
# Question
Title: Solspace Calendar and SEO Lite
I'm using both Solspace Calendar and SEO Lite. Was wondering how to get the {event\_title} from Calendar to display in the browser title when the event detail page is viewed.

Any recommendations? Thanks very much in advance.

# Answer
> 4 votes
The short answer is to just pass in either the `entry_id` or the `url_title` for this calendar entry, either of which should be easy enough to do on a detail page.

To know which would be best in your case I'd need to see key parts of your template(s), but here are a couple examples.

**Option 1:** Use the `entry_id` for your event from the URL:

```
{exp:seo_lite entry_id="{segment_n}"}

```

**Option 2:** Use the `url_title` for your event that is in the URL:

```
{exp:seo_lite url_title="{segment_n}"}

```

*Where `n` is the number of the segment that contains the entry id or url title.*

---

**OR Option 3:** If you're Seo Lite tag is already *within* your `calendar:events` tag, just pass the `entry_id` variable right in:

```
{exp:seo_lite entry_id="{entry_id}"}

```

If you need more help, just update your question to include the relevant template code.

---
Tags: solspace, calendar, seo
---


title: Create a plugin or Field type

text:
# Question
Title: Create a plugin or Field type
I am new to EE and working my way around the CMS. I have worked with WP and Joomla.

The task I have is to build an admin functionality where the admin can select either a URL or upload a file and this will show up as a list of links (either redirect to that URL or download the uploaded file)

Is creating a custom field type the way to go about this? Please let me if there is a sample code for this that I can follow the programming guidelines.

Thanks,

# Answer
> 3 votes
As folks mention above, no custom development is needed here. Just use the native Grid fieldtype with two columns - one using the File fieldtype (called, say, `file`), and the other using the Text fieldtype (called, say, `url`).

Then, in your template:

```
{my_grid_field}
    {if my_grid_field:file}<a href="{my_grid_field:file}">Download this file</a>{/if}
    {if my_grid_field:url}<a href="{my_grid_field:url}">Visit this link</a>{/if}
{/my_grid_field}

```

---
Tags: custom-fields, fieldtype
---


# Question
Title: How to pass category_id in the URL and make pagination work?
In an efford to restrict page results to categories (that I pass in the URL from a link on another page) I came up with the following URL structure.

```
    my_site.com/index.php/template_group/category/category_url/

```

This tag code on the index page of this template\_group:

```
    {exp:channel:entries channel="my_channel" limit="5" dynamic="off" category="{segment_2}" pagination="bottom" paginate_base="template_group/{segment_2}/{segment_3}/"}

```

*This works, but the pagination fails.*

I do get the correct pagination numbers at the end of my URL, but the tag does not listen anymore to the URL.

I tried very hard to get around this, but failed.

I do hope someone can shine a light here. Many thanks.

# Answer
I think you're doing more work than you need to here. Are you familiar with the Use Category URL Titles In Links? and Category URL Indicator preferences?

These preferences will let you do exactly what you want, but dynamically (so, no need for `dynamic="off" category="{segment_2}"`).
> 1 votes

---
Tags: categories, pagination
---


# Question
Title: Where's the documentation for using Relationships with Grid fields?
I'm trying to do something like:

> {grid\_fields}
>
> {grid\_fields:relationship}{title}{/grid\_fields:relationship}
>
> {/grid\_fields}

But I don't seem to be able to pull data out of the related entry. Any ideas?

# Answer
I'm using EE v2.7.0 and the syntax actually appears to be:

```
{grid_fields}
     {grid_fields:relationship}{grid_fields:relationship:title}{/grid_fields:relationship}
{/grid_fields}

```
> 17 votes

# Answer
Did you try...

```
{grid_fields}
     {grid_fields:relationship}{relationship:title}{/grid_fields:relationship}
{/grid_fields}

```

As of 2.6 the relationship field should be prepended with the relationship field name so that advanced relationships can work together with each other. http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#child-entries-displaying-the-stores-and-their-menus
> 1 votes

---
Tags: relationships, grid
---


title: how i can change root url?

text:
# Question
Title: how i can change root url?
i am using "example.com" URL for magento and "example.com/info/blog" URL for expression engine blog access now client want to access expression engine blog in root URL "example.com/blog" is it possible with coding ?

i want to remove "info" from URL i installed expression engine in "info" folder but i want to access expression engine from magento URL "example.com" not from "example.com/info/"

please guide me thank you.

# Answer
you can try out the "include list method" from the old wiki page. Instead of RewriteRule to index.php, use a RewriteRule to info/index.php/$1

*update: tested on my localhost*

```
RewriteEngine On

# Removes index.php from ExpressionEngine URLs
RewriteCond $1 ^(blog|home|TemplateGroup|P[0-9]{2,8}) [NC]
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ info/index.php?/$1 [L]

```

i would try-out several things on a local dev machine first. You have to test for site-index and site-url etc. so that {path=} variables still work, or otherwise you have set a custom global variable for {site\_root} or something to use for urls in the blog. EE does have to know it's path to the main index.php for various actions (e.g. info/index.php?ACT=xx)

http://web.archive.org/web/20120831062016/http://expressionengine.com/wiki/Remove\_index.php\_From\_URLs
> 1 votes

# Answer
Yes, this is possible with ExpressionEngine. It's right in the manual - how to remove index.php (which I assume is info, on your system) from URLs. These directions are for version 2.7.1, your version may be older, but ellislab does have older versions of the help documentation available (2.4.4, 2.5.5, 2.6.1, 2.7.1)

If this answer won't help you, please edit your question to let us know what version of EE you're using, and what OS and server software is on your server.
> 0 votes

---
Tags: ee2, url
---


title: Expresso Store: Realex Payments

text:
# Question
Title: Expresso Store: Realex Payments
i am very interested in new 2.0 version and see as with 1.0 there is no option for Realex Payments (irish payments handler) support. i know this is a niche market but is the only thing stopping me using this ecommerce in our projects.

Is there any plans to expand the payment providers ?

http://www.realexpayments.com/developers

# Answer
> 2 votes
If this is in reference to Store v2 then the good news is that support for the Realex payment gateway is intended to be rolled out in the next month or two. Keep an eye on the release notes for confirmation of when it's been added to the available gateways.

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


# Question
Title: In Cartthrob, how could one stop a discount being applied with any other coupon?
We created a custom Cartthrob plugin which applies a 10% discount to items in the cart if purchased before a certain date, which works fine.

But we also have a coupon code to give 10% off.

Coupons and discounts are "not to be used with with any other offer". It means if someone enters the coupon code, the our custom discount should not be applied.

I can't find any help on this and wondered if anyone has a suggestion/solution?

Thanks

# Answer
Have possibly found a solution, by retrieving the cart data direct from the database, decrypting and unserialising it I can obtain the cart data and see coupon codes applied, so am able to check against this.

```
private function _getCart($cart_id)
{
    $this->EE->load->library('encrypt');

    $query = ee()->db->select('cart')
        ->from('exp_cartthrob_cart ctc')
        ->where('ctc.id = "'.$cart_id.'"')
        ->get();

    if ($query->num_rows() > 0)
    {
        $fields[] = '';
        foreach ($query->result_array() as $row)
        {
            $cart = unserialize($this->EE->encrypt->decode($row['cart']));
        }
    }

    return $cart;
}

```
> 3 votes

---
Tags: cartthrob
---


# Question
Title: Wygwam fields (in Matrix) not initialized when switching fields with Entry Type
I'm using Entry Type to hide/show fields. If the field is a Matrix with Wygwam columns, the Wygwam fields don't initialize when the Matrix field is revealed by Entry Type. However, if I reload the Edit page, Wygwam intializes and all is well. Will be irritating to client to have to reload page for Wygwam's buttons.

# Answer
> 1 votes
You should try the "Defer CKEditor initialization?" feature in the Wygwam celltype settings. This will prevent Wygwam from initializing until the client clicks on the field.

---
Tags: matrix, wygwam
---


title: Changing email submission notification

text:
# Question
Title: Changing email submission notification
Not sure where to look to make changes to the layout(css) of the email notification submission portion. I have been searching for the View or the module that modifies this. Has anyone made changes to this?

# Answer
The only method I see that works is to go to Design, User Messages, and edit everything from there.
> 1 votes

# Answer
Profile:Edit sounds like it would take care of what you need as well as it allows you to serve up your own templates versus editing Design \> User Messages.
> 0 votes

---
Tags: ee2, email
---


title: Custom module URL structure

text:
# Question
Title: Custom module URL structure
Good evening folks,

I recently enquired what the best way to build a UGC site using ExpressionEngine would be. I decided to go down the route of a custom module and that side of things is now working: a table is being created, users are able to add jobs from a form on the front end and there are tags available for me to use in my templates to 'list' and 'single' jobs.

However, I still can't get my head around the EE URL structure.

The site has a number of top-level sections which each of the listing types fall under. The example I gave in the previous post was 'jobs' but this actually falls under the 'opportunities' section. Therefore, the URL structure I'm trying to achieve is:

```
/opportunities/jobs/                           jobs listing page
/opportunities/jobs/*id*-*job-title*/          job single page
/opportunities/jobs/add/                       add job page
/opportunities/jobs/edit/*id*-*job-title*/     edit job page
/opportunities/jobs/delete/*id*-*job-title*/   delete job page
/opportunities/jobs/success/                   success page for add/edit/delete job
/opportunities/jobs/filter/today/              jobs posted today
/opportunities/jobs/filter/this-week/          jobs posted in last 7 days
/opportunities/jobs/filter/2013/oct/           jobs posted in october 2013
...                                            (previous 12 months)
/opportunities/jobs/filter/2012/nov/           jobs posted in november 2012
/opportunities/jobs/filter/archive/            (including those with a status of 'closed')

```

I'm baffled as to whether this URL mapping is something that I would build into my module (in which case, could someone please point me in the direction of documentation as I can't find anything about it anywhere...) or whether I'd just create an 'opportunities' template group and the use the 'index' template as a controller to embed the correct sub-template (based on {if} statements checking the value of the third segment).

Or, is this a job for Router, or even some good old .htaccess rules?

Many thanks, as always, for any advice.

**Edit:** I've found the pages module, which allows me to add a page with the URL /opportunities/jobs but then /opportunities/jobs/add returns a 404. I doubt this is the correct route as it re-introduces the problems I originally faced when using Structure...

# Answer
This is definitely something that will be difficult without some add-ons. As your edit suggests, the Pages Module is great for getting custom URLs, but breaks down as soon as you try to add dynamic segments to the URLs. It works very similarly to Structure, so that's not going to be your solution here.

I think your best bet would be to check out Rob Sanchez' Template Routes add-on. I personally have never used it, but it seems like it should help you customize your URL structure to match the scheme you're looking for.
> 0 votes

---
Tags: templates, url, routing
---


title: EE Matrix Ajax Pagination

text:
# Question
Title: EE Matrix Ajax Pagination
hey i'm running through a serious problem , i found a lot of answers about this topic nothing really helped, theres no direct obvious answer

> heres a PHP page that i want to do with EE matrix+jQuery instead of PHP+mySQL+jQuery: http://egyptianartsgroup.com/videos.php look at "Featured Videos" section

and this is my code for just looping the matrix , outputting the featured items for isotope blocking

```
<div id="container" class="photos clearfix variable-sizes">
   {exp:channel:entries channel="featured" url_title="main-featured" limit="1"}
   {featured_items search:active="Yes" sort="asc" limit="5"}
   {if type == "Video"}
      <div class="photo video">
         {thumb_image}
        <img src="{path}_thumbnails/{filename}.{extension}" />
        {/thumb_image}
        <a href="{vlink}" class="featuredVideoIcon" t = "video" title="{overlayed_title}"></a>
        <a href="{vlink}" class="FeaturedTitleLink" t = "video" title="{overlayed_title}"><h2 class="FeaturedTitle">{overlayed_title} </h2></a>
        </div>
   {if:else}
   <div class="photo image">
            {thumb_image}
            <img src="{path}_thumbnails/{filename}.{extension}" />
            {/thumb_image}
            <a  class="featuredEnlargIcon" href= "{thumb_image}" title="{overlayed_title}" t = "image"></a>
            <a  class="FeaturedTitleLink" href= "{thumb_image}" t = "image" title="{overlayed_title}"><h2 class="FeaturedTitle">{overlayed_title} -- {row_count} of / {total_rows}</h2></a>
            </div>
   {/if}

   {/featured_items}

   {/exp:channel:entries}
</div>

```

any ideas to ajax paginate the matrix entries for isotope ?

# Answer
You should be able to create pagination using a combination of the `{matrix_field_name:total_rows}` variable, the `limit=xx` and `offset=xx` parameters to the Matrix tag pair and a math plugin such as MX Calculator.

An example of this method was posted on EE Insider some time back.
> 1 votes

---
Tags: matrix, pagination, ajax
---


# Question
Title: Nested categories without ul or other formatting
We have a 3 level category structure set up for a site. I would like to output these categories as JSON, while keeping the structure intact. As far as I can see, EE's native categories only allow outputting category hierarchy as ul or ol. I also tried Child categories & GWcode categories plugins, but at maximum I was able to output the two top levels only. Anybody have any idea how to get this working?

# Answer
Okay, I'll add this as a reference here, though I would avoid using it in a real life situation unless you are sure of what you are doing.

In stead of the many alternative ways to approach this, like using stash, embeds, a query or writing a plugin, I decided to tinker a little bit more with GWcode categories as it got me originally pretty close and seemed to have quite a few useful variables available.

While the solution could probably be easily modified to any arbitrary category structure depths, I highly recommend you do not use this solution in production. It is a messy hack (EE & JSON tend to get messy, but not this messy) and especially the last if-else structure feels a bit off, though it seemed to do what I needed it to:

```
 [{"categories":[
    {exp:gwcode_categories group_id="1" style="linear"}
        {if depth1_start || depth2_start || depth3_start}
        {if:else}
        ,
        {/if}

        {
            "id": {cat_id},
            "depth":{depth}

        {if has_children}
            , "childcategories":[
        {if:else}
            }
        {/if}
        {if group_end}
            ]}
        {if:else}
            {if depth1_end && depth2_end && depth3_end}
                    ]}]},
            {if:elseif depth1_end && depth2_end}
                        ]},
            {if:elseif depth3_end}
                ]},
            {/if}
        {/if}
    {/exp:gwcode_categories}
]},{"performance": "{elapsed_time} seconds / {total_queries} queries"}]

```

An example of the JSON output can be found here: http://jsonlint.com/?json=https://dl.dropboxusercontent.com/u/381221/jsoncategories.txt
> 0 votes

---
Tags: gwcode-categories, categories, nesting, child-categories
---


# Question
Title: Saving Multiple Relationships via checkboxes in a Channel Form
I have relationships field `Foo` where people can have more than one entry, basically a multiple relationships field.

I am not using `{field:foo}` to output my form field. Instead I am using multiple checkboxes to save the multiple relationships.

What is the proper way to do this?

Is there a native way to do this or do I have to resort to implementing a function in extensions to work them out?

# Answer
To output the information this worked for me:

```
<p class="grid-row"><em>Fav Style:</em><span>{options:member_favourite_drinks}{if selected}{option_name},{/if}{/options:member_favourite_drinks}</span></p>

```

... and to have this in a select list:

```
{custom_fields}
     {if field_name=="member_favourite_drinks"}
            <select id="{field_name}" name="{field_name}[data][]" multiple="multiple">
                  <option value="">Select...</option>
                  {options}
                      <option value="{option_value}"{selected}>{option_name}</option>
                  {/options}
             </select>
     {/if}
{/custom_fields}

```

... checkboxes will need an embed inside the form:

```
{embed="_embeds/.drinks-list"}

```

contents would be:

```
{exp:channel:entries channel="drinks" order="title" sort="asc" dynamic="no"}
    <div class="form-item form-item-checkbox form-item-small">
            <label for="member_favourite_drinks_{count}">
                    <input type="checkbox" name="member_favourite_drinks[data][]" value="{entry_id}" id="member_favourite_drinks_{count}">
        <span>{title}</span>
    </label>
</div>{/exp:channel:entries}

```
> 3 votes

---
Tags: safecracker, relationships, channel-form
---


# Question
Title: Channel Images and Matrix / Increment a variable/count within a matrix field?
Is there a possibility to increment a variable/count (something like "i++") within a matrix field so that the variable is incremented for each row with certain parameters?

The background is that I created a Matrix field to allow the user to reorder html elements. We use Channel Images to upload

I'm trying to achieve this in my template:

```
{my_matrix}

 {if cell_type == "image"}
 <!-- insert image1.jpg, image2.jpg, image"i++".jpg -->
   {exp:channel_images:images_static entry_id="{entry_id}"}
     <img src="{image:{i++}:url}">
   {/exp:channel_images:images_static"}
 {/if}

 {if cell_type == "text"}
   {text_from_matrix_cell}
 {/if}

{/my_matrix}

```

The html code is supposed to be looking like this:

```
<img src="image1.jpg">
<p>Text block 1…</p>
<img src="image2.jpg">
<p>Text block 2…</p>
<p>Text block 3…</p>
<img src="image3.jpg">

```

I tried it with a switch:

```
{my_matrix}

 {if cell_type == "image"}
   {exp:channel_images:images_static entry_id="{entry_id}"}
     <img src="{image:{switch'1|2|3|4|5'}:url}">
   {/exp:channel_images:images_static"}
 {/if}

 …

{/my_matrix}

```

The switch statement is working between matrix rows. However, it's alternating between matrix rows *whether the surrounding "if"-statement applies or not*. So instead of the desired result posted above, my actual html looks like this:

```
<img src="image1.jpg">
<p>Text block 1…</p>
<img src="image3.jpg">
<p>Text block 2…</p>
<p>Text block 3…</p>
<img src="image6.jpg">

```

I couldn't think of a way to solve this with php either. Any ideas? Thanks!

# Answer
> 1 votes
How about something like this?

```
{matrix}
  {exp:channel_images:images_static entry_id="{entry_id}"}
    {image:{element_count}}
  {/exp:channel_images:images_static}
{/matrix}

```

({element\_count} is the matrix field where you can choose the #-th image).

---
Tags: ee2, matrix, variable, channel-images
---


# Question
Title: GW Code Categories || Nested || 2 Category Groups
I'm having a bit of trouble getting my head around this issue and I'm probably over thinking it as well as just have spent too much time "in" it :) So i'm hoping someone can straighten this out for me.

I have a Business channel with 2 Category Groups: State/City (category id = 9) and Businesses (category id = 11).

State/City should be self-explanatory as those have a State for the Parent and City for Children.

Businesses has this setup (some Categories have children some don't):

So some entries are in Colorado and Denver BUT also in Bars \> Dive

I need to start on the State level, then to the City, then to the Category then a Sub-category if there is one. IF not then I just want to show the listings in those categories.

I've been working on this for a while and haven't had any luck with it. I always seem to get "close" then at the end I don't have the listings showing by City/State AND the Business type that it is.

Without writing a ton of `{if segment_5 !='' AND segment_6 ==''} etc...` I'm not sure how to drill down to the listings.

So I'm hoping there are people out there that can help me "un-complicate" this as this SHOULD work but I'm probably missing something.

Thanks for the help comrades!

# Answer
> 1 votes
I'm not clear on what you want your output to be, but check out the functionality of Low Seg2Cat and/or Category Sorted Entries to see if either can be helpful...

---
Tags: categories, gwcode-categories
---


# Question
Title: With EE 2.7 can you use a channel form on the front end to create new categories?
With EE 2.7 can you use a channel form on the front end to create new categories? Can't quite figure this out.

# Answer
You cannot add categories though the channel form, unfortunately. You've got a couple options:

1) It'd be a bit involved, but it's not altogether impossible to write a module that allows categories to be added from the front-end. Just take note of the various tables for categories and what needs to be filled out when added. If you're not familiar with add-on development already, though, this may be a bit challenging.

2) Switch to a tagging addon, such as the free Tagger from DevDemon. Tagger provides an interface that works with the channel form on the front-end. While tagging isn't exactly the same functionality as categories, in many cases it's pretty seamless to switch over.
> 1 votes

---
Tags: ee2, channel-form
---


# Question
Title: Canceling form submission within channel_form_entry_form_tagdata_start hook handler in 2.7+
I am using this hook `channel_form_entry_form_tagdata_start` to process some data before it is saved to database.

But there are many cases where I want to cancel. Validation errors, missing field, etc.

What is the correct way to this inside a hook event handler?

Am I even using the correct hook?

P.S.

I used this technique before. Is this still the correct way to do it?

# Answer
You can use the previous technique having same method call but the hook will be different `channel_form_submit_entry_start` instead of `safecracker_submit_entry_start`

**Please note**: if you are updating the hook name within the extension, it would be easy and good to uninstall it first and then update the hook name. Again install it.

I hope, everything would work fine for you.
> 1 votes

---
Tags: channel-form
---


# Question
Title: How do I add an XID hash to an old addon?
I'm using an older EE2 addon that doesn't appear to have support for secure forms. Does anyone know how to add the hidden XID hash field to the form via the addon code?

I guess I'm really looking to see if there's a code snippet that would just create the hash itself that I can add within the addon file.

**UPDATE:** After looking more closely at the addon code, it's using the form helper so what I need is something like:

```
form_hidden('XID', 'xid outputted value')

```

which would generate the following:

```
<input type="hidden" name="XID" value="the xid hash">

```

Cheers

Jim

# Answer
EE Docs. Also details Ajax handling of XID.

As Bhashkar stated:

```
$this->EE->functions->form_declaration($data);

```

Or the new method:

```
ee()->functions->form_declaration($data);

```

> "so the XID (secure hash ID) is added automatically as a hidden input field."

As part fo the $data array sent you can force secure by adding it:

```
$data['secure'] = TRUE;

```

Example of complete code:

```
$formDetails = array('action'     => '',
              'name'           => 'filtered_listing',
              'id'             => $this->EE->TMPL->form_id,
              'class'          => $this->EE->TMPL->form_class,
              'hidden_fields'  => array('ACT' => $actionID,
                                        'RET' => $_SERVER["REQUEST_URI"]),
              'secure'         => TRUE
);
$header = $this->EE->functions->form_declaration($formDetails);

```

If you're checking the receipt of the form and need to validate the XID...

```
//###   Check Security Hash   ###
if ($this->EE->security->secure_forms_check($this->EE->input->post('XID')) == FALSE) {
    //###   Deny Form submission if a hash isn't found or is too old
    $this->EE->functions->redirect(stripslashes($this->EE->input->get_post('RET', false)));
}

```

**Update based on Form Helper example code**

Try Outputting `{XID_SECURE_HASH}` Reference

```
form_hidden('XID', '{XID_SECURE_HASH}')

```

Failing that:

```
form_hidden('XID', $this->EE->functions->add_form_security_hash('{XID_HASH}'));

```

Ref: Rob Sanchez

Form Helper Documentation
> 1 votes

# Answer
I think, the addon may be generating the form with the following code:

```
$hidden_fields = array(
    'ACT'       => 'ACTION ID',
    'RET'       => 'RETURN URL'
);

$data = array(
    'action'        => 'FORM ACTION',
    'hidden_fields' => $hidden_fields,
    'id'            => 'FORM ID',
);

$tagdata = $this->EE->TMPL->tagdata;
$form  = $this->EE->functions->form_declaration($data);
$form .= stripslashes($tagdata);
$form .= "</form>";

```

which automatically generates XID as form's hidden field.

If above doesn't help, can you share the addon's code which is creating form.
> 2 votes

# Answer
If you just create a hidden input field name XID and use the EE Tag {XID\_HASH} I think it'll generate the value for you.

```
<input type="hidden" name="XID" value="{XID_HASH}" />

```
> 1 votes

---
Tags: add-on-development, xid
---


# Question
Title: Passing in vars for use in conditionals in Low Variables
Is there a simple way to create a custom conditional a bit like this:

In the template:

```
{exp:low_variables:single var="footer" foo="bar"}

```

In the variable:

```
   {if foo == "bar"}
      Show something here
   {/if}

```

I've played around with preload\_replace a bit but no joy so far

# Answer
> 1 votes
You can use the `preparse:my_var` parameter, available only in the Textarea variable type. Example:

```
{exp:low_variables:single var="my_var" preparse:foo="bar"}

```

---
Tags: low-variables
---


# Question
Title: Unable to upload files to directory 'file upload path not valid'
Site has just launched - and no issue with uploaded pdfs previously.

Some pdf links were broken and exisiting files not visible in directories. Trying to re-upload pdf and get message, file upload path is not valid.

Only have CMS access is there anything I can do to resolve and upload the file?

# Answer
It sounds like you will need to update file paths to take into account the new (live) server environment.

If you have Super Administrator access then go to Content-\>Files-\>File Upload Preferences and check the paths in there. You will need to specify the paths from the root of your server.

Unfortunately I cannot tell you what *should* be in there.

If you find that your changes don't 'stick' then it may be that the file upload paths are specified in a config file. To edit this you will need access to the server via FTP. There is also the possibility that the site is using multiple config files with something like Focus Labs Config. In which case it gets a little more complicated as there will be separate files for each environment the site is served in (local, dev, staging, production).

You may also find that you will need to update the permissions on the file upload directories but for that you will need access to the server via FTP, SSH or perhaps your hosting company provides a control panel that will allow you to update the permissions.
> 1 votes

# Answer
If you are using IIS for this application then your solution for this is to check in your web.config file for requestfiltering section and set the maxAllowedContentLength property. The reason for this is that IIS default max length is only 30MB.
> 1 votes

---
Tags: file-uploads
---


title: EE File management

text:
# Question
Title: EE File management
EE file management questioned corrected. Please close.

# Answer
> 1 votes
Assuming this is a hypothetical question, as Jeremy states, although it's possible it's not really worth the effort due to the many, many approaches. There's one developer I know of who has created "themes" that used to be sold through Theme Forest (but now no longer available), you can see them here. Woothemes attempted it as well (examples), but again they discontinued them and they're no longer available.

The point is, "theming" doesn't work in EE because of the different approaches to site structure, templates (naming, URLs, code, etc) and due to the amount of commercial add-ons (and variations in those) that are mostly standard to all EE builds.

Look at the default "theme" that comes with EE - it's meant as an example build to learn from, not to use in the real world or to expand upon.

There could be an approach whereby a module was developed to force rigid template usage for a build (e.g. like Wordpress has fixed templates for key functions), but ExpressionEngine's main strength is it's flexibility and freedom in approach and development.

More info on EE Insider

---
Tags: css
---


title: Show child categories but hide parent

text:
# Question
Title: Show child categories but hide parent
I have a template that outputs a list of categories and any entries associated with them.

All entries are assigned to child categories and none to the parent categories (the parent categories exist only to aid organisation of the child categories).

When the list is output, the names of the parent categories are being shown (with no entries), then the child categories with their entries as expected.

It looks something like this

```
Cat1
    Cat 1A
        (entries)
    Cat 1B
        (entries)
    Cat 1C
        (entries)
Cat2
    Cat 2A
        (entries)
    Cat 2B
        (entries)
Cat3
    Cat 3A
        (entries)
    Cat 3B
        (entries)

```

How can I not show the parent categories but keep the child categories showing?

i.e. the output will look like this...

```
    Cat 1A
        (entries)
    Cat 1B
        (entries)
    Cat 1C
        (entries)
    Cat 2A
        (entries)
    Cat 2B
        (entries)
    Cat 3A
        (entries)
    Cat 3B
        (entries)

```

Is my only option to remove the parent categories completely?

Here's my current template code

```
{exp:channel:categories channel="attachments" category_group="2" parent_only="no" style="linear" show_empty="no"}

    <h3>{category_name}</h3>
    {exp:channel:entries channel="pages" entry_id="112" }
        {exp:playa:children field="attachment" category="{category_id}" disable="members"}
                <ul>

                    <li>
                        <a href="{attachment-file}">{attachment-file-text}</a>
                    </li>

                </ul>
                {/exp:playa:children}
    {/exp:channel:entries}

{/exp:channel:categories}

```

# Answer
> 2 votes
Add:

```
{if {parent_id} != 0}
    ...
{/if}

```

(This only works for hiding root parents, not 3 tier structures)

```
{exp:channel:categories channel="attachments" category_group="2" parent_only="no" style="linear" show_empty="no"}

{if "{parent_id}" != 0}
    <h3>{category_name}</h3>
    {exp:channel:entries channel="pages" entry_id="112" }
        {exp:playa:children field="attachment" category="{category_id}" disable="members"}
                <ul>

                    <li>
                        <a href="{attachment-file}">{attachment-file-text}</a>
                    </li>

                </ul>
                {/exp:playa:children}
    {/exp:channel:entries}
{/if}
{/exp:channel:categories}

```

But be very careful of performance here - might be worth flipping the categories and entries tags, as `channel:entries` has more overhead than `channel:categories`, so a single entries tag and looping of the categories tag may improve performance.

---
Tags: categories, templates
---


# Question
Title: Expresso Store: Manually trigger 'store_product_price' recalculation
The class 'store\_product\_price' is updated by Javascript so that when a customer selects an option with a price variant, the price on display updates to reflect the new price.

This all works brilliantly.

However. We've added a system where by all the colour options for a product are shown as images on the product page. When clicking on one of these images we have got jQuery updating the select box of colour options (as populated by Expresso:Store) to reflect the right colour. However, the price doesn't update. I've tried fiddling with the $('select').change() methods, but I can't get it work.

The jQuery we use to update the select the right option in the select box is:

`$('.options select option').removeAttr('selected').filter('option[data-val="'+$(this).attr('data-title')+'"]').attr('selected','selected');`

How can use code to trigger a recalculation of the price please?

Thanks!

Tom

# Answer
I think the problem is that the Store JS code doesn't know the SELECT has changed so doesn't update the price. Setting the selected attribute doesn't fire the change event. You could test this by creating a change event on the select with a debug output to see if it fires.

```
$(".options select").change( function() {
    console.log("SELECT TRIGGERED ".$(this).val()); //ensure you remove this on live site as crashes IE!
});

```

Instead of setting "selected" for the OPTION, set the value for the SELECT:

```
$('.options select'.val( $(this).attr('data-title') ).trigger('change');

```

Although I think this is more correct for your scenario...

```
$('.options select'.val( $('.options select option[data-val="'+$(this).attr('data-title')+'"]').attr("value") ).trigger('change');

```

**Update**

What's the name of your select and what's the classes on the form element?

This is the line from Store JavaScript:

```
$(".store_product_price", form).val(price_str).html(price_str).trigger("change");

```

In the updateSku function.

Also this which attaches the handler the the update event on the select:

```
$(document).delegate('.store_product_form [name^="modifiers"]:not(:radio)', 'change', lib.updateSku).delegate('.store_product_form [name^="modifiers"]:radio', 'click', lib.updateSku);

```
> 1 votes

---
Tags: expresso-store, jquery, tags, product
---


# Question
Title: Low Replace Skips First Match in Same Line
I have a Low Replace tag that uses a regex to target links:

```
{exp:low_replace
    find='<a[^>]*href=QUOTE(.+)QUOTE[^>]*(.*)>(.*)<\/a>'
    replace='<a href=QUOTE$1QUOTE$2 style=QUOTEcolor: #007766; text-decoration: underline;QUOTE><span style=QUOTEcolor: #007766;QUOTE>$3</span></a>'
    regex='yes'
}
    <a href="http://google.com" target="_blank">Search on Google</a> <a href="http://bing.com" title="Search on Bing">or Bing</a>.
{/exp:low_replace}

```

But if the links are on the same line, Low Replace will only replace the last one. If I separate the links with a line break, like this:

```
<a href="http://google.com" target="_blank">Search on Google</a>
<a href="http://bing.com" title="Search on Bing">or Bing</a>.

```

then Low Replace works as expected.

I'm certain this is some problem with my regex, can anyone offer some insight?

# Answer
> 4 votes
You'll need to make the any-character match not greedy using a `?`:

```
<a[^>]*?href=QUOTE(.+?)QUOTE[^>]*?(.*?)>(.*?)<\/a>

```

That'll probably help.

---
Tags: low-replace, regex
---


# Question
Title: Channel Entries API and entry to a Category
Is it possible to add entries into categories when creating them with the Channel Entries API cant see anything in the documentation.

# Answer
Within the channel entry API, you can pass the data array containing the array of category ids like:

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

$data = array(
    'title'         => 'ENTRY TITLE',
    'entry_date'    => time(),
    'channel_id'    => x,
    'category'      => array($category_id)
);

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

ee()->api_channel_entries->submit_new_entry($channel_id, $data);

```
> 4 votes

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


title: Staging URL for web development

text:
# Question
Title: Staging URL for web development
Just wondered if anyone has a painless way of setting up a staging URL for website development. I often use Heart Internet, but the temporary URLs provided (ie ipaddress/domainreference) do not work with EE installations. In the past I've changed the domain ref to a staging domain, and got the client to point a subdomain to the new IP address. However, I'm not sure if Heart are allowing this now. I can also setup a hosts config locally, but that's makes client reviews awkward. Any thoughts greatly appreciated.

# Answer
> 2 votes
You might find EE Master Config useful. It allows you to replace the config.php file with a multi-environment setup that allows you to create sets of configuration items for each environment. From there it's just a matter of putting the right settings for the staging server.

---
Tags: staging-server
---


# Question
Title: HELP!! Upgrade errors: Unknown column 'hash' in 'field list' - Site is down!
When trying to upgrace 2.5 to 2.7 I get this error:

Fatal error: Cannot redeclare class Installer\_Extensions in /home/user/admin/expressionengine/cache/updater/1381156626\_439122/system/installer/libraries/Extensions.php on line 31

Then when I try and view the site I get a white screen with this error:

```
Error Number: 1054

Unknown column 'hash' in 'field list'

    SELECT `hash`, `timestamp` FROM (`exp_developer_log`) ORDER BY `timestamp` asc

    Filename: libraries/Logger.php

    Line Number: 106

```

# Answer
> 1 votes
Possibly the old version didn't have hash column in the table, and v2.7.1 does...? I've not got a v2.7.1 to compare.

Did you clear cache before updating? Had you done a previous update on this build before? Clear all the files from the cache folder manually then try the installer again. /home/user/admin/expressionengine/cache

When you copied the new files up to the server - did you delete the old folders and files first? Sometimes I get issues with FTP if I've not deleted the folder first, as in old files my remain, or not be updated correctly, so ensure you've not got a mix of old files and new - especially libraries/Logger.php.

Just compared v2.6.1 with v2.7.0 and the hash column has appeared in the exp\_developer\_log table - although there's no reference of it in the change log.

# Answer
> 3 votes
I added the required column hash in phpmyadmin and I was able to get rid of the error.

then I did a manual upgrade because Devdemon updater failed at ver 2.6.1

---
Tags: upgrade, devdemon-updater
---


# Question
Title: Expresso Store: Order tag seems to be ignoring order_by parameters
I've just upgraded to Expresso Store 2 and I've noticed that on my customers 'my orders' page that the orders are being listed from oldest to newest ignoring my parameters asking for them to be listed from newest to oldest.

(I'm not sure if this is a new bug with Store v2, or if I've only noticed it since upgrading).

Any advice on sorting this out please?

My code below:

```
{exp:store:orders member_id='CURRENT_USER' order_by='order_date' sort='desc'}

            {if no_orders}
                <tr>
                    <td colspan="5"><strong>You haven't placed any orders yet!</strong></td>
                </tr>
            {/if}

            <tr>
                <td>{order_id}</td>
                <td class="product">
                    {items}
                        {item_qty} × {title}<br />
                    {/items}
                </td>
                <td>{order_date format="%j %M %Y"}</td>
                <td>{order_total}</td>
                <td>{order_status}</td>
                <td><a href="{path='store/order/{order_hash}'}" class="button-style2">Details</a></td>
            </tr>

        {/exp:store:orders}

```

# Answer
> 1 votes
Looks like the parameter should be "OrderBy" without the underscore.

https://exp-resso.com/docs/orders\_tag.html#orderby

I also verified this in the code that it is indeed looking for the "OrderBy" parameter opposed to "Order\_By"

:D

---
Tags: expresso-store, tags, parameters, orderby
---


title: CartThrob Gateways

text:
# Question
Title: CartThrob Gateways
I am trying to try see if I can use 2 different gateways on 2 different checkout pages in CT.

ie: on one checkout page I want to use Moneris for standard goods

but on another checkout page reserved for Subscriptions I want to only use Stripe

I was going to try and hardcode the gateways in each:

```
{exp:cartthrob:checkout_form return="subscription-checkout/order_info" secure_action="yes" gateway="stripe"}

```

and

```
{exp:cartthrob:checkout_form return="checkout/order_info" secure_action="yes" gateway="moneris_direct"}

```

But it seems there is no way to actually know if it is actually working. HOw do I know if the correct gateway is being used?

# Answer
> 1 votes
That's the correct way to specify a gateway for the transaction as long as they are not nested (which wouldn't work anyway). You can also pass the gateway short name via POST with a hidden input like this:

`<input type="hidden" name="gateway" value="stripe">`

Does your product/subscription order list the gateway that was used if you look at the order reports in the CP?

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


# Question
Title: CathThrob - Add to Cart Form - No Shipping and Tax
I am running CartThrob 2.2.5. I am trying to exempt a product type from shipping and tax. I found the setting in their documentation but it isn't working (http://cartthrob.com/docs/tags\_detail/add\_to\_cart\_form/index.html)

Here is the opening tag. Any ideas why it isn't working?

**EDIT:** Updated to include Stash tags.

```
{exp:stash:get_list
    name="event_list"
    match='#{freebie_last}#'
    against='this_categories_url'
    limit='1'
}
    {exp:cartthrob:add_to_cart_form
        class='form-horizontal'
        entry_id="{this_entry_id}"
        tax_exempt="yes"
        shipping_exempt="yes"
        return="wines/wine-cart"
    }
        ....
    {/exp:cartthrob:add_to_cart_form}
{/exp:stash:get_list}

```

# Answer
Try changing `entry_id="{this_entry_id}"` to `entry_id="{entry_id}"`.

If that still doesn't work then try it with `{exp:cartthrob:add_to_cart}` instead of `{exp:cartthrob:add_to_cart_form}`.
> 0 votes

# Answer
I came across a similar issue with the 'add\_to\_cart' tag, and found the 'bug' was that the naming conventions for the parameters for those options were different to what was stated in the documentation to what was in the code.

The parameters should've been;

```
{exp:cartthrob:add_to_cart no_tax="yes" no_shipping="yes"}

```
* Cartthrob build was v2.1.6
> 2 votes

---
Tags: cartthrob
---


# Question
Title: Which table contains the data on the member group channel assignment privileges?
I am looking at my database and have looked at these tables

```
exp_member
exp_member_data
exp_member_fields
exp_member_groups

```

I can’t find any information here about the channel assignment privileges of a member group.

The one where you have something like

```
Can post and edit entries in:  Foo    Yes      No
Can post and edit entries in:  Bar    Yes     No

```

# Answer
The group\_id is mapped to the channel\_id in channel\_member\_groups

(an entry in this table means that 'YES' has been selected for that group/channel combination)
> 1 votes

---
Tags: members, channel, member-management
---


# Question
Title: ip_to_nation not working with ip_address
I've set up ip\_to\_nation like the user guide says to do it:

```
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
    {ip_address}
{/exp:ip_to_nation:world_flags}

```

But this won't output anything. However, if I hard code the IP address in there, it'll work:

```
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
    66.85.128.185
{/exp:ip_to_nation:world_flags}

```

Any ideas why this might be?

# Answer
I found the answer by accident, and I'll leave the answer here, in case someone else bumps into this problem.

You need to put the tag-pair inside a channel entry

```
//Doesn't work
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
    {ip_address}
{/exp:ip_to_nation:world_flags}

//Works!
{exp:channel:entries limit="1"}
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
    {ip_address}
{/exp:ip_to_nation:world_flags}
{/exp:channel:entries}

```

**EDIT:** So `{ip_address}` inside channel entries gives me the ip address of the author. However, there is a tag called `{logged_in_ip_address}`, which will output the users ip address even inside the channel entries tag. BUT! When using this, ip\_to\_nation fails again.

```
//Doesn't work either!
{exp:channel:entries limit="1"}
{exp:ip_to_nation:world_flags image_url="http://example.com/images/world_flags/"}
    {logged_in_ip_address}
{/exp:ip_to_nation:world_flags}
{/exp:channel:entries}

```

**EDIT 2:** Okay. I ended up doing everything in php because of this. So this is my final solution:

```
$this->EE->ip_data->find($ip);
include(APPPATH.'config/countries.php');
$cc = $this->EE->locales->alpha3_country_code($tmp);

```

Which will output the country code of the user, which was basically what I wanted anyway.
> 0 votes

# Answer
Have you visited the IP to Nation module in the CP and hit the 'Update IP Database' button on the top right?

Without doing that, there are no IPs to check against and the tag won't work as expected
> 0 votes

---
Tags: ip
---


# Question
Title: Solspace Rating stars alternative output
I'm trying to find out if there's a way to output alternative markup for the {stars\_overall\_avg} and the {stars}{rating}{/stars} rating tags.

Instead of the images, I'd like it to output a set of tags I can hang classes from.

Cheers Brendan

# Answer
> 2 votes
It's possible to ignore the built-in `{stars}` and `{starts_overall_avg}` tags and just output the numbers using the `{rating}` and `{overall_avg}` tags instead.

This allows you to do some clever things such as add variable class names to elements depending on the rating. Your CSS can then use these class names to alter the display of the data. For example:

```
<p class="star-{rating} rating">{rating}</p>

```

You can now use the CSS class to affect how the number is displayed by showing images other than stars and hiding the rating number using CSS text replacement techniques if desired.

# Answer
> 1 votes
You would probably have to hack mod.rating.php to make that happen. search for stars\_avg\_rating I don't think this would be a small undertaking.

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


# Question
Title: How do I escape characters in an RSS feed?
Here's a link to my RSS feed's failed validation. Nevermind the subtitles being too long, I'll fix that later. But fixing these special characters is a pill and in company names where it's part of their brand fixture, I can't readily change "&" to "and". How can I escape these characters? In the channel entry, the channel field type is sometimes Wyvern (already escaped the HTML character) and sometimes simply Text Input, which I believe is plain text right?

# Answer
unexplainedBacn is right.

Or you can also use the **XML Encode** plugin for this. It's actually included with ExpressionEngine

> This plugin converts reserved XML characters to entities. It is used in the RSS templates.
>
> To use this plugin, wrap anything you want to be processed by it between these tag pairs:
>
> ```
> {exp:xml_encode}
>     text you want processed
> {/exp:xml_encode}
>
> ```

To see more on usage go to Add-ons \> Plugins \> XML Encode in your EE Control Panel.
> 4 votes

# Answer
As a workaround, you could wrap the offending content in `<![CDATA[{content}]]>` tags.

Like so:

```
<description>
<![CDATA[
{body}
]]>
</description>

```

This won't actually escape the characters, but it will tell the validator to not worry about it.
> 1 votes

---
Tags: fieldtype, rss, html-entities, wyvern
---


# Question
Title: I'm new to ExpressionEngine, for those of you with some experience under your belt
I'm new to ExpressionEngine, for those of you with some experience under your belt ... what are some of the things that you wished you knew when you first got started with EE?

# Answer
> 3 votes
It depends on your milage, for me coding was quite new. So, yes, I wished I discovered earlier...:

* The videos of Mike Boink http://www.train-ee.com/courseware/free-tutorials (then buy his book)
* These podcasts http://ctrlclickcast.com
* This website http://devot-ee.com, but be careful there. It is amazing what one can do with EE right out of the box. No need to rush for addons right away.
* and last but not least, the art of DRY. And to work systematically. And to make a good plan before even starting. And to have a very good conversation with the client before taking the job.

Did I forget something? Probably yes, but I hope this helps a bit.

# Answer
> 2 votes
My tips:

* Read the user guide.
* Read it again
* parse order
* master config
* partials - dry approach
* Use Stackexchange forum, past and present posts
* Use the debugger and profiler to optimise page load times & minimise number of queries
* Use Simple conditionals wherever possible
* scratch different parts of your head so you dont get a bald spot!

# Answer
> 2 votes
I've had a blog post in the works for 2 years with almost exactly the title of your question! You've motivated me to quickly finish it off, update it and publish it:

http://www.jamessmith.co.uk/articles/expressionengine-beginners-guide

# Answer
> 2 votes
The best thing I can suggest is READ READ READ. Look over the tutorials and examine the sample sites that come with the installs. I got thrown into the mix fast and hard in the beginning and it caused a lot of confusion and a gateway to "bad habits".

Mike Boink was a Godsend in my time of need. He has several tutorials and a good book to get here:

Tutorials

Book

Another great resource of knowledge is Ryan Ireland. He also has some great resources here:

Tutorials

Books

Jae over at http://www.ejaedesign.com/ has great training courses too.

I know there are a ton of people that have helped and that have excellent resources. The entire community is great when it comes to helping each other out. Twitter will become your best friend.

---
Tags: ee2
---


# Question
Title: How many levels deep can relationships go?
Hopefully simple question but does anyone know how many levels deep the new native relationships template tags can go? The docs show examples going three levels deep but doesnt mention if there is any limit that would prevent you from going four or five levels down?

http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#child-entries-showing-games-and-teams-in-a-season

# Answer
As far as I know there is no limit, or no one has found it yet..;)
> 1 votes

---
Tags: relationships
---


# Question
Title: System 'on' and Site 'on' - Can you keep a channel segment 'closed'?
What is the best way to continue building a large site segment in which content can be added, previewed, and edited while the site is live but not seen in certain channels?

I have multiple ways of doing this, but I am always open to learn newer or better ways to improve my workflow.

Here's the situation: I have a large MSM site which consists of multiple subdomains. The old site is still live as the rebuild has to happen along side of the original which is a kluge of .net, static, EE1, etc..

So as the new site is designed and the old site becomes obsolete, I will need to open up various segments of the redesign (new), and close off the old site. Using 301's for the old content to the new content should help me with keeping my "juice" and traffic stats, but I am unsure of the best way to handle continuous development in the rebuild site.

If I have www.mydomain.com and say three channels as market-1, market-2, and market-3. I will build out market-1 and have it "live". While this is the case, I need to be able to develop in market-2 and market-3, adding entries, testing, etc. Is this possible without doing it on a development install and needing to port all of the fieldtypes, entries, etc. over? This is what I would like to avoid. I was hoping for a way to "close" a channeluntil it is ready for production viewing.

# Answer
A "channel segment" or a URL segment?

In case of URL segments, you can protect the templates using:

```
{if 0 == logged_in_member_id }
{redirect='404'}
{/if}

```

Or you can restrict the access to the templates by CP.
> 1 votes

---
Tags: ee2, channel, development
---


title: Channels Information

text:
# Question
Title: Channels Information
In the control panel, you can set channels access for users.

In the frontend, I want to get the channels data a user has access to and the fields data it can view.

I am not talking about the channel entries data. I am talking about the channel data themselves.

Is there a way to get this information? Are there addons for these feature?

# Answer
You will have to run a query to get the data. You should be able to run the following against the member\_group field of the member.

```
SELECT exp_channels.channel_title, exp_channel_fields.field_label, exp_channel_fields.field_name, exp_channel_fields.field_type, exp_channel_member_groups.channel_id FROM exp_channels, exp_channel_fields, exp_channel_member_groups WHERE exp_channel_member_groups.group_id = '6' AND exp_channel_member_groups.channel_id = exp_channels.channel_id AND exp_channels.field_group = exp_channel_fields.group_id

```

So in EE, run a exp:query like this maybe: (Should at least get you going)

```
Member Group : {member_group}<br>

<table>
<thead>
    <tr>
        <th>Channel</th>
        <th>Field</th>
        <th>Type</th>
    <tr>
</thead>
<tbody>
        {exp:query sql="
            SELECT channel_title, field_label, field_name, field_type
                FROM exp_channels a
                JOIN exp_channel_member_groups b on b.channel_id = a.channel_id
                JOIN exp_channel_fields c on c.group_id = a.field_group
                WHERE b.group_id = '7'
        "}
            <tr>
                <td>{channel_title}</td>
                <td>{field_label} - {field_name}</td>
                <td>{field_type}</td>
            </tr>
        {/exp:query}
    </tbody>
</table>

```

Of course, you'll have to figure a way to get your member's {group\_id} into where '7' is now.
> 1 votes

---
Tags: channel, fields
---


# Question
Title: {exp:channel:form} class param not working
I have this code

```
{exp:channel:form
  channel="foo"
  class="form-horizontal"
                ....
}

```

But I don’t see the class “form-horizontal” on my form

# Answer
This has been accepted as a bug by Ellislabs

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

---
Tags: 2.7.0, channel-form
---


# Question
Title: Changing Safecracker to Channel Form tag results in no form output
I recently upgraded from version 2.5.5 to 2.7.0.

To make my forms updated to the current version, I changed forms which uses the `{exp:safecracker}` tag to `{exp:channel:form}`.

When I did, however, the markup inside the tags shows does not show at all.

Is there something I am missing here on why they are not showing at all?

I am using Safecracker Registration btw, but I am not sure if that is the factor.

# Answer
> 1 votes
It is a channel permission issue. Thanks to Derek for the answer.

---
Tags: safecracker, channel, safecracker-registration
---


title: Store - How to Count Downloads

text:
# Question
Title: Store - How to Count Downloads
When selling downloadable files, is there an existing way to track the number of times each user has downloaded a file after purchasing?

# Answer
Not natively in Store. Similar to this question

Link Vault can track downloads per user.
> 3 votes

# Answer
Store doesn't support this natively.

There's nothing special about the way Store handles downloads, except that it provides a neat way to hide the real URL to a file and require a purchased order to visit the link. Since the files are just stored in regular EE channel fields, there is certainly no requirement that you use Store's download tag.

Therefore, if you want more advanced features or reporting, as Peter mentioned your best bet is to look to third party add-ons. Link Vault is definitely the most popular that I'm aware of.
> 2 votes

# Answer
I think, its late reply.

I developed a module "Member Downloads". One can see the documentation from here: http://www.sidd3.com/member-downloads-tracking-members-downloads/. It seems something suitable for you.

Soon, it will be available at devot:ee to purchase.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: Playa field not outputting expected value in zoo visitor update form
I'm trying to implement Chosen as a front to a Playa-field in my Zoo Visitor channel. Entering data isn't a problem, but obviously I want to have the currently selected entry selected as default. This wasn't behaving as expected, so I stripped everything down to the following bit of code:

```
{exp:zoo_visitor:update_form
    return='profiel'
    class='custom profile'
    allowed_groups='7'
}
    {member_employer var_prefix="employer"}{employer:entry_id}{/member_employer}
{/exp:zoo_visitor:update_form}

```

When I load this template, it outputs `810`, which isn't even an actual entry. When I output the value in another template between `{exp:zoo_visitor:details}` tags it outputs the expected entry\_id of `243`. I've tried removing the var\_prefix (which was only added later for debugging to be safe anyway). Any idea what's going on here?

# Answer
The update form works just the same as a Channel Form. You are trying to use tag syntax that works inside a channel entries tag, but that won't work inside a form. Either use {field:your\_playa\_fieldname} or if you really want to fetch them separately, you will have to resort to using a channel entries tag inside an embed. Also have a look at this thread http://devot-ee.com/add-ons/support/zoo-visitor/viewthread/10501#37493

Cheers, Nico
> 1 votes

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


title: Adding items to cart

text:
# Question
Title: Adding items to cart
I am new to the Store module. Store module is working only the Control Panel logged in members. If I'm not logged into the Control Panel, Side bar Cart is showing that: "Your cart is empty". When I click on Add to Cart it's not working either. It is working only when CP is logged in.

How can I solve this? any Configuration settings please.

I am using ExpressionEngine 2.6.1 and Store module is: 1.6.4

Ramesh Teegapur

# Answer
Try these:

Store isn't adding products to the cart

Expresso Store: Update Cart button is not updating the cart

Can't add items to a cart with EE 2.7 - Expresso Store

There's no conditionals in your template for logged in versus logged out in the relevant product tags are there?
> 1 votes

---
Tags: expresso-store
---


title: Reset Password link is wrong

text:
# Question
Title: Reset Password link is wrong
I am using EE 2.6.1 and User 3.4.3

I have been having issues with the Forgot Password form.

The email being sent contains a link to reset the password

urlofmywebsite//436184488/reset\_password?&id=TuIkrfhW

This link gives me a 404. Even when I remove the // Also ?& seems wrong.

If anyone could tell me what is wrong with this link it would be great.

# Answer
> 4 votes
I had the same issue, and ultimately discovered it was caused by a setting in Focus Labs EE Master Config.

In config.master.php around line 258 you'll find:

`/**
 * Member-based settings
 */`

`//$env_config['profile_trigger'] = rand(0,time()); // randomize the member profile trigger word because we'll never need it`

I'm not sure why randomising the tigger would help, however I found that setting it to a constant fixed the problem e.g.

`$env_config['profile_trigger'] = 'member';`

# Answer
> 2 votes
In EE 2.6.1, the reset password routine works differently compared to pre-2.6 version. Instead of being sent a password reset link, followed by a generated new password by email, users receive a link by email to visit a page on EE to reset their password themselves.

As of this writing, this new password reset method isn't available in User yet, but we're working on getting this added. :)

---
Tags: members, email, solspace-user, profile-edit, forgot-password
---


# Question
Title: Playa tag returning text string instead of entry ids
I've just upgraded a site from EE 2.1 to EE 2.7.1 and got it basically working by upgrading the associated AddOns. Playa is still having trouble (migrated from 3.1 to the latest 4.4.5).

Simple Playa code that should return the entry\_ids for the items selected within the `page_sidebar_content` field are instead returning a text string.

So,

```
 {page_sidebar_content backspace="1"}{entry_id}|{/page_sidebar_content}

```

is returning something like:

```
 M140o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr

```

instead of something like

```
114|32|61

```

Any ideas?

# Answer
> 0 votes
I ended up figuring out that it was a conflict with the now deprecated Twitter Timeline Add-On. Once that old code was removed from the site, all worked as it should.

# Answer
> 1 votes
Playa has an update script that you might have to trigger. Try **Add-Ons****Fieldtypes****Playa** to trigger Playa’s update script and see if that sorts things out.

# Answer
> 0 votes
Try the child\_ids tag.

```
{page_sidebar_content:child_ids}

```

---
Tags: playa
---


# Question
Title: Upgraded to 2.7.2: Fatal error: Class Matrix_cat_col_ft
I just upgraded to EE 2.7.2 and am getting an error when I go navigate to Addons \> Field Types.

Fatal error: Class Matrix\_cat\_col\_ft contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EE\_Fieldtype::display\_field) in ***\expressionengine\third\_party\matrix\_cat\_col\ft.matrix\_cat\_col.php on line 167

I've also upgraded to Matrix 2.5.8

Any help is greatly appreciated.

# Answer
Seems like the issue lies with this add-on http://koivi.com/ee-matrix-cat-col which hasn't been updated for two years so is incompatible with EE2.7

Adding this (http://pastie.org/private/f3xjwmrrm97psclvuu3hq) to the third\_party/matrix\_cat\_col.php class should help (right before the last "}").
> 1 votes

---
Tags: matrix, php-errors, fatal
---


# Question
Title: How to ensure only events that have not passed show up in simple search when events are contolled by Solspace Calendar
I'm using Solspace calendar on my EE site to handle calendar events. I am also using the built in simple search for the search feature on my site. I would like to have the search include calendar events in possible results, but only if the event has not passed already. I don't see any way to do that with the simple search, unless I can set the calendar events to automatically expire after they pass. Does anyone know of a way to either auto-expire calendar events after they pass, or is there a different search module I can use that would take into account the end date for an event based on how Solspace calendar tracks them (start date/end date, etc.)

Thanks,

Brian

# Answer
> 3 votes
Calendar events do not use regular entry entry\_date and expiration\_date values, but rather specialized event data stored in Calendar itself. Since the EE simple search form uses the regular EE channel entries library, it won't be able to filter for upcoming events based on entry\_date and expiration\_date.

Further, occurrences of an event are not necessarily channel entries themselves (unless you edit one of the occurrences, in which case only that occurrence becomes an entry). The EE simple search module will therefore **not** be able to display separate occurrences as if they were entries, even less discern upcoming occurrences.

To display upcoming events (another way of saying "events that have not passed yet"), you'll need to use `{exp:calendar:cal}`. You could try feeding the `{entry_id}` from your search results into a tag starting like this:

```
{if channel_short_name == "calendar_events"}
  {exp:calendar:cal
      pad_short_weeks="n"
      date_range_start="today"
      date_range_end="+1 month"
      event_id="{entry_id}"
  }
    // ...more code
  {/exp:calendar:cal}
{/if}

```

This will display, within your search results, all occurrences in the coming month for that event entry. As a note, if you're ordering your regular results by entry entry\_date or expiration\_date, these occurrences won't "mix in" chronologically with your other regular channel entries.

---
Tags: search, solspace, calendar
---


title: Advice: Different Content Country Sites

text:
# Question
Title: Advice: Different Content Country Sites
Whats the best practice to create a website in EE, that is different country (Not language) and change the content based on this.

I'm considering using MSM, due to the client needing different categories & pages per site, but then plugins such as CartThrob don't support the ability to span products across multiple sites via MSM.

# Answer
I actually have used MSM in this case, and to good results. We shared common code in one 'site' and embedded into other sites as needed. Each MSM site stored the things that were different/unique to that country.

I'd be curious to hear what Matt ran into.

But the eCommerce piece might be a deal-killer.
> 1 votes

# Answer
I would strongly recommend not using MSM for this; I think it will cause you more problems than it solves.

Have you considered having different category groups for each country and then on listing pages, limiting by category\_id in the weblog:entries tag?
> 0 votes

---
Tags: cartthrob, ecommerce
---


# Question
Title: upgrading multiple versions of EE to php 5.5
For security reasons we were recommended to upgrade to the latest version of php (from version 5.3 to version 5.5.X) to fix all the possible bugs out there for that version, however I'm a little bit worried because we have more than 100+ sites in EE (Versions 2.1,2.2,2.3) and if we upgrade our PHP the websites could stop working.

* Am I worrying too much for this? or there's something that I should consider before make the big upgrade

# Answer
> 7 votes
Totally agree with Steven's comment, I'll give my own answer though as we recently went through similar.

We were migrating to a new server and took the opportunity to build php 5.5 on the server to skip a version and save us the hassle of any major version upgrades again anytime soon. Here was our strategy.

1. Upgrade all sites to latest EE build
2. Upgrade all addons to latest build. As part of this we didn't only look at versions of addons on Devot-ee etc, we also checked the various addons respective Github repos etc, as often there were more recent versions that had not necessarily been pushed to Devotee, on a case by case basis if we thought the fixes on Github were worth taking we did testing with that version and went live with it if we had no problems.
3. We already maintain a spreadsheet showing all addons running across all sites and what version they were at. We then identified a test group of sites that covered all the addons across all our sites
4. Using the above list we came up with a test plan that would allow us to test all the major functionality in each site provided by both EE and addons
5. Before our server went into production, we migrated all our sites that were part of our test group and did extensive testing on these sites, knowing that in most if not all cases, the extensive testing we do here should cover most of the other sites as there should be no major differences to the php code between the sites.
6. Once we resolved all our issues with this test group, we ensured we also had a good copy of php5.3 on the new server, this meant if we did run into any issues due to php incompatibilities, we didn't have to roll back every site, we just switched the site experiencing the problem back to php5.3.

The key in the above strategy was to identify all the areas to look for problems before they occurred. Remembering that a php issue may only show up when a particular function runs. For example, the only significant problem we had in the migration was when last minute we removed imap from php, thinking it wasn't needed. When in actual fact Escore (mail sending addon), required this even though it didn't use imap. The only time this error would fire was when email was sent. It was a quick fix, and error was found quickly because testing email was part of our test routines.

If your doing a same server upgrade of php and don't have access to a cloned development environment, I would suggest looking at running two versions of php on the server, then you can move one site at a time which will cause you less grey hairs! How you would do this would depend on your setup, but that's a bit off topic here.

Personally it would never attempt a move like this with EE on 2.1/2.2 etc, they are getting a bit old now. If you do run into problems and seek help, your going to be asked to upgrade them anyway so best get it out the way while your in a stable environment first. Otherwise you could end up in a situation where every site has a different issue to troubleshoot and you will quickly get overrun with issues.

For what it's worth I'm not sure I would consider php 5.5 more secure than 5.4, in fact I think it would be fair to call 5.4 more mature as it's been in production for much longer. I'm not saying don't upgrade to 5.5, but don't automatically assume it's the most bug free version as that may not be the case.

# Answer
> 3 votes
I wouldn't go updating a production server without running any tests first. I'd mirror your production server first and then test the sites individually.

That's the only way you'll guarantee to be headache free.

---
Tags: php, upgrade
---


# Question
Title: Different Top vs Bottom Pagination Code Blocks
Pagination is pretty simple but I can't figure out how to have a different pagination style at the top vs the bottom. What I want to do is show the pagination links at the bottom of the results but show some other information that is only available within the pagination tags at the top of my results. I have AB Pagination installed as well so I can use some it's extra tags to show more info.

So my question is, is there a way to have something similar to

```
{pagination_top} Showing results 1-10 of 56. Show: 10  20 30 per page  {/pagination_top}

{entries loop} stuff here {/entries}

{pagination_bottom} Prev | 1 | 2 | 3 | etc | Next {/pagination_bottom}

```

Any help would be appreciated! Thanks

# Answer
Render out the pagination in one block, framing the 2 styles of pagination:

```
{paginate}
  <div id="top-pagination">
    Showing results {abp_entry_from}-{abp_entry_to} of {abp_total_entries}. Show: 10  20 30 per page
  </div>

  <div id="bottom-pagination">
    {pagination_links}
      <ul>
        {previous_page}<li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>{/previous_page}
        {page}<li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>{/page}
        {next_page}<li><a href="{pagination_url}" class="page-next">Next Page</a></li>{/next_page}
      </ul>
    {/pagination_links}
  </div>
{/paginate}

```

Then using CSS, `position:absolute` #top-pagination and ensure there's room for it at the top of the listing.

But not sure how you're going to handle the sorting amount.

Use only `paginate="bottom"` in the channel:entries tag parameters.
> 2 votes

# Answer
Unfortunately I don't think this is possible. One workaround might be to use multiple `{exp:channel:entries}` loops on the page, each creating it's own pagination, but obviously that would be a very inefficient solution, so I'd only use it in a last resort on a page you were sure wasn't going to have a lot of load.
> 0 votes

---
Tags: search, filter, pagination, ab-pagination
---


# Question
Title: Why is Text Formatting: None wrapping <p> tags around my text?
I recently upgraded a site I'm working on to 2.7.1. And now I have some text being output with `<p>` tags around it, despite having the text formatting set to "none".

Is this a bug, or is there a new setting I'm not aware of that's overriding the set preference?

# Answer
It looks like the issue was that EE was ignoring the "allow override on publishing page" formatting preference, so even though I set the text formatting to "none" in the entry, it was being ignored in favor of whatever the default format preference was for the field in question. Updating from 2.7.1 to 2.7.2 corrected the issue and caused the preference to start working correctly again.
> 1 votes

# Answer
I noticed this as well, but didn't have time to look into it further. I'd say it's a bug and I don't see it currently in the bug tracker.
> 0 votes

---
Tags: text-formatting
---


title: Expresso:store custom field as checkbox

text:
# Question
Title: Expresso:store custom field as checkbox
I am looking for a way to create a custom field to be used during the checkout process that a user can check if the would like to receive e-mail updates. I have attempted to add the {order\_custom1} field and specified as a checkbox but it still returns a text input field. This is the code I am using.

```
<div class="control-group">
    <div class="controls">
        <label for="order_custom1" class="checkbox">
            {field:order_custom1} Check here if you would like to receive updates about The Journey
        </label>
    </div>
</div>

```

Is there anyway to do this?

# Answer
> 4 votes
The `{field:something_here}` tag will always create a text input with a few exceptions of countries, regions, and state fields will return a select box. If you want to addd a checkbox or radio or similar you would need to do something along the following:

```
<div class="control-group">
    <div class="controls">
        <label for="order_custom1" class="checkbox">
            <input type="checkbox" name="order_custom1" value="Yes" /> Check here if you would like to receive updates about The Journey
        </label>
    </div>
</div>

```

This will display "Yes" in the Store \> Orders \> Order Detail section.

To create any custom input element you just need to set the name of the input field to whatever you are trying to collect. One thing to mention that when you are not using the `{field:somethinghere}` approach for text inputs you need to use the field name in curly brackets in the value field if you would like to repopulate the existing information.

```
<input type="text" name="billing_address" value="{billing_address}" />

```

# Answer
> 1 votes
In addition to Justin's answer, another thing to keep in mind is that if you are creating your own input field with a checkbox, you need to use a hidden field to set the unchecked state.

If an HTML checkbox is unchecked, nothing at all gets submitted and so in that case Store will not update the stored value in the cart.

You can solve this by putting a hidden input with the same name immediately before your checkbox. If the checkbox is selected, the second value will take priority, otherwise it will fall back to the default:

```
<input type="hidden" name="order_custom1" value="No" />
<input type="checkbox" name="order_custom1" value="Yes" {if order_custom1 == "Yes"}checked{/if} />

```

---
Tags: expresso-store
---