# Question
Title: Tips on doing user email address validation / DIY account activation in EE
I'd like to be able to offer some preliminary "logged in" features immediately to users after they register on the site, rather than requiring that they first click an activation link in an email. However, I do want to validate member email addresses.

So, at some moment after registration, I do want to email the new members something like an account activation link that they click to verify that they have entered a valid email address.

Has anyone done this in EE? Any tips? Any gotchas? Ideas for a best approaches?

In terms of the EE member permissions / back-end, I think it'll work simply enough to register users directly into a "New Members" group, and then, upon email verification, move them into a "Verified Members" group.

I'm working with Profile:Edit, and likely will be adding CartThrob in the future (so, want whatever I do to work with ecommerce check-out). I could see MX Notify fitting in here, as a way of automatically triggering an email to the user.

I don't think generating verification links for the email, or capturing them via templates in EE, should be too hard.

But, any thoughts on this? Is there an easier way?

# Answer
> 3 votes
You can definitely do this. General setup would be something like this.

* Set **Require Member Account Activation?** to *No activation required*
* Create a custom member field to indicate whether member has completed the email activation process. **Email confirmed? : y**
* For the pages (or specific elements) of the content you don't want them to access, run a check for the value of the custom member field (cmf). `{if cmf_email_confirmed == ""}{redirect="/"}{/if}` or `{if cmf_email_confirmed}show this content{/if}`
* You can use MX Notify to send emails to new members when they are activated by EE. In that email send a link to a page where they have to login (because you want them to know their username and password, right?). Then, once logged they need to view *another* page where they submit something simple, say their real name, city, or just "Are you ready to enter the Twilight Zone?" just so that you can have them submit a form that has a hidden field for cmf\_email\_confirmed to set a value of 'y'.

That should get you started.

---
Tags: members, profile-edit, member-management
---


# Question
Title: Moving to Content Elements from CE IMG, Matrix and fancybox?
I'm having a problem with the Content Elements {gallery} function where I would like to take a group of images and put them into a gallery, but display one main image which when clicked opens up into a fancybox gallery. The current code I'm using that works is:

```
{if Custom_channel_field}
 {!-- HANDLE SCALING / DISPLAY OF MAIN ARTICLE IMAGE --}
     {Custom_channel_field offset="1"}
         {exp:ce_img:pair disable_xss_check="yes" src="{image}" max="500"  quality="90" allow_scale_larger="yes"}
            <a class="fancybox-buttons" data-fancybox-group="button" href="{image}" title="{caption} {if notes}({notes}){/if}"></a>
            {/exp:ce_img:pair}
     {/Custom_channel_field}

 {!-- PREPARE IMAGES FOR THE IMAGE GALLERY --}
       {Custom_channel_field}
         {if row_count == 1}
            <a class="fancybox-buttons" data-fancybox-group="button" href="{image}" title="{caption} {if notes}({notes}){/if}">{exp:ce_img:single src="{image}" disable_xss_check="yes" width="500" quality="90" allow_scale_larger="yes" class="photo"}
              {if total_rows > "1"}<p>Image Gallery ({total_rows} Images)</p>{/if}
            </a>
         {/if}
       {/Custom_channel_field}
{/if}

```

And so that works fine, but with the change to using Content Elements I'm confused. I can get all of the images to show using:

```
{!-- Content Element GALLERY --}
 {gallery}
   {if element_name=="galleryname"}

{!-- HANDLE SCALING / DISPLAY OF MAIN IMAGE --}
     {images}
         <a class="fancybox-buttons" data-fancybox-group="button" href="{image}" title="{caption}">
           {exp:ce_img:single src="{image}" disable_xss_check="yes" width="500" quality="90" allow_scale_larger="yes" class="photo"} {if total_rows > "1"}<p>Image Gallery ({total_rows} Images)</p>{/if}</a>
     {/images}

  {/if}
{/gallery}

```

So when this runs it spits out HTML that looks like:

```
<a class="fancybox-buttons" data-fancybox-group="button" href="the_image1.jpg" title="pic1">
    <img src="the_image1.jpg" class="photo" width="500" height="333" alt="" />
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image2.jpg" title="pic2">
    <img src="the_image2.jpg" class="photo" width="500" height="600" alt="" />
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image3.jpg" title="pic3">
    <img src="the_image3.jpg" class="photo" width="500" height="600" alt="" />
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image4.jpg" title="pic4">
    <img src="the_image4.jpg" class="photo" width="500" height="500" alt="" />
</a>

```

So, all of the images are displaying on the page at once and within a fancybox gallery that is linked to each other. Now where I'd like to get is where one of the images is displayed and the others display on a click to the gallery. Such as this HTML:

```
<a class="fancybox-buttons" data-fancybox-group="button" href="the_image1.jpg" title="pic1">
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image2.jpg" title="pic2">
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image3.jpg" title="pic3">
</a>

<a class="fancybox-buttons" data-fancybox-group="button" href="the_image4.jpg" title="pic4">
    <img src="the_image4.jpg" class="photo" width="500" height="500" alt="" />
</a>

```

Which when I manually edit the HTML in Firebug displays exactly what I'm trying to achieve. I have contacted KREA (creators of Content Elements) about this same issue and received an email that replied:

```
{gallery}

{if element_name == "maingallery"}

...here goes your code...

{/if}

{/gallery}

```

But I'm sure there has to be more to this.

Any feedback and suggestions of how I can properly get to this point are much appreciated.

# Answer
> 2 votes
Looks like you're just missing conditionals based on the image `{count}`. This should get you in the right direction. I didn't add in your CE Image tags.

```
 {gallery}
   {if element_name=="galleryname"}
     {images}
       {if count == 1}
         <a class="fancybox-buttons" data-fancybox-group="button" href="{image}" title="pic{count}">
           <img src="{image}" class="photo" width="500" height="500" alt="" />
         </a>
       {/if}
       {if count != 1}
         <a class="fancybox-buttons" data-fancybox-group="button" href="{image}" title="pic{count}"></a>
       {/if}
     {/images}
 {/gallery}

```

---
Tags: matrix, pixelandtonic, ce-image, image-galleries, content-elements
---


# Question
Title: Simple search form results template displays system message template
It seems I have a similar problem to the one described in this thread.

You enter a search query and get redirected to the correct URL but the page displays the system message template saying *Your search did not return any results* instead of redirecting to the no-results template.

Removing the `exp:search:search_results` tag causes the page to render correctly, but obviously without any search results in it. `{exp:search:total_results}{total_results}{/exp:search:total_results}` also shows up as 0.

So why doesn't EE redirect to the no-results template if there are no results? Although it doesn't seem to matter what I enter, I get the error message each time.

## Template code

### Form

```
{exp:search:simple_form
    channel="blog"
    no_result_page="{segment_1}/search/no-results"
    result_page="{segment_1}/search/results"
    search_in="everywhere"
    where="all"
}
<input type="text" name="keywords">
<input type="submit" value="Go">
{/exp:search:simple_form}

```

### Results

```
<p>There were <strong>{exp:search:total_results}{total_results}{/exp:search:total_results}</strong> results for a search for <em>{exp:search:keywords}</em>.</p>

<ul class="search-results">
{exp:search:search_results}
    <li>
        <a href="{auto_path}/">{title}</a>
    </li>
{/exp:search:search_results}
</ul>

```

# Answer
It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

```
if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

```

WITH

```
if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    $path = reduce_double_slashes(ee()->functions->create_url(trim_slashes($this->_meta['no_result_page'])).'/'.$hash.'/');
    ee()->security->restore_xid();
    return ee()->functions->redirect($path);
  }
}

```
> 1 votes

---
Tags: simple-search
---


# Question
Title: Simple Search returns System Message template for No Results even when 'no_result_page' set
I’m running into some issues when my users are searching using Simple Search and get no results. For some reason, they’re being redirected to a system message which is detailing they don’t have any results. However, this isn’ the correct template, and certain embeds are showing that shouldn’t be, and as a result are not rendering properly. The search form is inside of a snippet called `snip_primary_nav`, shown here:

```
<nav id="social">
    <ul>
        <li><a href="http://www.youtube.com/user/HeirloomMeals"><img src="/assets/images/youtube_16.png" alt="Youtube" width="16" height="16" /></a></li>
        <li><a href="http://twitter.com/HeirloomMeals"><img src="/assets/images/twitter_16.png" alt="Twitter" width="16" height="16" /></a></li>
        <li><a href="/rss/"><img src="/assets/images/rss_16.png" alt="RSS" width="16" height="16" /></a></li>
        {!-- <li><a href="http://www.linkedin.com/company/heirloom-meals"><img src="/assets/images/linkedin_16.png" alt="LinkedIn" width="16" height="16" /></a></li> --}
        <li><a href="http://pinterest.com/heirloommeals"><img src="/assets/images/pinterest_16.png" alt="Pinterest" width="16" height="16" /></a></li>
        <li><a href="http://instagram.com/heirloommeals"><img src="/assets/images/instagram_16.png" alt="Instagram" width="16" height="16" /></a></li>
        <li><a href="http://www.facebook.com/HeirloomMealsWithCaroleMurko"><img src="/assets/images/facebook_16.png" alt="Facebook" width="16" height="16" /></a></li>
    </ul>

{exp:search:simple_form channel="blog|shows|recipes|products" search_in="everywhere" where="all" result_page="search/" no_result_page="search/no_results" show_expired="yes" show_future_entries="yes"}

<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" />
<input type="submit" value="" class="searchbtn" />

{/exp:search:simple_form}
<div class="question-call-to-action"><span>Questions?</span><br />Call 413-298-0173</div>
</nav>

```

This is called inside of a general template, but happens on every template similarly:

```
{embed="_includes/.header"}
    <header>
{gv_logo}
{snip_ribbon}
{snip_primary-nav}
    </header>
  <div id="container">
        <div id="banner">
        <h2 id="sig">With Carole Murko</h2>
            <div id="slider">
            {lv_home_headers}
            </div>
        </div>

        <div id="content">
        <section id="col1">
            <h1>{lv_home_col1_heading}</h1>
            <div class="divide">
            {lv_home_col1_content}
            </div>
        </section>

        <section id="col2">
            <h2>{lv_home_col2_heading}</h2>
            <div class="divide">
            {exp:low_variables:parse var="lv_home_col2_content"}
            </div>
        </section>

        <section id="col3">
            <h2>News</h2>
            <article class="highlight">
            {exp:channel:entries channel="blog" limit="1" category="16" disable="member_data|pagination"}
                <h3><a href="{title_permalink='blog/'}">{title}</a></h3>{exp:replace_plus find="class=:QUOTE:highlight:QUOTE:"}{body}{/exp:replace_plus}
            {/exp:channel:entries}
            </article>
            {gv_subscribe}
        </section>
        </div>
  </div> <!-- end of #container -->
{gv_footer}
{snip_footer}

```

I thought maybe I had an open search tag like Adam Wiggall did in this post: (Incorrect no\_results page returned for simple search) but after a quick search, I don’t see any other tags that aren’t closed.

Has anyone run into this sort of issue before? My template revisions are off, using files, and templates are synced with files.

# Answer
It's a bug in EE's native Search module. Bug reported here: https://support.ellislab.com/bugs/detail/19828

Here's the fix:

Starting in line 1290 of system/expressionengine/modules/search/mod.search.php

REPLACE

```
if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
}

```

WITH

```
if ($query->num_rows() == 0 OR $query->row('total_results')  == 0)
{
  if ($query->row('no_result_page') == "")
  {
    return ee()->output->show_user_error('off', array(lang('search_no_result')), lang('search_result_heading'));
  }
  else
  {
    $path = reduce_double_slashes(ee()->functions->create_url(trim_slashes($this->_meta['no_result_page'])).'/'.$hash.'/');
    ee()->security->restore_xid();
    return ee()->functions->redirect($path);
  }
}

```
> 4 votes

---
Tags: search, system-messages
---


title: Searching 'All' Categories

text:
# Question
Title: Searching 'All' Categories
I'm using the Geofinder plugin to search for events taking place in an area.

Each Event is assigned one of five categories. The search works fine when I select a category, but I'm unsure how to get it to search all categories, leaving the value empty doesn't produce the correct results.

Here is the simple code:

```
<select name="categories[]" id="categories">
<option value="">Select All</option>
{exp:channel:categories channel="calendar_events" style="linear"}
<option value="{category_id}">{category_name}</option>
{/exp:channel:categories}
</select>

```

As I say the 'select all' doesn't work properly.

# Answer
> 1 votes
I haven't had experience with the Geofinder add-on before, however the following should work for anything that uses the Channel Entries API behind the scenes.

```
<select name="categories[]" id="categories">
    <option value="not -1">Select All</option>
    {exp:channel:categories channel="calendar_events" style="linear"}
    <option value="{category_id}">{category_name}</option>
    {/exp:channel:categories}
</select>
```

# Answer
> 0 votes
This isn't the most efficient code, but you could do this:

```
<select name="categories[]" id="categories">
  <option value="{exp:channel:categories channel='calendar_events' style='linear' backspace='1'}{category_id}|{/exp:channel:categories}">Select All</option>
  {exp:channel:categories channel="calendar_events" style="linear"}
  <option value="{category_id}">{category_name}</option>
  {/exp:channel:categories}
</select>

```

---
Tags: categories, search, geofinder
---


title: Use unique user id in url segment

text:
# Question
Title: Use unique user id in url segment
I have a simple page with a simple PayPal Buy button on the page. When a person buys an item, and completes the purchase on PayPal, they will be returned to a thank-you page.

In order to NOT have people access the thank-you page if they have not actually purchased anything, I would like to give every user a unique ID in the return url and use it as a url\_segment.

When the user returns, the url will look like www.domain.com/thank-you/34567654
In the template I could do something like:

```
{if current_id != segment_2}
  {redirect='/'}
{/if}

```

Does something like this exist?

I know how to pass the option in the PayPal return url, but can one generate a unique user id (session id) and compare it like in my example. Use it as a template var?

# Answer
My approach would be to use Stash.

On the checkout page:

```
{exp:stash:set_value
    name="checking_out" {!-- User is checking out --}
    value="1"           {!-- Store any value --}
    scope="user"        {!-- Limit this to the user's session --}
    save="yes"          {!-- Store in the database --}
    refresh="10"        {!-- Only valid for 10 minutes --}
}
```

Then check against this being stored on the thank you page:

```
{if {exp:stash:not_empty name="checking_out" scope="user"}}
    {redirect='/'}
{/if}
```
> 1 votes

---
Tags: url, sessions
---


title: Wygwam - Empty Paragraphs

text:
# Question
Title: Wygwam - Empty Paragraphs
Is there anyway to stop Wygwam from pasting empty paragraphs when i paste text into it ? It got the latest version 3.02

I got the "ignoreEmptyParagraph" thing turned on and still not working.

Thanks fro the help

# Answer
In the same setting location as "ignoreEmptyParagraph", set "autoParagraph" to NO.
> 1 votes

---
Tags: wygwam
---


# Question
Title: Multi-site manager MSM or template group
MSM or not to MSM?

I have a site where a specific member group can only access one area of the website, would I be better to use MSM or just stick with a template group?

www.mysite.com/preciousthings or www.preciousthings.com

If the member goes to www.mysite.com they will be redirected to the /preciousthings directory.

So apart from having a neater url is there any reason to use MSM over a template group, for security etc, or is it just a lot of work for not much gain?

# Answer
> 1 votes
If it's just one section, I think it's too much work (and money) for really no gain. Just add a global conditional for all pages that will redirect visitors who are logged out or in this specific member group to your /preciousthings directory.

```
{if logged_out OR logged_in_member_group_id == 7}{redirect="preciousthings"}{/if}

```

# Answer
> 0 votes
Alternatively, you can use the built-in template access control.

In **Design \> Templates \> Template Manager**. You can click the **Access** link on any template and define who can view this template, and there they are sent if they can't.

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


title: Using Master Config

text:
# Question
Title: Using Master Config
I am using this Master Config, http://eeinsider.com/articles/multi-server-setup-for-ee-2

Problem is my site now shows a server error.

Here is a pastie of my master config file.

http://pastebin.com/G2PvFFck

ERROR

```
Warning:
require(/Applications/MAMP/Development/ExpressionEngine/pixelsandcode/../config/config.master.php):
failed to open stream:
No such file or directory in
/Applications/MAMP/Development/ExpressionEngine/pixelsandcode/pixels/expressionengine/config/config.php
on line 38

Fatal error:
require():
Failed opening required '/Applications/MAMP/Development/ExpressionEngine/pixelsandcode/../config/config.master.php'
(include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php') in
/Applications/MAMP/Development/ExpressionEngine/pixelsandcode/pixels/expressionengine/config/config.php
on line 38

```

# Answer
> 1 votes
If you see this or a similar error with the double-period in the path -- `/../config/config.master.php` -- you just need to modify the following in config.master.php

REPLACE ANY OCCURRENCE OF THIS

```
require $_SERVER['DOCUMENT_ROOT'] . '/../config/config.' . ENV . '.php';

```

WITH THIS

```
require $_SERVER['DOCUMENT_ROOT'] . '/config/config.' . ENV . '.php';

```

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


title: Client Not able to Add or Edit Entry

text:
# Question
Title: Client Not able to Add or Edit Entry
I have a client that has been posting things to different channels for a while now.

Today They edited a page and that page all the sudden was not available. I went in as super admin and checked the status, entry date, and Hide From Nav (Using Structure). All were set correctly. I even Edited all those fields to the wrong setting saved and set them all back and the entry still did not show up.

I recreated the entry as Super Admin and the entry worked fine.

After the client added an entry and the same thing had happened. When I went in and manually duplicated the entry it worked fine.

Any ideas? From Twitter I am about to check on Caching and testing if it is specific to that member or member group. If I find anything I will update.

# Answer
> 1 votes
This is an odd bug that typically happens when the channel isn't assigned to a status group. So, check that.

ADMIN \> CHANNEL ADMINISTRATION \> CHANNELS \> "Edit Group Assignments" for your channel \> assign status group

---
Tags: ee2, members, structure
---


# Question
Title: Expresso Store: Is login required to place orders?
To place orders or to add the items to the cart,is login required ?

EE version: 2.6.1 Store modules version: 2.0.3

# Answer
No, you can allow users can checkout as guests.

See **Require Member Account to Place Orders** in the above link.

EDIT: added heading to clarify the intended reference.
> 3 votes

---
Tags: expresso-store
---


# Question
Title: Redirected to homepage when adding/editing custom fields
After updating the system to 2.7.2 I am no longer able to add or edit channel fields. I just get redirected to my default homepage and the form doesn't submit.

# Answer
These types of issues are typically hard to pin-point, but I'd try two things first:

1. Re-download 2.7.2 and then replace your new 2.7.2 files/folders in case there was a corrupted or missing file in there somewhere. If that doesn't work...
2. After you've backed up everything up, start disabling fieldtypes one-by-one (and even extensions) to see if there's a third party culprit.
> 1 votes

# Answer
Make sure the control panel theme directory was uploaded during the upgrade. Sounds like it may not have been or the js corrupted.
> 0 votes

---
Tags: ee2, custom-fields, ee2-upgrades
---


# Question
Title: {super_search_total_results} Does Not Parse in EE 2.6.1
Using ExpressionEngine 2.6.1 and SuperSearch 2.1.2

After upgrade the {super\_search\_total\_results} no longer parses. It outputs the following:

"{super\_search\_total\_results} Matches Found" in the HTML instead of parsing the variable.

The {super\_search\_total\_results} tag is supposed to be able to be used inside OR outside the super search loop.

Am I missing something, or is this a bug in the 2.1.2 version of Super Search?

# Answer
> 1 votes
Maybe the docs are just out of date. I found that it worked when I moved the tag within the results loop.

---
Tags: templates, supersearch
---


# Question
Title: Stash: list of related entries completed by recent entries
What I am trying to do:

* I am in an entry detail page.
* Entries have a playa field to create relationships w/ other entries
* First, I need the first 4 related entries, in the order specified by the user in the Playa field
* Then, I need to add the 4 most recent entries to that list
* Finally, I need to display the first 4 entries of that list (Playa entries + Recent entries) and filter out duplicates

3 possible scenarios

