# Question
Title: Get Absolute Results outside of Low Search Results tag pair
Is there any way to get the **absolute results** on a Low Search results page outside of the {exp:low\_search:results} tag pair?

Something like:

```
{exp:low_search:absolute_results query="" collection="" limit=""}

```

So I can do this without the tag pair extra coding:

```
<a href="#venues">
    Show all {exp:low_search:absolute_results query="{segment_2}" collection="venues"} Venues found
</a>

```

Using the tag pair once or twice on a page is fine but it starts to get unwieldy after a while because I am grouping the collections on Bootstrap tabs and other UI foolery.

# Answer
This is not possible at the moment.

When Low Search filters entries, it will pass on its search results (the the form of entry IDs) to the native channel:entries tag. This, in turn, will filter down the entries even further depending on things like status, future/expired entries and other native parameters.

EE currently does not offer an API for firing those filters and returning just a results number -- this is only available when calling the channel:entries tag with the absolute\_results var.
> 1 votes

# Answer
Depending on what else you are doing on the page, you could of course simply save the results of the tag-pair(s) when you first run them and then get those back later in the page. There are several ways to do this, including stash and CE Variables (both of which are free).
> 0 votes

---
Tags: low-search
---


# Question
Title: Freeform Form expired error in Google Chrome only
I am using an {exp:freeform:form} tag for contact requests and am getting this error when submitting the form in Google Chrome only:

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

Because this is EE's CSRF protection error, I tried disabling CSRF protection in my config file and submitting the form. This works, but I dont' want to leave it off permanently.

```
$env_config['disable_csrf_protection'] = "y";

```

The odd thing is, why would this only happen in Chrome and not Firefox, Safari, etc.

Could it be a Cookie issue?

The site is using: EE 2.9.2 Freeform 4.2.0

# Answer
ExpressionEngine 2.9.3 officially addressed and resolved some common issues with CSRF. I strongly suggest you upgrade to EE 2.9.3 or greater to resolve or rule out that issue. :)

"CSRF tokens stored in cookies refresh with page refresh." - ExpressionEngine 2.9.3 Change Log
> 1 votes

---
Tags: solspace-freeform, solspace, csrf, chrome
---


# Question
Title: Expression Engine 1.7.1 new page generating {segment_3_category_name} tag instead of content
Yes, its an old version of EE. I take no responsibility for this. Trying to create a new page, but every time we save a revision and go to Live Look (or go straight to the page on the live site), all of the text from the Body and/or Extended text fields are lumped into the right side-bar, and the "body" of the page just shows:
**{segment\_3\_category\_name}**
Coming Soon! Please check back later.
Active plugins include Structure and Workflow. First question here, I'm assuming I'm missing critical information, so please feel free to yell at me for missing something obvious. :D

# Answer
Interesting. Looks like it was an issue between the Page URL and the URL title not matching in the Structure tab. I originally had the URL set to "newstudentoffer" and the URL Title set to new\_student\_offer. That mismatch was throwing off the system. After I made the URL new\_student\_offer, everything showed up correctly and the {Segment\_3\_category\_name} tag disappeared.
> 0 votes

---
Tags: structure, ee1, workflow
---


# Question
Title: Stash Channel Entries Loop -> Replacing a part of Tag Pair field name?
Stash 2.6.7 EE 2.10.1

I've been stumped on this one for over 8 hours and feel like I'm overlooking something so simple. I've reviewed the Low parse order guide but still can't get it to work. I've tried different routes with using get\_list, setting exp:stash:set to snippet type, etc.

```
{!-- LIMIT & GRAB ONLY FIRST CATEGORY NAME OF ENTRY (Entry can have multiple categories) --}
{exp:channel:entries channel="resources" dynamic="no" limit="6" disable="member_data|pagination"}
    {exp:stash:set name="entry_{entry_id}_category" trim="yes" parse_tags="yes" parse_depth="2"}
            {exp:gwcode_categories entry_id="{entry_id}" depth="1" limit="1" style="linear"}
                {cat_url_title}
            {/exp:gwcode_categories}
    {/exp:stash:set}
{/exp:channel:entries}

{!-- DROP IN STASH VARIABLE FOR FLEXIBLE TAG PAIR --}
{exp:stash:parse process="end"}
{exp:channel:entries channel="resources" dynamic="no" limit="6" disable="member_data|pagination" parse="inward"}

            {{stash:entry_{entry_id}_category}_resource_images}
            <div class="thumb">
                <a href="#"><img src="{image:url:small}" alt=""></a>
            </div>
            {/{stash:entry_{entry_id}_category}_resource_images}

{/exp:channel:entries}
{/exp:stash:parse}

--------

{!-- WORKS IF I SIMPLY DROP IN SEGMENT_2 (which is "print" category) --}
{exp:stash:parse process="end"}
{exp:channel:entries channel="resources" dynamic="no" limit="6" disable="member_data|pagination" parse="inward"}

            {{segment_2}_resource_images}
            <div class="thumb">
                <a href="#"><img src="{image:url:small}" alt=""></a>
            </div>
            {/{segment_2}_resource_images}

{/exp:channel:entries}
{/exp:stash:parse}

```

As you see in the third block above, replacing the Stash variable with segment\_2 which translates to "print" works and pulls in the image. So it's definitely a parse order issue. How can I get Stash to parse '{stash:entry\_{entry\_id}\_category}' first before parsing the outer tag pair?

Thanks!

# Answer
Stash parses any known `{stash:variable}` style markers at the beginning of each pass of the tagdata it wraps (working from the top layers of tags inwards). However `{stash:entry_{entry_id}_category}` does not resolve to a known stash variable until *after* `{entry_id}` has been parsed by the channel entries tag. By which point the channel entries tag has completed parsing and it's too late.

I would instead use nested stash lists:

```
{!-- set a list of entries, the first assinged category and all possible images fields --}
{exp:stash:set_list name="entries" parse_tags="yes" parse_depth="3"}
    {exp:channel:entries channel="resources" dynamic="no" limit="6" disable="member_data|pagination"}

        {!-- capture all the single value fields you need here --}
        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:title}{title}{/stash:title}

        {!-- capture the category for the entry --}
        {exp:gwcode_categories entry_id="{entry_id}" depth="1" limit="1" style="linear"}
            {stash:cat_url_title}{cat_url_title}{/stash:cat_url_title}
        {/exp:gwcode_categories}

        {!-- capture images for every possible category here, assuming each is a custom field --}
        {exp:stash:set_list:nested name="category_print" context="{entry_id}"}
            {print_resource_images}
                {stash:url}{image:url:small}{/stash:url}
            {/print_resource_images}
        {/exp:stash:set_list:nested}

        {exp:stash:set_list:nested name="category_another" context="{entry_id}"}
            {another_resource_images}
                {stash:url}{image:url:small}{/stash:url}
            {/another_resource_images}
        {/exp:stash:set_list:nested}

        {!-- ...etc... --}

    {/exp:channel:entries}
{/exp:stash:set_list}

{exp:stash:get_list name="entries"}

    <h1>{title}</h1>

    {exp:stash:get_list:nested name="category_{cat_url_title}" context="{entry_id}" prefix="image"}
    <div class="thumb">
        <a href="#"><img src="{image:url}" alt=""></a>
    </div>
    {/exp:stash:get_list:nested}

{/exp:stash:get_list}

```
> 2 votes

---
Tags: ee2, stash, parse-order
---


title: Copy / export channel entry content

text:
# Question
Title: Copy / export channel entry content
I have a production and local environment that I want to be able to transfer content between. I can't take a copy of the database as the production environment and local will be at different stages of the project.

My ideal would be to export channel entry content (including grid and matrix) and then import that into the production site.

Does anyone know of a module, script etc... that does this?

Thanks, James

# Answer
Syncing entries can fraught with danger and you need to stick to one direction ie. dev\>live or vice versa.

I'd look at grabbing a copy of DataGrab and installing that on the live server.

On the dev server, you will have to create templates that renders each channels entries as XML or json objects. There can be some tweaking required dependant on your actual content/fieldtype but there's plenty of info around and the docs for DataGrab are a good start.

Visit/save the output of the XML/json templates on your dev server.

On the live server, place a copy of the dev servers object. Jump into DataGrab and configure where the file is & how you want the data to be treated. There's plenty of options and you may need to tweak your source format especially for grid fields or complicated fields.

Remember to test, test, test.
> 0 votes

---
Tags: channel-entries, export, migration, content, backup
---


title: MSM and bespoke extension

