# Question
Title: Radio Button field not outputting anything
I am having a very odd issue. This is on EE 2.8.1. I created a channel and within that channel I have a radio button field with the values of Yes or No. I can create entries and check the correct option. If I check in the database, it has the correct values for that field for the entry I created.

Within a template I try some code like this:

```
{exp:channel:entries channel="my_channel" dynamic="no"}
  <div>{title} - {my_radio_button_field}</div>
{/exp:channel:entries}

```

And the output is just: Entry title - It seems to just output a blank space for the radio button field value, it is parsing it so it recognized the field name, but it is not getting the value for output.

The only weird thing that happened was I originally had it as a checkbox and changed to a radio button, so to alleviate that I created a second field as a radio button with the same options and it behaves the same.

I have seen a ton of examples (and used identical code myself in the past) using the field just like this or in a conditional. And all the data is being recorded properly in the DB, so I am sort of out of ideas? Can anyone suggest some things to try?

UPDATE: What I found is that if any of the entries don't have a value for that radio button, then they all will display as empty. When I limited the entries down to entries with a value selected it works. This seems like a bug to me, is that correct?

# Answer
> 1 votes
Try deleting that custom field, and recreating the custom field as a radio first. That may fix the issue.

---
Tags: fieldtype, bug
---


title: cannot connect EE to the database

text:
# Question
Title: cannot connect EE to the database
I'm in the process of installing EE on my website. All the information that I added in the data section are correct. I even contacted the host provider and everything that I have been doing seems right. However, I'm unable to proceed with the installation as I keep getting this message:

A Database Error Occurred Unable to connect to your database server using the provided settings.

Filename: controllers/wizard.php

Line Number: 1544

I would really appreciate the help on this matter.

# Answer
> 2 votes
Without a doubt the connection details are wrong in some way.

Have you created the database on the database server? The installer won't do that for you, it will simply populate a database with the necessary tables.

If you are using "localhost" then are the webserver and database server on the same network? (i.e. you don't have EE installed on your own machine but are attempting to access a database hosted elsewhere).

UPDATE: The OP was using the incorrect server host name. The fix was to use "localhost".

# Answer
> 0 votes
The first thing i would try is setting your System \> ExpressionEngine \> Config \>

config.php database.php

to 666 permissions.

If this is not set right it won't be able to setup your database file in a readable way to connect to your servers db.

---
Tags: ee
---


title: Shopping Cart & Shipping Charges

text:
# Question
Title: Shopping Cart & Shipping Charges
The website designer we have hired has created our site in Expression Engine and has included a shopping cart to handle donations, registrations and craft shop sales. We are being told that there is no way to automatically calculate shipping charges based on weight and shipping location. They have told us we need to calculate shipping manually for each item. Can you recommend a plug-in or something that can calculate shipping automatically? I can't imagine one doesn't exist that is affordable.

# Answer
> 0 votes
This is going to depend on which add-on was used to provide the ecommerce functionality.

It will most likely be Cartthrob, Expresso Store or Brilliant Retail. If it's a really old and basic site then it might be using SimpleCommerce.

Do any of those names ring a bell?

If you go to the Add-ons-\>Modules menu do any of those names appear?

# Answer
> 0 votes
Here are two options for plugins for Cart Throb

**USPS -\>** https://github.com/CartThrob/cartthrob-live-rates-UPS/blob/master/cartthrob/third\_party/language/english/cartthrob\_shipping\_ups\_lang.php

**FEDEX -\>** https://github.com/CartThrob/cartthrob-live-rates-fedex

---
Tags: add-on, shipping, shopping-cart
---


# Question
Title: Upgrade to 2.7.2 got this error "An Error Was Encountered Non-existent class: Addons"
Anyone else seen this error during an EE 2.7.2 upgrade?

> "An Error Was Encountered Non-existent class: Addons"

If I remove installer, the CP error says:

> Your ExpressionEngine installation’s version (2.7.1) is not consistent with the reported version (2.7.2). Please update your installation of ExpressionEngine again.

I updated all the modules to latest versions cannot find anything similar in forums.

# Answer
If somebody will have the same error - check if you have Solspace FreeForm . I had the same issue because of this (FreeForm v.4.0.4). Fix - temporary remove freeform folder. You can return it back after update will finish.
> 4 votes

# Answer
The first thing I would try is ensure that all addons (fieldtypes, extenstions, modules, plugins) are updated and then re-uploading the 2.7.2 EE files.

if that doesn't work, you may need to rollback to your backup of the site and try again.
> 1 votes

# Answer
Just had the same issue upgrading to 2.7.3 and thought I should let people know that the removing free form, then pasting it back in after upgrade solution still seems to work.
> 1 votes

# Answer
Removing Freeform (and putting it back after the update has finished) works for me still.
> 1 votes

# Answer
Go to `/system/expressionengine/config/config.php` and on line 14 or so you'll see `$config['app_version']` and make sure it equals 272 (no periods)
> 0 votes

# Answer
You can keep going that way. After this error you simply can remove installer and the system will be up to date. The version will update and database tables as well.
> 0 votes

---
Tags: upgrade, php-errors, addons
---


title: Create a member-specific promo code

text:
# Question
Title: Create a member-specific promo code
I am relatively sure this can't be done yet, but worth checking. Is it possible to create an Expresso Store promo code that is only available to a specific member/user?

The idea here is to generate a discount promo code as a sort of credit/reward to a user for something he/she did, like register on the site.

The only thing I can think of at the moment is to create an additional table that will link a member to a discount promo entry. And then validate this myself during the checkout process.

Anyone with a better idea without hacking Expresso Store self?

# Answer
> 1 votes
Currently you are able to "**Restrict to Member Groups**" but not per member.

> If selected, this discount will only be available to logged in members of these member groups.

I'd suggest creating discounts with "Total Use Limit" set to 1 and an extremely unique "Promo Code" that can't be guessed. Use the "Notes" field to store the member ID... You can key off that member ID to do what you like.

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


title: Database corruption due to InnoDB?

text:
# Question
Title: Database corruption due to InnoDB?
We had some weird situation last night where a EE site we manage fell over of it's own accord and is this morning reporting SQL errors:

```
Error Number: 1286

Unknown storage engine 'InnoDB'

```

Closer inspection reveals that all of the affected tables are set to use InnoDB whereas the unaffected tables are using MyISAM.

I'm not sure what best practice is but I'm guessing have different tables running on different engines is less than ideal and I'm not even sure how it happened but this is a fairly old site that's moved from host to host and started out on EE 1.x.

What are the repercussions of changing database engine for an ExpressionEngine table (if any) and why might this have happened in the first place (the table corruption)?

# Answer
> 3 votes
You probably need to check with your web host, as that error tells me that they made a change to MySQL server, and it's no longer configured to work with InnoDB. Or that you just moved from a host that supported InnoDB to one that does not.

There aren't any huge gotchas with running different engines on different tables as long as you or your web host are familiar with them (can't generate backups with MySQL's MyISAM-only tools, for instance, no FULLTEXT search in InnoDB).

We often recommend InnoDB for users on hosts who are well-versed in configuring MySQL for InnoDB, with the exception of the `exp_cp_search` table because it uses FULLTEXT search, which is not available to InnoDB.

Changing the engines should not be a problem either way, though of course you will want to backup first - and fairly certain that the server you do it on will need to have both storage engines available.

---
Tags: database
---


title: Retrieving MAX Value Using ActiveRecord

text:
# Question
Title: Retrieving MAX Value Using ActiveRecord
I am trying to get the maximum value of the entry\_id within the exp\_channel\_titles field of an ExpressionEngine2 database using the following code:

```
ee()->db->select_max('entry_id');
$query = ee()->db->get('exp_channel_titles');
echo "<pre>";
   var_dump($query);
echo "</pre>";

```

Above code only gives me this:

```
object(CI_DB_mysql_result)[674]
  public 'conn_id' => resource(45, mysql link)
  public 'result_id' => resource(386, mysql result)
  public 'result_array' =>
    array (size=0)
      empty
  public 'result_object' =>
    array (size=0)
      empty
  public 'current_row' => int 0
  public 'num_rows' => int 1
  public 'row_data' => null

```

How could I get the actual MAX value from the query?

# Answer
This is your solution. Since select\_max will only result in one row you will not need to loop through all rows like a normal query. Just use $query-\>row();

```
        ee()->db->select_max('entry_id');
        $query = ee()->db->get('exp_channel_titles');

        echo $query->row();

```
> 1 votes

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


# Question
Title: Channel Form - attempt to edit and save results in blank page/error
I'm using EE's Channel Form to allow members to edit entries.

I've isolated the form into a test template and I'm currently not able to successfully submit the form.

When I press save it goes to a blank page. If I go back or refresh Chrome gives me "Confirm Form Resubmission" (with an error ERR\_CACHE\_MISS).

I've disabled jquery, which got rid of an error appearing in the console but it's still the same result.

Install details:

v2.7.2

Third party modules:

* Zoo Visitor 1.3.30
* Wygwam 3.1.2
* Taxonomy 3.0.8.2
* Playa 4.4.5

Template code:

```
        <html>
        <head>
                <link href="{path=css/_ee_channel_form_css}" type="text/css" rel="stylesheet" media="screen">
                {!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script> --}
        </head>
        <body>

            {exp:channel:form channel="wiki" return="wiki" url_title="homeworking" rte_selector=".wiki_body" datepicker="no" include_jquery="no"}

                    <h1>{title}</h1>

                    <p>{wiki_body}</p>

                    <input type="text" name="title" class="title" value="{title}">

                    <textarea type="text" name="wiki_body" class="wiki_body">
                    {wiki_body}
                    </textarea>

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

            {/exp:channel:form}

        </body>
        </html>

```

# Answer
> 0 votes
I am making an assumption here but my guess is that the template code you have shown is for the template wiki. If that is the case you are returning them to a template that can't parse the channel form tags because you aren't passing the need to know information. I have added a conditional that is checking segment 2 for success that i added to your return="wiki/success" and will display a success message. If i had some more info i believe i could solve this problem. such as template code for "wiki" or the page you are originally sending them, and what does the url say after you submit the code below.

```
<html>
        <head>
                <link href="{path=css/_ee_channel_form_css}" type="text/css" rel="stylesheet" media="screen">
                {!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script> --}
        </head>
        <body>

            {if "{segment_2}" == "success"}
              <h1>Your Submission Was Successful</h1>
            {if:else}
            {exp:channel:form channel="wiki" return="wiki/success" url_title="homeworking" rte_selector=".wiki_body" datepicker="no" include_jquery="no"}

                    <h1>{title}</h1>

                    <p>{wiki_body}</p>

                    <input type="text" name="title" class="title" value="{title}">

                    <textarea type="text" name="wiki_body" class="wiki_body">
                    {wiki_body}
                    </textarea>

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

            {/exp:channel:form}
            {/if}
        </body>
        </html>

```

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


# Question
Title: Grid {field:total rows} is not returning correct value
I have a field(let's call it `foo`) with the Grid Fieldtype.

I have conditional to check if `foo` is greater than 0 or not

Now here is the problem. It seems to me that when I only have 1 row in `foo`, `{foo:total_rows}` returns nothing.

I tried adding another row. This time `{foo:total_rows}` returns 2. It is the same thing with 3, 4, etc. Basically anything greater than 1.

This shouldn't be the case. If there is only 1 row, it should return 1.

I would to point out that the `foo` field is in a Channel with multiple Grid fieldtypes. It also has a relationship fieldtype for one of its columns.

I have another Grid field in that channel but without a realationship fieldtype for one of its columns. It is working correctly.

Any idea why this is happening?

**UPDATE**:

Tried out this code

```
<h3>field_total_rows {foo:field_total_rows}</h3>
<h3>total_rows {foo:total_rows}</h3>

{foo}
    <h3>loop field_total_rows {foo:field_total_rows}</h3>
    <h3>loop total_rows {foo:total_rows}</h3>
{/foo}

```

Output when the field contains only 1 row

```
field_total_rows
total_rows
loop field_total_rows 1
loop total_rows 1

```

Output when the field contains 2 rows

```
field_total_rows
total_rows 2
loop field_total_rows 2
loop total_rows 2
loop field_total_rows 2
loop total_rows 2

```
* Does this mean that the `total_rows` and `field_total_rows` can only be accessed inside the loop?
* Why does the total rows variable only appear if it is greater than 1?

# Answer
If your conditional is checking if it is \> 0 this would work fine as a replacement:

```
{if foo:total_rows != ""}
     You have more than 1 row.
{if:else}
     You have 1 row.
{/if}

```
> 2 votes

---
Tags: 2.7.0, grid
---


title: Relationship into relationship

text:
# Question
Title: Relationship into relationship
I have problem with related entries. I want to get related entries into a related entry. We are a travel agency and want to show selected travel packages in a "deals template".

Channels are:

deals, travel\_packages, destinatios

Deals deal\_01 relationship (to travel\_packages) deal\_01 relationship (to travel\_packages) deal\_01 relationship (to travel\_packages) deal\_01 relationship (to travel\_packages) deal\_01 relationship (to travel\_packages)

travel\_packages

```
date        text input
price       text input
taxes       text input
date        date
destination relationship (to destinations)
hotel       text input

```

destinations

```
pictures_name   text input
maps        text input
description textarea

```

In "deals" template we have 5 relationship fields than are related with travel\_packages. In deals template we chose the deals that we want to show.

Then in the template we have the follow code:

{exp:channel:entries channel="deals"} {related\_entries id="deal\_01"} Date: {date} (travel\_packages field) Price: {price} (travel\_packages field)

Here we want to show travel\_packages relationship with destinations channel

we want to show {title} {pictures\_name} {maps} Description: {description} But those tags are from destinations channels.

{related\_entries} {/exp:channel:entries}

We tried to use related\_entries again:

{related\_entries id="destination"} {title} {pictures\_name} {maps} Description: {description} {/related\_entries}

but it doesn't work.

Thanks in advance.

# Answer
Guessing by the style of relationship tags you are using the best way to do this is to use an embed.

Steps:

1.) Create a template with the code for the destinations with an embed variable in the entry\_id section.

```
{exp:channel:entries channel="destinations" entry_id="{embed:eid}"}
     <h1>{title} Related to the Package Deal</h1>
{/exp:channel:entries}

```

2.) Put that embed inside your travel package related entries loop with the entry id of the package in a eid variable you pass to the embed variable.

