# Question
Title: How to build a taxonomy filter for drilling down search results?
How would I build a taxonomy filter like this in EE?

http://webcodesigner.com/?post\_type=listing

I've already purchased Low Search, are there any other addons necessary for this kind of thing?

Thanks!

# Answer
> 1 votes
In short:

* Create a search form;
* Create a results list;
* Optionally use JavaScript to submit the form when one of its elements changes.

Depending on how your channels and fields are set up, you either want to hard-code the different options in your Form, or generate them using native channel tags or add-ons like Loopee or Low Options.

To get a good grasp of how Low Search works, read the docs:

Note: the only thing Low Search will not do, is generate a number of search results next to each filter option, like on the example site you linked.

---
Tags: low-search
---


# Question
Title: Auto-create random ‘secure’ (obfuscated) url titles
I have a site in which I'd like to achieve the following:

1. Provide a publicly accessible but obfuscated and hard to guess at URL to which a customer can be referred to, to submit some data via a **Channel Form** without them having to register and log in (the data they submit is personal to them but does not personally identify them).
2. Upon submission the entry is automatically closed so the form cannot be used again.

So what I'd ideally like is a way to **auto-generate unique URL Titles that are intrinsically hard to guess at**. Something like…

```
mydomain.com/segment/hyr6gDEGhyus

```

I guess I could achieve this with custom JavaScript in the CP but anyone got any other suggestions?

# Answer
You can do this with last version (2.8.8) of MX Title Control. You can add **{random\_string}** tag into URL Title Pattern and get 10 characters random string.

**Hidden Configuration Variables**

```
$config['mx_random_string_length'] = "20";
$config['mx_random_string_pattern'] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

```
> 3 votes

# Answer
Sure - create an extension using the entry\_submission\_start hook and set your unique `url_title` there:

```
ee()->load->helper('string);
ee()->api_channel_entries->meta['url_title'] = random_string('alnum', 16);

```
> 1 votes

---
Tags: channel-form, url-title, security
---


# Question
Title: {option_value} how to pull from database
I am very new to CartThrob and EE so excuse my ignorance. I am charged with pulling order data from the database so I can write that data in our business system.

In the database we have stored, I believe, in {option\_value} the item code for our inventory. I have looked through all the fields in exp\_channel\_data for that information but can't seem to find it.

In EE, I go to CartThrob, Products, Store-Products. Look at one of the products, under size options, there’s a field Option Short Name. Where is that stored?

# Answer
> 1 votes
You need to figure out with field ID # corresponds to your Products \> Size Options field. Then look that `field_id_XXX` column up in the `exp_channel_data` table. The data is store as a base64 encoded and serialized array, which is somewhat of a convention in EE. So, to decode it, you'd do:

```
$query = ee()->db->select('field_id_XXX')->where('entry_id', 'YYY')->get('channel_data');

$data = $query->row('field_id_XXX');

$data = unserialize(base64_decode($data));

foreach ($data as $row)
{
    $row['option_value'];//this is what you're looking for
}

```

---
Tags: cartthrob, database
---


# Question
Title: Resource files are case sensitive on production server?
This seems so basic, but how would I make all of my URL's case insensitive? On my dev, everything worked fine, but on production, images are broken, resources are 404, etc.

I know I could do something like this:

```
RewriteMap tolowercase int:tolower
RewriteRule ^(.*)$ ${tolowercase:$1}

```

But I don't want to need to rename all of my files.

*** EDIT ***

I have just renamed my files since I couldn't find a solution yet. The odd thing is that I even had to modify an add-on: acc.theeditorcodemirror.php line 74

```
$results = $this->EE->db->query("select * from exp_TECM_settings where member_id = '".$this->EE->db->escape_str($this->EE->session->userdata('member_id'))."'");

```

had to be changed to:

```
$results = $this->EE->db->query("select * from exp_tecm_settings where member_id = '".$this->EE->db->escape_str($this->EE->session->userdata('member_id'))."'");

```

# Answer
on unix system files is always case sensitive (instead of Window). It possible to make some settings for apache to make filesystem case insensitive but it is not right.
Same story with db name:

> In MySQL, databases correspond to directories within the data directory. Each table within a database corresponds to at least one file within the database directory (and possibly more, depending on the storage engine). Consequently, the case sensitivity of the underlying operating system plays a part in the case sensitivity of database and table names. This means database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix. One notable exception is Mac OS X, which is Unix-based but uses a default file system type (HFS+) that is not case sensitive.
> 1 votes

---
Tags: ee2, url, htaccess
---


# Question
Title: Postmaster parses tag in preview but not in delivered email
I am having trouble getting a tag pair to work properly. In the preview pane of the control panel the code below behaves as expected. However, when the mail arrives via Mandrill this field is blank.

```
{exp:low_events:entries channel="events_submitted" entry_id="{parcel:entry_id}" dynamic="no"}
  <strong>{cf_events_date:start_date format="%F %j, %Y"}</strong>
{/exp:low_events:entries}

```

Any clues? Thanks!

# Answer
> 0 votes
The solution to this is issue to add `status="not closed"` to the entries tag. The template parser is the same for the preview as the one used when sending emails.

---
Tags: postmaster
---


title: HTML Stripped out of Postmaster Emails

text:
# Question
Title: HTML Stripped out of Postmaster Emails
I've setup Postmaster to send system emails via Mandrill. Everything's working fine, but, all of the HTML tags are getting stripped out.

Here's a snip from the Message field, which is rendering nicely in Postmaster's preview pane:

```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>{hook:subject}</title>
        <style type="text/css">
            /* /\/\/\/\/\/\/\/\/ CLIENT-SPECIFIC STYLES /\/\/\/\/\/\/\/\/ */
            #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" message */

```

Here's the raw text of the email I'm getting:

```
From: (client name / email redacted)
To:
Date: Mon, 20 Jan 2014 15:28:54 -0600
Subject: Enclosed is your activation code

Enclosed is your activation code

            /* /\/\/\/\/\/\/\/\/ CLIENT-SPECIFIC STYLES /\/\/\/\/\/\/\/\/ */
            #outlook a{padding:0;} /* Force Outlook to provide a "view in browser" message */

```

The CSS rules are making it through, but, looks like a `strip_tags()` or something is wiping out the HTML.

There is a setting for "Plain Text Only" in the area for the Mandrill config, but, it is set to false.

Running EE 2.7.2 and Postmaster 1.4.4.

Other than setting up per this post, and selecting Mandrill as the mechanism, none of the default EE email settings have been touched.

Any thoughts appreciated; will followup ASAP.

**Edit 1: Other Add-ons Interfering?**

Here are the relevant (hopefully) columns from `exp_extensions`; this is happening during the new member registration process (not sure if it's also happening in other situations); the form is coming from Zoo Visitor, has a Snaptcha captcha, ~~and the user is sent to a Custom System Messages managed page on success,~~ so I suppose there's plenty of room for interference.

```
Assets_ext          channel_entries_query_result        channel_entries_query_result
Shortlist_ext       channel_entries_row                 channel_entries_row
Matrix_ext          channel_entries_tagdata             channel_entries_tagdata
Zoo_visitor_ext     hook_safecracker_submit_entry_end   channel_form_submit_entry_end
Zoo_visitor_ext     hook_safecracker_submit_entry_start channel_form_submit_entry_start
Snaptcha_ext        comment_field                       comment_form_tagdata
Zoo_visitor_ext     hook_cp_js_end                      cp_js_end
Zoo_visitor_ext     hook_cp_members_member_create       cp_members_member_create
Zoo_visitor_ext     hook_cp_members_member_delete_end   cp_members_member_delete_end
Zoo_visitor_ext     hook_cp_members_validate_members    cp_members_validate_members
Superfish_admin_ext cp_menu_array                       cp_menu_array
Channel_images_ext  editor_before_display               editor_before_display
Channel_images_ext  editor_before_replace               editor_before_replace
Channel_images_ext  editor_before_save                  editor_before_save
Minimee_ext         ee_debug_toolbar_add_panel          ee_debug_toolbar_add_panel
Snaptcha_ext        email_form_field                    email_form_form_end
Snaptcha_ext        email_form_validate                 email_form_send_form_start
Postmaster_ext      trigger_hook                        email_send
Zoo_visitor_ext     hook_entry_submission_end           entry_submission_end
Postmaster_ext      entry_submission_end                entry_submission_end
Postmaster_ext      entry_submission_ready              entry_submission_ready
Assets_ext          files_after_delete                  files_after_delete
Assets_ext          file_after_save                     file_after_save
Snaptcha_ext        forum_field                         forum_submission_form_end
Snaptcha_ext        forum_validate                      forum_submit_post_start
Snaptcha_ext        forum_field                         forum_threads_template
Snaptcha_ext        freeform_field                      freeform_module_form_end
Snaptcha_ext        freeform_validate                   freeform_module_validate_end
Snaptcha_ext        freemember_register_validate        freemember_register_validation
Snaptcha_ext        comment_validate                    insert_comment_start
Snaptcha_ext        rating_comment_validate             insert_rating_comment_start
Snaptcha_ext        rating_validate                     insert_rating_start
Zoo_visitor_ext     hook_member_member_register         member_member_register
Snaptcha_ext        member_register_validate            member_member_register_errors
Zoo_visitor_ext     hook_member_member_register_start   member_member_register_start
Snaptcha_ext        member_register_validate_deprecated member_member_register_start
Zoo_visitor_ext     hook_member_register_validate_members member_register_validate_members
Zoo_visitor_ext     hook_membrr_expire                  membrr_expire
Zoo_visitor_ext     hook_membrr_subscribe               membrr_subscribe
System_messages_ext output_show_message                 output_show_message
Snaptcha_ext        proform_field                       proform_create_captcha
Snaptcha_ext        proform_process_captcha             proform_process_captcha
Snaptcha_ext        proform_validate                    proform_validation_end
Snaptcha_ext        rating_comment_field                rating_comment_form_tagdata
Snaptcha_ext        rating_field                        rating_form_tagdata
Snaptcha_ext        safecracker_field                   safecracker_entry_form_tagdata_end
Snaptcha_ext        safecracker_validate                safecracker_submit_entry_start
Snippet_sync_ext    sessions_end                        sessions_end
Zoo_visitor_ext     hook_sessions_end                   sessions_end
System_messages_ext extend_output_class                 sessions_start
Url_helper_ext      set_url_helper                      sessions_start
Snippet_sync_ext    show_full_control_panel_end         show_full_control_panel_end
System_messages_ext template_post_parse                 template_post_parse
Minimee_ext         template_post_parse                 template_post_parse
Snaptcha_ext        user_register_validate              user_register_start
Channel_images_ext  wygwam_before_display               wygwam_before_display
Channel_images_ext  wygwam_before_replace               wygwam_before_replace
Channel_images_ext  wygwam_before_save                  wygwam_before_save
Channel_images_ext  wygwam_config                       wygwam_config

```

**Edit 2: Custom System Messages**

Custom System Messages is installed, but, it shouldn't be involved in this process; on a successful submission, Zoo Visitor is the mechanism directing the browser to a template.

# Answer
> 0 votes
Just following up to provide an answer for this question if anyone else runs into this issue. This bug should be fixed in Postmaster v1.4.5. Download the latest copy for a fix.

---
Tags: postmaster
---


# Question
Title: Solspace Calendar - How do I show current date of repeating events?
I have a page that shows the Day's events. It currently uses:

```
{event_first_date}

```

This is great except with repeating events - which continues to show the first date of the event. I reviewed the documentation but did not see an option to display

```
{event_current_date}

```

or something like that. Any clues as to what that would be?

Thanks.

# Answer
A complete answer to your question requires a bit more context than you have provided, but this is a common question, so I will make some assumptions. :)