text:
# Question
Title: MSM and bespoke extension
I have inherited a site that makes use of a bespoke extension that has a long list of settings (https://docs.expressionengine.com/latest/development/extensions.html#abstracted-settings-form-and-processing).

The site is becoming an MSM one so i need to create site specific settings. Does EE handle this or do i need to build MSM support into the extension? Cant seem to find anything in the docs.

# Answer
> 1 votes
Nope, the extension settings are for the entire control panel across all MSM sites by default (no site\_id references). You will have to build in your own site\_id references into the setting storage. You can store the settings as a multi-dimensional array, so use the numerical parent array as the site\_id reference? You will probably have to use your own view file to display the settings page though and ensure the array structure is retained.

Edit: Further thought, you won't need to use your own view file, as you can send only the required site settings to the default view (return of function), therefore using the default, just ensure you capture the save settings to place it into the appropriate multi-dimensional array element.

---
Tags: plugin, extension
---


# Question
Title: DevDemon Subscriptions - Your card was declined
I'm using DevDemon Subscriptions 1.5.3 and EE 2.9.2. I've installed the demo templates, set up some subscriptions and added the Stripe details. When I try and make a payment using the Stripe test cards, it comes back saying Your card was declined.

Is there anything else I need to do to put through some test payments?

# Answer
Make sure you setup your Test public key on the page and use approved Test Cards from Stripe.

https://stripe.com/docs/testing

This should work appropriately.
> 1 votes

---
Tags: devdemon, subscriptions, devdemon-subscriptions
---


title: minimee v2 and ee2 caching

text:
# Question
Title: minimee v2 and ee2 caching
I am using expressionengine 2 and trying to compress css and js files, i can see the cached in the cache folder on my site root folder but the site does not display, it keeps loading. has there been anyone with this issue, are there any other alternatives for doing the above without slowing down the site.

thanks

# Answer
> 0 votes
I’d agree with Peter - start by breaking up the Minimee calls to give you lots of little minimee downloads: depending on how much stuff you have, maybe even try doing one per item to begin with. Once you have done this, you can exploit the `queue / display` feature to stack up more than one entry to see how combinging them works. For example:

`{exp:minimee:css queue="header”}
… css stuff …
{/exp:minimee:css}
…other stuff…
{exp:minimee:css queue="header”}
… more css stuff …
{/exp:minimee:css}
… other stuff …
{exp:minimee:display css="header”}`

will give you a single block of minimsed CSS cached by minimee that combines the two ‘header’ queues entries.

Useful documentation here - http://johndwells.github.io/Minimee/

HTH

---
Tags: cache, caching, cache-breaking
---


# Question
Title: Expresso Store Togging between Ex Tax and Inc Tax
All products on my store are entered excluding VAT/TAX. All Items are Taxable at 20%.

We're currently showing the prices on the site excluding VAT and VAT is added at the checkout. However, the site has been reported to the ASA (Advertising Standards Authority) and they have deemed that we need to show all prices Ex. and Inc. VAT.

The client has asked for a toggle that the user can select - however, I'm have trouble even simply showing the prices Including VAT... the `{price_inc_tax}` doesn't appear to work even though I've set the TAX rule to apply to all products in all areas.

Anyone ever accomplished showing both Ex. and Inc. VAT/TAX on the page?

# Answer
Have you looked at this add-on? https://devot-ee.com/add-ons/add-vat
> 0 votes

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


# Question
Title: Zoo Visitor: delete all in member group + channel entries
I have a member group with 10,000 members. I need to delete all of those members plus all channel entries assigned to them.

Thanks for any help you can provide.

# Answer
I ended up appending the url that shows the members in the control panel, so that I could view 1000 at a time from member group 5.

```
&group_id=5&perpage=1000

```
> 0 votes

---
Tags: zoo-visitor
---


title: Channel Entries Month Without Year?

text:
# Question
Title: Channel Entries Month Without Year?
I'm trying to display all entries in certain months without caring about what year it's in. Currently the tag looks like (for February as an example):

```
{exp:channel:entries channel="{embed:listingchannel}" month="2" show_future_entries="yes" dynamic="no" orderby="entry_date" sort="asc"}

```

However it only shows entries from 2016 and not 2017. How could I make it pull in entries from future years?

Bit of context: I'm putting an event calendar on a website. Some events listed are for the next year and I still want them to show even though it's not that year yet. It needs to be dynamic so I don't have to go in and update years every month to grab the future events that are listed.

# Answer
> 0 votes
This is not possible with current scenario of ExpressionEngine Channel entries tag. You can create small plugin (pi file) to manage this.

Let me know if you are new in this and don't know to create plugin. I can create one for you.

---
Tags: channel, entries
---


# Question
Title: Expresso Store Product Tag returns empty - including all template HTML
Silly question here I'm sure -- created a new channel for products on a pre-existing EE/Expresso Store install. I'm using code that easily displays products for the old channels, but seems to be breaking on this new template. Here's the template's tags --

`{exp:channel:entries channel="mounts" limit="1" dynamic="no"}
 {exp:store:product entry_id="{entry_id}" return="/ordnance/store-checkout"}`

Any items placed in between the product tag and its closer is omitted from the resulting page. I was thinking that maybe there was a breakdown from the prior page sending the proper entry\_id, but if I move the product tag down further in the code (to say, wrap only the "Buy Now" button), the proper product and associated fields are in fact displayed on the page.

So, essentially, the product tag is encountering an error and causing all wrapped content to not be displayed, as well as the modifiers included there.

A couple of notes that might help: 1) this is the first channel to be displayed on this site under a new template group. In other words, all other products/channels were displayed at

> xxxx.com/firearms/all-old-product-channels/product-page

And this new channel is being displayed at

> xxxx.com/ordnance/new-channel-/product-page

& 2) That's the reason I through the `dynamic="no"` into the entries tag.

Sorry for the poorly formed question, but it's my first here. Your help is greatly appreciated!

# Answer
> 0 votes
As I first stated, I'm sure this was a silly question. Dealt with the wonderful Devs of the Expresso Store who quickly were able to step through a few debugging items only to find the culprit:

I didn't have a price set for the product.

By simply setting the price 0.01 (or more), the Expresso Store happily displayed the full contents of the entry, and everything is working as expected. I hope my idiocy helps someone in the future!

---
Tags: expresso-store
---


# Question
Title: Channel Images tag pair breaks page parsing
I am using channel image 5.4.2 and as per docs I trying simple template like":

```
<html>
  <head>
  <meta charset="UTF-8">
  <title>Document</title>
  </head>
   <body>
      {exp:channel:entries
      channel='articles'
    dynamic='no'
    entry_id='85'
    limit='1'}
    {title}
 {exp:channel_images:images channel="articles" entry_id="85"}
    <img src="{image:url}" alt="{image:id}">
{/exp:channel_images:images}
{/exp:channel:entries}
 </body>

```

Where I have custom field, called "article images". The problem is that when I add this and try to open the template I'm getting "ERR\_CONTENT\_DECODING\_FAILED" and page breaks.

Actually my end point is to add this in json output and to be able to consume added images json property from the whole json object, which is used for website data.

Does anybody had this issue?

EDIT: Actually what I do need on the front-end is

```
"article_images" :
    [
        "/imgs/237455.jpg",
        "/imgs/4H631C00.jpg",
        "/imgs/243224.jpg"
    ]

```

this to be added as JSON property

# Answer
The version 5.4.2 has terrible behaviour and I would say that is not for production use at all. Sorry DevDemon, it's nice add-on but this version isn't that stable. I switched to Matrix.
> 0 votes

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


# Question
Title: Using Channel Form to populate VMG Chosen Member Field with member_id
Can't seem to figure out how to add members via Channel Form to a VMG Chosen Member field.

Members need to be able to sign up for a session of their choosing on the front-end and be associated with that particular session in the CP.

There isn't any documentation on the vmg\_chosen\_member git page other than how to format/style the field if you're using {field:session-attendees}.

Ideally, I would pass the logged in member\_id via a text input field like so:

```
{exp:channel:form channel="sessions" entry_id="{last_segment}" id="session-registration" class="session-form" return="url/success"}

<input name="session-attendees" type="text" value="{member_id}" />

<input type="submit" value="Register for this session" />

{/exp:channel:form}

```

But that doesn't work.

I don't want to use {field:session-attendees} because the member signing up for a session does not need to see the other members signed up.

What's the proper way to add members to a chosen member field via Channel Form?

# Answer
If you're wanting to pass in a member\_id to a VMG Chosen Member field, you'll need to pass it in as an array with a single member\_id. The following should work for you, but let me know if you still have issues!

```
{exp:channel:form channel="sessions" entry_id="{last_segment}" id="session-registration" class="session-form" return="url/success"}

<input name="field_id_1[]" type="text" value="{member_id}" />

<input type="submit" value="Register for this session" />

{/exp:channel:form}

```

(replace `field_id_1[]` with the ID of your VMG Chosen Member field)
> 1 votes

---
Tags: safecracker, vmg-chosen-member
---


# Question
Title: Help! Unable to save Assets entries in Grid
Unable to save Assets entries in GridI'm using Assets 2.6 on EE 2.10.2 running with Publisher 1.6.8

I'm able to define Assets fields within Grid fields.

The resulting Asset Fields work insofar as they open Assets and allow the selection of items. However upon saving the selected items are not stored in the Grid field.

