title: Categories with both 'and' & 'or'

text:
# Question
Title: Categories with both 'and' & 'or'
I am hoping to use the channel entries tag to filter categories from 2 category groups- one category group is using the 'or' separator (|), and one cat group is using the 'and' separator (&). See my current attempt below.

{exp:channel:entries channel="some\_channel" category="6|7|8|57 & 18" limit="15" paginate="top"}
...

This channel query should return entries of any of the categories '6,7,8,57', as long as they also have the category '18'. Is this possible? Or are there modules/extensions/etc. that would assist with this?

\*Note- I need the results to be paginated, so I need to keep all the category-operations in the channel entries tag- ie. this would not work for me:

{exp:channel:entries channel="some\_channel" category="6|7|8|57" limit="15" paginate="top"}
{categories}
{if category\_id == 18}
{!-- content --}
...

I am using EE2.8.1.

Thanks!

HERE IS MY ANSWER

I used PHP in the template to solve this (parse-stage on input).

```
$type_string = isset( $_GET['type'] ) ? $_GET['type'] : false;
$type = $type_string ? explode( ',', $type_string ) : false;
$service = isset( $_GET['services'] ) ? $_GET['services'] : false;

$entries = array();
// GET ALL CHANNEL ENTRIES IN CHANNEL
$channel_entries = ee()->db->select('entry_id')
    ->from('exp_channel_titles')
    ->where( array(
            'channel_id' => 8,
            'status' => 'open'
        )
    )
    ->get();
if ( $channel_entries->num_rows() > 0 ) :
    foreach( $channel_entries->result_array() as $channel_row ) :

        if( $type || $service ) :
            // GET ALL ENTRY CATEGORIES
            $categories = ee()->db->select('cat_id')
                ->from('exp_category_posts')
                ->where( array(
                        'entry_id' => $channel_row['entry_id']
                    )
                )
                ->get();

            $cats = array();
            if ( $categories->num_rows() > 0 ) :
                foreach( $categories->result_array() as $category_row ) :
                    $cats[$category_row['cat_id']] = $category_row['cat_id'];
                endforeach;
            endif;

            if( $type ) :
                if( count( array_intersect( $cats, $type ) ) > 0 ) :
                    if( $service ) :
                        if( isset( $cats[$service] ) ) :
                            $entries[] = $channel_row['entry_id'];
                        endif;
                    else :
                        $entries[] = $channel_row['entry_id'];
                    endif;
                endif;
            elseif( $service ) :
                if( isset( $cats[$service] ) ) :
                    $entries[] = $channel_row['entry_id'];
                endif;
            endif;
        else :
            $entries[] = $channel_row['entry_id'];
        endif;
    endforeach;
endif;

```

then in my channel entries tag i put:

```
{exp:channel:entries channel="portfolio" entry_id="<?= implode( '|', $entries ) ?>" orderby="<?= $orderby ?>" sort="<?= $sort[$orderby] ?>" limit="15" paginate="top"}
...

```

# Answer
Low Search's Categories filter will allow you to do this, without PHP in your template. Simply use the Results tag as a replacement for the channel:entries tag, and you can use this:

```
{exp:low_search:results
    channel="some_channel"
    category:group1="6|7|8|57"
    category:group2="18"
    limit="15"
    paginate="top"
}

```

All parameters themselves are combined with AND, but each parameter itself can hold values that are queried with either AND or OR.

Using the Results tag like this doesn't require having or submitting a search form.
> 0 votes

---
Tags: channel-entries, categories, category-group
---


# Question
Title: Channel Field setup ideas for tabbed content
Sites design uses Bootstrap/jQuery tabs in content area.

Content inside the tabs is set up as Grid (image file, description, link etc).

Any ideas how to make creating/adding tabs dynamic?

Grid inside Grid would be nice :) Maybe plaintext field in each Grid row with tab name + some clever templating to group rows with same “tab name”? Not so elegant..

---

Take a look http://ford.co.uk/Cars/Ka/Design#primaryTabs

Similar tabbed content as this page (Inerior/Wheels/etc).

All content is entered in the Grid filetype (image file, description, link etc). I could define 3 separate Channel Fields with Grid filetype, one for Tab1 content, second for Tab2 content, third for Tab3 content. But problem is, I don’t know (its up to editors choice) how many Tabs there will be. Also I don’t want to clutter content editors view with unnecessary fields.

As i said, it would be easy with nested Grid (for each tab a row, whitch then contains content)..

Is there some clever way to achieve this?

# Answer
From the additional comments it seems you don't know how many tabs will be output.

This isn't a problem as you would simply loop through each row and create a tab for each. By using the {count} variable it is possible append a unique value to an id or class attribute.

Do you have any existing template code?
> 1 votes

---
Tags: channel-entries, grid, jquery, bootstrap
---


# Question
Title: How to create dynamic mailto link with subject as entry title
I am managing careers on a client's website, and am trying to properly add a mailto link below each career description with an email address from one of the publish fields, as well as adding the subject to be the entry title of the career. I can't figure out how to properly format the entry title with %20 instead of a space. How can I do this? Here is my current code:

```
<p><em>Applicants should email resumés to <a href="{mailto_email}" target="blank">{mailto_email}</a>.</em></p>

```

The client wants the email address to be displayed (not encoded), so I am just displaying everything as default. I'm assuming my code will look something like the following, but with the entry title formatted somehow:

```
<p><em>Applicants should email resumés to <a href="{mailto_email}?subject={title}" target="blank">{mailto_email}</a>.</em></p>

```

# Answer
You should be able to use an available plugin to encode things for URLs. I haven't tried or used this plugin, but I think the syntax would be something like this:

```
<a href="{mailto_email}?subject={exp:url_encoder method='rawurlencode'}{title}{/exp:url_encoder}" target="blank">

```

As a last resort, you could also use PHP and run `rawurlencode()` on it, like so:

```
<a href="{mailto_email}?subject=<?=rawurlencode("{title}")?>" target="blank">

```

Remember PHP should be set to parse on the output stage.
> 5 votes

---
Tags: email, title, formatting
---


# Question
Title: Expressionengine2: how use a channel form for non logged in people (without expressionengine doing a guest login in the background)
I use a channel form which allows a non logged in person to post to a certain channel. On my entire site (so also on that particular page) I always have a AJAX login dialog, or when logged in a profile menu (and profile dialog). My problem now is when I come on the page where a non logged in user can post - expressionengine automatically does a sort of log in for the guest user in the background. Now this gets me in problems with my profile dialog (which gets loaded for the guest user, while it should only exist for a proper logged in user). And I don't get my AJAX login form anymore (as for expressionengine somebody is already logged in - so the login does not get shown).

Now I am trying to work around it but this is pretty tricky without changing a lot of stuff. Especially because my login is not on a seperate page.

Is there a possibility to allow non logged\_in people to get a channel form and post, without expressionengine doing a guest login in the background?

greetings, Rick

# Answer
What about using LogMeIn add-on to conditionally log out a user after form submission?
> 1 votes

# Answer
You could also change the logic on your login form so it tests against the group\_id instead of logged\_in. Then just make sure your channel form user is in a different group than your other users.
> 1 votes

---
Tags: login, guest
---


title: Remove index.php from URLs on WAMP

text:
# Question
Title: Remove index.php from URLs on WAMP
I am trying to remove index.php from my URLs on my local WAMP server using the supported .htaccess code:

```
<IfModule mod_rewrite.c>
    RewriteEngine On

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

```