* I have no Playa entries \> display just the 4 most recent entries
* I have 4 Playa entries \> just display those
* I have a mix of Playa entries and Recent entries. In that case, Playa entries have to be displayed first in the order specified by the user

Here is what I have tried so far

```
{!-- SET Entry data --}
{exp:channel:entries disable="member_data|pagination|trackbacks" channel="articles" status="not closed" require_entry="yes" limit="1"}

    {!-- Get first 4 related items in Playa field (combined with latest article and interviews if less than 4 --}
    {exp:stash:set_list name="st_complementary_items" parse_tags="yes"}
        {exp:playa:children channel="articles|interviews" limit="4"}
            {stash:st_complementaryitem_title}{title}{/stash:st_complementaryitem_title}
        {/exp:playa:children}
    {/exp:stash:set_list}

{/exp:channel:entries}

{!-- Get last 4 published articles / interviews items (completes the list if less than 4 in the Playa field  --}
{exp:channel:entries disable="member_data|pagination|trackbacks" channel="articles|interviews" status="not closed" orderby="date" sort="desc" dynamic="no" limit="4"}

    {exp:stash:append_list name="st_complementary_items"}
        {stash:st_complementaryitem_title}{title}{/stash:st_complementaryitem_title}
    {/exp:stash:append_list}

{/exp:channel:entries}

{!-- BUILD page content --}
{exp:stash:set name="content"}

    <p>Total items in list: {exp:stash:list_count name="st_complementary_items"}</p>
    <p>Unique items in list: {exp:stash:list_count name="st_complementary_items" unique="yes"}</p>

    {!-- get the list of related items (Playa + latest if less than 4 playa), still have to make rows unique using the unique=yes parameter --}
    {exp:stash:get_list name="st_complementary_items"}
        <p>[{count}/{total_results}] - {st_complementaryitem_title}</p>
    {/exp:stash:get_list}

{/exp:stash:set}

```

That works decently well, unless I have no playa items. Then Stash acts as if I have 5 items in my list with a first one that's not parsed.

Total items in list: 5 / Unique items in list: 5

* \[1/5\] - {st\_complementaryitem\_title}
* \[2/5\] - Recent Entry title
* \[3/5\] - Recent Entry title
* \[4/5\] - Recent Entry title
* \[5/5\] - Recent Entry title

I am at loss as to why this is happening.

If I completely remove the recent entries loop and just leave the Playa loop, things work as expected and I get 0 entries.

Grateful if anyone can help me out with that.

**EDIT: Mark "The" Croxton was quick again: Stash 2.4.4 has been updated to ignore empty list items** which apparently was the problem here.

# Answer
Ok, here is how I ended up coding this in the end:

```
{!-- Extended page template --}
{stash:embed name="layouts:page"}

{!-- SET Entry data --}
{exp:channel:entries disable="member_data|pagination|trackbacks" channel="articles" status="not closed" require_entry="yes" limit="1"}

    {!-- Get first 4 related items in Playa field (combined with latest article and interviews if less than 4 --}
    {exp:stash:set_list name="st_complementary_items" parse_tags="yes"}

        {exp:playa:children channel="articles|interviews" status="not closed" limit="4"}
            {stash:st_complementaryitem_title}{title}{/stash:st_complementaryitem_title}
            {stash:st_complementaryitem_date}{entry_date format="%F %d, %Y"}{/stash:st_complementaryitem_date}
            {stash:st_complementaryitem_date_machine}{entry_date format="%Y-%m-%d"}{/stash:st_complementaryitem_date_machine}
        {/exp:playa:children}

    {/exp:stash:set_list}

{/exp:channel:entries}

{!-- Get last 4 published articles / interviews items (completes the list if less than 4 in the Playa field  --}
{exp:channel:entries disable="member_data|pagination|trackbacks" channel="articles|interviews" status="not closed" orderby="date" sort="desc" dynamic="no" limit="4"}

    {exp:stash:append_list name="st_complementary_items"}
        {stash:st_complementaryitem_title}{title}{/stash:st_complementaryitem_title}
        {stash:st_complementaryitem_date}{entry_date format="%F %d, %Y"}{/stash:st_complementaryitem_date}
        {stash:st_complementaryitem_date_machine}{entry_date format="%Y-%m-%d"}{/stash:st_complementaryitem_date_machine}
    {/exp:stash:append_list}

{/exp:channel:entries}

{!-- BUILD page content --}
{exp:stash:set name="content"}

        {!-- get the list of related items and make it unique on the titles --}
        {exp:stash:get_list name="st_complementary_items" unique="st_complementaryitem_title"}
            {if count == 1}<ul>{/if}
                <li>[{count}/{total_results}] - {st_complementaryitem_title} - {st_complementaryitem_date} - {st_complementaryitem_type}</li>
            {if count == total_results}</ul>{/if}
        {/exp:stash:get_list}

{/exp:stash:set}

```

This ends up meeting all my requirements

* Because the set\_list and append list happen in the same "oignon layer" and because the set\_list comes first in the code, the playa items are always before the recent items in the stash list
* Playa items are in the order they were entered by the user and recent items are ordered by date
* We get rid of duplicates by using the unique parameter (set on titles) on the get\_list tag pair

I first tried to use append\_lists in both cases and create a type of "playa" or a type of "recent" that I could use to sort the list when I get it to make sure playa items are always before the recent items.

But then, even using nested lists, I couldn't figure out a way of making the titles unique across the playa and recent entries.
> 1 votes

# Answer
I think you are overcomplicating things with Stash. I'd use switchee with the variable {exp:playa:total\_children}, I'd set up the cases as:

case value ="0" -\> display recent entries with exp:channel:entries

case value ="1|2|3" -\> display mix of entries I'd use stash here to retrieve the ids of playa:children and the ids of the most recent entries which I'd then put inside a channel:entries with a limit of 4.

case default (for when there are enough playa entries) -\> display playa entries only with exp:playa:children

I hope this helps.
> 1 votes

---
Tags: stash
---


title: embedding grid outputs into javascript

text:
# Question
Title: embedding grid outputs into javascript
I have a number of entries containing videos with the language options contained in an ee2.7 grid field (ie. English / Irish). I am using the following code to output each video link in a fancybox lightbox. However the code I have at present does not work for ie8 and ipads etc.

```
{parents field="related_story"}
          <div class="{switch='three columns alpha|three columns omega'}">
           <ul>
                    <li><strong>{parents:title}</strong><br>
{parents:video}<a class="fancybox-media" href="{parents:video:video_url}"
title="{parents:title}" >{parents:video:video_title}</a>  {/parents:video}</li>
                     </ul>
                     <div class="clear"> </div>
                      </div>
                     {/parents}

```

Ideally I need to have a separate piece of js for each video similar to the following which I am using elsewhere on the site to pull in specific videos:

```
$(window).load(function(){
$("a.fancybox-myths").fancybox({
  content:'<div id="videospace">Loading the Video...</div>',
  maxWidth:"100%",
  maxHeight:"100%",
  fitToView:false,
  maxwidth:"100%",
  autoSize:false,
  closeBtn:true,
  openEffect:"fade",
  closeEffect:"fade",
  scrolling:"no",
  autoDimensions:!0,
  helpers:{closeClick:!0,
    title:{type:"inside"},
    overlay:{
      locked:!1,
      css:{
        background:"rgba(40, 33, 33, 0.80)"
      }
    }
  },
  afterShow:function(){
    jwplayer("videospace").setup({
      playlist: [{file: "http://webaddress.com/assets/video/title.mp4"}],
      primary:"flash",
      autostart:true,
      rtmp:{bufferlength:5},
      width: "100%",
      aspectratio: "16:9"})
  }
})
});

```

Essentially, what I need to do is automatically output the following line of the script dynamically with each link:

```
[{file: "http://webaddress.com/assets/video/title.mp4"}],

```

Apologies, this probably sounds very complicated!

# Answer
> However the code I have at present does not work for ie8 and ipads etc.

Are you sure that this is not a JWPlayer compatibility issue? If it works everywhere else, then it's most likely not an EE-specific issue.

**UPDATE**

What if you just remove the playlist setting and put every other setting in a global script? Then you can assign the video url inside the EE tags like below. Is that what you're trying to do?

```
 {parents field="related_story"}
   <div class="{switch='three columns alpha|three columns omega'}">
     <ul>
       <li>
         <strong>{parents:title}</strong><br>
         {parents:video}
         <a class="fancybox-media" href="{parents:video:video_url}" title="{parents:title}">{parents:video:video_title}</a>
         <script>
         $(window).load(function(){
           $("a.fancybox-myths").fancybox({
             afterShow:function(){
               jwplayer("videospace").setup({
                 playlist: [{file: "{parents:video:video_url}"}]
               })
             }
           })
         });
         </script>
         {/parents:video}
       </li>
     </ul>
     <div class="clear"> </div>
   </div>
 {/parents}

```
> 1 votes

---
Tags: javascript, grid
---


# Question
Title: P & T Matrix URL Title [current] & EE 2.7.2 fatal error
Have been unable to clear this / or uninstall. Can't open FT in addons dropdown in CP

Fatal error: Class Matrix\_url\_title\_ft contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EE\_Fieldtype::display\_field) in /var/www/www.domain/system/expressionengine/third\_party/matrix\_url\_title/ft.matrix\_url\_title.php on line 166

https://github.com/pixelandtonic/matrix\_url\_title

Help is greatly appreciated

# Answer
Edit line 11 of **/expressionengine/third\_party/matrix\_url\_title/ft.matrix\_url\_title.php** to start with

```
abstract class Matrix_url_title_ft

```

Just add the word `abstract`.
> 2 votes

---
Tags: matrix
---


# Question
Title: Wygwam3.21 not initializing - ckeditor error: TypeError: u is undefined
I am finding wygwam 3.2.1 is not playing ball with EE 2.7.2 - by this i mean it's not even initializing, instead, (through console) I find I am getting a javascript error for ckeditor.js "TypeError: u is undefined"

It is a fresh install of both EE & Wygwam (and Matrix 2.5.8)

any guidance would be greatly appreciated.

# Answer
I have EE 2.7.2 and Wygwam 2.3.1 working fine, so there's no bug. Try re-importing the Wygwam directories completely replacing the current ones. There may just be a corrupted or missing file.
> 2 votes