Other fields within the Grid work fine, and there are no apparent problems with the rest of the site. Assets entries stored in Matrix fields are fully accessible / work OK: but need to move to Grid as Matrix not being updated to EE3... :(

Editing a Grid with Assets entries previously saved within (created by external importer) results in the entry being deleted (or not saved).

Is this something that has happened elsewhere? Any ideas what I can do about it?

Thx

# Answer
> 0 votes
Turns out it was a bug in Publisher: seems to be referred obscurely as a "Grid persistence error" in changelog that was fixed in 1.6.10.

---
Tags: assets, pixelandtonic, grid
---


title: Unable to save Assets entries in Grid

text:
# Question
Title: Unable to save Assets entries in Grid
I'm using Assets 2.6 on EE 2.10.2 running with Publisher 1.6.8

I'm able to define Assets fields within Grid fields.

The resulting Asset Fields work insofar as they open Assets and allow the selection of items. However upon saving the selected items are not stored in the Grid field.

Other fields within the Grid work fine, and there are no apparent problems with the rest of the site. Assets entries stored in Matrix fields are fully accessible / work OK: but need to move to Grid as Matrix not being updated to EE3... :(

Editing a Grid with Assets entries previously saved within (created by external importer) results in the entry being deleted (or not saved).

Is this something that has happened elsewhere? Any ideas what I can do about it?

Thx

# Answer
I don't offer support through Stack Exchange. But you should try upgrading to the latest version first. Always upgrade before submitting a bug report... the bug may already be fixed.
> 0 votes

# Answer
Turns out it was a bug in Publisher: seems to be referred obscurely as a "Grid persistence error" in changelog that was fixed in 1.6.10.

Would have got there sooner if Brian Litzinger had actually said as much in his posting above rather than just hinting at...
> 0 votes

---
Tags: assets, grid, publisher
---


title: Delete Field Editor

text:
# Question
Title: Delete Field Editor
Just wondering if you can delete Field Editor without it running into issues with fields created with it.

Looking to upgrade to EE3 and Field Editor isn't supported yet.

# Answer
Yes, you can uninstall it with no problem. Your fields will remain intact.
> 1 votes

---
Tags: field-editor
---


# Question
Title: ExpressionEngine 2.3.1 and PHP 5.6 support
My service provider have upgrading from PHP 5.4 to PHP 5.6. I'm currently running EE 2.3.1.

After the upgrade, I get a "ERR\_CONTENT\_DECODING\_FAILED" on frontend. In the backend, I can log in, but none of the menuitems work and I get some mysql errors.

As far as I can see, the mysql\_escape\_string() is used, but is deprecated in PHP 5.6

The errors in backend: https://www.dropbox.com/s/r769zkuf8qnphvz/Screenshot%202016-03-04%2010.29.35.png?dl=0

First of all, can I upgrade to another version or am I stuck in this version? If so, which possibilities are there, to get the site up and running again?

# Answer
> 1 votes
A couple things. Usually get the the ERR\_CONTENT\_DECODING\_FAILED error when there are PHP errors/notices breaking the gzip output. You can turn off Gzip Output in the Output and Debugging preferences. This will allow you to see what the errors are on the front end.

The errors are most likely strict and deprecation notices. If so, you can disable these error types in your PHP settings (PHP.ini or your host can help you).

```
error_report = E_ALL & ~E_DEPRECATED & ~E_STRICT

```

---
Tags: upgrade, database-error
---


title: Creating new MSM site keeps timing out

text:
# Question
Title: Creating new MSM site keeps timing out
I'm trying to to create a new MSM site from one of the existing sites but i keep getting 500 internal errors.

Looking in the apache error log it says:

> Thu Mar 10 14:25:54 2016\] \[error\] \[client ::1\] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php5.4.42.fcgi" aborted: idle timeout (30 sec), referer: http://example.dev/ycmanage/index.php?S=0&D=cp&C=sites&M=add\_edit\_site

I have increased max\_execution\_time & max\_input\_time to 20 minutes and increased the memory allowance to 1024MB.

What more can i do?!

# Answer
I believe you need to increase the -idle-timeout value in your vhost .conf file.

Documentation:

http://www.fastcgi.com/mod\_fastcgi/docs/mod\_fastcgi.html#FastCgiExternalServer

If you are not able to configure this you probably need to figure out how to speed up the execution so it can complete in under 30 seconds. My guess is that MySQL is taking a long time to execute...

Related: https://stackoverflow.com/questions/17345016/mod-fastcgi-idle-timeout-not-work
> 0 votes

---
Tags: multi-site-manager
---


title: Facebook connect in codeigniter app

text:
# Question
Title: Facebook connect in codeigniter app
I am trying to create a facebook app on my local machine which will allow users to login/register on the app by using their facebook login details. I have gone through 2 tutorials and i keep getting one of 2 errors.

1.404 Page Not Found when i go localhost/app/login 2. CodeIgniter: “Unable to load the requested class” whe localhost/app/index.php/login

has anyone gone through this issue before or am i missing something.

Thnaks

# Answer
Tha @jim Wyse implemented the facebook sdk 5 module in the contollers and views folder. worked locally
> -1 votes

---
Tags: facebook
---


title: Expressionengine migration module

text:
# Question
Title: Expressionengine migration module
I'm a newbie in expression engine and would like to know if there is a module, app, plugin or script that allows for one to move not only the site but addonn settings from local \> staging \> production.

I have used drupal 7 and they have a features module where dependencies for specific modules can be set and moved from local \> staging and production without having to setup on the different environments.

# Answer
You might find a thing called MasterConfig by FocusLabs is what you need. You can read more about it and how to use it in this useful posting by Patrick Pohler -“ExpressionEngine multiple environments with Master Config

I’ve not used it, but general feedback on the EE Slack suggests that many do, and find it useful, but that configuration for multiple platforms can be a bit of challenge.

HTH
> 0 votes

---
Tags: migration, feature-request
---


# Question
Title: Using Stash pagination links and need cleaner URL's
Using the pagination feature in stash something like this:

```
{exp:stash:get_list
    name="sv_blogs_post_list"
    parse_tags="yes"
    parse_conditionals="yes"
    process="end"
    prefix="st_pre"
    limit="{stash:list_limit}"
    paginate="bottom"
}

    {!-- THE PAGINATION --}
    {st_pre:paginate}
        {pagination_links}
            {previous_page}<a href="{pagination_url}" class="btn btn-brick flat">Previous Post</a>{/previous_page}
            {next_page}<a href="{pagination_url}" class="btn btn-brick flat pull-right">Next Post</a>{/next_page}
        {/pagination_links}
    {/st_pre:paginate}

{/exp:stash:get_list}

```

The problem is that the URL stays with the `{url_title}` of whatever the initial blog post read was. Is there a way to use the next and previous to actually link to the true link?

---

*** UPDATE ***

I decided to use the `{exp:channel:next_entry}` and `{exp:channel:prev_entry}` per a suggestion from @croxton. Now I have this:

```
{exp:channel:prev_entry
    url_title="{segment_2}"
    channel="blog_post"
}
    <a href='{path="blog"}' class='btn flat'>Previous Post</a>{/exp:channel:prev_entry}
{exp:channel:next_entry
    url_title="{segment_2}"
    channel="blog_post"
}
    <a href='{path="blog"}' class='btn flat pull-right'>Next Post</a>
{/exp:channel:next_entry}

```

NOW the issue is stash keeping the same variables on the page when it directs to the new link...

Current Page: `http://my-site.com/blog/article-3`

Previous Link: `http://my-site.com/blog/article-2/`

Next Link: `http://my-site.com/blog/article-4`

That is working great... However, the page content is keeping the stashed values for elements like `<div class="title">{st_pre:sv_bp_title}</div>`.

That sits inside my `{exp:stash:get_list}` which is set like this:

```
{exp:stash:get_list
    name="sv_blogs_post_list"
    parse_tags="yes"
    parse_conditionals="yes"
    process="end"
    prefix="st_pre"
    limit="{stash:list_limit}"
    paginate="bottom"
}

```

All of those are being set in a data template like this:

```
    {exp:stash:set_list name="sv_blogs_post_list" parse_tags="yes" parse_depth="2"}
        {exp:channel:entries
            channel="{stash:channel}"
            dynamic="{stash:dynamic}"
            orderby="{stash:order_by}"
            status="{stash:status}"
            limit="{stash:limit}"
            paginate="{stash:paginate}"
        }
            {stash:sv_bp_entry_id}{entry_id}{/stash:sv_bp_entry_id}
            {stash:sv_bp_entry_date}{entry_date format="%m.%d.%Y"}{/stash:sv_bp_entry_date}
            {stash:sv_bp_relative_time}{relative_date}{/stash:sv_bp_relative_time}
            {stash:sv_bp_author}{author}{/stash:sv_bp_author}
            {stash:sv_bp_screen_name}{screen_name}{/stash:sv_bp_screen_name}
            {stash:sv_bp_title}{title}{/stash:sv_bp_title}
            {stash:sv_bp_url_title}{url_title}{/stash:sv_bp_url_title}
            {stash:sv_bp_url_title_path}{url_title_path='blog'}{/stash:sv_bp_url_title_path}
            {stash:sv_bp_blog_copy}{blog_copy}{/stash:sv_bp_blog_copy}
            {exp:stash:set_list:nested name="sv_bp_header_images_{entry_id}" parse_tags="yes"}
                {header_image}
                    {stash:sv_bp_header_image}{image:url:slider}{/stash:sv_bp_header_image}
                    {stash:sv_bp_header_image_original}{image:url}{/stash:sv_bp_header_image_original}
                    {stash:sv_bp_header_image_title}{image:title}{/stash:sv_bp_header_image_title}
                {/header_image}
            {/exp:stash:set_list:nested}
        {/exp:channel:entries}
    {/exp:stash:set_list}

```

Am I missing a tag in my set or get for stash???

# Answer
Thanks to Mark Croxton (Twitter) and Sam Royama (Skype) for the help with this one. Mark got me going with the Prev/Next entry solution. Sam helped me realize my rookie mistake of not accepting a `url_title` parameter in my `set_list`. GRRRRR

So... In the last block of code from the OP, I needed to add the `url_title` like this:

```
{exp:stash:set_list name="sv_blogs_post_list" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries
        channel="{stash:channel}"
        dynamic="{stash:dynamic}"
        orderby="{stash:order_by}"
        status="{stash:status}"
        limit="{stash:limit}"
        paginate="{stash:paginate}"

        url_title="{stash:url_title}"

    }
        ...

```
> 0 votes

---
Tags: stash, url, pagination, links
---


title: Expressiong Engine Heirarchy

text:
# Question
Title: Expressiong Engine Heirarchy
I am new to expression Engine and I'm coming from a Wordpress background. I am just trying to wrap my head around all the terms. Despite taking some online lessons, I am still lost at explaining what a template and channel are. I've gone to Ellis Labs many times and their definitions seem way too generic. When I go to build a new site, I am not sure which should be built in a channel or template and I don't know why.

Does anyone know of any hierarchy of some type that lays out the framework of the Expression Engine? Perhaps a place that gives an exhaustive definition of each part of the framework (template, channel, entries fields, entries fields group, channel fields group, categories, categories group, relationships, etc) Ugh......just listing them..... can you see why I'm getting confused!?! What is more important then what? If Expression Engine were a chessboard, which ones are queens or kings or pawns? get me?

# Answer
EE has a steep learning curve, so don't think you are alone in being mystified as a new user. There are probably better definitive books you can get that explain things - one highly regarded recent book is this one and is probably worth getting / reading.

Three key concepts to get you started though.

1) In EE information (e.g. blog entries etc.) are stored independently of any direction about how they will subsequently be displayed. All data is stored in **fields** which are themselves stored within **entries** within a **channel**. You can define multiple channels within a web site - so one for products, another for locations, a third for blog articles and so on. Each channel is associated with a specific set of defined fields - this collection of fields is known as a **channel field group**. When you add a new bit of information to your database, it has to be entered as an entry in a channel, and will comprise data stored in some or all of the fields you have defined for that channel (you can mark fields as being compulsory or not). So you can have a channel for blog entries, and define that each blog entry will have a name, some text, and an image - i.e. three fields. Each time you try to add an entry to the blog channel you'll be asked for these three items of data. You can do clever things with the data if you want to - for example you can attach 'categories' (think tags) to entries within a channel (so you could have a category for 'sports' and 'cars' in your blog if you like) and then extract from the blog channel just those entries about cars (for example).

