# Question
Title: Guest checkout email/username and existing users with CartThrob
I am allowing guest checkout through my store as well as checkout by registered members. I have noticed that if I use the create\_user parameter in the checkout form the guest gets registered, and the next time he visits and uses the same email he is unable to place an order because the email address already exists.

So I assume I have to remove the create\_user parameter, however when I do this the guest visitor is able to checkout using the email address of currently registered members. This means that in the order admin the guests orders are associated with the unknowing registered member.

I realise this is fairly unlikely to happen, but was wondering if there is a way to stop guests checking out with the email address/username of currently registered members?

# Answer
> 1 votes
You could write an extension that uses the **cartthrob\_pre\_process** hook (or possibly **cartthrob\_save\_customer\_info\_start**, depending on how your checkout flows).

Inside your extension method, grab `$_POST['email_address']`, check to see if a member exists with that email, and if they do, return an error screen.

---
Tags: cartthrob
---


title: Updating matrix makes my site go blank

text:
# Question
Title: Updating matrix makes my site go blank
I've just updated EE to 2.5.5 only to find that matrix images aren't showing. Apparently I need to update matrix from 2.1.2 to 2.5.3 to solve this, but when I do all of the site's pages go blank. Any idea how to solve this?

# Answer
You probably have to trigger Matrix's update script. Go to **Add-Ons****Fieldtypes****Matrix** and it'll run automatically.

If that doesn't work, try turning on error messages for admins and see if that gives you some hints. In `system/expressionengine/config/config.php`, put `$config['debug'] = "1";`
> 1 votes

---
Tags: matrix, upgrade, updating, update, blank-screen
---


title: Low Search Related Child in List

text:
# Question
Title: Low Search Related Child in List
I am working on a client site and they have a search form which we are using Low Search for. Two current search fields for `keywords` and `topics` (a Playa field) work fine.

I am working on the third field where we need to filter by the `position` (text input) field of a related employee (Playa field).

Here is the code I currently have:

```
<select id="position" name="child:news_related_employees[]">
    <option value="">All</option>
    {exp:query sql="SELECT GROUP_CONCAT(entry_id) AS entry_ids, field_id_34 AS p_position FROM exp_channel_data WHERE field_id_34 != '' GROUP BY field_id_34 ORDER BY field_id_34 ASC"}
    <option value="{entry_ids}">{p_position}</option>
    {/exp:query}
</select>

```

The query works fine, I get a comma separated list of `entry_id`s per unique position, however the form does not return any results. I assume that's because it is trying to match the entire string of `entry_id`s to an employee in the Playa field.

Can anyone shed some light on this or know of a way to do what we need? Thanks.

# Answer
> 1 votes
Low Search expects a pipe `|` as a value separator. You can define that in the `GROUP_CONCAT` clause of your query. So try this:

```
GROUP_CONCAT(entry_id SEPARATOR '|') AS entry_ids

```

---
Tags: playa, low-search, relationships
---


# Question
Title: Playa - Live filter is not visible in control panel
How to make the live filters visible on control panel when we publish a channel? I've added channel field and set playa as field type. But when i try to publish an entry, i cannot see the live filters near to the field. I'm using Playa 4.3.3 and EE 2.

# Answer
Double check that your themes folder is loading from the same site URL as you are using the access the control panel. I've experienced that before and it was as simple as making sure that I'm logging into the exact same domain (https vs http, www versus non-www, etc).
> 1 votes

---
Tags: playa
---


title: Stash Noob Questions

text:
# Question
Title: Stash Noob Questions
I've just installed Stash. I've got a couple of questions on how to use it.

I'm interested in retrieving the stashed variable and putting it in a variable so I can test it, and take actions depending on the value. How would I do that? (Actually, the retrieved variable is from $\_POST, and I've got that retrieval happening, but I can't seem to get it in a variable I can use.)

Is there any way to delete a stashed variable? I couldn't find anything in the docs.

Here's my test code:

```
Get: {exp:stash:get name="test1" dynamic="yes"}<br/>
Output: {test1}<br/>
{if test1 == 'yyy'}Yipee!{if:else}Frack!{/if}<br/>

```

Thanks for your help.

# Answer
Here's how I got conditionals to work with Stash 2.3.6:

```
Get: {exp:stash:get name="test1" dynamic="yes" output="yes"}<br/>
Output: {exp:stash:test1}<br/>
{if '{exp:stash:test1}' == 'yyy'}Yipee!{if:else}Frack!{/if}<br/>

```

I guess you can't really create a variable: they need to come from a channel. So this technique gets test1 from the $\_POST array, and now I can test it and take action depending on its value.
> 1 votes

# Answer
Do you need to store the POST var for reuse or do you just want to use it within a conditional? If so you'd probably find that Switchee gets you on the right track. For example:

```
{exp:switchee variable="{post:my_var}" parse="inward"}

    {case value="value1|value2"}
        Content to show
    {/case}

    {case value="value3" default="Yes"}
        Content to show
    {/case}

{/exp:switchee}

```

Note the `post:` prefix for the Switchee variable.

If you do need to cache the POST var then you can stick it in a Stash variable and then parse that with Switchee:

```
{exp:switchee variable = "stash:my_var" parse="inward"}

```

Or, rather than caching the POST var, you could put your `stash:set` calls inside the Switchee loop and you could cache the template output entirely, which could result in significant performance gains. Without more info it's hard to know which approach would be ideal.
> 1 votes

---
Tags: stash
---


# Question
Title: Assets + MSM won't display/upload files on custom sites: Update Indexes not working
I've browsed through quite a few similar questions, but many of these seem to have gone unanswered. I have some new input that might help.

## Situation

I'm running EE2.5.5, Assets 2.05, and Multiple Site Manager (not sure if version is relevant/where to find it) with 3 custom sites.

