# Question
Title: Expresso Store Stripe integration - Passing shipping details to Stripe null
Using Expresso Store and Stripe, I'm getting a conflict with either the naming convention of Expresso Store and stripe.js stripeResponseHandler, or my jQuery

Passing "user" details is null upon submit to Stripe.

My Expresso Store post details via firebug:

```
XID 7db7d1ad91f9fa13deeb13de67c784226ed345e7
billing_address 1   243 Blank Rd
billing_address2
billing_address3     Blastoff
billing_country us
billing_name    Denny Test
billing_phone   330-000-0000
billing_postcode     44231
billing_region  OH
form_name
next    Confirm Order
next_url    store/confirm-stripe
order_email somth@gmail.com
return_url  store/details
secure_return   1
shipping_address1
shipping_address2
shipping_address3
shipping_country    us
shipping_name
shipping_phone
shipping_postcode   44281
shipping_region OH
shipping_same_as_billing    0
shipping_same_as_billing    1
site_id 1

```

My Response handler:

```
  function stripeResponseHandler(status, response) {
    $("#checkout_submit").attr('disabled', false);
    if (response.error) {
      alert(response.error.message);
    } else {
     var token = response['id'];
     var form$ = $("#payment_token");
      $(form$).val(token);
     form$.append("<input type='hidden' name='stripeToken' value='" + token + "'/>");
      $("#checkout_submit").unbind("click").click();

    }
  }

```

And the response in Stripe:

```
object: "card"
last4: "4444"
type: "MasterCard"
exp_month: 1
exp_year: 2014
fingerprint: "3HSdYop7eOmsdo3a"
country: "US"
name: "Denny Test"
address_line1: "undefined"
address_line2: "undefined"
address_city: null
address_state: null
address_zip: "undefined"
address_country: null
cvc_check: "pass"
address_line1_check: "pass"
address_zip_check: "pass"

```

# Answer
I solved the issue in case anyone is looking for the same result.

**The jQuery stripeResponseHandler:**

```
          Stripe.createToken({
        name: $("#payment_name").val(),
        number: $("#payment_card_no").val(),
        cvc: $("#payment_card_csc").val(),
        exp_month: $("#payment_exp_month").val(),
        exp_year: $("#payment_exp_year").val(),
        address_line1: $('#billing_address1').val(),
        address_line2: $('#billing_address2').val(),
        address_zip: $('#billing_postcode').val(),
        address_state: $('#billing_region').val(),
        address_country: $('#billing_country').val()
      }, stripeResponseHandler);

      return false;
    }
  });

```

The long and short of it is, you have to declare the values when creating the token in jQuery. Also, the input values you're looking to pass to Stripe have to be either included in the form of the actual fields or hidden values within the page you're submitting from.

**In my case using Expresso Store:**

```
<fieldset id="billing_details" style="width:50%; float:left;">
    <legend>Billing Details</legend>
    <div class="control-group clearfix {if error:billing_name}error{/if}">
        <label class="control-label" for="billing_name">Name</label>
        <div class="controls">
            {field:billing_name} {error:billing_name}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_address1}error{/if}">
        <label class="control-label" for="billing_address1">Address</label>
        <div class="controls">
            {field:billing_address1} {error:billing_address1}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_address2}error{/if}">
        <div class="controls">
            {field:billing_address2} {error:billing_address2}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_address3}error{/if}">
        <label class="control-label" for="billing_address3">City</label>
        <div class="controls">
            {field:billing_address3} {error:billing_address3}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_postcode}error{/if}">
        <label class="control-label" for="billing_postcode">Postcode</label>
        <div class="controls">
            {field:billing_postcode} {error:billing_postcode}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_region}error{/if}">
        <label class="control-label" for="billing_region">Region</label>
        <div class="controls">
            {field:billing_region} {error:billing_region}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_country}error{/if}">
        <label class="control-label" for="billing_country">Country</label>
        <div class="controls">
            {field:billing_country} {error:billing_country}
        </div>
    </div>

    <div class="control-group clearfix {if error:billing_phone}error{/if}">
        <label class="control-label" for="billing_phone">Phone</label>
        <div class="controls">
            {field:billing_phone} {error:billing_phone}
        </div>
    </div>

    <div class="control-group clearfix {if error:order_email}error{/if}">
        <label class="control-label" for="order_email">Email</label>
        <div class="controls">
            {field:order_email} {error:order_email}
        </div>
    </div>

</fieldset>

    <fieldset>
        <legend>Shipping Details</legend>
<div style="margin: 0 0 0 40px;">

        <div id="shipping_details_drawer">

            <div class="control-group clearfix {if error:shipping_name}error{/if}">
                <label class="control-label" for="shipping_name">Name</label>
                <div class="controls">
                    {field:shipping_name} {error:shipping_name}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_address1}error{/if}">
                <label class="control-label" for="shipping_address1">Address</label>
                <div class="controls">
                    {field:shipping_address1} {error:shipping_address1}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_address2}error{/if}">
                <div class="controls">
                    {field:shipping_address2} {error:shipping_address2}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_address3}error{/if}">
                <label class="control-label" for="shipping_address3">City</label>
                <div class="controls">
                    {field:shipping_address3} {error:shipping_address3}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_postcode}error{/if}">
                <label class="control-label" for="shipping_postcode">Postcode</label>
                <div class="controls">
                    {field:shipping_postcode} {error:shipping_postcode}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_region}error{/if}">
                <label class="control-label" for="shipping_region">Region</label>
                <div class="controls">
                    {field:shipping_region} {error:shipping_region}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_country}error{/if}">
                <label class="control-label" for="shipping_country">Country</label>
                <div class="controls">
                    {field:shipping_country} {error:shipping_country}
                </div>
            </div>

            <div class="control-group clearfix {if error:shipping_phone}error{/if}">
                <label class="control-label" for="shipping_phone">Phone</label>
                <div class="controls">
                    {field:shipping_phone} {error:shipping_phone}
                </div>
            </div>

        </div>
        <div class="control-group clearfix">
            <div class="controls">
                <label for="shipping_same_as_billing" class="checkbox">
                    {field:shipping_same_as_billing} Same as Billing Details
                </label>

            </div>
        </div>
</div>
    </fieldset>

```
> 2 votes

# Answer
As Denny has mentioned there are a few extra fields that you can pass to Stripe when you creating the token. For most sites that I have worked on the last step when the user enters their CC details usually shows the billing/shipping details as text text instead of an input as they are just confirming the details are correct.

So instead of adding the fields back in as form inputs or creating them as hidden inputs you can use the .text() property. I am using a slightly modified version of the store\_example/checkout3 template below (from about line 32ish).

```
<fieldset>
    <legend>Billing Details</legend>
    <div class="control-group">
<div id="billing_name"><b>{billing_name}</b></div>
<div id="billing_address1">{billing_address1}</div>
<div id="billing_address2">{billing_address2}</div>
<div id="billing_city">{billing_address3}
<div id="billing_zip"> {billing_postcode}</div>
<div id="billing_region_name">{billing_region_name}</div>
<div id="billing_country">{billing_country_name}</div>
<div id="billing_phone">{billing_phone}</div>
<div>{order_email}</div>
    </div>
</fieldset>

```

Then in your footer area you would want to adjust the JS where you create the Stripe Token as follows

```
/* Create a Stripe card token */
Stripe.createToken({
name: $("#payment_name").val(),
number: $("#payment_card_no").val(),
cvc: $("#payment_card_csc").val(),
exp_month: $("#payment_exp_month").val(),
exp_year: $("#payment_exp_year").val(),
address_line1: $("#billing_address1").text(),
address_line2: $("#billing_address2").text(),
address_city:  $("#billing_address2").text(),
address_state: $("#billing_region_name").text(),
address_zip: $("#billing_zip").text(),
address_country: $("#billing_country").text()

/* any additional fields you would like to pass through with a comma at the end of every line but the last one */
}, stripeResponseHandler);

/* We don't want to submit the form yet */
return false;

```

You can see the full list of the parameters that are available here. For the initial setup of Stripe with Exp:resso Store go here.
> 2 votes

---
Tags: expresso-store, ecommerce
---


title: Retrieve Structure Top Level Pages

text:
# Question
Title: Retrieve Structure Top Level Pages
I find myself struggling with some of Structure's documentation and cannot find an answer via Google either, here's the skinny:

Currently have 2 top level "pages" (2 more but are hidden because I dont need them in the nav list). Each of these have children pages and everything is dandy and working.

```
Top Level Page1 - overview template / Channel1
    + Child Page -- Display template / Channel2
    + Child Page -- Display template / Channel2

Top Level Page2 - overview template / Channel1
    + Child Page -- Display template / Channel2
    + Child Page -- Display template / Channel2

```

I now need to take those 2 "top" level pages and insert them into a select dropdown for some JS sorting on a page that isn't managed by Structure, like this:

```
Project Overview -- show all entries template - Channel2
    {exp:channel:entries}
    // Works well, spits out Channel2 data no prob
    //This is what I need
    <option value="{structure:parent:id}">structure:parent:name</option>

```

Have tried:

```
{exp:structure:nav start_from="/" max_depth="1"}
  <option value="{page_uri}">{title}</option>
{/exp:structure:nav}
//This code works well in nav

```

This yields nothing (blank code), the docs allude that using :nav sets an li which I dont want & likely causing nothing to output.

I expect because Structure isn't managing the "projects" page, finding a parent or anything to do with normal `exp:channel:entries` tag is the roadblock.

Thought about adding Top Level pages as children of a new 'parent' but then I'd have another list item in the main nav which we dont want.

