# Question
Title: Is there a maximum number of images for Channel Images?
Is there a maximum number of images which can be uploaded using Channel Images? We did not set a maximum number per user, but somehow when more than 30 images are uploaded, the images above the 30 will not show on the page.

The images ARE uploaded and shown in EE. So, if you move image #32 down, it WILL show.

Any ideas?

# Answer
You need to explicitly set a limit parameter higher than 30 (i.e.: limit="500"), as Channel Images defaults to 30 max (similar to how EE Channel entries defaults limit to 100):

From the docs:

> This parameter limits the number of images on any given page. The limit will default to 30 entries if a value is not specified. If you are using pagination then this will determine the number of entries shown per page.
> 1 votes

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


title: switchee and regex

text:
# Question
Title: switchee and regex
I use in a EE site Structure and Low events. I need to use switchee but I can't find the correct regex for a date format like this: yyyy-mm I use quit often this switchee regex: {case value="#^P(\d+)$#|''"} for paging but I just can't find it for I need: {case value="yyyy-mm|''"}

# Answer
> 1 votes
For a not too specific match try:

```
{case value="#\d{4}-\d{2}#"}

```

which would match 4 digits ( \d{4} ) then a dash ( - ) then 2 digits ( \d{2} ).

UPDATE: Forgot about encoding brackets in switchee regex, one of these should work:

```
{case value="#\d\d\d\d-\d\d#"}

```

or

```
{case value="#\d{4|-\d{2|#"}

```

The second version replaces the brackets with `{` for { and `|` for } .

---
Tags: structure, regex
---


title: Moved server, now photos don't display

text:
# Question
Title: Moved server, now photos don't display
I've run out of ideas on how to fix this one. I moved a site to another server, and now the photos don't display. I've moved sites before without a problem. I did the following:

1. Confirmed the paths were correct.
2. Checked all folder (777) and file permissions (666).
3. Ran file synchronization.
4. Cleared all caches.
5. Optimized the database.
6. Re-saved some test photos.

New photos display correctly. When I use my browser to go to the exact path of an old photo, it won't display, even though the path and file permissions are correct.

Any suggestions?

# Answer
> 1 votes
It turns out that multiple problems were involved. The list of steps in my original post cleared up some of them, while others were simply the result of people renaming, deleting or overwriting photos on the new site. I guess the devil is in the details.

# Answer
> 0 votes
If you're using a plugin such as CE\_Image then ensure your image directories are writeable.