```
{exp:channel:entries channel="deals"}
  {related_entries id="deal_01"}
     Date: {date} Price: {price}
     {embed="path/to/embed/template" eid="{entry_id}"}
  {/related_entries}
{/exp:channel:entries}

```
> 1 votes

---
Tags: relationships, related-entries, related
---


# Question
Title: Creating an instance of Expression Engine 2 plugin class from template
I have created an EE2 plugin under third\_party folder and it succesfully shows up in Plugins list @ backend.

Now, is it possible to create an instance of that plugin class directly from a template as I don't need any template tag behaviour? Eg.

```
<?php
$cart = new Cart;
?>

```

Where as the plugin would have the following structure:

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$plugin_info = array();

/**
 * Cart Class
 * ...
 */

class Cart {

    var $return_data;
    function Cart() {
    }

    ...

}
?>

```

OR, is there a better way in achieving this preserving the possibility to use tags later on? Thanks!

# Answer
> 1 votes
It is generally bad practice to have php in your template. It isn't recommended by Ellis Lab and is not a good idea to even allow php in your templates in template preferences.

I hope this helps:

Here is my plugin starter kit. I hope this helps this will give you a plugin set up in a way that is able to be expanded on to add more functions and such.... to use the public construct it would be {exp:pluginname} if you added a function it would be {exp:pluginname:function} You will want to save this as pi.pluginname.php in a pluginname folder in the third-party folder.

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Pluginname Class

 * @package         ExpressionEngine
 * @category        Plugin
 * @author          Matthew Johnson
 * @copyright       Copyright (c) 2010, Jane Doe
 * @link            http://midwesterninteractive.com/
 */

$plugin_info = array(
    'pi_name'         => 'Pluginname',
    'pi_version'      => '1.0',
    'pi_author'       => 'Matthew Johnson',
    'pi_author_url'   => 'http://MidwesternInteractive.com/',
    'pi_description'  => 'Allows you to generate 1 of 13. ',
    'pi_usage'        => PluginName::usage()
);

class Pluginname
{

    public $return_data = "";

    // --------------------------------------------------------------------

    /**
     * Pluginname
     *
     * Plugin Description
     *
     * @access  public
     * @return  string
     */
    public function __construct()
    {
        $this->EE =& get_instance();

    }

    // --------------------------------------------------------------------

    /**
     * Usage
     *
     * This function describes how the plugin is used.
     *
     * @access  public
     * @return  string
     */
    public static function usage()
    {
        ob_start();  ?>

        @mattsidjohn
        @buildmidwestern
        http://midwesterninteractive.com

    <?php
        $buffer = ob_get_contents();
        ob_end_clean();

        return $buffer;
    }
    // END
}
/* End of file pi.pluginname.php */

```

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


# Question
Title: Outputting next post image within {exp:channel:next_entry}
I'm trying to output an image of the next post within my template like so...

```
{exp:channel:next_entry}
   <img src="{testimony_story_background}"/>
{/exp:channel:next_entry}

```

It doesn't work. What is the correct way to do this using a custom field that has been set up? I have tried using the query module but that that only seems to work outputting simple text fields. Here is an example...

```
{exp:query sql="SELECT field_id_16 FROM exp_channel_data WHERE entry_id = '{entry_id}'"}
   {field_id_16}
{/exp:query}

```

Any help would be wonderful!

# Answer
> 0 votes
I managed to do the following with the queries module and using a parse file path plugin:

```
 {exp:query sql="SELECT field_id_28 AS file FROM exp_channel_data WHERE entry_id = '{entry_id}'"}
                    {exp:parse_file_paths}
                        {file}
                    {/exp:parse_file_paths}
                    {/exp:query}

```

Plugin: https://github.com/rsanchez/parse\_file\_paths

# Answer
> 1 votes
Its not working because you aren't specifying a channel.

```
{exp:channel:next_entry channel="testimony"}
   <img src="{testimony_story_background}"/>
{/exp:channel:next_entry}

```

Couple things to keep in mind:

1.)These links can only be used on pages displaying a single entry, such as a “comment” page, since they are designed to provide navigation from one entry to another.

2.) These tags cannot be placed inside your main Channel Entries Tag. They must be placed outside of the Channel Entries tag in order to work correctly.

3.) If you are viewing the most recent entry in your channel, then the “next\_entry” tag’s contents will not be shown (since there is no “next entry”). Likewise, when you are viewing the oldest/first entry in the channel the “previous\_entry” content will not be shown.

# Answer
> 0 votes
You'll likely need to embed another channel entries tag inside the next\_entry pair like this.

**Main template**

```
{exp:channel:next_entry}
   {embed="includes/_next_image" entry_id="{entry_id}"}
{/exp:channel:next_entry}

```

**Embedded Template**

```
{exp:channel:entries entry_id="{embed:entry_id}" limit="1"}
    <img src="{testimony_story_background}"/>
{/exp:channel:entries}

```

---
Tags: channel-entries, custom-fields, image, next-prev
---


title: Extensions - where to start

text:
# Question
Title: Extensions - where to start
So, been using EE for some time but now want to push the limits and write some extensions and or plugin.

The extension needs to write the entry\_id of the entry just published by any user OR the entry\_id of the entry if posting a comment - to every members profile (or separate table).

When a member visits the entry, it would remove the entry\_id from their list.

EG:

--Install "extension"

----Extension creates new table - exp\_member\_read\_unread (User ID, list of entry\_ids)

--User creates a new post or comments on entry

----On save, extension kicks in and records the entries entry\_id to each members exp\_members\_read\_unread column. (eg: entry\_id column = 1,2,4,99,6)

**Background**: I'll be creating a server side read/unread visited/not visited since new stuff added - list for each member.