If this is a page using Calendar:Events tag to display complete/more info about an event, and you are linking to this page from a page such as a full month view calendar, we'll often use this workaround:

In the full month view template (using Calendar:Cal), we'll adjust the link for the title of the event to have this extra code:

```
{if event_recurs}{event_start_date format="%Y/%m/%d"}/{/if}

```

So, the complete code for the title link would be:

```
<a href="{path='calendar/events'}/{event_url_title}/{if event_recurs}{event_start_date format="%Y/%m/%d"}/{/if}">{event_title}</a>

```

What that will do is add some fake date values into the URI, which can be retrieved later ;)

Then, in your Event detail page (using Calendar:Events tag), you would have something like this code:

```
{exp:calendar:events
   event_name="{segment_3}" <!-- grabs URL title from 3rd segment, where we sent it -->
   event_limit="1"
   dynamic="no"
}
   <h2>{event_title}</h3>
   <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>
{/exp:calendar:events}

```

You'll see that we're using the date values from the URI that we passed on from the previous template, and now feeding them into the Calendar:Date tag, and telling it to parse those segments into a formatted date. We then use the {event\_start\_date ... } variable, but only for the time parsing.
> 1 votes

---
Tags: solspace-calendar
---


title: Orders not completing

text:
# Question
Title: Orders not completing
I'm running Store 2.0.2 on ExpressionEngine 2.7.1 and am using Paypal Express as my gateway. Orders aren't going through and I can't figure out why. Hoping someone can help.

User is taken over to Paypal with the correct total and can put in all their credit card info and it seems to go through. It sends them back to the site and I see it flash index.php?ACT=28&H=..... And then it redirects to the site's homepage. It *should* take them to the order confirmation page but doesn't.

Store sends an Order Confirmation email to the user (and admins). But the order stays Incomplete and card is never charged.

In the order detail under transactions is says the status is redirected. I don't know what that means (if anything?).

Here's my checkout tag:

```
{exp:store:checkout
    form_class="form-horizontal"
    payment_method="paypal_express"
    return="shop/order/ORDER_HASH"
    error_handling="inline"
    error_delimiters='<span class="help-inline">|</span>'}

```

Am I missing something?

Thanks for any help.

# Answer
> 2 votes
Turns out that there was an html file in the root of the site that had a redirect in the header to site/index.php. That redirect was causing issues when Paypal was communicating with the store that payment had been received.

Thanks to Expresso Store support for tracking down the issue!

---
Tags: expresso-store
---


# Question
Title: trying to get category_url_title from a relationship in a grid field
Having a strange issue with grid, categories and relationships. On my site i have a channel with products and services. On the services pages i need my client to be able to select related products to be shown, so i used a grid field with relationships to products. The products are categorised, so i want to see the category\_url\_title in the url.

I checked this thread and followed that approach however i'm not getting this to output anything. (http://www.site.com/producten//systeemoefeningen/ for what should be http://www.site.com/producten/oefenen/systeemoefeningen/)

```
{services_grid_products}
  <li><a href="/producten/category/
      {services_grid_products:product}
         {services_grid_products:product:categories}
             {services_grid_products:product:categories:category_url_title}
         {/services_grid_products:product:categories}
      {/services_grid_products:product}/{url_title}/"
      title="
      {services_grid_products:product}
          {services_grid_products:product:title}
      {/services_grid_products:product}">
      {services_grid_products:product}
          {services_grid_products:product:title}
      {/services_grid_products:product}</a></li>
{/services_grid_products}

```

I know i can do this with an embed too, however i'm trying to avoid them as much as possible.

# Answer
edited version (and just saw that Kevin Cupp beat me to it!): Just tested this and only needed to use {category\_url\_title}.

So try:

```
{services_grid_products:product:categories}
    {category_url_title}
{/services_grid_products:product:categories}

```
> 1 votes

---
Tags: categories, relationships, grid
---


# Question
Title: Exp-resso store, checkout process and URLs to products in the cart
Exp:resso Store demo code has that line for a product part (and URL to it) in the checkout process:

```
<h4><a href="{path='store_example/product'}/{url_title}">{title}</a></h4>

```

My products are categorized so it requires to obtain primary category and secondary category for a proper product URL. Is there any way to accomplish that? Maybe GWcode Categories can do that?

Thanks!

# Answer
> 1 votes
You will probably need to pass the `{entry_id}` variable to another tag in order to grab other fields. I had to do this on a site I'm building in order to grab product images for the cart.

So, if you can feed the entry\_id to GWcode Categories, it should work great.

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


title: Url title namespacing problem

text:
# Question
Title: Url title namespacing problem
I have this code

```
{exp:channel:entries
        channel="xxxxxx"
        disable="categories|category_fields|member_data|pagination"
        entry_id="{segment_2}"
        status="open|closed"
        track_views="one"
    }
        {url_title}

        {exp:channel:category_archive
            channel="yyy"
            style="linear"
        }
            {categories}
                {entry_titles}
                    {url_title}
                {/entry_titles}
            {/categories}
        {/exp:channel:category_archive}
{/exp:channel:entries}

```

Apparently, EE doesn’t know how to distinguish between the {url\_title} of channel entries and category archive since it shows value of the channel entries {url\_title} even inside the category archive tags.

I really think that EE should be able to namespace variables properly or at least provide some alternative names to avoid name conflicts like this.

But for now, is there a way to circumvent this?

**EDIT:**

* The channel in the category\_archive `yyy` is a relationship field
* What I am trying to do here is to show `yyy` selected items grouped by category

# Answer
> 1 votes
Until {entry\_titles} gets its own dedicated {entry\_url\_title} (if ever) this is a typical situation where you could use an embed for the nested category\_archive tag.

However, if yyy is already a relationship field, i wonder if there isn't a different approach to what you are trying to achieve.

# Answer
> 0 votes
You could use the VMG Nested add-on to prefix the variables on the category\_archive tag. It's designed for nesting multiple instances of the same tag, but will also work for helping to namespace different tags with overlapping variables.

---
Tags: channel-entries, category-archive
---


# Question
Title: Customise Meta Titles in CP (Admin) Pages
So I've been customising the admin area with styling and low key branding - but cannot find any way of editing the meta titles, so am currently stuck with *Login | ExpressionEngine* etc in the `<title></title>` of every admin page. Does anyone know how to change this? Ideally I'd like it to say *Login | NameOfMySite* etc, so the client feels happy.

Any help appreciated, I've looked all over, with no luck.

# Answer
> 2 votes
I had the same issue and created an accessory to rewrite the title tag using JavaScript. its not the best solution but it did the job. Maybe you could build on it to make it better. Follow the instructions here for creating an accessory and add this code as the set\_sections.

```
function set_sections()
{
    $meta_title = implode(" | ", array_filter(array($this->EE->view->cp_page_title, $this->EE->config->config['site_label'])));
    $js = "$('title').html('{$meta_title}');";
    $this->EE->cp->add_to_foot('<script type="text/javascript">'.$js.'</script>');
}

```

---
Tags: control-panel, admin, title, custom, meta
---


# Question
Title: Using Expression Engine modules in Core + multisite
Is it possible to use some of the modules from the regular version of EE in the EE Core? Also, outside of the multi-site manager for EE, is there any other way to run multiple sites of of the regular version of EE?

# Answer
> 2 votes
You have two questions here:

1) Is it possible to use some of the modules from the regular version of EE in the EE Core?

No. That would be a violation of the license agreement. You can use any 3rd party add-ons you like, as long as they work with Core, which means they cannot rely on any of the modules not included in Core. However, copying the modules over from the commercial version to a Core installation would be equivalent to stealing the software.

2) Outside of the multi-site manager for EE, is there any other way to run multiple sites of of the regular version of EE?

There are ways to do it, involving modifying your .htaccess, but again it violates the license agreement, as the license grants use for a single site.

If you have special case scenarios, you may want to run them by EllisLab via email, as they are the experts and final say on their license agreement.

---
Tags: core
---


# Question
Title: How to display sub categories using the query module
I'm using the query module to display a category, but how to use query to display the child categories??

It is possible??

Thanks,

Stéphane

# Answer
Its not clear from your question whether you're wanting to show the child categories based on the parent category page you're currently viewing. We needed to do the same thing, so I wrote a quick plugin, as I don't think there's any combination of EE tags that will allow you to achieve this. The scenario we used this in was if I was on domain.com/page/category/parent, it would allow me to list out all the children for that parent.

The plugin code looks like this:

```
class Show_child_cats {

public $return_data;

/**
 * Constructor
 */
public function __construct()
{
    $this->EE =& get_instance();

    // Get information about the current parent and the category group
    $this_cat_parent = $this->EE->TMPL->fetch_param('cat_parent');
    $this_cat_group = $this->EE->TMPL->fetch_param('cat_group');

    // Get the child categories within the group and current parent category set above
    $child_cats = $this->EE->db->query("SELECT exp_categories.cat_id, exp_categories.cat_name, exp_categories.cat_url_title, exp_categories.parent_id, exp_categories.cat_image FROM exp_categories WHERE exp_categories.group_id = '" . $this_cat_group . "' AND exp_categories.parent_id <> 0
AND
(SELECT exp_categories.cat_id FROM exp_categories WHERE exp_categories.cat_url_title = '" . $this_cat_parent . "' AND exp_categories.group_id = '" . $this_cat_group . "') = exp_categories.parent_id ORDER BY exp_categories.cat_order ASC");

    $vars = array();

    if($child_cats->num_rows() > 0)
    {
        foreach($child_cats->result_array() as $row)
        {
            $vars[] = array(
                'this_cat_name' => $row['cat_name'],
                'this_cat_url_title'  => $row['cat_url_title'],
                'this_cat_id'   => $row['cat_id'],
                'this_cat_parent_id'   => $row['parent_id'],
                'this_cat_image'   => $row['cat_image']
                );
        }
        $this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $vars);
    }
    else
    //not categorised
    {
        $vars[] = array (
            'this_cat_name' => 'There are no child categories for this category.'
        );
        $this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $vars);
    }
}//end __construct()

```