Like most similar questions, everything seems to be working fine on the default site (let's call this one *Site1*). Every site had their File Upload Directories duplicated from Site1 and are working fine in EE's own File Manager (after syncing every directory).

## The Problem

Assets is not working in any of the site variations.

**What's interesting:** I know why! The "Update Indexes" feature is failing. When I hit "Update Indexes", an AJAX request is made to the wrong domain. This request SHOULD go to "site1.com/", instead of "site2.com/", since the control panel only works from site1 (in my setup).

I've tried adding the config variable `$config['assets_site_url'] = 'http://site1.com/index.php';`, unfortunately to no avail.

## The Question

How/where can I configure Assets to help it send the **Update Indexes** AJAX request to the correct URL?

# Answer
This was solved by adding $config\['assets\_site\_url'\] = 'http://site1.com/index.php'; for real - on the first try something had went wrong for Adrian silently, apparently.

Using the CP to add this option worked as expected.
> 3 votes

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


title: entry_date format on SafeCracker

text:
# Question
Title: entry_date format on SafeCracker
I'm building a page with the twitter bootstrap at the moment and in particular am using the bootstrap datepicker to give users a particularly nice UI for selecting an entry date for their channel entry.

However, SafeCracker keeps telling me that the format of the date is incorrect - What dateformat should I be supplying? I've tried DD/MM/YY, MM/DD/YY, YYYY-MM-DD and none of them work. Do I need to supply a time as well?

I don't want to have to supply a time, since it's irrelevant for this purpose - but even putting into the formatting a default time (so using format dd/mm/yy 00:00), but this doesn't work either).

Anyone offer an insight?

# Answer
> 4 votes
EE requires the date format `yyyy-mm-dd hh:mm AM/PM` for the Entry Date. I know with jQuery's date picker you can make the submitted format different from the displayed format, but it doesn't look like the Bootstrap date picker has that option.

One option would be to use an EEvent Helper date field, which omits the time requirement, and then set it to auto-populate the Entry Date in the EEvent Helper settings.

# Answer
> 3 votes
Safecracker actually wants it like this:

YYYY-MM-DD 00:00 AM

Example: 2013-01-04 01:31 PM

# Answer
> 0 votes
I also ran into this issue and had a few things to get over.

1. You must disable the datepicker in the SafeCracker parameters before you can override the javascript settings.

{exp:safecracker channel="jobs" datepicker="no"}
2. I chose to add the time myself to the date format as I didn't nto want to add an additional plugin to set the time and it is semi irrelevant to my date.

$(".datepicker").datepicker({ dateFormat: "yy-mm-dd 12:00 'PM'",
maxDate: "+0d", changeMonth: true, changeYear: true, altFormat: "DD, d MM, yy" });
3. The other alternative is to use a separate field to display your data differently from the submitted data by using the additional field option and submitting in in a hidden field. Check out the datepicker widget API for the examples http://api.jqueryui.com/1.8/datepicker/

---
Tags: safecracker, saef, datetime
---


# Question
Title: Help with using the Search Module without a form
Is it possible in Expression Engine, using the latest version, to run a search query, without having to use a form? Meaning, I'd like to create an api endpoint like so:

```
http://localhost/v1/search/large+pants

```

So the view file would grab segment\_3, and use that to search the various channels I have?

If that's not possible, then I ask, is it possible to do a post like how the regular search module works, but not require any of the extra params in the request, just send over the "keywords"?

# Answer
Something like that is not possible with the first party search module. It would be possible to build queries like that with Low Search or Solspace SuperSearch however.
> 3 votes

---
Tags: module, search
---


# Question
Title: Selling Products world wide from Australia + Accepting Multiple Currency
I have used Expresso Store for all my carts to date, and have no experience in any other EE cart solutions, nor have I done a multi currency site before.

I can see in Expresso's documentation that they potentially have Multiple Currency in development.

My question is:

Has anyone out there delivered a shopping cart using Expression Engine which handled Multiple Currencies well along with shipping options/calculator for Australia?

# Answer
> 1 votes
Store currently only supports charging cards in a single currency per site which you set in the Store \> Settings \> General tab in the CP. Lets say that you have it set to USD and your customer is from England and therefor is paying with British Pounds. The payment gateway will convert the currency so that you collect the correct amount in USD.

---
Tags: expresso-store, cartthrob, shipping, shopping-cart, currency
---


# Question
Title: Two different channels, but one archive. Possible?
I'm sure I'm going to do a horrible job explaining this, so apologies in advance.

I have two different blogs (Blog and Featured), two different category groups (Blog and Decades), and I'm having a problem linking items in my category groups to the correct page. Here's an example of my Decades snippet:

```
<h3>DECADES</h3>
<ul>
    {exp:channel:categories channel="blog|featured" style="linear" category_group="not 10"     show_empty="no"}
    <li><a href="">{category_name}</a></li>
    {/exp:channel:categories}
</ul>

```

If I'm allowed to use multiple channels in the `channel=` parameter, what do I link the `{category_name}` to? Either blog can select the Decades Category group, so if I want someone to see all the posts in the 1910 category, regardless if the post was made in the blog channel or the decades channel, how would I go about it?

# Answer
If you are simply displaying the archive with a single template and dynamically displaying category headings, etc.? As long as the category name is unique (even across category groups, this is necessary unless you plan to use the category ID in the URL) you can use the category url title. You wind up having to do something similar with your entries loop - piping both channel names info the channel parameter. You may need some conditionals within your loop to handle any differences between what custom fields are within each field group (assuming for the moment that they don't share a field group) - for that I'd recommend using switchee or ifelse.
> 1 votes

---
Tags: categories
---


# Question
Title: Thumbnail could not be created for the image. Please make sure the thumbnail directory is writable.
I'm getting the following error when trying to upload images on all of the upload directories. The directories are set to 777.

*"Thumbnail could not be created for the image. Please make sure the thumbnail directory is writable."*

If I create a new upload directory I get the same error but it's able to create the \_thumbs folder.

# Answer
Are you 100% sure your Paths are correct in the file upload preferences?

You can check them at... CP Home \> File Manager \> File Upload Preferences \> Edit File Upload Preferences

Also make sure to check who is the "owner" of the folder, it should be the same user that "runs" the php/apache.
> 4 votes

---
Tags: file-uploads, thumbnails
---


title: Parse Order and Redirect=

text:
# Question
Title: Parse Order and Redirect=
I know I have come across this before but the solution is escaping me. I have a template and a channel lets call it widgets. If I go to the URL /widgets/ I want it to show all the entries of channel="widget" no problem. Now if i have a url of widgets/a-black-widget then I want to show just the specific info for just a-black-widget. Again no problem. The issue happens when I want to redirect someone who enters a url of /widgets/nonesensevalue meaning an entry that doesnt exist. HEre is my code.

```
{if segment_2==""}
  {exp:channel:entries channel="{segment_1}" limit="8"}
    <!--Code showing article list-->
  {/exp:channel:entries}
{/if}
{if segment_2!=""}
  {exp:channel:entries channel="{segment_1}" limit="1" require_entry="yes"}
    {if no_results}{redirect="404"}{/if}
    <!--Code that shows individual article-->
  {/exp:channel:entries}
{/if}

```

The problem is even when you go to /widgets the redirect fires. If I recall correctly this is because even though the conditional if segment 2 is not empty is untrue the parser still goes the channel entries tag anyway and as soon as it hits the redirect it fire.

So the question is how would you implement a 404 for this example.

# Answer
> 1 votes
I'd look to use switchee rather then `{if}`

```
{exp:switchee variable="{segment_2}"}
  {case value=""}{!-- Nothing is segment_2 --}
    {exp:channel:entries channel="{segment_1}" limit="8"}
      <!--Code showing article list-->
    {/exp:channel:entries}
  {/case}

  {case default="yes"}{!-- Assume there is something in segment_2 --}
    {exp:channel:entries channel="{segment_1}" limit="1" require_entry="yes"}
      {if switchee_no_results}{redirect="404"}{/if}
      <!--Code that shows individual article-->
    {/exp:channel:entries}
  {/case}
{/exp:switchee}

```

This is all untested and not to be interpreted as a literal answer – more a guide ;)

---
Tags: parse-order
---


title: Get EE to respect SSI include

text:
# Question
Title: Get EE to respect SSI include
We have a legacy system slowly getting migrated to full EE. We call an SSI include from within one of the files used by both systems.

The problem is, EE doesn't respect the SSI include and just shows a blank area where our content should be.

So, I'm looking at either:

1. Duplicating the include file and changing the SSI include to an EE include, or
2. Creating a script to bake the include content into our file before it gets called by either system.

The first just duplicates any work we have to do to our menu, the second seems like overkill.

I'm wondering if anyone else has any suggestions? I feel like I'm missing something obvious.

Thanks!

# Answer
I would think a line or two of PHP in your EE template (make sure to turn on PHP within) will allow you to include the file.
> 1 votes

---
Tags: templates
---


# Question
Title: Custom column creation for template and plugin
I have a homepage template that I manually change and there are rows with 3 columns each. Each column is a topic with entries.

I wrote out some PHP to programmatically to create these rows and columns so that I could query the database and then create the columns much easier.

It basically takes the array of items, and breaks into smaller items.

The problem I'm having is converting it to work with EE and the template engine.

I started out by creating a plugin, and maybe this isn't the way to do it. I can get the topics and spit them out using the parse\_variables function in the template engine. Getting them into their own arrays like I do in my test code below isn't hard, but I'm not certain how to get this working within the plugin and the EE template.

Then I just use:

```
{exp:topics_loop:all}
    {topics}
        {topic}
    {topics}
{/exp:topics_loop:all}

```

It spits out the topics, yay, but that's easy. Anyway, here's my rudimentary test code to get a better idea of what I'm trying to accomplish:

```
<?php

$array = array();

for( $i = 1; $i <= 13; $i++ ) {
    array_push($array, 'topic ' . $i);
}

$thisArray = array();
$numPerRow = 3;
$numElems = count($array);
$rowCount = 0;
$thisArray[] = array();
foreach( $array as $key => $value ) {

    if( count($thisArray[$rowCount]) == $numPerRow ) {
        if( ($numElems - $key) == 4) {
            $numPerRow = 2;
        }
        $rowCount++;
    }
    $thisArray[$rowCount][] = $value;
}

foreach($thisArray as $arrays) {

    echo 'start row<br />';
    $count = count($arrays);
    if( $count == 3) {
        foreach($arrays as $a) {
            echo 'span_4 - ' . $a . '<br />';
        }
    }
    if( $count == 2 ) {
        foreach($arrays as $a) {
            echo 'span_6 - ' . $a . '<br />';
        }
    }
    echo 'end row<hr />';
}

```

I create a simple array of items just for testing out different combinations. It creates columns of 3, if it has 1 item in the last array, we split the last 2 into arrays of 2. I never want 1 item by itself essentially.

If you run this specific code, you'll see that it creates:

```
start row
 span_4 - topic 1
 span_4 - topic 2
 span_4 - topic 3
end row

start row
 span_4 - topic 4
 span_4 - topic 5
 span_4 - topic 6
end row

start row
 span_4 - topic 7
 span_4 - topic 8
 span_4 - topic 9
end row

start row
 span_6 - topic 10
 span_6 - topic 11
end row

start row
 span_6 - topic 12
 span_6 - topic 13
end row

```

Anyway, this is rudimentary, but if anyone has pointers on how to get this idea into EE, let me know.

Thanks.

# Answer
> 1 votes
I would start by looking at the Matrix add-on. This may help solve your problem. Matrix

---
Tags: ee2, templates, plugin, dynamic
---


# Question
Title: How to order titles with non-english characters?
I display a list of entries using

```
orderby="title"
sort="asc"

```

But titles starting with the Swedish character "Å" and "Ä" is sorted before "A" - and it should be last in the list. Like this:

... X Y Z Å Ä Ö

Is there a way (hack?) to solve this?

Regards, Magnus

# Answer
Risking tooting my own horn here, but Low Alphabet will let you generate alphabetical lists and will ignore diacritics. If you don't want to use an add-on, you probably need to resort to PHP in your template.
> 3 votes

# Answer
In my experience (working with Norwegian characters) you need to set the MySQL collation to "utf8\_danish\_ci". Admittedly counter-intuitive when working with Swedish content, but if it works...
> 2 votes

---
Tags: channel-entries
---


# Question
Title: Where do I put Freemember Password Reset code?
This is embarrassing because I *know* I have asked this before...

What's the trick to getting the reset email link to load the template with the Freemember Password Reset code? Does the template have to be named something specific?

# Answer
The password reset link in the email should already have the code in it (it is stored in a segment variable which is passed to your password reset template).

Update: If the email sent still includes the default link to the standard EE reset password page, it is probably because you didn't specify which template your custom reset page is on with the reset parameter:

```
{exp:freemember:forgot_password return="account/forgot_sent" reset="account/reset"}
    <!-- forgot password template -->
{/exp:freemember:forgot_password}

```

Docs: https://github.com/expressodev/freemember/blob/master/docs/forgot\_password\_tag.md#reset
> 1 votes

---
Tags: freemember
---


# Question
Title: Does Expresso Store's Australia Post Shipping Module handle International Postage
A client wishes to sell from Australia to the rest of the world.

Will the Australia Post Shipping Module handle this?

Or is there a better method..?

# Answer
> 1 votes
The Australia Post plugin should correctly calculate international shipping rates.

However, the plugin doesn't have many options available (e.g. different parcel/priority types), so you will need to place some test orders to ensure it's calculating shipping rates which actually reflect your costs.

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


# Question
Title: Member registration in Zoo Visitor with CartThrob checkout form
I am using CartThrob for e-commerce part and Zoo Visitor for managing members.

We know that with the CartThrob checkout form, new member registration is being done. Its working fine in my case and member has been created but no member entry is being created in Zoo Visitor channel.

I hope, someone faced such a problem and can share some pointer to me.

Thanks,

# Answer
> 1 votes
I'm not sure how good integration is for the two at this point but I think you still need to submit via hidden input fields for Zoo Visitor within the Cartthrob checkout. If you're using a two-step checkout process it's easier because you can have one page for the member fields submitted as a Zoo Visitor entry and then the other page for Billing/Shipping fields etc for Cartthrob.

If that doesn't fit into your workflow then you could always use AJAX form submission to post and fill in hidden fields on the page.

What does your current code look like?

---
Tags: cartthrob, zoo-visitor
---


# Question
Title: What is the Wildcard for expression engine?
I am trying to use the wildcard for my {if} statement. Where I could have P12,P24,P36,48, etc.

```
{if segment_4 !="" && segment_4 !="P*"}

```

But The wildcard is not working for me, does the queries need to be turned on or something?

Thanks for the help in advance.

# Answer
> 3 votes
There are no wildcards in EE. You're probably looking for something like Switchee, where you can use regular expression matching, or Mo Variables, which gives you `{if paginated}`, which could help here.

# Answer
> 1 votes
You could also use Segment Search which is another free addon and allows more control of segment searching. This should work:

```
{exp:segment_search keyword="/P\d+/" segments="4" regex="yes"}

```

---
Tags: ifelse
---


# Question
Title: Anyone used Sencha Touch and EE for ecommerce?
I'm looking to build a new ipad and iPhone website for a client. I'm looking at Sencha Touch as the solution with Carththrob running the ecommerce side of things.

As anyone had any experience with this set up?

Looking at the Sencha docs, I'm thinking of using XTemplates quite heavily to accommodate CTs forms etc.

Any heads up would be fantastic!

Cheers

# Answer
> 2 votes
Sounds like an interesting mix. I don't know your exact use case but personally I'm not sure I'd look to go with that combination. Sencha Touch is great as a feature-reach mobile framework which is aimed at providing a native app look and feel. As you mentioned you're building a `website` for a client. The website vs web app debate is endless but generally if you're building some to look native to the mobile device then I'd say it's an app. Web apps generally tend to be front-end heavy primarily using HTML5 and JS to provide the application logic. As a result it's common that they only ever need a thin client on the server - just an simple RESTful interface to connect to for CRUD operations. In which case I'd tend to use something like Deployd which is built for the purpose and very easy to get started with or just build my own in pure code with a framework.

If it needed ecommerce and Cartthrob, baskets, and order forms etc were being considered then I wouldn't go for a native look and feel app. That would be more a `website` which I'd look to build responsively. Then I'd look to use EE and CT but I then wouldn't consider using Sencha Touch. It's too complete a framework and I wouldn't want the `native` look and feel.

You could always try and turn EE into a RESTful interface of sorts (although not true RESTful) but it almost seems like overkill if it's for a mobile `app`.

---
Tags: cartthrob
---


# Question
Title: Best practices for handling paths in File Manager with MSM?
I have a secondary site in an MSM install (EE2.5.5).

In EE's File Manager, I have paths like this:

/assets/foldername http://site2.com/assets/foldername

This works fine when using a *File* fieldtype, as I can change the domain name referenced above and file paths will all update. However, images inserted in a rich text field, i.e., WYGWAM, will be dumped in like this:

```
<img src="http://site2.com/assets/foldername/image.gif">

```

When I chance the domain name, I'll have broken links. However, if I try to refer to images with relative paths:

```
<img src="/assets/foldername/image.gif">

```

They don't show up in the EE control panel because it's running at site1.com/system

The only solution I've found to this is to store all the images at the primary domain and then reference them all with full paths starting with http:// Then I can fuss with the secondary domain and paths remain correct.

# Answer
> 2 votes
WYGWAM inserts images with {filedirX} in place of the actual path to the image. So changing the domain name (or replacing site2.com/somefolder with /somefolder for folders within File Manager should work without a hitch. Thanks @kristengrote.

---
Tags: wygwam, file-manager, bestpractice
---


# Question
Title: Simulate date/time in PHP for Expression Engine
We're running an annual event website and we're keen to simulate the site for a different date. In other words, add say 3 months to the current date/time so we can try out some options for when the event's finished.

Anyone have any thoughts on where to start with this?

# Answer
> 2 votes
Ian's comment works, though this will be less laborious...

Open **/system/expressionengine/libraries/Localize.php**, and look inside the constructor (around line 53 or so). Comment out the setting of `$this->now` and change it like so:

```
// Fetch the current local server time and convert it to GMT
// $this->now = time();

// Temporarily setting the date to 3 months in the past
$this->now = strtotime('3 months ago');

```

---
Tags: php, date
---


title: Customise system email templates?

text:
# Question
Title: Customise system email templates?
I'm sure I've read somewhere how to do this but I am not able to find it at the moment.

I have Postmaster installed, and I am using that to send various emails based on entry creations and status changes.

This all works great, and I have a customised template (with inline css) to produce a nice looking email.

Now I would like to customise the system messages, (i.e new member regs, activation links etc.)

I know there is the Email Notification Templates under the Design\>Message Pages option, and these templates produce plain text simple emails.

Is there a way to customise these? Ive read on the Postmaster docs that you can use postmaster for this purpose, but I have been unable to find any more info, or documentation other than to say it can be done.

# Answer
> 3 votes
You need to create a new "Hook" entry in Postmaster that uses the **send\_system\_email** hook. Then use `{hook:from_name}`, `{hook:from_email}`, `{hook:subject}`, `{hook:message}`, etc in the various fields when creating the parcel (all the variables listed here.)

It's not explained very clearly, I know. I had a bit of an exchange over Twitter with Justin about it, and he said he was planning on clarifying how to do this in the docs.

# Answer
> 0 votes
They can be found in the control panel: Design \> Message Pages \> Email Notifications.

If you want to save these speciality templates as files though I'd highly recommend Libraree. It will save not only speciality templates but also email templates, global variables and snippets as files to be run through version control. They can also be parsed as regular template files meaning more control and the ability to include any other tags for greater customisation.

# Answer
> 0 votes
You need to add the mailtype in the email sending code. Like for the email template of "Member Account Activation Instructions", go around line number 690 of file "/expressionengine/modules/member/mod.member\_register.php" and put this line of code

```
$this->EE->email->mailtype = 'html';

```

after

```
$this->EE->load->library('email');

```

Same can be applied for other emails which are not having mailtype as 'html'.

---
Tags: email, postmaster, system-messages
---


title: Unable to publish new channel entry

text:
# Question
Title: Unable to publish new channel entry
I'm trying to publish a new entry into an existing channel. This channel has one other entry. When I hit the Submit button on the new entry, I'm not seeing any error messages.

This same site has a dev instance, with its own database. I'm able to publish the entry on the dev site, but not on production. EDIT: I can add and edit templates on production, but cannot add or edit any channel entries. So possibly it's some channel setting???

How can I start troubleshooting this?

* Running ExpressionEngine 2.5.3, running on AWS
* Logged in as a super admin
* When I try to create or edit an entry, I just get taken right back to the entry form when I hit Submit
* Have tried turning on template debugging, but no change/no error messages generated

# Answer
> 1 votes
Sounds like you have a required field that isn't getting filled out on one of your publish tabs. Unfortunately, EE does a terrible job of indicating this error.

I suggest installing the **EP Mega Error** addon so you will always see such errors. Once installed, you will see a very obvious error like this:

# Answer
> 1 votes
Believe it or not, simply refreshing the page first, then republishing may solve your issue. I have run into this a few times myself, and this has worked... I know it sounds rudimentary but try it.

# Answer
> 1 votes
So I figured it out. It's very weird.

This morning, I had opened the Admin\>General Configuration settings screen, and set the site's root directory URL to be simply "/" so that people could view the site, or more specifically a certain set of templates, through either http or https. I've done this on other installs, even other installs for this particular client, and not had any problems.

Once I re-set the site's URL to the actual domain, instead of the more global "/", I could edit existing and publish new entries again.

Weird. Weird, weird, weird.

# Answer
> 0 votes
Long shot here, but you're not seeing the published entry on the dev site, are you? Could it be using the dev database?

---
Tags: ee2, channel-entries
---


title: Upgrading ExpressionEngine

text:
# Question
Title: Upgrading ExpressionEngine
These instructions don't seem to be working ...

> Copy system/expressionengine/utilities/offline.html to your web root folder (the same place you have your main index.php file).
>
> Rename offline.html to index.html. Now your visitors will see the “offline” page while you update your site.
>
> In your ExpressionEngine Control Panel, go to Tools ‣ Data ‣ Clear Caching. Select All Caches and click Submit.

I add the index.html file as it says here but my sites home page remains?

# Answer
Super Admins by default can see the site when the site is offline (hence why you are seeing the homepage and the site) can you confirm in another browser (or something like incognito)'?

If that does not in fact fix the issue you will need to add

```
DirectoryIndex index.html index.php

```

To you htaccess to give priority to index.html over index.php
> 0 votes

# Answer
Rename your **index.php** file to something else - your web server likely is prioritizing **index.php** over **index.html**.
> 1 votes

# Answer
Have you cleared your browser caches too? It's different for each browser but on Chrome for instance go to Preferences \> Settings \> Show advanced content \> Privacy \> Clear Browsing Data \> and Empty the cache. It's probably the cached copy of your site you're seeing.

Also be sure that index.html is in the same directory level as index.php in your public site root.
> 0 votes

---
Tags: upgrade
---


# Question
Title: Exp-resso store: coupon code including VAT
I just found out that the value of my coupon is without tax. Just like all the products in the store.

However, i've sold the coupon code including tax, so there's something not quite right.

How can I let customers redeem a coupon code after taxes have been calculated?

# Answer
> 0 votes
The promo codes in Store don't include tax, just like everything else. This makes it easier when setting them up in the backend (as others have suggested, the promo code system wasn't really designed with gift cards in mind since they have no ongoing balance, but you can certainly bend it to your will).

Assuming your store includes taxes on the front end, and your tax rate is 10% - then if you sell a $20 promo code, you need to save that in the database as $18.1818 so that your customers can use the pre-tax value to purchase products.

# Answer
> 0 votes
The value of your Coupon/Promo code will be based upon what you setup in the CP, it doesn't make sense to have a $25 off promocode be $25 + 7% tax, the better solution would be to create the coupon code for $26.75.

Personally I think you would be better off using DevDemon's Credits module from the sounds of it.

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


title: Can't add external links in nav menu

text:
# Question
Title: Can't add external links in nav menu
First, forgive me as I'm not a professional programmer. I have access to our CMS as our company's web content manager, however our marketing agency handles heavy duty programming and design.

We recently updated our ExpressionEngine to version 2.5.5. Since then, I'm not able to utilize one of the tools that I could prior to that in the editor. When publishing a new page, there is an option for me to add External Links to appear in a navigation menu. There are two fields to add the headline text and the corresponding link. Below those fields is a '+' sign to add another headline/link. However, when I click this '+' sign, nothing happens. This should add more rows to this nav menu.

I'm hoping this is a simple fix. We just transitioned to a new agency so typically I'd ask them for help, but they're still familiarizing themselves with the system and right now I'm just trying to get a head start on this particular issue.

Any help you can give me is greatly appreciated. I apologize in advance if this request isn't appropriate for this forum!

EDIT: here is a screenshot: https://i.stack.imgur.com/zsVgP.png

# Answer
Adding rows of content in a loop sounds a lot like Matrix.

1. Go to AddOns and choose Fieldtypes. See if you see a listing for Matrix. If so, click on it's name.
2. Check the license number is there and click Submit.

I know when I upgrade the site, and Matrix, sometimes I need to click Submit or else it doesn't initialise. Catches me out every few years.. If you're lucky, it's something small like this otherwise a discussion with your agency is in order.
> 1 votes

---
Tags: ee2
---


# Question
Title: Automatically generate a form based on a channel field set?
I have a field set that's going to be growing over time. Users will be filling out forms on signup that represent this field set.

Is there a way to automatically generate this sign up form based on the field set, instead of manually updating the form when I update the fields?

# Answer
You can do it by using the {custom\_fields} loop of SafeCraker. In case, you wouldn't like to show some specific custom fields, don't populate them using if condition.

Like:

```
{custom_fields}

{if field_name != "not_show_field_1" AND field_name != "not_show_field_2"}

[Custom field options]

{/if}

{/custom_fields}

```

Take a reference from http://ellislab.com/expressionengine/user-guide/modules/safecracker/#custom-fields

I hope, it would help you.
> 3 votes

---
Tags: safecracker, custom-fields, forms
---


title: Using Exp:resso RSVP on two Channels

text:
# Question
Title: Using Exp:resso RSVP on two Channels
I'm currently working on a Multi Language site with Biber's MLS.

I'm using Exp:presso's RSVP addon (it is brilliant!) to manage attendance. The only problem is that I have 2 event channels (one per language) named events\_en and events\_es. On the RSVP preferences you can only pick one channel to show the RSVP Form in.

What I want to do is have the RSVP Form show up on the default language Event page and on the tranlated Event page, but that the attendance is shared between them, since its really only one event.

I have the RSVP form and attendance code in a embed template, and tried using conditionals and custom fields to pass the entry\_id of the default language event, but the form still doesn't show up.

Anyone has any idea on how to get RSVP working with two channels? Thanks!

# Answer
Are you checking the language code? Biber's MLS prepares a global variable "language\_code".

I think, you are using code for events like:

```
{exp:rsvp:member_events parse="inward"}
    {exp:channel:entries channel="events" entry_id="{entry_ids}"}
        <!-- event details -->
    {/exp:channel:entries}
{/exp:rsvp:member_events}

```

For the language preference update code like:

```
{exp:rsvp:member_events parse="inward"}
    {exp:channel:entries channel="events_{language_code}" entry_id="1|{entry_ids}"}
        <!-- event details -->
    {/exp:channel:entries}
{/exp:rsvp:member_events}

```

You can notice, I am using {language\_code} within channel parameter.
> 1 votes

---
Tags: ee2, expresso
---


# Question
Title: Is there a way to persist a login across MSM sites?
I'm exploring MSM for a new site and need to provide a single login for members and allow them to jump from site1 to site 2 with a single session. Is this possible?

# Answer
I think, you setup well following variable in the index file of the both sites:

```
$assign_to_config['site_name']  = 'default_site';
$assign_to_config['cp_url'] = 'http://domain.com/admin.php';
$assign_to_config['site_url'] = 'http://domain.com';

```

You need to add a variable in config file also:

```
$config['allow_multi_logins'] = "y";

```

The member will be logged in for both sites and can be able to switch from site1 to site2 as logged in.

Hope, it would help you.
> 0 votes

# Answer
It is definitely possible. For my setup the necessary config was

```
$config['multi_login_sites'] = "http://somesite.com/|http://anothersite.com/";

```

where you provide a pipe delimited list of each of your site's URLs. You will have to make sure that the URLs you provide are an exact match for what ExpressionEngine has for the `{site_url}`.
> 1 votes

---
Tags: members, multi-site-manager, login, single-sign-on
---


# Question
Title: How to Switch Search Channels on the Fly?
I've asked a couple of other questions about parts of this issue, but I haven't explained the whole thing. I think I'm going down rabbit holes on specific issues; but if I explained the whole thing, perhaps someone could point me in a different, more productive direction.

I have a search page using the simple\_form tag. By default, it searches in the products channel. But we want a mechanism which allows users to alternatively search in the blog channel. So when they arrive on the search\_results page, in addition to the search results, we also display Product and Blog links. The Product link is highlighted, to show we're displaying product results. If the user clicks the Blog link, jQuery takes over, changes a hidden field called search\_type to "blog", and clicks the search button on the search form.

This brings us back to the search\_results page, but now we've passed the "blog" flag as a hidden field. We pick it up using stash:get, and use the search\_type as the channel parameter in the search:simple\_form tag...

Well, that's how it should work, anyhow. As I was writing that last bit, it occurred to me that the channel parameter had been parsed some time ago, so when we hit the search button, the channel is already encoded in teh hidden fields. (I'm guessing that's how it works.)

OK, so how would I handle this product/blog search thing? I've been going round in circles for over a day. Thanks for your help.

# Answer
> 1 votes
I have done something similar, but using categories in the mix.

My search form will search each category that is "selected" via named toggles. When the user searches using my simple search form I use jquery to override the search form, collect the toggled categories and then submit that url with the category and search values.

I then reload the results into the existing page, in a div.

Here is my code that I am using... hth

```
/* attach a submit handler to the contact form. By default, EE generates the ID "contact_form" */
    $("#calform").submit(function(event)
    {
      event.preventDefault();
      $('#calLoad').fadeTo('fast', 0.5);
      /* send the form data using post and check the results for any errors*/
      $.ajax(
      {
       url: "/",
       type: "post",
       dataType: "html",
       data: $(this).serialize(),
       beforeSend: function(){ },
       error: function(jqXHR, textStatus, errorThrown){displayAjaxMessage("Sorry, there was an error submitting your form.");},
       success: function(html, textStatus, jqXHR){
           $('#calLoad').fadeTo('fast', 1);
           $('#calLoad').empty().append(html);
           }
      });
    });

```

---
Tags: search
---


# Question
Title: Assets: pick a random one of the assets in this entry
If my client attaches 4 images to an Assets-field for an entry, how would I get a random one of those images? I was hoping something along these lines:

```
{exp:channel:entries channel='types'}
    {type_map_icon limit='1' orderby='random'}

    {/type_map_icon}
{/exp:channel:entries}

```

Where `{type_map_icon}` is the Assets-field which holds the 4 images. Any thoughts?

# Answer
Sorry, my bad! Assumed orderby='random' but the parameter = sort='random'!
> 1 votes

---
Tags: assets, pixelandtonic, random
---


# Question
Title: Jquery works in jsfiddle but not in my cart. Expresso Store
I have been working on some jQuery in jsfiddle and I currently have it working. However, when I apply the exact same script to my Expresso Store using EE it doesn't work. It's not outputting in js errors in Firebug. Any ideas?

Here is the fiddle http://jsfiddle.net/NnEdM/11/

And here is my site http://spartonenterprises.com/store/playground-mulch

# Answer
> 3 votes
This may not be the prettiest solution but, I got it working by removing the inline float:left and adding it to my css instead. Just to pass along, I wrote this jQuery to add mouse over functionality to swap product images, change the value of my select modifier, change the SKU and price on thumbnail mouseover.

```
 $(document).ready(function () {

        $('#fandeck #18 a').hover(function () {
           $(this).css('cursor','hand');
        $('.group').hide();
        $('#43').show();
            $('#selectImg').val('44').prop('selected', 'selected');
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_BLK.png")
          $('.store_product_sku').text('90509');
          $('.store_product_price').text('$7.50');

          });

        $('#fandeck #19 a').hover(function () {
           $(this).css('cursor','hand');
        $('.group').hide();
        $('#43').show();
            $('#selectImg').val('44').prop('selected', 'selected');
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_RD.png").fadeIn("slow");
          $('.store_product_sku').text('90509RD');
          $('.store_product_price').text('$18.00');
        });

        $('#fandeck #20 a').hover(function () {
           $(this).css('cursor','hand');
        $('.group').hide();
        $('#43').show();
            $('#selectImg').val('45').prop('selected', 'selected');
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_BRN.png").fadeIn("slow");
          $('.store_product_sku').text('90509BR');
           $('.store_product_price').text('$18.00');
        });

        $('#fandeck #21 a').hover(function () {
        $('.group').hide();
        $('#43').show();
            $('#selectImg').val('46').prop('selected', 'selected');
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_GN.png").fadeIn("slow");
          $('.store_product_sku').text('90509GN');
           $('.store_product_price').text('$18.00');
        });

        $('#fandeck #22 a').hover(function () {
        $('.group').hide();
        $('#43').show();
            $('#selectImg option[value=47]').prop('selected', 'selected');
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_BL.png").fadeIn("slow");
          $('.store_product_sku').text('90509BL');
           $('.store_product_price').text('$18.00');

       })
});

       //Image replacement for Playground Much Select
        $('.group').hide();
        $('#43').show();
        $('#selectImg').change(function () {
          var num = 43;
            $('.group').hide();
            $('#' + $(this).val()).show();
          if($(this).val()==num){ // Resets to Black if mouse over has changed source
            $("#43 img").attr("src", "/images/uploads/Playground_Mulch_BLK.png")
        }
        })

```

Here is the final jsfiddle and here's final result. http://spartonenterprises.com/store/playground-mulch

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


# Question
Title: At what point does the 404 template send it's response code?
I've recently launched a new site for a client. Their old site contained a lot of product pages with url parameters such as id=0123.

To try and alleviate people following dead links from Google etc I have implemented a system that looks up the id parameter against their old database, fetches the name of the product and then looks it up in the exp\_channel\_data table. If a match is found I have a 301 redirect at the top of the 404 template to send the visitor to what is hopefully the correct page.

If no match is found then the 404 page displays (though I may add some other sort of guessed lookup based on some other criteria later).

My question is, will that 301 get sent back to Google BEFORE the 404 response code generated by hitting the 404 template. Will the above method have the desired effect of telling Google that pages have moved to different URLs?

# Answer
The EE 404 page doesn't actually send a 404 header unless you are using a plugin or php in the template to specify that you want if be sent with a 404 header.
> 1 votes

---
Tags: redirects, 404, seo
---


title: Send Email from custom Addon

text:
# Question
Title: Send Email from custom Addon
I'm trying to send and email from a custom add-on using the Email Class and having no luck at all. I'm not totally sure how to debug this, as I've not got any server errors or anything like that.

This is the code I'm using as per the Docs:

```
$this->EE->load->library('email');
$this->EE->load->helper('text');

$this->EE->email->initialize();
$this->EE->email->wordwrap = true;
$this->EE->email->mailtype = 'text';
$this->EE->email->from($this->from_address);
$this->EE->email->to($receipient);
$this->EE->email->subject($subject);
$this->EE->email->message(entities_to_ascii($email_msg));
$this->EE->email->Send();

```

Are there any special requirements with regard to permissions I should be adding? I've created a separate user in order to post to a specific channel and then send notification emails.

I'm working locally at the moment and I've tried sending an email from the CP and that worked out ok, so I guess my email config is all right. I was logged in as the admin though.

Any help gratefully received.

# Answer
After messing about for a few days trying to re-invent the wheel, I decided to throw in the towel and just use FreeForm. No idea why I didn't come to this conclusion sooner.

Moral of the story - Make sure there aren't Add-ons out there which already do what you are trying to accomplish. You may have to adapt slightly to the way the Add-on does things, but in the end it'll save you time and money!
> 0 votes

# Answer
I would suggest to print the message by debugging with the code:

```
echo $this->EE->email->print_debugger();

```

Use this line of the code below:

```
$this->EE->email->send();

```

to see any server message.
> 2 votes

# Answer
I wouldn't rely on whether the email turns up in your inbox as a good way to tell whether it is being sent or not (even if it works from the EE communicate tab). Your code looks correct, and if there are no errors then it is most likely being sent fine.

The first thing I would do to troubleshoot is sign up for SendGrid (free for up to 200 emails per day), and enter their SMTP settings into EE. That way, you can look in their control panel and see every email that is being sent from your site (it also greatly increases the chances of your email being delivered, some really popular email providers such as Gmail will just plain block email from IP addresses they haven't seen before, or especially if another customer at your ISP has a record of sending spam).
> 1 votes

---
Tags: add-on-development, email
---


# Question
Title: P&T Assets: any way of importing images?
I was kinda hoping the new version of Solspace's importer module would make it possible to import images into Assets fields but alas.

I'm currently working on a site with a large (+-4000) product catalogue, each product is an EE entry with 1 image (product shot) in an Assets field + a list of product specifications. *(The spec data has already been successfully imported from a csv file using Solspace's importer)*.

Is there any way to, once the images have been uploaded to the default folder, import the filepath into the entry's Assets field? (EE 2.5.5 - Assets 2.0.5)

# Answer
I just made this work when doing an import from EE1.

I set up templates in the EE1 site to output the channel contents as XML. I was using nGen File Field there, so my image fields look like this:

```
<photo-photo>{filedir_1}{photo-photo show="filename"}</photo-photo>

```

nGen File Field uses `show="filename"` to only output the filename, so I could include the `filedir` reference as text in the template.

When I imported those into 2.5.5 using DataGrab, I had to set the fieldtype to be EE's File fieldtype first. Those paths would then work. I could see the images in the entry screens.

After I was done with the import, I changed the 2.5.5 fieldtype to Assets. Voila! Everything works.

If I had to re-import, I'd switch the fields back to File, import, and then switch them back to Assets.
> 2 votes

# Answer
If your original import included an image filename for each record then can just run an SQL query to prepend the filepath as `{filedir_X}` where X is the id of your upload directory. Do this for `field_id_Y` where Y is your Asset custom field's id. Add a where clause to for the relevant channel where Z is the channel\_id.

```
UPDATE exp_channel_data
SET field_id_X =  CONCAT('{filedir_Y}', field_id_X)
WHERE channel_id = Z

```

If your original import did not include the image filename for each record it would probably be worth doing another import from scratch or to update the exiting entries so you can get the image file name in there.
> 1 votes

---
Tags: assets
---


# Question
Title: Is there way to change a status of a safecracker entry with jquery?
I have a safecracker entry that I would like to change the status via jquery onClick or Submit? For example, I have one button that would be "save and preview" that onClick would change the status to "preview". There would be another button onClick button "Submit for Review" that would change the status of the same form to "pending". Is this possible?

# Answer
You can do it easily with the Mefu

Just create a template having mefu tag OR just put this code within a template like tempgrp/tempname:

```
{exp:mefu:save}{/exp:mefu:save}

```

and put this JQuery code to post the entry status to above template:

```
$.post("temp_grp/temp_name", { "[entry_id]:staus": "Open", mefu: "submit" }, function(data){
alert('status updates')
} );

```

For the same purpose, you can write the UPDATE query to update the entry status.

For the preview, use the load() of JQuery like:

```
$.post("temp_grp/temp_name", { "[entry_id]:staus": "Open", mefu: "submit" }, function(data){
$('#container_id').load('preview_template');
} );

```
> 1 votes

---
Tags: safecracker, jquery, status
---


# Question
Title: Freeform (Pro) and Multiple Site Manager
I just dropped my Freeform (Pro) form code into a template in a second site running on Multiple Site Manager. It's not rendering, and a peek in the Control Panel for site #2 shows no fields or forms.

This form is a duplicate of one set up for the main site, so I'm happy to see the submissions reside there, and for it to follow the settings there.

Is it possible to leverage the default site's Freeform setup? Or do I need to reproduce this in site #2?

# Answer
> 1 votes
It looks like this Solspace Support Forum post covers duplicating a form in your second site.

---
Tags: templates, multi-site-manager, solspace-freeform
---


title: CE Cache Escape tags being ignored

text:
# Question
Title: CE Cache Escape tags being ignored
This is a cross-post from the Devot:ee forums.
http://devot-ee.com/add-ons/support/ce-cache/viewthread/9173

I’m hoping I’m missing something simple.
My `{exp:ce_cache:escape}` tag pair simply seems to be ignored.

Templates aren’t unusual.

```
{exp:ce_cache:it}
  {exp:ce_cache:escape}
    {current_time format="%g:%i:%s"}
  {/exp:ce_cache:escape}
{/exp:ce_cache:it}

```

The time never changes.
When I look at the cached file through the CP, it shows the cached time, not the tag.

# Answer
> 3 votes
Escaping will escape pretty much everything it can with {exp..} tags and later in the parse order. If you would like to escape things with an early parse order too, like global variables, you'll want to use pre escaping. Here's an explanation from the Pre Escaping documentation.

> If the Escape tag is given a unique tagpart (example: `{exp:ce_cache:escape:blah}…{/exp:ce_cache:escape:blah}` has a unique tagpart of `blah`) then its tagdata will be pre-escaped (escaped even before segment variables and globals are parsed) when using EE 2.4.0+.

I hope that helps. :)