Second to this, I will need another plugin/extension to modify the users read/unread list once visited. That'll be another post I expect.

I can pound away at creating an SQL query but no solid idea on where to start or if an extension is the right approach. The docs are somehwat overwhelming to a N00b and cannot find simple starter examples - so looking to tap the brightest minds where possible :)

# Answer
Sorry i didn't read all the functionality you are wanting to create. To create all of the things you are wanting to do you will need to create a "module" there isn't a tone of great documentation out there on how to do that but here is a great read and information about the different types of EE extensions and small tutorials on doing so... I hope this helps and answers your questions.

http://ee-recipes.com/articles/page/the\_different\_types\_of\_expressionengine\_add\_ons

At the bottom you can click on each one giving you more info on each.

Here is a link to a easy module tutorial from the same source:

http://ee-recipes.com/articles/details/our-first-module-part-1

http://ee-recipes.com/articles/details/our-first-module-part-2-setting-up-the-file-structure

http://ee-recipes.com/articles/details/our-first-module-part-3-creating-a-database-table

The rest of the series is on the right hand side.
> 0 votes

---
Tags: module, extension, query
---


title: Apply coupon code when cart is empty

text:
# Question
Title: Apply coupon code when cart is empty
Would there be any easy way (or any issues) with allowing a customer to enter a coupon code before putting any items in his cart?

# Answer
The coupon code can be added at any time.

All you need to do is create a coupon code form somewhere using the {cartthrob:add\_coupon\_form} tags. http://cartthrob.com/docs/tags\_detail/add\_coupon\_form/

Really it's just a matter of creating your site's flow so the customer reaches that form first. It might be that you put the form on the homepage or you could create a separate page for it then do some kind of redirection to that page if the cart is empty (using total\_items tag within cart\_items\_info).
> 0 votes

---
Tags: cartthrob
---


title: expiration date and google crawl errors

text:
# Question
Title: expiration date and google crawl errors
I have a site with an "Events" page. Naturally, events come and go, and you don't want to see events from 2 years ago showing up on your site, so I have the admin person use the expiration date feature to have it no longer show on the website after the event has happened. Recently I went onto the google webmaster tools for the site and saw that there were 404 crawl errors for the events that had expired.

Is this a problem, and if so, how do I correct it?

# Answer
> 1 votes
If I understand your situation this is the expected (and desired) result.

You don't want old event entries showing up on the site so you set them to expire. When an expired entry's page is requested the default behavior is a 404 error (page not found). All Google Webmaster tools is confirming here is that it tried to crawl those expired pages and could not find them.

If you still want individual expired entries to be able to load, then in your `channel:entries` tag in your entry detail template you will need to set the `show_expired` parameter to "yes."

# Answer
> 1 votes
No it's not a problem. The 404 is exactly what SHOULD be returned to Google. Over time Google will drop those URLs from its index.

In a way the "problem" is fixed since it's doing precisely what you want it to do but Google may report future 404s especially if you have that URL in a Google Site map file.

# Answer
> 0 votes
Maybe do a redirect for expired events, on the same page when it expires, the page could redirect to the most recent event, altough , are you using Pages module ?

---
Tags: channel-entries
---


title: Get label from PT Pill field

text:
# Question
Title: Get label from PT Pill field
I have a FieldPack Pill field called `companies_type` with the following options:

```
physical : Physical Store
webshop : Webshop

```

To print the fields value I can just use `companies_type` but how can I get the value's label? (Webshop or Physical Store in the this situation)

I've tried with `companies_type:label`, `companies_type:option`, `companies_type:value` and all those inside a tag pair as wel: `{companies_type}{label}{/companies_type}`

Anyone know how/if this is possible?

# Answer
There is only one correct syntax style: `{companies_type:label}`.

If it's not working you might have changed your options after saving an entry. So the stored value is not matching any options anymore and thus resulting an empty value for `{companies_type:label}` and `{companies_type}`.
> 3 votes

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


# Question
Title: Can Super Search search categories in a matrix fieldtype?
Let me start out by saying that I am using Super Search 2.1.3 and on EE version 2.7.3.

Here is my problem. I have a channel for each product I'm selling. Each product has a Matrix field that can have several "variations" on that product and is really the meat of the data about the product itself. For instance, let's say the product is a particular table for this example. The variations for that table would be "Solid Top Table" and "Extension Table". Each variation would have a series number, product number, dimensions, categories etc. I'm using WB Category Select (1.3.5) to simply associate my categories with each matrix row, which is the important part because it's what my question is all about.

Can I use Super Search to search for the categories associated with each Matrix row for that product variation and, essentially, the product as a whole?

From what I've read this does not seem possible, however if someone has any ideas it would be greatly appreciated!

Thanks!

# Answer
> 1 votes
Ahmad, thank you for your response. I edited what I originally stated above to move it into an actual answer. The fields did need to be checked again to verify that they were truly searchable.

However, now that they are I have found that some fields will be included in the search results while the categories do not get included in the search. From my testing there is no way to search for a WB Category field in a Matrix field using EE or the Super Search plugin. The way the data is stored using WB Categories, the IDs are displayed in the matrix data instead of the actual category text.

So, the answer is that the EE or Super Search plugin will check any searchable Matrix field, but the data obviously wasn't what I was expecting so the search results were different as well.

# Answer
> 1 votes
a lot of custom fields here.

I don't know about Super Search , but for EE search you can search in Matrix data if you mark the field as searchable as mention here;

Matrix & Simple Search

I hope this will help you.

Regard's.

---
Tags: matrix, categories, supersearch
---


# Question
Title: Expression Engine not returning results for some items
I have a site at review.gemalto.com and several articles have "NFC" in the title and body.

However searching for NFC returns zero results.

Other search terms such as "Singapore" and "security" work as expected.

I'm at a loss as to why this is happening. Any ideas?

# Answer
This could possibly be because of the minimum length of a search string. I'm not 100% certain but I think anything under 4 characters doesn't get indexed/searched.

Does it work for other 3 character strings?
> 1 votes

---
Tags: search
---


# Question
Title: Exp:resso Store - Modifier stock levels/availability
We have a client who sells bespoke cookers. Cookers have numerous colour choices, and also trim options. However not all trim options are available with all colours.

For example the X range has Green, Blue, and Black for colour, and Brushed, Chrome and Brass for trim. Black only has Brushed and Chrome available, but Green and Blue have all three.