---
Tags: wygwam
---


title: Freeform Pro: nested if statement

text:
# Question
Title: Freeform Pro: nested if statement
I'm using Freeform Pro 4.0.12.

Does exp:freeform:entries allow for nested if statements, like below?

```
{if freeform:field:yes_no_002 == "Y"}
    <tr>
        <td colspan="2"> </td>
    </tr>
    <tr>
        <td colspan="2">Person 2:</td>
    </tr>

    {if freeform:field:r_type_of_presentation == "Roundtable"}
        <tr>
             <td>Are you a moderator or Discussionist?</td>
             <td>{freeform:field:r_round_table_leaders_002}</td>
        </tr>
    {/if}
{/if}

```

I haven't been able to get this to work.

Thanks

Peter T

# Answer
Freeform uses the default EE template parser so however conditionals are parsed normally should work the same in FFP.

However the EE template parser sometimes has quirks with conditionals. Have you tried making the variables in quotes?

```
 {if "{freeform:field:r_type_of_presentation}" == "Roundtable"}

```
> 1 votes

---
Tags: solspace-freeform
---


title: Freeform notification: Get member data

text:
# Question
Title: Freeform notification: Get member data
I'm using Freeform on my website for new requests from members only. I want to create a custom notification of these requests and show member-data (custom fields they provide during registration) in these notifications. Therefore I've created a new custom notification as followed:

```
Someone has filled out form: Request
{all_form_fields}
  {field_label}: {field_data}
{/all_form_fields}

{exp:member:custom_profile_data member_id="{user_entry_id}"}
  Company: {company_name}
  Address: {address}
{/exp:member:custom_profile_data}

```

The `{user_entry_id}` variable is a hidden field in my form which is populated by the member\_id. This value gets passed on correctly.

My problem is that {user\_entry\_id} isn't parsed and the company & address data fields are empty. When I insert a member\_id manually it does work:

```
{exp:member:custom_profile_data member_id="1"}

```

However, that part should be dynamic.

Any thoughts?

# Answer
If you use the `{exp:member:custom_profile_data}` tag without any paramter it will automatically use the currently logged in member.

This also works in the email notification.
> 1 votes

# Answer
Is the field you are storing {user\_entry\_id} in a field you've actually added to Freeform itself? If not, its not going to carry over into notifications.

If you are using Freeform Pro, there is a hidden field type that you can use, which even has CURRENT\_USER (logged in member\_id) as a possible default value (at creation time).

If you are using the free version of Freeform, you can just add a text field named 'user\_entry\_id' without any other modification to your form and keep using the hidden field you are using now, and it will save the data and should carry over to notifications then as it will be a field registered with that form.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: What is the security issue that 2.7.2 solves?
I'm asking because I have roughly 30 sites, most of which were started before my tenure here, that will need to be updated if this version is as critical as they say.

It is hard for me to justify the time it will take to update all of these sites (all of which are different versions of EE as well, with different server structures, et al) without knowing how crucial this fix is.

I haven't found anything about it at EllisLab's blog or forum. Does anybody know?

# Answer
> 3 votes
Per the 2.7.2 change log:

> Addressed a security issue where XIDs may not invalidate properly.

Based on that you can make your decision. But, you're right that it's not clear how far back they see this vulnerability reaching. EE folks will always tell you to update.

---
Tags: security, update, versioning
---


title: index.php not always removed

text:
# Question
Title: index.php not always removed
I have two weird scenarios concerning index.php in my url. For the most part, it is removed from the url. The two times when index.php reappears in the url is in form return. I'm using Freeform Pro.

My form code:

```
{exp:freeform:form
   form_id="5"
   form:id="freeform"
   require_ip="yes"
   prevent_duplicate_on="email"
   return="/template_group/template/review/%%entry_id%%"
}

```

My .htaccess code:

```
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_URI} !^/system [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.+)/$ /$1 [R=301,L,QSA]
  #
  RewriteCond %{QUERY_STRING} ^(ACT=.*)$ [NC,OR]
  RewriteCond %{QUERY_STRING} ^(URL=.*)$ [NC,OR]
  RewriteCond %{QUERY_STRING} ^(CSS=.*)$ [NC]
  RewriteRule ^(.*)$ /index.php\?&%{QUERY_STRING} [L]
  #
  RewriteCond $1 !^(images|assets|bootstrap|system|upd|themes|index\.php|admin\.php) [NC]
  RewriteRule ^(.*)$ /index.php/$1 [L]
  #
  RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]\
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
  #
  #------------------- index.php -------------------
  #strip index.php/* from the URL
  RewriteCond %{THE_REQUEST} ^[^/]*/index\.php/ [NC]
  #RewriteRule ^index\.php/(.+) http://%{HTTP_HOST}/$1 [R=301,L,QSA]
</IfModule>

```

I commented out the 2nd to last line of the .htaccess code recently because it was preventing FreeMember's "forgot password" code to work.

Any help would be appreciated as I'm not a pro with .htaccess (I know, ).

Thanks!

Peter T

# Answer
It was ALL ME! I hate it when operator error is the case!

In my general preferences, the name of my sites homepage was set to index.php instead of /.

My bad! This was definitely an unnecessary post!
> 3 votes

# Answer
You have a lot going in there. To completely remove index.php for the entire site, try this:

```
<IfModule mod_rewrite.c>
  RewriteEngine On

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

```
> 1 votes

---
Tags: solspace-freeform, freemember, .htaccess
---


title: Grouping Entries in Infinite Scroll

text:
# Question
Title: Grouping Entries in Infinite Scroll
So I am building out a homepage that is going to have a infinite scroll of entries. Though there are entries that are apart of a parent entry, and I will be displaying the parent entries Title. And each child entry is a part of a week. And the week is a category set on each child entry, and the category will be visible. Below is an example.

Parent Entry Title
Week 1 - Entry 1 Entry 2 Entry 3 Entry 4 Entry 5
Week 2 - Entry 1 Entry 2 Entry 3 Entry 4 Entry 5
Parent Entry Title
Week 1 - Entry 1 Entry 2 Entry 3 Entry 4 Entry 5
Week 2 - Entry 1 Entry 2 Entry 3 Entry 4 Entry 5

I can't figure out the syntax for this so it can be displayed in an infinite scroll, but where it displays all entries while grouped. I have achieved it but it loops out the same thing 5 times.

```
{exp:channel:entries channel="foo" site="mainsite"}
    {exp:playa:parents site="mainsite"}
        {if title}
            {title}
        {/if}
        {exp:playa:children site="mainsite" field="foo_entries"}
            {title}
        {/exp:playa:children}
    {/exp:playa:parents}
{/exp:channel:entries}

```

# Answer
> 0 votes
So to achieve this I put my 5 entries in a parent entry, so I could out put the title and all the entries. And used jQuery to get the week number.

```
{exp:channel:entries channel="foo" site="bar"}
    {title}
    {exp:playa:children}
        <li class="week_7">{title}</li>
    {/exp:playa:children}
{/exp:channel:entries}

$(document).ready(function () {
        $('.week_7').wrapAll('<ul class="foobar"/>');
        $('.week_6').wrapAll('<ul class="foobar"/>');
        $('.week_5').wrapAll('<ul class="foobar"/>');
        $('.week_4').wrapAll('<ul class="foobar"/>');
        $('.week_3').wrapAll('<ul class="foobar"/>');
        $('.week_2').wrapAll('<ul class="foobar"/>');
        $('.week_1').wrapAll('<ul class="foobar"/>');
        $('.foobar').each(function () {
            var weeknum = $(this).children('li:first').prop('class');
            var weeknum = weeknum.match(/\d+/);
            $(this).prepend('<li class="week week_'+weeknum+'"><img src="/images/theme/week'+weeknum+'.png" alt=""/></li>');
        });
    });

```

---
Tags: playa
---


# Question
Title: Expresso Store - Empty cart when changing url
Since the website we're developing is "donation-only", for our specific UX design, I'd like to empty the cart every time our check-out page is left.

I tried the following code and it's working, but I would like to follow the $("nav a") link, once the cart is correctly emptied.

```
$('nav a').click(function(){
    event.preventDefault();
    $('#store input[name="empty_cart"]').trigger('click');
});

```

