# Question
Title: The day before a big meeting....site disappears
Yup. I was finalizing a design by FTPing a revised stylesheet to my server and my entire domain went down for about 1/2 hour. It came back up but the website I wasb preparing on a subdomain shows up as a white screen. Looking at the source there is no code. However, I am able to log onto EE CP and my data is still present.

I'm currently on the line with my host (MT) so see if the issue is on their end. Has anyone experienced this on EE's end? If, so where should I start looking for a solution?

Thanks.

Update: Now I can see my raw HTML, but no CSS or EE templates.

Update: And now I just disabled the structure module and lost my site tree. :(

# Answer
> 1 votes
@cscott, were you saving your templates to the file system? I assume yes because you mention ftp. Check in your Exp Eng control panel under design \> templates \> global preferences. Is the file directory for templates that points to still valid? Are there any files there when you look using an ftp client? Next check the 'synchronize templates' and see if there is a green check mark next to all of them. If not then synchronize all of the templates. Also check if all of your template groups are there in the template manager.

I'm not sure what you mean by being able to see 'raw html but no css or ee templates'

You will likely have to reset all of the channel settings in Structure and then add each content entry back to Structure using the 'structure' tab in the Edit screen of Exp Eng for each entry. Unfortunately uninstalling the module does lose all the info.

But if you can get a backup from the hosting company just prior to the outage that would be optimal. Likely there is a mismatch currently between what is in the Exp Eng database and what is in the actual file system. Unfortunately you'll have to track down each mismatch one at a time.

---
Tags: server
---


# Question
Title: Low Variables and Matrix and Playa - Oh My!
I've been searching everywhere and tried many options, so I'm reaching our for some help.

I'm Running EE 2.6.1, LV 2.4.2, Matrix 2.5.10 and Playa 4.4.5.

I've got a Low Variable called 'lv\_obv\_lot\_directory' with 2 columns: one is a simple dropdown (with numbers) called 'm\_lot\_location' and the other is a Playa field called 'm\_lot\_vendor', which pulls from a channel called obv\_members.

Running this in the basic form

```
{exp:low_variables:pair var="lv_obv_lot_directory"}
  <div>{m_lot_location}
{/exp:low_variables:pair}

```

gets me a list of the numbers (in the order they are listed in the LV).

But I can't get it to pull the list of associated vendors. I've tried so many things, including a special embedded template. The closest I came was with an embedded template

```
{exp:channel:entries channel="obv_members" fixed_order="{embed:entry_ids}"  dynamic="no" disable="member_data|pagination|categories" status="not closed"} which just gave me a list of all of the vendor entries.  If I change it to fixed_order="0|{embed:entry_ids}" then I just get the first entry.

```

I think I'm close, but obviously missing something. HELP!!! :(

# Answer
Bob's post had me rethink the embed tag that I had, and in doing so I realized that there was an error in what was being fed to the fixed\_order parameter. Once I fixed this, things started to populate as expected.
> 0 votes

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


# Question
Title: CartThrob: Discount Plug-In - Buy X Get Y not working
I've recently installed the following CartThrob discount plug-in and it's not working. I can't get it to add the free product "Y" to the Cart.

**Buy X Get Y** https://github.com/CartThrob/cartthrob-discounts-buy\_x\_get\_y

My discount settings...

I'm running EE Version 2.7 and CT 2.5. Any help would be much appreciated.

Thanks Darren

# Answer
> 1 votes
I'm not sure it actually will add the free item automatically to the cart. In fact I'm pretty sure that's not what the plugin is meant to do.

If you add the free item manually then you should see that it gets discounted from the total. I think that's all the plugin does.

You may need to create a 'package' product that contains the 2 items.

---
Tags: cartthrob
---


# Question
Title: If statement for url segement to display certain as well as overlapping images
I have a map and on this map are about 3 images. However the map displays different images on it every month. See code:

```
 <div class="col-sm-11 map">
                            {exp:channel:entries
                                       channel="mapped"
                                       status="open|Draft"
                                       entry_id="1354"
                                       orderby="mapped_date"
                                       sort="asc"}
                                <div id="container">
                                    {exp:channel_images:images field_id="336" entry_id="{entry_id}" category="included" limit="4"}
                                    <img data-x="{image:field:1}" data-y="{image:field:2}" src="{image:url}" />
                                    {/exp:channel_images:images}
                                </div>
                                    {/exp:channel:entries}

                                <div class="map-canvas">
                                    <img src="/images/picture1"/>
                                </div>
                            <div class="xsmall-pad"></div>
                            </div>

```

How do I specify that I want the images to only appear for a certain month - the title for that month is specified in the 3rd segment of the url. And how do I get the 3 images to overlap on top of the map?

# Answer
Was more complicated than I first laid it out to be. We had to create a plugin for it. No answer here because the solution specifically fixed a feature that is not found normally. But yes, Nick Benson's points on URL segments is valid.
> 0 votes

# Answer
You can access the values of URL segments with `{segment_1}`, `{segment_2}`, and so on.

```
{if "{segment_3}" == "january"}
     <h1>It's January!</h1>
{/if}

```

The `segment_N` syntax is available natively in EE; when you're ready to do more advanced things with URL segments, take a look at URL Helper.
> 0 votes

---
Tags: channel-images, mx-google-map
---


# Question
Title: Having trouble setting cartthrob's selected_shipping_option variable with default value
I'm really stuck on this and i hope the EE community can help. I have CartThrob using a custom plugin for shipping that sets price thresholds to achieve free shipping. And it seems to be applying the right rate immediately based on the pre-tax subtotal, but a value for selected\_shipping\_option is not. It is only when I use the cart update form to resubmit the cart contents, which includes the shipping options drop down, that the value of shipping option is being set. I'd like to be able to display some information on the checkout screen on the basis of the selected shipping option, but although the right amount is being applied for the transaction, the value of shipping\_option is not being set. Is there anything I can do about that? I don't want to force the user to re-select even the default option just to be abel to get that value recorded and therefore included in the order entry.

So when I first go to my basket and have:

```
{exp:cartthrob:cart_items_info}
    {exp:cartthrob:update_cart_form return="basket/index" required="shipping_option"}
        {exp:cartthrob:get_shipping_options}
    <select name="shipping_option">
    <option value="ship_to_my_address" {if '{exp:cartthrob:selected_shipping_option}' == "ship_to_my_address"} selected="selected"{/if}>Ship to my address</option>
    <option value="in_store_pickup" '{exp:cartthrob:selected_shipping_option}' == "in_store_pickup">In store pickup - free</option>
        {/exp:cartthrob:get_shipping_options}
    </select>
    <input type="submit" value="Update Cart" class="button small" />
    {/exp:cartthrob:update_cart_form}
{exp:cartthrob:cart_items_info}

```

Neither option in the select box is being marked as selected and if I simply try putting {exp:cartthrob:selected\_shipping\_option} in the template, I get no value returned - UNTIL I submit the update cart form - then it works fine. But I need (and would expect) the value to already be set - not JUST for the right amount to be charged.

Anyone have any ideas?

# Answer
Usually this is because {exp:cartthrob:get\_shipping\_options} loop not setting value for "shipping\_option". I'm using something like that (inside update\_cart\_form):

`{if cart_shipping=="0.00"}
 <input type="hidden" name="shipping_option" value="personal_pick_up">
{/if}
{if cart_shipping=="20.00"}
 <input type="hidden" name="shipping_option" value="overnight">
{/if}`

{cart\_shipping} can have format like "20.00 $"
> 1 votes

---
Tags: cartthrob, shipping
---


# Question
Title: How can I use third party class in EE to render instagram images on templates?
I have been using an instagram class in projects for Laravel and other small php sites and it has seemed to work well. I include a require\_once in my functions file. I then create a function that calls the instagram class and then in my template I call the function and it works.

This is the instagram class on github: https://github.com/cosenary/Instagram-PHP-API

Heres a simple example on a recent wp site I did:

# The function

```
require_once('includes/instagram.class.php');

function get_instagram_image() {

    $instagram = new Instagram('253daacbd2b849dd9d1255ecf26088b7');
    $name = 'Ahastag';
    $result = $instagram->getTagMedia($name);

    foreach ($result->data as $media) {
            $content = "<li class='col5-1'>";

            // output media
            if ($media->type === 'video') {
              // video
              $poster = $media->images->standard_resolution->url;
              $source = $media->videos->standard_resolution->url;
              $content .= "<video class=\"media video-js vjs-default-skin\" width=\"250\" height=\"250\" poster=\"{$poster}\"
                           data-setup='{\"controls\":true, \"preload\": \"auto\"}'>
                             <source src=\"{$source}\" type=\"video/mp4\" />
                           </video>";
            } else {
              // image
              $image = $media->images->standard_resolution->url;
              $content .= "<img class=\"media\" src=\"{$image}\"/>";
            }

            // create meta section
            $avatar = $media->user->profile_picture;
            $username = $media->user->username;
            $comment = $media->caption->text;
            $content .= "<div class=\"content\">
                           <div class=\"avatar\" style=\"background-image: url({$avatar})\"></div>
                           <h3>{$username}</h3>
                           <div class=\"comment\"><p>{$comment}</p></div>
                         </div>";

            // output media
            echo $content . "</li>";
          }

}

```

# What I used in the template

```
<?php get_instagram_image(); ?>

```

Now I am trying to do the same in Expression Engine. I am aware of libraries/addons etc but I am struggling to keep it as simple as I have done in WP above and I am sure it can be as its only a php script at the end of the day.

What I want to do is either create a plugin or new ee class that does exactly what I have done above but in my ee templates and frontend.

Can anyone point me in the right direction? I want to develop my own and not use one already out there because I want to keep as clean as possible and not overly bloated and complex.

Thanks

# Answer
> 1 votes
What you have there you can *almost* just wrap in a plugin. Start by reading the plugin development docs.

However, you can probably simplify your code - and make it more flexible - by instead of building your output markup inside of the plugin, populating an array of data, then returning it to the template, where you use EE variables to create your markup.

Read the docs on the Template class for an overview of how this works.

Here's a real quick bit of code as an example:

```
$vars = array();
foreach ($result->data as $media)
{
    $vars[] = array(
        'type' => $media->type,
        'image' => $media->images->standard_resolution->url,
        'video' => $media->videos->standard_resolution->url,
        'avatar' => $media->user->profile_picture,
        'username' => $media->user->username,
        'comment' => $media->caption->text
    );
}
return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $vars);

```

Then you can use this in your template:

```
{exp:my_plugin:instagram_image}
    {if type == 'video'}
        // build your video embed using the above variables ({source}, {image}, etc)
    {/if}
    {if type == 'image'}
        <img src="{image}" alt="{caption}" />
    {/if}
{/exp:my_plugin:instagram_image}

```

---
Tags: add-on-development, php, plugin, custom-classes
---


title: Template variable not parsing

text:
# Question
Title: Template variable not parsing
We have a custom third-party module called qo5. All of our controllers are in there.

I have a template that I need to pass a variable from a PHP function to.

```
{exp:qo5 action="deal/getDealCode"}
    <span>Test: {default_combo_override}</span>
{/exp:qo5}

```

The `deal/getDealCode` function looks like this:

```
public function getDealCode() {
        $deal_id = $this->EE->input->post('deal_id');
        $deal_code = $_SESSION['order']['coupons'][$deal_id]['code'];
        error_log("deal code: " . $deal_code);

        if($deal_code == 'GARLICPARM') {
                $data['default_combo_override'] = 'AT';
                error_log("Data");
                error_log(print_r($data, 1));
                return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $data);
            }
    }

```

I know it's being called; the error log is executing and displaying the correct data. But the span value for `default_combo_override` is not being populated.

What am I missing here? We use similar functionality all over the place, and it works everywhere else.

# Answer
> 1 votes
The array that you're passing to `parse_variables` is incorrectly structured - it needs to be one level deeper.

You can fix this either by wrapping it in an array:

```
return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, array($data));

```

Or using `parse_variables_row` instead:

```
return $this->EE->TMPL->parse_variables_row($this->EE->TMPL->tagdata, $data);

```

# Answer
> 0 votes
Have you tried putting the parsed\_variable into a new variable and then returning that?

```
$output = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $data);
return $output ;

```

---
Tags: templates, variable, parse
---


# Question
Title: How to generate a manifest.appcache from a template?
I have a web app built with ExpressionEngine (2.8.0 at present) and I want to use it to auto-generate an appcache manifest file (I have been generating it manually).

I can generate the **content** of the manifest easily enough with a standard template, and I can use htaccess to…

```
AddType text/cache-manifest .appcache

```

…but how best can I get the output of my template served as a **.appcache** file?

# Answer
I haven't thought about this before but you could do it with a bit of PHP in a template.

The PHP would loop through any directories you specify and output the names of files you wish to cache - either directly or writing to a separate cache manifest file (I'd try the former).

To do this you'd need to create a template and turn on PHP for the output stage then within that write your PHP.

Something like this should get you started http://motyar.blogspot.co.uk/2011/09/creating-cache-manifest-file-using-php.html

This approach seems a bit "scatter-gun". I think it would be better to only cache files that were used. I'm not sure how to achieve that but maybe the answer is simply to ensure that assets you wish to cache are in particular directories away from assets you don't wish to cache.
> 1 votes

---
Tags: templates
---


# Question
Title: Copying billing address to shipping address with cart.js
I am using the default cart.js file in my checkout which is included with CT2.5 This provides a copy billing info to shipping function which always seemed to work well, but since upgrading to CT2.5 no longer copies the billing country to shipping country, all other fields copy fine.

# Answer
> 1 votes
Just ran across your question now. Perhaps this answer will help others who are looking.

This link goes to an archived Cartthrob forum question/answer from April 2012 which solved the problem for me:

http://cartthrob.com/forums/viewthread/5195/#23632

To quote:

> Are you asking about the example cart/checkout template? There looks to be an error that is keeping the selects from updating in the shipping fields. If you’re using the default cart, open the cart/\_header template and change $(“input to $(”:input in the code that updates the shipping fields.

Edited to add:

As of JQuery 1.7, you should use .on() instead of .live() so you should check that out as well. Here's a brief explanation: https://stackoverflow.com/questions/18395786/live-not-working-with-change-function

Hope this helps.

---
Tags: cartthrob
---


# Question
Title: Stylesheet link renders with very wrong path
I'm working on a site using EE 2.8.1. I have links for CSS files using EE stylesheet links, like this:

```
<link rel="stylesheet" href="{stylesheet=global/main.css}">

```

Never had an issue with this approach before, but when pages are served up it's coming out as:

```
<link rel="stylesheet" href="http://domain.dev///////////////////?css=global/main.css">

```

What could be the cause of this? Any tips greatly appreciated!

(Site is also using Structure, and .htaccess rewrite to remove index.php from URLs -- also a combination I've used before with stylesheet links with no problems.)

# Answer
> 1 votes
At a guess this looks like an htaccess rewrite problem. (do you need the .css on the filename?)

Personally I'd say unless you are using some EE tags in your stylesheets then don't link them up that way and just link to them normally. You're simply adding to the processing required to render your site.

That will, most likely, also stop the problem you're having.

---
Tags: ee2
---


title: Solspace Calendar "Featured" events

text:
# Question
Title: Solspace Calendar "Featured" events
I have a News & Highlights section on a site homepage where I'm trying to pull in entries from either a News channel or the Calendar. For both it should pull in the latest 3 entries that are tagged with a category (Featured). I have it working for the most part, except that I am unable to show the date of the event from the Solspace calendar. I realize this is due to the fact that the date is not stored in the channel entries, but needs to be pulled in via calendar:events. However, when I do this, I am getting the same date for all events output.

```
           <h1 class="head"><a href="/News-and-Highlights">News and Highlights</a></h1>

{exp:channel:entries channel="news|calendar_events" category="17" limit="3"}
    <div class="span4">
    {if news_body != ""}<a href="{url_title_path="News-and-Highlights/Story/"}">
    {if:else}<a href="{url_title_path="Calendar/Event/"}">
    {/if}
    <span class="link-spanner">

          <div class="row-fluid news-header">
            {if news_picture==""}<a href="{url_title_path="News-and-Highlights/Story/"}" title="{title}"><img class="news-photo" src="/Default_Images/logoDefault.png" alt=""/></a>
            {if:else}<a href="{url_title_path="News-and-Highlights/Story/"}" title="{title}"><img class="news-photo" src="{news_picture}" alt=""/></a>
            {/if}
            <div class="news-inner">
              {if news_date != ""}<span class="date-meta"><a style="color:#989898;" href="{url_title_path="News-and-Highlights/Story/"}" title="{title}">{news_date format="%F %d, %Y"}</a></span>
              {if:elseif news_body != ""}<span class="date-meta"><a style="color:#989898;" href="{url_title_path="News-and-Highlights/Story/"}" title="{title}">Announcement</a></span>
              {if:else} <span class="date-meta"><a style="color:#989898;" href="{url_title_path="Calendar/Event/"}" title="{title}">{exp:calendar:events limit="1"}{event_start_date format="%F %d, %Y"}{/exp:calendar:events}</a></span>
              {/if}
              <h3><a style="color:#4463A0;" href="{url_title_path="News-and-Highlights/Story/"}" title="{title}">{title}</a></h3>
              <h3 class="italics">{if news_author != ''}{news_author}{/if}</h3>
            </div>

          </div>

          <p>
        {if news_body != ""}{exp:sk_excerpt chars='200'}{news_body}{/exp:sk_excerpt}
        {if:else}{exp:sk_excerpt chars='200'}{event_summary}{/exp:sk_excerpt}
        {/if}
          </p>
          <div class="triangle-bottom-right"></div>

          <a class="read-more" href="{url_title_path="News-and-Highlights/Story/"}" title="{title}">Read More <i class="icon-caret-right"></i></a>

        </div>
</span>        {/exp:channel:entries}
      </div>  <!-- end news -->

```

# Answer
> 1 votes
try adding this to your calendar:events tag

```
event_id="{entry_id}"

```

You may need to stick it into an embed if nesting a calendar tag inside a channel entries tag gives you trouble.

---

EDITED

I believe A better approach to accomplish what you're after would be to use a {exp:channel:entries} tag for your news and a {exp:calendar:cal} tag for your events.

If you need to limit the number of events returned by calendar tag see the event\_limit parameter and this example. http://www.solspace.com/docs/calendar/calendar/#examples

Trying to get 3 entries from either channel would be tricky. A couple ideas are:

1. You could build a stash list from the 2 tags and output only 3 items
2. You could try to tweak the calendar\_events entries entry\_date (not calendar field date) and sort by it.

Without knowing a little more about what the news and events entries look like that's about all I can think of.

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


# Question
Title: Download / CD as a product options in Expresso Store
Client wants to sell several titles, with customer choosing either MP3 Download or CD. How do I set it up so the downloadable MP3 is the default for each title, with CD as a product option? Is this possible?

All help will be much appreciated. Thanks.

# Answer
> 1 votes
Just create your products as normal based on a download option. Then add a product '*modifier*' for '*CD*' which includes the extra cost associated with a physical version of the product. Ensure that you also setting any associated shipping or handling charges for delivered goods.

Then on the product page of your site the user can choose which they'd prefer and see the extra costs for the CD option. During checkout you could optionally loop through the contents of the cart to check if a CD option has been selected and if so use that to display the shipping details and options. If not then you can skip the shipping info step in the checkout and just collect the billing details.

There's not much more to it than that.

Store provides a Download tag providing a way to serve up simple file downloads but if you need anything more fancy such as auto-zipping multiple audio files or serving them encrypted/secured then you may need to look into using other addons which can enhance this functionality.

---
Tags: expresso-store
---


# Question
Title: Is is possible to set a minimum order quantity for a category
Is there a way to set the min order qty for a category? E.G. A customer can only order 5 products in category A; either the same product or 5 different products in the same category.

# Answer
> 1 votes
Not per category as such but you can set this per product on the Product entry/edit page:

Although you can run your own conditional check to see if the customer has at least 5 products of a particular category in their cart but this would need to be done in the cart/checkout as the product page would be a bit pre-mature (they may go on to view other products in the same category and add those to their cart). This wouldn't be great for usability as they'd only find out once they're ready to checkout. If you're going to do things that way then be sure to make a clear note on the product pages or on a global area of the site to try and prevent any annoyances when it comes to the checkout.

You may need to play with the conditional logic to loop through the items, tally up associated item counts and then compare that to categories. It may be a little tricky but certainly possible.

---
Tags: expresso-store
---


# Question
Title: Running EE across two servers - how to setup?
I am shifting to a two-server setup for running my site. This would mean one server handles MySQL and one handles web stuff. My understanding is all I need to do to make this function with EE (version 2.x) is to edit the database.php config file for EE on the server that handles the php to point to the IP of the MySQL server, but is there anything else I should do?

# Answer
> 4 votes
You are correct. The only thing that you will need to do is open up `system/expressionengine/config/database.php` and change the `hostname` `username` `password` and `database` and change the settings to match your new MySQL server credentials.

---
Tags: ee2, config
---


title: CE Cache + Multilanguage

text:
# Question
Title: CE Cache + Multilanguage
I Use the Multilanguage Add-On from Bieber ltd. I now want also to ad caching to my site with CE Cache. I almost works but ce cache doesn't take the language segment in the url into account. The sites are delivered in one language no matter if domain.com/de or domain.com/en

I already fount a devot:ee thread but I don't know where to place and how to alter the string mentioned in this thread so the URI is correct. Anybody solved this problem?

# Answer
> 1 votes
I haven't used Bieber's add-on, but, from glancing at the docs, I believe you should use their `{language_code}` variable to feed CE Cache's `url_prefix` parameter (had to do something similar using Publisher on a multilingual site).

Something like this should do it, I think... maybe:

`{exp:ce_cache:ic url_prefix="{language_code}" ...}`

---
Tags: multi-language, ce-cache
---


# Question
Title: EE 2.8.x - "All data associated...will be permanently deleted!" when installing an addon
This is an odd one and I'm wondering if we can just confirm here that it is some weirdness created in EE 2.8.x.

I just had a NavEE user contact me that when INSTALLING the module, they are seeing the message, "All data associated with this fieldtype, including all associated channel data, will be permanently deleted!".

It seems to me that this message is here in error - but I wanted to confirm. I can replicate the issue when installing addons in EE 2.8.

MW

# Answer
> 2 votes
This a confirmed bug, marked as "fixed in upcoming release". https://support.ellislab.com/bugs/detail/20149

---
Tags: module, install
---


# Question
Title: Increase number of channel entries displayed in control panel
A few years back, I worked on a client EE project that involved deleting thousands of existing entries. A fellow EE developer showed me that you could append the query string with a variable that will tell EE to display more than just the standard 50 entries.

```
http://domain.com/admin.php?D=cp&C=content_edit&{mystery_variable}=200

```

I remember using it, and it being a lifesaver, but I've forgotten what the actual variable is, and have had no luck searching for it.

Any ideas?

Thanks,

ty

# Answer
> 3 votes
Try appending this

```
&perpage=1000

```

# Answer
> 0 votes
You may be thinking of using Zoo Visitor. This has a limit parameter. In reality it is dealing with entries connected to member account and does the member deletion based on deleting the entry.

The limit parameter doesn't seem to work on the members list.

---
Tags: control-panel, entries
---


title: Loop_plus dynamic variable not parsing

text:
# Question
Title: Loop_plus dynamic variable not parsing
So I am using the loop\_plus plug-in to generate dynamic variable names with each iteration of a section of the page. My code is as follows:

```
<div id="portfolio_items">
  {exp:channel:entries channel="portfolio-section" url_title="{segment_3}"}
    {exp:loop_plus start="1" increment="1" parse="inward"}
 <div class="portfolio_item overlayed_animated_highlight portfolio_item_3 design">
   <div class="overlayed">
     <img src="{image-{index}}" alt="">
    <div class="overlay">
    <p>
    <a href="{image-{index}}" class="fancybox" data-fancybox-group="portfolio"><i class="icon-search"></i></a>
    </p>
         </div>
    </div>
       </div>
  {/exp:loop_plus}
     {/exp:channel:entries}

```

The resulting HTML that is returned is correct except for the EE shortcode is not parsed:

```
<div id="portfolio_items">

<div class="portfolio_item overlayed_animated_highlight portfolio_item_3 design">
  <div class="overlayed">
<img src="{image-1}" alt="portf20">
  <div class="overlay">
   <p>
    <a href="{image-1}" class="fancybox" data-fancybox-group="portfolio"><i class="icon-search"></i></a>
   </p>
  </div>
 </div>
</div>

```

I used parse="inward" as suggested in this post: https://stackoverflow.com/questions/16654301/expression-engine-dynamic-variable-names-slide-index-title. I get the feeling that the parse="inward" is not performing. I've tried it without parse="inward" and it returns the same results. Is there something I am missing?

# Answer
It's a parse order issue. You need to wrap the `channel:entries` tag inside the `loop_plus` tag rather than the other way around as you current have it.

That should solve the issue and get the EE tags to parse and the loop\_plus tags to add their increment counter. However it wont be too efficient because it means that the channel:entries tag will be called several times. To prevent this and increase performance use the `loop_area` tag pair to specify exactly what you want to loop. (You can use as many instances as you need within the `loop_plus` tags. So you should end up with something like:

```
<div id="portfolio_items">
    {exp:loop_plus start="1" increment="1" parse="inward"}
        {exp:channel:entries channel="portfolio-section" url_title="{segment_3}"}
            <div class="portfolio_item overlayed_animated_highlight portfolio_item_3 design">
                <div class="overlayed">
                    {loop_area}
                        <img src="{image-{index}}" alt="">
                    {/loop_area}
                    <div class="overlay">
                        <p>
                            {loop_area}
                                <a href="{image-{index}}" class="fancybox" data-fancybox-group="portfolio"><i class="icon-search"></i></a>
                            {/loop_area}
                        </p>
                    </div>
                </div>
            </div>
        {/exp:channel:entries}
    {/exp:loop_plus}
</div>

```

Two `loop_area` tags are used to add the increment counts to the EE tags and the `channel:entries` tag is only called once so it's nice and efficient.
> 0 votes

---
Tags: ee2, loop
---


title: Editing Freeform entry statuses

text:
# Question
Title: Editing Freeform entry statuses
Is it possible to edit / add to the entry Statuses in Freeform or can I only select from the default Pending, Open and Closed?

# Answer
Freeform status additions are available to the Pro version in the preferences area.
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Freeform sumit contact form : You are not authorized to perform this action
I have a website I am moving to a ubuntu server from a windows server for a client.

ee v2.7.1 freeform 3.1.5 matrix 2.5.8

I have the contact form that was working on the other server but on this server that is not live I get this error. The form renders fine but when you submit you get:

```
The form you submitted contained the following errors

    You are not authorized to perform this action

Return to Previous Page

```

I figure it could be a couple of things: 1) the site is not live and the old one is so this is just normal? 2) file permissions issue 3) user permission 4) scratching my head...

So any pointers on EE forms would be a help as I have not built one in about 4 years.

# Answer
> 1 votes
This error is happening due to the changes in secure form handling introduced in EE 2.7.

Freeform 3.1.5 is not compatible with EE 2.6+ and is no longer being developed or updated. You will need to upgrade to Freeform 4.x.

# Answer
> 0 votes
That's a generic error message. It can be returned in a number of circumstances. EE purposely does not reveal what error you triggered so as not to aid evil-doers.

I've seen this error when:

* I've submitted the same data more than once.
* I've submitted the same form without reloading the page (form hash being reused).
* I've submitted a form a long time after the page has loaded (form hash has expired).

There are probably other operations that can trigger this error, many of them come down to the form hash. Can you inspect your source to see if there's a hash there as expected? Can you compare that value to those listed in the hash table?

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


# Question
Title: How do I find the Column ID for a Grid Entry Field in Expression Engine Channel Forms
I am looking to add a grid entry to Channel Form. I can see the field in the Field Groups list, but i cannot locate the Column id for the actual entry.

```
<input type="hidden" name="field_id_59[rows][new_row_0][]" value="new_row_0" />
<input type="text" name="field_id_59[rows][new_row_0][col_id_**????**]" value=""/>

```

Many Thanks

# Answer
> 0 votes
The easiest way to see at a glance is to just throw the whole field onto the page and then view the source. So include this in your templates:

```
{field:field_name}

```

Where `field_name` is the name of your grid field.

Then you'll be able to identify the column IDs. The code you require will end up looking something like this:

```
<input type="hidden" name="field_id_1[rows][new_row_0][]" value="new_row_0" />
<input type="text" name="field_id_1[rows][new_row_0][col_id_1]" value="" />

```

`field_id_1` relates to the field ID of the grid field itself and `col_id_1` will be the column ID in that grid field that you're targeting.

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


# Question
Title: Upgrade to 2.8.1 (fiasco) installed 2.7.3 unable to login to CP
Had 2.5.5 install. Upgraded to 2.8.1 which was a disaster.

So I installed 2.7.3

Before i upgraded I turned off the site so it's **offline**

I am unable to login to CP. I don't get an invalid login message it just reloads the login form.

Am in panic mode as I scramble to get access to the site.

# Answer
> 1 votes
Clearing cookies in your browser should solve this problem.

# Answer
> 0 votes
If you're not running a config override you can edit:

system\>expressionengine\>config\>config.php with this:

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

```

---
Tags: ee2
---


title: exporting channel - not the data

text:
# Question
Title: exporting channel - not the data
I have a new channel (locally) about 30 fields long I want to get this into my live site. Is there a way to export and import the actual channel structure into a live site without doing a full database dump?

# Answer
> 0 votes
The good news is that Field Editor will handle this for you allowing you to import and export field groups along with a number of other useful editing features.

I'm not sure if you can currently purchase this addon however following a recent statement from MBR.

> As of Friday the 14th of March 2014, we removed from sale the following products:
>
> Profile Edit
> Field Editor
> Affiliator
> Champagne 2
> Geofinder
> Geotagger
> CartThrob Subscriptions
>
> This means that CartThrob 2 is the only product we have available for sale at this time...

It looks like it can still be purchased however so the current status is a little unknown. Best to give it a try and see but keep the official statement in mind with regards to the purchase and support.

---
Tags: channel, export
---


# Question
Title: ExpressionEngine + Slider, how do I get it to display correctly?
I suppose I could consider my very experienced with ExpressionEngine.. But I've come across a stumper here and I know the answer is probably obvious.

Client has handed me a design to port over to expression engine and implement all the bells and whistles. They have included their slider of choice in the design.

```
   <div class="slider">
     <div class="shell">
        <div class="slider-caption">
           <h3>Lorem ipsum</h3>

           <h2>Epsum factorial <br /> non deposit</h2>

           <div class="actions">
              <a href="#" class="link-more">read more</a>
           </div><!-- /.actions -->
        </div><!-- /.slider-caption -->
     </div><!-- /.shell -->
     <ul class="slides">
        <li class="slide">
           <img src="{images}/slide-01.jpg" alt="" />
        </li>

        <li class="slide">
           <img src="{images}/slide-02.jpg" alt="" />
        </li>

        <li class="slide">
           <img src="{images}/slide-01.jpg" alt="" />
        </li>

        <li class="slide">
           <img src="{images}/slide-02.jpg" alt="" />
        </li>
     </ul><!-- /.slides -->
     <div class="shell">
        <div class="slider-paging"></div><!-- /.slider-paging -->
     </div><!-- /.shell -->
  </div><!-- /.slider -->

```

^I'm sure you've seen the problem already. I cannot simply 'wrap' this section inside a channel tag, it would break the styling. Nor can I simply use two channel tags (unless I'm missing something) to populate both areas and keep them in sync with each other for each slide.

Here was my initial (lazy) attempt:

```
 <div class="slider">
     <div class="shell">
         {exp:channel:entries channel="home_slider" limit="4" orderby="date" sort="desc" dynamic="no"}
          <div class="slider-caption">
           <h3>{title}</h3>

           <h2>{home_slider_text}</h2>

           {if home_slider_link !==''}
           <div class="actions">
              <a href="{home_slider_link}" class="link-more">read more</a>
           </div><!-- /.actions -->
           {/if}
           </div><!-- /.slider-caption -->
          {/exp:channel:entries}
     </div><!-- /.shell -->
     <ul class="slides">
        {exp:channel:entries channel="home_slider" limit="4" orderby="date" sort="desc" dynamic="no"}
        <li class="slide">
           <img src="{home_slider_image}" alt="{title}" />
        </li>
        {/exp:channel:entries}
     </ul><!-- /.slides -->
     <div class="shell">
        <div class="slider-paging"></div><!-- /.slider-paging -->
     </div><!-- /.shell -->
  </div><!-- /.slider -->

```

I'm thinking the answer lies in being clever with an {if count} approach, but I'm scratching my head on this.

Any words of advice?

Note: To make this even more frustrating, a long time ago I dealt with a similar problem and fixed it.. But I don't have access (nor even remember the url) to that site.

Edit: Upon further investigation.. It seems that this slider they chose isn't actually transitioning\hiding the slide text- only the slide images themselves. Curious.

Seems the issue isn't with me per se but with their code.

# Answer
I suggest that you do not use separate entry for each slider, but have one entry with 2 custom fields:

* slider caption (text field)
* slide images (Matrix or Grid field)

This way, you will simply loop over Grid/Matrix field while staying in same Channel entry.
> 1 votes

---
Tags: count, html
---


# Question
Title: Login issues on front end - what to do now?
**Situation:**

Expression Engine v2.6.1 - Build Date: 20130506

I have a live server and a dev server. They are identical.

**The problem**

On the live site, members **cannot** login on the front end. I can login with my admin un/pw to the control panel, but I **cannot** via the front end. When I try to login I am taken to the homepage of the site and I am not logged in.

The front end doesn't recognise that I am logged in in the control panel either.

All of this has just started today. No changes have been made.

The dev server works as it should (logs in fine)

**I have tried**

To solve this issue I have tried:

* Changing the session options security settings
* Deleted cookies and browser history etc
* Setting a cookie name .example.com
* Checking to see if the front end recognises me as logged in to the control panel (it doesn't)
* I have set up a basic form to test logging in away from the main front-end code. Here is the form:

```
{exp:member:login_form return="http://www.exmaple.com/some_test"}
    <p>
            <label>Username</label><br>
            <input type="text" name="username" value="" maxlength="32" size="25">
    </p>
    <p>
            <label>Password</label><br>
            <input type="password" name="password" value="" maxlength="32" size="25">
    </p>
    <p><input type="submit" name="submit" value="Submit"></p>

```

{/exp:member:login\_form}

Everything works on the dev site as expected. On the live site (using the test above) I try to login and it just re-routes me to homepage and doesn't log me in.

**My question**

Apart from updating the CMS, what would be you recommend doing next?

This issue exists on Chrome, FF and Safari on Win7 and Mac 10.9

# Answer
> 1 votes
You say nothing has changed but *something* must have. Even if it's a change to the server set up (perhaps made by your host) it could have an effect. So it might be worth asking your host if any updates were made in the last 48 hours. This may at least give you a clue.

Were any options changed in the site CP? Such as cookie settings, requiring and IP and user agent, prevent multiple logins etc. These could all have an effect too.

One thing you might want to check is under Admin-\>Security and Privacy Settings and try changing the method being used for the User Session Type. Just switch it to another option, clear your cookies and try again. That might work.

# Answer
> 0 votes
I upgraded and still had some issues. The form has to be handled over HTTPs. This is the form (without the styling) I ended up with that works on all servers:

```
        <form method="post" action="https://www.example.com/area">

            <input type="hidden" name="ACT" value="15">
            <input type="hidden" name="RET" value="https://www.example.com/area">
            <input type="hidden" name="site_id" value="1">
            <input type="hidden" name="csrf_token" value="{csrf_token}">

            <input type="text" name="username" value=""/>
            <input type="password" name="password" value=""/>

            <button type="submit" name="submit" value="Submit"/>Sign in</button>

       </form>

```

---
Tags: members, login, cookies
---


title: Playa // Entries // Category Archive?

text:
# Question
Title: Playa // Entries // Category Archive?
So I have several Channel Data that I'm pulling into a Product page: Accessories, Options, Features, etc...

For Accessories I have all of the associated products pulled in, but now I want to pull in the categories for each product but only once. When I do this:

```
{exp:playa:parents channel="products_accessories" field="{{embed:slug}_accessories}" disable="members"}
{categories}<div class="col-md-4">
<p><a href="{url_title_path='products/accessories/'}">{category_name}</a></p>
</div>{/categories}
{/exp:playa:parents}

```

But that just gives me all the Categories for each product over and over again. Obviously not what I want. I just want to find each Category and list it once along with a link to that product category page :)

Any thoughts?

**UPDATE**

I have tried this as well:

```
{exp:channel:category_archive channel="products_accessories"}
    {categories}
            <h3>{category_name}</h3>
    {exp:playa:parents channel="products_accessories" field="{{embed:slug}_accessories}" category="{category_id}" disable="members"}
            <a href="#">{title}</a>
    {/exp:playa:parents}

    {/categories}
{/exp:channel:category_archive}

```

This gets me all of the entries in the appropriate category but I also get all of the other Categories too. I need a way to pass the Entry IDs that I want to the Category Archive.

**UPDATE 2 USING STASH**

I have also tried what the might Croxton suggested:

```
{exp:stash:set_list name="cat_accessories" parse_tags="yes"}
   {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}
      {categories}
         {stash:id}{category_id}{/stash:id}
         {stash:url}{url_title_path='products/accessories/'}{/stash:url}
         {stash:name}{category_name}{/stash:name}
      {/categories}
   {/exp:playa:parents}
{/exp:stash:set_list}

{!-- get unique list items only --}
{exp:stash:get_list name="cat_accessories" unique="yes"}
   <div class="col-md-4">
       <p><a href="{url}">{name} | {id}</a></p>
   </div>
{/exp:stash:get_list}

```

I'm still just getting the category listed each time an entry loop is parsed (the entry detail page loops it through 6 times):

```
Category
Category
Category
Category
Category
Category

```

So I'm not sure what's happening with the `unique="yes"` parameter on the `exp:stash:get_list` tag pair.

When I run Template Debugging I get this:

```
(0.453361 / 16.55MB)      Stash: SET cat_accessories to value id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/bedding-1-4-corn-cob-nestpacks|&|name|=|Single Use Caging Options|+|id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/single-use-cage-top-for-sipper-sack|&|name|=|Single Use Caging Options|+|id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/single-use-cage-top-for-water-bag|&|name|=|Single Use Caging Options|+|id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/single-use-cage-top-for-water-bottle|&|name|=|Single Use Caging Options|+|id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/single-use-docking-tray|&|name|=|Single Use Caging Options|+|id|=|102|&|url|=|http://animalcaresystems.dev/products/accessories/single-use-water-bottle-assembly|&|name|=|Single Use Caging Options

```

I'm assuming that Stash grabs the ID of the category to determine if the Categories are the same?

**UPDATE FINAL**

With Croxton's help I now have this:

```
{exp:stash:set_list name="cat_accessories" parse_tags="yes"}
   {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}
      {categories}
         {stash:id}{category_id}{/stash:id}
         {stash:url}{url_title_path='/products/accessories/'}{/stash:url}
         {stash:name}{category_name}{/stash:name}
      {/categories}
      {stash:product_title}{title}{/stash:product_title}
      {stash:product_image}{if products_accessories_images}<div class="accessories_image">{products_accessories_images limit="1"}<p><img src="{exp:ce_img:single src='/images/uploads/products/{image}'{sn_image_product_detail_accessories}}" alt="{alt}" class="img-responsive text-center" />{/products_accessories_images}</p></div>{/if}{/stash:product_image}
      {stash:product_content}{if products_accessories_content}<p>{exp:eehive_hacksaw chars='175'}{products_accessories_content}{/exp:eehive_hacksaw}</p>{/if}{/stash:product_content}
   {/exp:playa:parents}
{/exp:stash:set_list}

{!-- get unique list items only --}
{exp:stash:get_list name="cat_accessories" unique="id"}
    <h3>{name}</h3>
    <div class="col-md-4 accessories_listings">
        <p><a href="{url}">{product_title}</a></p>
        {product_image}
        {product_content}
    </div>
{/exp:stash:get_list}

```

The last thing I need is just all of the Products under that Category. I'm only getting ONE product although there are SIX under this particular category.

**GETTING ALL PRODUCTS UNDER CATEGORY WITH STASH**

**Missing Getting Products JUST in it's Category (almost there!)**

Okay I think I have what I want, please let me know if there's a better way of doing this :)

```
{exp:stash:set_list name="cat_accessories" parse_tags="yes"}
   {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}
      {categories}
         {stash:id}{category_id}{/stash:id}
         {stash:name}{category_name}{/stash:name}
      {/categories}
   {/exp:playa:parents}
{/exp:stash:set_list}

{exp:stash:set_list name="product_info" parse_tags="yes"}
   {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}
      {stash:product_url}{url_title_path='/products/accessories/'}{/stash:product_url}
      {stash:product_title}{title}{/stash:product_title}
      {stash:product_image}{if products_accessories_images}<div class="accessories_image">{products_accessories_images limit="1"}<p><img src="{exp:ce_img:single src='/images/uploads/products/{image}'{sn_image_product_detail_accessories}}" alt="{alt}" class="img-responsive text-center" />{/products_accessories_images}</p></div>{/if}{/stash:product_image}
      {stash:product_content}{if products_accessories_content}<p>{exp:eehive_hacksaw chars='175'}{products_accessories_content}{/exp:eehive_hacksaw}</p>{/if}{/stash:product_content}
   {/exp:playa:parents}
{/exp:stash:set_list}

    {!-- get unique categories items only --}
    {exp:stash:get_list name="cat_accessories" unique="id"}
        <h3>{name}</h3>
        {!-- get products that belong to this category --}
        {exp:stash:get_list:nested name="product_info" parse_tags="yes"}
        <div class="col-md-4 accessories_listings">
            <p><a href="{product_url}">{product_title}</a></p>
            {product_image}
            {product_content}
        </div>
    {/exp:stash:get_list:nested}
{/exp:stash:get_list}

```

Thanks again for all of the help!

# Answer
Each related product could have individual category relationships, right? So If I understand you correctly, you want the aggregate of all categories assigned to the related entries.

You can do that with Stash:

```
{exp:stash:set_list name="cat_accessories" parse_tags="yes"}
   {exp:playa:parents channel="products_accessories" field="{{embed:slug}_accessories}" disable="members"}
      {categories}
         {stash:id}{category_id}{/stash:id}
         {stash:url}{url_title_path='products/accessories/'}{/stash:url}
         {stash:name}{category_name}{/stash:name}
      {/categories}
   {/exp:playa:parents}
{/exp:stash:set_list}

{!-- get unique list items only --}
{exp:stash:get_list name="cat_accessories" unique="yes"}
   <div class="col-md-4">
       <p><a href="{url}">{name}</a></p>
   </div>
{/exp:stash:get_list}

```

**EDIT**

Aha, so you're url is dependent on the entry url title, not the category url title, and is therefore unique even for same categories. Is that intentional?

If you change `unique="yes"` to `unique="id"` (i.e. the id column must be unique) then you'll get only unique categories, however I'm not sure what you need to do with that url.

**EDIT 2**

You can use nested lists and match/against to list out unique categories and associated products. No need to repeat your Playa loop twice:

```
        {exp:stash:set_list name="product_info" parse_tags="yes" parse_depth="2"}

           {exp:playa:parents channel="products_accessories" sort="asc" orderby="title" disable="members"}

                {stash:product_url}{url_title_path='/products/accessories/'}{/stash:product_url}
                {stash:product_title}{title}{/stash:product_title}
                {stash:product_image}{if products_accessories_images}<div class="accessories_image">{products_accessories_images limit="1"}<p><img src="{exp:ce_img:single src='/images/uploads/products/{image}'{sn_image_product_detail_accessories}}" alt="{alt}" class="img-responsive text-center" />{/products_accessories_images}</p></div>{/if}{/stash:product_image}
                {stash:product_content}{if products_accessories_content}<p>{exp:eehive_hacksaw chars='175'}{products_accessories_content}{/exp:eehive_hacksaw}</p>{/if}{/stash:product_content}

                {!-- create an index for this product to match against --}
                {stash:categories}{categories}@{category_id}@{/categories}{/stash:categories}

                {categories}
                    {exp:stash:append_list name="cat_accessories"}
                        {stash:cat_id}{category_id}{/stash:cat_id}
                        {stash:cat_name}{category_name}{/stash:cat_name}
                    {/exp:stash:append_list}
                {/categories}

           {/exp:playa:parents}

        {/exp:stash:set_list}

        {!-- list unique categories only --}
        {exp:stash:get_list name="cat_accessories" unique="cat_id" orderby="cat_name" sort="asc"}

            <h3>{cat_name}</h3>

            {!-- list products that belong to this category --}
            {exp:stash:get_list:nested name="product_info" match="#@{cat_id}@#" against="categories" orderby="product_title" sort="asc"}
            <div class="col-md-4 accessories_listings">
                <p><a href="{product_url}">{product_title}</a></p>
                {product_image}
                {product_content}
            </div>
            {/exp:stash:get_list:nested}
        {/exp:stash:get_list}

```
> 2 votes

---
Tags: playa, categories, entry, category-archive
---


# Question
Title: Playa in a Low Variable and Stash problems after Update to latest stable Stash version
I had this scenario working before:

1. A Stash "standard.hmtl" template with {exp:stash:get name="maincontent"}
2. A single-view template for products that looks like this:

```
{!-- set the page layout --}
{stash:embed:layouts:standard}

{exp:stash:set name="body_id"}category_index{/exp:stash:set}

{!-- main page variables --}
{exp:stash:set name="maincontent" parse_tags="yes"}

{if no_results OR segment_3!=""}{redirect="404"}{/if}

<div id="content">

        <div class="intro">

                <div class="text">
                        {ll_intro}
                </div><!-- /text -->

                <div class="clear"></div>

        </div><!-- /intro -->

        <div class="products-new">

                <ul class="noGrid">
                {exp:low_variables:pair var="ll_products" multiple="yes"
                        status='{exp:stash:get name="functions:preview-status" file="yes" parse_tags="yes" parse_conditionals="yes"}'
                        parse="inward"}

                 {if no_results:no_results}
                 {exp:stash:get name="sn_no_results" type="snippet"}
                 {/if}

                 {stash:embed name="snippets:productdiv-new" process="start"}

                  {/exp:low_variables:pair}
                  <li class="gap"></li>
                  <li class="gap"></li>
                  </ul>

         </div>

</div><!-- /content -->
{/exp:stash:set}

```

snippets:productdiv-new contains:

```
<li class="mix {if product_price:plus_tax_numeric > "88.99"}freeshipping{/if} {brand}" data-price="{product_price:plus_tax_numeric}">
                            {if status == "Draft"}<img class="draft" src="/assets/img/site/draft.png" />{/if}
                            {exp:entry_age unit="days" max_age="21" entry_date="{entry_date}"}
                            <a href="{page_url}">
                                <img class="new-badge" src="/assets/img/site/neu.png" alt="Neu! (ein 'Fähnchen', welches signalisiert, dass dieses Produkt neu in unseren Shop aufgenommen wurde)" />
                            </a>
                            {/exp:entry_age}
                            <a href="{page_url}">
                                {if produktbilder}
                                {exp:channel_images:images entry_id="{entry_id}" cover_only="yes"}
                                <img class="product" src="{image:url:index_thumbnail}" width="{image:width:index_thumbnail}" height="{image:height:index_thumbnail}" alt="{image:title}" />
                                {/exp:channel_images:images}
                                {if:else}

                                <img class="product" src="/assets/img/site/no_picture.png" alt="Platzhaltergrafik mit der Aufschrift 'Kein bild'" />
                                {/if}

                                <div class="availability-new">
                                    {if product_inventory == "0"}

                                    <img src="/assets/img/site/availability_red.png" alt="Ampel, die auf rot steht" title="Dieser Artikel ist bald wieder für Sie verfügbar" />{/if}
                                    {if product_inventory > "0"}

                                    <img src="/assets/img/site/availability_green.png" alt="Ampel, die auf rot steht" title="Der Artikel ist auf Lager" />{/if}

                                </div>
                            </a>

                            <div class="meta">
                                {if product_price:plus_tax_numeric > "88.99"}

                                <a class="image" href="{page_url}">
                                    <img src="/assets/img/site/truck-green-23.png" alt="Truck" title="Kostenfreier Versand!" />
                                </a>
                                {/if}
                                {if channel_video}
                                {exp:channel_videos:videos entry_id="{entry_id}"}
                                <a class="video image" href="{video:url}">
                                    <img src="/assets/img/site/play-red-20.png" alt="Kamerasymbol" title="Zu diesem Artikel ist ein Produktvideo vorhanden" />
                                </a>
                                {/exp:channel_videos:videos}
                                {/if}

                            </div><!-- /meta -->

                            <div class="schatten">
                                <img src="/assets/img/site/shadow_img_index.png" alt="Schatten" style="width: 190px;"/>
                            </div>

                            <h3>{title}{if subtitle}<br /><span>{subtitle}</span>{/if}</h3>

                            <div class="price">
                                {if product_original_price && product_original_price > product_price}

                                <span class="reduced_price">{product_price:plus_tax} €</span> <span class="original_price">{product_original_price:plus_tax} €</span>
                                {if:else}

                                <div class="price">{product_price:plus_tax} €</div>
                                {/if}

                            </div><!-- /price -->
                        </li>

```

When pasting the content from snippets:productdiv-new directly into the single-view template everything's working as desired.

When putting the code into a Stash snippet and then calling it like in the above codeblock ({stash:embed name="snippets:productdiv-new" process="start"}) everything works **BUT** the images from {exp:channel\_images:images...} are not being displayed, the inventory doesn't get reflected and videos and freeshipping if conditionals don't get parsed.

So, basiclly all of the if conditionals don't get evaluated.

I had the very same code working before but since upgrading Stash from 2.3.9 to 2.4.4 it isn't working anymore.

Anyone able to spot the problem?

Thanks and Cheers!

# Answer
> 1 votes
Since Stash 2.4.3 embeds with `process="start"` are parsed by default to be consistent with the other process stages (`inline` and `end`).

Add `parse="no"` to disable parsing:

```
{stash:embed name="snippets:productdiv-new" process="start" parse="no"}

```

---
Tags: playa, stash, conditionals, low-variables
---


# Question
Title: Displaying form submission errors inline
Is there module to improve the errors in Expression engine ? The in build system is pretty cumbersome and without spending time building multiple form validation classes I would like something that does not send you to the error page but shows the errors on the current page.

# Answer
> 1 votes
The User Message templates are the native behavior of EE, but there are some addons that you can use to work around them.

A 3rd party addon like Free Member https://github.com/expressodev/freemember can display errors like required fields inline to avoid EE's user message templates.

Beyond that if there is a specific message you are trying to avoid from another form submission there's likely an addon that can do it.

You may also want to check out this the Custom System Messages Addon http://devot-ee.com/add-ons/custom-system-messages.

---
Tags: error, validation
---


title: Freeform 4.1.5 fingerprint PHP error

text:
# Question
Title: Freeform 4.1.5 fingerprint PHP error
I'm running Freeform 4.1.3 on an EE 2.5.5 site. It is an MSM site.

I've been encountering the same issue mentioned here: Freeform only sends notifications with default template

I tried upgrading to the latest (4.1.5) and I encounter the following errors:

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: fingerprint
Filename: addon_builder/addon_builder.php
Line Number: 4259

```

http://d.pr/i/inTS

In doing some debugging this appears to be related to some

I don't have a copy of 4.1.4 to test with to see if the same issue is happening with 4.1.4. Thanks for taking a look.

# Answer
> 1 votes
This is a regression bug for EE 2.5.x and we are working on another release that will fix it.

If you want to patch it yourself in the mean time, replace the get\_session\_id function in:

```
./system/expressionengine/third_party/freeform/addon_builder/addon_builder.php

```

(around line 4290) with this:

```
public function get_session_id()
{
    if ( ! isset(ee()->session) || ! is_object(ee()->session))
    {
        $s = 0;
    }
    //EE 2.8+
    else if (version_compare($this->ee_version, '2.8', '>='))
    {
        $s = ee()->session->session_id();
    }
    //EE 2.7.x and below
    else
    {
        $admin_session_type = ee()->config->item('admin_session_type');

        if (
            $admin_session_type == 's' &&
            isset(ee()->session->userdata['session_id'])
        )
        {
            $s = ee()->session->userdata['session_id'];
        }

        else if (
            $admin_session_type == 'cs' &&
            isset(ee()->session->userdata['fingerprint'])
        )
        {
            $s = ee()->session->userdata['fingerprint'];
        }

        else
        {
            $s = 0;
        }
    }

    return $s;
}
//END get_session_id

```

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


# Question
Title: Is there a way to make Postmaster receiver email dynamic?
I have a channel called `foo` which is tied up to a member via Safecracker Registration.

The `foo` channel has a field for an email.

When someone edits a `foo` channel entry, I want to send an email to the owner of the channel entry.

Is there way to in the Parcels/Hooks so that the email can be sent to the user via the email field?

# Answer
Yeah this is pretty standard functionality.

1. Create a new parcel
2. Your To Email would be `{member:email}`, which grabs the email of the entry's author
3. Set the entry trigger to "Edit"

Here is a screenshot to be 100% clear.
> 1 votes

---
Tags: postmaster
---


# Question
Title: Expresso Store, modifiers and price value for first modifier
I'm trying to retrieve price value for first modifier (*only*) within **entries** tag. My code looks like

`{if product_details:price_val!=0}
 {product_details:price_val}
 {if:else}
 {product_details:modifiers}
 {product_details:price_mod_val}
 {/product_details:modifiers}
 {/if}`

but always it returns an empty value for first modifier.

Any clue hot to bite that?

Thanks

# Answer
Based on directions from Ian (thanks!) I have finally got solution to my question.

To obtain first price (or all) for product modifiers I have used code below:

```
<?php $prices = array(); ?>
 {exp:store:product entry_id="{entry_id}" disable_form="yes" disable_javascript="yes"}
    {modifiers}
        {modifier_options}
            {if price_mod_val}<?php $prices[] = {price_mod_val}; ?> {/if}
        {/modifier_options}
    {/modifiers}
 {/exp:store:product}

```

and then Pinterest OpenGraph part:

```
<?php if(!empty($prices)) {?>
<meta property="og:price:amount" content="<?php $price = number_format($prices[0], 2, '.', ''); echo $price; ?>" />
<?php }
else { ?>
<meta property="og:price:amount" content="{if product_details:price_val!=0}{product_details:price_val}{if:else}99.99{/if}" />
<?php } ?>

```

I have try to use jQuery `change` to replace selected option price, but this works only when a visitor pin from that particular selection, but doesn't work when Pinterest will crawl back for price change/update. At that point I have stick only to primary (landing) product option.

UPDATE:

Stash version:

```
 {exp:stash:set_list name="price_list" parse_tags="yes" parse_depth="3" parse_conditionals="yes"}
 {exp:store:product entry_id="{entry_id}" disable_form="yes" disable_javascript="yes"}
    {modifiers}
        {modifier_options}
            {if price_mod_val}{stash:item_price}{price_mod_val}{/stash:item_price}{/if}
        {/modifier_options}
    {/modifiers}
 {/exp:store:product}
{/exp:stash:set_list}

```

and OpenGrap price for Stash version:

```
{if {exp:stash:not_empty name="price_list"}}
{exp:stash:get_list name="price_list" limit="1" parse_tags="yes" parse_conditionals="yes"}
<meta property="og:price:amount" content="{item_price}" />
{/exp:stash:get_list}
{if:else}
<meta property="og:price:amount" content="{product_details:price_val}" />
{/if}

```
> 1 votes

# Answer
To pull out the price for a modifier you should just need to do something like this:

```
{modifiers}
    {modifier_options}
        {if price_mod_val} ({price_mod}) {/if}
    {/modifier_options}
{/modifiers}

```

This will usually be done inside a select box for allowing a selection of each modifier option but above I've just stripped out all the HTML to place emphases on the Store tags only.

`{price_mod}` is the one which displays the price and `{if price_mod_val}` checks if it has a price to show
> 0 votes

---
Tags: expresso-store, price-modifier
---


# Question
Title: Unable to locate the specified class: Security.php
I've just started to install expression engine 2.8.1 (for the record I experienced the exact same problem with version 2.7.3) I've installed expression engine god knows how many times and have 6 copies of expression engine on the same server but when I go to run the installer I am experiencing the error

```
Unable to locate the specified class: Security.php

```

Has anyone experienced this before and if so, what was the fix?

Thanks

# Answer
After a little research and a bit of asking around on forums, I found that GoDaddy shared servers were reading the contents of the Security.php file and treating it as malware.

I've got in touch with GoDaddy and I'm waiting on a response but this is another reason for me to take my hosting elsewhere...

http://ellislab.com/forums/viewthread/244598/
> 3 votes

---
Tags: error
---


title: deploying version 2.8

text:
# Question
Title: deploying version 2.8
As deploy helper is currently not supported on the latest version of expression engine can anyone recommend a decent alternative.

I came across this one, but it hasn't been updated in 6 months so I'm a little unsure if it's supported. http://devot-ee.com/add-ons/reelocate

Can I just do a find and replace in my mysql file? In a code editor? with an owl!

Cheers Dave

# Answer
I think you'll find switching to a multi-environment config file a more convenient alternative than using an add-on for updating paths after migration (eg dev to staging to production). The really nice thing about using config overrides this way is that there is usually zero configuration update needed when migrating.

One excellent, widely used and well-documented method is the Focus Lab Master Config. Some other approaches are here in the EE Answers Stack Exchange post, Config Bootstrap Options.

You can also roll your own. Here are some helpful resources:
> 4 votes

---
Tags: 2.8, deployment
---


# Question
Title: Limit a FreeForm based on a maximum number of allowed entries?
I'm trying to create a form that will only allow a maximum of 40 users to complete. After the form hits 40 entries, I would like to hide the fields and show a message (ie. "This course has reached it's capacity and is now closed")

I've tried using FreeForms total\_results in an {If} statement, but I can't seem to get it working.

Any Thoughts? Is it possible to do this? Thanks in advance!

```
{exp:freeform:entries
                    form_name="camp_registration"
                }

                    {if freeform:no_results}
                        {exp:freeform:form
                            form_name="camp_registration"
                            required="first_name|last_name|date_of_birth|email"
                            }
                            test
                            <div class="form-group">
                                <label>{freeform:label:email} {if freeform:error:email}<span class="error"> - Required</span>{/if}</label><br />
                                {freeform:field:email attr:class="form-control"}
                            </div>

                            <div class="form-group">
                                <button type="submit" class="btn btn-primary">Register</button>
                            </div>
                        {/exp:freeform:form}
                    {/if}

                    {if freeform:count == 1}

                        {if freeform:total_results < 40} /* I'm pretty sure this is where there's a problem */

                            {exp:freeform:form
                                form_name="camp_registration"
                                required="first_name|last_name|date_of_birth|email"
                             }

                                <div class="form-group">
                                    <label>{freeform:label:email} {if freeform:error:email}<span class="error"> - Required</span>{/if}</label><br />
                                    {freeform:field:email attr:class="form-control"}
                                </div>

                                <div class="form-group">
                                    <button type="submit" class="btn btn-primary">Register</button>
                                </div>

                            {/exp:freeform:form}

                        {/if}

                        {if freeform:total_results >= 40}
                            <p>Sorry, maximum form entries allowed reached.</p>
                        {/if}

                    {/if}

                {/exp:freeform:entries}

```

# Answer
> 3 votes
Wrap your `{exp:freeform:form}` with an `{exp:freeform:entries}` tag pair and use conditionals to determine if there are more than less than 40 entries for the form. If there are less, present the form, if not, show a message:

```
{exp:freeform:entries /* your other parameters */}

  {if freeform:no_results}
     {exp:freeform:form /* your other parameters */}
        // Your form code. This will show up if there are no form entries yet.
     {/exp:freeform:form}
  {/if}

  {if freeform:count == 1}

    {if freeform:total_results < 40}
       {exp:freeform:form /* your other parameters */}
          // Your form code
       {/exp:freeform:form}
    {/if}

    {if freeform:total_results >= 40}
       <p>Sorry, maximum form entries allowed reached.</p>
    {/if}

  {/if}

{/exp:freeform:entries}

```

The `{if freeform:count == 1}` conditional is to prevent the `{exp:freeform:entries}` tag from looping and displaying the same content multiple times.

# Answer
> 2 votes
What I would try is move your form to an embedded template and in your main template put the following code which is using freeform:entries rather than freeform:form -

```
{exp:freeform:entries
    form_name="camp_registration"
    limit="100"
    }

    {embed="template_group/_formname" form_count="{freeform:total_results}"}

{/exp:freeform:entries}

```

Then in your embedded template where you have the conditional you can do a check on the value with {embed:form\_count}

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


# Question
Title: Solspace Tracker - Any way to order results?
Looking at the Tracker Control Panel, is there any way to order the tables for Overall Statistics, Site Averages, or Entry Statistics? It seems intuitive to click the column heading for that, but that doesn't do anything.

# Answer
> 1 votes
Unfortunately, that isn't possible.

I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions

---
Tags: solspace, solspace-tracker
---


# Question
Title: Cannot get passed customer details on checkout
After upgrading to v2 we can no longer get passed the customer details section of this site https://www.baileysfurniture.com. No errors at all. Any ideas?

# Answer
> 3 votes
It's failing silently but it's most likely down to a missing or invalid field value somewhere in the checkout. If you remove `error_handling="inline"` from your `exp:store:checkout` tag it will fall back to default EE error handling and you should be able to see specifics of what the cause of the problem is.

---
Tags: expresso-store
---


# Question
Title: PayPal Express & Store: Payment has already been made for this InvoiceID
I am setting up Store using PayPal Express. I am using a sandbox account for testing.

When I go to check out and submit payment I get the following error:

Payment has already been made for this InvoiceID.

What is going on here?

Thanks.

# Answer
> 2 votes
It sounds like for whatever reason you're passing a duplicate Order ID to Paypal when you try to make the purchase. If it's a development setup then it could be that in testing you've been making and deleting orders or moving databases which can sometimes cause a bit a few problems with database normalisation.

Store will always look to auto increment the Order ID however so on a clean install you should never get this issue. If it persists and you're just running some tests then I'd try wiping the slate clean and starting afresh to ensure that old or inconsistent data isn't the cause of the issue.

---
Tags: expresso-store
---


# Question
Title: Grid - Is there a way to filter out an empty value field?
Let's say I have Grid `foo`.

Grid `foo` has three fields, `a`,`b`,`c`

The way to get all of them would be

{exp:channel:entries channel="some\_channel" ...} {foo} {a},{b},{c} {/foo} {/exp:channel:entries}

My question is, how do I use the `search` param for grids to filter out those fields where grid field `a` is empty?

I tried `{foo search:="=not "}` but it did not work.

Any ideas?

# Answer
> 2 votes
If `a`, `b`, and `c` are columns then you should be able to do something like:

```
{foo search:a="not IS_EMPTY"}

```

Where `foo` is the name of your grid field, and `a` is the column you're searching.

---
Tags: grid
---


# Question
Title: Move Channel Form Javascript to end of page
I need to move the javascript block that is used by the channel form module from below my form to the bottom of the page, (after my scripts).

It's says that if you want to supply jquery yourself you will need to place the script above the form. However doing this has introduced other errors. Also I'm using my own validation methods.

Is there anyway to just append the javascript block to the bottom of my page?

I'm using Zoo Visitor

Thanks

# Answer
> 1 votes
Some add-ons / field types in your Channel Form will only work if the JS is included in the head, which is unfortunate, as best-practice dictates your JS should live below the content.

I worked around this by adding a parameter in my header/footer embeds called `js_in_head`. On pages with Channel Forms, I just included my main jQuery include in the header, and not in the footer. A bit silly, but, it worked, and I could move onto the next issue.

---
Tags: channel-form, zoo-visitor, 2.8
---


# Question
Title: Client needs a Paypal donation form with recognition wall - use Comments?
I've got a site in progress that is a redesign of a Wordpress website, and the client was using a WP plugin that allowed users to make a Paypal donation and leave a comment for the donation "wall of recognition." I see a few WordPress plugins available with this kind of functionality, but nothing similar for EE.

I'm wondering if there's a way to set this up just using the EE Comments module? Can I set up a Paypal donate form and somehow send the EE comment with it? And if the user selects a box for "show my donation amount", pass that donation amount along with the comment form? Seems plausible in my head, but it's a bit beyond my comfort zone coding-wise, so before I delve into it too much, wondering if anyone else has a better idea of how to do this!

# Answer
There might be a way to do it with the included Simple Commerce and PayPal; otherwise it would be fairly easy to setup with the Charge add-on, although you'd be using Stripe instead of PayPal.
> 1 votes

---
Tags: paypal
---


# Question
Title: Add custom class when inserting images in Wygwam field
I have some images uploaded with a post which I now want to inset in the body text. It is a Wygwam field so I can use the built in integration but is it possible to add a custom class to the images when I do this without having to look at the source? I want to add class="img-responsive".

# Answer
> 1 votes
One approach is to define a custom style for the "Styles" toolbar menu in Wygwam. When the user applies the style (just a couple clicks) Wygwam applies your css class to the images as desired. The class is applied without the user needing to manually edit in source mode. The following snippet would do the trick (See the docs):

```
{name:'Responsive Image',element:'img',attributes:{'class': 'img-responsive'}}

```

The other approach (assuming you want to apply a style to all images in the wygwam field), is to just wrap your Wygwam custom field with a div that you can use as a descendant selector...

```
<div class="wygwam-field">
    {your_wygwam_custom_field}
</div>

```

...and then in your CSS, use `.wygwam-field img` as your selector instead of `.img-responsive`. Again, this only works if you'd consistently want this style applied to *all* images in the Wygwam field.

---
Tags: channel-images
---


title: Expresso Store - mark order as a gift

text:
# Question
Title: Expresso Store - mark order as a gift
Is there any way to pass additional info with Expresso Store order? I would like to have a check box during the checkout process which will indicate to make that order as a gift (requires special wrapping), something similar to `accept_terms` tag.

Thanks

# Answer
You can use the Custom Order Fields to achieve this. Something as basic as:

```
{field:custom_order1}

```

would create a text input but you can do:

```
<input type="checkbox" value="yes" name="custom_order1" />Is this a gift?

```

would allow you to create a checkbox. Full documentation on custom order fields.
> 3 votes

---
Tags: expresso-store
---


# Question
Title: Does MX Stop Spammers no longer work? What's an alternative?
Since I upgraded to EE 2.8.1, MX Stop Spammers has stopped working, with the following error:

```
Fatal error: Call to undefined method Cp::set_variable() in [path]/third_party/mx_stop_spammers/mcp.mx_stop_spammers.php on line 431

```

Before this, with 2.7.x, I was getting warnings about deprecated functions.

Is there a fix, and what's a good alternative for dealing with spam registrations?

# Answer
You can get new version from my git repository. New version is works with EE 2.8.1
> 3 votes

# Answer
I personally use Low NoSpam and have very few spam emails, comments, member registrations come through as a result. I have not upgrade any sites to EE 2.8 yet so I can't speak to if it is currently supported.

There are a bunch of other spam add-ons available here.
> 2 votes

---
Tags: registration, spam
---


title: Integration with Emma

text:
# Question
Title: Integration with Emma
Does anybody knows what tags are used to get Emma integration with EE (http://myemma.com/email-marketing-integrations/cms-email-integration/expression-engine) to work on templates?

# Answer
> 2 votes
I have updated MyEMMA GitHub code to get working with EE 2.7.x

To display simple subscribe form use tags below

```
{exp:emma:subscribe} {/exp:emma:subscribe}

```

More here https://github.com/InteractM/integration-emma-expression-engine

# Answer
> 0 votes
There is an add-on for MyEmma integration (found here), but it is for EE 1.x

You can contact developer for porting it over to EE2, or do that yourself.

---
Tags: add-on
---


title: Not getting the correct item tax label

text:
# Question
Title: Not getting the correct item tax label
Because we're still on EE 2.7.3, I'm using 2.2.0 of EXP:Store, and I'm running into a problem with itemised taxes.

We have items at 2 tax rates, 6% and 21%, separated into categories (and as luck would have it, there's only 1 6% category while there are 15+ 21% cats).

When I need to itemise each item's tax in the checkout list:

```
<td>{item_tax} ({tax_percent}%)</td>

```

Seems simple, except that while the first tag renders the correct tax, the second doesn't give the correct rate. I'm clearly missing something...

# Answer
> 1 votes
When you are using multiple tax rates, you need to use the `{adjustments}` loop to display each of them individually. The `{order_tax}` and `{item_tax}` variables will only display aggregate taxes so aren't suitable for dealing with multiple taxes.

"Adjustments" in Store are basically extra line items which are not real products (for example: discounts, shipping, and taxes). Each order can have many adjustments to the order total. See the checkout tag adjustments documentation for more information.

You can loop through the adjustments and display totals for each tax rate in the checkout or order tags like this:

```
{adjustments}
    {if adjustment:type == "tax"}
        {adjustment:name} ({adjustment:percent}%): {adjustment:amount}
    {/if}
{/adjustments}

```

---
Tags: expresso-store, tags, tax
---


# Question
Title: Cross reference entries - use tags or playa field?
I'm working on Exp-resso store and now I'm at the stage where I need to cross reference a product, which already belongs to categories (like Furniture -\> Chairs) under same channel 'Products'. Now I need to have same product to be in 'XYZ Collection' and 'Gifts Under $500' list, and as a final URL displayed it as it was in the Furniture-\>Chairs (avoid multiple URLs for same product from SEO perspective).

Which way will be the best to go - use tags (add-on like http://devot-ee.com/add-ons/tag or http://devot-ee.com/add-ons/tagger) or playa field?

Thanks

# Answer
This is a fairly common problem in EE sites, and I haven't seen an elegant way to solve it yet.

It stems from the fact that EE doesn't have any sort of notion of a "primary" category for each entry. So if you want to use categories in the URL, or display breadcrumbs for each entry, you need to either have the entry sit under two different URLs, or remove the categories from the URL altogether.

If SEO is your primary concern, then one possible solution is to make each product under a master URL (say `/products/show/product-url-title`) and also under category URLs (`/products/categories/books/product-url-title`). You can then put a canonical link in your page header to ensure only one version appears in search results.
> 1 votes

# Answer
Solspace has a Primary Category add-on, which does allow you to select one of the entry's categories as primary. Then you can always use the primary category in the URL, but the entry is still assigned to other categories as well. This seams simpler than having to resort to tags or some form of relationships for what is essentially assigning multiple categories.
> 0 votes

---
Tags: expresso-store, channel-entries, playa, tags
---


title: Conditional Not Working

text:
# Question
Title: Conditional Not Working
I'm having some problems with my view model template... I'm trying to compare the value of `url_title`, but regardless of the value of it the last conditional passes and sets the stash variable...

This is what I Have:

```
{stash:embed:layouts:full-width}

{exp:channel:entries limit="1" channel="pages" disable="member_data|pagination" require_entry="yes" dynamic="no" url_title="{segment_1}" parse="inward"}
    {exp:stash:set_value name="content" value="{exp:stash:embed:partials:supports-landing}"}
    {exp:stash:set_value name="body_class" value="{url_title}"}

    {if "{url_title}" == "supports-for-adults"}
        {exp:stash:set_value name="support_type" value="Adults"}
    {if:elseif "{url_title}" == "supports-for-children"}
        {exp:stash:set_value name="support_type" value="Children"}
    {/if}

    {exp:stash:set_list
        name="supports-landing"
        parse_tags="yes"
    }
        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:body}{body}{/stash:body}
        {stash:support_type}{exp:stash:support_type}{/stash:support_type}
    {/exp:stash:set_list}
{/exp:channel:entries}

{exp:stash:set_list
    name="supports-landing-list"
    parse_tags="yes"
}
    {exp:channel:entries channel="supports" disable="member_data|pagination" dynamic="no" orderby="title" sort="asc"}
        {if "{supports_for}" == "{exp:stash:support_type}"}
            {stash:support_title}{title}{/stash:support_title}
            {stash:support_excerpt}{supports_excerpt}{/stash:support_excerpt}
            {stash:support_cover_image}{supports_cover_image}{/stash:support_cover_image}
            {stash:support_url}{path='supports/{url_title}'}{/stash:support_url}
        {/if}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

Every time, regardless if i'm on `/supports-for-adults` or `/supports-for-children`, the value of `{exp:stash:support_type}` will be `Children`. If I remove the `if:elseif` part of the conditional, it will always be `Adults`.

Any ideas why this would be happening, been fighting with it for quite some time.. Tried removing the `"`'s, the `{`'s, tried using the `IfElse` plugin, tried using `Switchee`... Tried changing the `exp:channel:entries` to `dynamic="no"`, `parse="inward"`, `url_title="{segment_1}"` etc.. I can't think of anything else to try now...

# Answer
> 1 votes
Since you don't have a default `{if:else}` case, try using simple conditionals compared against `segment_1` (since that's setting your entry anyway).

```
{if segment_1 == "supports-for-adults"}
    {exp:stash:set_value name="support_type" value="Adults"}
{/if}
{if segment_1 == "supports-for-children"}
    {exp:stash:set_value name="support_type" value="Children"}
{/if}

```

# Answer
> 1 votes
Get yourself a copy of ifelse by Croxton - this will evaluate your conditionals but only output the condition that is met. OOB EE conditionals evaluate everything and then displays what is met.

so your code would look like this

```
{exp:ifelse parse="inward"}
    {if "{url_title}" == "supports-for-adults"}
        {exp:stash:set_value name="support_type" value="Adults"}
    {if:elseif "{url_title}" == "supports-for-children"}
        {exp:stash:set_value name="support_type" value="Children"}
    {/if}
{/exp:ifelse}

```

# Answer
> 0 votes
As I understand the parsing order of EE it actually parses all items within the conditionals and then decides which is correct and outputs that resulting code. So it is always parsing both stash values which is why you always get the second value as the result. Try using http://devot-ee.com/add-ons/switchee for your conditionals instead.

```
{exp:switchee variable="{url_title}" parse="inward"}
  {case value="supports-for-adults"}
    {exp:stash:set_value name="support_type" value="Adults"}
  {/case}
  {case value="supports-for-children"}
    {exp:stash:set_value name="support_type" value="Children"}
  {/case}
{/exp:switchee}

```

Switchee only parses the code within the case that matches so you will not overwrite your stash value as you are with native conditionals. Switchee can give quite a performance boost to your page if you are using exp:channel:entries calls within conditionals as well because you avoid needless calls to the database. You can also do regex matches.

---
Tags: stash, conditionals, url-title, switchee
---


title: Carthrob + Stripe International Country

text:
# Question
Title: Carthrob + Stripe International Country
I'm using Carthrob + Stripe. I'm using the boilerplate, {gateway\_fields} to render my checkout fields. However, I don't see the country select menu. Is this not there by default? I'm attempting to set pricing for international shipping, however, without a country select I can't. Any thoughts?

# Answer
> 1 votes
Yes, if you check your CT settings (Cartthrob \> Settings \> Payments) and you have your gateway set to Stripe you should see an "HTML Template" setting, which if left to Default, will display the HTML generated by the {gateway\_fields} tag. It doesn't include a country select.

You can copy this code and add it, along with a select tag for your country field, to your template of choice - or set said template right there on that page to continue using the {gateway\_fields} tag.

---
Tags: cartthrob, shipping, stripe
---


# Question
Title: Store Shipping Method Changes if Shipping and Billing Details Don't Match
Using Store 1.6.3 I have only two shipping methods: Collect in store (free), or UK flat delivery fee of £4 per order. When a customer chooses the delivery fee, but then unticks the Shipping Details are the Same as Billing Details, and adds a different shipping address, the method name doesn't change, but the value goes to zero (should stay £4)! I have tested this myself using two UK addresses and sure enough, the total reverts back to £4 once my shipping and billing addresses match. The live site: http://www.thirstymeeples.co.uk/

Any ideas what causes this? Thanks!

# Answer
Per the comments, one option is to remove the country restriction (UK) from the UK Delivery Flat Fee rule.

Because you aren't offering shipping outside the UK anyway, there's no need to restrict the shipping rule to UK only (since when no rules match the cart it is displaying $0 shipping).

In Store 1, generally if no shipping rules for the currently selected shipping method match the current cart, an error will be displayed. In Store 2, if no rules match the current cart then the shipping method is not even displayed.
> 0 votes

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


title: PHP error on Function.php

text:
# Question
Title: PHP error on Function.php
A client asked for some assistance in connecting up some Snippet Sync files and after uploading the files and Submitting the settings I get the following error when I try to load the home page:

> Parse error: syntax error, unexpected '}' in expressionengine/libraries/Functions.php(683) : eval()'d code on line 712

The site is running EE 2.5.5 and I can access the control panel without difficulty.

I would appreciate any assistance available on this.

Thanks.

# Answer
> 1 votes
It's an `eval()` error, which means the syntax in your templates is incorrect.

Check the snippets you recently changed, and in particular look for something like:

```
{if something == "nothing"}

{/if}} <-- oops! extra closing bracket

```

---
Tags: php-errors
---


# Question
Title: ExpressionEngine API - get channel entries to show on different site
I have a news on my EE site, it's http. Then i have another site that run on https. I want to show my news entries on my https site, remembering that https cannot iframing http page, i think i can use API to achive this.

My question is: can i use API? if yes, how to implement it? if no, can you give me options to achive my goal?

Thanks, Best Regards, .mafaik

# Answer
> 3 votes
You might try creating an RSS feed on the news site. It's fairly easy to setup an XML template and build it out using the standard RSS format, which you can find easily with a Google search.

After you have an RSS template established, you can use the Feed Parser add-on on the other site to read and display the RSS feed contents.

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


title: getting the last logged in date

text:
# Question
Title: getting the last logged in date
I have created a user dashboard and am trying to get the last loggin date to show on the homepage.

I tried {last\_activity} but got no output. Is there a variable I can use for this? The profile is extended using zoo visitor.

# Answer
> 1 votes
I'm not sure if Zoo Visitor handles this differently, but you may need to place `{last_activity}` within the `{exp:member:custom_profile_data}` tag.

Have you tried `{exp:member:custom_profile_data} {last_activity} {/exp:member:custom_profile_data}`?

Also, this will display for the current logged-in user unless you show it as part of a larger loop and specify the member\_id.

---
Tags: login, zoo-visitor, profile
---


# Question
Title: Any way to get Wyvern or Wygwam to set a tag PLUS its required attributes?
I know how to set up custom styles in Wyvern and Wygwam so that my client can apply, say, a \<dfn\> tag or \<abbr\> tag to some text. And I can set attributes within that tag. But the values of the attributes (in this case, **lang** and **title** attributes) are hard-coded via the custom style configuration.

Is there any way, using either Wygwam or Wyvern, to let the client specify the content of those attributes without them having to click the Source button and wallow around, shrieking, in the raw horror of HTML?

# Answer
> 1 votes
That should be possible by just adding a custom styleset. You can create a new .js file and then set the values in a Javascript array format:

```
CKEDITOR.stylesSet.add( 'my_styles',
[
    { name: 'Abbreviation', element: 'abbr', attributes: { 'lang': 'en' } }
]);

```

Full documentation is here.

So if you're using Wygwam for instance then create a new folder in the themes third party directory and call it something easy to recognise such as:

/themes/third\_party/wygwam\_assets

Create your new .js file inside this folder with the above (or something similar) in it.

Then tell Wygwam where to find the new styleset. In Addons \> Modules \> Wygwam select the configuration you want to use the new styleset. Then "Add an advanced setting" and choose "styleSet". In the text field that then appears enter the following (with your specific paths and file names replaced):

```
my_styles:/themes/third_party/wygwam_assets/my_styles.js

```

# Answer
> 1 votes
Why not use a javascript solution like this - http://www.zazar.net/developers/jquery/zglossary/

Create a channel called "glossary" then create the json file from the channel?

There are a ton of plugins out there with a few more features then the plugin above.

---
Tags: wygwam, wyvern
---


# Question
Title: Problem importing database - import hangs on exp_stash table
**Here's a weird one.** I need to set up a dev server, so I'm importing a DB from and existing production EE install. The import proceeds fine until it gets to the exp\_stash table. Then I get MySQL error 150. I've tried this on two different servers, but I get the same error.

```
CREATE TABLE  `exp_stash` (
`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`site_id` INT( 4 ) UNSIGNED NOT NULL DEFAULT  '1',
`session_id` VARCHAR( 40 ) DEFAULT NULL ,
`bundle_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT  '1',
`key_name` VARCHAR( 64 ) NOT NULL ,
`key_label` VARCHAR( 64 ) DEFAULT NULL ,
`created` INT( 10 ) UNSIGNED NOT NULL ,
`expire` INT( 10 ) UNSIGNED NOT NULL DEFAULT  '0',
`parameters` TEXT,
PRIMARY KEY (  `id` ) ,
KEY  `bundle_id` (  `bundle_id` ) ,
KEY  `key_session` (  `key_name` ,  `session_id` ) ,
KEY  `key_name` (  `key_name` ) ,
KEY  `site_id` (  `site_id` ) ,
CONSTRAINT  `exp_stash_fk` FOREIGN KEY (  `bundle_id` ) REFERENCES
`exp_stash_bundles` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = INNODB DEFAULT CHARSET = utf8 ROW_FORMAT = COMPACT;

```

The error is

```
#1005 - Can't create table 'versastu_oakcrk.exp_stash' (errno: 150)

```

Research shows it has something to do with InnoDB table type/db type, but solution is unknown.

# Answer
> 2 votes
For this particular quandary, this worked:

Add this line to the top of the SQL file:

```
SET FOREIGN_KEY_CHECKS = 0;

```

Source: http://devot-ee.com/add-ons/support/stash/viewthread/5700

If you see this problem and the above solution doesn't work, check this thread as well: http://devot-ee.com/add-ons/support/stash/viewthread/10311

---
Tags: stash, database, mysql, database-error, database-migrations
---


# Question
Title: 403 forbidden error when creating custom fields
I'm getitng a 403 Forbidden error when trying to create custom fields. I can create/edit templates, create/edit channels, administer members and I'm a member of the Super Admins group.

The error occurs regardless of the field type and I'm not putting any special characters in there.

Example: Type: Text field Name: Strapline Shortname: cf\_productinfo\_strapline

The rest of the fields are set as their defaults.

The exact error is

> You don't have permission to access /promin/index.php on this server.
>
> Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Could it be hosting related?

Thanks in advance

# Answer
Thanks for the responses. It turns out that it was a hosting issue!

Thanks again.
> 0 votes

# Answer
Usually this is an issue with mod\_security, your host would usually need to whitelist the content or similar.
> 1 votes

---
Tags: custom-fields, error
---