Totally stumped :(

# Answer
> 0 votes
For those interested and for my future self, I basically need to add id's to 2 select dropdpowns (1 for category and for one to identity which parent it belongs to) + also replicate on 2 data values for each entry.

This is all outside the Structure framework, I'm querying only the children entries with a simple exp:channel:entries but no native way to query who its parent is.

```
/* Simple enough to add top value entry_ids
<select name="disciplines" data-label="Filter by Disciplines">
  <option selected="selected" value="all">All Disciplines</option>
  {exp:structure_entries depth="1" hide_from_nav="yes"}
    <option value="{entry_id}">{title}</option>
  {/exp:structure_entries}
</select>

/* Bit of a no brainer getting the categories
<select name="market" data-label="Filter by Market">
<option selected="selected" value="all">All Markets</option>
  {exp:gwcode_categories style="linear" channel="project_detail" show_empty="no"}
    <option value="{cat_url_title}">{cat_name}</option>
  {/exp:gwcode_categories}
</select>

```

Now the fun part, mighty Croxton Stash + Structure Entries FTW

```
/* Simple list of relationships !!
{exp:stash:set_list name="associated" parse_tags="yes" trim="yes"}
    {exp:structure_entries  hide_from_nav="yes" parse="inward"}
        {stash:parentid}{parent_id}{/stash:parentid}
        {stash:entryid}{entry_id}{/stash:entryid}
    {/exp:structure_entries}
{/exp:stash:set_list}

```

THE MAGIC = match + against !!

```
{exp:channel:entries channel="project_detail"}
<article data-disciplines="{exp:stash:get_list name='associated' match='#{entry_id}#' against='entryid'}{parentid},{/exp:stash:get_list}"
data-market="{exp:gwcode_categories entry_id='{entry_id}' style='linear' backspace='1'}{cat_url_title},{/exp:gwcode_categories}">
... remainder of layout for product ...
{/exp:channel:entries}

```

# Answer
> 3 votes
You'll need to use the Structure Entries add-on for this. Here's the basic idea (full docs can be found at the devot-ee page):

```
<select id="Menu" name="menu">
  {exp:structure_entries  depth="1"}
    <option value="{page_uri}" {if {current_page}}selected{/if}>{title}</option>
  {/exp:structure_entries}
</select>

```

---
Tags: structure, navigation
---


# Question
Title: Displaying what categories a product belongs to on a single-entry page
I have 3 category parents with several children in each.

For a single entry product page, I would like to list which categories the product belongs to (children only), with a single header for each category parent:

Publisher: (parent id 22) Designer: (parent id 45) Genre: (parent id 8)

There could be multiple children categories for Designer and Genre.

Ideally I would like to use conditional statements that spit out:

```
if publisher is checked then <p>Publisher: <a href="#">publishercategoryname</a> </p>

if designer is checked then <p>Publisher: <a href="#">designercategoryname1</a>, <a href="#">designercategoryname2</a>, <a href="#">designercategoryname3</a> </p>

if genre is checked then <p>Genre(s): <a href="#">genrecategoryname1</a>, <a href="#">genrecategoryname2</a>, <a href="#">genrecategoryname3</a> </p>

```

I would like the parent to show up just once, with the children category names nested.

Any help would be greatly appreciated.

Thanks!

# Answer
Whilst you can do some complicated stuff with GW Categories, I would probably first use separate category groups for these three things instead of nesting parent-child categories. It would simplify things greatly and create better separation of concerns, since your top-level categories are not semantically related to each other - you're basically just faking headings which would be better suited as individual category groups.

```
{exp:channel:entries channel="example" disable="categories|member_data|pagination"}
    <h1>{title}</h1>
    {exp:gwcode_categories entry_id="{entry_id}" style="linear"}
       {if group_start}<p>{cat_group_name}: {/if}
       <a href="{path=category/{cat_url_title}}">{cat_name}</a>
       {if group_end}</p>{if:else} ,{/if}
     {/exp:gwcode_categories}
{/exp:channel:entries}

```
> 2 votes

# Answer
This excellent add-on http://devot-ee.com/add-ons/gwcode-categories will do exactly what you need. Check it out!
> 0 votes

---
Tags: categories
---


# Question
Title: How can I stop a form submit and validate with javascript?
I've come across a form that, on the rendered page, looks like this:

```
<form id="mx_locator" name="mx_locator" method="post" action="search-results">

  <!-- form elements -->
  <span><input type="image" src="/images/search.png" onclick="loader()"></span>

</form>

```

The form itself, in the template code, looks like this:

```
{exp:mx_google_map:form result_page = "search-results" log="" lat="" unit = "" backspace="1"}
  {embed="site/sidebar_search"}
{/exp:mx_google_map:form}

```

Question 1) Where can I edit the form html? And/or how can I add an onsubmit attribute to the form's opening tag? Does that EE code build a form tag? Or can I edit the static html elsewhere? In addition to other methods, I want to try to add an onsubmit attribute to the form tag. Not saying it's the best way, or that it'll work, but I want to try.

Question 2) How can I stop the form submission to check two text input fields before proceeding? I need to make it so **one of two fields**, in this case zip or city, are not blank. At least one must be filled.

I thought the `loader()` bit took care of everything, meaning I could call a diff function and then have `loader()` called when the validator checks out ok, but `loader()` just handles some css changes. I have no idea how the form is calling the MXgm script or sending it data, so I don't know how to stop it or call it manually myself.

Thanks for any tips.

# Answer
You can use the Forms JS Validation plugin http://devot-ee.com/add-ons/forms-js-validation

You can add basic and complex validation to your forms without modify the form tag itself.
> 2 votes

# Answer
To stop the posting of the forum, you can use jQuery submit: http://api.jquery.com/submit/

The code would look something like this:

```
$(window).ready(function() {
    $('#mx_locator').submit(function() {
        if ($('#mx_zip').val() == '' && $('#mx_city').val() == '') {
            // Additional code here to light up the input or display error message
            return false;
        }
        return true;
    });
});

```

return false will stop the form from submitting.
> 2 votes

---
Tags: forms, javascript, jquery, validation, mx-google-map
---


title: Playa data not displaying

text:
# Question
Title: Playa data not displaying
I have recently come across an issue on a site I'm working on. The problem is that a Playa field doesn't seem to be displaying a related entry title. Normally I have no issue whatsoever with Playa tags so this has me stumped.

Here is the opening channel tag

```
{exp:channel:entries channel="courses" dynamic="on" limit="8" disable="member_data"
    status="not closed"
    paginate="bottom" paginate_base="{language_prefix}/courses/category/{segment_3}"}

```

This channel contains

* An image (file field)
* Title
* Category (using the `{categories}` tag)
* A short abstract (text area)

and also a related venue field (using Playa) coded as the following

```
{course_related_venue disable="member_data"}{title}1{/course_related_venue}

```

This is followed by pagination and then the closing `{/exp:channel:entries}`.

Is there something obvious that I'm missing that would cause the Playa field data to not display. It seems that anything inside the Playa tag just isn't being recognized, even if I hardcode something inside there.

Can someone maybe shed some light on this?

\*and in case it helps, this is on a category page so has a url of /courses/category/C6/

@Lisa Wess: additional information you requested

## **Versions**

EE v2.5.2 Playa v4.1.0.3

## **Template Code**

```
{embed="includes/_head" title="{general_custom_homepage_title}" hide_site_title="y" body="courses"}

<header class="head-container course detail">

<div class="container">
      <img class="courses-for-you" src="/assets/images/courses/courses-course.png">

        {exp:aj_lang:get_text word="courses"}

{exp:channel:category_heading dynamic="on" channel="courses"}<h4>{exp:aj_lang:get_text word="Course Category"}:  {if language_prefix=="/en"}{category_name}{if:else}{course_category_name{language_suffix}}{/if}</h4>
{/exp:channel:category_heading}

</div><!--/container-->
</header><!--/head-container-->
<br class="visible-phone"/>
<div class="container">
<div class="row">
<div class="span4">

          <p class="label">{exp:aj_lang:get_text word="Course Category"}</p>
        <ul class="category-spanned">
        {exp:channel:categories style="linear" category_group="3"}

              <li><a href="{path={language_prefix}/courses/category}"> {if language_prefix=="/en"}{category_name}{if:else}{course_category_name{language_suffix}}{/if}</a></li>

             {/exp:channel:categories}
         </ul>

</div><!--/spnn4-->

<div class="span8">

<p class="label">{exp:channel:category_heading dynamic="on" channel="courses"} {if language_prefix=="/en"}{category_name}{if:else}{course_category_name{language_suffix}}{/if}{/exp:channel:category_heading} {exp:aj_lang:get_text word="Courses"}</p>

{exp:channel:entries channel="courses" dynamic="on" limit="8" disable="member_data" status="not closed" paginate="bottom" paginate_base="{language_prefix}/courses/category/{segment_3}"}

<div class="row"><!--nested row open-->

<div class="span1">
{if course_image}
      {course_image}
      <span class="course-image">{exp:imgsizer:size src="{url}" width="70" height="70"}</span>
      {/course_image}
      {if:else}
       <span class="course-image">{exp:imgsizer:size src="/assets/images/courses/placeholder-course.jpg" width="70" height="70"}</span>
{/if}
</div><!--/span1-->

<div class="span7">

      <h2 class="title"><a class="course" href="{language_prefix}/courses/{url_title}">{title}</a></h2>

          <p class="no-font"><small>{exp:aj_lang:get_text word="Category"}:{categories}  {if language_prefix=="/en"}{category_name}{if:else}{course_category_name{language_suffix}}{/if}{/categories}</small></p>
          <p class="no-font"><small>{exp:aj_lang:get_text word="Venue"}: {course_related_venue}{title}{/course_related_venue} </small></p>

          <p>{if course_abstract{language_suffix}}{course_abstract{language_suffix}}
          {if:else}{exp:aj_lang:get_text word="Currently awaiting more information"}{/if}
          </p>
          <br/>
<ul>

</ul>
          <p><a class="button course shadow" href="{language_prefix}/courses/{url_title}">{exp:aj_lang:get_text word="More about this course"} »</a></p>

          {if no_results}
           <p>{exp:aj_lang:get_text word="Currently no courses in this category"}</p>
          {/if}

</div><!--/span7-->

</div><!--/nested-row--><hr/>

{paginate}
 {pagination_links}<div class="centered block">
        <ul class="paginate centered">

                {previous_page}
                        <li class="float-left"><a href="{pagination_url}" class="page-previous">Previous </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 class="float-right"><a href="{pagination_url}" class="page-next">Next</a></li>
                {/next_page}

        </ul></div>
{/pagination_links}
    {/paginate}

{/exp:channel:entries}
</div><!--/spnn8-->
</div><!--/row-->

</div><!--/container-->
<hr class="course">

{embed="includes/_foot"}

```

# Answer
Can I ask you to create a totally new template. Put **nothing** but this in it:

```
 {exp:channel:entries channel="courses" dynamic="on" limit="8" disable="member_data" status="not closed"}
<h1>{title}</h1>
    {course_related_venue}<strong>course_related_venue:</strong> {title}{/course_related_venue}
{/exp:channel:entries}

```

Make sure you're pulling up an entry on that template that has at least one child. Do you get any data out of that?

Thanks!
> 2 votes

---
Tags: playa, pixelandtonic
---


# Question
Title: Expresso Store - PHP Error - store/mcp.store.php
I just moved a site to a new server and everything is working beautifully except for Store. In CP, I see this PHP errors.