If they are, and your server isn't running out of memory (unlikely as it would just fall over if that was the case) then I'd put money on your paths being incorrect (even though you say they're correct) :)

I don't know if there is some database setting with Channel Images that needs to be updated.

# Answer
> 0 votes
If using CE Image, it is possible that the relative URL paths don't match the server directory structure. More info

# Answer
> 0 votes
That the new photos display correctly but the old ones don't point to the file upload paths have been updated but not synchronized. But you stated that you did synchronize. So perhaps the paths are hard coded in the templates, or even a portion of the path.

I would inspect the source code of the generated page, check the path to the image and see what errors occur.

---
Tags: channel-images
---


title: Update WYGWAM's CKEditor manually

text:
# Question
Title: Update WYGWAM's CKEditor manually
After the Safari-7.1-Update the CKEditor does no more work properly. There is a fix: CKEditor 4.4.5 with Safari 7.1 Fix Released

Which packet do I have to download (Basic, Standard, Full) and where do I have to install it?

Thanks for any help!!

# Answer
CKEditor goes through a build process when being integrated into Wygwam adding some custom stuff. It's not a matter of a simple swap out.

We will have to update Wygwam's CKEditor version in the next Wygwam release.
> 0 votes

# Answer
Ok ... I tried this: Downloaded the Basic Package and replaced in themes/third\_party/wygwam/lib the folder ckeditor.

This seems to work.

UPDATE: It does not work. A lot of unexpected occurrences. Would be glad if somebody could help me out :-/
> 0 votes

---
Tags: pixelandtonic, wygwam, ckeditor
---


# Question
Title: Can I add custom product modifiers that are different for each instance of the product in the cart?
I'm building a course booking system. Users will be able to book one or more 'places' on a course. When they make their booking, they need to provide their details (name, address, age, etc).

Say a user is booking 5 places on a given course. They need to be able to provide different details for each of those places.

It's similar to what you might have seen when booking plane tickets. You specify how many people are flying, then you get a form with a set of fields for each passenger where you enter their name, passport number, etc.

I thought I might be able to use the product form tag and add custom modifiers, but it doesn't seem to be possible to add different modifiers for each 'instance' of the product.

Has anyone done something similar? Am I barking up the wrong tree with modifiers? Is there a better solution?

Thanks for your help Pete

# Answer
I've come up with a solution. It's a bit more javascript-heavy than I would like, but hey ho.

The user selects the number of places they'd like to book on the course, then clicks 'continue', at which point I use javascript to generate that number of instances of a {exp:store:product} tag pair. Inside the tag pair are the custom modifier fields as well as a hidden field to set a quantity of 1.

The user completes the form(s) then clicks 'add to cart'. The 'add to cart' button triggers some javascript, which loops over each of the forms, submitting each one via AJAX. It then reloads the page.

The end.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: How can I hide an expired row in a Matrix field?
I have a Matrix field which is being used for late availability vacancies for a tourism website. Inside the Matrix field there are two columns, Date and Description.

Rows from the Matrix field will be displayed on the front end of the site. However I'm wondering if there is a way to hide a row if the Date field inside the Matrix is expired.

It seems using `show_expired="no"` won't work as this applies to the entry itslef which won't have expired. It's specifically the Date field inside the Matrix field. If the date on the **row** is expired, I'd like it not to be displayed.

Can anyone shed any light on this please

Thanks

# Answer
You can try to use **search:** parameter with combination with **{current\_time}\***

> {my\_matrix\_field search:date="\>{current\_time"}"}

usually date fields is keep data in timestamp format, so it must work.

*Unlike the rest of the Standard Global Variables, {current\_time} is parsed very early on in the Template parser, which allows you to make dynamic use of it in your tags, for instance as a tag parameter, or in a conditional.*
> 2 votes

---
Tags: matrix, date, expire
---


title: Setting Stash name as {entry_id}

text:
# Question
Title: Setting Stash name as {entry_id}
Having some issues here, not sure if it's even possible.

Template one lists one entry. I want to set a variable and make its name the entry\_id of that entry, to be used to validate on the next template based on the same entry.

Template two, I want to match a url segment to the variable. But i need to get the variable name from that same entry, so need to use the {entry\_id} in the stash get tag.

I am getting funny results, where it only works if the {entry\_id} tag apears anywhere inside the channel:entries loop. If i remove that single tag then the conidional always fails.

I am using EEv2.9.2 and Stash 2.5.8

My code:

Template One:

```
{exp:channel:entries channel="whitepapers" url_title="{segment_3}" limit="1" disable="categories|member_data|pagination" parse="inward"}

{exp:stash:set_value name="{entry_id}" value="{current_time format="%d%Y%g%i%s"}" scope="user" save="yes"}

{/exp:channel:entries}

```

Template Two:

```
        {exp:channel:entries channel="whitepapers" url_title="{segment_3}" dynamic="no" limit="1" disable="categories|member_data|pagination" parse="inward"}

        {exp:stash:parse process="end"}

        {if "{segment_5}" == "{exp:stash:get name='{entry_id}'}"}
        success
        {/if}

    {/exp:stash:parse}

    {exp:stash:parse process="end"}

        {if "{segment_5}" != "{exp:stash:get name='{entry_id}'}"}
        fail
        {/if}

    {/exp:stash:parse}

{!-- ALWAYS FAIL'S UNLESS THE {entry_id} TAG APPEARS IN THIS CHANNEL ENTRIES LOOP ANYWHERE --}

        {/exp:channel:entries}

```

# Answer
> 0 votes
Try adding scope="user" to your stash:get:

```
{if segment_5 == "{exp:stash:get name='{entry_id}'}"}

```

(Don't think you need to add quotes & brackets for segment\_5 for 2.9+, or parse="inward" for your outer channel:entries.)

If that doesn't work, also try without wrapping with stash:parse, or at least take off the process="end" so that the conditional is parsed inline instead.

---

UPDATE:

Version 1 or 2 below should work. The first grabs the stash variable but doesn't output it, so it's available for the conditionals. The second is if you use Switchee.

```
{exp:channel:entries
    channel="whitepapers"
    url_title="{segment_3}"
    dynamic="no"
    limit="1"
    disable="categories|member_data|pagination"
}

    {!--version 1:--}
    {exp:stash:get name='{entry_id}' scope='user' output="no"}

    {if segment_5 == "{exp:stash:get name='{entry_id}'}"}
        success
    {/if}

    {if segment_5 != "{exp:stash:get name='{entry_id}'}"}
        fail
    {/if}

    {!--version 2:--}
    {exp:switchee variable="stash:{entry_id}" parse="inward"}
        {case value="{segment_5}"}
            match
        {/case}
        {case default="yes"}
            no match
        {/case}
    {/exp:switchee}

{/exp:channel:entries}

```

---
Tags: stash
---


# Question
Title: Matrix images that are being pulled in via a Playa (Related Products) field
I have a product section. When I create a product entry, I select related product entries via a Playa field. I can get this to display as expected.

I have now added a matrix field on the product entry page that allows me to upload multiple product images for a specific entry.

When I view a product entry on the front end, the related products display as expected except for the images. All related products show the image from the main entry page they are currently visiting. Not the image for the entry that is related.

So I end up with a number of related products all sharing the same image.

I'm not sure where to go from here. Any help would be greatly appreciated.

**Here's the code**

```
{exp:channel:entries channel="products"}
                            {related_products} <!--THIS IS THE PLAYA FIELD FOR RELATED PRODUCTS-->
                                <div class="col-md-12">
                                    <div class="item product">
                                        <div class="product-thumb-info">

                                            <div class="product-thumb-info-image">
                                                <span class="product-thumb-info-act">
                                                    <a href="{exp:transcribe:uri path="paint/product/{url_title}"}" title="{title}" class="view-product">
                                                        <span><i class="fa fa-external-link"></i></span>
                                                    </a>
                                                </span>
                                                <a href="{exp:transcribe:uri path="paint/product/{url_title}"}">
                                                    {product_image limit="1"} <!--THIS IS THE MATRIX FIELD FOR THE IMAGES-->
                                                        <img alt="{title}" title="{title}" class="img-responsive" src="{main_product_image}">
                                                    {/product_image}
                                                </a>
                                            </div>

                                            <div class="product-thumb-info-content">
                                                <span class="price pull-right">{sizes_available}</span>
                                                <h4><a href="{exp:transcribe:uri path="paint/product/{url_title}"}">{title}</a></h4>
                                                <span class="item-cat"><small><a href="{exp:transcribe:uri path="paint/product/{url_title}"}">{paint_type}</a></small></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            {/related_products}
                        {/exp:channel:entries}

```

# Answer
It might be a namespacing issue for the matrix field, and it's outputting the main\_product\_image variable from the product page, not the related products. You can add a var\_prefix parameter to the matrix tag and the prefix to each matrix variable:

```
{product_image limit="1" var_prefix="mx"} <!--THIS IS THE MATRIX FIELD FOR THE IMAGES-->
    <img alt="{title}" title="{title}" class="img-responsive" src="{mx:main_product_image}">
{/product_image}

```

---

UPDATE: Here's a test version with namespacing for playa and matrix:

```
{exp:channel:entries channel="products"}
    Entry Title: {title}<br>

    {!--playa--}
    {related_products
        var_prefix="pl"
    }
        Related Title: {pl:title}<br>

        {!--matrix--}
        {pl:product_image
            limit="1"
            var_prefix="mx"
        }
            Related Title within Matrix: {pl:title}<br>
            Related Image within Matrix: {mx:main_product_image}<br>
        {/pl:product_image}

        {!--link for related product--}
        <a href="{exp:transcribe:uri path='paint/product/{pl:url_title}'}">{pl:title}</a>

    {/related_products}

    <hr>
{/exp:channel:entries}

```
> 1 votes

---
Tags: ee2, matrix, playa
---


# Question
Title: How to make expression engine not encrypt plugin output
I am building a plugin that takes variables from the url's query string and renders out the appropriate category ids, but when I tried testing out a category that I know exists and place the plugin tag inside the category parameters.

```
{exp:channel:entries channel="products" category="{exp:test_plugin}"}
   {title}
{/exp:channel:entries}

```

It outputs some hash:

```
{exp:channel:entries channel="product" category="M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr" dynamic="no"}

```

But when I place the plugin tag outside of the category parameter it prints out the number. Here's my plugin so far.

```
class test_plugin {
   public $return_data = "";
   public $c;
   public $s;
   public $m;
   public $t;

public function __construct($tagdata = NULL){
    $this->return_data = 28;
}

function type_name(){
    return $this->t;
}

public function usage()
{
    ob_start();
    ?>
        :)

    <?php
    $buffer = ob_get_contents();

    ob_end_clean();

    return $buffer;
}
}

```

How would I get it to print out the actual category number?

# Answer
This just happens in really trick situations. You probably have more than one instance of the same tag on different parsing levels: one inside another tag and other one outside all of them.

The template parser replaces all the instances of the plugin with the placeholder `M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr`, to avoid run it over and over again, and then, because they are at different levels, it tries to parse the `exp:channel:entries` before to replace the placeholder back.

You can remove the different instance you're probably using for testing. If this isn't an option, add a false parameter to the instance inside the `exp:channel:entries` opening tag.

```
{exp:channel:entries channel="products" category="{exp:test_plugin random}" parse="inward"}

```

This will make the two instances to be different, so they will not be replaced by a placeholder and your plugin will run again.
> 1 votes

# Answer
Scrap it. I suggest using Low's Seg2Cat. Tried and True. Gives a ton of other variables too that you can use throughout your templates.
> 1 votes

# Answer
I think maybe it's an parse order issue.

`{exp:channel:entries channel="products" category="{exp:test_plugin}" parse="inward"}`

See the docs: https://ellislab.com/expressionengine/user-guide/templates/plugins.html#changing-parsing-order
> 0 votes

---
Tags: channel-entries, plugin
---


title: Switchee regex for numbers

text:
# Question
Title: Switchee regex for numbers
Trying to get switchee to work with a regex check against a URL segment.

For example following URL check if segment 2 is numeric:

```
/property/123

```

Using:

```
{exp:switchee variable = "{segment_2}"}
    {case value="#[0-9]+#"}
        IS A NUMBER
    {/case}
{/exp:switchee}

```

However this isn't working. Any thoughts/suggestions?

Cheers

Cole

# Answer
> 1 votes
You just need to set the `parse` parameter to `inward` if you want to discard the content of the unmatched cases before parsing them or you are using a module or plugin tag as a parameter.

The RegEx you're using, `/[0-9]+/`, will match strings containing a number, not being one.

Please, try:

```
{exp:switchee variable="{segment_2}" parse="inward"}
    {case value="#^\d+$#"}
        IS A NUMBER
    {/case}
    {case default="yes"}
        NOT A NUMBER
    {/case}
{/exp:switchee}

```

`^\d+$` will match just numbers.

# Answer
> 0 votes
Add parse="inward" to switchee:

```
{exp:switchee variable="{segment_2}" parse="inward"}
    {case value="#[0-9]+#"}
        IS A NUMBER
    {/case}
    {case default="yes"}
        NOT A NUMBER
    {/case}
{/exp:switchee}

```

---
Tags: switchee, regex
---


# Question
Title: JSON Output encoding issue with accented characters and apostrophes
I have created a JS template with this code to output GeoJSON for our Google Maps;

```
{
  "type": "FeatureCollection",
  "features": [
    {exp:channel:entries
        channel="places"
    }
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          {longitude},
          {latitude}
        ]
      },
      "properties": {
        "name": "{title}",
        "url": "{url_title}",
        "address": "{addressline1}, {if addressline2}{addressline2}, {/if}{city}, {postalcode}",
        "icon": "/static/markers/place.png"
      }
    },{/exp:channel:entries}
  ]
}

```

However, some of the titles have an apostrophe or accented characters, which are being included in the GeoJSON like so;

```
Bar ‘67
CafÃ© and Bar

```

I was wondering if anyone knows how I can correct this?

Thanks

# Answer
> 1 votes
As we discus in comments, its most probable that you have this issue because server is not return correct charset (utf-8) by default. You can try next:

for apache - add into .htaccess:

```
AddDefaultCharset utf-8

```

for nginx:

```
charset utf-8;

```

---
Tags: json, character-encoding
---


# Question
Title: Is there a way to pass a category id from one entries loop to another?
I am building a site for a school. The school has classes and the school has events. Some of the events are school-wide and some are specific to a certain class. On a class detail page (domain.com/classes/class-name) I want to make a list of upcoming events that comingles events that are specific to that class as well as school-wide events.

The natural thought was to use relationships to do this. However, I am using icons to represent which class an event is related to and I want to have one icon for school-wide events (rather than showing 10 different icons for every related class).

So instead I am using categories. I have made a category for each class and am sharing the category group across both the event and class channels. I would love to be able to create a variable in the class channel loop and pass it to the parameters in the events loop. It would look something like this:

```
{exp:channel:entries channel="classes" limit="1"}
  {cat_var="{category_id}"}
{/exp:channel:entries}

{exp:low_events:entries channel="events" category="{cat_var}"}
  <li>{title}</li>
{/exp:low_events:entries}

```

I feel like there used to be a way to do this in EE 1.x. Doesn't seem to be there any more though. I also realize that this may be a totally dumb way to try to solve this problem, but it is the best I can come up with right now.

Anyone have any tips I how I might make this happen, or suggestions on another way to thing about it?

As always, any help is appreciated.

Thanks!

# Answer
> 1 votes
I don't know if this will be helpful to anyone else, but I solved my problem. Basically, I went back to thinking of this as something best handled by relationships rather than categories. I realized that if I use Playa instead of EE's native relationships my client could just check off all of the classes that an event is related to. That makes listing related events on the class detail page.

Then, because playa has the {exp:playa:total\_children} tag, I could do this on the event listings:

```
{if "{exp:playa:total_children}" >= "10"}
  <li>All Classes</li>
{if:else}
  {exp:playa:children field="related"}
    <li>{title}</li>
  {/exp:playa:children}
{/if}

```

Reading "All Classes" is a much better user experience than having to read a list of 10 things to decide whether this event applies to you.

Anyway, I am not sure I did a great job of explaining this problem or my solution, but maybe something in here helps someone somewhere eventually.

---
Tags: categories, relationships, variable, low-events
---


title: Leading Zeros in Text Input Fieldtype

text:
# Question
Title: Leading Zeros in Text Input Fieldtype
Is there any way to preserve leading zeros when using the text input field type? This is getting truncated. :(

0010250107 -\> 10250107

# Answer
> 2 votes
You should be able to do this by changing the expected content of your field from a number/integer to "any" which is basically a string and so will not be treated as a number.

---
Tags: fieldtype, entries, text-formatting
---


# Question
Title: Transcribe - After AJAX request, when i switch language it directs me to the AJAX endpoint
So using - Transcribe 1.5 and EE 2.6

Basically when i have channel information outputting to json within ee, when another page is requesting this via ajax, transcribe redirects to the translated json route rather than the template route.

$this-\>EE-\>session-\>tracker is updated with this new route because of the ajax request

which then means when i change the language using language switcher it uses the ajax url rather than the requesting page. (doesn't use referrer).

# Answer
> 0 votes
Found the solution, although this then outputs both language entries:

Use transcribe="disable" in the channel entries tag!!

# Answer
> 0 votes
You nailed down exactly why this one is happening. Transcribe by default looks at the native tracker array in the ExpressionEngine core when determining the page to switch to when changing languages. I would recommend taking a peek at the {exp:transcribe:no\_match} tag http://eeharbor.com/transcribe/documentation#tag-reference

---
Tags: ajax, sessions, transcribe
---


title: AJAX add to cart data.success?

text:
# Question
Title: AJAX add to cart data.success?
I am using Store 2 as my e-commerce module, with the AJAX Form plugin to submit products to the cart.

My question is: Is there a way to detect if the item was added successfully and update the CSRF token?

I thought the below would work, but unfortunately not:

```
$(document).on('click', '.add-basket', function() {
    $('.add-basket-form').ajaxForm({
        success: updateCart,
        dataType: 'json'
    });
});

function updateCart(data, statusText, xhr) {

    if (data.success) {
        $("input[name=csrf_token]").val(data.csrf_token);

        var url = 'http://www.domain.net/site/embed-mini-basket';

        $('#masthead-mini-basket').load(url, function() {
            alert('success');
        });

    } else {

        alert('Failed');

    }
}

```

Thanks.

# Answer
I'm currently not using Store for one of our projects. So I don't know the exact callback you're getting from the ajax call.

But you could store the token and the items in the cart in javascript variables. This makes it possible to compare them with possible new data. It's a bit of a workaround, but it could work...

You could do something like this in the updateCart function:

```
if(typeof data.csrf_token !== 'undefined' && typeof data.count !== 'undefined'){

    // checking if all data in callback

    if(data.csrf_token != current_csrf_token){
        // new token > change token in html
    }

    if(data.count != current_count){
        // changed shopping cart count > pretty sure there was an update?
    }

}

```
> 0 votes

---
Tags: expresso-store, ecommerce, ajax, json
---


# Question
Title: Add on to Make Categories 'Required' in Channel Form?
Is there a way to make category checkboxes work like custom fields and be 'required' in Channel Form? With a message that shows the error if not?

Been looking for a plugin but doesn't seem like there is one..

Anyone had to do something like this?

# Answer
> 2 votes
I often use BW Required Category with great success - does exactly what you're looking for.

---
Tags: categories, safecracker
---


title: Migrating from Catrthrob to Expresso

text:
# Question
Title: Migrating from Catrthrob to Expresso
Has anyone migrated from CartThrob to Expresso Store ? I have a site using cart throb and we need sales (specials) functionality. This is not handled very will is CartThrob, but Expresso does it nicely. So, we are looking to swap carts. I was wondering if anyone had done this, and what their experiences (traps, problems, etc) were.

# Answer
> 0 votes
That all depends on how complex your products are, and how big your product catalogue is.

Obviously you'll have to rewrite a lot of template code - but since CartThrob and Store both store their order data differently, you can preserve all your old CartThrob orders with ease. (If you were looking to import that data into Store that's a different story.)

The main thing will be moving your products over - you can keep the same product entries, but you'll need to add a Store fieldtype to that channel, and then run a migration to insert price and stock data into the various `exp_store_` tables. If you have simple products, this is not a big deal. If you have products with multiple options via the CartThrob Options fieldtype, then you have to decode that data, format it, and insert those options as well.

Your best bet is to install Store, then manually add your options to an existing product. You can then look at the various Store database tables and see how products, options, and stock were added so you can plan a programmatic migration.

---
Tags: expresso-store, cartthrob, migration
---


# Question
Title: Expresso Store - fixed discount if total order > x kg
Is it possible to discount a fixed amount based on the weight of the total ordered items?

I have a store which sells fruits. Let's suppose fruit is available in different modifier\_options

Oranges --product 1 kg basket --modifier (2$ per kg.) 2 kg bag --modifier (1.90$ per kg.) 4 kg barrell --modifier (1.50$ per kg.)

Eg: The customer orders 1 basket and 2 bags, for a total of 5kg. (no discount) The customer orders 2 baskets and 2 bags, for a total of 6kg. (1$ discount) Same applies if: The customer orders 1 barrell and 2 bags, for a total of 6kg. (1$ discount)

Thank you.

# Answer
Store does not currently support weight-based discounts, no.
> 0 votes

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


# Question
Title: Is it possible to set "global" parameters for a plugin with multiple functions?
I've written a plugin that connects to another service to then display its data within my EE site.

Certain parameters are necessary for each tag - primarily things like a key, username. Is there a way to declare these once rather than within each function's parameter array? I'm currently doing that, which works, but seems… like a lot of repetition.

# Answer
Just set them as class variables inside your plugin's `__construct` function.

```
function __construct()
{
    $this->my_api_key = 'foo';
    // OR
    $this->my_api_key = ee()->TMPL->fetch_param('my_api_key');
}

```

Then inside your other functions, just look at `$this->my_api_key`.

**UPDATE**

You can also do a hybrid of my and Yuri's answer:

```
function __construct()
{
    if($my_api_key = ee()->config->item('my_addon_my_api_key'))
    {
        $this->my_api_key = $my_api_key;
    }

    if($my_api_key = ee()->TMPL->fetch_param('my_api_key'))
    {
        $this->my_api_key = $my_api_key;
    }
}

```
> 1 votes

# Answer
I would recommend moving the configuration values to EE config (set them using EE config editor). They will be available as global config values then and you can access them like this: `$this->EE->config->item('my_plugin_username)`
> 1 votes

---
Tags: plugin
---


title: Grid field options - file and HTTPS

text:
# Question
Title: Grid field options - file and HTTPS
I have created a file grid field option to store product images in a channel fields. To display one from them on the site I use:

```
    {product_image limit="1"}
            <img src="{product_image:image}" alt="{product_image:title}" class="img-responsive">
    {/product_image}

```

but it always pulls images as HTTP connection even when I will come to the site as HTTPS.

Any clue?

Thanks

# Answer
The thing you should do is edit your upload preferences with a relative path and not an absolute, that is to say:

```
Server Path to upload directory = /the/actual/server-path/to/my-site/images
URL of Upload Directory = /my-site/images // Note we're not using http://my-site

```

This lets the path be more flexible by letting the browser/location use the current http method.

If you're using a bootstrap you can modify it there if not use the file manager within EE CP
> 2 votes

---
Tags: grid, http
---


title: Stash & Switchee parse order problems

text:
# Question
Title: Stash & Switchee parse order problems
I have the following blocks of code that I can't seem to to work correctly. The list sets and populates perfectly, but the switchee statement doesn't work. I konw that it has do do with parse order but I can't figure out what is going on. The debug value of for the switchee tag is this:

```
{exp:switchee variable="M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr" parse="inward"}

```

It seems as though switchee is running before stash is parsing list\_count, is there any way to fix this?

```
{exp:stash:set_list name="buy_now_options" parse_depth="4" parse_tags="yes" trim="yes"}
    {exp:channel:entries entry_id="{lv_site_buy_now}" status="open|closed" order_by="entry_id" sort="asc" limit="3"}
        {stash:title}{title}{/stash:title}
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}
        {stash:url_title}{url_title}{/stash:url_title}
        {stash:logo}{partner_logo:url}{/stash:logo}
        {stash:base_url}{partner_base_purchase_url}{/stash:base_url}
        {exp:stash:set_list:nested name="purchase_urls" context="{entry_id}" parse_tags="yes"}
            {partner_retail_urls}
                {stash:product}{partner_retail_urls:product:title}{/stash:product}
                {stash:url}{partner_retail_urls:url}{/stash:url}
            {/partner_retail_urls}
        {/exp:stash:set_list:nested}
    {/exp:channel:entries}
{/exp:stash:set_list}

{exp:stash:get_list name="buy_now_options" parse_tags="yes" parse_conditionals="yes"}
    {exp:switchee variable="{exp:stash:list_count name='purchase_urls' context='{item_entry_id}'}" parse="inward" }
        {case value="0"}
            true
            <li><a href="{base_url}" target="_blank"><img src="{logo}" alt="{title} Web Store" /></a></li>
        {/case}
        {case default="yes"}
            false
            <li><a href="{base_url}" data-reveal-id="{url_title}-modal"><img src="{logo}" alt="{title} Web Store" /></a></li>
        {/case}
    {/exp:switchee}
{/exp:stash:get_list}

```

# Answer
> 1 votes
It looks like you're simply testing to see if the nested entries are empty or not. Could you not use something like:

```
{exp:stash:get_list name="buy_now_options" parse_tags="yes" parse_conditionals="yes"}
  {exp:stash:get_list:nested name="purchase_urls"}
  {if no_results}Show default link{/if}
  // There must be entries so show them
  {exp:stash:get_list:nested}
{/exp:stash:get_list}

```

---
Tags: stash, parse-order, switchee
---


# Question
Title: Freeform MSM sites - no submissions received
I have a site that features MSM with Freeform pro. For the main site, all submissions are fine however for the other sites running from the main one form submissions are not received into expression engine . They do work though and email notifications are being sent, they are just not stored as submissions.

Any ideas?

# Answer
> 1 votes
In your Freeform preferences in the EE control panel, you need to have the "Show data from all sites" preference enabled if you wish to use forms, fields and notifications across all MSM sites. :)

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


# Question
Title: Is there an alternative to webspellchecker.net in Wygwam?
We enabled spell checking in Wygwam and the 3rd party service (webspellchecker.net) doesn't even seem to understand simple things like contractions.

For example if the word "aren't" is present it flags "aren" as a misspelled word :-/

So my question is - are there any other ways to spell check in Wygwam without hacking it?

# Answer
Given the licensing for dictionaries, one of the only other viable options is to use the browser's built in spell check. This won't work in older versions of IE, however.

Native spell check functionality is by default disabled in the editor, use disableNativeSpellChecker to enable it:

```
config.disableNativeSpellChecker = false;

```

You can do this from WYGWAM's settings.
> 2 votes

---
Tags: wygwam
---


# Question
Title: How to add bcc on the email notification on forgot password
I would like to send bcc email to myself when user forgot password (reset password). I have solspace user add-on module. I only see 1 email address could put in. http://www.solspace.com/docs/user/forgot\_password/#email

Does anyone know how to send notification to multiple email address (i.e. cc or bcc) when user forgot password. Thanks

# Answer
> 1 votes
For what it's worth, I think sending a password reset email to a cc or (worse) bcc is a huge security and privacy concern. As a user I certainly would not be very happy about that happening.

There is a big difference between a Super Admin being able to log in to a user's account via the control panel and that Admin knowing a user's password (which may also be used elsewhere). It's for this reason that you a Super Admin cannot ever "see" a user's password.

Even within a "trusted" system, i.e. a private network, allowing other users to have the potential to change a password removes any credibility to any audit of activity. Basically, if more than one person could change a password you can no longer say who was accessing the system when something happens.

# Answer
> 0 votes
Sorry, sending a forgot password email to a CC'ed or BCC'ed address isn't possible. I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. :) http://support.solspace.com/support/discussions

There are no hooks in User to add this functionality either. A hypothesis here, but perhaps there is a 3rd-party add-on that hooks up to email sending timed well enough enough to add a CC or BCC to the sent email. However, I highly doubt this exists.

Lastly, and this is just another idea, you could *perhaps* send a separate email using javascript/jQuery and Ajax, but you will need javascript/jQuery knowledge for that. In this situation, you could call a separate template (perhaps using something like http://devot-ee.com/add-ons/email-from-template) which triggers the sending of an email (perhaps using something like http://devot-ee.com/add-ons/email-from-template) to a specified address *before* triggering the actual forgot password form submission. Obviously the email content would be different, and the email woulnd't be CC'ed or BCC'ed. Tutorials for calling a separate URL before submitting a form are likely plenty available on the net.

---
Tags: solspace, solspace-user
---


# Question
Title: Trying to use tagger with structure.. no luck
I am trying to use DevDemon's(3.21) tagger with Structure(3.3.14.5) EE (2.9)

I'm not trying to do anything fancy, but I can't seem to wrap my mind around how to achieve a basic list of blog entries with the same tag. My blog entries are being pulled from a structure listing.

Anytime I try anything I get an error message saying "this page doesn't exist" Obviously it's saying that because the url http://domain.com/tag/{tag\_name} doesn't correspond with any page created by structure.

My blog page is using a channel entries tag.

Any ideas on how to achieve this? I was wanting to use tag instead of categories because of the content fro the blog.

Thanks, Jason

# Answer
> 0 votes
You don't need to use Freebie for this. Just create a template group called "tag" (tag.group on the filesystem) and an index.html (for listing all tags) and then another template that will pull out blog entries by tag (for example content\_by\_tag.html). There you can pull out whatever information from Tagger.

Then use Template Route Manager to set up a route to tag/content\_by\_tag on /tag/ if the url has segments after tag (the tag). See screenshot.

Notice "Require segments" dropdown set to Yes.

Your content\_by\_tag.html template can look something like this:

```
  {exp:tagger:entries_quick unitag="{segment:variable}" limit="999"}
{exp:channel:entries entry_id="{tagger:entry_ids}" channel="blog" dynamic="off"}
<-- content here -->
{/exp:channel:entries}
{/exp:tagger:entries}

```

In the index.html you put whatever you wish to show if the user visits the /tag/ page without a tag as the second segment. Ie. a tag cloud or something.

# Answer
> -1 votes
You need to use freebie to achieve what you want.

---
Tags: structure, devdemon-tagger
---


title: CartThrob UPS Shipping

text:
# Question
Title: CartThrob UPS Shipping
Is there anyway to see what data is being sent to and returned from UPS? It appears that the rates I'm getting back are not the rates I'm expecting and would like to see exactly what data UPS is rating for.

# Answer
> 1 votes
I spent about a week writing a very complex bespoke live rates CT plugin recently.

To debug it, I used kint.

I installed it via composer and load it at the top of my plugin via:

require '..//composer/vendor/autoload.php';

Then I use Kint::enabled(true); d($some\_string); d($some\_var); etc

To debug.

I haven't used UPS but it looks like ~ line 474 is what you need:

```

        $url = "https://www.ups.com/ups.app/xml/Rate";
        $data = (string) $access->asXML(). (string) $rating->asXML();
        $result =   new SimpleXMLElement($this->EE->cartthrob_shipping_plugins->curl_transaction($url,$data));

```

...so if you:

```

      d($data);
      d($result);

```

...you should get what you need.

---
Tags: cartthrob, ups-shipping
---


# Question
Title: entry_submission_end hook with ee()->api_channel_entries->save_entry
EE v2.9.0 Build Date: 20140715

This error displays about 44 times after submitting an entry with a white screen when using the `entry_submission_end` hook. I have roughly 20 field types enabled, and 37 fields created. This is across all field groups.

I've uninstalled everything to the bare bones besides the playa field that I'm working with.

I am using the entry\_submission\_end hook with `ee()->api_channel_entries->save_entry` inside a foreach loop.

`A PHP Error was encountered
Severity: Notice
Message: Undefined index: field_type
Filename: api/Api_channel_fields.php
Line Number: 299`

The `$data` is the $\_POST data array that is passed via the `entry_submission_end` hook. Made sure all my fields are mapped properly.

`print_r($added_playa_entries);`

Outputs

```
Array
(
    [0] => Array
        (
            [title] => test 1
            [url_title] => test-1
            [entry_id] => 9
        )

    [1] => Array
        (
            [title] => test 2
            [url_title] => test-2
            [entry_id] => 10
        )

    [2] => Array
        (
            [title] => test 3
            [url_title] => test-3
            [entry_id] => 12
        )

    [3] => Array
        (
            [title] => test 4
            [url_title] => test-4
            [entry_id] => 16
        )
)

```

The Code

```
foreach($added_playa_entries as $key => $val)
{
    unset($playa_data);
    $playa_daya = array();

    $playa_data['title'] = $added_playa_entries[$key]['title'];
    $playa_data['url_title'] = $added_playa_entries[$key]['url_title'];
    $playa_data['entry_id'] = $added_playa_entries[$key]['entry_id'];
    $playa_data['status'] = 'open';

    $playa_data['category'] = $data['revision_post']['category'];

    // These are custom fields
    $playa_data['field_id_33'] = $data['revision_post']['title'];
    $playa_data['field_id_34'] = $data['field_id_16'];
    $playa_data['field_id_35'] = $data['field_id_21'];
    $playa_data['field_id_36'] = $data['field_id_32'];
    $playa_data['field_id_37'] = $data['revision_post']['url_title'];

    if ( ! ee()->api_channel_entries->save_entry($playa_data, 4, $playa_data['entry_id'], FALSE))
    {
        var_dump(ee()->api_channel_entries->get_errors());
        exit();
    }
}

```

Here is what I am saving using the ee()-\>api\_channel\_entries-\>save\_entry method.

`print_r($playa_data);` For example outputs. The `$added_playa_entries` example above does not correlate with the result below. This is simply an example.

```
Array
(
    [title] => Test Entry
    [url_title] => test-entry
    [entry_id] => 7
    [status] => open
    [category] => Array
        (
            [0] => 4
            [1] => 5
            [2] => 22
        )

    [field_id_33] => Field id 33 data here
    [field_id_34] => Field id 34 data here
    [field_id_35] => Field id 35 data here
    [field_id_36] => Field id 36 data here
    [field_id_37] => Field id 37 data here
)

```

Field id's 33-37 are just text fields.

No fields are marked as required, I double checked this in the DB.

For some reason this will work when I delete a single entry using the hook `delete_entries_start`. When an entry is deleted, all related child entries of the deleted entry are set to closed, categories are cleared, and the custom field data of child entries is removed within the same similar foreach loop. I'm not even operating DRY right now because it's not working with the `entry_submission_end` hook method.

The data does save for every entry successfully, however the mentioned error appears 44 times with a white screen on entry\_submission\_end while using the `ee()->api_channel_entries->save_entry` inside a loop when using this hook.

What I want to know - can you replicate this? Am I missing the minuscule mistake, I have a hunch it's a bug within the channel entries api. Is it playa? I don't know yet. I've disabled all modules but Playa, but still can't seem to get this to work.

**UPDATE**

Performed upgrade to EE 2.9.2. Found that Line Number 299 is the culprit in the Api\_channel\_fields.php file. Why are field\_type indexes not appearing? No clue as it seems to try and grab these indexes for fields that are not even associated with the channel. This is something for Ellislab to look into.

```
$field_id = $field_type;
$field_type = $this->settings[$field_id]['field_type'];

```

Within the elseif statement, I removed line 299 where it assigns the `$field_type` variable and added this condition after line 298.

```
if (isset($this->settings[$field_id]['field_type']))
{
    $field_type = $this->settings[$field_id]['field_type'];
}
else
{
    return FALSE;
}

```

On publish, unfortunately the published view in the CP is the last child playa entry associated with parent entry I just published. Might need to do a function-\>redirect of some sort.

# Answer
> 0 votes
After getting with Ellislab support. It's nothing wrong with the API channel entries.

In regards to the errors on line 299 in Api\_channel\_fields.php I was missing a call to Api\_channel\_fields::setup\_entry\_settings before the `ee()->api_channel_entries->save_entry`

In my constructor I had to also instantiate the the channel\_fields API too.

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

```

So before saving multiple entries in a foreach loop my code looks like this:

```
ee()->api_channel_fields->setup_entry_settings(4, $playa_data, FALSE);
ee()->api_channel_entries->save_entry($playa_data, 4, $playa_data['entry_id'], FALSE);

```

To redirect to the proper content publish view in the CP, I also had to define the entry\_id and channel\_id with the api\_channel\_entries at the end of my foreach loop so it wouldn't return me to the last saved entry in the CP. Previously it was redirecting me to the last published channel\_id 4 after publishing channel\_id 3.

```
ee()->api_channel_entries->entry_id = $data['entry_id'];
ee()->api_channel_entries->channel_id = 3;

```

Also be aware that when publishing a new entry, $data\['entry\_id'\] equals zero, so the content publish view in the CP will not display. Earlier in my method hook, I did this.

```
$data['entry_id'] = $entry_id;

```

---
Tags: ee2, playa, add-on-development, hook, channel-entries-api
---


# Question
Title: No member fields showing from zoovisitor in order fields setting
When viewing Order Fields under settings the select boxes are empty. Fresh install of EE 2.9 latest Expresso Store and Zoo Visitor. Should I not be able to map the ZooVisitor member fields or was that removed from 2.4.0 Store?

# Answer
I used **updater** to install Expresso store. For what ever reason the Extension piece was not installed. I went into add-ons and manually installed all the peices for Store and it works now :). The zoo fields are showing now in Expresso Store to map.

Or it might have been Zoo Visitor just make sure all pieces for both are installed.
> 0 votes

---
Tags: expresso-store
---


title: Using Grid with Categories

text:
# Question
Title: Using Grid with Categories
I'm wondering how to use categories with Grid in a particular circumstance, or if that is really the best way to go.

Specifically, I'm doing a website for a restaurant and they want to be able to update their menu on a daily basis, so I want to use a Grid fieldtype for this.

So the question: is it possible to have a single Grid with the edit screen like this, with "Appetizer" and "Entrée" as categories?:

```
Appetizer
 -- item1
 -- item2
 -- item3
Entrée
 -- item1
 -- item2
 -- item3

```

Or does it make more sense to just have Appetizer, Entrée, etc. as separate Grid fields?

Thanks in advance!

# Answer
Categories can only be assigned to entries, not fields. You're better off to create a new Grid field for each part of the menu (Appetizers, Entrées, etc), so that you can enter each menu item row-by-row under each section.

Alternately, you could have a checkbox column in your grid called "Heading?", which indicates that that articular row is is a heading/divider in the menu, then design your template accordingly.
> 2 votes

---
Tags: grid, categories
---


title: Custom Matrix Field in Channel Form

text:
# Question
Title: Custom Matrix Field in Channel Form
Implementing the solution found on Bring Matrix Data Editing to the Front-End I've a matrix field that contains a P&T Dropdown field type

```
<select name="role_level[row_new_0][col_id_46]">
{options:role_level}
<option value="{option_value}"{selected}>{option_name}</option>
{/options:role_level}
</select>

```

This doesn't work (no options output), the author of the post adviced to hard-code the options

```
<select name="level_matrix[row_new_0][col_id_46]">
<option value="">Choose Level</option>
<option value="Entry Level">Entry Level</option>
<option value="Experienced">Experienced</option>
<option value="Manager">Manager</option>
<option value="Executive">Executive</option>
</select>

```

How can i make the selected option remain "selected"? (will be doing this on many other fields)

Thanks

# Answer
I got around this in a recent project by making the actual field in the entry a text field - the entries were ever only going to be editable via front end so a dropdown/select was redundant. Then using Low Variables, created a dropdown/select that I can call in when required. I actually created a few for my needs but could work for you.

**Create form:**

```
<select name="scrim_type" >
    {exp:low_variables:options var="lv_scrim_type"}
    <option value="{lv_scrim_type:data}"{selected}>{lv_scrim_type:data_label}</option>
    {/exp:low_variables:options}
</select>

```

-- This saves the selected option to the text field on save.

**Edit Form**

```
{exp:channel:form entry_id="segment_3"}
    <select  name="scrim_type" >
        {exp:low_variables:options var="lv_scrim_type"}
        <option value="{lv_scrim_type:data}" {if lv_scrim_type:data == scrim_type}selected{/if}>{lv_scrim_type:data_label}</option>
        {/exp:low_variables:options}
    </select>
{/exp:channel:form}

```

The "if" statement uses the entries value for the text field `scrim_type` to 'select' the active option.

Hope it helps :)
> 0 votes

# Answer
Maybe I am missing something but you have to set the option that the person has selected to selected="selected". This answer seems too easy though. What am I missing?

You were correct to hard code the values.
> 0 votes

---
Tags: matrix, safecracker, pixelandtonic
---


title: Disallowed Key Characters

text:
# Question
Title: Disallowed Key Characters
I get the following error when accessing most pages on my site. Sometimes some of the pages load, sometimes not.

Disallowed Key Characters

www.claireyaffa.com

# Answer
ok. I'm pretty sure, that you have this problem, because your site ask for cookies with name **\__utmt\_~1**. And "**~**" is Disallowed Key Characters. \__utmt is Google Analytics cookie. I think, that it is happens because you have two Google Trackers on your page:

```
var pageTracker = _gat._getTracker("UA-8460157-1");

```

&

```
var pageTracker = _gat._getTracker("UA-9184900-1");

```

Try to remove one of this. Possible you will need to cleanup cookies after that.
> 2 votes

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


# Question
Title: Disabling the session tracker for non HTML templates
I have a problem with DevDemon FreeMember where it relies on the native EE session tracker array (https://ellislab.com/expressionengine/user-guide/development/usage/session.html#tracker-array) to perform a "Return to Previous Page'. From mod.freemember.php:

```
protected function history($id)
{
    $tracker = ee()->session->tracker;

    if (isset($tracker[$id])) {
        if ($tracker[$id] === 'index') {
            return '/';
        }

        return $tracker[$id];
    }
}

```

If on the page prior to calling the FreeMember log-in form with the return parameter set to PREVIOUS\_URL I have a template which references an ExpressionEngine CSS template then the 'Previous URL' is recorded in the session tracker as the CSS file and not the last 'page' viewed by the user.

Is there some way I can disable session tracking for a single particular front end template as to negate this issue?

*Update*

Solved. I had the EE template I was using for my dynamic CSS set as a standard template, not a CSS template. The template parser in EE actually prevents JS and CSS templates from being added to the tracker array. :)

# Answer
Solved. I had the EE template I was using for my dynamic CSS set as a standard template, not a CSS template. The template parser in EE actually prevents JS and CSS templates from being added to the tracker array. :)
> 0 votes

---
Tags: freemember, sessions, tracking
---


# Question
Title: How to rename template folder in EE 2.9.2 ? (Free version)
Who know, how to rename template directory? From /themes/site\_themes/agile\_records To /themes/site\_themes/*custom\_name*

# Answer
it is not really template directory - it is folder for template presets which use during install. After installation only images/js use from this folder. To change it you will need to make search *agile\_records* and replace it with *custom\_name* in DB or in files (before install).

Folder for saving template files, you can setup in

> CP Home -\> Design -\> Template Manager -\> Global Template Preferences
> 2 votes

---
Tags: templates, themes
---


title: Include CSS file in JS

text:
# Question
Title: Include CSS file in JS
I have a problem with url in js file First, in Snippets i have code

In that init.js i have that

```
(function($) {

skel.init({
    reset: 'full',
    breakpoints: {
        global:     { range: '*', href: '{stylesheet=global_embeds/style}', containers: 1400, grid: { gutters: 50 } },
        wide:       { range: '-1680', href: '{stylesheet=global_embeds/style-wide}', containers: 1200, grid: { gutters: 40 } },
        normal:     { range: '-1280', href: '{stylesheet=global_embeds/style-normal}', containers: 960, grid: { gutters: 30 }, viewport: { scalable: false } },
        narrow:     { range: '-980', href: '{stylesheet=global_embeds/style-narrow}', containers: '95%', grid: { gutters: 20 } },
        narrower:   { range: '-840', href: '{stylesheet=global_embeds/style-narrower}', grid: { collapse: 1 } },
        mobile:     { range: '-736', href: '{stylesheet=global_embeds/style-mobile}', containers: '90%', grid: { gutters: 15 } },
        mobilep:    { range: '-480', href: '{stylesheet=global_embeds/style-mobilep}', grid: { collapse: 2 }, containers: '100%' }
    },

```

In template group global\_embeds i have all this files

BUT link {stylesheet=global\_embeds/style-mobile} doesn't work on js file

What to do? Who know? =(

# Answer
First of all, the stylesheet tag needs quotation marks.

```
{stylesheet="global_embeds/style"}

```

If you link to the JS file using `path` variable, all the templates variables on the linked file will be parsed.

```
{path="global_embeds/init.js"}

```

But I really don't think it's good for performance. It's much better to use static links for the JS and CSS.
> 2 votes

---
Tags: javascript, variable, snippets, global-variables, js
---


# Question
Title: "File Upload" box appearing at bottom of Publish Page
I'm having an issue where the "File Upload" is appearing at the bottom of the publish page. There is quite a few JS errors in the console, but I'm unsure what files are causing this.

I though this was the same issue as:

File manager modal appearing at the bottom of publish page

But they fixed it by upgrading Matrix... But I'm on the latest version! I'm running EE.29 and ALL the add-ons are up to date.

:(

# Answer
Just upload the themes directory of the add-on that throwing error in console.

It should work.
> 0 votes

---
Tags: file-uploads, file-manager, publish-layout
---


# Question
Title: Strict Standards: Declaration of Matrix_ft::post_save() should be compatible with EE_Fieldtype::post_save($data)
I have an online shop which uses CT and offsite payment processing. Upon returning to the store after a successfull (test)purchase I recieve those errors:

```
Strict Standards: Declaration of Matrix_ft::post_save() should be compatible with EE_Fieldtype::post_save($data) in /Users/user/Sites/site/dev.site.de/system/expressionengine/third_party/matrix/ft.matrix.php on line 3753

Strict Standards: Declaration of Matrix_ft::save_settings() should be compatible with EE_Fieldtype::save_settings($data) in /Users/user/Sites/site/dev.site.de/system/expressionengine/third_party/matrix/ft.matrix.php on line 3753

Strict Standards: Declaration of Matrix_ft::post_save_settings() should be compatible with EE_Fieldtype::post_save_settings($data) in /Users/user/Sites/site/dev.site.de/system/expressionengine/third_party/matrix/ft.matrix.php on line 3753

Warning: Cannot modify header information - headers already sent by (output started at /Users/user/Sites/site/dev.site.de/system/expressionengine/third_party/matrix/ft.matrix.php:3753) in /Users/user/Sites/site/dev.site.de/system/expressionengine/libraries/Functions.php on line 415

```

At the moment I have really no clue what that might be about. Offline payments go through without any problems and I am not using anything Matrix related in that part of the shop.

So any hints in the right direction would be great. Thanks!

# Answer
Have you updated Matrix & EE yet? It's not a Cartthrob issue i'm afraid.
> 1 votes

# Answer
I have run into a similar error which can usually be fixed by adjusting the notification template code but could not find any errors this time. Eventually managed to work around it by placing the following code in the extload.php file.

`error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);`
> 0 votes

---
Tags: matrix, cartthrob, error, payment-gateway
---


# Question
Title: Expresso store: in stock tag inside modifiers options
I have a code which looks like:

```
{modifier_options}
{if total_stock > 0}
<option value="{option_id}">{option_name} {if price_mod_val} ({price_mod}) [{store_product_stock_level} in stock] {/if}</option>
{/if}
{/modifier_options}

```

which shows total stock (sum) of all options not stock per option.

Also how to display stock amount per product option? So far it shows sum of all product options not X stock amount per product option.

Any clue how to get this resolved?

Thanks

# Answer
The correct code for this is:

```
{modifier_options}{if option_stock_level > 0}{option_name} - {option_stock_level} in stock{if:else}Out of Stock{/if}{/modifier_options}

```

Hope that helps!
> 1 votes

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


title: Unable to add products to cart

text:
# Question
Title: Unable to add products to cart
I'm using Store 2.4 and EE 2.9. I've got a simple product with dynamic pricing to allow the user to set the price of this particular item.

```
{exp:store:product_form return="vanpool/store/checkout"}
  {exp:store:product entry_id="19339" disable_form="yes"}
  <input type="hidden" name="item_qty" value="1" />

      <label class="field_label" for="price">Amount to Pay *</label>
      <input id="price" class="large" name="price" type="text" value="" />

      <label class="field_label" for="notes">Notes </label>
      <textarea name="order_custom1"></textarea>

  <p>
    <input type="submit" name="submit" value="Pay Now" />
  </p>

    {/exp:store:product}
{/exp:store:product_form}

```

I've tried everything I could find here with regards to htaccess, trying different servers, etc. The form posts but the cart is never updated with the item. I've tried being logged in and logged out. I do see the orders being generated for the cart in the control panel but they're missing info: http://cl.ly/image/1g1E0R0y2T2L

I'm completely stuck on this. Any ideas?

# Answer
> 0 votes
After trying everything I could think of, this is working as expected now. I'm sure I must have missed something simple along the way.

---
Tags: expresso-store
---


# Question
Title: Displaying Entries by Category name not working
I'm using Low Seg2Cat and I'm trying to display a list of entries by their Category Name.

if I use the category id I can pull the entries, however using the Category name is a no go.

```
{exp:channel:entries channel="channel_name" dynamic="off" category="
{segment_3_category_name}" status="open"}
{title}
{/exp:channel:entries}

```

this is the URL I'm using.

```
www.site.com/index.php/group/template_name/category_name

```

I've the latest version of seg2cat and set the extension to "search all sites."

Thanks in advance!

# Answer
If you're using lows Seg2cat you can use `{segment_3_category_id}`

EE can only use an id parameter in the channel entries tag.

```
{exp:channel:entries channel="channel_name" dynamic="off" category="{segment_3_category_id}" status="open"}
    {title}
{/exp:channel:entries}

```

Is this cool? Don't really 'get' your issue?
> 1 votes

---
Tags: categories, segments, low-seg2cat
---


title: Facebook addons for images

text:
# Question
Title: Facebook addons for images
Are there any EE Facebook addons that can create albums from multiple images in entry when sharing entry on Facebook.

Thanks

# Answer
> 1 votes
I think you can do this with standard OpenGraph meta tags. Just create a meta tag for each image in your entry and Facebook will handle the rest. I'm not sure it will create an "album" but it should attach all images to the shared post.

```
<meta property="og:image" content="http://yourdomain.com/full/path/to/your/image.jpg" />
<meta property="og:image" content="http://yourdomain.com/full/path/to/your/image2.jpg" />
<meta property="og:image" content="http://yourdomain.com/full/path/to/your/image3.jpg" />

```

See the documentation here http://ogp.me/#array

---
Tags: add-on, facebook
---


title: Caching Regions of template with Stash

text:
# Question
Title: Caching Regions of template with Stash
Having a issue trying to figure out how I can cache the majority of a site page but keep the opening/closing tag of a module uncached? (ie. `add_to_cart_form`) Once the page is cached, the add to cart doesn't work as the forms `XID` hash value has to be dynamic every page load. I'm sure it has something to do with the parse stage, but I have had no luck thus far.

The basics of what I'm trying to do:

```
{exp:stash:cache name="builder" context="@URI" parse_stage="both"}
    {exp:channel:entries
        channel="sheds"
        disable="categories|category_fields|member_data|pagination|trackbacks"
        dynamic="no"
        url_title="{segment_2}"
    }

    ...

    {stash:nocache}
        {exp:cartthrob:add_to_cart_form
            id="atc-form"
            allow_user_shipping="yes"
            entry_id="{exp:entry_data:entry_id url_title="{segment_2}" channel="sheds" site_id="1"}"
            return="cart/index"
            secure_action="yes"
            secure_return="yes"
        }
    {/stash:nocache}

    ...

    {stash:nocache}
        {/exp:cartthrob:add_to_cart_form}
    {/stash:nocache}

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

```

# Answer
I don't think there's any way to nocache just the opening and closing tags -- you'd have to enclose all of `{exp:cart throb:add_to_cart_form} … {/exp:cartthrob:add_to_cart_form}` inside of `{stash:nocache} … {/stash:nocache}`.

So, there's an alternative approach that might work for you:

In my experience, typically when an EE tag generates an HTML form, the form output is a completely boilerplate, predictable chunk of HTML, but with a changing XID hash, e.g.: something like:

```
<form action="blah" method="post">
  <div class="hiddenFields">
    <input type="hidden" name="ACT" value="999">
    <input type="hidden" name="XID" value="absbfjhsfjbsdfksd18748">
  </div>

 ...

</form>

```

When you look at the HTML source output from your templates, if you see that `{exp:cart throb:add_to_cart_form}` outputs a totally predictable pattern of HTML, then you may simply **not** use `{exp:cart throb:add_to_cart_form}` at all. Instead, in its place, you can add the actual form HTML to your template--but with one special EE tag, `{XID_HASH}`, that generates a new XID.

You'd end-up with something like:

```
<form action="blah" method="post">
  <div class="hiddenFields">
    <input type="hidden" name="ACT" value="999">

    {stash:nocache}
     <input type="hidden" name="XID" value="{XID_HASH}">
    {/stash:nocache}

  </div>

 ...

</form>

```

So, then, with all of the "final" form HTML directly in your template, you'd need to nocache only the XID tag (or, as I show above, the HTML input that includes that `{XID_HASH}` tag).

**Added -- one potential gotcha:** one warning about using the manual approach -- with the hidden input with the ACT value, that value could conceivably be different between on different installs of EE, if you've separately installed (in this case) CartThrob. For example, on your dev machine, the ACT ID could be 50, but it could be 55 on your production machine. I try to make sure to never separately install add-ons on development / stage / production copies of a site. But if you reuse this code from one project to another, you might have an unavoidable change to make. And, worse case, you'd have to change that ACT value when moving the template code between environments / projects.
> 1 votes

# Answer
I think the issue here is that the entry\_id param isn't being rendered. Have you tried something like this:

```
{stash:nocache}
  {exp:cartthrob:add_to_cart_form
    entry_id="{/stash:nocache}{product:entry_id}{stash:nocache}"
  }
{/stash:nocache}

```

Hinted at by the legend himself: http://devot-ee.com/add-ons/support/stash/viewthread/12576#40677

The `{product:entry_id}` variable is coming in from a get\_list and gets rendered onto the stash variable, something like this:

```
{exp:cartthrob:add_to_cart_form
  entry_id="2918"
}

```

It looks like it's working on my local, I'll update when I inevitably break it.
> 0 votes

---
Tags: cartthrob, stash
---


# Question
Title: Relationship field & variables outside of product form
Trying to access price of some store items in a relationship field. The name of my store field is `shop_product_settings`

I'm trying to access the price variable without using the form tag, however, it doesn't seem to work when the items are being access through a relationship field.

```
  {class_recommended_products limit="2" }
    {class_recommended_products:title}"
    {class_recommended_products:shop_product_settings:price}
    {class_recommended_products:shop_main_image}
  {/class_recommended_products}

```

# Answer
I've used this:

```
{exp:channel:entries}
    {relationship_field parse="inward"}
        {exp:store:product entry_id="{relationship_field:entry_id}" disable_form="yes" disable_javascript="yes"}
            {price}
        {/exp:store:product}
    {/relationship_field}
{/exp:channel:entries}

```
> 1 votes

# Answer
That may not be possible. Store takes advantage of EE's internal parsing to display the special `price` variables inside the product details tag.

I have not tried this myself, but it may not be possible to use the fieldtype parameters inside a relationship tag like that. Instead, would need to use the `{exp:store:product}` tag to get the product details.
> 0 votes

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


# Question
Title: Template routes and Pagination - blank page
I've got a blog listing template where pagination is not working as expected. I see the pagination links but when I follow one I get taken to a blank page.

My template routes are:

All links from listing template to single template work except for pagination links. I've also tried turning the blog/index tempalte to require segments but that also did not work

My blog listing template is:

```
            {exp:channel:entries channel="blog" limit="2" dynamic="yes"}
                <article class="post">
                    <div class="media">
                      <a class="pull-right" href="#">
                        {exp:ce_img:single src="{blog_image}" width="290" height="113" add_dims="no" attributes="class='media-object'"}
                      </a>
                      <div class="media-body">
                        <h4 class="media-heading"><a href="{route="blog/single" blog-post="{url_title}"}">{title}</a></h4>

                        {if blog_copy:has_excerpt}
                            <p>{blog_copy:excerpt text_only="yes"}…</p>
                        {if:else}
                            {exp:eehive_hacksaw
                                words = "25"
                                append = "…"
                                allow="<p><b><a>"}
                                {blog_copy}
                            {/exp:eehive_hacksaw}
                        {/if}

                        <a href="{route="blog/single" blog-post="{url_title}"}" class="readMore">Read More</a>
                      </div>
                    </div>
                </article>

                {paginate}
                <div class="row">
                    <div class="col-sm-12">
                    {pagination_links}
                        <ul class="pagination">
                            {!--
                            {first_page}
                                <li><a href="{pagination_url}" class="page-first">First Page</a></li>
                            {/first_page}
                            --}

                            {previous_page}
                                <li><a href="{pagination_url}" class="page-previous"><span class="glyphicon glyphicon-chevron-left"></span></a></li>
                            {/previous_page}

                            {page}
                                <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
                            {/page}

                            {next_page}
                                <li><a href="{pagination_url}" class="page-next"><span class="glyphicon glyphicon-chevron-right"></span></a></li>
                            {/next_page}

                            {!--
                            {last_page}
                                <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
                            {/last_page}
                            --}
                        </ul>
                    {/pagination_links}
                    </div>
                </div>
                {/paginate}

            {/exp:channel:entries}

```

# Answer
> 0 votes
Looks like I'm an idiot - forgot to put /blog/ in the template route for blog/index so it should be /blog/{pagination}

Why do I always find the solution minutes after posting? Why?

---
Tags: templates, pagination, template-routes
---


# Question
Title: Using Stash variable inside of channel entries loop
So, I have a scenario where I'm setting a Stash variable based on a query string being passed. I'm using Mo' Variables to get the $\_GET values.

```
// Query string: /?c1=74&c2=81

{exp:ifelse parse="inward" parse_tags="yes"}
{if get:c1}
  {exp:stash:set name="active_cat" parse_tags="yes"}{get:c1}{/exp:stash:set}
  {/if}

  {if get:c2}
  {exp:stash:set name="active_cat" parse_tags="yes"}{get:c2}{/exp:stash:set}
  {/if}

  {if get:c3}
  {exp:stash:set name="active_cat" parse_tags="yes"}{get:c3}{/exp:stash:set}
  {/if}

  {if get:c4}
  {exp:stash:set name="active_cat" parse_tags="yes"}{get:c4}{/exp:stash:set}
  {/if}
{/exp:ifelse}

Works directly: {exp:stash:get name="c2" dynamic="yes"}<br> // outputs 81
Stash Variable works: {exp:stash:get name="active_cat" process="end"} // outputs 81

{exp:channel:entries
    channel="{stash:_channel}"
    category="{exp:stash:get name='active_cat' process='end'}"
    dynamic="no"
    orderby="title"
    sort="asc"
    limit="10"
    parse="inward"
    status="{stash:_status}"
    disable="member_data|pagination"
}
    <li><a href="{structure:page_url_for:{entry_id}}">{stash:_channel} - {stash:_status} - {title}</a></li>
{/exp:channel:entries}

```

Basically, it assigns a Stash variable 'active\_cat' to c1, c2, etc. If a "c4" exists though, it overwrites that variable with the new value.

It works outside of the channel entries loop, but isn't being passed into the channel entries loop. This is in a Stash embed and there are 2 other variables passed into the loop correctly from the parent template.

# Answer
So, it seems that I have to wrap the channel entries tag pair inside of {exp:stash:parse process="end"}, and then remove the process='end' from the active\_cat tag being passed as a parameter.

```
{exp:stash:parse process="end"}
{exp:channel:entries
    channel="{stash:_channel}"
    category="{exp:stash:active_cat}"
    dynamic="no"
    orderby="title"
    sort="asc"
    limit="10"
    parse="inward"
    status="{stash:_status}"
    disable="member_data|pagination"
}
    <li><a href="{structure:page_url_for:{entry_id}}">{title}</a></li>
{/exp:channel:entries}
{/exp:stash:parse}

```
> 0 votes

---
Tags: stash
---


# Question
Title: extension error when using function>redirect
```
$this->EE->functions->redirect('account/not-found');

```

When this is triggered in my extension, I get this error:

```
A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClassàK´cðËÛ::$flashdata

Filename: libraries/Functions.php

Line Number: 381
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /Users/Chad/Repositories/hhc/site/system/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 414

```

I am not using flashdata, don't care about it. Any reason this error is happening?

# Answer
> 1 votes
Is that strange encoding actually displaying on the stdClass undefined property?

Which hook are you using to call the extension? Something may not be setup on the object yet...

Just out of curiousity, did you try ee()-\>functions-\>redirect('account/not-found');

# Answer
> 1 votes
If you can't get that to work consider using Codeigniter's URL Helper. See `redirect()` at bottom of page.

For example:

```
public function sessions_end()
{
   $this->EE->load->helper('url');
   redirect('/account/not-found/');
}

```

---
Tags: extension
---


title: append .xml to EE template

text:
# Question
Title: append .xml to EE template
Client has a podcast feed that up until now has been a manually edited XML file on their server.

I'm looking to move this into EE so that they don't need to touch the server directly.

Because this was a manual XML edit, the file was at /media/podcast.xml

Converting to EE /media/podcast works just grand, however, for those still looking at /media/podcast.xml - they get a 404.

What's the best way to route those users to the /media/podcast url ?

# Answer
> 1 votes
I believe the best is a redirect on the server. It's faster and easier.

If the server runs Apache, you can add to the .htaccess file:

```
RewriteRule ^/media/podcast.xml http://domain.com/media/podcast [L,R=302]

```

If everything goes right, replace the `302` by `301`.

---
Tags: url, htaccess, routing, rss
---


# Question
Title: Highlight days with events on solspace calendar
I am using your the solspace calendar extension. I need to be able to highlight by adding a class to the td

I googled the request and I came across a few results but your archived forum seems to be not working any more

Is there a tag I can use {if event has results} etc

Thanks

{display\_each\_day} {day format="%j"} {/display\_each\_day}

# Answer
> 1 votes
If you're using the `{exp:calendar:cal}` tag, within `{display_each_day} ... {/display_each_day}` you can use a `{day_event_count}` (http://www.solspace.com/docs/calendar/calendar/#day\_event\_count) in a conditional:

```
{display_each_day}
   <td class="{if day_event_count > 0}HIGHLIGHT CLASS{/if}">
      {day format="%j"}
   </td>
{/display_each_day}

```

Alternatively, `{event_count}` can also be used in some cases: http://www.solspace.com/docs/calendar/calendar/#event\_count

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


title: Foreign Characters and Low Search

text:
# Question
Title: Foreign Characters and Low Search
We have a site where some entry titles are company names including a German umlaut. When we perform a search using Low Search and type in the name 'without' the umlaut (as you would be most likely to do if you have a english language keyboard) then no results are returned.

However when performing the same search from 'within' the ExpressionEngine control panel channel entries listing screen searching without the umlaut does return results.

Is there some fundamental difference between how internal entry searches are performed in EE and how Low Search works and is there any workaround we can implement to enable the return of results when we do perform a search on the front end minus the umlaut?

# Answer
> 4 votes
Keyword searches with Low Search are diacritic insensitive. That is to say, both the collection index and given search terms go through an algorithm to strip them out or replace them with unaccented equivalents. LS uses EE's native `$foreign_characters` array for this, located in `/system/expressionengine/config/foreign_chars.php`.

For example, take the word **München**. LS will change this, *using the foreign\_chars map*, to **muenchen**. That means if you use the search term "münchen", LS will transform the search term to "muenchen" too. However, if you search for "munchen", LS will not change the terms since that doesn't contain diacritics.

So, it's best to **change the values in the `foreign_chars.php` file** to suit your needs. You'll need to update your indexes if you do.

---
Tags: search, low-search, multi-language, language
---


title: Keeping content synced in development

text:
# Question
Title: Keeping content synced in development
Good Afternoon EE StackExchange,

I was wondering if anyone had experience keeping their development environment in sync with production content. The problem being that a content freeze is not permissable on long-term projects, and our client insist that they need to see the latest content from production. Is this matter of dumping specific tables from the database and moving them down to development. I've seen a few strategies, but all of them seemed overly manual and not in line with just moving content. To be short, I am looking for a strategy to move content from Production to development, after changes have been made to development (so overwriting the database is not an option). Thank you for your help.

# Answer
You statement of:

> after changes have been made to development (so overwriting the database is not an option)

Means it isn't straightforward, although it is possible, it's not easy. If you must create content on the Development server and move it to Production **and** there's no chance of Live being updated independently, then you can move the relevant tables up from Dev to Prod. If both can be updated then you'll have to duplicate stuff manually!

One alternative may be to consider using something like Publisher or Better Workflow, entering all the content into Production, but the client can see the draft content and the live content is then unaffected. And if there is still content that can only be reviewed on Dev, then it can be entered as draft on Prod and the database bought down to Dev.

As you make reference to, there are other questions that relate to this:
> 0 votes

---
Tags: development, workflow
---


title: Secure Comment Form Action?

text:
# Question
Title: Secure Comment Form Action?
I'm trying to add comments as reviews to a store using the Devdemon Ratings module.

The store runs over SSL and that's all fine, however when I add a comment:form to the mix, the form action isn't secure and therefore the SSL on the page throws out an insecure error.

Securing forms on the rest of the site is easy, but I cannot find any example or anything in the documentation that explains how to secure comment forms. Is this possible or am I missing something?

```
{exp:comment:form
    channel="products"
    entry_id="{entry_id}"
    dynamic="no"
    rating:enabled="yes"
    }

    {if rating:not_rated}
        <a href="javascript:void(0);" title="Write Review" id="id_{entry_id}_review" class="review"><i class="fa fa-star"></i></a>
    {/if}

 {/exp:comment:form}

```

Any fixes or workarounds appreciated!

Thanks

# Answer
> 0 votes
Brad from DevDemon was kind enough to provide some suggestions and this has in fact led to a solution.

http://eeinsider.com/articles/multi-server-setup-for-ee-2

By modifying the config file you can have the URLs set dynamically and thereby all content within a page can load over SSL by default, or not, depending on how the page itself it loaded.

The simplest solution Edd posted above is to have your site running on HTTPS in the EE admin config. If this isn't an option (as was my case), then a dynamic config file will do the trick.

---
Tags: forms, comments, ssl
---


title: AJW Export download button

text:
# Question
Title: AJW Export download button
I am using the Add-on AJW Export to export member details in CSV format. Each time the page loads the CSV format downloads automatically. Anyone any suggestions how to activate the download via a click rather than on page load..

Code looks like this:

{exp:ajw\_export sql="SELECT * FROM exp\_member\_data" format="csv" filename="members.csv" }

# Answer
> 2 votes
You can do it like this:

```
<a href="members/index" class="button">Download</a>

```

(place this button anywhere you want)

Just create group in your templates called members and add `{exp:ajw_export sql="SELECT * FROM exp_member_data" format="csv" filename="members.csv" }` to index file.

---
Tags: members, freemember, export, sql, csv
---


# Question
Title: Issue with grouping members in EE using either AB Member Categories or an alternative
I'm struggling with a concept in EE, and indeed explaining it, but what I need is essentially a way to group members so, for example, I'd have a group called Google then other members could be assigned to it. This would allow for content on the front end to be shown only to those that are part of that group.

I can't use member groups for this as I still need those for permission based things. I've looked at using AB Member Categories and this would be okay however it doesn't appear to be flexible enough when it comes to displaying entries from a specific category (group) based on the id/username of the person who is logged in.

Here is an example:

Groups / Members:

* Google
    + Member 1
    + Member 2
    + Member 3
* StackExchange
    + Member 4
    + Member 5
    + Member 6
* Facebook
    + Member 7
    + Member 8
    + Member 9

If Member 4 logs into the site then they will only see content linked to StackExchange, however if Member 2 logs in then they will only see Google related content.

Can anyone help out at all?

Thank you.

# Answer
> 1 votes
I've done this sort of thing using Zoo Visitor. With a category group specifically for visibility, which you use to assign content to said categories, in addition to members to the same categories, you can tie it together by using the Zoo Visitor global variable of "Member Categories" to limit the content displayed to content sharing category assignment with the logged in user using the category parameter on the entries loop. What's nice is that a member can then be part of more than one group if need be.

---
Tags: members, member-management, member-categories
---


# Question
Title: Conditional to check if a field exists for a channel
Is there a way to check if a field with a certain short name exists for a given channel? I'm not checking if a field is left blank, but if it even exists in the field group.

Currently, this only checks for it being blank, but not if it exists. I'm sharing a template for a few channels, but certain fields aren't mirror images of each other per-channel.

```
{if {segment_1}_code}{{segment_1}_code}{/if}

```

# Answer
In short, no. The template parser doesn't know whether fields exist or not.

What would you do differently based on a field being empty vs. a field not existing? Don't they end up with the same result (conditional fails)?
> 0 votes

---
Tags: conditionals
---


# Question
Title: How to show entries for next week or last week
Related to this question *new channels shown by week*
How could you show entries, not for the current, but for next week?

If you have many future entries, `show_future_entries="yes" display_by="week" limit="1"`
will show one week worth of entries, but it's showing the furthest away future entries.

What are some of the options to display entries for next week?

# Answer
> 2 votes
You could enable php, grab the current time and add as much time as you need, then use the start\_on parameter.

Or here's a plugin you could use: http://devot-ee.com/add-ons/dt-plugin

Maybe something like this as the start\_on parameter: {exp:dt day="7" ee\_format="true" format="%Y-%m-%d %H:%i"}

---
Tags: date, orderby, entry-date
---


# Question
Title: Have trouble implementing Low Search using Expresso Store
I'm trying to implement Low Search for the first time and I'm struggling with how you integrate it.

I don't fully understand what Collections are and How I should use them. I'm using the expresso store and have a number of categories for products. I would like to have the ability to show product based on price, and some other criteria. Do I create a collection for each product section or product type?

Secondly I have a page that shows products right now. I would like to use the same page to display the results in the same manor. Once I have create the form inputs, checkboxes, etc., how do I set it up to make the search based on all selected criteria?

Secondly, How do I display the results. I have seen the example on the product page, but I don't understand how I implement my results page.

Any help would be greatly appreciated. Below is some initial code to get started. What am I doing wrong?

```
{exp:low_search:form collection="central_vacuums" search_mode="all" result_page="products/index"}

                 <select name="range:regular_price">
                    <option value="">All</option>
                    <option value=";99">$0.00 - $99.99</option>
                    <option value="100;199">$100.00 - $199.99</option>
                    <option value="200;399">$200.00 - $399.99</option>
                    <option value="400;799">$400.00 - $799.99</option>
                    <option value="800;">$800.00 and over</option>
                </select>

                <input name="submit" type="submit" value="Submit">

            {/exp:low_search:form}

            {exp:low_search:results limit="10"}
                {exp:store:product entry_id="{entry_id}"}
                    <p>{regular_price}</p>
                {/exp:store:product}
            {/exp:low_search:results}

```

# Answer
> 3 votes
You should take a look at Low Search Store. This adds compatibility with Expresso Store to Low Search - https://github.com/low/low\_search\_store

:)

# Answer
> 1 votes
Low Search cannot be fully implemented with Exp:resso Store data at this time.

---
Tags: add-on, ee2, expresso-store, low-search
---


# Question
Title: Creating a chronological list from 2 channels and sorting by 2 different fields
I'm building a loyalty scheme system in which customers log purchases they have made and when approved they are allocated points. These points are used to 'purchase' rewards.

I have most of the system working but I need to create a transaction history and this is proving to be tricky.

Basically, I have 2 channels;

**Invoices** \- in which the entries represent customer invoices that are awarded points.

**Rewards** \- in which the order for items they claim are recorded

The invoices channel contains a date field to record the date of the invoice (not the entry date since this is different). I need to retain the entry date as the date the entry was made for admin purposes.

The rewards channel uses the standard entry date to record when the purchase is made.

The transaction history needs to show a mixed list pulling entries from both channels - easy enough. BUT I need to sequence them chronologically using the invoice date and the reward entry date.

I'm using this in my entries tag at the moment;

```
{exp:channel:entries channel="invoices|rewards" dynamic="off" status="approved|open|closed|pending|declined" show_future_entries="yes" show_expired="yes" orderby="invoice-date|entry_date" sort="asc"}

```

As you can imagine, this isn't working as it groups each channel's entries together.

As I've been writing this it has occurred to me that the simplest solution would be to add another date field to the purchases which replicates the entry date then just sort on the 2 custom fields. I'm not sure this will work but might be worth a try though I can see other problems manifesting if I do that.

A better option might simply be to use the query module now I think of it. But again I fear I may run into a similar issue.

If anyone has an idea on this I'd be grateful!

# Answer
I think I would go with adding a reward\_date field to your other channel, this will also make things more obvious for any other devs picking up the project later on.

You should be able to write a simple extension to do this using the publish-form-entry-data hook:

http://ellislab.com/expressionengine/user-guide/development/extension\_hooks/cp/content\_publish/index.html#publish-form-entry-data

All you need to do is mirror your entry date 'if' then entry belongs to the relevant channel to the 'reward\_date' field. :)
> 1 votes

# Answer
Stash has multisort, and sublists.
Just add both to a stash list (or one of the two to a sublist)

Depending if you want both in one list mixed up together,
then fill a stash list `{stash:varname}` with the first datefield,
then append the list with the other channel, and output the whole list,
ordered by said varname (datefield).

If you want to keep the rewards organised together with the invoices
then you can work with sublists. e.g. fetch all invoices,
and in each loop, fetch the rewards where the joining key matches.

Stash behaves just like a multi-dimensional array,
and also supports array\_multisort.

https://github.com/croxton/Stash/wiki/Lists
> 0 votes

---
Tags: custom-fields, date, sort, entry-date, multiple-channels
---


title: Unable to Login

text:
# Question
Title: Unable to Login
For some reason I am not able to log into my EE Control Panel this morning. I was working on it last night without difficulty and this morning when I try and log in the username and password are cleared out of the fields and it comes back with empty fields. I have tried this in Safari and Firefox with the same result. This also happens with another user on the site. I am running EE 2.9.0.

Edit: I am seeing an unusually long session id at the end of the URL after trying to login:

Normal looking URL & session ID:

> http://domainname.com/admin.php?/cp/homepage?S=2eb7686aa8a34e593cc97a79ff27c30f

What I am seeing with failed login:

> http://dev.domainanme.com/admin.php?/cp/login&return=Qz1hZGRvbnNfbW9kdWxlcyZhbXA7TT1zaG93X21vZHVsZV9jcCZhbXA7bW9kdWxlPXJlcHVibGljX2FuYWx5dGljcw==

Has anyone else had similar experience? If so, what is the fix?

# Answer
The solution was found in an older EE bug report.

> To resolve I had to disable the ‘cp\_member\_login’ hook in the extensions table where the ‘class’ value is ‘Republic\_analytics\_ext’

After that was disabled I was able to log in.
> 0 votes

---
Tags: ee2, login
---


# Question
Title: GraySquare: exp:channel:entries does not show all entries
I have a page that shows tips by month. It works well but for some odd reason, the `{exp:channel:entries channel="tips"}` does not return all tips.

I query the database:

```
{exp:query sql="SELECT t.entry_id AS query_entry_id FROM
exp_channel_titles t, exp_channel_data d WHERE t.entry_id = d.entry_id
and t.year='{segment_3}' and t.month='{segment_4}' and t.channel_id='3'
order by t.entry_date desc"}

```

then use `{exp:channel:entries channel="tips"}`. `{total_results)` shows 4 but the same tip is repeated 4 times instead of 4 different tips.

Here is the URL to understand better: http://www.neatfreak.com/index.php/site/tips/2014/07/

Bottom line, I have around 85 tips but it only shows a few. The dates and the channel on all tips are correct.

# Answer
> 1 votes
show\_expired="yes" show\_future\_entries="no" helped !

# Answer
> 0 votes
Parsing dates in URLs is automatic in EE; you don't need to build a query for that: https://ellislab.com/forums/viewthread/212166/

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


# Question
Title: Sorting by Expresso Store Price within Low Search Results
We're using Low Search and the Low Search Store Filter to add search to our online shop. Works great but we also need to let users sort by price.

Sorting by fields which are native works fine but as 'price' is not a standard entry field passing orderby="price" has no effect.

So, is there some way to sort by price when using Low Search to display Store results?

# Answer
I see this is missing in the Low Search Store docs, but try this: `orderby="store:price"`.
> 2 votes

---
Tags: expresso-store, low-search, orderby, sorting
---


title: Relationships in Postmaster Parcel

text:
# Question
Title: Relationships in Postmaster Parcel
Is it possible to use the new EE 2.6 native relationships in parcels. I cant seem to get it to work... tried a few different syntax styles?

```
Your application for {parcel:application_related_fair}{application_related_fair:title}{/parcel:application_related_fair}has been submitted and will be reviewed shortly.

Your application for {parcel:application_related_fair}{parcel:application_related_fair:title}{/parcel:application_related_fair}has been submitted and will be reviewed shortly.

Your application for {parcel:application_related_fair}{title}{/parcel:application_related_fair}has been submitted and will be reviewed shortly.

Your application for {parcel:application_related_fair:title} has been submitted and will be reviewed shortly.

```

none of these seem to work?

# Answer
For anyone else who might have the same question:

The Answer is, yes you can. Just put your regular {exp:channel:entries} code in either the message or subject and it renders like in any other template. Example:

{exp:channel:entries channel="your\_channel" limit="1"}
Your message {relationship\_field}{relationship\_field:your\_field\_that\_you\_need}{/relationship\_field}
{/exp:channel:entries}

Since the question was older, it might be that the reasons it works is that I am on a newer version (EE 2.9.2 and Postmaster 1.5)

If not, I am glad to help
> 0 votes

---
Tags: postmaster
---


# Question
Title: ACT urls have lots of backslashes - "The URI you submitted has disallowed characters."
My logout and other ACT urls all seem to have a lot of backslashes in the URL

I'm using the module shortlist and when clicking add it takes you to:

http://eogee.rmdyapps.co.uk/////////?ACT=39&p=YToyOntzOjg6ImVudHJ5X2lkIjtzOjM6IjgzNiI7czoxMToiY2xvbmVkX2Zyb20iO2I6MDt9&ret=http%3A%2F%2Feogee.rmdyapps.co.uk%2Fwhat-we-do%2Fsustainability%2Fsigns-tool%2Fafirm-apparel-and-footwear-international-rsl-management

This then shows the error "The URI you submitted has disallowed characters."

My logout URL is also showing as:

http://eogee.rmdyapps.co.uk/////////?ACT=16&csrf\_token=e836df2db8ce7415437de6a9ddb938e613d12aa8

Any idea as to why it's adding in these additional backslashes? seems to be causing all sorts of issues.

Thanks!

# Answer
Turns out this was due to the transcribe module doing strange things, once disabled everything worked as expected
> 0 votes

---
Tags: url, act, shortlist
---


# Question
Title: Dynamically setting case value with switchee
I'm wanting to dynamically populate a switchee value, I've tried using an embed, but it seems the parse order means this won't work so I'm looking for aternative ideas, this is the code we've tried:

```
{exp:switchee variable="{segment_1}" parse="inward"}

    {case value="{embed='site/_school-list'}"}
        {redirect="/contribute/school/{segment_1}"}
    {/case}

    {case default="yes"}
        Otherwise go here
    {/case}

{/exp:switchee}

```

Basically I want to automatically pull out all of the entries from the school channel and get their {url\_title}, then check it against {segment\_1}.

The code in the embed is:

```
{exp:channel:entries channel="schools" dynamic="no" limit="99999"}{url_title}|{/exp:channel:entries}

```

Which is outputting correctly when tested.

Any ideas?

# Answer
While you could easily use Stash to pass the entry ids as a variable, you shouldn't.

To create the variable would mean iterating over the entire list of entries in a channel. That's expensive just for a simple routing operation.

Assuming this is being run on your site's default index template, and you have strict 404s disabled, why not just redirect if `segment_1` exists at all?

```
{if segment_1 != ""}
 {redirect="/contribute/school/{segment_1}"}
{/if}

```

Your template `contribute/school` should take care of 404s using a channel entries tag with parameters `require_entry="yes"` and `{if no_results}{redirect="404"}{/if}`
> 4 votes

---
Tags: segments, switchee
---


# Question
Title: Error after EE2.9 update. Conditional fix required
The below code no longer works with EE2.9 Have tried determining how to change it but cannot work it out. I just need to specify that if ANY of the fields exist, display the content (div/header/row/info).

Any help is appreciated!

```
{if jumper_colour|sash_colour|tie_colour|saddle_colour|rally_colour}
<div id="container">
<h4>CLUB COLOURS</h4>

  {if jumper_colour}<div id="row">
    <div id="ff"><h5>Jumper:</h5></div>
    <div id="ee"><p>{jumper_colour}</p></div>
  </div>{/if}
  {if sash_colour}<div id="row">
    <div id="ff"><h5>Sash:</h5></div>
    <div id="ee"><p>{sash_colour}</p></div>
  </div>{/if}
  {if tie_colour}<div id="row">
    <div id="ff"><h5>Tie:</h5></div>
    <div id="ee"><p>{tie_colour}</p></div>
  </div>{/if}
  {if saddle_colour}<div id="row">
    <div id="ff"><h5>Saddle Cloth:</h5></div>
    <div id="ee"><p>{saddle_colour}</p></div>
  <div>{/if}
  {if rally_colour}<div id="row">
    <div id="ff"><h5>Rally Uniform:</h5></div>
    <div id="ee"><p>{rally_colour}</p></div>
  </div>{/if}

</div>
{/if}

```

# Answer
> 1 votes
Ok finally worked out that all i needed to do was add a double pipe character between fields.

```
{if jumper_colour || sash_colour || tie_colour || saddle_colour || rally_colour}

```

---
Tags: conditionals
---