# Answer
Instead of trying to catch links on the page (which won't work if the customer uses their back button etc), you should use the `empty_cart="yes"` parameter on the product tag.

https://exp-resso.com/docs/product\_tag.html#empty\_cart

```
{exp:store:product entry_id="{entry_id}" empty_cart="yes"}
    <!-- form here -->
{/exp:store:product}

```

This means the cart will be emptied immediately before adding the new product to it. This means it will work with your UX design, even if the customer hits back and changes their donation amount.
> 3 votes

# Answer
You're close. You'll need to have the return value on the empty cart form ('form.empty-cart' in my example below) change to the href for the anchor.

```
$(document).ready(function(){
  $('nav a').click(function(event){
    event.preventDefault();
    var link = $(this).attr('href');
    $('form.empty-cart input[name="RET"]').attr('value', link);
    $('#store input[name="empty_cart"]').trigger('click');
  });
});

```
> 2 votes

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


# Question
Title: freeform pro 4 and honeepot, spam still coming through
I implemented honeepot (http://devot-ee.com/add-ons/hon-ee-pot-captcha) for two freeform pro forms I have on my 2.6.1 EE website and it cut down the spam drastically, but some are still getting thru.

Is there anything else that I can do to combat it?

I do not want to have the users have to fill in a captcha field to submit the form.

I tried honeepot over snaptcha because its free. What do you think of snaptcha? Is that something will cut down on spam more so than honeepot?

Thanks!

# Answer
> 2 votes
Snaptcha has some additional features over Honeepot to better prevent spam submissions. Snaptcha's "medium" and "high" settings require that javascript be enabled, which blocks spambots (they don't use JS). The "high" setting also only allows the form to be submitted once, which helps prevent multiple spam submissions.

I also highly recommend Low Nospam paired with an Akismet license. It checks every form submission against a database of known spammers and spam content. If it fails the test, the submission fails. I've never used Freeform Anti-Spam so I don't know if they conflict, though.

Another excellent free add-on is VZ Bad Behavior. This works a lot like Low Nospam in that it checks against a database of known spammers, but VZ Bad Behavior actually prevents spammers from even *viewing* your site, let alone submitting a form.

Also don't forget to check out EllisLab's recommendations for preventing spam natively.

Even with all of these options the occasional, clever human spammer will get through. But so few that it's negligible. Just add their IP address to the EE Blacklist to prevent them from posting again.

# Answer
> 1 votes
i normally also setup http://devot-ee.com/add-ons/freeform-anti-spam and http://gotolow.com/addons/low-nospam to help. However, spam allways gets through occasionally

---
Tags: solspace-freeform, forms, solspace, spam
---


# Question
Title: {exp:playa:total_children} > 1 not returning in conditional without var output
I'm trying to show data conditionally based on a relationship having more than 1 child (see below). When I output the var `{exp:playa:total_children field="cf_lookbook_products" entry_id="{entry_id}"}` anywhere in the DOM, the conditional returns true, however if I do not include it, then it returns false always. That var also returns the correct number of children.

```
{if {exp:playa:total_children field="cf_relationship_field" entry_id="{entry_id}"} > 1}
content here
{/if}

```

# Answer
Make sure you put your conditional inside of your `{exp:channel:entries ...}` tag for the `{entry_id}` to work.

If that doesn't help, what code do you have around this conditional?

UPDATE

Change your quotes to look like this

```
{if "{exp:playa:total_children field='cf_relationship_field' entry_id='{entry_id}'}" > 1}
content here
{/if}

```
> 1 votes

---
Tags: add-on, playa, pixelandtonic
---


title: Stripe Payment Gateway return error

text:
# Question
Title: Stripe Payment Gateway return error
I'm trying to process a payment with Stripe, but am getting an error after the form submits and reloads. The error is

"Sorry, there was an unexpected error communicating with the payment gateway."

I did a little digging and dumped out the exception being throw inside OrdersService.php file. The exception message says "The number parameter is required"

Any thoughts what the issue may be?

Thanks!

UPDATE: Here is the code

Checkout Page: https://gist.github.com/bryantAXS/6989698

JS: https://gist.github.com/bryantAXS/6989724 (Token created at line 315)

I can confirm the token is being created and added to the payment\[token\] field correctly before the page has submitted.

UPDATE 2: I've written a new answer below that is a temporary fix until more clarification or the source is updated.

# Answer
I've somewhat pinpointed the issue, but I'm not too sure where to start fixing it.

Essentially, the token generated on the client side which is being set to an input with the name payment\[token\] is not being recognized inside the payment processing.

Inside the file `Omnipay/Stripe/Message/AuthorizeRequest.php` file there is a if/else conditional looking for the token, however that token wasn't being found.

inside the getToken() method being called to retrieve it (line 153 of Common/Message/AbstractRequest.php) , there was the line

`return $this->getParameter('token');`

I replaced that with

`return $_POST["payment"]["token"]` And the checkout processed correctly.

Naming the form payment\[token\] is how the documentation says to set it, but there seems to be a bug somewhere there.
> 4 votes

# Answer
Store 2.x use the new Stripe.js which requires that you use `data-stripe=""` on your form elements oppose to `id=""` and `name=""`for all of your payment specific fields. Here is a stripped down version of your template:

```
<h4>Payment Information</h4>

<label>Name</label>
<input data-stripe="name" type="text" placeholder="">

<label>Credit Card Number</label>
<input data-stripe="number" type="text" placeholder="">

<label>Expiration Month</label>
<div class="select-wrapper">
<span class="select-text">January</span>
<span class="ss-dropdown"></span>
<select data-stripe="exp-month" id="payment_exp_month" class="hidden-dropdown">
  <option value="01" data-text="January">January</option>
  <option value="02" data-text="February">February</option>
  <option value="03" data-text="March">March</option>
  <option value="04" data-text="April">April</option>
  <option value="05" data-text="May">May</option>
  <option value="06" data-text="June">June</option>
  <option value="07" data-text="July">July</option>
  <option value="08" data-text="August">August</option>
  <option value="09" data-text="September">September</option>
  <option value="10" data-text="October">October</option>
  <option value="11" data-text="November">November</option>
  <option value="12" data-text="December">December</option>
</select>
</div>

<label>Expiration Year</label>
<div class="select-wrapper">
<span class="select-text">2013</span>
<span class="ss-dropdown"></span>
<select data-stripe="exp-year" id="payment_exp_year" class="hidden-dropdown">
  <option value="2013" data-text="2013">2013</option>
  <option value="2014" data-text="2014">2014</option>
  <option value="2015" data-text="2015">2015</option>
  <option value="2016" data-text="2016">2016</option>
  <option value="2017" data-text="2017">2017</option>
  <option value="2018" data-text="2018">2018</option>
  <option value="2019" data-text="2019">2019</option>
  <option value="2020" data-text="2020">2020</option>
</select>
</div>

<label>Card Verification Number</label>
<input data-stripe="cvc" type="text" placeholder="">

<input type="hidden" id="payment_token" name="payment[token]" value="" />
<input type="hidden" name="payment_method" value="stripe">

```

Once you do that you will need to update your JS to use the new store.js. In its most basic form you will need the following:

```
$(function() {
    $.getScript('https://js.stripe.com/v2/', function() {
        Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY_HERE');
    });

    /* Ensure your checkout submit button has id="checkout_submit" */
    $checkout_submit = $("#checkout_submit").click(function() {

        /* Only handle requests for Stripe gateway */
        if (this.form.elements["payment_method"].value == "stripe") {

            /* Temporarily disable the checkout submit button */
            $checkout_submit.attr('disabled', true);

            /* Create a Stripe card token */
            Stripe.card.createToken($(this.form), stripeResponseHandler);

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

    /* This function is triggered once Stripe has generated the token */
    function stripeResponseHandler(status, response) {
        /* Re-enable the checkout submit button */
        $checkout_submit.attr('disabled', false);

        /* Check whether we have a valid credit card */
        if (response.error) {
            alert(response.error.message);
        } else {
            /* Set the card token and submit the checkout form */
            $("#payment_token").val(response.id);
            $checkout_submit.off("click").click();
        }
    }
});

```

Once you have that working you can use the Stripe docs to add any additional functionality that you want.
> 2 votes

# Answer
This has been fixed in Store 2.0.4:

> Fixed an error with Stripe gateway where card token was not submitted correctly

Per Bryant's answer, in Store 2.0.3 the card token was not being correctly passed through to Stripe which meant the payment was unsuccessful.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Exp:resso Store: Setting discount expiry date / time - Store v2
On Expresso Store v2 you have the option to set an expiry date for a promo / discount code. Unfortunately, whilst the setting represents a date and time the Javascript picker only lets you select the date - it automatically selects the current time. Attempting to manually edit the time in the text field doesn't work.

As the discount code did expire on the precise time (not just date) that was selected its probably important to allow people to edit the time too!

Thanks

T

# Answer
This has been fixed in Store 2.0.4 which was released today:

> Fixed ability to edit time manually in datetime fields in the control panel

You can now manually edit the time after selecting the date you need.
> 2 votes

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


title: Include size "0" in Store

text:
# Question
Title: Include size "0" in Store
My client runs a women's clothing store where they need to enter size "0" for some of the items. However, it seems like Store interprets this entry as an empty field and does not allow it as an option in the modifier field. As a workaround we've used size "00", but I've been told that "00" and "0" are actually 2 different sizes in women's clothing.

We're running Store 1.6.1.

# Answer
> 1 votes
I was able to recreate the issue on a site that I have too, this seems like a bug or oversight in how 0 & null are handled.

You can use `0 ` or `'0 '` in the option portion to get it to work without having to use 00 which would be a different size. Inserting either an actual space or the html for a forced space will cause Store to create it as a modifier.

# Answer
> 0 votes
This has been fixed in Store 2.0.4 which was released today:

> Fixed product options named 0 being treated as empty

You can now create product options named "0" and they will not disappear or be treated as an empty string.

---
Tags: expresso-store
---


title: Why is EE not autosaving?

text:
# Question
Title: Why is EE not autosaving?
I have got editors who often have an entry open around 30minutes before saving. I have turned on autosaving in the config.php file and this is also reflected in the config edotr in the control panel:

```
$config['autosave_interval_seconds'] = '5'; // to test I have set this to 5 seconds
$config['autosave_prune_hours'] = '8';

```

I have tried to research this problem but I can't find anything helpful.

Am using ExpressionEngine v2.5.2 (this is a multi site).

Any help is appreciated, Thanks

# Answer
> 2 votes
I can see no one answered this for you. I'm having issues with autosave, maybe my explanation about how it works will answer your question. Maybe the issue I'm having is the same?

autosave does not work as expected. Specifically RTE and WYGWAM

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


# Question
Title: How do I capture *all* data from a White Screen
I have a live e-commerce site which is seemingly random (in that all the reports appear to be different) error where, at some point, during the checkout process, the entire thing gives up and I get a white screen of death.

I can't enable debugging (at least verbosely) on this site, but I'd like to be able to capture all of the EE and Session Data (either in a text file, third party service or simply email dump it all to me) and then instead of the white screen, I'd like to present the user with a 'Sorry somethings broken, but we've been notified and we'll look into it!' kind of message.

What are my options here? Whats the best way to get this kind of information out of EE? It's an older version of EE (v 2.5.3), with add-ons which have had custom hacks on them so none of it can be upgraded (the site is in fact being rebuilt, but is 2-3 months off completion).

The client naturally doesn't want to spend a huge amount of time debugging a somewhat impossible bug, but in the same respect we have no idea how many orders are being lost to this random issue.

Thanks!

# Answer
> 4 votes
You can log errors to a file using php\_value error\_log in your .htaccess file:

https://stackoverflow.com/questions/11330041/specify-a-relative-path-to-php-value-error-log

Here's a recommended .htaccess setup:

```
php_flag display_errors 1
php_flag display_startup_errors 1
php_value error_reporting 30719
php_value error_log /home/USER/log/PROJECT.log
php_flag log_errors 1

```

You could also add something like this at the top of index.php to help provide context:

```
error_log($_SERVER['REQUEST_METHOD'] . ' ' . $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : ''));

```

As for handling the white screen itself - try wrapping a try/catch around the require\_once at the bottom of index.php. The catch block could then be used to display a more friendly message.

# Answer
> 1 votes
I'd suggest turning on CodeIgniter logging. In your config.php file set the value for $config\['log\_threshold'\].

```
0 = Disables logging, Error logging TURNED OFF
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages

```

You'll need to also create the /system/logs/ folder and set it to be writable. You can overwrite the location by setting the $config\['log\_path'\] in your config file.

Don't forget to turn logging off when you're done.

---
Tags: php-errors, debugging, white-screen-of-death
---


title: Solspace Favorites for members only?

text:
# Question
Title: Solspace Favorites for members only?
I guess I should have read that properly but is there no way to enable Solspace Favorites to work with cookies only – not requiring membership??

# Answer
> 1 votes
Correct, it only works for logged in members. For a cookie-based favorite-type functionality you can use Shortlist.

# Answer
> 0 votes
Try remember-me \- its free and function inside is enough for build favorite functions.

---
Tags: solspace
---


# Question
Title: Search's no_result_page works only sometimes
I have this Simple Search Form in my site that looks like this (simplified for the problem's purpose):

```
{exp:search:simple_form channel="news" name="recherche" no_result_page="s/e" result_page="s" results="32" search_in="everywhere" status="open" where="any"}
    <input type="search" id="search" name="keywords" placeholder="Search" autocomplete="on" maxlength="35" value="{exp:search:keywords}">
    <input type="submit">
{/exp:search:simple_form}

```

When I search for something that *I know doesn't exist*, such as "askjdakjsbfkub", I get redirected to the "s/e" template correctly, displaying an appropriate "no results" message.

However, when I enter a different term that *I know still doesn't exist*, such as "test", I get redirected to the ugly, god-forsaken default message (pardon my french, literally):

Can somebody explain that weird behavior? Better yet, anyone has a solution for this one?

# Answer
When you search for something that does have a search result, are you redirected to the correct search results page? You are searching everywhere , search\_in="everywhere", which includes comments and all other fields. Could it be possible that "test" was somewhere else in there?

Also, your result\_page parameter is set to "s", you might need to try and set it to "s/index".
> 1 votes

# Answer
After you, other people were asking the same thing. An answer has been found and reported here: Simple Search returns System Message template for No Results even when 'no\_result\_page' set
> 0 votes

---
Tags: search, simple-search
---


# Question
Title: Database Error - Unable to connect to your database server using the provided settings
My site won't show up (white screen of death). When I try to access the control panel, I am setting this error:

```
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/EE_Config.php
Line Number: 207

```

# Answer
Broadly speaking, as the error says, you are not connecting to your database. So, check to make sure everything is "plugged in" properly.

Things to check:

**/expressionengine/config/database.php**
\- file exists
\- triple check you are using the correct database info for your current server/environment (host, username, password, and database name)
\- file has proper permissions (chmod 666)
\- /config/config.php is setup properly and with proper permissions (chmod 666)

**Run a connection test**

In /system/expressionengine/utilities there's a file called dbtest.php. Fill out the top 4 variables and place it at your web root directory so you can view it online (eg, http://mysite.com/dbtest.php). The result should prove helpful.

If you see "Unable to select your database" make sure the database actually exists on the server and that the user has permission to access that specific database.

If you are still "Unable to connect to your database server," you'll have to dig deeper.

**Still unable to connect to server**

If you are running locally, it may have to do with where your MySQL is installed. Check this out.

If you are on a server (especially a shared server), check with your hosting provider. They may be experiencing a temporary outage or be able to help you find a solution.
> 12 votes

---
Tags: error, white-screen-of-death, database-error
---


# Question
Title: If/else conditional based on categories to choose a freeform form
I'm trying to show a contact form based on the category that an entry is a member of, i'm using the freeform plugin to generate forms and then have a category group (an id of 7) with three categories in (ids of 41,42,43).

Here's the current code:

```
           {exp:channel:entries}
             {categories show_group="7"}
                {if "{category_id}" == "42"}
                  {exp:freeform:form form_id="6" return="thanks/index"}
                {/if}
                {if "{category_id}" == "41"}
                  {exp:freeform:form form_id="7" return="thanks/index"}
                {/if}
                {if "{category_id}" == "42"}
                  {exp:freeform:form form_id="8" return="thanks/index"}
                {/if}
              {/categories}
{freeform:all_form_fields}
                    <div class="field-group type-{freeform:field_type} field-{freeform:field_name}">
                      <label>{freeform:field_label}</label>
                      {freeform:field_output}
                    </div>
                  {/freeform:all_form_fields}
                  <p>{freeform:submit}</p>
              {/exp:freeform:form}
            {/exp:channel:entries}

```

This however is simply trying to output all three forms and only showing the first one on every page no matter which categories they are assigned to. Any ideas how I should go about this? I'm guessing it's parsing the freeform tag before the conditional at the moment but not sure how to fix it?

# Answer
You need to make sure all data of `exp:channel:entries` is parsed before `exp:freeform`. This is almost exactly the point of the sample code in docs about `parse="inward"`.

Try this, please:

```
{exp:channel:entries parse="inward"}
    {categories show_group="7"}
        {if "{category_id}" == "42"}
            {exp:freeform:form form_id="6" return="thanks/index"}
        {if:elseif "{category_id}" == "41"}
            {exp:freeform:form form_id="7" return="thanks/index"}
        {if:elseif "{category_id}" == "42"}
            {exp:freeform:form form_id="8" return="thanks/index"}
        {/if}
    {/categories}
                {freeform:all_form_fields}
                    <div class="field-group type-{freeform:field_type} field-{freeform:field_name}">
                    <label>{freeform:field_label}</label>
                    {freeform:field_output}
                    </div>
                {/freeform:all_form_fields}
                <p>{freeform:submit}</p>
            {/exp:freeform:form}
{/exp:channel:entries}

```

This code just works because all conditionals are related to `exp:channel:entries`, so they can be parsed in the right order.

I changed the conditionals to `elseif` to prevent the case of some user to chose more than one category.
> 2 votes

---
Tags: categories, conditionals, solspace-freeform
---


# Question
Title: Getting {switch='A|B'} to work within relationship tag
I have the following code:

```
  {staff_member_groups}
    <h2>{staff_member_groups:staff_group_heading}</h2>
    <ul class="staff_member_groups">
      {staff_member_groups:staff_group_members}
        <li class="{switch='odd|even'}">
          <img src="{staff_member_groups:staff_group_members:staff_portrait}">
          <h3>{staff_member_groups:staff_group_members:title}</h3>
          <p class="meta">
            {staff_member_groups:staff_group_members:staff_position}
          </p>
          <p>
            {staff_member_groups:staff_group_members:staff_titles}
          </p>
        </li>
      {/staff_member_groups:staff_group_members}
    </ul>
  {/staff_member_groups}

```

which renders correctly except for the fact that `{switch='odd|even'}` returns `odd` on every list item. Is there a way to get this functionality while looping through a relationship tag?

**Edit:** I should clarify: `{staff_member_groups}` is a grid field, with `{staff_member_groups:staff_group_members}` being the relationship field within the grid field.

**Edit #2:** I’ve found the solution (still new around here, SE won’t let me answer my own questions really quickly yet). `{switch='odd|even'}` needs to be namespaced so that it switches within the context of the relationship field, like so: `{staff_member_groups:staff_group_members:switch='odd|even'}`. Otherwise, `{switch='odd|even'}` is going by the larger context of the entries tag that surrounds this template.

For clarity, my final block of code looks like this:

```
  {staff_member_groups}
    <h2>{staff_member_groups:staff_group_heading}</h2>
    <ul class="staff_member_groups">
      {staff_member_groups:staff_group_members}
        <li class="{staff_member_groups:staff_group_members:switch='odd|even'}">
          <img src="{staff_member_groups:staff_group_members:staff_portrait}">
          <h3>{staff_member_groups:staff_group_members:title}</h3>
          <p class="meta">
            {staff_member_groups:staff_group_members:staff_position}
          </p>
          <p>
            {staff_member_groups:staff_group_members:staff_titles}
          </p>
        </li>
      {/staff_member_groups:staff_group_members}
    </ul>
  {/staff_member_groups}

```

# Answer
I’ve found the solution: `{switch='odd|even'}` needs to be namespaced so that it switches within the context of the relationship field, like so:

`{staff_member_groups:staff_group_members:switch='odd|even'}`

Otherwise, `{switch='odd|even'}` is going by the larger context of the entries tag that surrounds this template.

For clarity, my final block of code looks like this:

```
  {staff_member_groups}
    <h2>{staff_member_groups:staff_group_heading}</h2>
    <ul class="staff_member_groups">
      {staff_member_groups:staff_group_members}
        <li class="{staff_member_groups:staff_group_members:switch='odd|even'}">
          <img src="{staff_member_groups:staff_group_members:staff_portrait}">
          <h3>{staff_member_groups:staff_group_members:title}</h3>
          <p class="meta">
            {staff_member_groups:staff_group_members:staff_position}
          </p>
          <p>
            {staff_member_groups:staff_group_members:staff_titles}
          </p>
        </li>
      {/staff_member_groups:staff_group_members}
    </ul>
  {/staff_member_groups}

```
> 4 votes

---
Tags: templates, relationships, switch
---


# Question
Title: Assets Unable to Load S3 Buckets; No Error Message
When loading the buckets for a new S3 source, Assets is failing silently (no buckets listed in select box, no error message), despite correct S3 credentials.

# Answer
> 1 votes
Enabling cURL in PHP resolved this issue.

---
Tags: assets, s3
---


# Question
Title: User session ending when clicking on a link
I have a site with a login form on the front end for the user to log into the site. The login works ok, but when they click on any link to another page, their session ends and they get logged out. This is an issue as I have {if logged\_in} tags in various parts of the site.

I'm using EE 2.2.2 and I have set the Session type Session ID only. Setting any other session type dosn't allow them to log in at all.

Thanks,

# Answer
> 3 votes
This is an old bug that caused a lot people problems. You can read the lengthy bug report here: https://support.ellislab.com/bugs/detail/17423

Bottom line: you'll need to update to the latest version of EE

---
Tags: sessions
---


title: Accessing nested data in templates

text:
# Question
Title: Accessing nested data in templates
I'm trying to use a template to parse through nested data, but some of the child data has the same variable names as the parent. In the example below I'd like to print a list of shows and then a list of the episodes for each show, but the id, title, & description are parsed and given the parent data.

```
$data = array(
    array(
        'id' => 1,
        'title' => 'LOST',
        'description' => 'Best. Show. Ever',
        'episodes' => array (
            array (
                'id' => 1001,
                'title' => 'Pilot',
                'description' => 'The one where the plane crashes.'
            ),
            array (
                'id' => 1002,
                'title' => 'Dr. Jack',
                'description' => 'Jack saves everyone.'
            )
        ),
    ),
    array(
        'id' => 2,
        'title' => 'Seinfeld',
        'description' => 'Funniest. Show. Ever',
        'episodes' => array (
            array (
                'id' => 2001,
                'title' => 'Pilot',
                'description' => 'The one where it wasn\'t funny yet.'
            ),
            array (
                'id' => 2002,
                'title' => 'Kramer',
                'description' => 'Kramer isn\'t that funny yet either.'
            )
        ),
    ),
);

$tags = '<h1>{title}</h1>
<p>{description}</p>
<h2>Episodes:</h2>
<ul>
{episodes}
<li><em>{id}: {title}</em> {description}</li>
{/episodes}
</ul>';

$output = $this->EE->TMPL->parse_variables( $tags, $data );

echo $output;
?>

```

This generates the output below:

```
<h1>LOST</h1>
<p>Best. Show. Ever</p>
<h2>Episodes:</h2>
<ul>

<li><em>1: LOST</em> Best. Show. Ever</li>

<li><em>1: LOST</em> Best. Show. Ever</li>

</ul><h1>Seinfeld</h1>
<p>Funniest. Show. Ever</p>
<h2>Episodes:</h2>
<ul>

<li><em>2: Seinfeld</em> Funniest. Show. Ever</li>

<li><em>2: Seinfeld</em> Funniest. Show. Ever</li>

```

How can I access the episode data? If the field names are different it works just fine, but this data is coming from a web service that is not easily changed.

# Answer
> 1 votes
Why are you using PHP to output your data?

I know you can attempt this with Playa, and a couple channels.

---
Tags: templates, parse-order
---


title: Site Hacked, No Original Email

text:
# Question
Title: Site Hacked, No Original Email
I have a slight issue.. Actually a major one!

The site I am working on is built in expression engine and it was hacked and whoever has done it has changed the password and the client has no idea what the original email is when the site was first built.

Is there any way at all I can get into the backend of the website?

Hoping someone can help!

Thanks!

# Answer
> 11 votes
Do you have access to the `MySQL` database? If so, you can change the admin's email and initiate a password reset at the login screen.

---
Tags: security, admin
---


# Question
Title: Relationship tag: link to different channels
I have a relationship field which allows the editor to choose entries from different channels (channels `about` & `news`), and a few channels I have set up for Pages (with a Page URI). How can I make the template generate an appropriate URL for each entry? That is: how can I get it to link to `/about/{url_title}` for an about sub-page, `/news/{url_title}` for a news entry, and `{pages_uri}` for a page?

I think I can probably create a switchee scheme to create the link programmatically on the template depending on the case, but I wonder if there’s an EE tag for this.

# Answer
> 2 votes
I think you're on the right track with switchee, and something like the following should work:

```
{your_relationship_field}
    {exp:switchee variable="{your_relationship_field:channel}" parse="inward"}

        {case value="news"}
            <a href="{url_title_path='news/entry'}">{your_relationship_field:title}</a>
        {/case}
        {case value="about"}
            <a href="{url_title_path='about/entry'}">{your_relationship_field:title}</a>
        {/case}

        {case default="yes"}
            <a href="{your_relationship_field:page_url}">{your_relationship_field:title}</a>
        {/case}

    {/exp:switchee}
{/your_relationship_field}

```

# Answer
> 0 votes
One other option would be to use a switch only between channel entry versus page entry, as long as you have set up your channel entry comment template path setting in your channel settings. With that set in each channel, you can use the variable {comment\_url\_title\_auto\_path} for channel entries, and your page url for the page entries. That would simplify your conditional somewhat, though with switchee, that may not be necessary.

---
Tags: templates, relationships, tags, links
---


title: Upload file via channel form

text:
# Question
Title: Upload file via channel form
I am trying to set up a form on the front-end with channel:form but it doesnt behave.

channel-form-file-upload http://supinum.com/bilder/channel-form-file-upload.png

Clicking the 'Undo Remove'-link or the 'close-x' on the thumbnail does nothing but add a # to url.

What is this form lacking? Javascript? css? query? ACTurl-something?

This works perfectly on a simple local install. There I can reproduce this error by unchecking 'Generate HTTP Page Headers?' in 'Output and Debugging Preferences' But doing this backwards doesnt help me on the more complex live site.

What should I look for?

/thanks, David

```
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>upload files</title>
</head>
<body>
{exp:channel:form channel="formchannel" return="thank/you"}
<div class="row">
    <div class="large-12 columns">
        Title<br /><input name="title" type="text">
        Photo<br />{field:photo}
    </div>
</div>

{/exp:channel:form}

</body>
</html>

```

### Screendump of error message in Safari:

Screendump of error message in Safari http://supinum.com/bilder/channel\_form\_error\_log.png

# Answer
I've had issues with the 2.7 upgrade not deleting Safecracker properly.

First, check the Modules and Extensions areas of the control panel. If you see Safecracker there, make sure it is uninstalled / disabled.

Then look in system/expressionengine/modules directory and see if there is a safecracker directory. After completing the steps above, you can safely remove that directory.
> 2 votes

# Answer
I just had this solved by Jeremy Worboys on another thread (Can I see the most basic example of a File field in Channel Form (Safecracker)?). I had WYGWAM Entries installed, which created a button that caused a fatal JS error. (Repaired it via the exp\_html\_buttons table.) THEN my jQuery was too high of a version; downgrading to 1.8.3 fixed the visual abnormalities ("x" not working, for example).
> 2 votes

---
Tags: channel-form
---


# Question
Title: Information not displaying in Playa field
I'm unable to get any relationship information to display within my Playa field. I'm using ExpressionEngine 2.5.2 with Playa 4.0.5 installed and my license key input. I have an information selected within my channel entry in the Playa field.

My playa field is titled "testplaya2" and here is the code that I'm using to display the playa information:

```
 {exp:channel:entries  channel="tours" limit="1" url_title="{segment_2}" status="open|hidden" show_future_entries="yes" show_expired="yes"}
 <div class="section">
    {testplaya2}
        {title}
    {/testplaya2}
 </div>
 {/exp:channel:entries}

```

Am I missing something?

# Answer
> 1 votes
Is the entry that you've selected in the Playa field expired? Playa defaults to no for show\_future\_entries and show\_expired.

---
Tags: playa, pixelandtonic, fieldtype
---


title: Table 'exp_accessories' already exists

text:
# Question
Title: Table 'exp_accessories' already exists
I try to import a ee db into my local environement and I get this Error:

> SQL-Befehl:
>
> ## -- --------------------------------------------------------
>
> -- Tabellenstruktur für Tabelle `exp_accessories` -- CREATE TABLE `exp_accessories` (
>
> `accessory_id` INT( 10 ) UNSIGNED NOT NULL AUTO\_INCREMENT , `class` VARCHAR( 75 ) NOT NULL DEFAULT '', `member_groups` VARCHAR( 50 ) NOT NULL DEFAULT 'all', `controllers` TEXT, `accessory_version` VARCHAR( 12 ) NOT NULL , PRIMARY KEY ( `accessory_id` ) ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO\_INCREMENT =8;
>
> MySQL meldet:
>
> # 1050 - Table 'exp\_accessories' already exists

I have absolutely no clue about db files what do I have to do?

# Answer
Okay I found the error. The new db didn't have the same name as the old one so I deleted the lines:

```
CREATE DATABASE IF NOT EXISTS `db_name` DEFAULT CHARACTER SET
latin1 COLLATE latin1_swedish_ci; USE `db_name`;

```

Now it works. But that's not what the error said. Is it possible to disable this line directli in the export window of phpMysql?
> 1 votes

# Answer
Looks like this is possibly a bug in your phpmyadmin version: http://sourceforge.net/p/phpmyadmin/bugs/4019/.

The create database code shouldn't be added with the default export.
> 0 votes

---
Tags: database
---


title: Strange text with Wygwam

text:
# Question
Title: Strange text with Wygwam
I update a site to EE2.7.2 and Wygwam to 3.2.1. When I copy text form Open Office and paste it as plain text in Wygwam I always get this "extra" text at the top:

Version:1.0 StartHTML:0000000167 EndHTML:0000000922 StartFragment:0000000454 EndFragment:0000000906

When I was using EE2.5.3 with Wygwam 2.6.3 I never got this strange text.

Francois

# Answer
Have you looked at the WYGWAM Edit Configuration page for that particular WYGWAM config, and chose under Advanced Settings \> forcePasteAsPlainText AND pasteFromWordRemoveStyles? That they're both set to Yes?

However, doing this means EVERY copy-paste you ever do from wherever will be copy-pasted as plain text.
> 1 votes

---
Tags: pixelandtonic, wygwam, expresso-toolbar
---


# Question
Title: ReferenceError: EE is not defined error on page with Grids
I am on EE 2.7.2

Here is my channel form tag that has grid data

```
{exp:channel:form
    channel="xxxxx"
    class="form-horizontal"
    datepicker="no"
    dynamic_title="[email]"
    edit_member="yes"
    entry_id="{embed:entry_id}"
    error_handling="inline"
    id="basic_information"
    include_assets="yes"
    include_jquery="yes"
    member_id="CURRENT_USER"
    rules:profile_name="required"
    rules:user_provided_address="required"
    return="/xxxxx/"
}

```

In the page I am using Grid, I have tried doing various permutations of `include_assets` and `include_jquery` to make an JS error go away because it blocks Grid from working properly(Grid relies on JS)

**CASES**

* **`include_assets="yes"`, `include_jquery="yes"`**

I have this JS error in the console

```
ReferenceError: EE is not defined

```

This is the script being included

```
 http://xxxxx.com/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,sortable,button,dialog&plugin=markitup,toolbox.expose,overlay,tmpl&file=cp%2Fsort_helper,cp%2Fgrid,underscore&v=1381722060&include_jquery=y

```
* **`include_assets="yes"`, `include_jquery="no"`**

I have this JS error in the console

```
ReferenceError: jQuery is not defined
ReferenceError: jQuery is not defined

```

This is the script being included

```
http://xxxxx.com/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,sortable,button,dialog&plugin=markitup,toolbox.expose,overlay,tmpl&file=cp%2Fsort_helper,cp%2Fgrid,underscore&v=1381722060

http://xxxxx.com/themes/third_party/mx_lonestar/js/jquery.mx_lonestar.min.js

```
* **`include_assets="no"`,`include_jquery="yes"`**

I have this JS error in the console

```
ReferenceError: EE is not defined

```

This is the script being included

```
http://xxxxx.com/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,sortable,button,dialog&plugin=markitup,toolbox.expose,overlay,tmpl&file=cp%2Fsort_helper,cp%2Fgrid,underscore&v=1381722060&include_jquery=y

```
* **`include_assets="no"`,`include_jquery="no"`**

I have this JS error in the console

```
ReferenceError: jQuery is not defined
ReferenceError: jQuery is not defined

```

This is the script being included

```
http://xxxxx.com/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,sortable,button,dialog&plugin=markitup,toolbox.expose,overlay,tmpl&file=cp%2Fsort_helper,cp%2Fgrid,underscore&v=1381722060

http://xxxxx.com/themes/third_party/mx_lonestar/js/jquery.mx_lonestar.min.js

```

**NOTE**: There is a jquery script at the bottom of the page included

```
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

```

Is there any solution to this problem? I have tried to debug this for a week already but to no avail.

# Answer
*There is a jquery script at the bottom of the page include*

I believe this is the reason - you need to load your jquery library before other scripts.

p.s. this answer has good solution what you can do in this case
> 1 votes

# Answer
**Add include\_jquery="no" to the tag and move your jQuery from the footer to the header.**

From this answer on StackOverflow...

"make sure that you are not loading any plugins before you load jQuery. Plugins extend the "$" object, so if you load a plugin before loading jQuery core, then you'll get the error you described."
> 0 votes

---
Tags: javascript, jquery, grid
---


# Question
Title: Blank retrieve password page after 2.5.5 > 2.7.2 update
When i click on the link to reset the password, I get a blank page. How can I debug this?

The reset link is something like that: http://mysite.com/?ACT=14&id=Rr2Z8OrG

thank you

# Answer
> 1 votes
The forgot password process was **changed in EE 2.6**.

> With ExpressionEngine 2.6 comes a much-improved experience for resetting a forgotten password. Users will be sent a single email with a link to a new password form. This lets the user decide what their new password will be, rather than having the system send a new, plain-text password in a second email. After filling in a new password, users will be able to login straight away and get right back to work!

EE uses the standard **Member Profile** and the **Messages** templates for this flow and the password reset link is valid for 24 hours.

I can't tell you where in the process your setup is broken but sounds like the user isn't getting to the correctly place for the new password reset process. I'd start by checking to make sure you have member templates loaded to the server.

# Answer
> 1 votes
Is this on the front end or the backend? The front end system changed the forgot password functionality recently to use a password reset form on the front end that relies on the member templates (yuck). The idea was that instead of sending a random general password a user could reset their password with a form after validating an email link.

# Answer
> 0 votes
The reset link from the CP should be something like:

> http://www.site.com/system/index.php?S=0&D=cp&C=login&M=forgotten\_password\_form

Sounds like the upgrade process didn't complete 100%. I would try uploading the 2.7.2 files again and run the upgrade process again.

---
Tags: password
---


# Question
Title: Specify a valid entry to edit - Safecracker Error
I've run into this before, however, for whatever reason I can't seem to resolve it this time. Whenever I submit my safecracker form below, I receive the following error:

*The form you submitted contained the following errors You must specify a valid entry to edit.*

My hidden fields show the correct entry\_id, etc. What am I doing wrong?

```
{if segment_4=="issue"}

{if segment_6 == "success"}
    <div class="alert fade in">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>Success</strong> Issue has been updated.
    </div>
{/if}

{exp:safecracker
limit="1"
channel="issue"
return="/myfig/{segment_2}/edit/issue/ENTRY_ID/success"
datepicker="yes"
include_jquery="no"
entry_id="{segment_5}"
safecracker_head="no"
error_handling="inline"
use_live_url="no"
author_only="no"
}

    <label>Title</label>
    <input type="text" name="title" id="title" value="{title}" /><br />

    <label>Rate</label>

    <div class="input-prepend">
        <span class="add-on">$</span>
        <input type="text" name="rate" id="rate" value="{rate}" />
    </div>
    <label>Publish Date</label>
    <input type="text" name="publish_date" id="publish_date" value="{exp:low_nice_date date='{publish_date}' format='%m/%d/%Y'}" /><br />
    <label>Date Signed</label>
    <input type="text" name="date_signed" id="date_signed" value="{exp:low_nice_date date='{date_signed}' format='%m/%d/%Y'}"><br />

    <input type="submit" class="btn btn-success" value="Update" />

{/exp:safecracker}

```

# Answer
Could the `lmit="1"` parameter be causing problems?
> 1 votes

---
Tags: safecracker, error
---


title: Safecracker file extensions

text:
# Question
Title: Safecracker file extensions
I'd like to lowercase filename & extension on file upload with safecracker. Does someone know where to find the pre-uploading bit in the code?

I've played around with the core set\_filename method, but that only seems to affect the temp\_ filenames.

Thanks in advance!

# Answer
> 1 votes
I was using an add-on to do something similar. However it broke when I upgraded from 2.4.0 to 2.5.3. See thread: Safecracker File: Rename on Upload

---
Tags: safecracker, safecracker-file
---


title: EE Freemember register with multi lang?

text:
# Question
Title: EE Freemember register with multi lang?
I'm having some trouble using FreeMember and Transcribe. It seems like the member register posts the action to the site url.

However, if the site url includes a language prefix the page seems to just refresh, doesn't register a new member and doesn't return to the allocated return page.

eg.. www.site.com/form/fr/ will fail. With transcribe (language prefix) disabled it does work.

Thanks for any help!

# Answer
Freemember forms simply post to the current URL, with an `ACT` parameter which tells EE which action to perform. I doubt Transcribe itself is interfering too much with this process.

I'd be willing to bet though that you have some sort of htaccess rule or extension which is redirecting the form submission to a different URL, and in the process losing the POST data.

You can check this by looking at the Chrome/Firebug network tab and checking what response the POST request gets.
> 1 votes

---
Tags: freemember, transcribe
---


title: Tracking users "most clicked"

text:
# Question
Title: Tracking users "most clicked"
I'm looking for a way to track (hopefully non-logged in) users most viewed items. I found a few helpful addons, but the closest I could get is determining that users most recent views, or how many times they viewed a certain page via cookie. I'd like to eventually be able to take the "most viewed" information and put a few if statements to order the content shown to put the stuff they view the most up top. Does anyone have any experience in something like this? Or if someone could point me in the right direction I would greatly appreciate it!

Thanks!

# Answer
You can track visits to your single entry pages with the **Entry “Views” Tracking Tag**.

> ExpressionEngine lets you track how many times a channel entry has been “viewed” on a particular page. Up to four different instances of the view counter can be used (each on a different page), enabling you to track different aspects of an entry independently. For example you can use view counter “one” to track views on your comments page and view counter “two” to track views on your permalink page.
>
> **Note** The view tracking counter works in conjunction with the {exp:channel:entries} tag. Although you can show the number of views in any instance of your channel entries tag, the counter will only increment on pages that show a single-entry pages. Single entry pages are ones that show only a single entry, specified dynamically by the ID number or URL Title in the URL, such as comment or permalink pages.

You can then **orderby the view count** or write conditionals against the count in your channel:entries tag.
> 5 votes

---
Tags: tracking
---


# Question
Title: Solspace Calendar and Channel Form - dates not saving
I'm using the latest builds of Calendar and EE (1.8.5 and 2.7.2 respectively) and am having problems getting the calendar to save the dates when creating or editing through Channel Form (Safecracker).

All works fine if saved in EE itself so it seems to be an issue with compatibility with Channel Form. The entry also saves without any other issues. I've tried a 'vanilla' form with only the title and the Calendar widget with no success. I wondered if you might have any suggestions for troubleshooting?

The field appears to be working fine (no javascript errors, datepicker appearing, etc) and my code is as follows (simplified)

```
      {exp:channel:form
           channel="channel_events"
           return="registration/listing/event_location/ENTRY_ID"
           include_jquery="no"
           include_assets="yes"
           datepicker="yes"
           error_delimiters='<p class="form_error inline_error"><span class="icon">* </span>|</p>'
           preserve_checkboxes="yes"
           id="event_form"
           error_handling="inline"
           class="sc_form"
         }
             <input type="text" class="i_text" name="title" id="title" value="{title}" maxlength="75"  />
             {error:title}
             {exp:calendar:date_widget}
             <input class="submit_btn" id="event_submit" type="submit" name="submit_listing" value="Save" />
         {/exp:channel:form}

```

I'd be grateful of ANY thoughts/suggestions you might have!

Thanks Tim

# Answer
Having dug through the archived forums on Solspace I found this gem: http://www.solspace.com/forums/viewthread/11282/P15/

Basically it appears that adding the id="" parameter in the Channel Form/Safecracker form tag somehow breaks things. Removing that parameter seems to have fixed the issue.

Thanks to Anna for the really useful suggestions, though :)
> 5 votes

# Answer
Have you tried setting datepicker="yes" to datepicker="no"? Do you need the date picker enabled? Seems like Solspace would load its own JS for their date field.
> 0 votes

---
Tags: solspace, solspace-calendar, calendar, channel-form
---


# Question
Title: There are some entries in the db that are out of date, please select
EE 2.6.1 Assets 2.2.1

I was doing an index update in Assets when ran into that, someone can help me understand?

# Answer
If you're seeing this message when updating Assets indexes, it means that there are some files or folders in the Assets index database, that reference files or folder that no longer exist physically on the server.

This could be due to deleting files via FTP or EE filemanager, for example.
> 1 votes

---
Tags: assets
---