2) In EE page design is quite separated from data - a **template** is the set of instructions you need to construct a page for the web site, and as part of the instructions for the template you can include rules for how EE will work out what data to display within the template. Most of a template will be the HTML codes you want to use to generate your page - but within that HTML you can insert EE tags (that are denoted by {} brackets) that will be decoded by EE and used to inject data into your HTML. So for example if you are displaying data from a channel that has a "title" field, you might see HTML like this in the template `<h1>{title}</h1>`. In general you create templates to display information from a channel as a list (i.e. one listing all your blog entries), or as single entry display templates (where the same template can then be used by each of your blog entries). Template design can get very clever once you have got the basics - so you can mix and match data within the same page, and can get very clever about exploiting features of the EE data retrieval system to generate very sophisticated pages of data with not a lot of coding. EE also fully supports modern cleverness such as responsive design and API driven sites - thanks in part to its clean separation of data and display elements.

3) EE has a lot of core functionality, but is also a system that has many many functional extensions. Some of these help with the storing of data - for example by adding new kinds of fields to the set you can deploy in a channel. Others help by making some common template coding tasks easier. There is a strong community behind these 'add-ons' and probably most working EE sites are using several such Add-ons. If you have not found it already you should check out a site called devot-ee.com which is a valuable source of free and paid for add ons.

Something you might find useful too is to check out the two EE add-ons that can be used to make EE behave more like a page based CMS - Structure and Construct \- if you want them to they can help hide much of the complexity of EE.

Hope this helps - it only scratches the surface, but maybe it will be of use.
> 1 votes

---
Tags: tags
---


# Question
Title: Conditional with if and ifelse not working
Every entry has one image {event\_feature\_image\_01}, however, some entries have a second, third and forth image. I want to count backwards from the forth image {event\_feature\_image\_04}. Every entry has one image. So that is the {if:else}.

I tried to put in 3 images using {if:else if} but Something is not right in the syntax and I am not sure what it is.

```
{if event_feature_image_04} <img class="img-responsive osd-border" alt="Photo:{event_name}" src="{event_feature_image_04}" {if:elseif src="{event_feature_image_03}"} {if:else} src="{event_feature_image_01}" {/if}>

```

Thanks

# Answer
> 1 votes
Option 1 - show nothing at all if there is no image:

```
{if  event_feature_image_04
  OR event_feature_image_03
  OR event_feature_image_02
  OR event_feature_image_01}
<img class="img-responsive osd-border" alt="Photo:{event_name}" src="
{if event_feature_image_04}{event_feature_image_04}
{if:elseif event_feature_image_03}{event_feature_image_03}
{if:elseif event_feature_image_02}{event_feature_image_02}
{if:else}{event_feature_image_01}{/if}
">
{/if}

```

Option 2 - show a default image if no `event_feature_image` is set:

```
<img class="img-responsive osd-border" alt="Photo:{event_name}" src="
{if event_feature_image_04}{event_feature_image_04}
{if:elseif event_feature_image_03}{event_feature_image_03}
{if:elseif event_feature_image_02}{event_feature_image_02}
{if:elseif event_feature_image_01}{event_feature_image_01}
{if:else}dummy_image.jpg{/if}
">

```

---
Tags: conditionals, ifelse
---


title: Upgrading to Calendar 2 and EE3

text:
# Question
Title: Upgrading to Calendar 2 and EE3
As a practical matter—is it better/easier/more advisable to upgrade to Calendar 2 before upgrading to ExpressionEngine 3, or the reverse?

# Answer
> 2 votes
You cannot upgrade to Calendar 2 while on EE2, as it is only compatible with EE3. We created a very thorough walkthrough and user guide for customers wishing to upgrade from Calendar 1 / EE2 to Calendar 2 / EE3 here:

https://solspace.com/expressionengine/calendar/docs/calendar-1-migration/

So to exactly answer your question, you need to upgrade Calendar and EE at the same time (take site offline, upload EE3 files, upload Calendar 2 files to EE3 addons folder, then upgrade EE. Then upgrade Calendar, and update your templates). :)

---
Tags: solspace-calendar
---


# Question
Title: In Freeform, where is the 'from' email address set?
I'm using freeform for a simple contact form. Notification emails are being sent when the form is submitted, but they are coming from my gmail.com email address, and I would like them to come from my info@mydomainname.com address. Where can I set the email address that the form submission notification emails originate from?

I appreciate your help!

# Answer
By default, if you do not have any Email Notification templates created, Freeform will use its internal default one, which grabs the main Email address in your EE Email Configuration.

You really should create a new Email Notification template (in "Notifications" page of Freeform control panel area), where you can customize the email notification and set the from name/email address, etc. Then just be sure to specify this new notification template in either your Form's settings or in your EE template with the applicable parameter.
> 1 votes

---
Tags: solspace-freeform
---


title: Config variables in templates

text:
# Question
Title: Config variables in templates
Is there a way to access config variables from the config files via native EE tags so that I can display it in the templates ?

Or are there none that I have to right a plugin for it?

# Answer
We can add variables to the `config.php`, instead of `index.php`, by this way:

```
global $assign_to_config;

if(!isset($assign_to_config['global_vars']))
$assign_to_config['global_vars'] = array();

```

So, I believe that you can set some config variables by this way:

```
$assign_to_config['global_vars']['cv_smtp_port'] = $config['smtp_port'] = '587';

```

On your templates, you'll have early parsed variables to work with:

```
{cv_smtp_port}

```

You can use this technique to get some data from global variables in early stages of parsing:

```
$assign_to_config['global_vars']['cv_site_url'] = $config['site_url'] = "http://domain.com";

```

`{site_url}` is parsed at the end of parsing stages, while `{cv_site_url}` will be parsed at the beginning.

I **don't tested** this, but I guess that edit edit `config.php` by the CP can destroy all of this. So, test this and maybe do not allow the users to access the config file editor.
> 1 votes

# Answer
I don't think so, the only method I'm aware of is using global variables in index.php as per the user contributed notes here - http://ellislab.com/expressionengine/user-guide/templates/globals/user\_defined.html

I think otherwise you may need a plug-in though I'm not even sure that would work as the values in the DB which you could pull out with a plug-in are not necessarily going to mirror those defined in config.php.
> 0 votes

# Answer
Here's a really quick plugin that would do exactly what you need. Basically, create a folder in your add-ons directory called 'config\_var', create a file pi.config\_var.php and copy/paste the following in there

```
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
    'pi_name'           => 'Config Vars',
    'pi_version'        => '1.0',
    'pi_author'         => 'Carl Crawley',
    'pi_author_url'     => 'http://www.madebyhippo.com',
    'pi_description'    => 'Returns Config var based on input',
    'pi_usage'          => config_var::usage()
);

class Config_var
{
    public $return_data = '';

    public function Config_var()
    {
        $this->EE =& get_instance();

        $var = $this->EE->TMPL->fetch_param('var');

        $this->return_data = $this->EE->config->item($var);

        return;
    }

    public function usage()
    {
        ob_start();
?>
Simply pass the variable you want to return in the tag {exp:config_var var="xxx"} and it will return the variable from the config.
<?php
        $buffer = ob_get_contents();

        ob_end_clean();

        return $buffer;
    }
    // END
}

```

Once you've done that, you can now simply called {exp:config\_var var=""} passing in the config variable you want and it'll pull the data out onto the page.
> 0 votes

# Answer
While this is quite old thread, I don't see esy-to-use solution posted to it.

Config Variables Plugin is easy to use and provides access to all config variables (whether coming from config.php or saved in database) with template tag.
> 0 votes

---
Tags: templates, config
---


# Question
Title: Playa lists own entry as relationship 100 times
I have some template code that used to work:

```
{exp:playa:children field="blog_related_entry" limit="5"}
{if count == 1}
<ul class="no-bullet">
  <li>Related Entries</li>
{/if}
  <li><a href="{site_url}blog/{url_title}" title="{title}">{title}</a></li>
{if count == total_results}
</ul>
{/if}
{/exp:playa:children}

```

I'm not sure when it broke, but with EE 2.8.1, Playa 4.5.2 this lists out the parent entry as a relationship 5 times, or 100 if there is no limit set. (I upgraded from Playa 4.1 in an attempt to solve the problem, I can't upgrade EE due to other issues.)

Any idea what's happening here?

-- Andris (accepted answer below) found it was a combination of needing to set var\_prefix, entry\_id and change the EE template tags - namely enclose the IF conditional fields in quotes and curly braces:

```
{exp:playa:children field="blog_related_entry" var_prefix="related_blog" entry_id="{entry_id}"}
{if "{related_blog:blog_published}"=="Yes"}
{if "{related_blog:count}" == 1}
<ul class="no-bullet">
  <li>Related Entries</li>
{/if}
  <li><a href="{site_url}blog/{related_blog:url_title}" title={related_blog:title}>{related_blog:title}</a></li>
{if "{related_blog:count}" == "{related_blog:total_results}"}
</ul>
{/if}
{/if}
{/exp:playa:children}

```

# Answer
You should be using the `var_prefix` parameter to avoid field naming conflicts. Try something like

```
{exp:playa:children field="blog_related_entry" limit="5" var_prefix="blog_entry"}
    {if count == 1}
        <ul class="no-bullet">
        <li>Related Entries</li>
    {/if}
    <li><a href="{site_url}blog/{blog_entry:url_title}" title="{blog_entry:title}">{blog_entry:title}</a></li>
    {if count == total_results}
        </ul>
    {/if}
{/exp:playa:children}

```
> 0 votes

---
Tags: playa
---


title: SEO Lite & Home Page

text:
# Question
Title: SEO Lite & Home Page
I have implemented SEO Lite into my site and have it all set up and working for all of my pages/entries, but I’m having trouble figuring out how to get it to work for my home page.