**Edit**

Here's a quick example:

```
{exp:ce_cache:it}
   <p>This should be cached: {current_time}</p>

   {exp:ce_cache:escape:pre}
      <p>This should not be cached: {current_time}</p>
   {/exp:ce_cache:escape:pre}
{/exp:ce_cache:it}

```

Disclaimer: I'm the author of CE Cache.

---
Tags: ce-cache
---


# Question
Title: EE1 -> EE2 Upgrade; Updated Wygwam settings page error
As stated in the title, I'm in the process of upgrading a site from EE1 to EE2, and I'm encountering errors on Wygwam's settings page. This is almost identical to the issue Lisa raised, with the exception of the line number in error #3 being different.

Errors 1-3 are all above the CP menubar:

```
A PHP Error was encountered
Severity: Warning
Message: base64_decode() expects parameter 1 to be string, array given
Filename: wygwam/helper.php
Line Number: 40

A PHP Error was encountered
Severity: Warning
Message: array_merge(): Argument #2 is not an array
Filename: wygwam/helper.php
Line Number: 42

A PHP Error was encountered
Severity: Warning
Message: array_merge(): Argument #2 is not an array
Filename: wygwam/mcp.wygwam.php
Line Number: 302

```

Errors 4-6 are immediately below the "Wygwam" heading (the one with the pencil graphic on the right-hand side), above the Preferences table:

```
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: base
Filename: views/index.php
Line Number: 3

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: license_key
Filename: views/index.php
Line Number: 11

A PHP Error was encountered
Severity: Notice
Message: Undefined variable: file_browser
Filename: views/index.php
Line Number: 28

```

The EE 1.7.1 site had Wygwam 2.6.3. The upgraded EE 2.5.5 site has Wygwam 2.7.

# Answer
> 1 votes
This was solved by enabling the Wygwam fieldtype under Add-Ons-\>Fieldtypes.

---
Tags: wygwam
---


title: Matrix hides row options in IE9

text:
# Question
Title: Matrix hides row options in IE9
This is in response to the thread posted here: https://getsatisfaction.com/pixelandtonic/topics/matrix\_in\_ie9\_hides\_row\_options which is no longer active.

Matrix 2.5.3 and Internet Explorer 9, the numbered tab on the left should give row options and the ability to reorder by dragging a dropping. In Firefox it works fine, however in IE9 no indicator shows there are row options and dragging to reorder doesn't work. Has there been any progress of resolving the issue?

Thanks! -Steve

# Answer
sorry to say that no, not currently. I added this to the to-do list of our next version of Matrix, but I can't make any promises about when will that see the light of the day.

Could you shoot an email to support@pixelandtonic.com referencing this question? I'll check it out in the evening when I get access to a Windows machine.