```
A PHP Error was encountered
Severity: Notice
Message: Constant STORE_CP already defined
Filename: store/mcp.store.php
Line Number: 9

```

The front-end has this error.

```
Fatal error: Call to undefined method Store_cart::count_contents()
in /public_html/manager/expressionengine/third_party/store/mod.store.php
on line 55

```

Store 1.6.3, EE 2.5.3

Thanks.

# Answer
> 2 votes
Going from the PHP error, it sounds like the files weren't uploaded correctly. I would delete the entire `third_party/store` folder from your server and try uploading it again.

# Answer
> 1 votes
It's possibly a permissions issue. If you make sure the `store` directory in the `third_party` folder has correct permissions (maybe 755) then that may fix it...?

---
Tags: expresso-store
---


# Question
Title: Use an exp-resso store coupon code without being a member
Is it possible to use an exp-resso store coupon code without being logged in / without being a member?

From the docs:

Restrict to Member Group: If configured, the promo code will only be able to be used by logged in members in this member group.

So I set the setting to 'all'. When I log out to test the code I get an error 'invalid code'. If I'm logged in, everything works shiny.

# Answer
> 1 votes
You probably have a "per user limit" set for the promo code. Although it's not particularly clear, this by definition requires that a member be logged in, otherwise anonymous customers could easily get around the limit.

---
Tags: expresso-store, coupon-code
---


# Question
Title: MasterConfig seems to retain reference to Republic Variables somewhere
I just performed a clean install of EE onto a local virtual host, and having checked the installation by successfully logging into the CP, followed that up by bringing into play the MasterConfig files. I copied those over from my last project since I had them modified from the basic FocusLab files (lots of config-variables added in, extra commented headers for my own reference, etc). I had used these same files to switch another project over to MasterConfig system just a few days ago, with no problem.

So I updated the system folder location in my webroot index.php and admin.php files, as normal, made sure all the folders were in the correct locations, and checked that all was okay by going to log into the CP. And got the response **'Unable to load the following extension file: ext.republic\_variables.php'**. Now, the project that these MasterConfig files were grabbed from *did* use Republic Variables. And since this is a virgin install, of course those extension files are not present. But since the only change between the successful CP login and the failed one was the introduction of the MasterConfig files (and some folder moving), I have to conclude that somewhere in the MasterConfig files there must be a reference to Republic Variables. But I absolutely cannot find it anywhere. Does anyone have any ideas what code in MasterConfig might be causing this?

Thanks.

# Answer
> 0 votes
It's more likely to be that RV has not been uninstalled before moving the database (ie, it has a couple of rows in exp\_extensions table that need to be deleted manually).

It also has a handful of its own tables that will need deleting.

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


# Question
Title: Creating an Entry-Specific Comments RSS Feed
My client wants an RSS feed link near her comments form so users can subscribe to comments, which would update whenever someone posts a new comment. It's been quite a while since I've done something like this, so I'm kind of drawing a blank here.

I thought initially I could simply pull in the entry\_id into the channel entries, but then I realized that I'm not using the channel entry\_id in the URL (using title path), so where does it pull the entry info from to know for which post the comments should be displayed?

Is this just a case of using dynamic="on" (or "yes" or whatever we're calling it these days)?

Thoughts? Help? Pointing and laughing? :) I appreciate any insight here. Thanks!

* Sorry for all my fumbling in here, I've not posted much here before. :)

# Answer
Did that solve it for you Joelle? You can also pass in the entry\_id as a parameter such as:

```
{exp:comment:entries entry_id="{entry_id}" }
   ...
{/exp:comment:entries}

```
> 0 votes

---
Tags: comments, rss
---


# Question
Title: Change file upload size units from bytes to kilobytes?
A client has a request that the file size units in upload preferences be changed to a more familiar unit of KB (Kilobytes). It does make sense to me as well, as most operating systems display the file size as the same.

Is this configurable?

# Answer
> 1 votes
Don't think that's possible either.. ? I always just let Google figure it out for me; Google Math. It's an extra step but manageable I think.

---
Tags: config-overrides
---


# Question
Title: Cart throb not emptying cart after successful checkout
I am running EE 2.5.5 the CT 2.2.9 (latest version).

I have been alerted by my client that when visitors are checking out, the basket is not emptying. This causes problems if a user then tries to checkout again, as the previous product can be sold out and still tries to checkout with it.

I can't see any setting for this in the cp. Anyone seeing or have seen a similar issue?

Thanks

# Answer
You can add the **Clear Cart** tag to your checkout workflow to force the cart to empty.

```
{exp:cartthrob:clear_cart return="cart/home"}

```
> 1 votes

# Answer
I experienced something like this at one point - if the administrator "successful order" email does not get sent, the basket does not get cleared properly - there's sort of an order of operations behind the scenes in CartThrob, each triggering the next action. Are your administrator email notifications being sent and received when a customer goes through the checkout? Once I got the admin emails working, the checkout clearing was fixed at the same time in my case.
> 0 votes

---
Tags: cartthrob
---


title: Top 20 sales with overrides

text:
# Question
Title: Top 20 sales with overrides
I'm building an ecommerce site with Cartthrob where I need to produce a feature for the home page which lists the top 20 sales. This would be simple enough but the client wants to be able to override this and bump up other tracks on the top sellers board from time to time.

With this in mind instead of simply outputting the top 20 sellers at the template level with a simple database query I now have to pull them into the control panel to allow for doctoring before displaying them in the templates.

Can anyone suggest the best way to go about this?

# Answer
> 0 votes
Side-stepping the obviously-unethical practice of lying to customers about what is indeed a "top-seller" (maybe consider renaming this list "hot tracks" or something less deceitful?) ...

To avoid having to build a module and control panel for it, I'd use something like Low Variables with a Matrix field, allow your client to select a "sales position" (first column) and a product (channel entry selection - second column) for each row.

Then, in a simple plugin you can query the top sales from CartThrob, then query the data saved by that variable (in the `exp_matrix_data` table) and bump any actual sales positions out of their place with you fraudulent sales data if need be.

# Answer
> 0 votes
You could use Low Variables with a Playa field. Let the client choose a list of X products. Add some other variable like a checkbox to switch the automated list or theirs.

Downside is you need to buy extra add-ons ...

Oh, also NSM Entry Select could help. Which is free. Same basic setup, create a custom field type which allows the client to pick entries from the products channel. You'd need to put these fields somewhere though, Low Variables would be a good help.

-- Or what Derek said ;)

---
Tags: cartthrob
---


# Question
Title: ExpressionEngine 1 - Fieldtype to select members
My client has an old site that is using EE 1.6.8. They need to be able to select multiple members from a list to display member field information about them. Before I went and created something using queries, I thought I would ask and see if anyone knew of an existing fieldtype of such thing.

The entry template would be pretty simple. Just a simple copy field with a gallery of employee photos. Only some of the employees will be listed though.

Thanks in advance.

# Answer
http://devot-ee.com/add-ons/vz-members may help you out - it's a fieldtype for selecting one or members
> 1 votes

---
Tags: members, ee1, fieldtype
---


title: Strange Stash Problem When Embedding

text:
# Question
Title: Strange Stash Problem When Embedding
My Stash template has the following:

```
{if "{member_images:total_rows}" == 0}
    {!-- No images uploaded. Display placeholder as avatar. --}
    <img class="img-polaroid" src="http://placehold.it/133x100/" alt="No image uploaded"/>
{/if}
{if "{member_images:total_rows}" == 1}
    {!-- Only one image uploaded. Display that image as avatar. --}
    {member_images}
        <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
    {/member_images}
{/if}
{if "{member_images:total_rows}" > 1}
    {if "{member_images:total_rows search:default="y"}" == 0}
        {!-- Multiple images upload, but none defined as default. Display first image as avatar. --}
        {member_images limit="1"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}
    {/if}
    {if "{member_images:total_rows search:default="y"}" == 1}
        {!-- Multiple images upload, and one defined as default. Display that image as avatar. --}
        {member_images search:default="y"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}
    {/if}
{/if}

```

This works fine. However, since I need this in different parts of my site, I figured I'd pull it out into its own stash template and just try to embed it where ever it's needed, like this:

```
{stash:embed name="common:.avatar" process="start"}

```

The problem is when I do this, nothing is outputted. When I enabled template debugging, I see the following error:

```
Parse error: syntax error, unexpected T_STRING in /home/devserver/public_html/system/expressionengine/libraries/Functions.php(683) : eval()'d code on line 12

```

I have no problems embedding other stash templates. Any ideas what might be wrong?

**UPDATE 1:**