I considered using the limit stock row and setting the stock level to 0 (since none of the others are stock tracked since they're build to order) but couldn't see a way to wrap the modifier options in a track\_stock conditional, it seems it only works on a product wide basis. I also thought about using the SKU (eg if the SKU is empty, disable the option) but that doesn't seem to work either.

Ideally the code would be something along these lines

```
<select id="{modifier_input_name}" name="{modifier_input_name}">
    {modifier_options}
        <option value="{option_id}" {if SKU/TRACK_STOCK/ETC == ""}disabled{/if}>
            {option_name} {if price_mod_val} ({price_mod}) {/if}
        </option>
    {/modifier_options}
</select>

```

Basically, is there a way to disable the options if the variant is unavailable?

# Answer
> 5 votes
Similar question here, I left the teaser for the out of stock bit, but nobody picked up on it :(

I wrote a plugin that pulls back all the options for multiple modifiers, you can then use JavaScript to query the information and change what options are available for each modifier. So when they select the colour, you can look at what trims are in stock and hide those not in stock.

The template code:

```
{modifiers}
     {if "{modifier_name}" != ""}
         {if {exp:store_options:total entry_id="{entry_id}" parse="inward"} <= 1}
             <p>{modifier_name}: {modifier_options}{option_name} {/modifier_options}</p>
                 <input type="hidden" name="{modifier_input_name}" value="{modifier_options}{option_id}{/modifier_options}">
         {if:else}
             <label>
                 <select id="{modifier_name}" name="{modifier_input_name}" class="dropdown required" tabindex="1">
                    <option value="">-- Select {modifier_name} --</option>
                    {modifier_options}
                        <option value="{option_id}" {if "{modifier_name}" == "Colour"} itemprop="color"{/if}>{option_name}</option>
                    {/modifier_options}
                </select>
            </label>
        {/if}
    {/if}
{/modifiers}

<ol id="stock-lookup">
    {exp:store_options:all entry_id="{entry_id}"}
        <li data-colour="{Colour}" data-size="{Size}" data-stock="{stock}">{if no_stock} (out of stock){/if}</li>
    {/exp:store_options:all}
</ol>

```

In the above, I'm allowing 2 modifiers Colour and Size. The OL list #stock-lookup is a hidden element to store the lookup information I need - I expect this could be changed to a JavaScript array if preferred. For the select output I'm checking for a single option - I don't then want to show a select menu, but need to have a hidden field to pass with the form submission.

Then the JavaScript function called upon changing either of the select boxes. $formElement being the JQuery object for the select they selected and "Label" being the value of the item selected - used for matching with the product options:

```
function checkStockLabels($formElement, label) {
    //###   Update the [other] select box with only the available options (instead of all)    ###
    if ($formElement.attr("id") == "Colour") {
        if ($(".product-desc #Size").length) {
            //###   Check the Size list to show message on unavailable options   ###
            $("#dk_container_Size li a span").remove("span");
            $('#stock-lookup li[data-colour="'+label+'"]').each(function( index ) {
                sizeRef = $("#dk_container_Size li a:contains('"+$(this).attr("data-size")+"')").attr('data-dk-dropdown-value');
                $("#dk_container_Size li a:contains('"+$(this).attr("data-size")+"')").append('<span>'+$(this).html()+'</span>');
                defaultLabel = $("#dk_container_Size .dk_options a:first").html();
                if ($("#dk_container_Size .dk_label").html() != defaultLabel || $("#dk_container_Size li a").length <= 2) {
                    $("#dk_container_Size li a[data-dk-dropdown-value='"+sizeRef+"']").click();
                }
            });
        }

    } else if ($formElement.attr("id") == "Size") {
        if ($("#Colour").length) {
            //###   Check the Colour list to show message on unavailable options   ###
            $("#dk_container_Colour li a span").remove("span");
            $('#stock-lookup li[data-size="'+label+'"]').each(function( index ) {
                $("#dk_container_Colour li a:contains('"+$(this).attr("data-colour")+"')").append('<span>'+$(this).html()+'</span>');
            });
        }
    }
}//###   End of checkStockLabels function   ###

```

To add to the confusion of JS code, I'm using DropKick as a Select skinning replacement. The spans are the inserted "out of stock" text - because child elements are not valid in a select - option, I'm solving this due to dropkick converting it to an li. But you would simply be removing the select option completely, so no need to insert the spans or remove them, or better still disable and hide.

If you need more clarification, let me know and I'll expand upon the above.

ExpressionEngine Expresso Store Options Plugin can be found here. Note: Not tested on latest Expresso Store version!

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


# Question
Title: search through category names using search function?
Is it possible to parse through and display category names using the search function? So, beyond simple channel entries I mean.

If so (or if this requires some kind of add on) could you provide me with details?

I have it doing what I want for a client, but they may want to be able to look through the categories as well. The reason for this, is that they're selling certain brands and they'd like for potential customers to not only look through the product name ('Apple Green') but also the brand ('Bendel').

# Answer
Highly recommend Low Search which extends EE's native searching and allows for category indexing (name, description or any custom category fields). Specific link to category documentation here.
> 0 votes

---
Tags: simple-search
---


# Question
Title: Expresso store add if statement to order confirmation email
Is it possible to put an if statement in the order confirmation email?

like so?

```
{if shipping_address2}{shipping_address2}<br />{/if}

```

# Answer
> 2 votes
Yes you should be able to use most EE tags without issues in the Store email templates.

---
Tags: expresso-store, email, html-email, confirmation
---


# Question
Title: Calendar - Shows event beginning date and not the current event date
I am running Solspace Calendar 1.8.9 on EE 2.8.1 and I am having an issue with recurring events not reflecting the next event date, but instead showing the first event date.

Example: On this page, the first event is "Southern Fried Comics..." with a date of 7.7.2014. However, if you click on the title it takes you to the event details page where the Date is displayed as July 2.

Here is the code on the first page:

```
{exp:calendar:cal
                    date_range_start="today"
                    orderby="event_start_date"
                    category="{segment_3}"
                    show_months="3"
                    dynamic="off"
                    event_limit="10"
                    paginate="bottom"
                    }
                            <div class="event-summary">
                                    <div class="details">
                                        <span class="event-title"><a href="{path='calendar/event'}/{event_url_title}">{event_title}</a></span>
                                        {exp:trunchtml chars="100" inline="..." }{event_summary}{/exp:trunchtml}
                                        <span class="local-time">{event_location} | {event_start_date format="%g:%i%a"} | {contact_phone}</span>
                                        <p class="learn-more" ><a href="{path='calendar/event'}/{event_url_title}">Learn More »</a></p>
                                    </div><!-- end .details -->

                                    <div class="date-details">
                                        <span class="month-day">{event_start_date format="%n.%j"}</span><br />
                                        <span class="year">{event_start_date format="%Y"}</span>
                                    </div>
                                    <div class="clearer"></div>
                            </div><!-- end .event-summary -->

                                    {paginate}
                                        <div class="pagination">
                                            Page <span class="this-page">{current_page}</span> of {total_pages} pages   {pagination_links}
                                        </div>
                                    {/paginate}

{/exp:calendar:cal}

```

And here is the code for the event page:

```
{exp:calendar:events
                    limit="1"
                    event_name="{segment_3}"
                    dynamic="no" }
                        <h3>{event_title}</h3>

                        <div id="event-details">

                            <h4>When:</h4>
                                <p>
                              {if event_recurs}
                                 {exp:calendar:date
                                    base_date="{segment_4}-{segment_5}-{segment_6}"
                                    output_date="today"
                                 }
                                    {date format="%l, %F %j"} @ {event_start_date format="%g:%i%a"}
                                 {/exp:calendar:date}
                              {if:else}
                                 {event_start_date format="%l, %F %j @ %g:%i%a"}
                              {/if}
                           </p>

                            <h4>Location:</h4>
                            <p>{event_location}
                                {if event_address}<br />
                                    {event_address}
                                {/if}
                            </p>

                            <h4>Admission:</h4>
                            <p>{admission}</p>

                            <h4>Contact</h4>
                            <p>{contact_phone}</p>

                    {/exp:calendar:events}

                    <div id="more-events">
                                <h4>More Events</h4>

                        {exp:calendar:cal
                            calendar_id="11"
                            date_range_start="{segment_3}-{segment_4}-{segment_5}"
                            date_range_end="{segment_3}-{segment_4}-{segment_5}"
                            pad_short_weeks="n"
                            event_limit="3"
                            dynamic="off"}
                            <div class="event-mini">
                                <span>{event_start_date format="%m.%d"}</span>
                                <p><a href="{path='calendar/event'}/{event_id}/">{event_title}</a></p>
                             <div class="clearer"></div>
                            </div>
                        {/exp:calendar:cal}

                        <p  class="more-events"><a href="{site_url}calendar/">{ More Events }</a></p>
                    </div><!-- #more-events -->

                        </div><!-- end #event-details -->

                        <div id="event-full-description">
                        {exp:calendar:events orderby="title" sort="asc" limit="1" event_name="{segment_3}" date_range_start="today" show_months="6" dynamic="off"}
                                {event_summary}
    {/exp:calendar:events}

```

How can I change the code so it reflects the correct date?

Thanks!

# Answer
Use `{exp:calendar:cal}` for your details page. This is the tag that will display only the occurrences of an event within the timeframe set in `date_range_start=""` and `date_range_end=""` (also add `pad_short_weeks="n"`!).

Building an events detail page with a specific date "zoomed in" has been answered in another thread, with the full solution posted here: Get (Solspace) calendar occurences sorted by date

(I believe *ExpressionEngine® Answers* doesn't like links to solutions and prefers full inline answers. If that's necessary, I can post the same answer from that thread here.)
> 0 votes

# Answer
You have to use the 'occurrences' tag within the loop to display the specific event occurrence that you want. http://www.solspace.com/docs/calendar/occurrences/ Use event\_range\_start and event\_range\_end to select the proper occurence. The date value you're using in the above code is only for the date used on the first entry.

```
{exp:calendar:occurrences
    date_range_start="{segment_3}-{segment_4}-{segment_5}"
    date_range_end="{segment_3}-{segment_4}-{segment_5}"
    dynamic="off"
}

```
> 0 votes

---
Tags: solspace-calendar
---


# Question
Title: Amount Is Invalid. Amount Must Be In Cents
This is the first time I am getting this error. I am currently using PayU as payment gateway and integrated this by using Omnipay in expresso store in my EE2 project. In my request object that I need to send to PayU I need to times the amount by 100 to convert this into cents and I am doing this.

The error I get is: `{"store_payment_error":"Amount is invalid. Amount must be in cents"}`

I got this error when I had an order amount of R22 293.36. Is this too big an amount for the gateway or store to handle? I am sure this shouldn't be the problem? I have over 200 orders that I tested already, but the first time I am getting this error?

# Answer
**FIXED:** I am using the function `$this->getAmountInteger();` where I am building the request object to send the info over to the payment gateway and timed this by 100 to convert it into cents. **BE AWARE** that this function already times the order/cart amount by 100, hence there is no need to have it as `$this->getAmountInteger() * 100;`
> 1 votes

---
Tags: expresso-store, ee2, payment-gateway, omnipay, payu
---


# Question
Title: Why does a multiselect fieldtype custom field result in a DB error
I have created a custom fieldtype that uses a multiselect box. However when I save the entry in the CMS, the following error occurs

```
A Database Error Occurred
Error Number: 1054

Unknown column 'Array' in 'field list'

UPDATE `exp_channel_data` SET `channel_id` = '27', `field_id_108` = Array, `field_id_109`...

```

Any suggestions? I have checked the Multiselect fieldtype within EE and my code looks OK (I think)

# Answer
> 1 votes
Since you're using a multiselect element, you're posting an *array* of data when the entry is saved. But you can't simply insert an array into the database - you need to turn it into a string.

So in your fieldtype's `save()` method, you need to do something like:

```
return implode('|', $data);

```

Or:

```
return json_encode($data);

```

Then you need to turn your data back into an array in `replace_tag()` and `display_field()`.

```
$data = explode('|', $data);

```

Or:

```
$data = json_decode($data);

```

---
Tags: custom-fields, fieldtype, channel-fields, multiselect
---


title: Error pages in expresso store?

text:
# Question
Title: Error pages in expresso store?
Looking to be able to style/customize error pages for Expresso Store or EE. Anyone have experience ideas of this please? Thanks.

# Answer
> 7 votes
The easiest way to customize the error messages shown would be to set `error_handling=”inline”` in your checkout template opening tag as mentioned in the docs here. Then you would be able to add `{error:field_name}` anywhere you would like to show the errors.

Alternatively if you want to customize the text that is shown you can do something like:

`{if error:field_name}Whoa buddy! Your custom error message for this field_name goes here.{/if}`

If that doesn't fit your needs you would need to use something like Custom System Messages of LibrarEE or redoing the built in error templates to suit your needs.

# Answer
> 3 votes
I'm not sure if Store has it's own error pages or not though, for EE itself take a look at Custom System Messages for styling all your error pages:

http://devot-ee.com/add-ons/custom-system-messages

# Answer
> 3 votes
You can control the page EE shows when a 404 is encountered via your Global Template Preferences.

The error page you see when EE or an add-on encounters a submission error, or when you're being redirected after a form submission, is controlled via the User Message Template.

# Answer
> 0 votes
Wrap your error code i.e. `{error:field_name}` in a label tag and then style your label tag with some css. This ought to do the trick.

Something like:

```
<label class="error">{error:field_name}</label>

```

---
Tags: add-on, expresso-store, error-pages, system-messages
---


# Question
Title: Solspace Ratings Pagination Links Variable Pair
I read in the old solspace forums that the the rating module would support the ee variable pairs {pagination\_links} {/pagination\_links}

But when i add them ton the template only the tag {pagination\_links} renders.

Do you know if its supported?

I am using the latest version of ee and the ratings module

Thanks

```
{exp:rating:entries collection="Apartment Reviews" limit="10" orderby="rating_date" sort="desc" paginate="bottom"}
    {rating_paginate}
        <div class="paging x">
            {pagination_links}
                {page}
                    <ul>
                        {previous_page}
                            <li class="prev"><a href="{pagination_url}">«</a></li>
                        {/previous_page}

                        <li><a href="{pagination_url}">{pagination_page_number}</a></li>

                        {next_page}
                            <li class="next"><a href="{pagination_url}">»</a></li>
                        {/next_page}
                {/page}

                </ul>
            {/pagination_links}
        </div>
    {/rating_paginate}
{/exp:rating:entries}

```

# Answer
It looks like Solspace did not update the pagination class used on Ratings. The same thing happened some time ago with Calendar. The EECMS updated the pagination class, but Calendar was using the CodeIgniter pagination class.

Please, check if you're using the last versions of Rating and EECMS. If you are, contact Solspace and report the issue as a bug.
> 0 votes

---
Tags: solspace, module
---


# Question
Title: Solspace Tag and serach by tags from tag group
I have created tags group "Attributes", which contain tags for product colors, material which was made etc.

I have set that tag field as searchable, but I have hit a wall on searching site using tags from the "Attribute"

Example: searching for "red Pinto Paris armchair" where 'red' is an attribute tag, 'Pinto Paris' is the product name (EE title entry field) and an 'armchair' comes from the product description (EE entry field). I'm able to search for "Pinto Paris armchair" but is not show up only those armchairs tagged as a red.

Search snippet looks like:

```
{exp:search:simple_form channel="products" search_in="everywhere" result_page="search" no_result_page="search/noresults" status="retail|open" where="all" results="12"}
          <label for="keywords">Search</label>
          <input type="text" name="keywords" id="keywords" placeholder="Search" />
          <button type="submit" name="submit"><i class="icon-chevron-right"></i></button>
{/exp:search:simple_form}

```

Any clue what can be wrong?

Thanks

# Answer
Tag data should be saved to `exp_channel_data`, and therefore be searchable. Super Search can search Tags like this. Although I'm not sure for EE's simple\_search form, I assume it would also work fine.

Is the Tag field set as searchable? If not, please set it as searchable in the custom field settings in the EE CP. You may need to re-save the entry so that the data ends up in `exp_channel_data`.
> 1 votes

---
Tags: search, tags, solspace-tag
---


# Question
Title: Cart Throb: Shed light on CRON Job denial
I'm working on setting up a CRON Job for Cart Throbs subscription package. At first I was getting a "Permission Denied" response until I granted shell access to the account, now the CRON Job returns with "403: Forbidden". What could I be missing?

I have "sh /copied/path/from/cartthrob" running every hour.

# Answer
This may be a bit too late to be helpful in your situation but in the event someone else runs into a similar scenario, here are a couple things you could try to resolve the 403 error:

* Restart apache if you havent done that since setting up the cron job
* Check to make sure the permissions on the directory or file the cron job uses are correct.
* Make sure apache has read/write access to the filesystem (its usually the www-data user)
* Check to make sure your apache conf or vhost have the allow directive set properly for the directory the cron task needs to interact with
> 1 votes

---
Tags: cartthrob, subscriptions, cron
---


title: Retrieving Next Available Entry ID

text:
# Question
Title: Retrieving Next Available Entry ID
Using Active Record in an EE2 project, is there a specific function that retrieves the next available entry id of a record I am going to insert?

At the moment I have this code to generate the next id before I insert a record into the database:

```
$this->EE->db->select_max('entry_id');
$this->EE->db->from('exp_channel_titles');
$entry_result = $this->EE->db->get()->result_array();
$entry_id = intval($entry_result[0]['entry_id'] + 1);

```

# Answer
Why would you want to find out prior to inserting?

When inserting, you can find out the new entry ID added using...

```
ee()->db->insert_id();

```

From the Docs.

So...

```
$data = array(
           <your field>       =>  <your value>
);
if ( ee()->db->insert('exp_channel_titles', $data) ) {
    $new_entry_id = ee()->db->insert_id();
}

```

I've used the super global here, if you're using an old version of EE, then use the legacy `$this->EE`.
> 1 votes

---
Tags: ee2, entryid, activerecord
---


title: Draggable doesn't save order

text:
# Question
Title: Draggable doesn't save order
Someone know why Draggable doesn't save new categories order? I use draggable 1.4.2 with ExpressionEngine 2.8.1

# Answer
Stemwinder has fix the bug with URLs in 2.8.1

https://github.com/stemwinder/draggable
> 1 votes

---
Tags: categories, sorting
---


# Question
Title: Freeform Pro checkbox group displaying checkbox above label
I'm having a problem with checkboxes displaying above their label when using `{freeform:field:FIELD_NAME}` for checkbox\_group field types.

I've tried applying classes by using `attr:NAME` as well as wrapper\_open/close and row\_wrapper\_open/close options, but nothing is working.

Is there some way to make my checkboxes display inline with their labels that I'm overlooking?

# Answer
It sounds like all you need to do is apply `display: inline;` to both your `label` and `input` elements. Those elements are `inline` by default, so is it possible that you're setting them to `block` somewhere else in your stylesheet? Also, check your markup output in Developer Tools or Firebug; are your `label` and `input` wrapped in a block-level element?

For me, I did something like this:

```
{if composer:field_type == 'checkbox_group'}
    {freeform:field:{composer:field_name}
        attr:class="control--checkbox-group"
        wrapper_open="<div>"
        wrapper_close="</div>"
        row_wrapper_open="<div>"
        row_wrapper_close="</div>"
        input_wrapper_open=""
        input_wrapper_close=""
    }
{/if}

```

The markup looks like this: http://cl.ly/image/1w1o1f1P1X2N; and then I used the class `control--checkbox-group` to style and format the controls.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Checkbox inline with label using the composer
I would like to get the label and checkbox inline using composer.

This is the current code rendered by the `{composer:field_output}` tag:

```
<div class="unit size1of1">
  <label for="freeform_newsletter">
    Newsletter
  </label>
  <p>
    <input type="hidden" name="newsletter" value="n">
    <input type="checkbox" name="newsletter" value="y" id="freeform_newsletter">
  </p>
</div>

```

But I'd like it to render something like this, still using the `{composer:field_output}` tag while selecting all items containing checkboxes:

```
<label  for="freeform_newsletter" class="checkbox-inline">
  <input type="hidden" name="newsletter" value="n">
  <input type="checkbox" name="newsletter" value="y" id="freeform_newsletter"> Newsletter
</label>

```

# Answer
You'd have to manually write that out instead of use the composer tag.
> 1 votes

# Answer
This snippet should do it.

```
{if composer:field_type == 'checkbox'}
    <label{if composer:field_name != ''} for="freeform_{composer:field_name}"{/if} class="checkbox-inline">
        {if composer:field_required}
            {freeform:field:{composer:field_name} attr:required="required"}
        {if:else}
            {freeform:field:{composer:field_name}}
        {/if}
        {composer:field_label}{if composer:field_required}<span class="required">*</span>{/if}
    </label>
{if:else}
    {if composer:field_required}
        {freeform:field:{composer:field_name} attr:required="required"}
    {if:else}
        {composer:field_output}
    {/if}
{/if}

```
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Zoo Visitor Fields Displaying Tag Instead Of Member Data
I am trying to map the member fields of EE2 to the zoo visitor fields to display the user's previously registered shipping and billing details and I am using the value '`{visitor:global:shipping_phone}`' to retrieve the values, but the value of the phone field is showing the actual text '`{visitor:global:shipping_phone}`'. I am wrapping my form fields with the '`{exp:zoo_visitor:details}`' tag.

I have also mapped the two fields in the backend.

What else am I missing?

# Answer
> 1 votes
`shipping_phone` is not a ZV global variable. If the tag doesn't exist then it will always just output as a string. If this is on the member account page then you just need to use the member details tag pair with their respective fields as shown in their docs.

---
Tags: ee2, zoo-visitor
---


# Question
Title: HTML will not display 'if' image set as 'cover'
No idea if this is possible. I currently have an entry setup, that if an image is uploaded, it will appear at the bottom of the page, in a 'gallery' format below a heading, being: Gallery: Click to enlarge.

Now if the uploaded image is set as a 'cover' image, it will appear at the top right of the page (right of the text) instead of at the bottom (gallery) of the page.

This works fine, see code:

(This appears at the top of the page)

```
{exp:channel_images:images entry_id="{entry_id}" limit="1" cover_only="yes" force_cover="yes"}
...my image...
{/exp:channel_images:images}

```

(This appears at the bottom of the page)

```
{if news_image}

<div class="gal">
<h4>Gallery: Click to enlarge</h4>
{exp:channel_images:images entry_id="{entry_id}" skip_cover="yes"}
...my image(s)... (appearing within individual divs)
{/exp:channel_images:images}
</div>

{/if}

```

Because my 'if' statement just looks to see if an image exists, the Div AND the H4 heading still appear at the bottom of the page, even if the image is set as 'cover'.

So, is it possible to customise the 'if' statement so that my html code (div/h4 ) will ALSO not appear (when the image is set as cover).

Any help is appreciated. (I understand that this is not necessarily a channel images question).

# Answer
Here is what you want to do.

```
    {if news_image}
      {exp:channel_images:images entry_id="{entry_id}" skip_cover="yes"}
        {!-- only opening HTML data on the first loop --}
        {if "{image:count}" == "1"}
          <div class="gal">
          <h4>Gallery: Click to enlarge</h4>
        {/if}

        ...my image(s)... (appearing within individual divs)

        {!-- Closes HTML data on the last loop --}
        {if "{image:count}" == "{image:total}"}
          </div>
        {/if}
      {/exp:channel_images:images}
    {/if}

```
> 3 votes

---
Tags: channel-images
---


# Question
Title: How to build a table in a form using DevDemon Forms?
I am trying to build a form for booking rooms using DevDemon Forms. The data I need to collect has a tabular format like this:

Room 1 name -- Date from -- Date to -- Time from -- Time to

How can I implement this using the said module? I have 5 columns so the 4 column layout widget does not work for this.

A solution would be to integrate a matrix field into forms - but I don't think this is possible.

# Answer
> 1 votes
You could do this using CSS. We provide a considerable amount of wrappers around each input field. Simply drag and drop the form fields you want and save the form. Then open your template and grab the ids of each wrapper. Then using divs you could float and/or inline-block them to work as columns.

Another option is you could just publish the form and grab the field names. Then using the tag pair you could just make your own fields and use whatever markup you want. This makes it less "automated" but if you do not need the content admin to adjust the form, this could be an option as well.

---
Tags: forms, devdemon, devdemon-forms
---


title: Channel field within a playa tag pair

text:
# Question
Title: Channel field within a playa tag pair
I'm using a playa tag pair to display some related information. But would like to include a field from a different channel entry in the middle of the tag pair. I tried closing the play tag par before the field and then opening it up afterwards and continuing the loop, but this didn't work.

Could anyone offer any advice? Thanks

Here's my code, (the {tour\_director\_tour\_specific\_text} field is from the 'tour' channel not the playa related fields)

```
{exp:channel:entries channel='tour' disable="category_fields|member_data|pagination" dynamic="yes"}
                       {tour_to_tour_personnel}
                        <div class="unit1">
                            <div class="imageLeft">
                                <img src="{site_url}images/general/portrait-andrew-wilson.jpg" alt="portrait-andrew-wilson" width="100%" />
                            </div>
                            <div class="textRight">
                                <p>{tour_director_name_first} {tour_director_name_last}{if tour_director_name_qualification}, {/if}{tour_director_name_qualification}.</p>
                                <p>{tour_director_tour_specific_text}</p>
                                <p class="cta"><a href="{site_url}tour-directors/{url_title}">full biography and other tours</a></p>
                            </div>
                        </div>
                        {/tour_to_tour_personnel}
{/exp:channel:entries}

```

# Answer
> 1 votes
I believe you have to add var\_prefix to your playa field so that you can distinguish between the two channels. If you add var\_prefix="tttp" then your fields will be {tttp:tour\_director\_name\_first}. Then your previous channel should work.

---
Tags: channel-entries, playa, channel-fields
---


title: Expresso - Cart button not working

text:
# Question
Title: Expresso - Cart button not working
I've just updated the paypal express settings to use the LILVE api/creditials/signature and now the cart button is not working. I presume this is because the settings are incorrect. Is there anything else that could cause this to happen. Everything was/is working fine with the sandbox details.

Is there anything I need to do on paypal?

Thanks Dave

# Answer
If the page is reloading there are a couple things that you should do.

* In the final step of your checkout process make sure that you have `{error:payment_method}` in your template (docs).
* Remove `error_handling="inline"` from the opening checkout tag on the last page this will show the default error page instead of putting things inline which would only show up if you had the proper `{error:field_name}` tag in your template.

That should give you a good indication of what is causing the problem. I found in the past sometimes with PayPal you have to create a new API key to do that goto:

> Profile \> My Selling Tools \> API Access \> Request/View API Credentials (Option 2) \> Request API Signature

You will then need to copy/paste those fields into the PayPal Express gateway settings.
> 1 votes

---
Tags: expresso-store, paypal, 2.8, paypal-express-checkout
---


# Question
Title: pagination gets This webpage is not available
I am totally lost.

So pagination is something i have used many times except this time it gives an "This webpage is not available" ?

i stripped down everything to the minimum and this is the code

**EDIT** {exp:channel:entries channel="blog" limit="1" }

## {title}

```
    {paginate}
    <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
  {/paginate}

 {/exp:channel:entries}

```

If i remove {pagination} it works perfect, the moment i add pagination it's all gone!

What is it that i'm doing wrong?

Extra module that i have added lately is the publisher , but i'm not sure that is even related.

# Answer
Try adding paginate="bottom" parameter.

```
     {exp:channel:entries channel="channel_name" paginate="bottom"}
        {paginate}
           <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
        {/paginate}
     {/exp:channel:entries}

```
> 1 votes

---
Tags: channel, pagination, get
---


title: How to use JSON in templates?

text:
# Question
Title: How to use JSON in templates?
Some of my templates outputs JSON string, which was designed to be consumed by the frontend's JS. However, I also have the need to consume this JSON within my templates. Is there an add-on that I can use that takes a JSON string and converts it to loopable EE data? If not, how can I approach this problem?

# Answer
Here is an example of how you can parse JSON and then loop through the data and append html to the data and your DOM with JavaScript.

https://stackoverflow.com/questions/5715952/parsing-json-in-javascript-using-for-loop
> -1 votes

---
Tags: templates, json
---


# Question
Title: PHP Errors in CP when using DataGrab to parse remote feed
I'm using the following:

```
EE v2.8.1
DataGrab 1.8.0

```

I have a number of data imports set up, using various formats such as CSV, XML, JSON, etc. Since upgrading to EE 2.8.1, I get this Error message when I run the import on any of them, displayed at the top of the page in the control panel:

> A PHP Error was encountered Severity: Notice Message: Undefined index: entry\_id Filename: pages/tab.pages.php Line Number: 195

The data import itself seems to work fine, but these ugly errors cannot be part of the final deliverable to my client.

The file referenced (system/expressionengine/modules/pages/tab.pages.php) is not part of the DataGrab add-on so I'm not sure what is going on.

I would appreciate any help.

Angel

# Answer
My best guess is that when you are importing your data you are creating channel entries. Pages is a tab in your channel entry that isn't getting referenced or set correctly because of this mass import of data. You might reach out to the developer of Pages to get this resolved.
> 0 votes

---
Tags: ee2, datagrab
---


# Question
Title: Possible to access templates from plugin?
From within a plugin, is it possible to access a template? I need to do some processing on the resulting output of a template from within the plugin.

# Answer
> 1 votes
Using `ee()->TMPL->tagdata` you have access to every element between your plugin tags on the page. You can then do anything with that and return it to the page using `ee()->TMPL->parse_variables`

I'd suggest checking out the Template Class docs for more details.

# Answer
> 0 votes
You could also have your plugin take a parameter json="json data" and then you would have it to parse and render in your plugin then display it back in your template.

Template:

```
{exp:jsonplugin json="{embed="your/template}"}

```

Plugin:

```
$json = ee()->TMPL->fetch_param('json');

```

In your plugin.

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


# Question
Title: Moblog - Entries aren't created, no error
I've managed to get the moblog to work previously, but now, I can't even get it to create an entry. If there are no emails in the mailbox I'm checking, it says `"No valid emails were found"`, so it seems it manages to connect just fine. But if I actually send an email to that address with the correct Moblog Subject Prefix, I get no error message. But there are no entries created either. Even the simplest moblog template with only `{text}` doesn't work. No entries are created. What am I doing wrong?

# Answer
Finally managed to fix this issue. First of all, I suspected that the default field in the moblog config could be the culprit. So it became apparent that moblog only supports textarea and textfield by default. So the default field was empty in my moblog configuration.

Editing the ExpressionEngine $default\_config to include the following `'moblog_allow_nontextareas' => 'y',` made it possible to select all my channel fields as default field. And thus, the post was created as expected. This really is badly documented by EllisLag. But then again, it's not a very used feature anyway.
> 2 votes

---
Tags: templates, fields
---


# Question
Title: How to display more entries from the same channel, but exclude one already being shown?
EE 2.6.1

I have a page with a standard channel entries tag as follows:

```
{exp:channel:entries limit="1" channel="{embed:category}"}

{/exp:channel:entries}

```

followed by another channel entries tag, which is included as an embedded file:

```
{exp:channel:entries limit="6" channel="{segment_1}" url_title="not {segment_2}" orderby="random" dynamic="no"}

```

What I'm trying to do is show further entries from the same channel, but not the entry in the second segment, which is already being shown on the page. So, if I was displaying an entry from the Cakes channel, the 2nd channel entries tag would show a list more more cakes, but not the one being displayed on the main section of the page. The url\_titl="not {segment\_2}" does not seem to be working.

Any help much appreciated.

Kind regards,

Matt

# Answer
> 1 votes
Matt, id use a plugin called stash. Take some time to read the docs and do little tests to see how it works. Most people who start using it misunderstand parse order. Using stash set\_list wrapping a single channel:entries tag you can create a list of all seven entries, then later in the same template use get\_list to display in your markup. This approach will save using a second CI tag and an embed, which means less queries and overhead.

# Answer
> 0 votes
I couldn't understand why parameter `url_title="not {segment_2}"` isn't working while segment variables are parsed so early. Also, you are using `channel="{segment_1}"` which seems working for you.

As you mentioned that you are putting that channel entry tag within embedded template so try by having url\_title as embed variable like:

`{exp:channel:entries limit="6" channel="{segment_1}" url_title="not {embed:url_title}" orderby="random" dynamic="no"}`

You can try it and share if it worked.

# Answer
> 0 votes
I know this is a slightly old post but for benefit of others doing this kind of thing, I've just used url\_title="not {segment\_3}" to do exactly this - exclude the currently viewed entry from a list of other randomly displayed recent entries in a list. It seems to work fine. My code is:

```
{exp:channel:entries channel="my-channel" limit="3" orderby="random" dynamic="no" disable="member_data|trackbacks|pagination" status="open" url_title="not {segment_3}"}
*preview list of 3 recent entries displayed, excluding the one being currently viewed*
{/exp:channel:entries}

```

Having said all that, I know I should learn how to use Stash. Everyone raves about it.

---
Tags: channel-entries
---


# Question
Title: Displaying only one related entry per list
I'm working on a site which has a series of tours, some of which are related (using playa) for when a tour is available on alternateive dates.

The problem I have is I want to display a list of all the tours, but instead of showing the title, link and date for all of them. If a tour has an alternative date/relationship it displays the title once with the alternative dates listed underneath. So it outputs like this:

Tour title 1
\- Date a (links to Tour title 1 page)

Tour title 2
\- Date b (links to Tour title 2 page)
\- Date c (links to Tour title 3 page)
\- Date d (links to Tour title 4 page)

Tour title 5
\- Date e (links to Tour title 5 page)
\- Date f (links to Tour title 6 page)

Tour title 7 (links to Tour title 7 page)
\- Date g (links to Tour title 8 page)

If any one could offer any advice I'd appreciate it. Thanks.

To give a bit more information about the configuration of the channels:

I have a channel for each Tour entry called 'tour', that has all the information about the tour, including date, price etc. There are some tours which might run several times a year, but may have different costs, flights etc, (which is why each has to be an entry in it's own right.) Within the 'tour' channel I have a Playa field {alternative\_tour\_dates} which lists all the tours. This would be used to 'link' the tours with alternative dates to each other.

This is my template which I want to show all the tours, but with the tours that have multiple dates, rather than displaying each one, it displays the tour that has the earliest date and lists the alternative dates, cost and url of the others.

```
{exp:channel:entries channel='tour' disable="category_fields|member_data" show_future_entries="yes" orderby="tour_date_start" sort="asc" search:tour_type="tour"}
                    <div class="unit3">
                        <div class="unit1 unitpadding grey overview">
                            <a href="{url_title_path='tours/'}"><h3>{tour_name}</h3></a>
                            <h4>Tour Director: {tour_to_tour_personnel}<a href="{site_url}tour-directors/{url_title}">{tour_director_name_first} {tour_director_name_last}<br /></a>{/tour_to_tour_personnel}</h4>
                            <ul>
                                <li><a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a> <span class="price">£{tour_base_price}</span></li>
                                <li>{alternative_tour_dates}<a href="{site_url}tours/{url_title}">{tour_date_start format="%j %F"} – {tour_date_end format="%j %F %Y"}</a> <span class="price">£{tour_base_price}</span>{/alternative_tour_dates}</li>
                            </ul>
                        </div>
                    </div>
{/exp:channel:entries}

```

Once again thanks for input so far.

# Answer
> 1 votes
I am going to give you a solution that would work not knowing how your channel entries are set up if i had more information i know i could figure this out for you with playa, however this solution will work just fine.

IF Tour titles and Dates are a one to many relationship meaning you are having for each Tour title 1 or more dates associated to it. You could accomplish it this way.

Create a tour title category group and create categories for each tour title. We'll say for the example it is category group 1.

Create a channel thats your tour date and information, and associate each one to a category in the group.

Now for code.

Create a separate template with your code in it for the tour dates.

File path: temlates/default\_site/yourtemplate.group/\_dates.html

```
<h1>{embed:tour_title}</h1>
{exp:channel:entries channel="tour_dates" category="{embed:cat_id}"}
   {!-- Your tour dates data --}
{/exp:channel:entries}

```

Then embed that template from your tour title template passing data into the two variables specified above "tour\_title" and "cat\_id".

```
{exp:channel:categories category_group="cat_id_of_tour_group"}
   {!-- now we are going to loop through every category that has data assoiated with it in your system and pass the specific cat id and title through to the other template we created to generate the specific data needed. --}
   {embed="yourtemplate/_dates" cat_id="{category_id}" tour_title="{category_name}"}
{/exp:channel:categories}

```

Like I said this isn't a solution using playa, but because of your limited information i had to come up with a more standard native EE solution.

# Answer
> 2 votes
Assuming that the alternate dates are related to the "parent" tour via a Playa field in each "alternate" entry (so the alternate dates are "children"), you'd simply do this:

```
{exp:channel:entries channel="tours"}
    <h3>{title}</h3>
    <ul>
        <li><a href="{title_permalink="tours/view"}">{tour_date}</a></li>
        {exp:playa:children channel="tours" field="parent_tour"}
        <li><a href="{title_permalink="tours/view"}">{tour_date}</a></li>
        {/exp:playa:children}
    </ul>
{/exp:channel:entries}

```

(Your channel and field names will differ obviously.)

---
Tags: playa, relationships, related-entries
---


# Question
Title: PHP doesn't work with Relationship field
I’m having trouble embedding PHP into a template and having anything on the page render, and I assume it’s because I’m working with a Relationship field.

Just as an example, this works:

```
{portfolio_projects}
<span class="date"><?php echo("Client A"); ?></span>
{/portfolio_projects}

```

and this works:

```
{portfolio_projects}
<span class="date">{portfolio_projects:client_name}</span>
{/portfolio_projects}

```

but this does not (I just get a blank page with empty html and body tags):

```
{portfolio_projects}
<span class="date"><?php echo({portfolio_projects:client_name}); ?></span>
{/portfolio_projects}

```

So I reckon I’m doing something wrong. Help?! (BTW, I’ll be needing to use PHP on my template to do a regex/preg\_replace on strings.)

# Answer
> 0 votes
A couple things here:

1) You don't have any quotes surrounding the template variable in your PHP echo function. This is likely causing a PHP error, because the string is not enclosed in quotes.

2) It's a really really really bad idea to use PHP in templates. What kind of replacement are you trying to do? Have you looked at add-ons that could do this instead, such as Low Replace? Failing that, writing a custom plugin is pretty trivial and would be a much better way to accomplish your needs.

---
Tags: channel-entries, relationships, php
---


title: Solspace and Structure conflict?

text:
# Question
Title: Solspace and Structure conflict?
So this is my problem. I am using Structure for a site. But, I am also using Solspace Calender-- particularly for the ICS function more than anything. (So, if there is another option out there that would allow calendar population from an external ICS file... that would be another option that I'd be open to...), but as it is I have read around and it seems that as long as I'm not using the same template group and/or Structure is not using /calendar (url) that I should be able to use Solspace Calendar from my understanding. Version-wise Solspace is using 1.8.6 on EE 2.7.1 and PHP Version 5.3.27.

I've installed and reinstalled a number of times and cannot get the "TIMEZONE" area under Calendar-\>Calendars to appear. / or a calendar entry that I publish to be recognized when I go to publish an event as I constantly get the "You must first create a calendar before creating an event." Message under the DATES & OPTIONS tab.

What am I doing wrong & / overlooking here??

# Answer
You must use the channels and custom field groups provided by Calendar when it's installed.

To create events in "Calendar: Events", you need to create a calendar in "Calendar: Calendars" first.

If you uninstalled Calendar and want to reinstall it, make sure to delete everything from the old Calendar install before you do, this includes the old Calendar channels and the custom field groups created to be used with these old Calendar channels. The "Timezone" field not displaying anything might be caused by a lingering channel/custom field group.

*Also make sure to upload the Calendar themes folder!*
> 2 votes

# Answer
Seems after not being able to find anything happening and following every hunch I could. It miraculously started worked after another uninstall -\> reinstall. Thank you all for you help.
> 1 votes

---
Tags: php, channel, structure, solspace-calendar, calendar
---


# Question
Title: Allow "Invalid" Characters in Member Account Email? Apostrophe
There is a particular member in my site that needs access but her corporate email that is attached to her account has an apostrophe in it. How do I allow EE to allow apostrophes in emails for member accounts?

# Answer
> 5 votes
In order to allow the apostrophe, I had to hack the core code. Specifically, a CodeIgniter helper within:

/system/codeigniter/system/helpers/email\_helper.php

In there, find around line 40 this:

```
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;

```

Then replace that line with this instead:

```
return ( ! preg_match("/^([a-z0-9\+_\-']+)(\.[a-z0-9\+_\-']+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;

```

Found the particular regex in an old EE Forum Thread here: http://ellislab.com/forums/viewthread/84711/

Anything wrong with this approach or the expression used?

# Answer
> 1 votes
Incase someone else comes to this post.. this has heen resolved in the developer version of codeigniter.

https://github.com/EllisLab/CodeIgniter/issues/3116

Be sure to also update the Form\_validation class as the email validation function there is different from the email\_helper functions.

---
Tags: members, email
---


title: Expression engine updates

text:
# Question
Title: Expression engine updates
I have a client that needs an expression engine site updated in order to install an add-on. Does he have to buy it all over again? If not, His relationship with his previous developer isn't good so he doesn't have the login info for Ellis labs. Would he be able to use a license number or something? I went to ask Ellis labs, but you have to pay for the privilege of speaking to someone there.

# Answer
> 2 votes
To access the license number of an EE Install log into the CPanel and go to Admin \> General Configuration \> License Number :: If you give that to ellis lab they should be able to get you taken care of.

EllisLab Contact Info:

Email: sales@ellislab.com

Twitter: @EllisLab

---
Tags: ee2-upgrades
---


# Question
Title: Is there a limit to the number of channel entries that ExpressionEngine can handle?
We currently run a site that has over 120,000 channel entries across our main EE install + MSM sites. As we continue to grow and add more channels and entries, I'm wondering if there's a limit to the number of entries EE can store.

I'm interested to hear about overall limits (perhaps imposed by the database) along with any channel specific limits, if they exist.

# Answer
> 2 votes
I can't say for certain how it would pan out in the real world but the entry\_id column in the database is an unsigned 10 digit INT so technically there is a limit there. But it's pretty big. You should be OK until your 10 billionth entry.

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


title: Connection string

text:
# Question
Title: Connection string
I have a form (freeform) in my EE site working just fine. My client ask me for a connection string because he wants to get the information fill up in the form directly in his own system database.

I've never hear about connection string before. Is it possible? What is neccessary to achieve it?

Francois

# Answer
> 1 votes
A connection string would simply be the database connection details formatted in a way to allow some software to connect to the database.

A list of MySQL connection strings can be found at http://www.connectionstrings.com/mysql/

Essentially, given the database hostname, database username, database password, and the database name from your system/expressionengine/config/database.php file should be enough for someone to create their own.

---
Tags: string
---


# Question
Title: Custom Extension Help (entry_submission_absolute_end() hook)
I'm making a custom extension to add a channel entry's data to another remote database, but I only want to do this with certain channel(s).

How do I check inside my extension hook what channel the entry is being published in?

```
/**
* Adds new EE product to Infusionsoft products table.
*
* @return bool
*/
public function entry_submission_absolute_end() {

    // if the channel being published is "products", continue..

    // get the product details from the channel entry form
    $newRow = array(
        'ProductName' => '',
        'Description' => '',
        'ProductPrice' => ''
    );

    // add the new row(product) to the infusionsoft db
    if ($this->app->dsAdd('Product', $newRow)) {
        return true;
    }

} // END

```

# Answer
> 1 votes
The hook gets called with several parameters that you can add to your extension:

```
public function entry_submission_absolute_end($entry_id, $meta, $data, $view_url) {
  if ($meta['channel_id'] == 7) {
    // do your code here

```

See http://ellislab.com/expressionengine/user-guide/development/extension\_hooks/cp/content\_publish/index.html#entry\_submission\_absolute\_end

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


# Question
Title: Security on a redirect page for a short URL service
I'm setting up a simple short url service which utilises a template (code below) to forward the user to the correct page based on an entry id in the URL.

The following code is based on EllisLab's docs:

Because the segment variable will be user-supplied, I want to make sure I haven't missed anything security-wise.

**Is this sufficient security or are there additional/better methods I can employ?**

*(PHP is enabled on input)*

```
   <?php

       $this->EE =& get_instance();
        $seg3 = $this->EE->uri->segment(3);
        $entry_id_clean = ee()->security->xss_clean($seg3);
        $entry_id = ee()->db->escape_str($entry_id_clean);
        $query = ee()->db->select('channel_id, url_title')
            ->from('exp_channel_titles')
            ->where(array(
                    'entry_id' => $entry_id,
            ))
            ->limit(1)
            ->get();

        $title = $query->row('url_title');
        $channel = $query->row('channel_id');

        // Redirect to the correct page...

    ?>

```

# Answer
The only thing i see from a security standpoint is EllisLab considers php in template a bad practice. If this where me I would create a small plugin that would render your PHP for you. and pass the segment through a parameter. That would then redirect the user.

To create a plugin you can use my plugin starterkit.

1.) Create a folder with lowercase plugin name.

2.) Create file called pi.pluginname.php