I went into General Configuration and removed "index.php" from "Name of your site's index page" and saved. I am running EE on a subdirectory (http://localhost:8080/mysite/), so I removed the "/" before "index.php" in the last line:

```
    RewriteRule ^(.*)$ index.php/$1 [L]

```

It works for the home page, but for the rest pages when I click the links (which now have the index.php removed), I get this error:

> Not Found
>
> The requested URL /mysite/about-us was not found on this server.

I am still able to access the about-us page at /mysite/index.php/about-us.

Can someone please help me?

# Answer
Make sure `AllowOverride All` is in the httpd.conf or httpd-vhosts.conf file as per this answer on StackOverflow. You'll need to restart Apache after you make the change.

You may be able to add `AllowOverride All` at the top of your htaccess file too.
> 1 votes

# Answer
Try with this .htaccess code:

```
<IfModule mod_rewrite.c>

  # Enable Rewrite Engine
  # ------------------------------
  RewriteEngine On
  RewriteBase /

  # Redirect index.php Requests
  # ------------------------------

RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

  # Standard ExpressionEngine Rewrite
  # ------------------------------
  RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{QUERY_STRING} ^(ACT=.*)$ [NC,OR]
 RewriteCond %{QUERY_STRING} ^(URL=.*)$ [NC,OR]
 RewriteCond %{QUERY_STRING} ^(CSS=.*)$ [NC]
 RewriteRule ^(.*)$ /index.php?&%{QUERY_STRING} [L]
  </IfModule>

```
> 0 votes

---
Tags: url, htaccess
---


# Question
Title: Conditionally returning result from a plugin
I'm writing a custom plugin to tap into an external database, and I'm getting the overall results I want. However, I want to wrap my *return values* around a conditional to avoid processing unnecessary queries further down the line - this bit doesn't seem to be working :-/

Basically I want to check whether the current date is Christmas Day. So I have this early on in my logic:

```
    if($date[2]=="25" && $date[1]=="12") {
        $this->return_data = '<p>Sorry, there are no sailings on Christmas Day.</p>';
    }

```

If it is 25/12, then obviously output the above message and ignore the rest of the plugin, otherwise run the SQL and return a timetable.

Whats happening is (when I change the date to today) it continues through the plugin, always outputting the timetable, presumably because I've nothing to *stop* the plugin after it returns the data in this conditional.

Do I need to wrap this in an if/else structure? Or can I *break* the processing somehow?

# Answer
After setting the return data, you need to return program control to the Template class, which ends execution of the current method.

```
if ($date[2] == 25 && $date[1] == 12)
{
      $this->return_data = '<p>Sorry, there are no sailings on Christmas Day.</p>';
      return;
}

```

Incidentally, it isn't necessary to set the `$return_data` class property unless your plugin only operates in its constructor. So most plugin/module methods can simply return their output:

```
if ($date[2] == 25 && $date[1] == 12)
{
      return '<p>Sorry, there are no sailings on Christmas Day.</p>';
}

```
> 4 votes

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


# Question
Title: Super Search DB error with Matrix fields
I want to re-hash this issue: http://www.solspace.com/forums/viewthread/17419/

The error is:

```
Error Number: 1052

Column 'field_id_90' in field list is ambiguous

```

It seems there was never a proper solution and I'm having the same issue. I can confirm (at least in my testing) that the issue is related to Matrix fields given a relevant value in Super Search.

I’m running EE 2.7.2, SS 2.1.3 and Matrix 2.5.8.

My two matrix fields are: `services_about` & `ct_sub_sections`

**this works:**

```
relevance=“title=1+services_tags=5+ct_tags=5+page_keywords=5+services_introduction=2+ct_about=1+body=1+count_words_within_words”

```

**this doesn’t:**

```
relevance=“title=1+services_tags=5+ct_tags=5+page_keywords=5+services_introduction=2+services_about =1+ct_about=1+ct_sub_sections=1+body=1+count_words_within_words”

```

# Answer
> 2 votes
I am experiencing the same problem where it seems to happen when "Is field searchable?" is enabled within the field settings containing the Matrix field-type (not sure why??!)...

I found a solution by changing line 7595 from

```
$select .= ', field_id_'.$fields[$key].' AS `'.$key.'`';

```

to

```
$select .= ', cd.field_id_'.$fields[$key].' AS `'.$key.'`';

```

Within mod.super\_search.php. This seems to have fixed the problem where the table alias is added to the field.

Super Search V2.1.3

---
Tags: matrix, database, solspace, supersearch, database-error
---


# Question
Title: Forum module : can i load the forum into an iframe?
How can I go about making the forum load into an iframe so I can maintain the main site's header and footer sections?

# Answer
This isn't really EE specific - you'd load the forum in an iframe like you'd load anything else in an iframe.

That said - loading it in an iframe isn't a good idea. If you want to use your global header and footer (embeds/snippets?) in the forum then run your forum through the regular template engine using the {exp:forum} tag. More info about that here:

http://ellislab.com/expressionengine/user-guide/add-ons/forum/other\_features.html

That way you can have a template group called "forum.group" for instance, with an index.html in it which has:

```
{embed="embeds/global_header"}
{exp:forum}
{sn_global_footer}

```

And voila, you have your global header / footer code around the forum. Then you'll need to dive into the forum global header and footer templates and remove some html there of course to make it work properly.
> 5 votes

---
Tags: forum
---


# Question
Title: Can't login to control panel (redirects back to login)
I'm having the same issue described here. I've tried the working solution but it hasn't worked for. In config.local.php I have `$env_config['cookie_domain'] = 'buckley.dev';` and I am still unable to login. This site is using the focuslab multi environment config set up in case that is relevant.

This was working last night when I installed EE 2.8.1 but when I tried to login this morning it won't let me. I am also unable to log in to the staging site.

I have also tried logging in with Firefox unsuccessfully.

In config.master.php I have the following

```
//$env_config['cookie_domain'] = "";
$env_config['cookie_path'] = "";
$env_config['cookie_prefix'] = "bulkley";
$env_config['admin_session_type'] = "c";
$env_config['user_session_type'] = "c";
$env_config['require_ip_for_login'] = "n";
$env_config['require_ip_for_posting'] = "n";
$env_config['secure_forms'] = "n";

```

Also I am able to login via a front end form so I know my user/password are correct. I am however unable to access the CP.

Interestingly if I login via the CP (and get redirected) and then I view the front end of the site when previously logged out, I am now logged in. So the issue isn't that I'm not logging in but that **I can't access the control panel when logged in**.

# Answer
Some more googling and I found the answer here. The issue is with Structure and setting it to redirect to structure on login.

> I finally found out that Structure 3.3.1 is the culprit when you set it to redirect to Structure on login. You can get past it by editing the config file and change $config\['allow\_extensions'\] = 'y'; to $config\['allow\_extensions'\] = 'n';

Have done this and turned off the redirect within structure and all is good now.
> 6 votes

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


# Question
Title: New EE 2.8.1 install control panel login error
Any suggestions would be most appreciated with a problem I'm having with the control panel login.

I'm creating a brand new site, fresh install of 2.8.1, no modules. When I log in to the control panel it displays an error message that the form has expired. This happens in both FF and Chrome.

After looking around for possible fixes, I've added the following to the config file:

$config\['admin\_session\_type'\] = cs $config\['cookie\_domain'\] = .domain.com

This did not help.

To get around the problem, I have to clear the browser cookies and files each time I start working each day. Once I'm in, if I log out I can usually log back in right away. I've cleared the browser cookies and files after a successful login and can usually log in again, too. So the problem seems to come up after I've been away for awhile.

The other thing I noticed is that I have an .htaccess file to remove index.php from URLs. When I comment out that code, the control panel login works again, regardless of whether I've cleared the browser cache/cookies. I'm using the code directly from the EE docs for removing index.php (http://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html). However, I have to remove the section about "Removes index.php from ExpressionEngine URLS" because it cause an internal server error. Here's the code:

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    # Removes index.php from ExpressionEngine URLs
    #RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    #RewriteCond %{REQUEST_URI} !/system/.* [NC]
    #RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

I've checked with my host, and the server should support this. I also ran the EE wizard just to confirm, and all looked good from that end.

Do you have an idea what is going on, or advice for what to try? Thank you.

# Answer
Did you rename your EE /system directory to something besides "system"? If you did, make sure to adjust your .htaccess file on this line so the RewriteCond will be ignored for the control panel directory. Not sure this is the fix but worth trying.

```
RewriteCond %{REQUEST_URI} !/system/.* [NC]

```
> 1 votes

---
Tags: control-panel, login
---


title: Problem Logging in

text:
# Question
Title: Problem Logging in
Has anyone seen this. user is on Log in page.

Everything looks find.

Once they have input their username and password in the appropriate fields

And go down to click on the login button

all they can do is select the the word - login - with their cursor

Pressing "enter" does not yield any difference

# Answer
I just tried to login on your site using Chrome Version 34.0.1847.131 on OSX 10.9.2 and it worked fine.

From your screenshot it looks like you have some ads being injected onto the page. Is this something intentional?

My guess is that you have some "helper" or perhaps malware on your system that is injecting the ad content and consequently breaking the proper functionality of the page.

Also works fine in Firefox 28, Safari 7.0.3, and Opera 12.15 on OSX as well as IE9 under Windows 7 and IE11 under Windows 8.1
> 1 votes

---
Tags: login
---


# Question
Title: Krea Content Elements Field and EE 2.6.1 Relationships Field - how to use parts of an article in the related articles section of a Single Entry Page
On our web-site each article (Single Entry Page) is accompanied by 4 related articles. Those 4 are chosen by the editors. I set up a native EE 2.6.1 Relationships Field for them. For the article itself I set up a Content Elements Field. In the related articles are below the main article I´d like to show

1. the title of the related articles
2. the articles first image (called intro\_image)
3. I also need the url\_title\_path, to make title + image clickable.

I have no problems with title + url, but can´t get the CE tag to work.

This is my code

```
    {exp:channel:entries channel="article" status="open|featured"}
       {related_article status="not closed"}
          {artikel}
            {gallery}
              {if element_name=="intro_image"}
                 {images}
                    {related_article:image} <= doesn´t work!
                 {images}
              {/if}
            {/gallery}
          {/artikel}
          <p><a href="{related_article:url_title_path='artikel/index'}">
{related_article:title}</a></p>
      {/related_article}
    {/exp:channel:entries}

```

This code is working fine for the title and the URL, but not for the image. I tried to prefix `{artikel}`, `{gallery}`, `{image}` in various combination with `{related_article:}`. But this is not working. When I leave out the related\_article in frot of each of the three tags, I get the intro image from the main article. So I need an identifier, that points to the child entry.

# Answer
First off, your `{images}` tag is duplicated - instead of closing the first tag with `{/images}`, you have another `{images}`. Dunno if that's a simple typo from simplifying the actual template or not.

Secondly, is the `{if element_name=="intro_image"}` code getting called at all? I've found that such conditionals never work for me. I have to wrap `element_name` in quotes and EE tags: `{if '{element_name}' == "intro_image"}`. You can insert some temporary code in the conditional to make sure that part is working at least:

```
          {if '{element_name}'=="intro_image"}
             {!-- Debug code --}
             Element name is "intro_image"!
             {!-- // Debug code --}
             {images}
                {related_article:image} <= doesn´t work!
             {images}
             --}
          {/if}

```

Once all that's sorted out, if you still have problems, let me know. :)

EDIT: And yes, I know this is a rather old question, but Google sent me here! :p
> 1 votes

---
Tags: custom-fields, relationships, related-entries
---


title: I need make a Form the custom module

text:
# Question
Title: I need make a Form the custom module
In first, sorry to something. I'm new in EE and need make a form of custom table.

ex: my table have 4 fields, name, old, address, city. (this is only example.) and need make in control panel a form to cadastre, edit, delete my register.

I looked in many sites and only saw about EE 1 but I'm using EE 2.8.

can somebody tell me any site or examples to I follow and study more?

one more time, sorry something.

# Answer
> 1 votes
Start with the Development Documentation for a broad overview of topics that will be relevant to building your module.

Specifically though, you will want to drill into the module development instructions and go through the module development tutorial that comes with sample code that you can learn from.

---
Tags: templates, module, forms
---


# Question
Title: Nested html tabs and playa fields please help
I now want to create a second set of pill tabs based on a playa list called up within the first channel entry (called "nwt\_2cd\_order\_location") I am using Zurb Foundation's mark up for responsive design and it worked on flat pages.

The child in a playa list would be (called "3rd\_order\_under") and from that list i want to add content from that child. This all works pretty good until the user chooses a different selection under the first set of tabs (nwt\_2cd\_order\_location). It does not update the second set correctly (3rd\_order\_under).

If thats not enough, once that works i would like to add another playa list (no tabs this time fortunately) in the content derived from a playa list inside (3rd\_order\_under) called {4th\_order\_under\_3rd\_order}. Can you call up a playa list three tier deep?

So if any one here has any suggestions I sure would appreciate it.

Thanks Eric

The page

http://niwot.colorado.edu/index.php/location

My simplified code:

\<!-- PILL TABS --\>

\<div class="row"\>

```
<div class="twelve columns" style="padding-top:20px;">
  <dl class="tabs pill">
    {exp:channel:entries channel="nwt_2cd_order_location" limit="10" sort="asc"}
       <dd style="padding:5px;" {if count == '1'}class="active"{/if}> <a href="#pillTab{url_title}">{title}</a></dd>
    {/exp:channel:entries}
 </dl>

  <ul class="pill tabs-content contained">
          {exp:channel:entries channel="nwt_2cd_order_location" limit="10" sort="asc"}
       <li {if count == '1'}class="active"{/if} id="pillTab{url_title}Tab">
            <!-- li class="active" id="pillTab{url_title}" -->
            <div class="row">
                   <!-- MAP BOX -->
               <div class="twelve columns" style="float:right;">
                  {summary}
               </div>

            {if 3rd_order_under}
            <p><strong>Locations within {title}</strong></p>
            {/if}
         </div>

      <dl class="tabs pill">
           {exp:playa:children field="3rd_order_under" limit="25" sort="asc"}
               <dd style="padding:5px;" {if count == '1'}class="active"{/if}><a href="#pillTab{url_title}">{title}</a>
               </dd>
          {/exp:playa:children}
      </dl>

```

\<!-- CONTENT FOR 3rd ORDER pill tabs within pill tabs --\>

```
    <ul class="pill tabs-content contained">
     {exp:playa:children field="3rd_order_under" limit="25" sort="asc"}
       <li {if count == '1'}class="active"{/if} id="pillTab{url_title}Tab">
            <div class="row">
               <div class="twelve columns" style="float:right;">
                   {summary_3rd_order}<br />

                   {!-- nothing I've done here works
                   exp:playa:siblings entry_id="{4th_order_under_3rd_order}" parent_id="3rd_order_under"}
                   {4th_order_under_3rd_order}
                   {/exp:playa:siblings}
                   --}
               </div>
            </div>
         </li>
       {/exp:playa:children}
       {/exp:channel:entries}
      </ul>
    </li>
  </ul>

```

the additional tab selections just stack on top each other instead of replacing the previous selection.

# Answer
> 1 votes
You have still included your JavaScript in the wrong order, jQuery should come first.

How it is now:

```
<!-- More Foundation pannel -->
<script src="http://niwot.colorado.edu/eejavascripts/jquery.foundation.tabs.js"></script
<!-- END More Foundation pannel -->
<script src="http://niwot.colorado.edu/eejavascripts/jquery.js"></script>
<script src="http://niwot.colorado.edu/eejavascripts/foundation.min.js"></script>

```

How it must be:

```
<script src="http://niwot.colorado.edu/eejavascripts/jquery.js"></script>
<!-- More Foundation pannel -->
<script src="http://niwot.colorado.edu/eejavascripts/jquery.foundation.tabs.js"></script
<!-- END More Foundation pannel -->
<script src="http://niwot.colorado.edu/eejavascripts/foundation.min.js"></script>

```

---
Tags: templates, playa, template-scripting, nesting
---


# Question
Title: How to implement A/B testing (split testing) in Expressionengine
I was advised on Twitter to post this here for others who might be looking for the same answers I was.

The client wanted to test the user engagement of an auto-play video vs. image slides with a call-to-action. I chose A/B testing over Multivariate testing, because I only needed to switch out one section of my page. I couldn't find many articles or any answers on how to implement dynamic-content split testing with a module or add-on, so I started looking into other non-dynamic options.

Since I am not using Structure in this current project, I had found this helpful article, but couldn't implement it the way the article explained: FortySevenMedia Blog

I was told to look into Google Content Experiments, which looked amazing, but I didn't want to deal with multiple pages/urls, despite that looking like the easiest solution, so had to find something else to use instead. Overview of Content Experiments

# Answer
> 2 votes
I decided upon using Optimizely, which is not the perfect solution since you can't use dynamic content, but since the client only wanted to change out 1 section of the homepage, I decided this was the best solution for what they wanted. You don't even need an account to test it out on your site, just visit their Homepage and enter your site url to try out how everything works and what you have control over with their code editor (which is actually so much more than I was expecting).

You can choose what page section you want to split-test and create variations, or even just change out the text/color of a button or heading to test user engagement and click-throughs.

# Answer
> 0 votes
The basic implementation of Google Analytics Experiments with redirects is awful IMO. Each version requires its own URL? No thank you!

BUT there are also implementation methods that do not require redirects with both client side and server side code.

I've not tried the server side option but the no-redirect javascript one is *much* cleaner than the basic one that they lay out.

I like having all my analytics data in one place which was a big plus for Google Experiments. I did not extensively evaluate Optimizely.

---
Tags: content
---


# Question
Title: Super Search and Primary Category - conditonal if searched categories includes entry's primary category
I have a very complex situation in which I need to pull out one entry from a Super Search results loop and re-inject it in a different location on the page. I'm planning on using NSM Transplant for that part and some early tests indicate it will work fine.

The tricky part is writing a conditional inside the Super Search loop that will identify the correct entry to pull out via Transplant. I want to only transplant the entry if the category or categories searched include the Primary Category of that entry - which in my case is a location.

So in plain english this is the conditional I want:

> If {this\_entry's\_primary\_category} is contained in {super\_search\_category} then do something with Transplant, otherwise, leave it alone

I'm using CE String so my first thought was to check if the {super\_search\_category} string contained the primary category URL title with **strpos**, something like this (this is inside `exp:super_search:results`):

```
{if "{exp:ce_str:ing strpos='{exp:primary_category entry_id='{entry_id}'}{primary_category_url_title}{/exp:primary_category}'}{super_search_category}{/exp:ce_str:ing}" != "-1"}

```

This always returns false - even on the entry where the primary category should be found within super search category. I think it's because `{super_search_category}` only works outside the `exp:super_search:results` tag. Is this correct?

**Any suggestions for the easiest way to test to see if an entry's Primary Category is included in category or categories searched on a Super Search results page?**

*Edit to add some recent code examples*

This is on a Super Search results page:

```
{exp:stash:set name="ss-cats" parse_tags="yes" parse_depth="2"}{super_search_category}{/exp:stash:set}

{exp:super_search:results
    redirect_post="yes"
    channel="directory"
    status="Open|Featured"
    performance="off"
    category_indicator="category_url_title"
    search-words-within-words="yes"
    inclusive_categories="yes"
    orderby="vendor-group+desc+vip+desc+rating_field-rating+desc+title+asc"
    search_in="title|vendor-person|about|extended|address|awards"
    inclusive_keywords="no"
    where="all"
    limit="50"
    paginate="bottom"
}

{exp:stash:get name="ss-cats"}
<!-- lots of stuff here removed for simplicity -->

{/exp:super_search:results}

```

**At the moment, I'm not even getting this simple stash set/get to work so I can read the value of {super\_search\_category} inside the results loop.**

*Edit for progress below:*

`{super_search_category}` returns category URL titles if used outside results loop.

If you used INSIDE results loop it does nothing (tag is not parsed at all).

If I use Stash to save the tag output from outside the results loop it works to some extent:

```
{exp:stash:set name="ss-cats" parse_tags="yes" parse_depth="1"}{super_search_category}{/exp:stash:set}
Stash get SS cats outside results: {exp:stash:get name="ss-cats"}

{exp:super_search:results
    redirect_post="yes"
    channel="directory"
    status="Open|Featured"
    performance="off"
    category_indicator="category_url_title"
    search-words-within-words="yes"
    inclusive_categories="yes"
    orderby="vendor-group+desc+vip+desc+rating_field-rating+desc+title+asc"
    search_in="title|vendor-person|about|extended|address|awards"
    inclusive_keywords="no"
    where="all"
    limit="50"
    paginate="bottom"
}

Stash get SS cats inside results: {exp:stash:get name="ss-cats"}

{/exp:super_search:results}

```

---

In this case the stash:get **outside** results works fine, but the stash:get **inside** results returns something different (a completely different category name - which isn't even the Super Search category!).

So I fail to see how I can read {super\_search\_category} from within the results in order to use it in a conditional.

# Answer
> 0 votes
I want to share my final solution in case anyone else runs across a similar situation.

My goal was in two parts:

1. Identify which entries had their Primary Category equal to one of the Super Search categories from {super\_search\_category} string.
2. Move that entry to the top of the search results to bypass the normal sort order.

I accomplished it like this (lots of code removed to show just the relevant parts):

```
<?php $cats = explode(" ", '{super_search_category}'); ?>

<ul class="directory">

{exp:super_search:results
    redirect_post="yes"
    channel="directory"
    status="Open|Featured"
    performance="off"
    category_indicator="category_url_title"
    search-words-within-words="yes"
    inclusive_categories="yes"
    orderby="vendor-group+desc+vip+desc+rating_field-rating+desc+title+asc"
    search_in="title|vendor-person|about|extended|address|awards"
    inclusive_keywords="no"
    where="all"
    limit="50"
    paginate="bottom"
}

    <?php $group = "{vendor-group}"; ?>
    <?php $primeCat = "{exp:primary_category entry_id='{entry_id}'}{primary_category_url_title}{/exp:primary_category}"; ?>

    <li
        <?php if ($group == "10 - Platinum" && in_array($primeCat, $cats) !== false) { ?>
            data-platinum="primary-platinum"
        <?php } ?>
    >
    </li>
{/exp:super_search:results}

</ul>

<script>
    $(function () {
        $(".directory li[data-platinum='primary-platinum']").prependTo($("ul.directory"));
    });
</script>

```

Comparing the search category string to the primary category had to be done with PHP since that tag only works outside the results loop. Even with Stash I couldn't get it to work because of parse order issues.

After banging my head over multiple ways to try to transplant the entry to the top of the list using NSM Transplant, Stash, Embeds, or extra search results tags, I decided it was far easier to do it on the front-end with javascript!

# Answer
> 1 votes
Consider checking out Stash instead of Transplant using it's set\_list & get\_list's -\> match / against params. (I probably need more info to help with the regex if any)

See this wiki article for Filtering Lists with match against. Note: in that example Mark is manually creating the list but, you'd do it with Super Search (or channel entries tags etc.) and use the Primary Category to filter against (if and when it exists.)

Also, this EESE answer appears to have accomplished something similar (possibly the opposite?) to what you want using Stash and Active Record; an add-on which is often recommend over using the Query Module.

# Answer
> 0 votes
Have you tried Plv Check If plugin?

# Answer
> 0 votes
Does `{super_search_keywords}` contain the category name when the search is on a category? Unlike `{super_search_category}` which works only outside of the results loop, `{super_search_keywords}` can be used within it.

If that doesn't work, the one thing to say about Stash that maybe isn't clear from @Natetronn's answer, is that you could use Stash to capture the value of `{super_search_category}` outside of the results loop, and then use that value inside the results loop.

Using Stash to solve your issue would be slightly complicated, so best to see if `{super_search_keywords}` solves your issue first. And, maybe NSM Transplant could work similarly to Stash in this regard. But Stash is particularly good at letting you move values in and out of contexts and perform conditionals on those values. (The hard part, of course, is figuring out which freakin' context each part of your code is in, in relation to EE's outside-to-inside parse order…)

---
Tags: solspace, stash, supersearch, primary-category
---


# Question
Title: Only show categories if entries exist in that category AND in another separate category
I need to create a megamenu for a site which links to a bunch of category pages.

So I have megamenus for Product Type A & B which are also categories.

Under Product Type A there are headings for Materials, Brand & Usage.

Product Type B will also have a megamenu with a Brand subheading.

At the moment I have a category group for Brands and I'm just listing out all the categories in that group under the respective headings.

So what I need to do is make sure that under the Brand heading for Product Type A that only Brands that have entries that are also assigned to the Product Type A category show, and so on for Type B etc.

For most of the options in these menus I'm just dealing with categories because there won't be any overlap.

But there will for Brands and so I need to look at the entries and then build the list of category options from there.

Any idea how I go about that?

# Answer
> 1 votes
This is what I ended up doing:

```
{exp:query sql="SELECT COUNT(entry_id) num_cat_entries
    FROM
    (
            SELECT  entry_id
            FROM    exp_category_posts
            WHERE   cat_id IN (31, 73)
            GROUP   BY entry_id
            HAVING  COUNT(DISTINCT cat_id ) = 2
    ) s"
}
{if num_cat_entries > 0} show the category link {/if}
{/exp:query}

```

# Answer
> 0 votes
What will really make your day is the GWcode Categories add-on. If you set the parameter show\_empty="no" you're good to go. Documentation here.

Let us know if we can be of any more help!

EDIT: native EE also has this built in

---
Tags: categories, stash
---


# Question
Title: Is it possible to span an entry over multiple pages with Structure?
I would like to have a Structure managed page span the content of that entry over multiple pages using the method in the EE Docs.

My code:

```
 {exp:channel:entries channel="articles" paginate_type="field" paginate="bottom" limit="1" }
        <h1>{title}</h1>
        {multi_field="page1|page2|page3|page4|page5"}

        {paginate}
        Page {current_page} of {total_pages} | {pagination_links}
        {/paginate}
{/exp:channel:entries}

```

The first page shows the content from {page1} however each addition page is empty.

I have also tried adding dynamic="no" & url\_title="{segment\_2}" to the exp:channel:entries tag with the same results.

Are there any other options that I might be missing or is this just not possible?

Thank you

# Answer
> 2 votes
Each entry is attached to a single URL, but with something like Freebie you possibly could. You could have an initial channel tag on the main page wrapped in conditionals. This channel tag would have the certain fields you want to show. Then if you appended a random segment on the end that Freebie is ignoring, you could have another channel tag showing the remaining ones.

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


# Question
Title: Child nav item only showing up on parent page in nav menu when using Structure
I have the following menu built with Structure:

```
{exp:structure:nav start_from="/" include_ul="no" exclude="10|11|12|13"}
{/exp:structure:nav}

```

One of my pages is called "About" and a child page called "Our Team."

The problem is that "Our Team" only shows up in navigation when on the "About" or "Our Team" pages. If I navigate to another page like "Services," the 2nd level navigation disappears.

Any help is much appreciated!

# Answer
Add show\_depth="2" to the nav tag to reveal all children on the second level. Also, remove the end tag, it's not a wrapper.
> 0 votes

---
Tags: structure, navigation, parent, child
---


# Question
Title: Why is my FoxyCart Datafeed getting a different POST than it should?
When comparing FoxyCart's Transaction Datafeed's raw POSTs to any other web service, EE's reception seems totally different.

What is going on?

I am using the latest version of EE as of this writing, 2.8.1.

# Answer
Use `$_REQUEST` because it remains untouched.

FTR it's not the `permitted_uri_chars` config item. The `$_POST` and `ee()->input->post(...)` are cleaned via `Input::_clean_input_data`.

Instead of hacking core (which is an option, see below) I got the hint to use `$_REQUEST` from this CI issue:

https://github.com/EllisLab/CodeIgniter/issues/1136
> 0 votes

---
Tags: module
---


# Question
Title: Freeform Pro's default_value Parameter Not Working for select Element
According to Freeform Pro's documentation, the `default_value` parameter should let you designate a default (non-first) selection for any field without relying on JavaScript...

> Also available is the default\_value="VALUE" parameter, which can be applied directly to the {freeform:field:FIELD\_NAME} variable. For field types that contain predetermined values such as select lists and radios, this can be used to pre-select a value from that list. For field types such as text input or text area, this can be used to add sample text to the field.

With Freeform Pro 4.1.7 on EE 2.7.2, this line (a State select field) fails to set any default even though `Washington` is in the list.

```
 {freeform:field:state attr:id="state" attr:class="required" default_value="Washington"}

```

So the resulting default value, as usual, is Alabama.

Solspace has advised using JavaScript in response to other questions, but I'd rather utilize this parameter since it appears to exist for exactly the case I'm interested in.

Am I missing the point or doing something wrong? Maybe misRTFM?

# Answer
It's working, you just have to use the default *value*, not the default label.

The clue:
`<option value="WA">Washington</option>`

The answer:
`default_value="Washington"`
`default_value="WA"`

For the win...

```
 {freeform:field:state attr:id="state" attr:class="required" default_value="WA"}

```
> 1 votes

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


# Question
Title: Low Yearly Archives Showing Total News Articles in Two Languages
I have a bilingual website where I am using Low Yearly Archives to create a dropdown that shows how many news articles have been added in a single year using the {entries\_in\_year} tag. Only issue is it is showing double what the entries are because I have a bilingual site (using Transcribe) so each entry has an associated entry in another laguage. Is there a way for the {entries\_in\_year} tag to only show the count for the number of entries in that year for that specific language?

Thanks. Stephen.

# Answer
Low Yearly Archives isn't specifically compatible with Transcribe. But if the languages can be differentiated by, for example, status, then you can use that parameter to filter the entries.

Otherwise, some sort of hack would be required.
> 1 votes

---
Tags: transcribe, low, low-yearly-archives
---


# Question
Title: Content Elements - Is there a Video add-on compatable with Vimeo?
I'm trying to give a client the ability to add Vimeo videos in their entries in conjunction with Content Elements. There seems to be only one video fieldtype compatable with CE - Embed video by krea but that only allows youtube uploads. Anyone else got this working or knows a workaround?

# Answer
> 0 votes
Currently there is no compatible add-on. Developer tells me there is something in the pipeline.

# Answer
> 2 votes
One alternative would be to create a text fieldtype in which the client could simply enter the video ID, which you would then parse into the Vimeo embed code within the template. It's not perfect, but it's a potential solution. You might simply have to do an element name lookup to distinguish it from any other textfield options you have provided as an element.

---
Tags: content-elements, video
---


# Question
Title: Solspace Calendar: showing non-ongoing events and only ongoing
I need to show a list of event per one day, lets say Today, that are only today and not repeating, and after that list I need to show events that are ongoing. I'm already filtering events per one day and that works but no sure how to filter just one day events (that don't repeat, even they are from today till tomorrow for example) and after events that are ongoing that repeat weekly/monthly etc..

thanks

# Answer
You can use `{exp:calendar:cal}` to zoom in on "today", and filter out recurring events using `{if event_recurs}...{/if}`. Eg.:

```
{exp:calendar:cal date_range_start="today" date_range_end="today" pad_short_weeks="n"}
    {events}
        {if event_recurs}
        {if:else}
            [{event_id}] {event_title}<br /> /* ...and other event data */
        {/if}
    {/events}
{/exp:calendar:cal}

```
> 1 votes

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


# Question
Title: Minimee CSS tags produce output while JS tags do not
Has anyone ever encountered a situation in which the Minimee tag pair (using version 2.1.10) correctly outputs a minified CSS file to the cache directory, but the JS tag pair simply has no effect at all and the various JS files wrapped with the Minimee JS tags simply wind up as-is in the template? In both cases the files are static CSS and JS files loading from the local server. But the CSS files are being combined, while it seems like the minimee js tag pair is being ignored.

# Answer
Most often the cause for this is that one of the JS files you're trying to use does not exist (at least from Minimee's point of view). As Alex suggested, if you turn on EE's template debugging, Minimee will add errors to the log. Search for the string "Minimee \[ERROR\]" to jump right to where it's encountering a problem.

If you install the EE Debug Toolbar, Minimee adds its own panel of log messages, so it is even simpler to track down what might be amiss.

Feel free to hit me up direct via twitter (@johndwells) if you're still having trouble, or the devot-ee forums if it looks like there's a bug.

Cheers, John
> 2 votes

# Answer
I haven't ever seen that myself. Is the `exp:minimee:js` tag closed properly?

The first thing to do is turn on EE's template debugging feature because Minimee will provide debugging info there with any errors. http://johndwells.github.io/Minimee/#faq
> 2 votes

---
Tags: css, minimee, js
---


title: Adding a product code to cart items

text:
# Question
Title: Adding a product code to cart items
Wondering if anyone can help me out with this issue I've got. Apologies if my terminology is wrong with any of this - It's landed in my lap and I'm trying to get the issues solved without any prior EE or cartthrob knowledge.

We're using CartThrob with SagePay payment gateway on our website.

When a customer goes onto our site and makes a purchase, all the information seems to be displayed correctly in the cart (both on cartthrob and sagepay), However once the purchase is completed and the order details are downloaded to Sage 50 Accounts 2014, all of the item details are missing and instead we get just one line item "Purchase from Website".

I spoke to the chaps at SagePay who have told me that we need to add a product code to our line items which will pair up with our product codes in Sage Accounts and then the data will pass through correctly.

I found the following info in some of the SagePay documentation...

> In order for the download of transactions within Sage 50 to update a product record the first entry in a basket line needs to be the product code of the item within square brackets.

So seemingly I need to simply add the product code in square brackets to each of the 'items' being purchased, only problem is that I have no idea how to go about doing this.

I've had a good root around ExpressionEngine, specifically in the cartthrob settings. I can see our products there, but cant see where I would add the product code info.

Can anyone explain how I would go about doing this, or even just point me in the right direction?

Thanks in advance!

# Answer
> 1 votes
How you do this will depend on the fields you have for your product code. If you're using the title field, then this will automatically be carried across to your orders. If you're using a different field for example something like *{product\_sku}*, then you'll need to carry this over into your orders channel.

You can collect any custom data for products as they're added to the cart in Cart Throb.

So in your add to basket form (most likely a *{exp:cartthrob:add\_to\_cart\_form}* tag, include the following:

```
<input type="hidden" name="item_options[sage_code]" value="{product_sku}">

```

The name here can be anything you like, but it needs to be prefixed with *item\_options*. This will ensure is attached to the ordered products.

If by some chance you're using *{exp:cartthrob:multi\_add\_to\_cart\_form}*, you'd need to modify your hidden field to include a *{row\_id}* to ensure the product code is attached to the correct item within the order.

```
<input type="hidden" name="item_options[{row_id}][sage_code]" value="{product_sku}">

```

That deals with adding your product codes to the order data, but then getting this information out of Cart Throb can be a little harder because of the way the data is stored in the database. Its serialised and Base 64 encoded, so there's a little bit of leg work needed if you need anything other than the built in reports - although I'm not familiar with import requirements with for Sage.

We've had to create some bespoke reports on a couple of occasions, so have some experience of this if you need any additional guidance.

---
Tags: cartthrob, sagepay, product
---


# Question
Title: How do I process form data with a php script inside expressionengine?
I have an ee site that has tons of forms that are currently live. These forms are submitting data to a third party service using that service's custom submission code (which has nothing to do with ee addon code - I think the service is just using CURL).

I need to implement additional validation for these forms on the PHP side before I pass the data to the service. I kind of need a middle layer which processes the data I guess. The forms are in plain html and are stored as snippets or low variables.

I do not need to save the data. I only need to

* validate form inputs
* filter out bad input characters
* throw back errors and redirect to form if form data is invalid
* send data to the service if the form is valid

How should I do this? Should I write a plugin, extension, module? I only need to process the data not build the form. What should I write?

# Answer
You don't need to run this through EE at all if you don't want to. Simply create your PHP script outside of EE's templates and have the form post its data there.

I did something very similar to what you need recently to send data from a contact form to a CRM system. They supplied a ready made PHP script (which used CURL) to get the data to the CRM. I just set my form to post to the script they gave me.

UPDATE: Here's my htaccess redirect rule in case you have a problem

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Options All -Indexes

```
> 3 votes

---
Tags: forms, validation
---


# Question
Title: Cartthrob and Transcribe: orders don't get the default language assigned
I was wondering why my CT invoices are always empty. When digging deeper I noticed that a simple

```
{exp:channel:entries  channel="orders" status="not none" }
    {if no_results}This invoice could not be found{/if}
    Entry ID: {entry_id}<br />
{/exp:channel:entries}

```

doesn't even return the no\_results branch.

After some more testing it was clear that all CT generated channel entries, i.e. orders and purchased\_items, don't have the default language assigned to the channel entry. After manually changing the language the channel entries can be found and invoices get generated as they should.

Question is... is this a CT or a Transcribe bug? Or is there even a configuration setting which I may have missed.

# Answer
> 0 votes
Disabling transcribe was the solution:

```
{exp:channel:entries
     channel="orders"
     limit="1"
     status="not none"
     dynamic="no"
     entry_id="{embed:entry_id}"
     parse_inward="yes"
     show_future_entries="yes"
     transcribe="disable"}

```

---
Tags: channel-entries, cartthrob, transcribe
---


# Question
Title: Codeigniter version within ExpressionEngine outdated? Is it wise to update?
Is there a specific reason that even the most recent ExpressionEngine installs (as of writing, 2.8.1) are built upon a seemingly outdated version of CodeIgniter (2.0.1), when CI 2.1.4 is available?

And is it possible to manually update that Codeigniter instance to avoid security issues – or does EllisLab use a custom build of CI that should not be tampered with?

(Context: A malware scan has listed my ExpressionEngine installs as outdated (and in need for update) because of the version number of Codeigniter install within.)

# Answer
Just to clarify, we definitely use a forked version of CI with security holes patched as we find them. We also apply any security patches to the public version of CodeIgniter. Don't update what's there as that would cause compatibility issues.
> 7 votes

# Answer
EllisLab has forked the official CodeIgniter version and are using their own internal one. I highly doubt you can replace this with the official one.
> 6 votes

---
Tags: ee2, codeigniter, updating, core
---


# Question
Title: Expresso Store: Display price including tax from channel:entries tag
First Store project underway for a UK store charging VAT.

I'm (probably) going to enter prices ex-VAT into the database as they do ship internationally, but I generally want to display them inc-VAT throughout the site. The only place I'm likely to split things out is in the checkout.

Is there a "best practice" for this? I've got my VAT setup and UK is the default country, but I can't figure out how to add tax to the price displayed using a {store\_field:price} tag.

Quite happy to get my hands dirty with add-ons/extensions etc, but not if I don't have to.

thanks

# Answer
> 2 votes
Had the same issue so wrote a Tax plugin, I've just uploaded it but still needs instructions adding.

**Template Tags** \- either as tag pairs or single tags:

* {exp:tax:only} - display only the tax
* {exp:tax:price} - display the price with tax
* {exp:tax:none} - display the non-taxed price

If using as single tags, use the value or price parameter to set the numerical price value. Value passed can already be inclusive or exclusive of tax - default is that tax is already included in price.

**Example**:

1. {exp:tax:only value="10" rate="20" currency="£" show\_currency="yes"}
2. {exp:tax:only rate="20" currency="£" show\_currency="yes"}10{/exp:tax:only}

Will both output: £2.00

**Parameters**:

* included (is the tax already included in the passed price value)
* value or price (the number/string to use - for single tags only)
* rate (rate of tax, any non numerical characters will be stripped)
* show\_currency (show the currency symbol on output - defaults to no)
* currency (what currency symbol to use - can also take any character passed as a value or within the tag pair)
* position (where the currency symbol should appear, options are "before" and "after" - defaults to before)
* decimals (show decimal points - defaults to yes)
* thousands (show the thousands character - defaults to yes, character can only be defined through config settings)
* rounding (how the calculations should be rounded, options are "up", "down", "nearest")

All the above defaults can be defined in the EE config file:

* tax\_rate
* tax\_included
* tax\_currency
* tax\_position
* tax\_decimals
* tax\_thousands
* tax\_show\_currency
* tax\_rounding
* tax\_decimal\_places
* tax\_thousand\_symbol
* tax\_decimal\_symbol

Decimal places, decimal character and thousand character can only be set via config variables.

---
Tags: expresso-store
---


# Question
Title: Expresso Store: checkout and order custom field w/ amout value - how to calculate total
I have added an order custom field to the checkout process named "Would you like this order gift wrapped?" and there is one choice (check box) which is passing value, which is marking that order as a gift, but now store owner has decided to have added some $ amount to the total when that options is checked.

My code looks like:

```
          <td>Would you like this order gift wrapped?</td>
            <td colspan="2"><input type="checkbox" value="yes" name="order_custom1" /> Yes</td>
            <td style="text-align:right"><input type="hidden" value="5.00" name="order_custom2" /> $5.00</td>
        </tr>

```

Now how I can update total with value of order\_custom2 when order\_custom1 is not empty on Update Total (or auto update total w/ jQuery on check box checked event)?

Thanks

# Answer
> 2 votes
You will need to use a product instead of a custom order field.

In Store 2, the checkout tag and add to cart tag both submit to the same URL, so you can use this to add optional products to the cart during checkout.

To do this, the high level overview is that you simply submit a hidden field with the entry\_id along with the standard update cart fields.

For example:

```
<input type="hidden" name="items[0][entry_id]" value="123" />
<!-- hidden input so that unselecting the checkbox submits 0 quantity -->
<input type="hidden" name="items[0][update_qty]" value="0" />
<input type="checkbox" name="items[0][update_qty]" value="1" selected /> Gift wrapping?

```

`update_qty` is exactly like `item_qty`, except that it overwrites any existing quantity in the cart rather than adding to it.

The only difference between this and the regular add to cart form is that you have to wrap the inputs with `items[num][]`. This allows multiple products to be added/updated at once.

This is similar to how the product form tag works (they all submit to the same endpoint).

---
Tags: expresso-store, custom-fields, checkout, custom-order-fields
---


# Question
Title: What is the level of risk in enabling user-uploaded photos in EE?
I know there will always be some level of risk when allowing user-submitted data, but what exactly does EE do natively to filter, validate, and sanitize photo uploads through the standard interface? Does EE do anything to escape or sanitize photos on output or before doing any other processing? I'm talking mostly with respect to avatars and the native EE file upload system, particularly pertaining to photos (current EE version 2.8.1).

Researching the developer docs, they have the following to say on saving images to server:

> **Saving Images or Files to the Server**
>
> When saving images or files to the server, make sure and validate the file type (MIME) and also clean the file name to remove possible naughty characters.
>
> * Sanitize file name: ee()-\>security-\>sanitize\_filename();
> * Browser provides the MIME type, available in: $\_FILES\['userfile'\]\['type'\]
> * Use the Upload class (ee()-\>load-\>library('upload', $config);) as it contains methods for validation and sanitizing

I assume that EE's native file upload functions use the Upload class, but what exactly does the Upload class do to validate and sanitize? Does it check MIME type using some sort of actual file analysis, or does it simply rely on what the browser reads it as?

Can anyone give any particular pointers or best practices in EE photo upload settings or possibly server settings to permissions given to the photo upload folder to maintain the highest level of security?

# Answer
> I assume that EE's native file upload functions use the Upload class, but what exactly does the Upload class do to validate and sanitize? Does it check MIME type using some sort of actual file analysis, or does it simply rely on what the browser reads it as?

The Upload class uses the `$_FILES` array and it does use `$_FILES[]['type']`, but we do some verification later on:

```
if (function_exists('getimagesize') && @getimagesize($file) !== FALSE)
{
    if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary
    {
        return FALSE; // Couldn't open the file, return FALSE
    }

    $opening_bytes = fread($file, 256);
    fclose($file);

    // These are known to throw IE into mime-type detection chaos <a,
    // <body, <head, <html, <img, <plaintext, <pre, <script, <table,
    // <title
    // title is basically just in SVG, but we filter it anyhow

    if ( ! preg_match('/<(a|body|head|html|img|plaintext|pre|script|table|title)[\s>]/i', $opening_bytes))
    {
        return TRUE; // its an image, no "triggers" detected in the first 256 bytes, we're good
    }
    else
    {
        return FALSE;
    }
}

if (($data = @file_get_contents($file)) === FALSE)
{
    return FALSE;
}

$CI =& get_instance();
return $CI->security->xss_clean($data, TRUE);

```

So we:

* Make sure that `getimagesize()` works on the file
* If the file is an image, we check the first 256 bytes for any funny business
* Make sure that running `Security::xss_clean()` returns an untouched file

> Can anyone give any particular pointers or best practices in EE photo upload settings or possibly server settings to permissions given to the photo upload folder to maintain the highest level of security?

Well, in order for the images to be accessible on your website, the images must have permissions so the server can access them, which means you at least need read+write access for the server and read access for everything else. Our recommendation in the installation documentation is:

> These permissions are typical for PHP-based applications running on Apache, though you may want to check with your web host to see if more restrictive permissions can be used to allow PHP to write to files and directories.

Since every server is different, we're pretty loose on our suggestions, but it doesn't hurt to try more and more restrictive options until you find one that works best for you.
> 7 votes

---
Tags: ee2, file-uploads, security, validation, uploads
---


title: Input Class in template

text:
# Question
Title: Input Class in template
Is it possible to use the EE Classes within a template?

Are they only available for add-on development?

Thanks, Patrick

# Answer
> 1 votes
You'd need to create an add-on to use them, but creating a plugin is simple enough and if you needed something beefier you could always build a module. Also, depending on what you're trying to do, someone may have already solved it so search around at Devot-ee for potential add-ons.

# Answer
> 0 votes
Along the lines of what Wes said about an existing add-on that might do what you need:

Mo' Variables makes a lot of what the Input Class provides available in your templates (ie, GET, POST, GET and POST, and Cookies). It's a very useful add-on.

---
Tags: ee, classes
---


# Question
Title: {exp:comment:notification_links} not displaying anything
I copied the example in the documentation to display

```
{exp:comment:notification_links}
    {if subscribed}
            <h5><a href="{unsubscribe_link}">Unsubscribe to comment notification for this entry.</a></h5>
    {if:else}
            <h5><a href="{subscribe_link}">Subscribe to comment notification for this entry.</a></h5>
    {/if}
{/exp:comment:notification_links}

```

However, nothing is outputted.

Is this supposed to be inside a {exp:comment:entries} or {exp:channel:entries} tag?

# Answer
If you're logged out, you shouldn't see anything, so make sure you're logged in. Second, this tag needs to be on a single entry page and it will try to figure out your entry ID by:

* Checking to see if you used an `entry_id=` or `url_title=` parameter on the `{exp:comment:notification_links}` tag
* Checking the URI to see if the entry ID shows up there

So, if your entry id or URL title is **not** in the URI, you should be using the `entry_id=` or `url_title=` parameters.
> 2 votes

---
Tags: comments, subscriptions
---


# Question
Title: ExpressionEngine add-on question regarding email and social media notification
I have seen functionality on a Wordpress site that allowed visitors to sign up for notification whenever new content is added to the site. The subscription allowed the user to receive notification of all new additions or to limit notifications to specific categories.

The user could also select how they want to be notified (by email, Facebook, twitter, other social media, etc.).

Does anyone know of an existing EE add-on that can replicate this functionality?

Thanks for your help,

Darin Parker

# Answer
This is not available OOB or with current addons, but these two addons come the closest to what you need minus the social media integration: update message and Entry Mailing

You might consider talking to those developers and see if they would be able to add that functionality in - I would imagine that you would need to pay for this extra functionality but it's definitely worth asking.
> 1 votes

---
Tags: add-on, notification, social
---


# Question
Title: How to find the source of awful queries generated by EE
One of our sites has been really suffering and our ISP pointed out that we needed to optimize our templates because we were generating some really slow queries.

For example this:

```
SELECT DISTINCT(t.entry_id) FROM exp_channel_titles AS t
            LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id INNER JOIN exp_category_posts ON t.entry_id = exp_category_posts.entry_id
                     INNER JOIN exp_categories ON exp_category_posts.cat_id = exp_categories.cat_id WHERE t.entry_id !='' AND t.site_id IN ('1')  AND t.entry_date < 1399575836  AND (t.expiration_date = 0 OR t.expiration_date > 1399575836) AND t.entry_id != '2706' AND (t.channel_id = '1' OR t.channel_id = '3' ) AND t.entry_id IN ('164','162','356','354','145','180','230','221','218','207','243','244','254','256','257','272','281','283','308','309','314','315','318','319','323','324','329','330','331','332','333','337','338','343','346','348','349','350','351','359','360','361','362','363','371','376','384','393','394','409','411','426','450','455','470','471','480','488','507','509','513','514','517','522','527','529','532','538','539','557','559','560','563','582','583','584','588','604','609','613','614','617','621','625','633','641','650','652','682','813','674','676','677','678','679','688','694','696','699','704','712','718','724','726','728','732','757','758','759','763','770','783','778','784','794','796','799','810','822','828','837','1216','871','843','844','845','846','847','855','861','863','864','865','866','868','873','887','888','879','884','890','891','892','896','900','902','907','912','913','914','916','917','918','924','925','929','955','935','936','940','946','950','953','954','95! 7','961','965','967','968','1169','981','983','998','999','1131','1005','1007','1014','1019','1026','1185','1030','1031','1032','1045','1046','1050','1056','1078','1073','1075','1081','1088','1094','1099','1109','1116','1120','1124','1144','1151','1152','1153','1154','1156','1158','1161','1163','1166','1172','1241','1195','1198','1199','1200','1201','1204','1591','1209','1215','1220','1223','1226','1232','1233','1245','1246','1257','1258','1261','1270','1274','1275','1279','1280','1283','1288','1289','1300','1301','1303','1308','1312','1313','2378','1345','1351','1354','1357','1366','1372','1379','1386','1387','1390','1405','1393','1402','1403','1416','1417','1420','1421','1423','1430','1432','1434','1447','1450','1455','1465','1468','1469','1473','1475','1478','1481','1487','1488','1503','1506','1507','1512','1513','1517','1520','1521','1546','1547','1548','1550','1571','1557','1558','1559','1561','1564','1565','1567','1568','1595','1600','1604','1609','1614','1613','1624'! ,'1641','1633','1638','1644','1645','1650','1653','1655','1658! ','1659','1660','1662','1663','1676','1677','1687','1688','1690','1693','1697','1699','1700','1701','1703','1704','1705','1711','1713','1715','1718','1722','1726','1730','1731','1738','1742','1744','1752','1759','1762','1767','1768','1772','1773','1776','1797','1779','1782','1791','1795','1810','1813','1815','1828','1840','1841','1843','1844','1845','1860','1861','1867','1885','1879','1888','1889','1892','1893','1894','1900','1904','1910','1914','1912','1915','1921','1925','1927','1929','1930','1939','1948','1949','1952','1954','1956','1958','1959','1974','1976','1985','1988','2001','2002','2003','2007','2015','2014','2020','2324','2033','2034','2035','2039','2046','2044','2048','2052','2059','2057','2061','2062','2066','2078','2075','2082','2102','2124','2129','2128','2225','2144','2146','2177','2184','2187','2188','2192','2193','2197','2199','2201','2212','2222','2226','2227','2234','2240','2245','2246','2253','2274','2275','2276','2293','2297','2299','2301','2304','2314'! ,'2323','2334','2343','2348','2351','2363','2367','2368','2369','2379','2382','2387','2400','2405','2416','2417','2420','2434','2440','2442','2445','2452','2458','2460','2462','2463','2473','2480','2484','2497','2499','2502','2505','2509','2511','2520','2521','2523','2525','2530','2531','2537','2547','2553','2557','2566','2592','2598','2602','2608','2612','2638','2641','2643','2645','2648','2651','2655','2658','2661','2663','2694','2665','2693','2700','2701','2702','2704','2708','2709','2739','2736','2722','2723','2725','2727','2729','2731','2733','2737','2746') AND t.status  IN ('open','draft') AND t.status != 'closed' ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc LIMIT 0, 5

```

So yeah, that's a mess. But how would I identify what EE tag is generating it so I can find a better solution?

Any tips on tracking these things down?

# Answer
If you enable the Output Profiler you'll see the profiler at the very bottom of the page. Look around for this:

If you click the show link you'll see all of the queries required to build your page along with the file, line number, class, and method that ran that query:

You might still need to do a bit of hunting because a query could be created in one place and run in another. It might also help to enable the Template Debugger because it shows the memory usage after certain logged items. Take this for instance:

```
(0.010291 / 5.69MB) Processing Tags
(0.010321 / 5.70MB) Module Tag: Moblog/check
(0.010340 / 5.70MB) Module Tag: Search/simple_form
(0.010356 / 5.70MB) Module Tag: Channel/entries
(0.010372 / 5.70MB) Module Tag: Channel/entries
(0.010389 / 5.70MB) Module Tag: Channel/entries
(0.010405 / 5.70MB) Module Tag: Channel/categories
(0.010421 / 5.70MB) Module Tag: Channel/month_links
(0.010437 / 5.70MB) Module Tag: Channel/calendar
(0.010453 / 5.70MB) Module Tag: Channel/entries
(0.010469 / 5.70MB) Module Tag: Channel/entries
(0.010488 / 5.70MB) Including Files for Plugins and Modules
(0.020725 / 7.62MB) Files for Plugins and Modules All Included
(0.021423 / 7.64MB) Beginning Final Tag Data Processing
(0.021446 / 7.64MB) Calling Class/Method: Moblog/check
(0.021545 / 7.65MB) -> Class Called: Moblog
(0.021594 / 7.66MB) -> Method Called: check
(0.022470 / 7.69MB) -> Data Returned
(0.022506 / 7.68MB) Calling Class/Method: Search/simple_form
(0.022611 / 7.68MB) -> Class Called: Search
(0.022635 / 7.68MB) -> Method Called: simple_form
(0.023925 / 7.82MB) -> Data Returned
(0.023951 / 7.82MB) Calling Class/Method: Channel/entries
(0.024100 / 7.82MB) -> Class Called: Channel
(0.025505 / 8.01MB) -> Method Called: entries
(0.076083 / 11.72MB) -> Data Returned

```

You can see that loading the files for plugins and modules used 1.92MB of memory since it jumped at that point. Continuing down the list, the channel entries method used close to 3.9MB of memory.
> 11 votes

# Answer
In addition to the fine answer by Wes I'd add that most likely you don't need to "find a better solution" you just need to use the `disable` parameter in your `exp:channel:entries` tags.

A couple of those JOINs will be eliminated with this simple fix.
> 5 votes

---
Tags: tags, debugging, queries
---


# Question
Title: Mailchimp Subscribe with Profile:Edit / Cartthrob
I'm having problems getting Mailchimp Subscribe working when used in conjunction with Profile:Edit registrations or Cartthrob Checkout. Does anyone know if there are known conflicts with these Extensions/Modules.

Running EE v2.5.2 Cartthrob 2.2.2 Profile:Edit 1.0.7 Mailchimp Subscribe 2.1.0

The problem is that I've set a custom member field (member\_subscribe). In mailchimp subscribe settings this is set as the trigger field and the trigger is 'Yes'. Once member has registered the trigger field is shown as Yes but when I login to Mailchimp there are no subscriptions registering under lists.

# Answer
The version of MailChimp Subscribe on Devot-ee hasn't been updated in nearly 18 months, and the developer (Steven Lewis) is no longer actively developing it himself.

**However**, there are a number of forks on Github that add enhancements, including (I think) CT compatibility and Safecracker Registration support too.

Some of these have been merged into the original, so grab the version from GitHub rather than Devot-ee for starters, as they probably fix a number of issues/incompatibilities with recent EE versions.

Other than that as @Tyssen says you really need to provide more information about the specific issues you're having.

As an alternative approach, have a look at the (free) CT Mailing list addon instead. It's made by BNI (who make CT & Profile:Edit) and it allows you to hook directly into CT's checkout process. You could probably also pretty easily extend/reuse the same code to tie into one of Profile: Edit's hooks
> 2 votes

# Answer
Any solution for EE 2.8 out there? The suprisehighway hack is causing errors:

Fatal error: Call to undefined method EE\_Javascript::generate\_json() in /Applications/MAMP/htdocs/laatmaarzien/e2services/expressionengine/third\_party/mailchimp\_subscribe/ext.mailchimp\_subscribe.php on line 274
> 1 votes

# Answer
We had the same issues. We hacked our way to a solution.

https://github.com/surprisehighway/MailChimp-Subscribe-Profile-Edit
> 0 votes

---
Tags: members, cartthrob, email, extension
---


# Question
Title: Expression Engine - Passing Custom Field Variables to Layout
I'm trying getting to grips with Expression Engine. Specifically passing custom field information to a master layout

I have created two template groups. One for the overall layout including the header and footer and one to control a specific channel.

I have custom fields for the channel. Including one called "description" that I want to be able to pass back to the overall header layout. This is what I have from looking at the documentation but it doesn't work - the variable {timeline\_item\_description} isn't getting passed to the header. Looking at the code below what am I doing wrong?

Channel index template:

```
{layout:set name="desc"}{timeline_item_description}{/layout:set}

```

The Header layout template:

```
<meta property="og:description" content="{layout:desc}"

```

# Answer
> 2 votes
If your trying to pass a simple value to your layout, you can set it on the layout tag. For example:

```
{layout="pages/.layout" body_class="contact"}

```

But custom fields variables need to be parsed by the `channel:entries` variable pair. This is the reason for the tag `layout:set`.

```
{exp:channel:entries [...]}
    {layout:set name="desc"}{timeline_item_description}{/layout:set}
{/exp:channel:entries}

```

By this way, its value is passed to the layout template.

# Answer
> 0 votes
I believe what you describe should work.

1. I take it you have a `{layout="site/.header_layout"}` tag in your children (channel index template) as well, and that the path to the template\_group/template is correct ?
2. I suppose that you can print out `{timeline_item_description}`in your children template and that it works
3. Could you try the following just to be sure ?

**Channel index template:**

```
{layout="site/.header_layout"}
{layout:set name="desc" value="{timeline_item_description}"}

```

**Header Layout template**

```
<meta property="og:description" content="{layout:desc}" />

```

---
Tags: templates, custom-fields, variable
---


# Question
Title: P&T Field Pack 2.1.1 on EE2.8.1 Installation Errors Notice and warnings
A PHP Error was encountered Severity: Notice Message: Undefined index: enabled\_types Filename: fieldpack/helper.php Line Number: 78

A PHP Error was encountered Severity: Warning Message: Invalid argument supplied for foreach() Filename: fieldpack/helper.php Line Number: 78

On specific field types this error occurs. I am guessing that it is the foreach loop as it is only list, multiselect, pill, etc, fieldtypes.

Not stopping my development - but thought i should flag it and see if anyone knows reason / fix...

N

# Answer
P&T field pack has been superseded by fieldpack http://devot-ee.com/add-ons/field-pack. P&T field pack wont be supported by 2.8.1 but the upgrade to field pack is really simple do.
> 1 votes

# Answer
As far as I'm aware the P&T field pack is not yet compatible with EE 2.8.x
> 0 votes

---
Tags: pixelandtonic, field-pack, install
---


# Question
Title: Combining multiple inputs in to single textarea
I would like to use freeform to make an enquiry form that lists several products each with a quantity input field. On submit these would combined in to a single textarea field, each on a separate line.

Is this something that is possible within freeform?

# Answer
> 2 votes
Here are a couple options:

If it really needs to be *stored* as one field, then you can use jQuery to concatenate and format all the separate inputs. Then set that as the value on single hidden input field named after the Freeform field you want to use to store the data. You would do this on form submit. Easy to do with a little jQuery knowledge (but out of the scope of this site).

If it doesn't matter that it's *stored* as a single field (ie, the only time the data needs to be viewed as a single block of text is in an email notification or template) then you could just pull all the separate variables together using Freeform tags.

---
Tags: solspace-freeform
---


# Question
Title: Creating a store with Structure and multiple levels of categories in the URL
Looking for some general advice, I'm looking to build a store that has 1,500 products. These products are broken down into 40 or so categories, can be in multiple categories and I want to be able to nest these categories in the URL, for example I want to be able to do the following:

```
site.com/category_parent/category_child/category_childs_child/product_name/
site.com/category_parent/category_child/product_name/
site.com/category_parent/product_name/

```

The trouble I have is that ExpressionEngines built in categories don't allow this, the only option is to have:

```
site.com/categories/category_name/product_name/

```

And if i'm linking to a product from the homepage (without being on a category listing page) you'll end up on:

```
site.com/product_name

```

This all gets pretty confusing from a users point of view as the URL system doesn't have any consistency. Is there any options for me to get the URLs working as I want or is ExpressionEngine simply the wrong system for the job?

I've been thinking it might be possible by using the add-on freebie but still can't workout how i'd manage the different levels of category and the fact that there isn't a fixed depth of category… some pages could have 4 levels of categories some only 1.

Would really appreciate someone else's thoughts on this matter, thanks!

# Answer
> 1 votes
This is exactly what you want http://devot-ee.com/add-ons/category-url

# Answer
> 1 votes
You might consider using the segment variables and Mark Croxton's highly-regarded ifelse plugin.

You can start checking at the highest possible number of segments and work your way back, of course.

# Answer
> 0 votes
Subsegment works well with Structure. Subsegment allows you to split a url segment into a subsegments array and find any subsegment.

http://devot-ee.com/add-ons/subsegment

---
Tags: expresso-store, categories, structure
---


title: Freeform and responsive layout

text:
# Question
Title: Freeform and responsive layout
I have created two columns form using Freeform composer, but it looks like each field is counted as a new row. At that case responsive layout is "breaking" form flow on mobile devices.

Is there any way to do have predefined columns first then rows?

Thanks

# Answer
Well, I think that composer has issue withing new FireFox. Have used Chrome and drag-n-drop can drag without creating new rows per each field.
> 1 votes

---
Tags: solspace-freeform
---


title: Cartthrob Product price including vat

text:
# Question
Title: Cartthrob Product price including vat
Just bought Cartthrob. But i'm having a struggle for the following. Cartthrob automatically generates a price including vat.

So for example when I add a product with price € 10,- it will create a price € 12,10 because of my 21% vat.

But my customer wants to add product prices including Vat. So he wants to add a product and give it the price € 10,- incl. vat.

Or else he needs te calculate all his prices to excl. vat.

Is it possible to change this way of calculating prices? So inputted prices is price incl. vat?

Thanks in advance!

Wessel

# Answer
> 1 votes
There are 2 options here.

Enter all prices incl. VAT then use the https://cartthrob.com/docs/tags\_detail/add\_to\_cart\_form/#tax\_exempt tag so VAT doesn't get added to the base price.

This is fine but assumes items are exempt from VAT and therefore doesn't account for it in reports or order details.

OR

Add prices ex VAT, but use the http://cartthrob.com/docs/fieldtypes/price\_simple/#price\_plus\_tax tag to add your tax rate to the base price to display this on your product page.

---
Tags: cartthrob
---


# Question
Title: Auto insert a numerical value that increases by 1 to channel form field
I would like to be able to have members create codes, these codes are made of text based on drop down and should contain a numerical value that must be unique (with Channel Forms Grid (safecracker)) and increment by one with each new entry. Does any one know of a way to do this, the initial entry needs be to be dynamically generated and written to the DB entry field as static entry on save. Many thanks for any advise.

Dan

# Answer
> 1 votes
You could write an extension calling the `ee()->extensions->call('channel_form_submit_entry_start', $this);`

http://ellislab.com/expressionengine/user-guide/development/extension\_hooks/module/channel\_form/index.html#channel-form-submit-entry-start

In your extension you then do the unique (auto increment) value by using the DB class to check for uniqueness.

Example code for the auto increment would be something like:

\` $auto\_increment = 1; $query = ee()-\>DB-\>query('SELECT field\_id\_x FROM exp\_channel\_data' WHERE field\_id\_x = $auto\_increment LIMIT 1);

if($query-\>num\_rows() != 0 ) { $auto\_increment = $query-\>row()-\>field\_id\_x + 1; } \`

You can also do more of the logic in MYSQL like so:

\`$query = ee()-\>DB-\>query('SELECT (COUNT(\*)+1) AS auto\_increment FROM exp\_channel\_data WHERE channel\_id = "y" GROUP BY channel\_id');

$auto\_increment = $query-\>row()-\>auto\_increment; \`

# Answer
> 1 votes
Reatile's answer is good for what you outlined in your question, but one possible consideration and possibly easier to implement is to make use of the {entry\_id}. This automatically is a unique numerical value which increases by 1 every time a new entry is created. You could also prepend some other identifier like 'sku{entry\_id}', which would then render output to 'sku598'.

One possible issue is if you need the number to be strictly sequential within it's own channel/category. Using the entry\_id will mean there will be gaps between numbers if there is an entry created outside of that particular use. However, this may or may not matter depending on your particular needs.

# Answer
> 0 votes
If you create entrys with the same title name, the url\_title field will contain the title name + a numerical value (auto increment).

dont know if you can use it to your advantage.

---
Tags: channel, forms, 2.8, ee
---


# Question
Title: EE 253 > 273 upgrade not "progressing" - just skips to "finished" screen
I ran the update locally and it acted as expected. On the dev server, it goes right from the "begin" button to the "finished" screen. The DB definitely isn't getting touched, as i'm getting "field not found" db errors when i try to login afterward.

I've tried disabling extensions with no change. Anything else you can think of that might cause this? Anyone seen this?

# Answer
> 1 votes
Did you deploy the files from your local machine to dev environment?

I ran across a similar issue a few weeks ago as a result of deploying the upgrade files to my dev environment.

In that case the config.php had the `$config['app_version'] = "";` updated to `273"` instead of the needed `"253"` for the EE upgrade script to run properly.

---
Tags: upgrade, update
---


# Question
Title: exp_channel_data matrix field contains YTowOnt9
EE 2.6.1, Matrix 2.5.10, Structure 3.3.13, Wygwam 3.2.2

Matrix field data outputs on the frontend, but matrix rows disappear when editing a specific entry.

The matrix data still appears on the front-end even after clearing all caches but when editing the entry it appears the Matrix rows and data are gone but it still exists in the exp\_matrix\_data table.

Found that our matrix field\_id\_x with the missing rows contained the value `YTowOnt9` which base64 decodes to `a:0:{}`. Any ideas if an older version of Matrix once stored a serialized array? If we delete the string `YTowOnt9` the matrix rows for that field reappear.

Each row there are a total of 7 columns. In each row there are 2 file upload fields, and 5 text fields.

When we save an entry now with Matrix 2.5.10 and the value `YTowOnt9` exists in field\_id\_x, the matrix data is removed from the exp\_matrix\_data table. If the channel\_data field\_id\_x column is blank or has a value of 1 that matrix data is retained.

Was wondering if anyone had any idea on where `YTowOnt9` was coming from? A previous version of Matrix? Another add-on that is modifying the value of field\_id data?

# Answer
> 2 votes
Issue was with DataGrab 1.8.0

If a matrix field has a value and DataGrab has the field option "Action to take when an entry is updated" is set to, "Delete all existing rows" **even though there are no selected columns to import from**. DataGrab will populate that field with 'YTowOnt9' which is base64 that decodes to a:0:{} breaking the connection with the Matrix table data for that entry. The client was re-editing these entries and the matrix data was being erased because of the broken relationship between exp\_channel\_data and exp\_matrix\_data.

Older versions of the Matrix fieldtype I believe stored it's data serialized.

This was fixed by running a query on all matrix field types which had the value YTowOnt9 and clearing it. Matrix will find all the existing data by itself if done in the correct order.

1. Change DataGrab settings

Changed DataGrab setting for Matrix fieldtypes: "Action to take when an entry is updated" to "Keep existing rows and append new"

1. Run SQL fix on all field\_ids affected
2. Run DataGrab import again

---
Tags: matrix, pixelandtonic, datagrab
---


title: low:events excluding an entry

text:
# Question
Title: low:events excluding an entry
I'm using low:events:entries. I have a page that shows the next upcoming featured event as a picture, then underneath it a list of events, both featured and non-featured. My next upcoming featured event is showing up both in the picture and in the list, and I'd like it to not show up in the list since that looks like a duplicate.

It's under "Upcoming Events" at www.fcs.uga.edu.

I've tried using the entry\_id="not {lv\_exclude\_id}" parameter when making the list, defining lv\_exclude\_id, an early-parsed Low Variable, as:

```
{exp:low_events:entries channel="events" show_passed="no" search:events_front_page_feature="Yes" limit="1"}
{entry_id}
{/exp:low_events:entries}

```

(The same tag that brings up my one featured event.)

But that's not working. Maybe seeding one low:events:entries with another isn't the way to do this. Any ideas?

# Answer
Using an early parsed var (or a Snippet for that matter) like that doesn't work. To illustrate, using the var you geva as an example, and using it like this:

```
{exp:low_events:entries entry_id="not {lv_exclude_id}"}
    ...
{/exp:low_events:entries}

```

...will result in this code when we come to the stage where tags are parsed:

```
{exp:low_events:entries entry_id="not {exp:low_events:entries channel="events" show_passed="no" search:events_front_page_feature="Yes" limit="1"}
        {entry_id}
    {/exp:low_events:entries}"}
    ...
{/exp:low_events:entries}

```

You can see why this will not work.

So, to work around it, you'd need to use either an embed, or something like Stash.
> 2 votes

---
Tags: low-variables, parse-order, low, events, low-events
---


# Question
Title: Show playa parents of child items listed via {exp:low_alphabet:entries} (not a single entry page)
Each discography entry has a playa field for each disc that contains all the songs that appear on that record, creating a tracklisting. What I'd like to do is create a reverse navigation system, so that people can browse songs and see all releases they appeared on (albums, singles, collections, etc).

It was straightforward to get Low Alphabet to ouput a page containing all songs starting with a letter, now I'd like to have all parent releases listed under them.

I imagine it's something where I'd need to write some custom PHP or use an embed or stash based on research I've been doing.

Relevant template code below - it just outputs a long list of entries (even for X, which has one song that is included on two discography items). Removing `channel="discography"` doesn't make any impact.

```
{exp:low_alphabet:entries
        channel="songs"
        alpha_ignore="the"
        numbers="before"
        group_numbers="yes"
        numbers_label="#"
        alpha_filter="{segment_3}"
        orderby="title"
        sort="asc"
        disable="categories|member_data|pagination"
        limit="250"
}
     {if low_alphabet_heading}
         <h2>Songs that start with {low_alphabet_label}</h2>
         <ul>
     {/if}
            <li><a href="{url_title_path="songs"}">{title}</a></li>
            {if no_parents}{/if}
                <ul class="list-nav">
                {exp:playa:parents channel="discography"}
                        <li><a href="{path={channel_short_name}/{url_title}}">{title}</a></li>
                {/exp:playa:parents}
                </ul>
        {if low_alphabet_footer}
        </ul>
    {/if}
{/exp:low_alphabet:entries}

```

The following works as expected

```
    {exp:channel:entries channel="lyrics" limit="50"}

         <ul>
            <li><a href="{url_title_path="songs"}">{title}</a></li>
                <ul class="list-nav">
                    {exp:playa:parents}
                    <li><a href="{path={channel_short_name}/{url_title}}">{title}</a></li>
                    {/exp:playa:parents}
                </ul>
        </ul>

    {/exp:channel:entries}

```

# Answer
> 1 votes
That code should work but you might want to use the var\_prefix parameter to avoid variable name conflicts.

Also, because Low Alphabet is a plugin and EE's quirky template parser, you'll need to add `parse="inward"` to the opening low\_alphabet:entries tag if you're using other tags inside it (as per the docs).

---
Tags: playa, pixelandtonic, loop, parent, low-alphabet
---


# Question
Title: Gmap for ee - create list of nearby businesses from google maps
Is it possible using objectivehtml's google map for expression engine, to look at a particular address (point) then using a radius search pull from google businesses, potentially allowing for refining the search by hospitals, parks, stores, etc - and create a list?

# Answer
No that's not possible out of the box. Gmap for EE will search your EE entries, not Google's listings. You'd have to write an extension to the Gmap module or ask ObjectiveHTML to do that implementation for you.
> 1 votes

---
Tags: google-maps-for-ee
---


title: Entries Grouped by month and year

text:
# Question
Title: Entries Grouped by month and year
I am looking to create a list page which will output all entries for a single year, but have them grouped by month. So for example i will have:

January entry A entry b entry c February entry d entry e entry f

etc... The perfect solution would be like Lows Alphabet, but working on dates as opposed to starting letters... http://devot-ee.com/add-ons/low-alphabet

I cannot find any addons, or default functionality for this - and want to avoid running 12 entry queries! Therefore, i either have to code an addon, or php in the template to store and then output them how i want...

Does anyone know of an existing, elegant solution? Or can give me guidance here - it would be very much appreciated.

# Answer
> 4 votes
http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#date-heading

completely missed this before, but should make this more than possible.

---

EDIT

In response to the above comment, a better formatted view:

```
<ul>
{exp:channel:entries channel="blog"}
{date_heading display="monthly"}
  <li>{entry_date format="%F"}
    <ul>
{/date_heading}
      <li>{title}</li>
{date_heading display="monthly"}
    </ul>
  </li>
{/date_heading}
{/exp:channel:entries}
</ul>

```

# Answer
> 2 votes
This sounds like something that Low Yearly Archive could be used for.

http://gotolow.com/addons/low-yearly-archive

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


# Question
Title: Error message when I try to edit custom fields
I just upgraded my ExpressionEngine to the latest version (2.8.1) along with the latest FieldPack (2.1.1). All my pages load fine, but when I try to click on an existing Custom Field within my ExpressionEngine Control Panel, I get the following error:

Unable to load requested field type file: ft.rel.php. Confirm the fieldtype file is located in the expressionengine/third\_party/ directory

I read that PT doesn't support it anymore, but I'm not using any fields that use FT's old field type anyways, so I'm not sure what's going on. I basically can't edit any existing custom field without getting the error message. Any idea what's going on? Thanks!

# Answer
As far as I'm aware, P&T field pack isn't working under 2.8. Remove/uninstall the fields and you'll stop the error.

If you have channels that use these field types then you'll have to make other plans or roll back to 2.7.3.

Maybe hit up P&T and see if they'll open source them so others may contribute/update the code.
> 1 votes

---
Tags: pixelandtonic, field-pack
---


title: Cart Throb loses cart items in IE11

text:
# Question
Title: Cart Throb loses cart items in IE11
A client has reported a strange error in a Cart Throb site where the items that are added to the basket aren't being saved. This is only happening in IE11.

Is there anything about cookies in IE11 that is *different* to previous versions of IE?

I tried logging into the site and this worked fine, retaining the cookies, but it still didn't hold items in the cart as I moved from page to page.

Anyone any thoughts?

EE2.7.2. Cart Throb 2.4

# Answer
After much frustration and searching around, I've finally tracked down the issue here. In between times I scheduled a support call with Cart Throb who were super helpful, so thank you to them for offering their input - it was their advice that set me off on the right track.

In the end however, it was an IE specific issue related to Magic Zoom, a Javascript image zoom feature we'd added to the site. Although this states full compatibility with IE6+, and we've successfully used this before without any issues, it was, believe it or not, the stylesheet provided with it that was causing the problem.

Within the stylesheet were 3 references to `cursor` linking to a `.cur` file (also provided).

```
.MagicZoomPlus, .MagicZoomPlus:hover {
  display: inline-block;
  cursor: url(graphics/zoomin.cur), pointer;
  outline: 0 !important;
  font-size: 0 !important;
  line-height: 100% !important;
  direction: ltr;
  max-width: 100%;
}

```

I eventually noticed the cursor wasn't appearing in IE compared to sensible browsers, and removed the `.cur` references and *voila*! Items added to the cart and all working as expected. I can't say exactly why this was causing the problem, but I'm happy enough to see it working again and just set the cursor value to `move`.

Thanks for everyone's suggestions in the comments :-)
> 1 votes

---
Tags: cartthrob, internetexplorer
---