The query combines 2 select statements. The first gets all the child categories in the chosen category group (where the parent ID is not 0). The 2nd statement then gets the ID number of the currently viewed category, based on the categories url\_title and group\_id.

The combined query then lists out the children of the selected parent only.

In my template, I could then call the plugin as follows:

```
    {exp:show_child_cats cat_parent="{segment_3}" cat_group="1" parse="inward"}
        {if this_cat_url_title!=""}
          <div class="product-cat">
            <a href="/products/category/{this_cat_url_title}" title="{this_cat_name}">
              <h3>{this_cat_name}</h3>
              {if this_cat_image!=""}
                <img src="{exp:parse_file_paths}{this_cat_image}{/exp:parse_file_paths}" alt="{this_cat_name}">
              {if:else}
                <img src="/assets/img/no-image.jpg" alt="{category_name}">
              {/if}
            </a>
          </div>
        {/if}
      {/exp:show_child_cats}

```

If you need to output a category image the plugin Parse File Paths will convert the path from {filedir\_n} to your actual server path.
> 3 votes

---
Tags: categories, query
---


# Question
Title: When I use CE Image inside Gwcode categories, it's not parsed
When I use Ce Image inside the Gwcode categories tags, it's not parsed.

```
{exp:gwcode_categories group_id="5" cat_id="{segment_3_category_id}" depth="1|2|3" custom_fields="yes" style="linear" orderby="cat_name" }

    {exp:ce_img:pair src="{cat_image}" width="300"}<img src="{made}"/>{/exp:ce_img:pair}

{/exp:gwcode_categories}

```

It is a parser order priority problem??

# Answer
Add parse="inward" to the gwcode categories parameters.
> 1 votes

---
Tags: ce-image, gwcode-categories
---


# Question
Title: Solspace Tag "Suggestion" dropdown broken
Using Solspace Tag 4.2.5 with EE 2.7.0

The suggestion tool is broken. Triple checked install. De-installed, reinstalled twice... /themes/ as well as /system/ files.

This is the error: http://cl.ly/U22k

Any ideas?

# Answer
This solution over at Solspace support would likely fix this:

http://support.solspace.com/solution/categories/115922/folders/236531/articles/145012-how-to-avoid-issues-with-the-tag-custom-field-autocomplete-not

I'll post the answer here for more exposure:

> There may be cases when the Tag custom field's autocomplete does not display any results.
>
> First, please check if the domain in your browser address bar is the same as the domain set in EE. www and non-www domains are not considered the same. Domains need to be the same to prevent AJAX requests (used by Tag) from being considered as Cross-Site Scripting (XSS) attempts, which are blocked by browsers.
>
> One solution is to set up config.php so that EE's site\_url changes with the domain used in your browser. You can do this using PHP's $\_SERVER variables. Here's an example. You would put this in config.php:
>
> ```
> $protocol              = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https://" : "http://";
> $base_url              = $protocol . $_SERVER['HTTP_HOST'];
> $config['base_url']    = $base_url . '/';
> $config['site_url']    = $config['base_url'];
> $config['cp_url']      = $config['base_url'] . $system_folder . "/index.php";
>
> ```
>
> This assures that the EE domain for site\_url is the same as my browser's domain, every time. This avoids Cross-Site Scripting issues when using AJAX.
> 1 votes

---
Tags: solspace, solspace-tag
---


# Question
Title: Posting to FB/Twitter - addon suggestion?
I want each channel entry to be posted to FB and Twitter. I'm looking at http://devot-ee.com/add-ons/social-update. Does anyone have experience with this? Documentation for this addon is a lacking, IMHO.

Or alternative suggestions?

# Answer
> 3 votes
The documentation for Social Update can be found here

The update is sent to one or several social accounts you've pre-authorized in Control Panel. The text of update needs to be entered for each entry using custom field.

If you're rather looking for solution that will post to user's timeline, consider Social Login Pro

As Adrian suggested, it's better to try, and request moneyback if you find out it does not do the job for you.

# Answer
> 1 votes
I've had good luck posting to Facebook and Twitter using dlvr.it.

I set up recipes to take the information from my RSS feed and post the title/story/link to both Twitter and Facebook.

I speed up the turnaround using Superfeeder's pubsubhubbub service.

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


# Question
Title: Conditionally output code every nth entry for Bootstrap grid
I'm building a grid with Twitter Bootstrap. How do I add the closing row `</div>` tags after every 2 entries?

I need the HTML to look like this:

```
<div class="row">
  <div class="span6">...</div>
  <div class="span6">...</div>
</div>
<div class="row">
  <div class="span6">...</div>
</div>

```

I think I need something like this:

```
<div class="row">
  {exp:channel:entries channel="channel_name" dynamic="no"}
  <div class="span4">
    ...
  </div>
  <!-- conditional here to close /.row -->
  {/exp:channel:entries}

```

I think I could use `{switch}` tag to accomplish this, but I also need a way to close the row if there are an odd number of entries as well. Is there an easy way to do this without using PHP and modulus somehow?

# Answer
> 4 votes
I managed to find a simple solution as I wrote the question. This just uses a combination of `{switch}` and a `{if count != total_results}` conditional:

```
<div class="row">
  {exp:channel:entries channel="channel_name" dynamic="no"}
  <div class="span4">
    ...
  </div>
  {if count != total_results}
    {switch='|</div><!-- /row --> <div class="row">'}
  {/if}
  {/exp:channel:entries}
</div><!-- /row -->

```

There are many other great add-ons that solve this problem in the answers below. But for me, this out-of-the-box solution is the simplest.

# Answer
> 10 votes
You should put the closing `</row>` outside your channel entries tag, to be consistent, and use a switch statement to add the middle rows every third entry:

```
<div class="row">
    {exp:channel:entries channel="channel_name" dynamic="no"}
        <div class="span4">
            ...
        </div>
        {switch='||</div><div class="row">'}
    {/exp:channel:entries}
</div><!-- /row -->

```

Note that we are using `{switch='||</div><div class="row">'}` here to show a row every *third* entry. By placing two pipes (`|`) at the start of the switch statement, you are essentially switching between:

* Nothing
* Nothing
* `</div><div class="row">`

This is the easiest way to insert html every nth element - simply by adding extra pipes to your switch statement.

# Answer
> 4 votes
It's a common task to want r rows of x items, and I've sometimes got myself tangled with switch and conditionals etc still finding I end up with empty or unclosed tags. I find the EEGrouper add-on http://devot-ee.com/add-ons/eegrouper is a quick and easy way to handle all cases.

# Answer
> 4 votes
I too might go for the `{switch}` method. But I would also question if using Bootstrap's CSS classes are the best way to mark up your page.

Have you considered using their LESS classes? You could then possibly keep your EE and HTML as separated from the design as this...

```
<section id="section-name">
    {exp:channel:entries channel="channel_name" dynamic="no"}
        <article>
            Your stuff goes here
        </article>
    {/exp:channel:entries}
</section>

```

Then within your stylesheet perhaps something like this...

```
#section-name {
    article {
        .span(2); // load GS - never used Bootstrap so may be incorrect syntax

        &:nth-child(even):after {
            .clearRow(); // call our clearRow mixin after every 2nd article which emulates ending the row class
        }
    }
}

// Our clear row mixin
.clearRow(){
    content: "";
    display: block;
    clear: left;
}

```

It may or may not work. But if it does it'd certainly separate your styles from your markup. Something that I dislike about Bootstrap using CSS is it's reliance on obscure classes and unnecessary syntax.

Another small win of this method is that it is marginally less for ExpressionEngine to process and by having the clearRow mixin in LESS you could apply this method on any channel and any template.

Of course it relies on a certain level of browser compliance, which is the trade-off.

# Answer
> 3 votes
My approach to handling this issue is to use the SurgerEE addon which provides (among many other useful things) modulo operator support via a plugin call, so you can then do something like this:

```
<div class="row">
{exp:channel:entries channel="channel_name" dynamic="no"}
  <div class="span4">
    ...
  </div>
{if '{exp:surgeree:modulo numerator="{count}" denominator="2"}' == 0 && count == total_results}
  </div><!-- /row -->
  <div class="row">
{/if}
{/exp:channel:entries}
</div><!--//.row-->

```

While in general I'd always tend to prefer solutions that don't require third party code, here I think there's a real benefit in the increased readability of your code (both for others and for yourself at a later date). `{switch='||</div><div class="row">'}` works and is native functionality, but is not hugely intuitive and hard to scan, whereas `{exp:surgeree:modulo}` is very explicit, and makes it super clear what this code is doing.

# Answer
> 3 votes
I'd like to add that with the Modulus Operator added to EE in 2.7.1 that this can be easily achived now with the following code, based on Bootstrap 3 (example using a Grid fieldtype for the output):

```
<div class="container">
    <div class="row">
    {gallery}

        {if gallery:index % 3 == 0 OR gallery:index != 0}
            </div>
            <div class="row">
        {/if}

        <div class="col-sm-4">
            <p>{gallery:title}</p>
        </div>

    {/gallery}
    </div>

```

This will close the row and make a new one after every 3rd element.

# Answer
> 0 votes
You can do this using Will Hunting and it's mod() function. This will ensure that no blank row is included at the end of the output by checking if the $count variable is equal to total\_results, and avoids outputting a blank row div if there are no results.

```
{exp:will_hunting:solve_pair}
    {$count=0}
    <div class="row">
        {exp:channel:entries channel="channel_name" dynamic="no"}
            {$count=$count+1}
            {!-- we're on the first item, so output our starting row div --}
            {if {$count} == 1}
                <div class="row">
            {/if}
            <div class="span4">
                content
            </div>

            {!-- close the previously open row div if this is a multiple
                 of 3, or if it is the last result --}
            {if mod({$count}, 3) == 0 || {$count} == {total_results} }
                </div>

                {!-- if there are more records left, create a new row div --}
                {if {$count} != {total_results}}
                    <div class="row">
                {/if}
            {/if}
        {/exp:channel:entries}
    </div><!-- /row -->
{/exp:will_hunting:solve_pair}

```

---
Tags: conditionals, bootstrap, switch
---


title: Dev Demon Updater error

text:
# Question
Title: Dev Demon Updater error
just used Dev Demons' Updater for the first time (update 2.6.1 to 2.7.2) I got a not completed message and them the following: AJAX request failed.

However when I look at the current version running its updated. But when I go the Updater CP I see the "Ajax Request Failed" when I click on the "Show Response" link I get:

{"error":" Error Number: 1054\</p\>\n\n

Unknown column 'csrf\_exempt' in 'field list'\</p\>\n\n

SELECT `class`, `method`, `csrf_exempt`\nFROM (`exp_actions`)\nWHERE `action_id` = '44'\</p\>\n\n

Filename: libraries/Actions.php\</p\>\n\n

Line Number: 82\</p\>"}

When I go to the EE CP I get this message: Your ExpressionEngine installation’s version (2.6.1) is not consistent with the reported version (2.7.3). Please update your installation of ExpressionEngine again.

# Answer
> 2 votes
Easiest solution that I've found for this in the past, is to go into your /system/expressionengine/config/config.php file and change the version number in there back to 2.6.1 and then re-run the upgrade using updater.

This would reapply the update and should resolve the problem for you.

---
Tags: devdemon-updater
---


# Question
Title: Structure Monthly Archive - archive template
I have a listing channel of a news/blog page. I'm attempting to use the Structure Monthly Archive plugin to achieve this. Everything seems to be as it should, however I keep getting a 404 error when I attempt to access the monthly.

My structure is like this: mysite.com/resources/newscenter - this spits out a paginated list of all news/blogs articles

In the left column of this page I've got the Structure Monthly Archive plugin coded, the archive list shows - but when I go to click on the link \[which looks like this: resources/newscenter/archives/2014/02\] I'm getting the 404 error.

But I can go to: resources/newscenter/archives - where it displays the same list as the main newscenter page: resources/newscenter

Any thoughts?

# Answer
> 1 votes
```
"No need to rely on Channels to separate your entries"

```

This copy says to me the addon works on Structure Page entries, not with Structure Listing entries as your question suggests you are using.

Here is a screenshot from the Structure Monthly Archives Devot:ee page showing how the entries need to be setup for the addon to work.

# Answer
> 0 votes
Why not keep the news listing outside of Structure and build the archive as you would normally? You can still assign the channel to a Structure node but have a template group of /news and then /news/archive to do the usual breakdown of filters.

---
Tags: structure, listing
---


# Question
Title: File_upload_preferences_model::get_upload_preferences() removed - What to use?
I've had a plugin for ExpressionEngine developed that uses the File\_upload\_preferences\_model::get\_upload\_preferences() method, which is now removed.

Is there a way for me to update the plugin to reflect any newly added similar methods?

# Answer
The new method that replaces `get_upload_preferences` is called `get_file_upload_preferences`. All you need to do is change that method name in your code, the parameters should be the same.
> 2 votes

---
Tags: add-on-development, file-uploads
---


# Question
Title: Using Stash lists with Channel Videos, getting double result rows
I'm using EE 2.7.3, Channel Videos 3.1.5, and Stash 2.4.9.

I am trying to stash all the data for my Page channel, which has a Channel Videos field. So at the top of my template, I have this code (\[hopefully\] irrelevant stuff omitted):

```
{exp:stash:set_list name="page_content" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="page" limit="1" status="not closed" require_entry="yes"}
        {stash:page_title}{title}{/stash:page_title}
        {exp:stash:set_list:nested name="header_videos" context="{entry_id}" parse_tags="yes"}
            {exp:channel_videos:videos entry_id="{entry_id}"}
                {stash:video_url}{video:url}{/stash:video_url}
                {stash:video_title}{video:title}{/stash:video_title}
                {stash:video_service}{video:service}{/stash:video_service}
                {stash:video_title}{video:title}{/stash:video_title}
                {stash:video_description}{video:description}{/stash:video_description}
                {stash:video_url}{video:url}{/stash:video_url}
                {stash:video_url_hd}{video:url_hd}{/stash:video_url_hd}
                {stash:video_img_url}{video:img_url}{/stash:video_img_url}
                {stash:video_img_url_hd}{video:img_url_hd}{/stash:video_img_url_hd}
                {stash:video_web_url}{video:web_url}{/stash:video_web_url}
            {/exp:channel_videos:videos}
        {/exp:stash:set_list:nested}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

And then, down below, I'm trying to pull that info back up, using this code:

```
{exp:stash:get_list name="page_content"}
    {exp:stash:get_list:nested name="header_videos" context="{page_entry_id}" prefix="page_video"}
        <h2>Count: {page_video:count}</h2>
        <h3>{page_video:video_title} {page_video:count}</h3>
        Service: {page_video:video_service}<br />
        Desc: {page_video:video_description}<br />
        URL: {page_video:video_url}<br />
        URL HD: {page_video:video_url_hd}<br />
        IMG URL: {page_video:video_img_url}<br />
        IMG URL HD: {page_video:video_img_url_hd}<br />
        Web URL: {page_video:video_web_url}<br />
        Embed Code: {page_video:video_embed_code}<br />
        Embed Code HD: {page_video:video_embed_code_hd}<br />
        <hr />
    {/exp:stash:get_list:nested}
{/exp:stash:get_list}

```

What's happening is, when I have 2 videos in that field, my code outputs 4 result rows. When I have 3 videos, the get\_list outputs 6 results. And the weird part is, the first from each pair has the first three fields correctly populated, but the rest are unparsed tags. And the 2nd from each pair has all the rest, including the 3rd field... Notice in the screenshot below, the URL field is the same on the 1st and 2nd results, the 3rd and 4th results, and the 5th and 6th results.

Like, so:

Does anyone know what I'm doing wrong? Stash is AWESOME, but I sometimes have trouble wrapping my mind around how it works. Thanks for your time!

# Answer
You have some keys which are repeated multiple times, `video_url` and `video_title`.

The first duplicate `video_url` causes the problem, because it makes Stash 'think' the row of keys is starting again, i.e. a new row. This doubles up your list.
> 2 votes

---
Tags: stash, channel-videos, nested-list
---


title: Billing details in PayPal express

text:
# Question
Title: Billing details in PayPal express
I have filled in my checkout with the following details, note I have left Shipping Address 2 blank:

```
Billing
First Name: “Billing Name 1“
Last Name: “Billing Name 2“
Address 1: “Billing Address 1“
Address 2: “Billing Address 2“
City: “Billing City“
Post Code: “Billing Post Code“

Shipping
First Name: “Shipping Name 1”
Last Name: “Shipping Name 2”
Address 1: “Shipping Address 1”
City: “Shipping City”
Post Code: “Shipping Post Code”

```

I then submitted this to Paypal Express and choose to pay via CC within PayPal. The fields are populated thus:

```
Billing Information
First Name: Shipping
Last Name: 2
Address Line 1: Shipping Address 1
Address Line 2: Billing Address 2
Town: Shipping City
Postcode: Shipping Postcode

Postal Address
Same as billing address: checked

```

I understood that my billing details should have been used..

I read in the gateway instructions ”PayPal only displays shipping addresses on their payment capture page. If a shipping address is captured on your site, it will be sent to PayPal. If a shipping address is not captured on your site, the billing address will be assumed to be the shipping address and will be sent to PayPal instead.”

So I have submitted the billing info but it is still taking the shipping info.. except for the Shipping Address 2 field which I left blank. Also the first and last name are being cut down.

Is this working as it is meant to do or am I missing something?

# Answer
I think this is working as it is meant to although I do find it very strange. I have just come up against this problem myself today.

The CartThrob Paypal Express plugin checks to see if there is a shipping address, and if there is then it will transmit that to PayPal instead of the billing address.

Having said all this I don't really understand the logic behind this - I would prefer just the billing details to be sent to PayPal and I am considering re-writing the plugin myself.

PS: It also limits the first and last name to 31 characters which, I suspect, is why yours is getting cut off.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: Displaying ExpressionEngine Data in an XML file
have come up against a problem recently and its driving me crazy. Just wondered if anyone can give some advice on it

I'm in the process of exporting data from a EEv1 site to an EEv2 site. So far I have exported some data from a channel into an XML file. What I'd like to be able to do is the following

```
<?xml version="1.0" encoding="UTF-8"?>

<entries>

{exp:weblog:entries weblog="assets" dynamic="off" status="Open" limit="1000" disable="pagination"}

<entry>

<!-- Entry ID | URL Title | Title | Author | Status | Entry Date --><br/>

<entry_id>{entry_id}</entry_id>
<url_title>{url_title}</url_title>
<title>{title}</title>
<author>{author}</author>
<status>{status}</status>
<entry_date>{entry_date format="%d/%m/%y %h:%i %a"}</entry_date>

<!-- Body --><br/>

<body><![CDATA[{body}]]></body>

<!-- Page Images Matrix --><br/>

<images>{images}
<matrix_cell_1>{image}</matrix_cell_1>
<matrix_cell_2><![CDATA[{label}]]></matrix_cell_2>
<matrix_cell_3><![CDATA[{image-link}]]></matrix_cell_3>
<matrix_cell_4><![CDATA[{openlink1}]]></matrix_cell_4>
{/images}</images>

</entry>
{/exp:weblog:entries}
</entries>

```

By the above I mean use Expression Engine tags to populate the XML file in a browser

If I save this XML file to the server and then navigate to the file in my browser, it would dynamically display all entries in that weblog in a presentable fashion. However it seems like the XML files just doesn't recognize the `{exp:weblog:entries...`

I don't get an error, but it just display the tags exactly as shown on the XML file.

Is anyone able to help out with this, as I'm sure I've had it working before. But that was a while ago and I've the feeling I may have missed something

Many Thanks

# Answer
> 2 votes
Ok so this has been resolved now. With credit to @Michael Boyink who suggested the following;

I had been creating the templates using FTP. However when the templates were created in the Control Panel Template Manager using XML as a template type, the XML gets populated with channel data, just as I had hoped.

Relief!!, this one could have stumped me for days but a simple solution in the end.

---
Tags: channel-entries, xml, export
---


title: Playa Re-ordering Not Working

text:
# Question
Title: Playa Re-ordering Not Working
I have a site that has a custom sidebar for each page and I decided to use Playa to accomplish this. I have the sidebar components displaying on each page as expected but the re-ordering doesn't seem to be working, they just stay in the same order as they are in my template.

Has anyone ever come across this before?

Template code - which is an include on each page:

```
<div class="sidebar">
{exp:channel:entries channel="page|sub_page|news_page|events_page|music_page|gallery_page|shop_page|reviews_page|contact_page" url_title="{embed:parent}"}
    {exp:playa:children field="sidebar" channel="sidebar_image_component"}
    <div class="sidebarComponent">
        <h4>{title}</h4>
        <a href="{sidebar_image_component_link}" class="linkImage"><img src="{sidebar_image_component_image}" alt="Buy my latest album" /></a>
        <a href="{site_url}/shop" class="siteButton album">Buy Album<i class="fa fa-long-arrow-right"></i></a>
    </div>
    {/exp:playa:children}
    {exp:playa:children field="sidebar" channel="sidebar_text_component"}
    <div class="sidebarComponent">
        <h4>{title}</h4>
        <p>{sidebar_text_component_textarea}</p>
        <a href="{sidebar_text_component_link}" class="siteButton">{link_text}<i class="fa fa-long-arrow-right"></i></a>
    </div>
    {/exp:playa:children}
    {exp:playa:children field="sidebar" channel="sidebar_featured_music"}
    <div class="sidebarComponent">
        <h4>{title}</h4>
        {sidebar_soundcloud_iframe}
    </div>
    {/exp:playa:children}
{/exp:channel:entries}

```

# Answer
Playa can’t re-code your template for you; if your template is first outputting any children from the “sidebar\_image\_component” channel, then from the “sidebar\_text\_component” channel, and then from the “sidebar\_featured\_music” channel, that’s the order they’ll appear in.

If you want the entries to be output in the Playa-defined order, you’ll need to merge all of that into a single {exp:playa:children} tag pair:

```
{exp:playa:children field="sidebar"}
    <div class="sidebarComponent">
        <h4>{title}</h4>

        {if channel_short_name == "sidebar_image_component"}
            <a href="{sidebar_image_component_link}" class="linkImage"><img src="{sidebar_image_component_image}" alt="Buy my latest album" /></a>
            <a href="{site_url}/shop" class="siteButton album">Buy Album<i class="fa fa-long-arrow-right"></i></a>
        {/if}

        {if channel_short_name == "sidebar_text_component"}
            <p>{sidebar_text_component_textarea}</p>
            <a href="{sidebar_text_component_link}" class="siteButton">{link_text}<i class="fa fa-long-arrow-right"></i></a>
        {/if}

        {if channel_short_name == "sidebar_featured_music"}
            {sidebar_soundcloud_iframe}
        {/if}

    </div>
{/exp:playa:children}

```
> 0 votes

---
Tags: playa
---


title: EE 1.x missing entries?

text:
# Question
Title: EE 1.x missing entries?
Has anyone ever seen this behavior before? I seem to have random entries missing from my site. This has been going on for a few months now and I've chalked it up to some weird anomaly when it first started happening. Now, I'm noticing that entries are missing because I'm getting crawl errors inside of Analytics and Adsense admin. I probably haven't deleted an entry in five years so something weird is going on.

# Answer
This is NOT good. A couple of possibilities occur to me.

1. Your host migrated your site to a new database server and failed to import the data correctly.
2. Someone has exploited a vulnerability in EE1.

If you look at the EE1 Change Log there are security fixes right up until the final version (1.7.3). If you are running a version older than that there are *certainly* vulnerabilities. If you are 1.7.3 there are *very likely* vulnerabilities as the code is not longer being maintained.

I'd start by going through my server log files to look for unusual control panel access, but some vulnerabilities might not even require this.

If you have database backups I'd look at those as well to see if you can determine when the missing data disappeared.

Updating to the latest version of EE1 might help but for the longer term you must get off of EE1 for the sake of security.
> 1 votes

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


title: Show all entries except most recent

text:
# Question
Title: Show all entries except most recent
I have a new page that I am pulling the most recent entry to feature on the page. I need to list out the rest of the entries except for the most recent entry.

How can I use the channel entries tag to show all entries except for the most recent?

Thanks.

# Answer
Use the offset parameter. Like:

```
{exp:channel:entries channel="news" limit="10" offset="1" orderby="date"}

```
> 5 votes

---
Tags: channel-entries
---


# Question
Title: How to collect payment of invoice with Expresso Store
We would like clients to be able to pay their invoices online, in a single page checkout. The form would collect the Customer name, email, invoice #, amount, and all the Credit Card info needed to send to authorize.net. In reviewing Expresso Store documentation, it isn't clear to us how to let the customer set the amount.

# Answer
There is a setting for this within the Expresso store field settings. When adding your channel field select "Yes" to dynamic pricing.
> 4 votes

# Answer
I reached out to Exo:resso based on the suggestion that *dynamic Prices* was how to allow users to set the price and thereby the invoice amount. This was their answer…

---

You're on the right track. Dynamic prices are the way to go and allow the user to enter in their own amount for the purchase. When setting this up you apply this to the Channel when you add the Store Product Details field type so I'd make sure your invoices are setup to be in their own Channel. Then when you add the Store Product Details field to the Channel Field Group you'll see the "Field Options" table at the bottom (screenshot attached). Set "Enable Dynamic Prices" to "Yes".

Then when you setup the templates you just need to make sure you add a "price" and "item\_qty" field to the Product Form tag:

The "value" will be submitted by the user. Store always needs an item\_qty field though so make sure you include it. Keep it hidden, as above, if you don't want to display this on the front-end.

Hope that helps.
> 2 votes

# Answer
I think you would need some AJAX to make it work all on one page, as there are two steps, the add to cart and the checkout.

Store doesn't allow users to input prices directly, but other users have reported setting up a product that is $1 and allowing the customer to set the quantity (labeled as amount) to set the number of dollars for the invoice.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: Child subcategory or separate category - which one for the best practices
I have channel named Products and category group Product Types assigned to it. As an example it looks like:

> Product Type -\> Scent -\> Product Collection

And then it comes as Product Collection sometimes has own Product Line (here I have dilemma) or goes directly to a product item (that part I have handled already).

Also Product Types category group is used for building a main menu (using GWcode Categories add-on).

My question is - should I add Product Line for particular Product ABC Collection as a child category or create separate category group Product Lines and there list Product ABC Collection with his Product Line (and how to link it to the "main" Product Collection from Product Type).

Option 1:

> Product Type -\> Scent -\> Product ABC Collection -\> Product ABC Line

Option 2:

> Product Type -\> Scent -\> Product ABC Collection
>
> Product Lines -\> Product ABC Collection -\> Product ABC Line

and connect those two category groups together.

I'm not sure which one is the best practice way to go for within EE.

Thanks

# Answer
> 0 votes
After some glitches I have decided to go with the Option 1.

Major issue was to retrieve product categories when product was in the cart using `{entry_id}` and GWcode Categories add-on. In that case I was getting all categories from Product Type and Product Lines, which created additional conditional statements to have that issue cleared. With the Option 1 it was straight out of the box.

---
Tags: categories, category-group
---


# Question
Title: EE Addon Module - How to store a value in a EE session?
I am needing to set and and retrieve a variable within this addon. For example on one page my module connects to a remote server and gets an auth code. I would then use that auth code for all subsequent requests back to that remote server.

I assumed that like in codeigniter i could just store this in a session, most likely the EE session. But everything i have tried does not store for the period of the session, just the time it is set.

Am i being a numpty? Or do i need to roll my own session setup and storage?

Thanks, N

# Answer
I think I would use the cache vs. the user data. The userdata is tied to the specific member that is logged in. The session cache is more appropriately used for add-ons (or developers) wanting to retrieve information in a subsequent method call.

```
$this->EE->session->set_cache('your_addon', 'your_cache_var', 'some value');

$cache = $this->EE->session->cache['your_addon']['your_cache_var']' // return 'some value'

```
> 2 votes

# Answer
With the EE session class you can set user data like:

```
$this->EE->session->set_userdata(array('session_name' => $value));

```

to get this user session data:

```
$session_name = $this->EE->session->userdata('session_name');

```

It would be better to use global session variable $\_SESSION.

like:

```
if (session_id() == "")
{
session_start();
}

$_SESSION['SESSION_NAME'] = $value;

```
> 0 votes

# Answer
FYI ExpressionEngine 2.0 removed the set\_userdata() function. For a workaround, see this thread.
> 0 votes

---
Tags: cache
---


title: Condition if entries exist?

text:
# Question
Title: Condition if entries exist?
My markup:

```
<section id="box">
<ul id="slide">
<li></li>
<li></li>
<li></li>
</ul>
</section>

```

I want to show the section box only if date condition matches to todays date and then further loop the li tags.If it does not then I completely want to ingore the entire box.

This is what I am doing:

```
<section id="box">
    <ul id="slide">
{exp:channel:entries channel="LIVE_STREAM"}
    <li></li>
{/exp:channel:entries}
    </ul>
 </section>

```

How do I put a conditional check right above the section.In php it would have been quite easy,but in expression engine how can I do it?

# Answer
If you use some custom text field to keep timestamp, in this case I think you need activate php and set it to be parsed on "input":

```
<?php
        $beginOfDay = strtotime("midnight", ee()->localize->now);
        $endOfDay   = strtotime("tomorrow", $beginOfDay) - 1;
?>

    {exp:channel:entries channel="LIVE_STREAM"  search:timestamp_field="<<?php echo $endOfDay; ?>" search:timestamp_field="><?php echo $beginOfDay ?>"}
{if count == 0}
<section id="box">
        <ul id="slide">
{/if}
        <li></li>
{if count == total_results}
   </ul>
     </section>
{/if}
{/exp:channel:entries}

```
> 1 votes

---
Tags: ee2, ifelse, no-results, count
---


title: Expresso-store select modifiers by name

text:
# Question
Title: Expresso-store select modifiers by name
I want to select modifiers by name because for my modifier's it's not possible to put all modifier\_options in the same output, for example a `<select>` form. So how would I be able to select a specific modifier?

Or do I need to walk through all modifiers and doe this with something like this:

```
{modifiers}
  {if "{modifier_name}" == "myMatch"}
  // Specific HTML for this match
  {if:else "{modifier_name}" == "myOtherMatch"}
  // Specific HTML for this other match
  {/if}
{/modifiers}

```

# Answer
Yes. The `{modifiers}` tag is a loop so within that loop if you wanted to call out a particular modifier by name then you'd need to run a conditional check as you are currently showing in your example.
> 1 votes

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


title: Is Low Search right for this?

text:
# Question
Title: Is Low Search right for this?
I have two forms on a site I'm developing, one form I need to be able to filter by categories and sub-categories, the other I need to filter by keyword, File Type (PDF, EXE) and list them based on their category.

Is Low Search right for this?

# Answer
> 1 votes
Depends on **what** you're filtering. Low Search will filter **channel entries**.

Whether you can *“list them based on their category”* depends on what you mean by that, exactly. If you can generate the output using the native `channel:entries` tag, then you can also output it using the Results tag.

---
Tags: low-search, filter
---


# Question
Title: Only outputting one category group with Channel Form
I have 2 categorys assigned to a channel that I want to use with channel form, however I only want to allow the editor to use 1 of these categories when adding a new element via channel form, I've tried the following:

```
{exp:channel:form channel="work" return="work/thanks"}
     <label for="categories">Categories</label>
     <select name="category[]" id="categories" size="4" multiple="multiple">
        {categories category_group="2"}
           <option value="{category_id}"{selected}>{category_name}</option>
        {/categories}
     </select>
{/exp:channel:form}

```

But this still outputs both categories, I can't seem to find any parameters in the documentation? http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_form/#category-group

# Answer
Turns out it should have been show\_group instead of category\_group

```
{categories show_group="2"}
<option value="{category_id}"{selected}>{category_name}</option>
{/categories}

```
> 0 votes

---
Tags: channel-form
---


# Question
Title: Comparing Stash variable to segment fails
I asked this also on Devotee - apologies for posting in both places but I guess here is better.

I’m setting several variables in the Channel Entries loop like so:

> {exp:stash:set name="var1" parse\_tags="yes"}{custom\_field}{/exp:stash:set}

Then outputting them later outside the channel like this:

> {exp:stash:get name="var1" default="uff" process="end"}

Which works fine. But then I want to compare “var1” to Segment\_3 but can’t find any syntax/conditional which will work…either it outputs nothing or both conditions are true - have tried with If/else plugin too.

I’m guessing it’s parse order? What’s the way to compare these values? I tried with this conditional:

> {if segment\_3 == "{exp:stash:get name='var1'}"}Success!{/if}

And it returns nothing when the condition is actually true and the ‘success’ when it’s false. Which is odd. Anyone shed any light?

# Answer
> 0 votes
It's a parse order issue: the conditional is being run before the stash variable is set. There may be a more efficient approach, but you can use stash parse to make it parse later:

```
{exp:stash:parse process="end"}
    {if "{segment_3}" == "{exp:stash:get name='var1'}"}Success!{/if}
{/exp:stash:parse}

```

(note the change to segment variable)

Or if you can use a snippet, try:

```
{exp:stash:set name="sn_var1" type="snippet"}{custom_field}{/exp:stash:set}

```

and retrieving:

```
{if sn_var1 == segment_3}success{/if}

```

---
Tags: stash, conditionals
---


# Question
Title: Issues with counter when using exp:zoo_triggers:catergories
**Note: This is a duplicate of a support request in Devot:ee but unfortunately I haven't had a response.**

I’m having an issue with counter which could really cause me headaches further down the line in the site that I'm developing. Counter doesn’t appear to update according to my url. I am using several categories to filter a list of products, and while the filter works perfectly with the entries that it outputs, the counter doesn’t. This means that the code is also outputting category options (on the second or third stage of filtering) which are empty. Hopefully my code helps explain this:

```
// EXAMPLE URL - domain.co.uk/paper-card
{if triggers:cat_name_1 == ""}
  <h2>Colour Range</h2>
  {exp:zoo_triggers:categories status="open" channel="pm_paper_card" style="list" cat_group_id="1" show_counter="yes" show_empty="no"}
{/if}

// EXAMPLE URL - domain.co.uk/paper-card/category/whites
{if triggers:cat_name_1 != "" AND triggers:cat_name_2 == ""}
  <h2>Sheet Size</h2>
  {exp:zoo_triggers:categories status="open" channel="pm_paper_card" style="list" cat_group_id="2" show_counter="yes" show_empty="no" path="{triggers:original_uri}" all_path="no"}
{/if}

// EXAMPLE URL - domain.co.uk/paper-card/category/whites/a4
{if triggers:cat_name_2 != "" AND triggers:cat_name_3 == ""}
  <h2>Pack Size</h2>
  {exp:zoo_triggers:categories status="open" channel="pm_paper_card" style="list" cat_group_id="3" show_counter="yes" show_empty="no"  path="{triggers:original_uri}"}
{/if}

// BELOW HERE IS WORKING FINE
// EXAMPLE URL - domain.co.uk/paper-card/category/whites/a4/small-box
{if triggers:segment_5 == "small-box" OR triggers:segment_5 == "midi-box" OR triggers:segment_5 == "mega-box" OR triggers:segment_5 == "a3-box"}
  <h2>Pick & Mix - {triggers:cat_name_3}</h2>
  {exp:stash:get_list name="products"}
    <p>{title} - {weight}</p>
  {/exp:stash:get_list}
{/if}

{if triggers:segment_5 == "packs"}
  <h2>{triggers:cat_name_3}</h2>
  {exp:stash:get_list name="products"}
    <p>{title} - {weight}</p>
  {/exp:stash:get_list}
{/if}

```

My problem is, in stage one I have 3 categories:

* Whites (13)
* Colours (1)
* Pearlised (1)

If I select Whites, in stage two I have 2 categories, however the total count for each category is taken from all entries, not the filtered list as I would expect:

* A4 (14)
* A3 (1)

Also, this becomes an issue if I select Colours or Pearlised, where I have only 1 product, neither of which have A3 as a category but it still shows A3 as a category option (and the incorrect counters).

This is the first time I’ve used Zoo Triggers so I appreciate I could be making some glaring mistake or have overlooked something in the docs.

If anyone can point out where I am going wrong it would be greatly appreciated as I feel I have exhausted the docs. Thanks.

# Answer
> 0 votes
Updating question to state that after direct contact from Zoo, it appears that this is beyond the scope of Zoo Triggers functionality.

---
Tags: zoo-triggers, zoo
---


title: Relationship filtering by category

text:
# Question
Title: Relationship filtering by category
*Echoing post from http://ellislab.com/forums/viewthread/236223/ as suspected error in user documentation.*

Looking at the documentation for the new relationships functionality it says filtering by category is supported (3rd paragraph of introduction): http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#accessing-parents

However this is not listed as one of the supporting parameters under http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html#id9 and does not seem to work when I try something along the lines of the following:

{parents field="minutes\_partner" category="20"} {parents:title} {/parents}

Anyone know if category filtering supported in relationships and if so how can I achieve this without writing some crazy custom query or coding a plugin?

Cole

# Answer
> 1 votes
Just had this precise problem.

Rummaged around and did a *little* hack to make this work.

Open this file

`/system/expressionengine/libraries/relationship_parser/Parser.php`

Look for:

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

If you simply move this line to be the last line inside the foreach loop that starts

`foreach ($entry_ids as $entry_id)`

Then it works.

Your script may differ slightly, but my line moved from line #475 to line #520

# Answer
> 1 votes
Had a similar issue recently and I used an IF statement to solve the problem for me. Might help with others who find this page looking for similar answers.

To use the OP's example:

Trying to get the following to work:

```
{parents field="minutes_partner" category="20"} {parents:title} {/parents}

```

How I got around it:

```
{parents field="minutes_partner"}
   {if "{parents:categories}{category_id}{/parents:categories}"=="20"}
      {parents:title}
   {/if}
{/parents}

```

Hope this helps someone.

# Answer
> 0 votes
This hack does work for the parent output but the standard output does not work now. Any ideas?

Not working...

{campus} {campus:title} {/campus}

---
Tags: categories, relationships
---


title: Zoo visitor save member error

text:
# Question
Title: Zoo visitor save member error
I'm using EE 2.7.3 and I have a fresh installation of zoo visitor (1.3.30). I migrated my members over to zoo (1 member) and tried to add a First Name and save. I receive this error:

```
Fatal error: Call to undefined method stdClass::update_username_password() in /var/www/mysite/system/expressionengine/third_party/zoo_visitor/ft.zoo_visitor.php on line 390

```

Any thoughts?

# Answer
This was resolved by re-installing zoo visitor. http://devot-ee.com/add-ons/support/zoo-visitor/viewthread/12676#41054
> 0 votes

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


# Question
Title: Postmaster Expiration_Date In "Post Date Specific" Field
I'm currently looking to send out an email using Postmaster when an entry expires. My entry will be assigned a expiration date, so im curious if I can use this variable in the "Post Date Specific" field. Currently the field states that you can put a dynamic date.

Will it work with the {parcel:expiration\_date format="%d/%m/%Y-%g:%i:%s"}? If it does, its not working for me.. Maybe its my formatting?

# Answer
Issue is definitely the formatting. I tested this locally and found that the format you used returns `FALSE` when it's passed to the `strtotime()` method. This because PHP cannot recognize the format to convert it to a timestamp, thus returning `FALSE` which will force the email to be sent immediately. Use the following format:

```
{parcel:expiration_date format="%Y/%m/%d %H:%i:%s"}

```
> 1 votes

---
Tags: date, postmaster
---


title: Page Load too Slow

text:
# Question
Title: Page Load too Slow
I have a page template that runs exceptionally slow (average 20 seconds to load). These pages are event pages and require certain information to be shown pre-event vs. post event. There are also competitors and judges, along with their lightboxed profiles. There are sponsors, comments, and additional information section. Because of this, within my code I know that there are a ton of conditionals. This is also an image heavy site.

What is a standard number of conditionals that won't overload my page? How can I get around using so many? How do you successfully code an ExpressionEngine page with this much content? Looking for any advice - I've been unsuccessful in trying to speed up this page for a very long time now.

I'm on ExpressionEngine v2.5.2, and here is my template code: http://codeviewer.org/view/code:3ca2. I am using plugins like Pixel&Tonic's Matrix and ED ImageResizer.

# Answer
> 3 votes
If else statements are killing! They slowdown your site because all code is executed, also the code that doesn't match the if condition.

Use switchee for if else statements and your page will load much faster! Link: http://devot-ee.com/add-ons/switchee. You will be amazed!

**Description of the plugin**:

*With EEs if/else advanced conditionals, each condition is parsed before being removed at the end of the template parsing process. This means if you wrap if/else tags around lots of other tags then your template will be running many unnecessary queries and functions.*

*Using Switchee instead you can ensure that unmatched conditions are removed from the template before they can be parsed. This can make your template significantly more efficient and your pages will render more quickly.*

# Answer
> 0 votes
I hope I can offer a few more suggestions to help.

1. Try using the disable tag in your exp:channel:entries line to reduce some unnecessary queries.
2. Use {if}{/if} and {if}{/if} instead of {if}{if:else}{/if} whenever possible. EE support people have recommended that to me a number of times.
3. Turn on Display Output Profiler and Display Template Debugging. Note the large number of database queires, in part because of plugins and conditionals, and identify the biggest problem areas. It's a matter of opinion, but I try to keep my total queries per page to no more than 30-40.
4. Instead of Img Resizer, try using the native Image Manipulations to reduce the number of database queries. I find it helps to use plugins only when absolutely necessary.
5. You have two embeds at the top for header and navigation. Can they be combined?
6. Note that Disqus uses a lot of javascripts, slowing the page even more.
7. Turn on template caching.
8. Use gtmetrix.com to analyze choke points even further.

Scott

---
Tags: conditionals, channel-images, speed
---


title: Building a client portal

text:
# Question
Title: Building a client portal
I built an EE site for a business client several years ago, and they are now asking about my adding a client portal to store and share documents. This would need to be a secure area of the site, as the documents may be sensitive. They are currently on a shared hosting plan. My questions are:

1. Can I build this in EE, and be confident that it will be adequately secure? Perhaps using Protected Links, Zoo Visitor and SSL certificate, and storing the files above the root?
2. Would it be better to store files on Amazon S3?
3. Can it be adequately secure on shared hosting?
4. Would I serve the client better by recommended a service such as ShareFile or something similar, that could be branded.

# Answer
> 1 votes
1. If the "clients" don't need access to the EE control panel itself, I don't see why you couldn't achieve the basic presentation with a simple set of page templates using the {if logged\_in} tag or some such and combining that with an SSL connection. ( http://ellislab.com/expressionengine/user-guide/templates/globals/conditionals.html )
2. The files themselves might be better secured via Amazon S3, yes, but you could produce a combination of S3 and the approach I've outlined in #1 above. You could secure the template-ed pages via EE's normal means, but build a channel specifically for S3 hosted files. Say, using the default title field, plus an Amazon S3 secured link as a custom field. Typically, S3 links are time sensitive, so the custom field might simply contain the file name. At display time, you could establish a connection to that file name to an S3 bucket containing it using an API key to generate an expiring link. This would help ensure that sharing links with unauthorized users would become pretty useless.
3. I'd say your definition of "adequate" is important here. The spectrum might range from "DOD"-secure or "I'd be a little embarrassed if this leaked"-secure. Personally, I'd find the above approach reasonably secure, but I wouldn't assume the NSA wasn't downloading those secured files on their donut breaks.
4. There's a reasonable argument to be made for using a 3rd party file sharing service like Sharefile or Dropbox, yes. However, branding isn't the reason you'd go that route. Using a 3rd party is the no-development-necessary approach. Fast turn up. The upside of the EE approach is that it's fully branded using the site's page templates you already have in place.

---
Tags: security, amazons3
---


# Question
Title: NGen File Image to Assets within Matrix table
I'm currently in the process of transferring channel entry data from an EEv1 site into a fresh new EEv2 site. My method is to populate XML files with channel data and then, using Importer (or DataGrab), pop the channel data into the waiting channels on the new site.

The problem I'm running into is that as you'd expect, custom fields being used on the old site aren't really what I'd like to use on the new. So the example that's giving me a headache is the following;

Currently Ngen File field being used to handle images/documents on the old site and I'd like to be able to import these images into an Assets field on the new site.

Can anyone give me some steps or advice on how I would achieve this.

In my Exported XML file I have the following

```
<images>

 <matrix_cell_1>{filedir_1}BREEAM-CTA_1.jpg</matrix_cell_1>
 <matrix_cell_2><![CDATA[no-borders]]></matrix_cell_2>

</images>

```

It has brought the image path through. This image path (**images/uploads/page-images**) has been recreated exactly on the new site. But how can I go about taking what is essentially a text string (**/images/uploads/page-images/BREEAM-CTA\_1.jpg**) and convert it into a functioning Assets field image.

I appreciate that it cannot be as easy as importing that image path directly into an Assets Field. I assume a few extra steps have to be taken in order to have Assets recognize that imported field string.

Thank you for any advice/answers

# Answer
> 1 votes
OK...progress, enough progress to be able to post an answer anyway. Turns out using Datagrab rather than Importer seemed to do the trick. Why that would make any difference whatsoever is beyond me as they're both great EE plugins. I'm open to suggestions on that one

So, in a nutshell, I created the Image field in the new site using File as its field type. I then imported the XML file using `{filedir_x}`, with x being the file upload destination of choice, instead of a relative path to the image. This then populated the image in the File field.

Its then just a case of changing the field type of the image from File to Assets and the image will remain.

Its kind of a relief to know my only mistake, on the surface, was using the wrong module.

---
Tags: assets, pixelandtonic, import, solspace-importer, channel-fields
---


# Question
Title: Check if user is logged-in inside sessions_start hook handler
I am aware that in sessions\_start handler function, the session object is not yet set.

Since I can't use the session object, are there alternative ways to check if you are logged in in this function handler?

# Answer
If there is no session, then there is no logged in user. All of the user login code runs after the sessions\_start hook.
> 1 votes

---
Tags: sessions, hook
---


# Question
Title: Options for showing content based on a member field
I'm about to start building a system where we need to display different content for different users, but all these users will be part of the same usergroup "students". I'm trying to work out the best way to group the various members of this user group together into "schools".

So basically I could end up with 150 students with 50 in school1, 50 in school 2 and 50 in school3.

My initial thinking was that we'd simply have a custom member field named school and then on each template check this field and display articles from a category with the same name as the custom member field, but i'm not 100% sure this is the most effective/scalable way of doing it so am looking for more ideas.

Any other ideas or add-ons/modules that could help would be much appreciated!

# Answer
I've ended up having a "School code" on the registration process, using member custom fields. I then have a School channel which contains the school name and the code, I then check against this when pulling out articles. Lots of if else's but does the trick!
> 0 votes

---
Tags: members
---


# Question
Title: EE Hook where I can change language to be displayed?
Is there hook in ExpressionEngine where I can change the language to be shown before the page is rendered?

# Answer
> 2 votes
You might use `sessions_start` hook and set language config variable within hooked function.

---
Tags: hook, language
---


# Question
Title: Stash lists with a dynamic list name in a relationship loop
I have got a bunch of entries in this relationship and i want to spit them out and group them by day. So, i thought i could use Stash to capture this, group them into a list for each day and the below is my sorry effort.

It does work, but it's not appending the row of data, it's only ever one row as i guess it's creating and destroying those lists over and over. I can't see any other way to do this though. Any ideas would be greatly appreciated!

```
{parents field="products-lessons-pool"}
   {exp:stash:set_list name='{parents:products-lessons-day}' parse_tags="yes" save="yes" scope="site"}

      {stash:class}{parents:products-lessons-class:title}{/stash:class}
      {stash:time}{parents:products-lessons-time format="%g:%i %a"}{/stash:time}
      {stash:day}{parents:products-lessons-day}{/stash:day}
      {stash:entry_id}{parents:entry_id}{/stash:entry_id}
      {stash:price}{parents:product_price}{/stash:price}

    {/exp:stash:set_list}
{/parents}

```

# Answer
> 1 votes
Oh silly me, i had the answer in a code sample on my machine already :-/

```
{parents field="products-lessons-pool"}
      {exp:stash:append name="Monday" match="#Mon#" against="{parents:products-lessons-day}" parse_tags="yes" save="yes" scope="site" refresh="86400"}
            <tr>
                <td>{parents:products-lessons-class:title}</td>
                <td>{parents:products-lessons-time format="%g:%i %a"}</td>
                <td><a href="/cart_functions/add_to_cart/{parents:entry_id}" class="button success radius">Buy</a><br />
                     {parents:product_price}
                 </td>
            </tr>
       {/exp:stash:append}
 {/parents}

```

---
Tags: stash, relationships
---


# Question
Title: Accessing site without ~tilde (alternate domain using hosts file?)
I am developing a site that resides on a different server to where the current site resides.

I am accessing the site via a url such as:

http:// host.server.com.au/~username/

(So i am logging in via http:// host.server.com.au/~username/admin.php and viewing the site at eg, http:// host.server.com.au/~username/index.php/index)

This is causing some issues with links/linked files so i want be be able to access the site via a specific url, such as mytempdomainsite.com.au

I have tried altering my hosts file in such a way:

111.222.33.44 mytempdomainsite.com.au
111.222.33.44/~username/ mytempdomainsite.com.au

however that does not work for me. I have also tried editing the htaccess file with rewrites (found via searching the web), and then editing my system configuration within EE but nothing seems to work.

I have no idea the steps involved in getting this to work for me. The ~username is causing me some grief, so if anyone can help with this it would be deeply appreciated!

# Answer
.host file just overwrite DOMAIN -\> IP determination which usually do DNS server before you computer send request to Web server. So you can't manipulate urls on server with it.

Your web server (apache/nginx) must be ready to get request with domain "mytempdomainsite.com.au" (or have default setting for ip) and redirect to your web folder. This is only way. After that you can route you request by htaccess.
> 2 votes

---
Tags: htaccess, server
---


# Question
Title: Search Results Page - The action you have requested is invalid
Anyone getting “The action you have requested is invalid." On a search results page when using {exp:search:search\_results} tag?

This is EE 2.7.3.

\**Fixed --- Basically use a completely separate template for results don't try and route it through /search/index.php.

# Answer
> 2 votes
The native search module, and in this case the `exp:search:search_results` tag, expects a URL like this, assuming the tag is put in the `search/results` template:

```
domain.com/search/results/HASH

```

The hash is supposed to be *at least* 32 characters long (alphanumeric). If the hash is not there, the error is triggered.

The hash is used to look up a submitted search query. The query has been put in the DB by submitting the search form, after which it redirects to the results page. The search hash stays valid for a limited amount of time, after which it's deleted from the DB. If EE cannot find the search query associated with the hash, the error is triggered.

If a valid query is found, it is run again. If it then has 0 results, the error is triggered.

Then there's the possibility of having an expired XID token, as a result of the secure forms. This will be addressed in 2.8, but in the meantime, you can execute this query to avoid this issue:

```
UPDATE exp_actions SET csrf_exempt = 1 WHERE class = 'Search';

```

So, make sure all of the above conditions are met, and the error should go away.

---
Tags: search
---


title: Document Link Target New Window

text:
# Question
Title: Document Link Target New Window
Can the target tab drop down be defaulted to "open in new window" when linking to uploaded docs?

# Answer
> 1 votes
You could easily do this with jquery on the front end of the site.

```
//all pdf links with a will open in a new window
jQuery(document).ready(function() {
    jQuery("a[href$=".pdf"]").attr('target', '_blank');
});

```

Change the selector as needed if you only want to target pdfs on a certain page/div/ etc...

---
Tags: wygwam
---


# Question
Title: Does anyone know of a working color picker plugin for Expression Engine 2.x?
I've found all the plugins on devot-ee.com, but none of them seem to work. Most of them seem to cause some sort of javascript conflict. The "modal" that the pickers use show up at the bottom of the publish form and the picker fields don't work.

I'm using EE 2.7.3.

Here's a screenshot of what it looks like.

http://cl.ly/image/2t3f1W3j153k

# Answer
> 3 votes
I found out what the issues are. The plugins simply haven't been updated for the most recent versions of EE.

I use a different locations for my third\_party folder. The url in most of these plugins look for the theme directory in the default location using this url:

```
$this->EE->config->item('theme_folder_url').'third_party/plugin_folder_name

```

But, there's also a config variable avaialable for getting the defined third\_party theme directory:

```
$this->EE->config->item('url_third_themes').'/plugin_folder_name

```

So, in any of these color picker plugins, just open the PHP file that comes with them and update the url to the theme files.

You can find a list of hidden EE config variables here: http://ellislab.com/expressionengine/user-guide/general/hidden\_configuration\_variables.html

---
Tags: fieldtype, jquery
---


# Question
Title: Category dropdown in Channel Form, with parent cats as option group labels?
I'm having a few issues with categories at the moment that seems like it should be simple, but it is not.

I have a category set up which contains a list of UK counties. This consists of 4 parent categories (the countries - England, Scotland, Wales & Ireland) and many child categories for each (the individual counties).

I am trying to output the categories into a select dropdown within a channel form, with some structure.

I want the parent categories to show as a 'non selectable' label, and the child cats organised beneath.

This way users can only select a single county, and the parent category should be selected as it is set to 'auto-assign' within the settings.

In other words, I want it to look like this...

instead of this...

Any ideas? Everything I've tried (including this question here and I am still unable to get it working!)

(The first picture was achieved via the P&T dropdown in a custom field)

**UPDATE:**

The answer below got this working and I am using the following...

```
<select name="category[]" id="categories">
  <option value="">Select one...</option>
{categories}
  <option value="{category_id}" {if "{category_depth}" == "1"}disabled{/if}{selected}>{category_name}</option>
{/categories}
</select>

```

Only thing now is validating it? Is there a way to make a category required via the native (i'm using inline) error handling?

# Answer
> 1 votes
When outputting your category options do something like

```
<option value="{category_id}" {if "{category_depth}" == "1"}disabled{/if}>{category_name}</option>

```

Edit (sources): http://www.w3schools.com/tags/att\_option\_disabled.asp http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_form/#category-depth

---
Tags: categories, safecracker, channel-form
---


# Question
Title: Get untranslated {segment_n} from translated URL with publisher
I'm using Publisher for translations and also use the URL translation. Now I want to show a menu item "active" based on the URL. But when I get `{segment_1}` it will return the translated template. So the make an if else statement for showing a active class, I need a lot of OR function to check all different languages. That's not how it should work!

So I wont to know, can I get the default untranslated template name? I thought of something like:

```
{publisher:segment_1}

```

But this echo's nothing at all..

Is it possible what I want? And how to?

# Answer
> 1 votes
I think you emailed me about this, and it might be a bug when that variable is inside of a snippet as it appears to work when its in a template file directly.

---
Tags: multi-language, publisher
---


# Question
Title: Should you upgrade ExpressionEngine or Multiple Site Manager (MSM) first?
I am upgrading MSM and ExpressionEngine.

Which upgrade do I need to complete first?

# Answer
You should always make sure you are running the most recent version of ExpressionEngine when installing or upgrading Multiple Site Manager.

**Also consider:** when you buy additional licenses you're technically completing an upgrade of MSM, and so each time you add new licenses, you need to make sure you're on the most recent version of ExpressionEngine.
> 1 votes

---
Tags: multi-site-manager, upgrade, ee2-upgrades
---


# Question
Title: Cartthrob order subtotal:plus_tax includes tax on products that aren't taxable
I have a cart set up to add 20% VAT to products. We then have a field that enables the user to set a product as non-taxable.

When you order one of these products, everything goes through as expected with the order confirmation showing the line item without tax, and the order tax and grand total in the summary are all incorrect. However the subtotal is not - it adds tax when it shouldn't.

Example:

Product price = £15.42, not taxable.

Subtotal = £18.50 Shipping = £0.00 (Incl. tax)= £0.00 Total = £15.42

This is with the following code:

```
{exp:cartthrob:submitted_order_info}
    Subtotal: {order_subtotal:plus_tax}<br>
    Shipping: {order_shipping:plus_tax}<br>
    (Incl. tax): {order_tax}<br>
    Total: {order_total}
{/exp:cartthrob:submitted_order_info}

```

I've tried removing :plus\_tax but then the output is incorrect for any products that DO have tax on them.

This only seems to affect the subtotal and order\_shipping in the submitted\_order\_info tag, both of which fine all the way through the basket.

EE is 2.7.2, CT Pro 2.4

# Answer
> 1 votes
Rather than use :plus\_tax on the order\_subtotal tag, the solution was to map a field in the config for Order Subtotal Plus Tax and just output that directly in the template (for example {order\_subtotal\_plus\_tax}.

---
Tags: cartthrob, mightybigrobot
---


# Question
Title: Access data from grid field in a related entry, linked by a grid field
Not sure if that title makes sense, but here is the problem I'm having.

I have a grid field with four rows (`home-featured-lesson`). This grid field has one column, which is a relationship(`lesson-plan`). You select the entry you want to relate, then I pull data from that.

It mostly works, apart from one bit - I have another grid field in the related entry (`lesson-images`) and I can't seem to pull anything from it. Here is my code:

```
{home-featured-lesson}
    <div class="lesson-plan">
        {home-featured-lesson:lesson-plan:lesson-images}
            <p>{home-featured-lesson:lesson-plan:lesson-images:image}</p>
        {/home-featured-lesson:lesson-plan:lesson-images}

        <h3>{home-featured-lesson:lesson-plan:title}</h3>
        <p>{home-featured-lesson:lesson-plan:lesson-summary}</p>
    </div>
{/home-featured-lesson}

```

And here is my output:

```
<div class="lesson-plan">

    <h3>Lesson Plan 1</h3>
    <p>Lorem ipsum</p>
</div>
<div class="lesson-plan">

    <h3>Lesson Plan 2</h3>
    <p>Lorem ipsum</p>
</div>
<div class="lesson-plan">

    <h3>Lesson Plan 3</h3>
    <p>Lorem ipsum</p>
</div>
<div class="lesson-plan">

    <h3>Lesson Plan 4</h3>
    <p>Lorem ipsum</p>
</div>

```

As you can see, the tag pair for the grid field inside the related entry is not returning anything at all. I've tried a few variations on the tag pair but nothing seems to work. Does anyone know where I'm going wrong here?

Thanks in advance!

# Answer
I **think** you're almost there.

```
{home-featured-lesson:lesson-plan}
    {home-featured-lesson:lesson-plan:lesson-images}
        <p>{home-featured-lesson:lesson-plan:lesson-images:image}</p>
    {/home-featured-lesson:lesson-plan:lesson-images}
{/home-featured-lesson:lesson-plan}

```

I think you need to establish the first relationship, then the 2nd. Can't do it in one go, I believe.
> 2 votes

---
Tags: ee2, relationships, grid
---


# Question
Title: cycle thru each parent category and show 3 entries from each category
I am looking to cycle thru all the parent categories of a category group, show three random entries (from the products channel) from each category, then go to the next category in the group.

I'd share some code, but I don't even know where to start.

My final code that works:

```
{exp:channel:categories
    style="linear"
    category_group="2"
    parent_only="yes"
}
    <h1>{category_name}</h1>

    {exp:channel:entries
        channel="products"
        category="{category_id}"
        limit="3"
        orderby="title"
        sort="random"
        status="open|featured"
        cache="yes"
        refresh="5"
        disable="category_fields|member_data|pagination"
    }
        <p>{title}</p>
    {/exp:channel:entries}
{/exp:channel:categories}

```

# Answer
I needed this for a recipe website once and the code below seemed to do the trick:

```
{exp:channel:categories channel="products" style="linear" show_empty="no"}
  <h2>{category_name}</h2>
   {exp:channel:entries channel="products" dynamic="no" limit="3" orderby="random" category="{category_id}" }
     {title}
   {/exp:channel:entries}
{/exp:channel:categories}

```

The channel param on the categories tag is required unless you only have a single channel. Multiple channels may also be specified.

see: http://ellislab.com/expressionengine/user-guide/modules/channel/categories.html#channel

Hope this helps!
> 2 votes

# Answer
Alec's method works, but it might cause very high query counts due to the way EE generates nested Channel Entries tags. Take a look at the alternative method outlined in this post from EE Add-on superhero (and parse order master) Low. It achieves the same thing, but is *much* more performance friendly:

http://gotolow.com/blog/nesting-tags-and-performance-in-ee

And if you're like me and not excited about futzing with PHP, have no fear. This is actually a pretty simple and flexible technique to implement even if it might not appear so on the surface.
> 3 votes

---
Tags: categories, channel
---


# Question
Title: Devdemon Updater error: Unable to load the requested class: localize
I'm trying to update my install of expressionengine from 2.5.3 to 2.7.3 using DevDemon's Updater module. I installed Updater and then dragged the EE2.7.3 zip into Updater and clicked Start Queue. It then said it was Waiting for a response from the server but didn't do anything. Now when I go to the control panel it just gives me the error

{"error":"

Unable to load the requested class: localize\</p\>"}

I then deleted the Installer folder which it had created and it went back to normal but it hasn't managed to update EE. What's the next steps to take to work out what's gone wrong?

# Answer
I had the same problem - according to Manuel at DD this was a bug with updating earlier version of EE introduced when they added support for EE2.8 and is now fixed with the latest version of Updater (3.2.11)
> 1 votes

---
Tags: ee2, devdemon-updater
---


# Question
Title: Is there a way to modify the CP home screen?
Are there any plugins available to update the layout / available list of actions on the home screen once a user is logged in?

# Answer
dashEE \- is fully customizable ExpressionEngine control panel dashboard alternative.

> Module comes with 8 default widgets but you also have the ability to develop your own tailored to your needs. In addition to developing your own stand along widgets you can also incorporate dashEE widgets into your existing custom EE modules instantly making your modules more usable by introducing new functionality right on the EE CP dashboard.
> 6 votes

# Answer
Zoo Flexible Admin is great for controlling and customizing what other member groups can see in admin control panel.

"Lets you fully customize the control panel menu per membergroup. Insert custom links, rename, re-order and remove menu items in order to create a more intuitive menu..."
> 1 votes

---
Tags: add-on, control-panel, extension
---


# Question
Title: Log in member based on custom field, without password
We have a project where our client would like to display different prices for promotions, based on a member's group. The client would like the member to login by entering their current customer account number, which is allocated to them though our client's Point-Of-Sale. Our client would like the member to be able to do this without a password, as the data to be displayed is not particularly sensitive, but is tailored to their members.

Is this possible? We are planning on using Zoo Visitor to manage members elsewhere on the site.

Thanks for your help.

# Answer
I think, Customer Account Number would be unique for each member so based on the Customer Account Number, the member id can be fetched. That member id can be used for manually login a member.

You should see here: Manually login a member in ExpressionEngine

There is another way also. As you can get member's username also with Customer Account Number so just use LogMeIn addon and pass username. I hope, it would be best approach for you.

As you mentioned that using Zoo Visitor so getting username and member\_id would be easy with parameter `search:customer_account_no_field="[CUSTOMER ACCOUNT NUMBER]"`.

I hope, it would help you.
> 2 votes

---
Tags: members, login, zoo-visitor, member-details
---