Thanks!
> 1 votes

---
Tags: matrix
---


# Question
Title: Is there a simple up-to date Structure tutorial?
I've been trying to get my head around Structure (3.3.8) for EE2 for almost 6 hours and I keep on going around in circles. I must have missed a basic concept.

I've read the documentation, read the Structure support site and it either refers me back to documentation that is not particularly clear, or to a tutorial / guide for a much older version of Structure.

I am trying to achieve in the Structure CP list something that resembles the following :

```
Company Information -
             --- About
             --- Legal
             --- etc ...

Product Group A -
             Product 1
             Product 2
             Product 3 etc

Product Group B -
             Product 4
             Product 5
             Product 6 etc

```

I have set up a channel for 'Company Information' which comprises of entries for 'about', 'legal' etc, I have also set up channels for Product Group A and Product Group B which have their own specific product entries.

Something is obviously not connecting in my mind as to how Structure is supposed to work.

Can anyone shed some light on this without referring back to the official Structure documentation.

# Answer
> 4 votes
Your channels should not match your nav, they should match your page types. So you really only need, in what you've laid out:

1. Channel: Pages
2. Channel: Products

Pages has the fields that comprise a Page. Products has the fields that comprise a Product.

Go to Channel Settings on your Structure screen. You'll see those two channels. Set each as Type: Page. Then set a template that has the code that renders them appropriately.

That template just needs `{exp:channel:entries channel='pages'}` or `{exp:channel:entries channel='products'}`. `Dynamic="on"` by default, and Structure passes in the entry reference.

That's it. Now on the Structure screen, when you click Add Page at any level in the tree, you can choose Pages or Products to insert a page into the navigation hierarchy.

There's obviously much more you can do. Just remember, a page = channel entry married to template at a specified URL.

# Answer
> 0 votes
I created this screencast a while ago https://vimeo.com/26023392

---
Tags: ee2, structure
---


# Question
Title: Exp:resso Store Unable to locate file ID Since Upgrading Assets - I Think
I am seeing this after upgrading Assets to 2.0.5 - it was working perfectly before - I know everyone says that. Environment is EE2.5.5 Store 1.6.3 My template:

```
<tr>
    <th>Order Hash</th>
    <th style="width:14%;">Order ID</th>
    <th style="width:14%;">Order Date</th>
    <th style="width:14%;">Items</th>
    <th style="width:14%;">Total</th>
    <th style="width:14%;">Status</th>
    <th style="width:14%;">Download</th>

</tr>
{exp:store:orders member_id='CURRENT_USER' secure="yes" order_by='order_date' sort='desc'}

{if no_orders}
    <tr class="product_detail">
        <td colspan="4">Sorry, no matching orders were found.</td>
    </tr>
{/if}
    <tr class="product_detail">
        <td>{order_hash}</td>
        <td style="text-align: center;"><a class="onwhite" href="{path='products/order/{order_hash}'}">{order_id}</a></td>
        <td>{order_date format="%d/%m/%y %H:%m"}</td>
        <td>{items}{title}<br />{/items}</td>
        <td>{order_total}</td>
        <td>{order_status}</td>
        <td>
            {exp:store:download order_id="{order_id}" url="{software}" class="onwhite"}
                Download
            {/exp:store:download}
        </td>
    </tr>

{/exp:store:orders}

```

The file is visible in the EE file manager. This appears to be different from question 769 since it was working before, but stopped after upgrading Assets. Can anyone see what I am doing wrong?

# Answer
> 0 votes
This problem turned out to be due to a database corruption that occurred during one of the software upgrades, most likely the Store upgrade. Since I corrected that, all is well again.

# Answer
> 0 votes
There shouldn't be an issue if you have uploaded the file via the native file browser from upgrading Assets. Try changing your template to the following:

```
<tr>
    <th>Order Hash</th>
    <th style="width:14%;">Order ID</th>
    <th style="width:14%;">Order Date</th>
    <th style="width:14%;">Items</th>
    <th style="width:14%;">Total</th>
    <th style="width:14%;">Status</th>
    <th style="width:14%;">Download</th>

</tr>

    {exp:store:orders member_id='CURRENT_USER' secure="yes" order_by='order_date' sort='desc'}

    {if no_orders}
        <tr class="product_detail">
            <td colspan="4">Sorry, no matching orders were found.</td>
        </tr>
    {/if}
        <tr class="product_detail">
            <td>{order_hash}</td>
            <td style="text-align: center;"><a class="onwhite" href="{path='products/order/{order_hash}'}">{order_id}</a></td>
            <td>{order_date format="%d/%m/%y %H:%m"}</td>
            <td>{items}{title}<br />{/items}</td>
            <td>{order_total}</td>
            <td>{order_status}</td>
            <td>
      {items}
                {exp:store:download order_id="{order_id}" url="{software}" class="onwhite"}
                    Download
                {/exp:store:download}
      {/items}
            </td>
        </tr>

    {/exp:store:orders}

```

This should allow Store to know which item to generate the downloads for.

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


title: Multiple Relationships

text:
# Question
Title: Multiple Relationships
This one's a little hairy. I have 3 channels: Products, Where to Buy Product and Retailers. We're displaying a Where to Buy dialog on the Products page. So I have 6 relationships on the Where to Buy Product channel: one to the Products channel, and 5 to the Retailers channel. (Yes, I have retailer\_1, retailer\_2, and so on.)

The Retailers channel is just an image for the retailer's logo. The Where to Buy Product channel is the product reference, and 5 sets of retailer references, and associated links to the retailer's website for that product.

Here's the code I put together:

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

{reverse_related_entries channel="where_to_buy_product"}
    {retailer_1}<br>
    {link_1}<br>
    {related_entries id="retailer_1"}
    <img src="{retailer_logo:logo}" ><br>
    {/related_entries}

    {retailer_2}<br>
    {link_2}<br>
    {related_entries id="retailer_2"}
    <img src="{retailer_logo:logo}" ><br>
    {/related_entries}
{/reverse_related_entries}

{/exp:channel:entries}

```

So I got to the first level, where I can display the link to the retailer's website; but the second level, reaching to the Retailers channel, doesn't seem to work. I'm getting a funky code in curly braces that changes on each request. ({REL\[79\]\[retailer\_1\]AT42ME0eREL} ) I even tried switching to reverse\_related\_entries, even though that doesn't make sense to me, and apparently, it doesn't make much sense to EE either. (It dumped the {reverse\_related\_entries} tags.)

Can anyone help me make this work? I hope I have the concepts down right. Thanks for your help.

# Answer
> 1 votes
Whenever I need to deal with complex relationships in EE I always turn to Playa. That should provide you with a nice way to make the associations and also to return the relationships from simple tags in the templates. It's a commercial addon but if complex relationships between your channel data are core to your site then it's worth the investment in time it will save you.

# Answer
> 1 votes
Try the Tied Entries plugin - it allows you to reach data that's more than one relationship away: http://engaging.net/products/tied-entries

---
Tags: relationships
---


# Question
Title: Is there a CartThrob variable for shipping_tax?
I can't seem to find any mention of one in the documentation - is there a CartThrob variable for the tax calculated against the shipping charge (when you have shipping set as taxable)?

I was able to find one that is the shipping rate plus the added tax:

```
{exp:cartthrob:cart_subtotal_plus_tax}