I am using {exp:seo\_lite use\_last\_segment='yes’} in my main layout template. Since the home page has no segment, the tag is not pulling in the home page channel entry values from the SEO Lite tab.

How can I get this working?

Thanks for any help.

# Answer
I got it figured out. In my main layout I used the following, where the entry ID of 11 is the ID for the home page entry:

```
{if segment_1 ==""}
{exp:seo_lite entry_id="11"}
{if:else}
{exp:seo_lite use_last_segment='yes'}
{/if}

```
> 1 votes

# Answer
Yepp, the homepage is a special case as it does not have an url\_title which you need if you use the "use\_last\_segment" parameter. So you'll have to fetch it using entry\_id, **or alternatively** modify the default SEO Lite template in the CP to fit the homepage.
> 1 votes

---
Tags: seo-lite
---


title: Stash Embed Variable Assignment

text:
# Question
Title: Stash Embed Variable Assignment
I have two Stash embeds. Both embed templates accept a `color` variable, but it's optional:

```
{if '{stash:color}'}
  {stash:color}<br>
{/if}

```

If I explicitly set the variable in both embeds, everything works as expected:

```
{exp:stash:embed name='template1' stash:color='Red'}
{exp:stash:embed name='template2' stash:color='Green'}

```

Outputs:

```
Red
Green

```

If I set the variable in the first embed but not the second, it also works as expected:

```
{exp:stash:embed name='template1' stash:color='Red'}
{exp:stash:embed name='template2'}

```

Outputs:

```
Red

```

But if I leave the first variable empty and set the second, both are assigned the second value:

```
{exp:stash:embed name='template1'}
{exp:stash:embed name='template2' stash:color='Green'}

```

Outputs:

```
Green
Green

```

Is this a bug? Shouldn't Stash embed variables only be scoped to the embed template they're passed to?

* Stash 2.6.0
* EE 2.10.1

# Answer
Stash embed variables are available *anywhere* in the template that is parsed later in the parse order, i.e. they create a variable with global scope. This is by design - so that, for example, child embeds inherit variables passed to their parent, and so that the embeds can pass information to siblings. I would argue this is a feature rather than a bug, but I understand why you may disagree.

When using multiple instances of the same embed that accepts variables, you should set each variable explicitly:

```
{exp:stash:embed name='template1' stash:color=''}
{exp:stash:embed name='template2' stash:color='Green'}

```
> 1 votes

# Answer
It looks like you may need to include the `file_name` in your embed code.

The docs refer to the same template but it's likely that what you're seeing may be related.

Give it a shot and see what happens.

PS. How are you setting your stash var if they're both named the same ?
> 0 votes

---
Tags: stash, embeds
---


# Question
Title: Count of Favorited entries in Solspace Favorites in a specific channel tag with a specific user
I need to show the number of times a user has favorited a specified set of entries. I've tried many ways, including different combinations of using Stash and Mx\_calc, but have been unsuccessful.

The exp:favorites:count tag doesn't seem to allow this without help. I would like it to do something like `{exp:favorites:count entry_id="130|132|463" favorites_member_id="CURRENT_USER"}`, but this is not allowed.

I've tried setting the numbers of each entry with Stash and then adding them with Mx\_calc but can't get that to work (below). Maybe there's a simpler way?

```
{exp:stash:set name="total-favorites" parse_tags="yes"}
  {exp:channel:entries channel="topic-content" search:topic-title="advertising" category="5" search:topic-view="IS_EMPTY" dynamic="no" parse="inward"}
    {exp:favorites:count entry_id="{entry_id}" favorites_member_id="CURRENT_USER"}
  {/exp:channel:entries}
{/exp:stash:set}

  {exp:mx_calc parse="inward" expression="sum({exp:stash:get:blah name="total-favorites"})"}
{!--OR--}
{exp:stash:parse trim="yes" parse="inward"}
  {exp:mx_calc parse="inward" expression="sum({exp:stash:get:blah name="total-favorites"})"}
{/exp:stash:parse}

```

# Answer
Well to start with you're capturing a single number, by adding stash around the EE channels tags, it will only ever capture/hold the last number or 0.

To hold all numbers you should use something like the following (**NOTE:** This is a theory and not verbatim code, refer the documents and experiment) I've done similar but not with Favorites so cannot confirm code of usage:

```
{exp:channel:entries channel="topic-content" search:topic-title="advertising" category="5" search:topic-view="IS_EMPTY" dynamic="no" parse="inward"}
    {exp:stash:append name="fav_count" scope="user" trim="yes"}{exp:favorites:count entry_id="{entry_id}" favorites_member_id="CURRENT_USER"}+{/exp:stash:append}
  {/exp:channel:entries}
//NEW - Add bogus 0 to end of stash
{exp:stash:append name="fav_count" scope="user" trim="yes"}0{/exp:stash:append}

```

What this does is append the result of the favourites tags, trims any whitespace which would kill the sum action (next), adds a scope to the current user as well as adding the "+" symbol, which we can now utlise like this:

```
{exp:stash:parse}
  {exp:mx_calc parse="inward" expression="sum({exp:stash:get name='fav_count' scope='user'})"}
{/exp:stash:parse}

```

Assuming the stash capture results look like this: `0+1+2+0+` the sum would render like exp:mx\_calc parse="inward" expression="sum(0+1+2+0+)

Failing that (or variations). Wrap each result in a unique class and use Javascript to find, record, add up and inject into a result tag.

**UPDATE:** Added a trailing '0' to the original capture (the trailing '+' was borking the math module. Inside the math function, used single quotes rather then doubles.

**WORKING CODE!**

```
{exp:channel:entries channel="topic-content" search:topic-title="advertising" category="5" search:topic-view="IS_EMPTY" dynamic="no" parse="inward" }
  {exp:stash:append name="fav_count" parse_tags="yes" trim="yes" parse_conditionals="yes"}
    {exp:favorites:count entry_id="{entry_id}" favorites_member_id="CURRENT_USER"}
    {if "{count}" != "{total_results}"}+{/if}
  {/exp:stash:append}
{/exp:channel:entries}

{exp:stash:parse process="end"}
{exp:mx_calc expression="sum({stash:fav_count})"}
{/exp:stash:parse}

```
> 0 votes

---
Tags: solspace, count
---


# Question
Title: Can you query a grid field to return a list of distinct fields?
EE 3.1.4

I need to get a detail field from a grid field, but I also need the results to be distinct. The issue I have is the grid field returning a pipe delimited field set.

So running something like this:

```
{exp:query sql="SELECT DISTINCT field_id_23 AS bedroom_count FROM exp_channel_data WHERE channel_id=3"}
    {bedroom_count}
{/exp:query}

```

yields results similar to:

```
315,000|3|2|2|1|2374

```

...but be able to return the distinct values from a particular segment inside that set like just the field that, in this case, was '3'.

Is there a way to better do this? I need to stash them in a stash list to be used in a ddl selection.

---

*** ANSWER ***

I wish I could accept two answers for this. Derek provided what I asked for, but Stuart made me fix my original mistake.

I originally had this being done with stash. My mistake was that I had this:

```
{!-- BATHROOMS --}
{exp:channel:entries channel="house" dynamic="no" limit="999999"}
    {exp:stash:set_list name="bathroom_counts" parse_tags="yes" parse_depth="2"}
        {house_details}
            {stash:bathrooms}{house_details:bathrooms}{/stash:bathrooms}
        {/house_details}
    {/exp:stash:set_list}
{/exp:channel:entries}

```

And fetched it like this:

```
{exp:stash:get_list name="bathroom_counts" unique="yes"}
    <li>{bathrooms}</li>
{/exp:stash:get_list}

```

The problem I was having, besides being extremely tired at the time, was creating my list within the `channel:entries` loop.

I needed the following:

```
{!-- BATHROOMS --}
{exp:stash:set_list name="bathroom_counts" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="house" dynamic="no" limit="999999"}
        {house_details}
            {stash:bathrooms}{house_details:bathrooms}{/stash:bathrooms}
        {/house_details}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

# Answer
> 0 votes
Just to recap, you're capturing 'bathrooms' count from multiple entries with each bathroom count residing inside a Grid field, if correct, then using stash:

```
{exp:stash:set_list name="bathrooms" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries…}
      {stash:url_title}{url_title}{/stash:url_title}
      {grid_field}
        {stash:bathroom}{grid_field:bathrooms}{/stash:bathroom}
        {stash:bedroom}{grid_field:bedroom}{/stash:bedroom}
      {/grid_field}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

Basically we're capturing the URL, the bathroom & bedroom count which we can then use elsewhere on the page.

Assume we have 50 entries, we can use the unique column tag and single out unique bathrooms and only return 1 of each count:

```
{exp:stash:get_list name="bathrooms" unique="bathroom"}
    <li>{url_title}||Bedrooms: {bedroom}|| Bathroom: {bathroom}</li>
{/exp:stash:get_list}

```

**Disclaimer:** this is all untested code – it represents an approach.

# Answer
> 1 votes
I preface the answer by saying that I do not recommend using SQL to get at your entry data this way, as it's what the Channel Entries tag and field variables are designed to do for you. That said, aggregation functions aren't currently available so I understand the desire.

Grid data is stored in a separate table for each Grid field. The data you see in the `exp_channel_data` table for that field is just a raw pipe-dump that is used by the Channel Entry tag's `search:field=` parameter when a Grid field is searchable. So if you are wanting to access the data directly, you need to use that Grid field's table.

```
SELECT DISTINCT col_id_1
FROM exp_channel_data AS cd
LEFT JOIN exp_channel_grid_field_23 AS gf ON gf.entry_id = cd.entry_id
WHERE cd.channel_id = 3

```

You will need to change `col_id_1` to the actual column in your Grid field table for the column you are targeting.

---
Tags: stash, grid, query, ee3, query-module
---


# Question
Title: Filtered search with category entry counts
I'm trying to create a product search page, where the categories are listed on the sidebar with checkboxes. I'd like to show how many products are in each category.

* Checking one of the categories would filter your results to show products in that category.
* Once the results are filtered, the entry counts on the categories should be updated. (Number of entries that match the current search and is also in the respective category)

I've created the search using Low Search, and can show the entry count using GWcode Categories. But I don't know how I would show the 'filtered' count. Is something like this even possible?

# Answer
This is a tricky issue. Low Search sits 'on top of' the native Channel Entries method. It optionally executes some non-native filters (like keywords, ranges, search:title, etc) and feeds that to the channel:entries method, which takes care of any native filtering (category, status, search:channel\_field, etc).

That means that before calling channel:entries, LS doesn't know how many entries are actually going to be displayed. If you don't know which entries are going to be displayed, you also don't know which categories apply to them. Pagination throws another spanner in the works, as you *could* determine the applicable categories but only if the results were not paginated.

In this scenario, it seems impossible to get a filtered count.

The way to get to them, would be to have a list of entry\_ids available from the channel:entries tag (and thus the low\_search:results tag) that make up the entire list of results, regardless of pagination. With that list, it would be possible to have a category count. But I'm pretty sure that info isn't available through EE's hooks at the moment.
> 3 votes

# Answer
> Is something like this even possible?

I tried relying on categories once for a really complex product hierarchy. I ran out of segment variables (there's a max of 9) for the full tree, and my listing page ended up being a ton of PHP & SQL for each level.

I just took a look back at that, and I did not show filtered counts. In each tier of categories, I highlighted the selected category, left the unfiltered counts on each category name, and had an "Undo" link at the bottom of a filtered category list that would reset/undo the filter. That way, from a UX perspective, it was obvious that you were in a filtered view within the broader view, and could easily back out.
> 1 votes

# Answer
Just in case anyone else has this problem I solved it with the `query` tag. This code is pretty specific to my situation, but if you look through it you should be able to swap in your own values. I use also use the low:seg2cat plugin, and this code is within the `{exp:low_search:form}` tag. I use segment 2 to indicate a particular brand category, and then this code returns only non-empty categories and entry counts that are also tagged with that brand.

My search form posts through the brand category as `low_search_category:group1` and the 'type(s)' as `low_search_category:group2`:

```
  {exp:query sql="SELECT
      type.cat_id,
      type.cat_name,
      type.cat_url_title,
      t.title,
      COUNT(*) AS entries
    FROM
      exp_categories type JOIN
      exp_category_posts p ON type.cat_id = p.cat_id JOIN
      exp_channel_titles t ON p.entry_id = t.entry_id JOIN
      exp_channel_data d ON t.entry_id = d.entry_id JOIN
      exp_category_posts p2 ON p.entry_id = p2.entry_id AND p2.cat_id = '{segment_2_category_id}'
    WHERE
      type.group_id = 9 AND
      t.channel_id = 2
    GROUP BY
      type.cat_id
    ORDER BY
        type.cat_order;"}
        <label>
          <input type="checkbox" name="category:group2[]" value="{cat_id}"
          {if cat_id IN ({low_search_category:group2})} checked="checked"{/if} />
          {cat_name} [{entries}]
        </label>
  {/exp:query}

```
> 0 votes

---
Tags: categories, search, low-search, gwcode-categories
---


# Question
Title: Accept Terms Field in DevDemon Subscriptions
Looking for a solution to make users have to click a checkbox to accept the terms and conditions of our membership before being able to subscribe.

Would prefer some sort of required field solution rather than scripting something outside of the add-on.

Any suggestions?

# Answer
> 0 votes
I have not used DevDemon's Subscription module personally but there does not appear to be a way to require certain fields outside of payment specific fields. Having said that the easiest approach would be to add an additional field to the template/s in question with a bit of javascript to see if the checkbox filed you added has indeed been checked before reenabling the submit button.

# Answer
> 0 votes
Zoo Visitor (membership addon) has this functionality, and it plays well with Subscriptions

---
Tags: devdemon, subscriptions
---


# Question
Title: "Google Maps for ExpressionEngine" field validation with Zoo Visitor Update Form
I am using Google Maps for ExpressionEngine field type with Zoo Visitor update member entry form. But I couldn't make this field type as `Required`.

I tried by having "Is this a required field?" as "Yes" from field setting and/or validation rule `rules:field_name="required"` but no luck.

Could anyone please suggest how can I validate Google Map field.

Thanks,

# Answer
> 0 votes
Have you tried setting "minimum points" to something other than 0? You can find it in the field settings of your Google Maps channel field.

# Answer
> 0 votes
I've been working on something very similar, but instead of using a map fieldtype I chose to just make the native EE grid custom field to hold the address. This way you can easily make the fields required. See example below.

```
{my_address}
    {my_address:street_address_1}
    {my_address:street_address_2}
    {my_address:city}
    {my_address:state}
    {my_address:zip}
{/my_address}

```

I'm using Zoo Visitor, but for maps I'm using Gmaps. In my template I can use this information within the gmaps tag to bring in the address. I'm sure that Google Maps for ExpressionEngine has a similar tag.

Cheers! jules

---
Tags: custom-fields, google-maps-for-ee, validation, channel-fields
---


# Question
Title: Reverse sell list (buy-in list) in Expresso Store
Is it possible to do a buy-in list using Expresso Store? It is like a sell list except that when the user checks out the inventory will increase instead of drop and payment will be deducted from the overall sales revenue rather than increasing it.

# Answer
> 0 votes
There is nothing built in to Store (or any of the EE e-commerce modules) that would allow you to do this. You will need to write an extension using Store's developer extension hooks to create the functionality that you are looking for.

---
Tags: expresso-store
---


# Question
Title: RSS feed from 2.1.4 no longer works with conditionals in 3.2.0
We just upgraded to 3.2.0 from 2.1.4, and the move seems to have broken my RSS feeds completely. I used several conditionals to assign the correct paths to each template group section, but none of those seem to work now. See the following for a representative example – perhaps you can divulge what I need to change for parsing to work in the new EE. (You’re seeing part of code that has worked for eight years until we updated.)

```
    {preload_replace:master_channel_name="restaurants|arts|community|kids|blogs|rural_road_trips|style|food|parties"}
{exp:rss:feed channel="{master_channel_name}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
   <title><![CDATA[Rural Intelligence]]></title>
    <link>{channel_url}</link>
    <atom:link href="{path=feed/RSS_2.0}" rel="self" type="application/rss+xml" />
    <description>Your guide to Rural Living</description>
    <dc:language>{channel_language}</dc:language>
    <dc:creator>{email}</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
{exp:channel:entries channel="{master_channel_name}" limit="19" rdf="off" dynamic_start="on" status="open" disable="member_data|trackbacks" category_group="1|2|3|4|5|6|7|8|13|14|15"}
    <item>
{if channel_id=="24"}
      <title><![CDATA[{title} -- Restaurants -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=food_section/food_restaurant_listing}</link>
      <guid>{title_permalink=food_section/food_restaurant_listing}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
{exp:channel:categories}
{if channel_id=="12" AND category_id=="16"}
{/exp:channel:categories}
      <title><![CDATA[{title} -- Arts Section -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_movies}</link>
      <guid>{title_permalink=arts_section/arts_articles_movies}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
{exp:channel:categories}
{if channel_id=="12" AND category_id=="17"}
{/exp:channel:categories}
      <title><![CDATA[{title} -- Arts Section -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_music}</link>
      <guid>{title_permalink=arts_section/arts_articles_music}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
{exp:channel:categories}
{if channel_id=="12" AND category_id=="18"}
{/exp:channel:categories}
      <title><![CDATA[{title} -- Arts Section -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_art}</link>
      <guid>{title_permalink=arts_section/arts_articles_art}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
{exp:channel:categories}
{if channel_id=="12" AND category_id=="19"}
{/exp:channel:categories}
      <title><![CDATA[{title} -- Arts Section -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_theater}</link>
      <guid>{title_permalink=arts_section/arts_articles_theater}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
{exp:channel:categories}
{if channel_id=="12" AND category_id=="20"}
{/exp:channel:categories}
      <title><![CDATA[{title} -- Arts Section -- {exp:channel:categories}{category_name}{/exp:channel:categories} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_books}</link>
      <guid>{title_permalink=arts_section/arts_articles_books}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/exp:channel:categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}
    </item>
{/exp:channel:entries}
    </channel>
</rss>
{/exp:rss:feed}

```

You get the idea… What is going wrong in 3.2.0?

Thanks!

Terry

# Answer
> 0 votes
Robin Sowell at EE found the problem, and of course it had to do with parsing -- but was in the last place I would have thought to look!

The long and short of it: We cannot nest `{categories}` tags any longer and get away with it. Never was a good idea - won't work at all now.

Here is a short example of what DOES work!

```
    {exp:channel:entries channel="{master_channel_name}" limit="19" rdf="off" dynamic_start="on" status="open" disable="member_data|trackbacks" category_group="1|2|3|4|5|6|7|8|13|14|15"}
    <item>

{categories}
{if channel_id=="12" AND category_id=="16"}

      <title><![CDATA[{title} -- Arts Section -- {category_name} ]]></title>
      <link>{title_permalink=arts_section/arts_articles_movies}</link>
      <guid>{title_permalink=arts_section/arts_articles_movies}</guid>
      <description><![CDATA[{article}]]></description>
      <dc:subject><![CDATA[{category_name}, ]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
{/if}{/categories}

```

Now the conditionals work and parse-out just fine. I hope this helps someone else in a similar situation where you need to direct categories to specific template groups and templates.

Terry

---
Tags: conditionals, rss
---


# Question
Title: International order/donation failing in CartThrob but settling correctly in Authorize.net
We're having a strange thing happening in CartThrob. We've set it things up to allow people to make donations (one-time or monthly) on the site.

In one particular instance, a donor from Germany attempted to make a donation but CT/EE gave her an error:

> "Payment failed, unspecified error"

In the backend, the error is as so:

This wouldn't be an issue except that Authorize.net processed the transaction successfully:

I'm not sure what would cause this to happen. The donation form is set up to take international info, but maybe I missed something?

Here's what that code looks like: http://pastie.org/private/5kpouwclti1gtkguvdvd7w

Any ideas or suggestions would be helpful! Thanks!

# Answer
(I'm with Vector; we're the people behind CartThrob)

Angie ended up submitting a ticket to us, and it turned out to be over-aggressive fraud settings on the credit card gateway's side. The payments were getting held for review.
> 1 votes

---
Tags: cartthrob, shopping-cart, authorize.net
---


title: User v3.5.3, EE v2.10.1

text:
# Question
Title: User v3.5.3, EE v2.10.1
When User sends an invite it includes a Key.
\- Where is this key stored ?
\- Is there a way to generate a key without having a User be sent an invite ? \- Is there a table which contains all the invites sent ? \- Can the same key be shared with more than one User ?

Thanks!

# Answer
The keys are stored in the exp\_user\_keys database table. There is not a way to generate keys without sending an invite email. Multiple invites can be sent at the same time, but each user receives a different/unique key. :)
> 0 votes

---
Tags: solspace-user
---


title: WYSIWYG Editor gone missing

text:
# Question
Title: WYSIWYG Editor gone missing
We have EE 2.1.0.

One of our Super Admins actually had some WYSIWYG editor for the content in entries. I have never seen a WYSIWYG editor and I'm a Super Admin as well.

I don't see that we have any plugins or extensions installed.

The "Center Content" field in the entries shows as Wygwam type. I'm also showing a Wygwam Field Type (v2.0.4) but it has no License Key entered. I know this has worked before. I don't want to uninstall it because it will remove all content with that field type and I've got TONS of it.

Why would she have that and now today, no longer has it?

BTW, for some reason, I can't post new topics on the EllisLab forums, did they "mothball" them?

# Answer
The problem was that the URL to the themes folder was not https:

`http://www.example.com/themes/` vs. `https://www.example.com/themes/`

This caused the resources to load in mixed mode causing the issue.
> 1 votes

---
Tags: ee2, editor, ckeditor
---


title: Expresso Store EE 3.0 Support?

text:
# Question
Title: Expresso Store EE 3.0 Support?
New to Expresso Store, but purchase this for a client who wants to build a pretty complicated store. I'm ready for the challenge, but realized that Expresso isn't compatible with 3.0 yet? Is this something that's in the works, or a hack that I can possibly use. Thanks-

# Answer
> 0 votes
I used this neat website called 'google' to search for an answer and it yielded this result:

http://www.devdemon.com/blog/expressionengine-3.0-porting

Spoiler: It looks like Store is being ported.

---
Tags: expresso-store
---


# Question
Title: Limit a Low Replace query to only the first instance
Is there a way to limit the "find" and "Replace" to only the first occurance of an item?

For instance, I want to replace only the the first \< p \> tag with \< p class="lead"\>

Thanks. Russ

# Answer
> 0 votes
It looks as though Low Replace can use regex There's plenty of StackOverflow questions out there regarding regex first instance.

---
Tags: low-replace
---


# Question
Title: Page doesn't scroll to form if validation errors are shown
I have a FreeForm form at the bottom of a page. When the form is submitted and returns with a validation message, the user is bounced back up to the top of the page. Is there a way to make sure the page is scrolled down at the same place in the document so the user isn't disoriented?

# Answer
The nature of freeform is to actually visit another URL on submit and on error return to the previous (form page).

I'd look at implementing a JavaScript check prior and/or use Ajax to submit.

Failing that I do recall an option to setup freeform with inline error checking.

Double check the freeform docs.
> 0 votes

# Answer
Use the inline\_error\_return parameter to set the return path to the current page then add in a link to an anchor.

Docs: https://solspace.com/expressionengine/freeform/docs/form/#inline\_error\_return

Example I have used in the past:

Inline\_error\_return="template\_name#anchor"

You could change the #anchor to the css form ID and it will load the page in the correct position.
> 0 votes

---
Tags: solspace-freeform, solspace, forms, validation
---


# Question
Title: What if no entry translated with Transcribe?
I'm quite new in EE so my question can be trivial.

What to do if one (or more) entry is not translated? If I have translation for English but change language to Deutsch for example - I got an error. I'd like to get the point where if I change the language and do not have translation for any entry the default language will be shown.

I try to work with this code but it doesn't work:

```
{if title == ""}
{exp:transcribe:language name="english"}{title}{/exp:transcribe}
{/if}

```

I use Transcribe and EE 3.0.4.

Thanks!

# Answer
> 0 votes
Do you have a language switch link on the page? You can add conditional code around the language switcher so it would only appear if there is an entry in the other language.

---
Tags: transcribe
---


# Question
Title: Low search - searching multiple children
We currently perform searches and filters and we need to ALWAYS match results to a parent entry (lets assume entry ID 19826 - variable obviously).

We are using the native relationship field in EE 2.8.1 and low search 4.4.2

We need to use low search so that we can filter by category AND match keywords where the parent entry is 19826 (variable obviously).

An example query would be:

```
http://example.com/sandbox?child:related_field=19826

```

What we would like to do is search ALL channels for related child entries, is this possible, what would the typical query pattern for this be, can we combine multiples, for example:

```
http://example.com/sandbox?child:related_field=19826&child:another_related_field=19826

```

OR is there a way to simply search all entries that match our parent ID:

```
http://example.com/sandbox?child=19826

```

We've also tried multiple params as hidden fields in the form:

```
{exp:low_search:form result_page="/sandbox"}
    <input type="hidden" name="child:related_field" value="19826">
    <input type="hidden" name="child:another_related_field" value="19826">
    <button type="submit">Go</button>
{/exp:low_search:form}

```

But no luck, this works if we ONLY have a single hidden field.

# Answer
You can combine any amount of filter parameters, including multiple Relationships filters. Your second example would read like:

> Return entries that have both entry 19826 as a child via the `related_field` field *and* via the `another_related_field` field.

Right now, you can't consolidate the two parameters into a single one out of the box, but you could either use JS to populate the two parameters on form submit, or you could use an extension that uses the `low_search_pre_search` hook to populate the two parameters based on single one.
> 0 votes

---
Tags: low-search, related-entries
---


title: A jpg upload triggers: File Not Allowed

text:
# Question
Title: A jpg upload triggers: File Not Allowed
After upgrading to 2.10.3, my client can no longer upload anything via the File Manager - not even a vanilla 24kb jpg.

"File not Allowed" appears in red letters in the modal window where the file is chosen.

I've double-checked the mime type locally:

```
199701AD.jpg: image/jpeg; charset=binary

```

And this is obviously in-line with EE's default settings for allowed files.

I've noticed that the file is thrown away and the error is thrown after the file is uploaded. I've tried a variety of files, all have the same result. The upload directory permissions are 777 (for the purposes of debugging this.)

# Answer
File Info for 2.10.0

Apparently an entire config file had changed format (mimes.php) for version 2.10.

I'm not entirely sure how I didn't overwrite the old one, because this should have happened in at least 1 of my fallbacks, but I had the old one so technically no files were whitelisted.
> 0 votes

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


title: How to Display custom fields into tabs?

text:
# Question
Title: How to Display custom fields into tabs?
I’m new to EE and coming from a Drupal background. I’m enjoying learning EE.

**Question: How do I display the fields from a custom channel into tabs?**

A perfect example I would like to replicate is this page here:

http://www.genuinehealth.com/store/greens-daily-detox#.VuwFlpMrJTY

You will notice that there are 4 tabs below the product and when in a mobile view, the tabs are compressed to a mobile like menu. I would like each custom field to be displayed in a tab.

Can EE do anything similar ??

Thanks in advanced! Rob

# Answer
> 0 votes
WElcome, this question is a staple of EE. WHilst we can show you how to capture the information and give you the basics, you'll need CSS & JS to complete the functionaity.

So, lets create a channel named "products" in EE with the following fields:

* detail - Textarea (or WYSIWYG)
* image - File upload
* tab01 - Textarea (or WYSIWYG)
* tab02 - Textarea (or WYSIWYG)
* tab03 - Textarea (or WYSIWYG)

As you may see we're cpaturing the data we need into their own little areas which we'll now use in a template.

```
{exp:channel:entries channel="products"}
<article>
  <h1>{title}</h1>
  <img src="{image}/>
  <div class="tab-group">
    <a href="#tab1">Tab Name</a>
    <a href="#tab2">Tab Name</a>
    <a href="#tab3">Tab Name</a>
    <a href="#tab4">Tab Name</a>
  </div>
  <div class="tab-items'>
    <div id="tab1" class="active">
      {tab01}
    </div>
    <div id="tab2">
      {tab02}
    </div>
    <div id="tab3">
      {tab03}
    </div>
    <div id="tab4">
      {tab04}
    </div>
  </div>
</article>
{/exp:channel:entries}

```

Then for the JS:

```
//Found this here: http://jsfiddle.net/R85tE/293/ but there are a million other ways to do this.
$('.tab-items div').hide();
$('.tab-items div:first').show();

$('.tab-group li').click(function() {
    $('.tab-group li a').removeClass("active");
    $(this).find('a').addClass("active");
    $('.tab-items div').hide();

    var indexer = $(this).index(); //gets the current index of (this) which is #nav li
    $('#tab-content div:eq(' + indexer + ')').fadeIn(); //uses whatever index the link has to open the corresponding box
});

```

Hopefully this will get you started!

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


# Question
Title: Strip card errors not showing if logged out
Using Devdemon's Subscription system, we have a sign up and card form all on one page. If I enter the correct details for the account and card details when I am logged out (which most new sign ups will be) then it logs the user in and creates the subscription all OK.

If I make a mistake in the card details, it returns me to this page with no error showing. But the user is still registered and logged in.

If I make the same incorrect card submission now I am logged in, I get the Stripe error that the card number is wrong.

So it seems that the Stripe error is not showing if the user is originally not logged in when registering (even though they are still registered when entering the wrong card details).

Here is our template code

Thanks

```
{embed="_inc/.header" sidebar="off"}

    {if segment_3 == ""}

    <h2>You are not subscribed to any plan. Please choose a plan...</h2>

    {exp:subs:plans}

    <a href="/{segment_1}/{segment_2}/{subs:handle}">{subs:label}</a><br/>

    {/exp:subs:plans}

    {/if}

    {if segment_3 != ""}

        {!-- http://www.devdemon.com/documentation/tag/subs-subscribe/ --}

        {exp:subs:subscribe
            register_member="yes"
            plan="{segment_3}"
            payment_method="stripe"
            return="/members/subscription/%SUBS_HASH%"
        }

        <input type="hidden" name="card_token" class="stripe_token">

        <div class="stripe_error"></div>

        <div class="uniform">

            {if subs:no_results}
            {redirect="/{segment_1}/{segment_2}"}
            {/if}

            <h1>Subscribe to: {subs:plan:label}</h1>

            <p>
                Every <strong>{subs:plan:recurring_interval_count} {subs:plan:recurring_interval}</strong> {subs:plan:recurring_amount} {subs:plan:currency}
            </p>

            <p>Add Coupon: <em>(Discount will be applied at checkout)</em></p>
            <p><input type="text" name="coupon" value="{subs:coupon}"></p>

            {if subs:total_errors}
            <ul class="message error">
                {subs:form_errors}
                <li>{subs:error}</li>
                {/subs:form_errors}
            </ul>
            {/if}

            {if logged_out}
            <h3>Account Details</h3>

            <p>
                <label>Username</label>
                <input type="text" name="username" value="">
            </p>

            <p>
                <label>Email</label>
                <input type="text" name="email" value="">
            </p>

            <p>
                <label>Password</label>
                <input type="password" name="password" value="">
            </p>

            <p>
                <label>Password Confirm</label>
                <input type="password" name="password_confirm" value="">
            </p>
            {/if}

            {if logged_in}
            {exp:member:custom_profile_data}
            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Your Details</h2>
                </div>

                <div class="col sixcol land-twelvecol"></div>

                <div class="col sixcol land-twelvecol clear">
                    <label for="m_field_id_1">First Name</label>
                    <input type="text" name="m_field_id_1" class="form-control" value="{first_name}">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_2">Last Name</label>
                    <input type="text" name="m_field_id_2" class="form-control" value="{last_name}">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_10">Phone Number</label>
                    <input type="text" name="m_field_id_10" class="form-control" value="{telephone}">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_21">School Name</label>
                    <input type="text" name="m_field_id_21" class="form-control" value="{school_name}">
                </div>
            </div>

            <div class="col-wrap twelvecol"> </div>

            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Billing Address</h2>
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_3">Address</label>
                    <input type="text" name="m_field_id_3" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_4">Address Line 2</label>
                    <input type="text" name="m_field_id_4" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_5">City</label>
                    <input type="text" name="m_field_id_5" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_6">County</label>
                    <input type="text" name="m_field_id_6" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_8">Country</label>
                    {exp:cartthrob:country_select name="m_field_id_8" selected="GBR"}
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_7">Postcode</label>
                    <input type="text" name="m_field_id_7" class="form-control">
                </div>

            </div>
            {/exp:member:custom_profile_data}
            {/if}

            {if logged_out}
            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Your Details</h2>
                </div>

                <div class="col sixcol land-twelvecol"></div>

                <div class="col sixcol land-twelvecol clear">
                    <label for="m_field_id_1">First Name</label>
                    <input type="text" name="m_field_id_1" class="form-control">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_2">Last Name</label>
                    <input type="text" name="m_field_id_2" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_10">Phone Number</label>
                    <input type="text" name="m_field_id_10" class="form-control">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_21">School Name</label>
                    <input type="text" name="m_field_id_21" class="form-control">
                </div>
            </div>

            <div class="col-wrap twelvecol"> </div>

            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Billing Address</h2>
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_3">Address</label>
                    <input type="text" name="m_field_id_3" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_4">Address Line 2</label>
                    <input type="text" name="m_field_id_4" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_5">City</label>
                    <input type="text" name="m_field_id_5" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_6">County</label>
                    <input type="text" name="m_field_id_6" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_8">Country</label>
                    {exp:cartthrob:country_select name="m_field_id_8" selected="GBR"}
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_7">Postcode</label>
                    <input type="text" name="m_field_id_7" class="form-control">
                </div>

            </div>
            {/if}

            <div class="col-wrap twelvecol"> </div>

            {if "{subs:has_cards}" == 'yes'}

            <div class="col twelvecol">
                <h2>Pay with Credit Card</h2>
            </div>

            {exp:subs:cards prefix="card"}

            <div class="cardslist col-wrap twelvecol">

                <div class="col twelvecol cards-box">
                    <input name="card_hash" value="{card:hash}" type="radio" class="card_hash"> {card:brand} ending in {card:last4} {card:name_on_card} {card:exp_month}/{card:exp_year}
                </div>

            </div>

                <div class="cardstoggler col twelvecol">
                    <input name="card_hash" value="" type="radio" class="card_hash">
                    <strong>Add a new card</strong> <i>saves on submission below</i>
                </div>

            {/exp:subs:cards}

            {/if}

            <div class="col-wrap twelvecol cardnew">

                <div class="col twelvecol">
                    <h2>Payment Details</h2>
                </div>

                <div class="col twelvecol">
                    <label>Credit Card Number</label><br/>
                    <input type="text" name="card_number" value="{subs:card_number}" class="form-control stripe_number" data-stripe="number">
                </div>

                <div class="col twelvecol">
                    <label>Name on card</label><br/>
                    <input type="text" name="card_name" value="{subs:card_name}" class="form-control stripe_name" data-stripe="name">
                </div>

                <div class="col twelvecol">
                    <label for="card_number">Expires</label><br/>
                    <select name="card_exp_month" class="form-control stripe_exp_month free" data-stripe="exp_month">{subs:month_options}</select>

                    <select name="card_exp_year" class="form-control stripe_exp_year free" data-stripe="exp_year">{subs:year_options}</select>
                </div>

                <div class="col twelvecol">
                    <label>Security Code</label><br/>
                    <input type="text" name="card_cvc" value="{subs:card_cvc}" class="form-control stripe_cvc" data-stripe="cvc" size="5">
                </div>

            </div>

            <div class="col-wrap twelvecol"> </div>

            {if logged_in}
            {exp:member:custom_profile_data}
            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Shipping Details</h2>
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_11">First Name</label>
                    <input type="text" name="m_field_id_11" class="form-control" value="{shipping_first_name}">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_12">Last Name</label>
                    <input type="text" name="m_field_id_12" class="form-control" value="{shipping_last_name}">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_13">Address</label>
                    <input type="text" name="m_field_id_13" class="form-control" value="{shipping_address}">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_14">Address Line 2</label>
                    <input type="text" name="m_field_id_14" class="form-control" value="{shipping_address2}">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_15">City</label>
                    <input type="text" name="m_field_id_15" class="form-control" value="{shipping_city}">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_16">County</label>
                    <input type="text" name="m_field_id_16" class="form-control" value="{shipping_county}">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_18">Country</label>
                    {exp:cartthrob:country_select name="m_field_id_18" {if country_code!=""}selected="{country_code}"{/if}{if country_code==""}selected="GBR"{/if}}
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_17">Postcode</label>
                    <input type="text" name="m_field_id_17" class="form-control" value="{shipping_postcode}">
                </div>

            </div>
            {/exp:member:custom_profile_data}
            {/if}

            {if logged_out}
            <div class="col-wrap twelvecol">

                <div class="col twelvecol">
                    <h2>Shipping Details</h2>
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_11">First Name</label>
                    <input type="text" name="m_field_id_11" class="form-control">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_12">Last Name</label>
                    <input type="text" name="m_field_id_12" class="form-control">
                </div>

                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_13">Address</label>
                    <input type="text" name="m_field_id_13" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_14">Address Line 2</label>
                    <input type="text" name="m_field_id_14" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_15">City</label>
                    <input type="text" name="m_field_id_15" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_16">County</label>
                    <input type="text" name="m_field_id_16" class="form-control">
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_18">Country</label>
                    {exp:cartthrob:country_select name="m_field_id_18" selected="GBR"}
                </div>
                <div class="col sixcol land-twelvecol">
                    <label for="m_field_id_17">Postcode</label>
                    <input type="text" name="m_field_id_17" class="form-control">
                </div>

            </div>
            {/if}

            <div class="col-wrap twelvecol"> </div>

            <p>
                <button type="submit" class="stripe_submit">Subscribe</button>
            </p>

        </div>

        {/exp:subs:subscribe}

    {/if}

{embed="_inc/.footer" sidebar="off"}

```

# Answer
> 0 votes
Looks like we were missing the stripe key field. Adding this in and now it works OK. Strangely it worked previously without this, if the card details were correct, which is why we were confused.

```
{if subs:test_mode == 'yes'}<input type="hidden" class="stripe_public_key" value="YOUR_TEST_STRIPE_PUBLIC_KEY">{/if}
{if subs:test_mode == 'no'}<input type="hidden" class="stripe_public_key" value="YOUR_LIVE_STRIPE_PUBLIC_KEY">{/if}
<input type="hidden" name="card_token" class="stripe_token">

```

---
Tags: stripe, devdemon-subscriptions
---


# Question
Title: Assets - "The file cannot be found" error
We have a few entries that work well on the live site, but when editing on staging server we get the following error:

An Error Was Encountered The file cannot be found

This might be the same issue as this question: Editing entry in backend: "The file cannot be found" but I can't comment so I decided to open a new one.

We did a text search through the entire EE files and the only one with that exact text string ("the file cannot be found") was Assets. We tried updating the addon, updating databases, double checking all files to make sure nothing was missing.

We could copy the contents from the db as the other question suggests but we'd rather have this fixed so it doesn't happen again. Any ideas? Thanks in advance.

Santiago

# Answer
In case it's useful for someone else:

This particular issue was triggered by a missing file on the upload folder. The file was related to the entry via an Assets field and most likely for human error it got removed from our server. We restored the file and the entry was editable again.
> 0 votes

---
Tags: channel-entries, assets, control-panel
---