The culprit seems to be the nested if block, particularly the if-conditions (e.g. `{if "{member_images:total_rows search:default="y"}" == 0}`. The if-condition contains a tag that must first be parsed? I'm guessing this might have something to do with parsing order, etc.?

**UPDATE 2:**

Currently using this code now. Incorporated `elseif`, single quote wraps tag when tag has double quote, etc.

```
{if "{member_images:total_rows}" == 0}
    {!-- No images uploaded. Display placeholder as avatar. --}
    <img class="img-polaroid" src="http://placehold.it/133x100/&text=No Image" alt="No Image"/>
{if:elseif "{member_images:total_rows}" == 1}
    {!-- Only one image uploaded. Display that image as avatar. --}
    {member_images}
        <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
    {/member_images}
{if:elseif "{member_images:total_rows}" > 1}
    {if '{member_images:total_rows search:default="y"}' == 0}
        {!-- Multiple images uploaded, but none defined as default. Display first image as avatar. --}
        {member_images limit="1"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}
    {if:elseif '{member_images:total_rows search:default="y"}' == 1}
        {!-- Multiple images uploaded, and one defined as default. Display that image as avatar. --}
        {member_images search:default="y"}
            <img class="img-polaroid" src="{member_image:133x100}" alt="{caption}"/>
        {/member_images}
    {/if}
{/if}

```

# Answer
This is one of those questions where an enormous amount of good information has been posted by an expert - in this case the designer of the plugin/s in question.

Given that the solution suggested involves simplification of the original design, and as the conversation's then gone quiet, I am going to follow a tweeted idea to make our StackExchange 'unanswered' space more actionable, and suggest that there's an answer, within the main comment thread.
> 2 votes

---
Tags: templates, stash
---


# Question
Title: How do Expression Engine plug-ins query and return data when the 'dynamic=' parameter is set to "no"?
When I return "entry\_id" from my plug-in, I do not want to fetch the "entry\_id" of enclosing parent tags.

Channel entries tag does this. How does it work? Thanks.

# Answer
? check if parameter dynamic="no" exist. If is not exist or dynamic="yes" then parse the URL try to find information which can be used as parameters for your plugin. If dynamic="no" just ignore URL and parser tag parameters only.

That all. If is not what you expected - please rephrase you question.
> 1 votes

---
Tags: plugin, dynamic, parameters
---


# Question
Title: error_handling="inline" not working in exp:resso store
I have to switch off error handling and use the less than ideal EE native error handling page. I get the following error message when I try to use error\_handling="inline"

Fatal error: Call to undefined method EE\_Core::generate\_page() in …./store/mod.store.php on line 784

EE version: 2.1.3 Build 20101220 Store version: 1.6.3

I'm using the example template, which comes with Exp:resso Store. All other aspects of the Store module work perfectly, it's just the error\_handling which doesn't.

Thanks for any assistance/advice!

# Answer
Store doesn't support ExpressionEngine 2.1.3.

You will need to upgrade to at least ExpressionEngine 2.2.0 - though preferably the most recent version. It's a good idea to keep software on an e-commerce website (where security is critical) up to date.
> 2 votes

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


# Question
Title: Image upload thumbnail error for one upload directory but not another
There are similar questions on this site but both seem to be Windows related. This is Ubuntu 12.04.

On EE 2.5.1, I have two upload directories configured:

```
$config['upload_preferences'] =
  array(
   1 => array(
    'name'        => 'Article Images',
    'server_path' => '/var/www/myhost/files/article_images/',
    'url'         => 'http://myhost/files/article_images/',
    'properties'  => 'style="border: 0;" alt="image"'
   ),
   2 => array(
    'name'        => 'Image of the Week',
    'server_path' => '/var/www/myhost/files/image_of_week/',
    'url'         => 'http://myhost/files/image_of_week/',
    'properties'  => 'style="border: 0; width:160px;" alt="image"'
   )
  )

```

I can upload images to directory 2 but when I upload to directory 1 I get the message, `"Thumbnail could not be created for the image. Please make sure the thumbnail directory is writable"`.

For starters, the directories are identical:

```
[myuser@ubuntu:/var/www/myhost/files]$ ll article_images/
total 20012
drwxrwxrwx 4 myuser mygroup      12288 Mar 26 10:12 ./
drwxrwxrwx 6 myuser mygroup       4096 Mar 25 23:33 ../
... more files
drwxrwxrwx 2 myuser mygroup   20480 Mar 21 14:26 _thumbs/

```

and

```
[myuser@ubuntu:/var/www/myhost/files]$ ll image_of_week/
total 340
drwxrwxrwx 3 myuser mygroup   4096 Mar 26 10:19 ./
drwxrwxrwx 6 myuser mygroup   4096 Mar 25 23:33 ../
... more files
drwxrwxrwx 2 myuser mygroup   4096 Mar 26 10:19 _thumbs/

```

Details are obfuscated but I can assure you user/group ownership is identical and in any case all permissions are set to 777.

I've tested with the same jpeg image, it uploads fine in "image of week" but fails in "article images".

I have tested the EE server wizard and all requirements show Supported: yes.

php.ini shows `memory_limit = 128M`.

I believe I've dealt with every suggestion offered on the other similar questions on this site. What am I missing? Something obviously wrong in my file upload preferences?

# Answer
> 1 votes
Also, are you able to synchronise upload directories without any problems?

This error can also be related to image manipulations, check permissions on the \_preview folder.

---
Tags: file-uploads, error, file-manager
---


title: Exp:resso Store issue with index.php

text:
# Question
Title: Exp:resso Store issue with index.php
So I have this website I put together. Everything works fine, except 1 tiny weird issue.

Whenever the URL does **NOT** have /index.php/ in it. All the Store buttons just refresh the page and do not work properly. Add to cart fails, checkout fails, any Store generated button just plain fails and only refreshes the page.

Does anyone know of this issue? Or how to fix it?

# Answer
Ah, i figured it out. This website was upgraded from a ZENcart installation. I never updated the .htaccess file. I just replaced it with ...

```
<IfModule mod_rewrite.c>
    RewriteEngine On

    # Removes index.php from ExpressionEngine URLs
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

and it seems to have solved the issue.
> 1 votes

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


# Question
Title: Why has Fieldtypes disappeared in CP menu?
Why would the Fieldtypes option under Add-ons not be available in the CP in EE 2.1.1?

I've inherited a site, so have no knowledge of a broken update or other such cause. Matrix seems to be properly installed, is working on the entry page and the site is populating the content properly.

Has anyone seen this before?

Thanks very much, Doug

# Answer
To follow up:

Although I had super admin access, permissions/access was limited.

Lessons learned - 1) be aware of sites with multiple super admin groups, and, 2) develop your sites in such a way that a new dev can quickly get up to speed with your implementation.
> 1 votes

---
Tags: control-panel, fieldtype
---


# Question
Title: LV, Matrix fieldtype with an Assets fieldtype in column
I have a Low Variable with a Matrix field type. Inside one of the columns I have an Assets field type.

Seems to work on and off. I could load my template, image is displayed. I could refresh the template, I get a 0.

I've tried numerous template tags but I'm not confident its fixed.

```
{exp:low_variables:parse var="lv_sidebar_adblock_image"}
<li class="widget"><a href="{link}"><img src="{image:url}"/></a></li>
{/exp:low_variables:parse}

```

I've also tried this:

```
{exp:low_variables:parse var="lv_sidebar_adblock_image"}
<li class="widget"><a href="{link}"><img src="{image}"/></a></li>
{/exp:low_variables:parse}

```

'image' and 'link' are my Matrix column names. 'image' is the Assets field type.

# Answer
```
{exp:low_variables:parse var="lv_sidebar_adblock_image"}
<li class="widget"><a href="{link}"><img src="{image:url}"/></a></li>
{/exp:low_variables:parse}

```
> 0 votes

---
Tags: assets, matrix, low-variables
---


# Question
Title: Playa tag ignoring child_ids parameter and Low Events parameter
I'm trying to use Low Events in conjunction with a Playa primary tag pair to exclude expired entries from showing up on the site. This is the code I think should work:

```
{exp:channel:entries channel="home" show_expired="no" limit="1" disable="categories|member_data|pagination|trackbacks" rdf="off"}
    {exp:low_events:entry_ids channel="events" show_passed="no"}{low_events:entry_ids}
      {cf-home-events show_future_entries="yes" limit="3" child_ids="{low_events:entry_ids}"}
        {title}
      {/cf-home-events}
    {/exp:low_events:entry_ids}
{/exp:channel:entries}

```

The primary issue is the Playa primary tag pair is ignoring the show\_passed="no" parameter from the low\_events tag. I think the issue has something to do with the Playa tag's "child\_ids" parameter because it is not parsing the correct info. For example, the "{low\_events:entry\_ids}" field outside of the Playa tags excludes passed events. But the "child\_ids="{low\_events:entry\_ids}"" ignores that completely. I tried manually inputting the entry ids into the "child\_ids" parameter, but it ignored that too, outputting the same values as before.

Any ideas as to why Playa would be ignoring the Low Events parameter? Or why it would be ignoring the "child\_ids" tag parameter?

FYI: Playa 4.3.3 running on Expression Engine 2.5.3. Low Events is version 1.1.1.

# Answer
Have you tried substituting `show_passed="no"` with `show_expired="no"` in your Low Events tag? This will apply to the *entry's* expiration date and not the show end event.
> 1 votes

---
Tags: playa, low-variables
---


title: Inline coupon validation

text:
# Question
Title: Inline coupon validation
I was wondering if anyone had already setup some inline coupon validation script that I could use on my order pages - something I could hook up with AJAX upon the user filling out the coupon form where it then queries the database and tells me if this coupon is valid and not used. If this is already available, that would be great! If not, just let me know and I suppose I'll create one myself.

Thanks!

# Answer
> 2 votes
Store handles validation of the coupon code with it's {promo\_code} tag by default. If you wanted to throw in a little AJAX that should be fairly straight forward although not something that can come pre-made as such as each form will be different. If you're using jQuery then I'd recommend this plugin and then just bind it to your form and promo filed to capture the response provided by Store on coupon validation. Then output that to the page. The plugin comes with plenty of useful examples with AJAX calls included and it should as close to a drop-in as possible once you've changed your DOM selectors to match your form and field.

---
Tags: expresso-store
---


# Question
Title: if:else not working with my matrix tag pair
Maybe I am a moron, but i just can't get this to work. Iv anyone can help me... please do so before i start hurting myself... :p I'm working with EE 2.5.5 and Matrix 2.5.2.

I've got a channel called "**events**". A matrix field assigned to "events" called "**dates**" (minimum rows = 0). "Dates" has 3 colums, a date column called 'date', a text column called 'city' and a P&T Switch called 'confirmed'.

Each entry has either no date (=no row), one date oder multiple dates. Each 'date' can of course be „in the future“ or „in the past“ since past events don't get deleted.

I'm trying to put out a list of all entries in this channel and ONE date (if conditions are met).

1. If there is no date specified (=no row) in the matrix field: "**no date specified**"
2. If there ARE entries for dates:
case 1: in the future, i need **the next upcoming date**
case 2: all dates in the past, i need "**no date specified**" again

I have tried everything i can think of but it seems i am not able to use if:else between my matrix tags...

**My approach:** Getting entries with no date is easy.

```
{if dates}
   do something...
{if:else}
   no dates found
{/if}

```

So far, so good. But when i try to do

```
    {if dates}
       {dates search:date=">{current_time}" sort="asc" limit="1"}
          {if date}
             {date format="%d.%m.%Y"} <!-- outputs next upcoming date if there is one -->
          {if:else}
             no date specified <!-- THIS does not work. Should get triggered when there
ARE rows in "dates" but all "date"-values are < current_time =  already happened,  -->
          {/if}
       {/dates}
    {if:else}
       no date specified <!-- no row -->
    {/if}

```

Any suggestions? I've spent 4 hours trying everything i could think of... still getting nowhere....

# Answer
This will most likely be to do with parse order. Because you're using advanced conditionals they will be parsed late on and probably evaluated after Matrix conditionals are processed.

Give it a try with simple conditionals by just using {if} statements. So:

```
{if dates != ""}
   do something
{/if}
{if dates == ""}
   no dates found
{/if}

```

(Depending on what type of data is returned from dates you may need to experiment with your conditional checking. It could return a boolean for instance rather than a string)

The same applies to your nested if statement. Apply the same principle.

The above will be processed much earlier in the parse order and that will most likely make the difference.

Let me know what the outcome of that is.
> 2 votes

# Answer
The search: parameter mimics the EE search parameter. That means it only searches Text Input, Textarea, and Drop-down fields (\[search: parameter\])

I see here that you're trying to search on a date type column. It sounds like that may be the core problem. If you run a few of these as plain tests against one of the supported fields, do you get more expected results?
> 0 votes

---
Tags: matrix, ifelse
---


# Question
Title: How do I strip spaces from a form field?
I have a strange issue with URLs double encoding. So for instance if I have a URL with spaces, instead of the site navigating to "url%20name" it instead navigates to "url%2520name."

I'm looking at how to rewrite .htaccess to fix this but I feel like the best practice would be to strip the spaces out of the data coming from the safecracker form field.

My code is

```
   <label for="story_author">Author*</label><br>
    {field:story_author}<br>

```

What could I add to that to strip out the spaces in the output?

# Answer
You could either turn on PHP in your templates and use regular PHP:

```
trim({field:story_author})

```

Or you could use a small plugin and keep PHP out of your templates. TextTrimmer will strip out whitespace and is just $3. Either solution should work depending on which you feel more comfortable with.
> 1 votes

---
Tags: safecracker, forms, url, character-encoding
---


# Question
Title: Issues when putting system outside web root
Following 'best practice' of putting the EE system directory outside of the web root I have found that I now have a problem with password reset links.

It seems the reset url sent in the emails when a user forgets their password is incorrect. All other aspects seem, so far, to be working OK.

For instance, my system is located at ../mysystem and specified as such in the config. To access the control panel I would use the URL http://mysite.com/**mysystem.php** which works fine.

However the link sent in password reset emails is, for example, http://mysite.com/**mysystem**/index.php?D=cp&C=login&M=reset\_password&id=ABC123HASH

Is there somewhere I can configure this reset url?

# Answer
The {reset\_url} will be looking towards the site's index page as set in Admin \> General Configuration \> name of your site's index page. Is this set?
> 1 votes

# Answer
The problem was that in my config file I had actually set the cp\_url incorrectly.

I am a bad person!
> 1 votes

---
Tags: security, system, filesystem, forgot-password
---


# Question
Title: Can I use a 'Select' Statement in my EE 2.5 template
I am trying to use a SELECT statement to call in some information.

CODE: $qry = $this-\>EE-\>db-\>query('SELECT col\_id\_1, col\_id\_2, col\_id\_3 FROM exp\_matrix\_data');

I get this error when I try to use the data:

A PHP Error was encountered Severity: Warning Message: mysql\_num\_rows() expects parameter 1 to be resource, string given Filename: libraries/Functions.php(680) : eval()'d code Line Number: 1552

So... my question is, Can I not use the 'SELECT Statement' like this in EE ?

# Answer
You would need to either turn on PHP for the template and then use that to create a query like you did, or go the much easier route an just use the Query Module included with ExpressionEngine (unless you are using Core).

With the Query Module your statement would look like

```
{exp:query sql="SELECT col_id_1, col_id_2, col_id_3 FROM exp_matrix_data"}
   {my_fields}
{/exp:query}

```

Remember to add limits and sorts as needed. You can learn more about the Query Module in the **User Guide**.
> 2 votes

---
Tags: ee2, query
---


title: Exp-resso Store how to set language

text:
# Question
Title: Exp-resso Store how to set language
Is there a way to set the default language to Dutch on the front-end of Store? I can't see it in the CP.

Right now I'm getting partial translated Errors when leaving required fields blank. Like: "The Naam field is required" Where "Naam" is the dutch translation.

Is Store looking on OS or browser lang settings?

I hope I can set it so it's always Dutch.

Tnx, Martijn

# Answer
You will want to download the Dutch language pack for both Store & EE. Then in the Super Admin account you will want to set Dutch as the language that EE uses and make sure that members prefs control the site. From there Store should use Dutch in the CP and for error messages.

Another thing to mention that if you are using inline\_error handling you can create custom error messages in your template instead of using the default store messages.

For example lets say you have a form that has

```
{field:billing_name} {error:billing_name}

```

This would show the default Store error message if the user did not fill it out. If you change it to something along the lines of

```
{field:billing_name}
{if error:billing_name}
Whoa buddy! We can't sell you something without knowing your name.
{/if}

```

You can change the message that is shown to the user.
> 1 votes

# Answer
Exp-resso store uses the same default language Expression Engine does.

Check: https://github.com/expressodev/store-language for available languages.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: Trigger set_flashdata when method called via ajax
Is there any way to use `$this->EE->session->set_flashdata();` when calling a method via ajax without having to do a page reload to get the message to appear as it normally would under a non-ajax situation?

I tried and the message shows up after the next page load which of course isn't ideal.

I read a few posts over at SO that said it requires the page reload though, just wanted to double check to make sure it was in fact *not* possible to trigger the message via an ajax request without the load.

Thanks!

# Answer
Yes, it's possible (assuming you're talking about triggering the ExpressionEngine status message in the control panel, not generically setting flash data from an AJAX request).

I had this same question a few days ago - I know for example the CP template manager triggers the success message at the top of the page from an AJAX request, so I went trawling through the (minified) EE javascript source to find out how it works. Turns out there is a handy JS function you can call to trigger that CP status message.

Remember, it's nothing to do with flashdata at this point, you simply need to return a message from your AJAX script, then use javascript to display that message to the user at the top of the page. In your PHP script, you would put something like this:

```
if ($this->EE->input->is_ajax_request()) {
    return $this->EE->output->send_ajax_response(array(
        'type' => 'success', // or 'error'
        'message' => lang('settings_updated'),
    ));
}

```

Then, in your javascript AJAX call, get the response data and display it to the user using ExpressionEngine's secret `$.ee_notice` function:

```
$.post(url, data, function(response) {
    $.ee_notice(response.message, {type: response.type});
});

```

Easy once you know how, right :)

**UPDATE:** It looks like this has actually documented now. I swear it wasn't there last time I read the docs: http://ellislab.com/expressionengine/user-guide/development/cp\_javascript/notification.html
> 3 votes

# Answer
Assuming you're calling the method via Ajax dataType html, you can get the return html which will be the entire CP html include the message, e.g.:

```
function submitForm($form) {
    //###   Send form via AJAX   ###
    $.ajax({
        type: "POST",
        data: $form.serialize(),
        dataType: "html",
        url: $form.attr("action"),
        cache: false,
        success: function (html) {
            $("#footer").after(getMessage(html));
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            //###   Error occurred, could be server, CMS or 404   ###
            $form.find("[type='submit']").fadeTo("slow", 1).removeAttr("disabled").removeClass("disabled")
                .addClass('error')
                .after('<label class="error" generated="true">'+textStatus+'</label>');
        }
    });
} //###   End of submitForm function   ###

```

This could probably be simplified to:

```
$(this).click( function(e) {
    var url = $(this.form).attr('action');
    var data = $(this.form).serialize();
    $.post(url, data, function() {
        $("#footer").after(getMessage(html));
    });
    e.preventDefault();
});

```

In the EE Admin the #notice\_container div contains the message(s) and appears after the #footer div in the DOM.

Handy JQuery function to get the div and content (as opposed to just innerHTML):

```
jQuery.fn.outerHTML = function() {
  return jQuery('<div />').append(this.eq(0).clone()).html();
};

```

Source: https://stackoverflow.com/questions/3614212/jquery-get-html-of-a-whole-element

Then you'll need the code to rip the message from the return html:

```
function getMessage(html_string) {
    var $html = $('<div>',{html:html_string}).hide().appendTo('body');
    $message_div = $html.find('#notice_container').outerHTML();
    $html.remove();
    return $message_div;
}

```

Hopefully this should then place the message and message html elements into your page - the next problem is it's probably hidden via CSS, if so, show it via JS.

And finally there's no JS code attached to it. So have a scan of the Control Panel code looking for triggers on #notice\_counts, .notice\_success, .notice\_alert, .notice\_error & .notice\_info and either re-intialise or duplicate the functionality (open and close slider - the remove is in-line JS so no need to worry).

All the above is theory, so not tested but will hopefully help!
> 1 votes

---
Tags: ee2, add-on-development, ajax, sessions
---


# Question
Title: SSL certificate on https://secure.domainname.com
**my problem:** If I attempt to access a https template through expression engine, I get a **blank screen**:

```
https://secure.domainname.com/anyTemplateGroup/anyTemplate

```

**Solved by host** (finally found this on their website, their support desk never mentioned it!)

> https://secure.domainname.com You can use a different prefix, eg "www." or "store."

Solution: I will get host to change prefix to www.

Thanks everyone!

---

Just in case anyone comes across this problem, here are some details of what was going on:

**FACT 1**: The EE site url is as follows, and I can access all my templates like a normal site.

```
http://www.domainname.com

```

**FACT 2**: I have an SSL certificate installed and my host provides access using **https and a prefix**, but 'secure' is not a subdomain, it just points to files in the same path as http://www.domainname.com:

```
https://secure.domainname.com

```

**FACT 3:** Within the site I have a few forms that I'd like to make secure using SSL such as:

```
http://www.domainname.com/login

```

**FACT 4:** But with my host the above URL needs to be:

```
https://secure.domainname.com/login

```

**FACT 5:** Im using Focus Lab, LLC Master Config, so my config file reads as:

```
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://';
$base_url = $protocol . $_SERVER['HTTP_HOST'];
$env_config['base_url'] = $base_url . '/';
$env_config['site_url'] = $env_config['base_url'];

```

**FACT/CLUE 6:** If I disable EE's htaccess in the root off the www folder, I can launch a test file located at www/test/phpinfo.php as, *but this is not what I want, as this is not an EE page, just something created in dreamweaver*:

```
https://secure.domainname.com.au/test/phpinfo.php

```

**FACT/CLUE 7:** With htaccess enabled again I cannot access the above file (I get blank screen), but I can access it via:

```
http://www.domainname.com/test/phpinfo.php

```

---

**POSSIBLE CAUSE OF ISSUE** I looked at changing values in the config and htaccess, but nothing has given me access to the EE template via https. **The main problem appears to be with the prefix *secure*** Other users of EE + https do not appear to have the 'secure' prefix as part of URL, but someone must know how to overcome.

Thanks, Lloyd

# Answer
Is https://secure.domainname.com the actual place where EE is installed? You'll need to install it in this 'secure' subdirectory and ensure that all paths within the system are correctly pointing to this location on the server.
> 3 votes

---
Tags: htaccess, ssl
---


title: DST vs Datagrab

text:
# Question
Title: DST vs Datagrab
I'm importing a feed (of evens) with Datagrab, and using it to list them on my site. I have the event-date connected to the entry-date, "and all was well with the world". Right, so now DST-switch is coming up, and all events that are before the switch are appearing fine, but all events after (for example one on April 6th 00:00) is now appearing as April 6th 23:00. Now this particular example isn't really a problem, but you can imagine this becoming a problem with times near 01:00AM (which would switch to the day before). Is there any way to stop this behavior?

Thanks,

* Steven

# Answer
I believe you can turn Daylight Savings Time off, under the General Administration -\> Localization preferences. If you set to 'no' no DST magic will happen. But I do believe this is a manual option, meaning when you need DST, you'll need to turn it back on.
> 1 votes

# Answer
The data in the feed is fixed so you can'r adjust it. One thought would be to try the http://devot-ee.com/add-ons/eevent-helper addon which lets you use a custom field for the event date(s), you could map the entry date to that field which should give you the "correct" time to play with.

It would mean adjusting your templates to use the addons date instead of the entry date, also new imports entry dates would be set to the time of the import.

Might be doable that way.
> -1 votes

---
Tags: ee2, datagrab, dst
---


# Question
Title: Populate Playa field from values of another field
I have a site that want to link blog posts to their author pages. Authors have their own entries in a staff channel. Currently they've just used a plain text select field which has had the options manually populated.

What they want to do is use a Playa field instead. So they want to dynamically update the Playa field based on the values of the plain select field.

So at the moment they've got:

`{blog_channel}: {author_custom_field} = "Author Name"` `{staff_channel}: {title} = "Author Name" {url_title} = "author-name"`

I need to write some SQL that will look at the value of the author\_custom\_field, check it against the staff\_channel to see if there's any open entries, and if there is, update a new author\_playa\_custom\_field with those values.

That will involve updating the relevant field\_id column in exp\_channel\_data with values like `[2256] [author-name] Author Name` but also update exp\_playa\_relationships with parent\_entry\_id, parent\_field\_id and child\_entry\_id.

Has anyone done something similar before?

# Answer
> 1 votes
I came up with what I needed if anyone's interested:

```
UPDATE exp_channel_data cd

INNER JOIN exp_channel_titles ct
  ON ct.title = cd.field_id_14
  AND ct.channel_id = 8
  AND ct.status = 'open'

SET cd.field_id_56 = CONCAT('[',ct.entry_id,'] [',ct.url_title,'] ',ct.title)

WHERE cd.channel_id = 2

```

followed by

```
INSERT INTO exp_playa_relationships (parent_entry_id, parent_field_id, parent_col_id, parent_row_id, parent_var_id, child_entry_id, rel_order)

SELECT cd.entry_id, 56, null, null, null, ct.entry_id, 0

FROM exp_channel_data cd

INNER JOIN exp_channel_titles ct
  ON ct.title = cd.field_id_14
  AND ct.channel_id = 8
  AND ct.status = 'open'

WHERE cd.channel_id = 2

```

---
Tags: playa
---


# Question
Title: Control Panel/MCP: Table class in older versions of EE2
Have there been any changes to the table class in EE2? I have a bug report on an add-on from a user with EE v2.3.1. They've received the following error in my mcp. file:

```
<b>Fatal error:</b> Call to undefined method CI_Table::set_columns()

```

My code looks like this, nothing looks amiss:

```
$this->EE->load->library('table');
$this->EE->table->set_columns(array(
    // column mappings
));

```

And things work fine in 2.5.5. Here's the EE documentation I relied on:

http://ellislab.com/expressionengine/user-guide/development/usage/table.html

Thanks for any insight you can offer!

# Answer
> 1 votes
I just checked, and the `EE_Table` class, as well as the `EE_Table::set_columns()` method were introduced in EE 2.4.0.

Before that, EE only included the default CodeIgniter (v2.0.1) table class.

---
Tags: control-panel, add-on-development, module, table, table-class
---


# Question
Title: How can I tell NavEE to ignore the category segment?
I am running into an issue with a custom NavEE, and I am hoping there is a simple fix for this that I am overlooking.

I have dynamic "secondary" navigation in the sidebar of this site. I want it to always show the nav items that are two and three levels deep. The nav for this site does not go deeper than three levels. Here is my code:

```
{exp:navee:custom
    nav_title="primary"
    wrap_type="ol"
    selected_class="is-current"
    selected_class_on_parents="true"
    parent_selected_class="is-current"
    start_nav_from_parent="true"
    start_nav_from_parent_depth="1"
}
    <li class="nav__item">
        <a href="{link}" class="nav__link icn-arrow-right {class}">{text}</a>
        {if has_kids}<div class="nav nav--tertiary">{kids}</div>{/if}
    </li>
{/exp:navee:custom}

```

This configuration is working very well form me until I sort the contents of a page by category.

For example, I have a typical page: http://www.example.com/resources/faqs/ that allows users to click a link to sort the entries by categories. Let's say one of the categories is "Overview". The resulting page would be http://www.example.com/resources/faqs/category/overview. On this page, the dynamic navigation in the sidebar disappears, and I am assuming it's because a selected class is not being declared when I click a link to sort by category.

I hope I explained this well enough, and I would appreciate any insight into this issue.

ExpressionEngine v2.5.5
NavEE v2.2.6

# Answer
Use NavEE's **Regular Expression** field for the FAQs menu item. This tells NavEE to match an item as selected based on that rule (using `preg_match()`), rather than just matching the URL itself.

So in your case you could enter `/faqs/`.
> 3 votes

---
Tags: navigation, dynamic, navee
---


# Question
Title: Expresso Store : Add customer member fields to checkout process
Is it possible to have custom member fields added to the checkout process so when the customer is registered during checkout the custom member fields are saved?

I've tried adding the fields to my form (I copied the HTML from the /members/register page), but the values I enter are not saved during registration.

Thanks in advance for any help.

# Answer
It sure is. You just need to make sure you've mapped them to Store's order/custom order fields.

Create your custom member fields in Members \> Member Fields.

Then, in Store \> Settings \> Order fields make sure the fields are mapped up to the member fields. If they are custom fields then use order\_custom1-9. The right hand column is where you select which Member field (or Zoo Visitor field if you're using that addon) to map to.

Then include the appropriate fields in the Store checkout form: {order\_custom1} etc. Those will be saved upon submission and mapped to the member fields.
> 5 votes

---
Tags: expresso-store, members, checkout, register
---


# Question
Title: Adding a class to a particular para inside a text area
I'm looking for a way to let the client flag any given paragraph within a single text area field with a class so that it will appear with different styling. So say I have:

```
{exp:channel:entries channel="news" limit="1"}
  {myTextAreaField}
{/exp:channel:entries}

```

I would be hoping to get the output:

```
<p>First paragraph of content</p>
<p class="flagged">Second paragraph of content</p>
<p>Third paragraph of content</p>

```

I can think of numerous ways to do it using various plugins (Matrix, Hop Inject) but they all break the simple usability of just letting the client type their entry as a series of paragraphs in single text area field and flagging one of them. I'd prefer a less convoluted, native solution if I can find one, and I'd prefer to avoid using the the RTE if I can possibly avoid it.

Am I missing something really obvious? Or is the plugin route the only realistic solution?

# Answer
> 1 votes
You can do this using wygwam using a Custom Style Set. Doing this will allow your users to use the "style" drop down to add a class to a paragraph in the wygwam field.

# Answer
> 0 votes
Given that it sounds like you need the client to have the ability to flag any chunk they want, short of the client entering html, I'm not sure you can avoid the need to have a rows-based flagged/unflagged kind of setup for the client - Matrix being the obvious example. The usability of that solution is better than the alternative of having the client have to enter such flagging themselves in HTML. On the upside, they only need to create a new row for the instance of flagging. So a group of twelve paragraphs, only one of which requires flagging, would only require three rows in Matrix. The client ought to be able to understand that pretty easily, I would think.

---
Tags: channel-entries, markup
---


# Question
Title: Exp-resso Store & store_product_out_of_stock Dynamic Variable
I'm having an issue where customers can order items that are out of stock. Looking for a solution in the Store docs and here on EESE i've come across Dynamic Product Variables. Unfortunately, I can't get them working consistently. The issue appears to be getting the 'Limit Stock' checkbox to stay consistently checked in the corresponding product's entry in EE:

Anytime i check that box, then save the entry, and go directly to the front-end, the dynamic variable works as it should. If the given product combination (color + size) is out of stock, it shows the dynamic variable (store\_product\_out\_of\_stock). If i go to any other entry in EE, then check that box for that product, then go back to view the first product on the front end, the dynamic variable shows no matter what. Going back into the first entry in EE shows that the box has been un-checked! Is there some-sort of persistance issue with the checkbox? Is this even important or merely a coincidence?

I'm on EE 2.5.3 and Store 1.6.3.

Thanks in advance for any help.

# Answer
> 2 votes
The solution was to move the jquery call to the `head` of the page to initiate it prior to the store template tags

---
Tags: expresso-store
---


title: issue with {edit_date}

text:
# Question
Title: issue with {edit_date}
Ok, I have the following:

the edit\_date is stored in the exp\_channel\_titles table in the edit\_date field by default.

This is the value 20130320100306 (20/03/2013 10:03:06)

I tested the following tags within a ZooVisitor update form

```
{edit_date}

```

**output:** 08-01-1970

```
{edit_date format="%d-%m-%Y"}

```

**output:** 639874-06-14 00:25

```
{exp:low_nice_date date="{edit_date}" format="%d-%m-%Y"}

```

**output:** 14-06-1974

Running EE v2.5.3 - Build Date: 20120911

kind regards, Vic

# Answer
> 1 votes
This is because date formatting is not supported inside a Safecracker form. See also http://devot-ee.com/add-ons/support/zoo-visitor/viewthread/7449#25153

Cheers, Nico

# Answer
> 0 votes
I too had some issues with datepicker and formatting date in safecracker. This may be of further assistance: SAEF + Matrix + Date\_field + custom layout, datepicker not displaying

---
Tags: zoo-visitor, edit-date
---


# Question
Title: can I get individual MSM control panels to each use different colour theme?
I have two sites running on MSM at the moment, however it seems that sometimes the editors and authors get confused about which site they are currently on, is it possible to get each site control panel to make use of a different colour?

For instance, the main site can use the standard blue/pink, the second site would display with blue/green in order to stop any confusion.

# Answer
> 2 votes
MX MSM Themes \- simple ext. which helps to setup CP themes for sites with MSM

---
Tags: control-panel, multi-site-manager
---


# Question
Title: Upgraded site from EE1 to EE2 but data in exp_matrix_data missing
As the title says, I've upgraded a site from EE1 to EE2 but data that I can see exists for entries in exp\_matrix\_data table is missing from the publish page, i.e. there's rows in exp\_matrix\_data whose entry\_id column matches up with entries that should have matrix data, but when viewing the entry in the CP, Matrix says there's no rows yet.

Anyone come across that before?

# Answer
> 1 votes
I've found what the problem is. The is\_draft column was missing so I had to create it manually. All the legacy rows had their value for that column set to NULL instead of 0. Updating to 0 brings back the data.

I had a problem with is\_draft missing throwing a MySQL error but the previous time, I just clicked into the fieldtypes settings and it went away. This time it didn't do it which is why I created the column manually.

# Answer
> 0 votes
Is all matrix data missing? Can you add a new matrix row? Does the other data appear? If not, i suggest compare whats different with the exp\_matrix\_data rows. And check exp\_channel\_data, there will be a matrix field their too. And if you have copied in the database tables, have you enabled the matrix module, or installed the latest version.

---
Tags: matrix
---


# Question
Title: JavaScript tag striped out from templates when editing from Admin
I am running ExpressionEngine 2.5.3. Happens something weird: when I save a template from the admin panel, javascript tags in it gets transformed from `<script>` to `[removed]`. I have checked file permission, configuration etc, but I can't figure out why this happens.

# Answer
I've seen this happen when the server was doing some aggressive security stripping. Modifying the template via FTP didn't show the issue; only submitting via the CP. So I'd talk to your host about it; and also try via FTP and make sure that works as expected. :)
> 2 votes

# Answer
If it's full javascript, you're using the wrong template type. While the `web page` template type will handle references to javascript files, such as

```
<script type="text/javascript" src="/javascripts/modernizr.foundation.js"></script>
<script src="/javascripts/lib/selectivizr.js?1337120337" type="text/javascript"></script>

```

the javascript file-type is preferred for actual javascript. Read, 'Are There Limitations on ExpressionEngine's Javascript Handling?' question by Steve Hurst. The web page template doesn't always protect javascript, so it's frequently better to reference the script and store outside of EE or on the javascript file type. But another option, which may work is to modify the `config.php` file to add the hidden variable:

```
$config['protect_javascript'] = 'y';

```

ExpressionEngine has a number of, not needed frequently, but available for use variables, see Hidden Variables.

One of these should work, assuming there wasn't some odd bug in EE 2.5.3. Is there a reason you haven't updated to 2.5.5? You may also want to upgrade.
> 1 votes

---
Tags: templates, javascript
---


title: Different template for the same channel

text:
# Question
Title: Different template for the same channel
Fairly new to ExpressionEngine. I'll try to briefly summarize what I'm trying to achieve since I haven't found any answers as of yet, which have properly worked.

I have an image gallery template, with the images being shown by a channel loop. When one is clicked, instead of simply showing the image by itself (by a permalink, I presume) in the same template style, I'd like for it to be shown in a separate template, so for example the image could be seen shown in a larger size, along with whatever other info: caption, etc.

I've tried linking the images to {url\_title\_path='template\_group/template'} so that I could generate the same channel entry in another template - and it seemed to work, however all my images (besides the ones uploaded through the channel) were missing. Perhaps because I'm using relative image paths? I still don't know what image url method is best for ExpressionEngine.

On top of that, my {path='home'} link which is the url to my index didn't work anymore as well.

So what would be the best solution to linking the same channel entry to another template?

# Answer
What you need to use is {title\_permalink} and you'd pass in the template\_group/template that you want to link to to display your image. For instance:

```
{title_permalink="image/view"}

```

Where 'image' is your template group and 'view' is your template to display a single image. The URL will something like:

```
mydomain.com/index.php/image/view/image-name

```

'image-name' will be the title of your image entry.

For the second issue regarding your link to the home page, ensure that `home` is the name of your template group and that this template group is set as the default template group - indicated by the pink star next to it. This follows the same suit in being set to template\_group/template so if that doesn't work then include the index page:

```
{path="home/index}

```
> 1 votes

---
Tags: channel-entries, templates
---


# Question
Title: output nested categories plus channel entries
I'm scratching my head to find the best way to output a nested category list that contains channel entries for child cats...something like this

---

```
h1 Parent Category Name

    h2 Child Category Name 1
        Channel Entry 1 in Child Category
        Channel Entry 2 in Child Category
        More Channel Entries in category....

    h2 Child Category Name 2
        More Channel Entries in Child Category.....

 h1 Parent Category Name
     .....

```

---

I'm thinking the only way to get the job done would be stash or php, but the solutions I've found so far don't do seem to handle this kind of nested category setup

any ideas?

# Answer
Default category handling in EE can be limited so I'd highly recommend GWCode Categories. It's free, very versatile, and well documented. You could achieve your nested categories as simply as:

```
{exp:channel:entries channel="example" disable="categories|member_data|pagination"}
    <b>{title}</b><br />
    {exp:gwcode_categories entry_id="{entry_id}"}
        {group_heading}{cat_group_name}{/group_heading}
        {cat_name}
    {/exp:gwcode_categories}
{/exp:channel:entries}

```

Example here.
> 2 votes

# Answer
NSM Categories might be able to do what you need.
> 0 votes

---
Tags: categories
---


# Question
Title: Expresso Store : Checkout form based on payment method
I'm working on an implementation and I'm using the most current version of the Expresso Store plugin. So far everything is working great, only I'm having trouble getting the payment method form to show up based on the payment method selected.

Currently I'm using `{payment_method_options}` inside of a `{exp:store:checkout}` block. I have a select that correctly displays the payment options but I'm unsure how to tie that together with a credit card form (I've used the Credit Card Details section of the docs to build a checkout form),or say another payment method like PayPal.

Does anyone have a direction to point me in, or have an example implementation that I could examine?

EE v2.5.3 Store v1.6.3

# Answer
This depends on whether you're taking payment on-site or off-site (handing over to the payment gateway's servers to take the payment and then sending the users back to your site). If you're taking payments on your site then you really need to be PCI-DSS compliant which is no small feat. Personally I'd always look hand over to the payment gateway to keep things simple.

If you are sending over to the payment gateway then you wont need the card details form on your site. All you'd need to do is to set the payment\_method as the parameter on your store checkout tag along with a return URL.

You'd need to make sure that you've setup your chosen gateway in Store \> Settings \> Payment methods, first. Create the new gateway, ensure that it's enabled and then enter in your account credentials.

If you're allowing the user to select their payment method then that can be provided with a simple dropdown:

```
{field:payment_method}

```

Note, that you'll need to setup the payment methods in Store Settings first to see them appear in this dropdown.
> 2 votes

---
Tags: expresso-store
---


title: Exp:resso Store Cart date

text:
# Question
Title: Exp:resso Store Cart date
How can I get the date when the cart was last modified?

I am doing some AJAX stuff and I want to use the date string as a cache buster.

# Answer
> 1 votes
There's nothing in terms of template tags that will output modified date-time to grab on to as far as I know but there is a useful hook (store\_cart\_update\_end) provided which will give you something to work with to grab the current date and time and output that to the template file (hidden). This will give you something to grab hold of client-side with AJAX.

---
Tags: expresso-store, ajax
---


title: Exp:resso Store and PayPal Express

text:
# Question
Title: Exp:resso Store and PayPal Express
I'm thinking of using Exp:resso Store for my client's site, and I'm thinking of using PayPal Express Checkout as the payment gateway. Can anyone please shed some light on how these two work together?

Where do I enter my API Signature so Store can connect to PayPal?

What details do I have to send to PayPal?

Do users have to log in to a PayPal account before they can confirm their purchase?

Thanks in advance, sorry for being clueless!

# Answer
Paypal Express is fully supported by Store. Once you have Store installed you'll see it in the main menu in the EE control panel.

Go to Store \> Settings \> Payment methods and then "Add Payment Method". From the "Payment Plugin" dropdown select "Paypal Express". You'll then be asked for your username, password, and signature, etc.

In terms of details you need to send to paypal, that will all be handled by Store in the checkout process. If will pass on the fields included in exp:store:checkout so it's all done for you in that respect.

I think Paypal Express *does* require the user to have a Paypal account but I think there is a way around it.
> 1 votes

---
Tags: expresso-store, paypal, payment-gateway, paypal-express-checkout
---


# Question
Title: Exp-resso Store: Shipping Country Options
How can I grab store's shipping country options in a template without a store tag? I would like to use them in a custom signup form.

# Answer
> 3 votes
Store wont support that natively as far as I know but I'd personally look to use Stash to set a variable and then call it either elsewhere in that template or carry across to other templates.

Setting the variable is as pretty much as simple as `{exp:stash:set}` giving it a name and setting a few specific options, and then calling it with `{exp:stash:get}`. It's incredibly versatile.

**Example:**

```
{exp:store:checkout}
    ...

    {!-- Set the variable --}
    {exp:stash:set name="shipping_methods" save="yes"}{field:shipping_method}{/exp:stash:set}

    ...
{/exp:store:checkout}

{!-- Get the variable outside of the Store tags --}
{exp:stash:get name="shipping_methods"}

```

**EDIT:** Updated example to include save="yes" to demonstrate how to carry variable through to other template files.

# Answer
> 2 votes
You can also use the Query Module to grab the available regions are.

```
<select>
{exp:query sql="SELECT * FROM exp_store_regions WHERE site_id = '1' GROUP BY country_code"}
<option value="{region_code}">
 {region_name}
</option>
{/exp:query}
</select>

```

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


# Question
Title: Updating from MX Universal Editor to Assets
I'm trying to upgrade an EE1 site that was using MX Universal Editor as it's file manager to use Assets 2 instead.

At the moment I'm dealing with Matrix fields that have values like /folder/subfolder/subsubfolder/filename.jpg in exp\_matrix\_data

If I change the column fieldtype to the native file manager, nothing shows up because the image isn't in the root level of the file upload directory, it's in a subfolder of that directory which is why I used the Universal Editor in the first place and why I want to change to Assets now.

If I change to Assets, again nothing shows up. If I click to browse files and add a file, the file is added succesfully, but if I then save the entry, all the other matrix rows that I haven't updated yet have their data wiped from the db.

After updating the entry by adding my own image with the Assets fieldtype, the value that ends up in db looks like filename.jpg but if I manually update the value to remove /folder/subfolder/subsubfolder/ and then check the entry, still nothing shows up. So is there some other piece of the puzzle missing?

I've got several hundred entries all with a handful of images each so I want to find an automatic way of updating all the entries to use Assets successfully.

# Answer
Assets doesn't do its business in the `exp_matrix_data` or `exp_channel_data` tables. It uses its own `exp_assets_selections` table, where it references a `file_id` (entry in `exp_assets_files`), then `entry_id` and other relevant columns. That's the table you'll need to populate.

So for each file in a Matrix:

1. Grab the relevant entry ID, field ID, col ID and row ID.
2. Extract the file name and find the ID of that file in `exp_assets_files`.
3. Enter that data in `exp_assets_selections`.
> 0 votes

# Answer
Turns out it wasn't that hard after all. Here's the query if anyone's interested:

```
INSERT INTO exp_assets_selections (file_id, entry_id, field_id, col_id, row_id)
SELECT af.file_id, md.entry_id, 60, 5, md.row_id
FROM exp_matrix_data md
INNER JOIN exp_assets_files af
  WHERE INSTR(md.col_id_5, af.file_name) > 0

```
> 1 votes

---
Tags: assets
---


# Question
Title: Keep Getting Logged Out of Control Panel
I keep getting logged out of the control panel while I'm working in it.

Under *Admin \> Security & Privacy \> Security and Session Preferences*, I have:

* **Control Panel Session Type:** Cookies & Session ID
* **Require IP Address and User Agent for Login?**: Yes

I tried clearing my cookies - didn't work.

I tried setting *Require IP Address and User Agent for Login?* to "no" - didn't work.

I tried setting *Control Panel Session Type* to "cookies only" - didn't work.

What else should I try?

EE 2.5.5

# Answer
> 2 votes
The main suggestion I have is setting a value for the cookie prefix and seeing if that works.

I actually had a similar problem to this on ONE site that was configured seemingly identically to some of my others, but this exact thing happened to me. This set of config items added to my main config.php seemed to alleviate it for me:

```
$config['cookie_domain'] = "";
$config['cookie_path'] = "";
$config['cookie_prefix'] = "someprefix";
$config['require_ip_for_login'] = "n";
$config['require_ip_for_posting'] = "n";
$config['secure_forms'] = "n";

```

The secure forms bit in particular seems to be what was causing trouble for that site, despite completely wiping out the EE core and starting fresh, though I couldn't tell you why. Probably some legacy garbage hanging around in the database.

The previous suggestion about setting configurations for the session ttl values may work also.

# Answer
> 1 votes
In addition, I've been adding the following to my config file (based on someone else's recommendation):

```
$config['cp_session_ttl'] = 14400;
$config['user_session_ttl'] = 3600;

```

# Answer
> 1 votes
I experienced logouts while **working with multiple tabs** (sometimes up to 10 for different templates etc.). It seems that your session times out if one of the tabs "times out".

---
Tags: control-panel, sessions, cookies
---


title: ExpressionEngine and WorkflowMax

text:
# Question
Title: ExpressionEngine and WorkflowMax
I am looking to integrate EE with the WorkflowMax (SAS project management software, via their API). The idea was to collect leads directly into Workflow max when someone requests a callback, as this is the CRM for the business.

I want to use FreeFormPro to setup these enquiry forms etc. Should I do this first, and fine tune all our forms, then get the plugin developed?

I was also planning on using Freeform to add people to our CampaignMonitor mailing list, for those who arent enquiring but just want to get the newsletter (people we no very little about).

Will I still be able to use FreeFormPro once we connect to Workflowmax- not sure how all this works together. Thanks

# Answer
> 1 votes
You should approach a developer and see how they want to go about the integration. It depends on many things, such as the Workflowmax API etc.

However, I would say it is probably possible to collect responses using Freeform, then use one of their extension hooks to submit this to Workflowmax. The other option would be for your developer to create a plugin which submits the data directly to workflowmax, without going through Freeform - there are pros and cons to each strategy.

---
Tags: solspace-freeform, campaignmonitor
---


title: No input file specified

text:
# Question
Title: No input file specified
Nuts nuts...

www.example.com works, but when accessing www.example.com/index.php/template\_group, or any other pages, EE gives No input file specified-message and nothing therefore works. Version 2.5.3 with Channel Images, likEE, Wygwam...

but what makes this very very odd, is that the site worked just fine 3 months ago when i was working on it. Now its dead end.

What might be the issue?

EDIT: Was a serverside issue, host made updates on server, so therefore stopped from working. I got email from them and check all later today, but did try fastlink to one i remember, and it worked as before - so i think they fixed their own hassle :)

# Answer
Was a serverside issue, host made updates on server, so therefore stopped from working.
> 1 votes

# Answer
Pete, have you tried adding a question mark to your URLs? ie: example.com/index.php?/template\_group?

Try that, if it works, you need to add the question mark to your index.php or set Force Query Strings to "Yes" in Admin \> Output and Debugging.
> 2 votes

---
Tags: ee2
---


title: Cometchat in use?

text:
# Question
Title: Cometchat in use?
Does anyone have CometChat on their EEsite? If so, does it work as promised, and installation is as easy as promised? Am i wrong but do you need to add global variable in every single template that you have build in ExpressionEngine or that chat toolbar wont appear?

And most important, i have already some and more javascript on my site, so might that be a problem?

And last but not least, does this software work thru Forum Module when it is run via regular template?

Thanks. FinPete

# Answer
Using Cometchat in my site forums now with success. So i think i can give a positive "thumbs up" to this software, even tho it has been online only 24 hours so far.

But i think that this is a low-cost solution for rapid chatting for logged in users, and more. (there is guest chat available but i dont find that very usefull).
> 0 votes

# Answer
I've used CometChat, but not an EE site. Installation is fairly straightforward, and yes, it was a snippet of code in the footer of the site (this was on MyBB actually). If you have your Footer in a snippet, embed or LV, this should be a breeze to install.

CometChat is fully separate from EE so isn't impacted by EE's template parser. It shouldn't matter how you run the Forum, so long as you have that snippet.
> 0 votes

---
Tags: add-on
---


title: Installing Extention Cartthrob

text:
# Question
Title: Installing Extention Cartthrob
Hi I'm trying to install Cartthrob I have Extension enabled But still carthrob is asking for extension to be installed

Is there anything else i need to check for this?

Thanks!

I'm testing this on ee 2.5.5

# Answer
> 1 votes
It is not asking you to install it, it is telling you that the extension is going to be installed automatically with the module. In previous versions of EE you could sometimes install a module without installing the extension which would cause problems.

# Answer
> 0 votes
You might have extensions disabled globally.

Have a look underAdd-ons \> Extensions, then look at the top right for an "Enable Extensions" button. If the button already says "Disable Extensions", then this isn't the problem.

---
Tags: cartthrob, extension
---


# Question
Title: Assets 2.0.5 problem when transferring database
I am trying to install a local copy of my database on Mamp. But I am getting the following error in the exp\_assets\_folders table:

```
#1062 - Duplicate entry 'ee-0-' for key 'unq_source_type__source_id__full_path'

```

I saw another post with a similar problem but the answer says this was sorted in version 2.0.2. I am using Assets version 2.0.5. I am not using master config.

Thanks

# Answer
> 0 votes
Looks like it was an issue with the Backup proish DB. Thanks for your help

---
Tags: database, assets
---


title: Simple Search Form

text:
# Question
Title: Simple Search Form
I am using this code which I thought was right.

```
{exp:search:simple_form channel="work" search_in="everywhere" role="search" id="search-form"}
                  <label class="screen-reader-text" for="search">Search</label>
                  <input type="text" value="" name="s" id="search" title="Enter keyword">
                  <input type="submit" id="search-submit" title="Search it" value="→">
                {/exp:search:simple_form}

```

However I get an error (see attached). Does anyone have any ideas to what I am doing wrong in this case?

# Answer
> 3 votes
Only certain input fields are supported and if you're using keywords for example then you need to ensure that the name attribute is set:

```
<input type="text" name="keywords" id="keywords">

```

That should yield some results.

---
Tags: simple-search
---


# Question
Title: Expresso Store UPS Shipping Calculation is off on with multiple quantities
When calculating a single quantity item in the store using UPS shipping, my shipping calculations work perfect. However, if I add 2 or more quantities, my shipping rates go up but not exactly the same as what UPS is calculating.

\[edit\] EE 2.5.3 w/ Expresso Store 1.6.2 / IIS 7 / PHP 5.3.6

1X Item Calculation (perfect) UPS $14.66 Store $14.66

2X Items (different) UPS $29.32 Store $17.25

# Answer
Turns out the UPS api calculates everything as a single shipment - as they would expect you to ship multiple items in one box.
> 1 votes

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


title: Number of Items in the shipping cart

text:
# Question
Title: Number of Items in the shipping cart
Since I was planning to have "You have # items in the cart". Is it possible to get the number of items in the cart?

I tried to do something like this:

```
{exp:store:cart}

You have {if no_items}0{if:else}{items}{/if} item(s) in the cart

{/exp:store:cart}

```

# Answer
> 2 votes
You need `{order_qty}`.

```
{exp:store:cart}

    {if no_items}Your cart is empty.{/if}

    You have {order_qty} item(s) in the cart.

{/exp:store:cart}

```

:)

---
Tags: expresso-store
---


# Question
Title: Set "site_url" Config Variable in index.php
I'm upgrading a multi-language site from EE1 to EE2, and it's using the technique of duplicating `index.php` and `path.php` inside subdirectories named for each language, and defining global language variables inside `path.php`.

So I upgraded the site to EE2, ditched the `path.php` files from the subdirectories, updated the `index.php` files to the new EE2 versions, and added these configuration variables:

```
$assign_to_config['site_url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' . $_SERVER['HTTP_HOST'] . '/en/';

$assign_to_config['global_vars'] = array(
    'country_code' => 'en',
    'language' => 'english'
);

```

The global variables seem to be working, but `site_url` is not. I tried:

* `$config['site_url'] = '...'`
* `$site_url = '...'`

I'm also using Focus Lab Master Config, and I made sure to comment out the `$env_config['site_url']` variable inside `config.master.php`. I also double-checked that it's not being defined inside `system/expressionengine/config/config.php`.

What am I doing wrong here?

**UPDATE:** The `site_url` global variable works when used in templates, but it isn't applied in the control panel, in *Admin \> General Configuration*, for example.

I'm using FocusLab Master Config, and assigning `site_url` from within `config.master.php` does update the control panel. So there must be something getting in the way somewhere between `index.php` and `config.master.php`.

# Answer
Does it work when you hard code the site URL?

How about:

```
$assign_to_config['site_url'] = getenv('HTTP_HOST');

```

Have you ensured your system path has been altered in index.php?

```
$system_path = '../system';

```

Notice the extra leading dot.
> 2 votes

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