```

But I have not been able to find one for the tax amount separately. Anyone know if it exists? And if so, what it is?

# Answer
> 3 votes
You might be able to try a `{exp:cartthrob:cart_items_info}` tag pair which loops through all the items in your cart.

They have `{cart_shipping}` and `{cart_shipping:plus_tax}` tags available.
So, you could work it out yourself using the Arithmetic tag.

```
{exp:cartthrob:arithmetic operator="-" num1="{cart_shipping:plus_tax} num2="{cart_shipping}"}`

```

Put it all together: (Limit by 1 so it only outputs once)

```
{exp:cartthrob:cart_items_info limit="1"}
  Shipping: {cart_shipping}<br />
  Shipping Tax: {exp:cartthrob:arithmetic operator="-" num1="{cart_shipping:plus_tax} num2="{cart_shipping}"}<br />
  Shipping Total: {cart_shipping:plus_tax}
{/exp:cartthrob:cart_items_info}

```

---
Tags: cartthrob
---


title: Google Sitemap Issues

text:
# Question
Title: Google Sitemap Issues
I am trying to add a Google Site Map for my site but am having a few issues. I get the following errors from Google (see attached).

I guess it is to do with:

```
{gmt_edit_date format="%Y-%m-%d;T;%H:%i:%s%Q"}

```

but I am not an expert. I was just following a screen cast. Any help would be appreciated.

# Answer
{edit\_date format="{DATE\_W3C}"}
> 1 votes

# Answer
I've used the following format in Google sitemaps without any issues:

```
{gmt_edit_date format='{DATE_W3C}'}

```
> 0 votes

# Answer
You've just got a couple of superfluous semi-colons in around the T. Change:

```
{gmt_edit_date format="%Y-%m-%d;T;%H:%i:%s%Q"}

```

to:

```
{gmt_edit_date format="%Y-%m-%dT%H:%i:%s%Q"}

```

Google should accept that but you'll need to give it time to re-spider your pages again. Give it 24-48 hours and you should see things resolved back in Webmaster tools.

To provide a longer explanation for anyone who's interested; Google expects the date to be in a W3C valid date/time format. Both of these are acceptable:

> 2005-02-21
>
> 2005-02-21T18:00:15+00:00

But if you specify the time then you must also specify the timezone. In this case you're doing so with GMT so that's fine.

As mentioned, you can also use:

```
{gmt_edit_date format='{DATE_W3C}'}

```

Which is actually just a shortcut for the corrected code provided above. It will output the exact same thing.
> 0 votes

---
Tags: google-webmaster-tools
---


# Question
Title: Is there a maximum number of emails that can be sent through EE?
We are looking into an email solution for our client. They would like to email their site members once or twice a month. The amount of members is around 6,000. Does anyone know if there is a maximum number of emails that can be sent via ExpressionEngine (Tools \> Communicate)? It is set up to send via SMTP (SendGrid). Note: we have the ability to send 40,000 emails per month with SendGrid, so that would not be a bottleneck. I would appreciate any insight or feedback you can offer. I have very limited experience sending emails via the Control Panel's Tools \> Communicate.

# Answer
> 2 votes
That doesn't sound like a problem. ExpressionEngine provides 3 protocols; PHP Mail, Sendmail, and SMTP. It's always better to use SMTP where possible and even better if you're outsourcing it to an email gateway like SendGrid.

The only thing to be cautious of is the batch size of large distributions. In the CP go to Admin \> Email Configuration and set '*Batch mode*' to '*yes*'. Then in the field underneath set a value for how many to send out in one batch. It's recommended to start off with something small like 300 or so and see how that goes first. If that goes OK with no errors or timeouts then you can experiment gradually increasing the batch size. SendGrid will be able to provide you with some other useful stats to do with the send success.

The batch mode is there to guard against timeouts and the batches are sent in quick succession so it should still be processed fairly quickly. Other than that it shouldn't have any problems with your scenario. :)

---
Tags: control-panel, email
---


title: Bend Structure to meet goals

text:
# Question
Title: Bend Structure to meet goals
We're having to use structure to do what would normally be pretty straight forward, now need to know if this scenario is even possible:

```
Main URL Structure:
discipline01 URL://discipline01
  --Child01  URL://discipline01/Child01
  --Child02  URL://discipline01/Child02
discipline02
  --Child03
discipline03
  --Child04

"discipline0X" are all top level "pages", "Child0X" are sub "pages".

```

I initially set this up as Pages with child pages (as per above) and it worked. Now word is we need to keep these "Child" items but have them exist in multiple "top level pages" like this:

```
discipline01 URL://discipline01
  --Child01  URL://discipline01/Child01
  --Child02  URL://discipline01/Child02
  --Child03  URL://discipline01/Child03
discipline02
  --Child01  URL://discipline02/Child01
  --Child03  URL://discipline02/Child03
… etc

```

No amount of faffing around yields the results I seek. The top level "pages" form the basis for the main navigation (just to compound things). Can't create template.groups as top level items may change.

Categories are the pseudo logical solution but Structure with Categories seems umm, inadequate ?

**Ideally, Structure should manage all this content.**

"Listings" are great except they only apply to one item. "Assets" - dont fit

I'm about to punch something, please, any inisghts welcome!

# Answer
> 2 votes
Is this a typo whilst copy/pasting or are discipline02 children meant to cross-link to discipline01 children?

```
discipline02
  --Child01  URL://discipline01/Child01
  --Child03  URL://discipline01/Child03

```

If I understand correcly I'm not sure Structure is the best fit in this situation. Structure largely exists to provide that familiar page-based CMS system to those used to it but EE by default is more of a resource description framework (i.e. it deals with streams/channels of content). Unless it's a strict one-to-one relationship with pages and URLs then Structure probably isn't the best thing to run this setup through.

I don't know what the child pages are or even the disciplines from what you've provided but I would take it back to channels and categories. You could have a '*discipline*' channel and then use categories to manage their hierarchy. That way you could apply a 'discipline' entry to both 'discipline01' and discipline02' and the URLs would follow the template\_group/template structure. with a few cunning condtional segment variable checks you could make it appear in multiple locations.

Hopefully that makes sense but if you're still in need of advice just let me know.

---
Tags: structure
---


# Question
Title: Performing an actual redirect to 404 page
I'm having no trouble displaying a 404 page when using `{redirect="404"}`, but is there any way to *actually* redirect to my 404 page? ie. changing the url to /404 ?

I've seen Ryan's blog post, but he uses PHP to do it. Should I just write a simple plugin to do that?

**Update:**
I've created a plugin for this behavior.
https://github.com/jazonv/fourofour

# Answer
Sure. You just need to use the native redirect tag:

```
{redirect='site/404'}

```

That will redirect to the template\_group/template specified. :)
> 0 votes

---
Tags: redirects, 404
---


# Question
Title: Require SSL connection for checkout and order tags problem
EE v2.4

Store v1.6.1

Toggling the "Require SSL connection for checkout and order tags" setting doesn't do anything. There are Checkout Tags, but those pages do not get redirected to HTTPS. I can manually enter the URL with the HTTPS protocol without issue.

Thanks in advance for your help.

# Answer
Sometimes the way folks code to determine whether HTTPs is on or not is not according to the PHP docs which is maybe what you are running into. I've fixed this HTTPS issue with Mo\_variables which is why I am mildly seasoned with knowledge about it:

An alternative solution is one I use that involves using two plugins by rsanchez.

1. Mo\_variables (be sure to update as I made a pull request adding some variables)
2. Http\_header

With those two installed you can then do the following at the top of you template (you can do the opposite too on nonsecure templates):

```
{if not_secure}{exp:http_header location="{secure_site_url}{uri_string}" status="301"}{/if}

```
> 2 votes

# Answer
This can quite often be something happening on the server/network level that you don't specifically know about. I had a similar problem and I eventually discovered that it was due to some reverse proxying being done on the server that I wasn't aware of. It could be worth confirming with the hosts. I wouldn't be surprised if MT were doing something similar.

Failing that a solid solution is to use DM Force SSL. It's a very useful plugin and just ensures that page is served up over SSL. No harm in being sure either way. You simple place:

```
{exp:dm_force_ssl:force}

```

At the top of the template and it will always redirect.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: image file upload with safecracker error, when file becomes too big
I let users upload images via safecracker.

The process is very standard:

1. User submit form (fields: name, email, selected file from users HD)
2. Safecracker uploads the file into the appropriate directory
3. Safecracker adds an entry to the submit channel in the database
4. The users gets redirected to the submit/thanks page
5. I get a mail announcing the upload

My problem: This only works for files with a certain size. I can confirm, that it is fine for files with the size 840kb and that files with more than 2577kb will not work. Somewhere in between will be the breakpoint, which I haven´t figured out yet.

For the big files EE will just do point 2. The file upload will be fine, but the redirect won´t work. The submit-page will turn blank, as if the browser attempts to redirect, but can´t get the thanks-page to load. 3 and 5 aren´t executed.

I think, I found the error

```
Fatal error: Out of memory (allocated 49020928) (tried to allocate 4000 bytes)
in www/frogcroc.com/www/system/codeigniter/system/libraries/Image_lib.php on
line 1246

```

I assume, that I get this error, because my memory limit on the server is exhausted (shared hosting). I assume, that EE tries to make one of those "internal" thumbnails that are needed for watching the entry in the CP.

I need to know: Are my assumptions right? If yes, what are my options?

I can ask my provider to give me more memory. Question: For how much should I ask, and what kind of memory is it, the PHP image memory? What are the technical terms to describe what I want?

**Preferred method:** Let the users upload all images, how big they might be, but avoid the memory issue, by not invoking the thumbnail routine. I don´t need to see the picture in the CP entry. I´m fine to just get the file name. Preferrably as part of the mail. How can I change the file-fieldtype in the channel "submit", that shows the thumbnal into a text field, that just shows me the filename?

# Answer
Here´s what I did: I iterated til I found the max file size, which is around 2,2 MB. I set this as a limit in the CP file manager in order to avoid, that users can upload bigger files. I also ask users to sumbit images with a least 1200 px width. This will give me a sufficient image quality. This is a very pragmatic solution, that doesn´t solve the problem, but something I can live with. It´s easier to take this route, than to discuss this issue with my hosting company or to upgerade to my own server.
> 1 votes

# Answer
It sounds like a limit on upload size so I'd check this first. In the control panel go to Tools \> Utilities \> PHP Info. Search for:

* post\_max\_size
* upload\_max\_filesize

What are those set to?
> 0 votes

# Answer
Looks like PHP needs more memory to complete the upload process.

With most hosts you can adjust this in your .htacccess file. Add the following to your file:

```
php_value memory_limit 128M

```

If PHP throws the error at 128MB, increase it until you hit a number that works for what you're doing.
> 0 votes

---
Tags: ee2, safecracker, file-uploads
---


title: PHP Memory Limit & EE Wizard

text:
# Question
Title: PHP Memory Limit & EE Wizard
I am running the EE Wizard to check the compatibility of a new server I may be working with.

All tests pass except for the PHP Memory Limit.

In the cPanel of the hosting server, it shows that memory\_limit is set to 32M, so why would the EE Wizard be failing this part of the check?

# Answer
Just a few things I can think of off the top of my head. Run a php info script in the locate where you plan to install expressionengine. See what the script tells you the memory limit is there at that point. It is possible there may be some configuration override happening that means what you've got in cpanel is not what you actually have where you are trying to install.

Another thing that I'm sure you probably know, but I have seen people make the mistake before:

PHP memory limit is different from PHP upload size.

If it is allowed on the server you are working with you could try the following in an .htaccess file to get the settings how you want them:

```
php_value memory_limit 32M

```
> 2 votes

---
Tags: memory-limit
---


# Question
Title: Stash, switchee and template caching outputs a random string {6ee64145dfa4ae5926a9c326266d5954499133923}
I am using EE's next\_entry tag to link to the next entry, and then using a stash/switchee combination to evaluate if we are at the last entry in the loop and if so use a channel entries loop to display the first entry.

Everything works fine and it does what I expect with the following code.

But when I turn on EE's template caching, I get a random string as follows:

{6ee64145dfa4ae5926a9c326266d5954499133923}

The problem seems to be inconsistent as this doesn't happen all the time. Template caching right now is at 60 minutes, but after clicking around a bit the string appears occasionally every few minutes and I haven't found a pattern to the issue.

Here's the block of code I'm using:

```
{exp:channel:next_entry channel="video" url_title="{segment_2}" orderby="date" sort="asc"}

  {!-- If next_entry doesn't run then we are at the end of the loop so this stash won't be set --}
  {exp:stash:set name="st_next_entry"}next{/exp:stash:set}

  <span>Next: </span>
  <a href="{path='{segment_1}'}">
    {title}<span> ›</span>
  </a>
{/exp:channel:next_entry}

{exp:stash:parse process="end"}
  {switchee variable="{exp:stash:get name='st_next_entry' random}" parse="inward"}

    {case value="next"}
      {!-- Do Nothing, link to next entry is already displayed --}
    {/case}

    {case default="yes"}
    {!-- Display start entry link, because the next_entry loop didn't run so stash value was left empty --}

      {exp:channel:entries channel="video" dynamic="no" disable="categories|category_fields|member_data|pagination" status="open" limit="1" sort="asc"}
        <span>Next Video: </span>
        <a href="{url_title_path='{segment_1}'}">
          {title}<span> ›</span>
        </a>
        <br />
      {/exp:channel:entries}

    {/case}
  {/switchee}
{/exp:stash:parse}

```

I'm guessing that the {6ee64145dfa4ae5926a9c326266d5954499133923} string is actually a placeholder of some sort and that the template parser isn't getting around to filling in the proper value when I turn on the template caching.

Thank you for any assistance you can provide.

Also, if someone knows their way around EE's native tag caching options and how to use the cache="yes" refresh="60" parameters. Are they only for EE native tags, or can it be used across the board for any exp: tag, including also related\_entries/reverse\_related\_entries tag pairs and the output of 3rd party plugins?

* oliver

# Answer
> 3 votes
For anyone that has encountered this same issue, Mark Croxton was able to solve the issue at the devot-ee support forum.

Essentially, wrapping the next\_entry tag pair with a stash parse tag like so {exp:stash:parse}....{/exp:stash:parse} on the first code block solves the issue.

Full support thread: http://devot-ee.com/add-ons/support/stash/viewthread/9131

---
Tags: stash, switchee, next-prev
---


# Question
Title: Custom Field Type - Data not passing to the view
I'm trying to create my own custom field type, however, when I go to load the view, the var's within my display\_field function, are Undefined. All I'm trying to do, is Load a view file, then in the view, loop through and array.

Example:

```
function display_field($data)
    {
        $entry_id = $this->EE->input->get_post('entry_id');
        $query = $this->EE->db->query("SELECT * FROM exp_channel_images WHERE entry_id = '$entry_id'");

        $channelImages = array();

        if ($query->num_rows() > 0)
        {
            foreach($query->result_array() as $row)
            {
               array_push($channelImages, $row);
            }
        }

        return $this->EE->load->view('index', $channelImages, TRUE);
    }

```

Then, my view file is called index.php, and is located under:

/third\_party/channel\_images\_sources/views/index.php

# Answer
> 1 votes
First, for new entries the get\_post(entry\_id) probably isn't set (check and verify it before running your query). Second, the view loader **extracts** the vars array passed to it, and your array doesn't have keys. instead of passing $channelImages array, try passing it inside an array, something like array('chanimg' =\> $chanimg)

See example below, and the part "adding dynamic data to the view"
http://ellislab.com/codeigniter/user-guide/general/views.html

```
$data = array(
  'chanimg' => array()
);

$entry_id = $this->EE->input->get_post('entry_id');
if ($entry_id > 0){
    // query
    // $data['chanimg'][] = $row;
}

return $this->EE->load->view('index', $data, TRUE);

```

# Answer
> 1 votes
The display\_field function of field type will not load view file so you need to return the data / content which you would like to show at edit or publish forms and SAEF.

Like:

```
function display_field($data){
/***
other code
**/

return "<div>SOME DATA or VARIABLES</div>";

}

```

---
Tags: custom-fields
---


# Question
Title: Is there a way of capturing card payments to be able to process them manually afterwards?
If the server is set up PCIDSS Compliant and I want to store the card details to be processed using a conventional cart facility, is this possible?

I also need to be able to take direct debit info, can this also be done in some way, or in conjunction with another plugin like freeform etc?

Thanks Guy

# Answer
> 1 votes
I'd highly recommend *against* storing any card details. It can only go to cause problems. PCI DSS compliance is not just about the server security but even physical security. The premises will need to be highly secure and adhere to compliance levels as well as external locations for backups etc. Everything would need to be encrypted in storage and in transit and then even if you do meet those levels there is always a chance of having something stolen and then you'd be in a LOT of trouble so your insurance would go through the roof too. It really isn't worth it.

If you're using a service such as Spreedly Core then they provide a *Vault* which allows you to retain credit card details for re-use next time via a secure token based system. This puts the responsibility firmly on their shoulders then and is a much better way.

Using Spreedly Core you can then also allow the user to choose their gateway so you can setup a gateway for accepting credit cards and also one for accepting direct debit payments and allow the user to choose or to specify yourself.

Alternatively if you wanted to setup a credit card gateway and then a direct debit gateway individually then that's possible in Store too. GoCardless is a good direct debit gateway if you're UK based and I'd recommend Dwolla if you're US based. The GoCardless gateway is already provided as part of store so you can use that out of the box.

# Answer
> 0 votes
It's unclear whether you want to store credit cards and charge them later, or just initiate a charge and complete it at a later date (usually once you have shipped the items). This is known as separate authorize/capture.

Store doesn't support storing credit cards, but it does support authorize/capture, you just need to enable it under general settings.

---
Tags: expresso-store
---


title: Assets - How to show file hierarchy

text:
# Question
Title: Assets - How to show file hierarchy
After getting files properly indexed on the backend, how can they be displayed through a template on the front-end using the two assets:folders and assets:files?

If the file structure looks like this on the server:
Folder A
\- file1
\- file2
\- Folder B
-- file3
-- file4
--- Folder C
---- file5
---- file6

... and was indexed with Assets, using their tags how could I display that in an unordered nested list? Th example on their site with folders and files is close, but isn't nested. The end goal is a browsable download page with EE goodness. If not, is there a better way with navigation, maybe like their backend?

# Answer
Assets 2.1 is out and for me it works like this:

```
<ul>
    {exp:assets:folders parent_folder="{filedir_}"}
        <li>{folder_name}</a>
            {if total_subfolders}
                <ul>
                    {subfolders}
                </ul>
            {/if}
            <ul>
                {exp:assets:files folder_id="{folder_id}"}
                        <li><a href="{url}">{if title != ""}{title}{if:else}{filename}{/if} ({size})</a></li>
                {/exp:assets:files}
            </ul>
        </li>
    {/exp:assets:folders}
</ul>

```
> 2 votes

---
Tags: assets
---


# Question
Title: How can I get a site running under MSM (not the 'default_site') to recognise that I'm logged in?
I have a Multi Site Manager set up running 6 sites from a single EE installation.

I am trying to troubleshoot a problem on one of the sites and have turned on template debugging but it doesn't get shown. From past experience I have recalled that this is because the "sub-site" doesn't recognise me as being logged in as a Super Admin - even though I am logged in to the "master" site as a Super Admin.

How can I get the other sites to acknowledge that I am logged in to the CP?

Again, from memory I think I previously managed this by dropping an admin.php file into the sub-site's directory structure and logging in from that site instead of the main one. Not had time to try this again but I wondered if there was a "proper" way to do it?

# Answer
> 1 votes
**Step 3 of the MSM docs** indicate that this is done by adding the admin.php to the web root for the site.

> Open domain2’s new admin.php file (this is the file that allows Control Panel access on the new site) and make the following changes:
>
> Tip: In some multi-site situations, you may not want to allow Control Panel access from anyhere other than domain1. This file can be removed in those cases.
>
> Update the $system\_path variable to indicate the path from this file to your installation’s system folder. Typically this can be a relative path, but some servers may require a full, absolute path.

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

```

---
Tags: multi-site-manager, login, cookies
---


# Question
Title: Cannot change the template assigned to an entry item
I am working on a complex EE site (version 2.5.2) that I've been handed that has a large number of templates. I wish to customize the template for a specific entry. I have created a duplicate of the template that an entry item is using. I wish to change that template to accommodate a design change. The original template for that entry item is "index" and the new template is called "graduate-program" However, when I edit said entry item, and then use the "template" dropdown menu to change the template assignment to "graduate-program" and click "submit" the entry's template does not change. It remains the "index" template.

Any ideas on how to resolve this?

### Update: more details:

The channel in question has 8 channel entries associated with it. I wish for *one* of the 8 entries to use a unique template.

Snippet from the currently-selected template. This allows me to confirm via *view source* which template EE is applying to the content:

```
{embed="common/_header"}

<!-- academics/index -->

{if segment_1 == "academics" && segment_2 !="" && segment_2 !="a"}
{if segment_2 != "" && segment_3 == ""}

```

The channel entries in question

The entry in question as output via the edit entry page, shows the wrong template as being the current selection. (had to remove external link to screenshot)

Finally, here is what I'd *like* to use for the template for said item:

Please let me know what other details I may provide for clarity.

# Answer
EE doesn't generally follow the conventions of some other CMS's like WordPress where each post can have a specific template assigned to it via the entry screen. Templates are assigned in EE via their URLs, because (as Ian mentions), URLs in EE follow a **template\_group/template/entry** pattern. So generally, you'd change the display of an entry by linking to it using a different *template* in the URL.

(The **Template** field you show in the screenshot appears to be the template option for entries which use the Pages module, which is one exception where you *can* assign a template per-entry.)

However, you could add a new custom field to your channel, called, say, **Entry Template** (`arch_entry_template`), and give it two options:

* Standard
* Graduate Program

Choose "Graduate Program" for your one-off entry, then save. (No need to save the others as "Standard".)

Then in your **academics/index** template, within the Channel Entries tag:

```
{if arch_entry_template == 'Graduate Program'}

    Your new template code goes here

{if:else}

    The old template code goes here.

{/if}

```
> 2 votes

# Answer
If you edited a template FILE then it could be that the site is pulling the original template from the database. Have you synched your templates?
> 0 votes

# Answer
There is no template assignment as such if you're not using the Pages module (as you mentioned). EE follows a **\*template\_group/template\*** pattern for Channel Entries so if you want to change a specific template to accomodate a design change you need to give it the same name as the existing one (in this case ***index***).

Backup the old one and rename it to **\*index\_old\*** or something along those lines, then call your new one ***index***. If it's a Channel Entry then the changes will be applied automatically as it picks up the template based on the URLs.
> 0 votes

# Answer
I still haven't read whether or not you've used the Pages module and whether it's succeeded or failed.

This is almost the definition of the purpose for the Pages module.

Please confirm that applying this template to this channel entry does or does not work via the Pages interface of the channel entry.
> 0 votes

---
Tags: ee2, templates, entry
---


# Question
Title: Low Search - Why does a range value evaluate to a blank string instead of a literal 0?
There seems to be a problem with having a zero(0) value in a select dropdown.

I am using select dropdown to do some minimum-maximum ranges on a field.

```
<select name="range-from:foo">
<option value="">Min Foo</option>
<option {if "0" IN ({low_search_range-from:foo})}selected="selected"{/if} value="0">0</option>
....
</select>
<select name="range-to:foo" id="property_number_of_bedrooms_to">
<option value="">Max Foo</option>
<option {if "0" IN ({low_search_range-to:foo})}selected="selected"{/if} value="0">0</option>
....
</select>

```

I tried choosing the option with value="0" and then submit. When I get back on the page, the option with the value="" is selected.

I tried outputting {low\_search\_range-from:foo} and {low\_search\_range-to:foo} and they both output a blank string.

It seems that low search probably type casted this to a string which returned a blank string.

How to solve this? I want to get 0 as my value literally when the option value is 0.

# Answer
> 1 votes
Adding this as an official answer. The question was related to Low Search version 2.1.2. Upgrading to the latest version (currently 2.3.0) solved this issue.

---
Tags: low-search
---


title: Template Starter Files

text:
# Question
Title: Template Starter Files
I am looking for a starter kit just like the one of starterfiles.com. This domain name is not longer in use and doesn't provide the download file anymore. Is there any, not named EE, that why I can't find it, github project that provides a template starter kit for ExpressionEngine 2?

Thank you.

# Answer
> 1 votes
It's on the waybackmachine http://web.archive.org/web/20110901211254/http://starterfiles.com/download

And it says the download is now on github https://github.com/Jenn/ExpressionEngine-2-Starter-Files

Also, ExpressionEngine comes with a test project, you can install, called Agile-records. You can install a fresh copy of EE with that, onto your development station and have a look.

Some free turorials are available on http://www.train-ee.com/courseware/free-tutorials . If you like the course, consider taking a online course or training.

---
Tags: templates
---


title: Programmatically Uploading Image

text:
# Question
Title: Programmatically Uploading Image
I've got a channel where the editor is specifying a YouTube link. I'll also need a still from the video, which I can get from YT (see https://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api); but I want to store the image locally. How would I go about capturing or uploading the file to my upload directory, and having EE perform the resizing service?

Thanks for your help.

Update: I should have specified that I don't want the user to upload the video still. At this point I've got the video ID, and the CMS should fetch the still from YT, and load it into EE's file manager. Any way to do that?

# Answer
If you are not completely married to the idea of storing and syncing the remote images with an actual *EE* upload directory, and using EE for all image size processing, then take a look at CE Image.

CE Image can work with remote images, resizing them as needed (very customizable) and then storing a cached local copy on your server. It is a very well-documented and flexible add-on with a ton of features. It's my go-to for all image manipulation and judging by all the rave reviews it has I don't think I'm alone on that!
> 2 votes

# Answer
First of all you need to download the YouTube image via CURL and after that save it within the preferred directory.

```
$imgURL = 'youtube image link';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $imgURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$imgContents = curl_exec($ch);
curl_close($ch);

$upload_dir_path = 'upload/directory/path';

$file = @fopen($upload_dir_path, 'wb');
@fwrite($file, $content);
@fclose($file);

```

**Please Note:** I didn't test above code. It would give a good pointer to code this feature.
> 1 votes

---
Tags: file-uploads, image
---