3.) Paste the following code in that file.

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Pluginname Class

 * @package         ExpressionEngine
 * @category        Plugin
 * @author          Matthew Johnson
 * @copyright       Copyright (c) 2010, Jane Doe
 * @link            http://midwesterninteractive.com/
 */

$plugin_info = array(
    'pi_name'         => 'Pluginname',
    'pi_version'      => '1.0',
    'pi_author'       => 'Matthew Johnson',
    'pi_author_url'   => 'http://MidwesternInteractive.com/',
    'pi_description'  => 'Allows you to generate 1 of 13. ',
    'pi_usage'        => PluginName::usage()
);

class Pluginname
{

    public $return_data = "";

    // --------------------------------------------------------------------

    /**
     * Pluginname
     *
     * Plugin Description
     *
     * @access  public
     * @return  string
     */
    public function __construct()
    {
        $this->EE =& get_instance();

        /* Your Code For you Plugin Here
        --------------------------------
        $entry_idParam = ee()->TMPL->fetch_param('eid');
        --------------------------------
        */

    }

    // --------------------------------------------------------------------

    /**
     * Usage
     *
     * This function describes how the plugin is used.
     *
     * @access  public
     * @return  string
     */
    public static function usage()
    {
        ob_start();  ?>

        @mattsidjohn
        @buildmidwestern
        http://midwesterninteractive.com

    <?php
        $buffer = ob_get_contents();
        ob_end_clean();

        return $buffer;
    }
    // END
}
/* End of file pi.pluginname.php */

```

To use your plugin you will place this in your template {exp:pluginname eid="{segment\_3"}

4.) Then place the plugin folder in the system \> expressionengine \> third\_party folder

You can reference the plugin docs here: http://ellislab.com/expressionengine/user-guide/development/plugins.html
> 2 votes

---
Tags: redirects, security, segments
---


# Question
Title: Solspace super search excerpt not working
I have the following tag:

```
{exp:super_search:results
                orderby="date"
                paginate="both"
                limit="20"

            }

                <h3><a href="{page_url}">{title}</a></h3>
                <p>{if excerpt}{excerpt}{if:else}No excerpt available.{/if}</p>

                 ....
{/exp:super_search:results}

```

I have the correct excerpt field selected in the channel settings, cleared the cache, reindexed, etc. Still nothing appearing here. Any thoughts?

# Answer
After some testing, both the Super Search and the native EE Simple Search form had the issue. Here is the explanation and solution:

Your channel preferences indeed had a custom field set as your excerpt field, but this setting was likely not registered in the database. Re-saving the channel preferences should save the excerpt value in the EE database, and excerpts should appear in your results.

Repeat this for each channel that might be causing issues.
> 1 votes

---
Tags: solspace, supersearch
---


# Question
Title: Import Channel Entries into New Channel?
We are in the process of architecting an upgrade for a site, and in the process are considering consolidating multiple channels into a single channel. (in the process utilizing new templates designed around the single channel) BUT, we have a significant amount of entries in the original channels.

Assuming we set the new channel's fields to the correct configuration, can we use one of the import tools to migrate entries from one channel to another instead of manually needing to recreate entries? Or would we need to export first then reimport?

Any suggestions or guidance to ensure minimal repetition of work would be GREATLY appreciated!

# Answer
> 1 votes
IF the channels share the same custom field group you should be able to use a bit of SQL to check for a specific channel\_id and convert it to the channel\_id you are keeping.

If the channels do not share the same custom field groups you will need to export the data. This can be as simple as creating a template and setting it to XML, or using one of the export add-ons to export the relevant data. From there you would have to use Datagrab or Solspace importer to import the data back into EE.

# Answer
> 0 votes
If it where me I would use this addon to export your data from the old channel into a csv.

http://devot-ee.com/add-ons/ajw-export

Then use this addon to import that csv into the new channel.

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

---
Tags: datagrab, export, solspace-importer
---


# Question
Title: Low Search + SafeCracker Registration: How To Sort By Distance?
We are building a membership site that uses SafeCracker Registration so that Member data can leverage Channels. In the Member associated Channel, it has a latitude and longitude field that's always populated with the Member's geocoded location.

In Low Search, is there a way to apply the Haversine formula to compute the distance between the lat/lng of the logged in member (guests will not have lat/lng) and the lat/lng of the other members and sort by that? Perhaps something like passing a callback function to compute distance to the orderby parameter???

# Answer
Should be possible using Low Search's Distance filter.

If you're using a search form, add a hidden input field that contains the lat/long values of the logged in member, eg:

```
<input type="hidden" name="distance:from" value="{cf_member_lat}|{cf_member_long}">

```

...making sure the values are replaced with their actual numerical values. Then, set the `distance:to` parameter, targeting the same custom fields, eg:

```
<input type="hidden" name="distance:to" value="cf_member_lat|cf_member_long">

```

Notice the absence of the curly brackets, since we're targeting the fields themselves.

Submitting the form should now give you entries ordered by distance, which you can output using the `{low_search_distance}` variable.
> 4 votes

---
Tags: low-search
---


title: I need more than 10 segments

text:
# Question
Title: I need more than 10 segments
Does anyone know of a predefined way to increase the number of URI segments ExpressionEngine allows before it throws an error. This is currently set to 10 and I'm sure I could hack the core to achieve this but I thought there may be another way (config setting, extension, etc).

Any suggestions?

# Answer
> 2 votes
As far as I know this flatly can't be done without hacking the core and even then it's possible that third-party functionality (and even base functionality) might break. Maybe explain your issue a little more -- there might be a way to accomplish your goal WITHOUT the need for extra segments?

**Edited to add:**

You can TRY the following, it *should* work for base EE functionality but I *cannot* guarantee how it will interact with anything third-party.

In the file `/system/expressionenine/core/EE_URI.php`, on or around line 133 (depending on the version of EE), find the following:

`if (count($segs) > 9)`

and change 9 to some other number, like this:

`if (count($segs) > 25)`

# Answer
> 0 votes
Have you tried achieving this with EE structure? As far as I know there isn't a limitation in structure. If there is, please let me know!

---
Tags: segments, navigation
---


# Question
Title: Expresso Store: If member, fill in blank shipping\billing details automatically?
Client wants the check out pages to automatically populate the shipping\billing details if they're a member and have already done it before.

Does Expresso have any sort of functionality to accommodate this?

# Answer
Store does have the ability to pre-populate the checkout fields. Basically you either need to create custom member fields or if you are using Zoo Visitor you would need to create custom channel fields that will hold the users address details. Once you have done that you will need to go Store \> Settings \> Order Fields and map the form input fields to the custom fields that you have just created as seen in the picture below. (Docs Link)

Once you have done that in your template you have 2 options in your template to pre-populate the fields:

```
{exp:store:checkout}
 <label for="billing_first_name">First Name</label>
 {field:billing_first_name}
{/ezp:store:checkout}

```

or

```
{exp:store:checkout}
 <label for="billing_first_name">First Name</label>
 <input type="text" name="billing_first_name" value="{billing_first_name} class="input" />
{/ezp:store:checkout}

```

Documentation on the checkout fields can be found here.
> 0 votes

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


# Question
Title: How to implement rollbar into a expressionengine setup?
I'm talking about http://rollbar.com

> Rollbar collects and analyzes errors on web and mobile apps so you can find and fix them faster.

What would be the best approach to get this working? Is it possible to hook into the EE logging itself?

I would like to log things like:

* 404 pages
* errors while sending mail (freeform)
* module/plugin php errors (what super-admin's get to see)
* ...

# Answer
First you would need to to decide which integration method you would like to use probably either PHP, API or JS. With the data you want to collect you would probably be best to use the PHP or API integrations (PHP link or API link). From there you have a few options:

1. Write an extension (my recommendation)
2. Modify the index.php file to include the PHP script on every page load.

EE's Add-on Developer Docs should get you started in the right direction on creating an extension.
> 1 votes

---
Tags: php-errors, bestpractice
---