title: Automate Exporting of Freeform data

text:
# Question
Title: Automate Exporting of Freeform data
I've asked this question over at Solspace but thought I'd see if any of the EE community have any insight.

I have urgent need of a solution that can automate the exporting of freeform data. The manual solution is not a viable option at all.

Can anyone advise me of how I could achieve a cron job or JSON feed… anything that can be picked up by a remote server, I'm open to all ideas.

Exporting each "form" group would be mandatory ie. not all form data in one stream/file/URL

# Answer
> 2 votes
Firstly thankyou all for your replies and knowledge, I'm confident all answers are "the answer" but EE being EE there is rarely a definitive answer, here's the solution I've arrived at.

Nicolas from Solspace suggested using EE as the solution.

It made sense, I recall using EE to output similar types of data for different needs but I had never thought I could use EE for JSON output (OK, so I'm a newbie with JSON).

A google search returned one poignant post by James over at spibey that pretty much dealt with was what I was after.

A liberal dash of Low Replace to remove any nasty characters that may be in the Freeform fields and stuff up the JSON schema.

Combined with Rob Sanchezs' Http Header Plugin to convert the template to proper JSON and I'm well on my way.

The only thing left to do was create a ridiculous username/password and restrict the template to that usergroup only and I now have a series of URL's that are secure and output JSON feeds of all Freeform collected info.

Note, extended the functionality to include a parameter where the client can query a date range rather then "the lot".

Thanks to all who helped.

# Answer
> 3 votes
This can actually be accomplished quite easily using a combination of Automat:ee and Export It. Automat:ee would handle the scheduling and Export it can be used to export out the Freeform data.

# Answer
> 2 votes
You can create a template to pull Freefom data anyway you need it to be pulled. If you need a json feed, just build that code into the template using Freeform tags. You'll get exactly what you need and how you need it. You can create an XML feed instead of json if that's easier for you.

If you need to automate saving the output to a flat file, just add the appropriate PHP and add a cron job on your server to run the template at the specific intervals you need.

# Answer
> 1 votes
From what I can tell, the answer is not one that currently exists as part of the Module. For the process to be automated, you would need to create a custom query, with a cron job or an add-on, but the cron job with a custom query would be the easiest approach.

Andrew Weaver has a great little utility add-on, AJW Export, that basically would handle the .csv process for you, so all you'd need to do is create the query, place it on a template, and either set-up a cron job with your ISP or use the ExpressionEngine Cron add-on, which I can't recall, if it's packaged with EE or if it's one of the many items you can get from EllisLab, but you need to grab from Devot-ee or the Ellis Lab GitHub account.

One thing to recall with the custom query process, is that FreeForm Pro 4.x now creates new data tables for each new form, so make sure you grab the right forms data. The query would look like:

```
{exp:ajw_export
sql="SELECT entry_id, entry_date, form_field_1, form_field_2 FROM exp_freeform_form_entries_1"
format="csv"
delimter=":"
filename="output.csv"
}

```

The one thing I'm uncertain about is the

> anything that can be picked up by a remote server

statement. Do you need another database to grab the reports, or do they need to be stored on a different server? A cron job will automate the running of the report, AJW Export will produce the .csv format for you, but both options either assume it will be downloaded in a web browser or be saved to the server. In fact, I think AJW Export ONLY posts to immediate download. I could be wrong, but I believe that's true.

If you have a second database that needs access to info from the website, then an ODBC query might be more appropriate. I know we've set these up for clients using FileMaker on the desktop and MySQL on the server. The automation is more dependent on what desktop database you are using. But basically, we configure the desktop database to open a connection to MySQL using ssh via the sFTP access, and an IP filter, then grab the data. FileMaker handles pre-existing data by checking if the designated entry\_id exists or not.

I've never used it, but if JSON is your other option, then you can also look at the add-on, JSON, by Rob Sanchez/Barrett Newton. You might be able to grab this from a specific url, with some login credentials or an IP filter.

---
Tags: solspace-freeform, automation
---


# Question
Title: How to deal with Seg2Cat no results in channel query
I'm using Low Seg2Cat to retrieve the third segment of my url and pass it as category to filter a listing page. Problem is that when third segment is empty I have no-results, where I was expecting a full list.

Here my code:

```
{exp:channel:entries channel="my_channel" category="{segment_3_category_id}"}

```

URL : my\_template/my\_category \[wohoo, get right result!\]
URL : my\_template/ \[uh oh, no results at all :'/ \]

Normally in a situation with an empty category i.e. `category=""` it returns all results, so it is like Seg2Cat is passing some kind of string filtering category with one that doesn't exists.

For instance, this code works just fine, it returns all posts:

```
{exp:channel:entries channel="my_channel" category=""}

```

Any idea?

# Answer
> 7 votes
By default the Seg2Cat extension will only populate the `{segment_n_category_id}` vars if the corresponding segment is present. So in your case when segment 3 is blank the `{segment_3_category_id}` var does not exist so it's passed to the channel entries tag as a raw string.

To fix this you can tweak the extension settings and set "Set all segments" as Yes. This will ensure that an empty var will be set if no match is found and the channel entries tag should behave as intended.

---
Tags: categories, segments
---


# Question
Title: Getting reverse related entries via Playa
I have a channel called "products" which contains a Playa field called "chemistry-group". This field allows a relationship between a product and one or more chemistries. For instance, "Copper Iodide" is related to the "Copper" and "Iodine" chemistry groups. No problems there.

For the sake of administration, the playa field needs to exist in the product channel.

What I need to do is create a page for each chemistry that will look in the products channel and list any products where a relationship exists.

I could do this with reverse\_related\_entries but since each product can be in more than one group I'm unable to use the native relationship field (as this only allows a single relationship - or have I gone nuts here?).

I'm having trouble getting my head around setting this up, can anyone help?

# Answer
> 6 votes
I've worked it out in a moment of clarity and by re-reading the excellent Playa documentation.

The tag pair I wanted was

```
{exp:playa:parents channel="products"}

```

So on my chemistry page I'd have something like

```
{exp:playa:parents channel="products"}
    <a href="/products/{url_title}}">{title}</a>
{/exp:playa:parents}

```

This shows me any entries from my products channel that are related to the entry I am viewing from the chemistry channel.

It was as simple as that!

---
Tags: playa, related-entries, reverse-related-entries
---


title: related categories issue

text:
# Question
Title: related categories issue
I am having a slight issue with grabbing data from my related categories. click here on my dev site i have several categories energy, relax, wellness etc etc. When the user click on one of the categories a blog roll is created which reveals all posts with that category. I have added the following code to my template:

```
<ul class="results-row">
{exp:channel:entries channel="blog" disable="member_data|trackbacks" related_categories_mode="yes" limit="4" }
        <li>
        <a href="{url_title_path='blog/full-post'}">
            <div class="featured-tab {categories}{category_image}{/categories}"></div>
            <img src="{blog_slide_image}" alt="placeholder" class="feature-preview-img"></a>
            <h2>{title}</h2>
            <p>{exp:eehive_hacksaw chars="150" append="..."}{feature_copy}{/exp:eehive_hacksaw}</p>
        </li>
        {/exp:channel:entries}
        </ul><!-- RESULTS-ROW ENDS HERE-->

```

However the blog roll pages remain blank, although the categories are populated. Looking at my code above can someone point me in the right direction.

# Answer
> 1 votes
I think the issue may lie with the presence of the related\_categories\_mode parameter, which is intended for a single entry view and not an entries loop returning multiple entries.

From the docs:

```
  When enabled, this parameter alters the behavior of the {exp:channel:entries} tag, causing it to ignore the entry ID or URL title found in the URL, and instead show a list of entries that are in the same category as the entry specified in the URL. This lets you create a list of entries that are “related” to the primary one specified by the URL.

```

And so your URLs in category viewing wouldn't have a single entry's url title or id, and so the loop fails to return entries. You would want to use related categories mode on your full-post template perhaps, but not on your list view.

---
Tags: templates, categories, related-entries
---


# Question
Title: Get Category Name from a known Category ID
> **Possible Duplicate:**
> How do I display a category name based on a segment?

I am trying to construct a Breadcrumb navigation system on my navbar. The URL will look like this: http://mysite.com/case\_studies/index/3 \- where '3' is a Category ID.

I want to be able to retrieve `{category_name}` or similar dynamically. How can I do this? I have seen `{exp:channel:categories}` but that seems to not let you filter by ID.

Any ideas? Thanks!

# Answer
Have you tried the category heading tag pair? Alternatively there is a great add-on from Low called Seg2Cat that lets you grab a bunch of info on a category-related segment in the URL.
> 4 votes

---
Tags: templates, channel, categories
---


# Question
Title: Low Search - Can you search multiple collections in one search?
Assuming that some collection fields are the same, can you search multiple collections in one search/search form?

# Answer
> 2 votes
Yes. Treat the collection parameter as the channel parameter. Multiple collections are searchable, even if the collection fields are different.

---
Tags: low-search
---


# Question
Title: ExpressionEngine - I'm a beginner, have I set up my Channels correctly?
I'm a beginner at ExpressionEngine, so I'm wondering if this is actually the right way to do things. Here's how my site is laid out:

* Construction
    + List of Construction case studies
        - Case Study 1
        - Case Study 2
        - etc.
* Hydrology
    + List of Hydrology case studies
        - Case Study 1
        - Case Study 2
        - etc.
* Sustainability
    + List of Sustainability case studies
        - Case Study 1
        - Case Study 2
        - etc.

What I have done is set up a Channel called "Home" for my homepage, and a channel called "Case Studies", along with corresponding Channel Field Groups for both.

In terms of Templates, I have created a Template Group called "Home", and a Template Group called "Case Studies".

All is fine with the "Home" group. This is where I'm getting confused - with "Case Studies" Template Group, I have two Templates - "index", and "case\_study".

What I would like is:

* From the homepage, users can click through to a list of all Case Studies within a Category
* From the list of Case Studies, users can click through to see an individual Case Study

**I have gotten the list of all Case Studies working, but I cannot find a way to filter it by category (via the URL or otherwise).** Is such a thing possible in EE, or am I using it in the 'right' way?

I have tried accessing http://mysite.com/case\_studies/index/hydrology to try to only show the Hydrology-categorised case studies, but they are all appearing.

# Answer
> 5 votes
If I'm interpreting your setup correctly, Jack, it seems you have the right basic setup and it may just be a couple of small edits you need to make to your setup to have the links work the way you intend.

First, go into Admin \> Channel Administration \> Global Preferences and ensure that you set "Use Category URL Titles In Links?" to yes (otherwise, rather than a category name, EE with us the category ID number). You can also set your "Category URL Indicator" to "cat" or "category" - whatever you prefer to see in your URL.

In your case-studies/index template, you would then have a sidebar that would list your categories. Basic example:

```
{exp:channel:categories channel="case_studies" style="nested"}
<a href="{path='case-studies'}">{category_name}</a>
{/exp:channel:categories}

```

You can add other parameters as needed, such as show\_empty="no" etc. This will link each category back to a filtered view of the main index page at case-studies/index with a url like mysite.com/case-studies/category/hydrology

In the index, you can add the category heading tag pair to dynamically add the category name, description or other custom category fields to the top of the filtered list, if needed.

Hope this helps!

FYI - there's a dedicated ExpressionEngine community setup in StackExchange at expressionengine.stackexchange.com that'll help you get responses more quickly.

---
Tags: php
---


# Question
Title: Conditional for newest item in a loop limited to one
You probably looked at the title and said, "what the heck?".

I have this on a detail page, a loop limiting to 1, but I want to conditionally do something for the newest item. {if count == 1} won't help me here because it's already limited to 1.

```
{exp:channel:entries channel="insights" limit="1" dynamic="off" orderby="entry_date" sort="desc" disable="  categories|category_fields|member_data|pagination"}

{if you are the newest entry}
DO THIS
{if:else}
DO THAT
{/if}

{/exp:channel:entries}

```

# Answer
Use the entries tag you are using but add the parameter offset="1". So your results will start from the second entry.

http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#offset

```
{exp:channel:entries channel="insights" limit="1" dynamic="off" orderby="entry_date" sort="desc" offset="1" disable="  categories|category_fields|member_data|pagination"}

   DO STUFF

{/exp:channel:entries}

```

Additional... Looking at the comments on the original question you seem to have expanded the scope to include a restriction on what a visitor sees based on their member group.

Assuming your registered member group id is, say, 6 you would simply use a conditional to check the member group then either include or exclude the offset="1" parameter on your entries tag.

```
{if member_group=="6"}
    {exp:channel:entries channel="insights" limit="1" dynamic="off" orderby="entry_date" sort="desc"}
{if:else}
    {exp:channel:entries channel="insights" limit="1" offset="1" dynamic="off" orderby="entry_date" sort="desc"}
{/if}

```

This will show the most recent entry to registered members but show the second entry to non-registered visitors. No need to create special statuses or anything like that.
> 3 votes

---
Tags: conditionals
---


# Question
Title: same channel field on more than one channel
Is there a way I can use the same field in more than one channel without purchasing an add-on? I have an {image\_description} field that I'd like to use in more than one channel. Any work-arounds?

# Answer
> 8 votes
Personally I would create a different field in each as sharing fields across channels has in the past caused me a number of issues when unforseen changes need to be made to the site.

I'd perhaps then use a naming system for my fields - something like;

{channelA\_shortname\_image\_description}

{channelB\_shortname\_image\_description}

e.g. your fieldnames might be (assuming you had channels "people" and "products")

```
{people_image_description}
{products_image_description}

```

Then if the issue is that you wish to use the same template code regardless of which channel you're using then you can do something like

```
{{channel_short_name}_image_description}

```

The {channel\_short\_name} would be dynamically replaced with the shortname of the channel you are accessing with your channel entries tag pair.

# Answer
> 9 votes
I don't mean to be presumptuous, but you do know that you can assign the same field group to multiple channels, yes? That is the only way to use the same field in more than one channel.

Some people like to make one single field group that includes fields for their whole site, assign that same group to *all* channels, and then simply hide the unnecessary fields using publish layouts channel by channel.

# Answer
> 8 votes
In the grand scheme of things, it's advisable to simply use such a field in each field group that requires it, since add-ons that would give you the ability to place a single custom field into multiple field groups (thinking back to the gypsy days) can complicate ongoing support and in particular your upgrade path in the future. There are ways to make that considerably easier to handle though. The excellent Field Editor add-on gives you the ability to mass-edit fields for a given field group as well as clone a field from one field group to another - so you set it up once just the way you like it, then clone it to all other field groups that require it.

---
Tags: channel, fields
---


# Question
Title: Language File Issue (File Manager Related)
I am working on a site that I recently updated from 2.1.4 to 2.5.5. I am noticing that certain menu titles and field titles associated with the file manager module are not being pulled from the language files correctly.

Has anyone else seen this issue and/or found a fix for it?

# Answer
Fixed - I uploaded the language folder within system again, overwriting everything. It appears to be working now. Not sure what I did during the update then!?
> 1 votes

---
Tags: control-panel, updating, file-manager, multi-language
---


title: Using the switch variable with Matrix

text:
# Question
Title: Using the switch variable with Matrix
I'm trying to use the switch variable with Matrix with no success - nothing is output. This is on the latest Matrix and EE 2.5.5:

```
{panels}

    <div class="panel {switch=panel-n1|panel-n2|panel-n3|panel-n4}">

        <h2>{headline}</h2>

        <div class="editor-content">
            panel_text here
        </div>

        {if structure_page OR url}
            <a href="{if structure_page}{structure_page}{if:else}{url}{/if}" class="cta" title="{headline}">{cta}</a>
        {/if}

    </div>

{/panels}

```

Any suggestions where I'm going wrong?

Thanks

# Answer
> 1 votes
Argh, sorry. Was missing quotes:

```
{switch='panel-n1|panel-n2|panel-n3|panel-n4'}

```

Doh!

---
Tags: matrix
---


# Question
Title: How to display sub categories on individual pages?
I currently have a summary page that displays the links to 5 product categories (with a product image for each category) - the user clicks on an image is taken to a new page that displays all the products in that category.

What I now need to do is have a new product category (c6) with 3 sub-categories (c6-a), with each of these sub-categories potentially have multiple sub-categories (c6-a-1).

c6 \> c6-a/c6-b/c6-c \> c6-a-1/c6-a-2/c6-a-3 ...etc

The problem I'm having is getting EE to display the categories inside the 1st level of sub-category (c6-a) on a single page. So that the user can select c6 from the top level of product categories, & then see the c6-a/c6-b/c6-c sub-categories displayed on a new page, and then click from that selection to see a single page displaying the products in, for example, the c6-a-1 sub-category (and then choose a product to view).

There would also need to be a breadcrumb trail at the top of each page...

Any help with this would be very much appreciated!!! Many thanks.

# Answer
> 2 votes
The **GWcode Categories** addon should get you what you need.

> You basically pick a starting point first to get a list of categories and then narrow it down by choosing from a wide variety of parameters. Your starting point can be:\>
>
> * One or more channels by using the channel parameter (to get the categories for those channels);
> * One or more category groups by using the group\_id parameter (to get the categories for those category groups);
> * An entry (to get the categories the entry has been added to);
> * ***A category (to get its child categories, or parent categories).***

# Answer
> 2 votes
The GWcode CatMenu might fit the bill a little better. It dynamically creates multi-level navigation menus. I was trying to do the same thing a couple weeks ago with conditionals for GWcode Categories and realized this plugin did exactly what I needed out of the box. Look at the examples on the site for different solutions.

---
Tags: categories
---


title: WYGWAM "re-draw" lines in Chrome

text:
# Question
Title: WYGWAM "re-draw" lines in Chrome
One of my clients is having major "re-draw" issues with WYGWAM while using Chrome (Mac):

https://i.stack.imgur.com/n8l4D.png

The only way to temporarily lose the lines is to keep resizing the text area. Does anyone know a more permanent solution or reason why it's happening?

We're using EE 2.5.2 and WYGWAM 2.6.3.

EDIT: Just wanted to note that this is fixed in the latest version of Chrome (24.0.1312.52).

# Answer
> 3 votes
This is a Chrome/Iframe/contentEditable bug that usually crops up when you set Wygwam to use your own CSS file.

You should be able to fix it by adding a line-height to your CSS.

(See https://getsatisfaction.com/pixelandtonic/topics/display\_bug\_showing\_lines\_across\_editor\_when\_there\_is\_lots\_of\_content#reply\_10264807)

---
Tags: add-on, wygwam
---


# Question
Title: How can I bulk update the Matrix search index without re-saving each entry?
I have a site that has 100's of products. I just enabled a custom field (Matrix) to be searchable and now the only way to update the index is by re-saving each entry.

I'm not really familiar with this part of EE, but would a query/script be able to update the index? Or is there an addon out there that can do this that I'm not aware of?

# Answer
I actually had to do this recently. It's not too difficult to grab all that Matrix data, concatenate it, and save it to your field.

First, backup your database (!). Next, create a new template, enable PHP on it, then put this in it:

```
<?php

$this->EE =& get_instance();

$channel_id = 1;
$field_id = 20;
$matrix_cols = array(
    'col_id_1',
    'col_id_2',
    'col_id_9'
);

$entries = $this->EE->db->query("
    SELECT entry_id
    FROM exp_channel_titles
    WHERE channel_id = $channel_id
");
if($entries->num_rows() > 0)
{
    $cols = implode(", ", $matrix_cols);
    foreach($entries->result_array() as $entry)
    {
        extract($entry);
        $matrix = $this->EE->db->query("
            SELECT $cols
            FROM exp_matrix_data
            WHERE field_id = $field_id
            AND entry_id = $entry_id
        ");
        if($matrix->num_rows() > 0)
        {
            $data = '';
            foreach($matrix->result_array() as $row)
            {
                foreach($matrix_cols as $col)
                {
                    $data .= $row[$col].' ';
                }
            }
            echo '<p>Search data for entry '.$entry_id.': '.$data.'</p>';
            $this->EE->db->query(
                $this->EE->db->update_string('exp_channel_data', array('field_id_'.$field_id => $data), "entry_id = $entry_id")
            );
        }
    }
}

?>

```

Replace the data inside the three variables at the top with your relevant data, then load your template in the browser. Should fix you up.
> 15 votes

# Answer
EE doesn’t have a search index; it just queries exp\_channel\_data directly on every search.

The issue is that Matrix primarily saves its data in exp\_matrix\_data, not exp\_channel\_data. It’ll dump the content from any columns listed as Searchable into exp\_channel\_data precicely so that it’s discoverable by EE search, but only when an entry is saved. It does not provide a way to update exp\_channel\_data across all entries when the Searchable settings are changed.

We’ll have to fix this with an update. I’ll update this thread when that happens.
> 4 votes

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


# Question
Title: Embed Variables not parsing in time in embed placed inside of Playa Parents tag
I’m currently trying to add a safecracker form that either creates a new entry or edits the existing one depending on whether or not the `CURRENT_USER` has made one or not. Part of this also requires I place the form inside of a `exp:channel:entries` tag. Now, when I’m using the code below, I find that my embed variable for segment\_id is not parsing properly, but instead, it looks like it’s parsing after everything else and actually returning `{entry_id}` as the embed variable.

```
{exp:playa:parents channel="implementation_notes" status="not closed" author_id="CURRENT_USER"}
  {if no_parents}{embed="embeds/_implementation_notes_form_create" segment_id="{child:entry_id}"}{/if}
  {embed="embeds/_implementation_notes_form_update" segment_id="{entry_id}"}
{/exp:playa:parents}

```

Anyone have a suggestion how to get around this without having to refactor the original developer’s code too much?

# Answer
> 2 votes
You will run into issues nesting the form inside the channel entries tag, since the both share some of the var variables. Not sure about the EE embed though, as I don't use them anymore in favor of Stash.

So...

My recommendation would be to use Stash to include the form inside the loop, but parse it beforehand so there are no conflicts.

```
{exp:stash:set parse_tags="yes"}

    {stash:safecracker}
        [YOUR HTML/TAGS HERE]
    {/stash:safecracker}

{/exp:stash:set}

{exp:channel:entries}

    {!-- Short syntax for the Dev branch --}
    {exp:stash:safecracker}

    {!-- Legacy/original syntax for the master branch --}
    {exp:stash:get name="safecracker"}

    {!-- Just to be clear, no need to use both tags. Choose one. --}

{/exp:channel:entries}

```

You will likely need more complicated logic than this, but the same principal applies. Simply change the parse order to fit your own needs - Stash is the best tool for that.

---
Tags: channel-entries, safecracker, playa, parse-order
---


# Question
Title: How to stop registration emails from going to spam?
I have an EE site with 30-50 daily registrations. We're noticing that a lot of the registration confirmation emails are going to spam folders lately (through testing and user reports, along with a lot of non-spam pending members). I've tried running the email both through php mail and SMTP, with similar results. This isn't a major area of expertise for me, so I'm hoping some of you have suggestions for how to reduce the chance that these automated emails end up in someones spam folder.

# Answer
I’ve been down this road a number of times, and have even had problems with emails originating out of an EngineHosting server while email was handled through Google Apps.

There’s probably a problem between what your server is reporting its address as and what your email that’s being generated says its from. I would highly recommend moving all transactional emails to the very excellent Mandrill service from MailChimp. You can even authenticate so that the emails show up as verified for that domain. The service is free up to 12,000 transactional emails a month, so you probably won’t need to even pay for the service.

If you’d like to automate it a bit, you could also check out ObjectiveHTML’s awesome Postmaster addon. It does much of what Mandrill does, but makes it quite a bit easier, and he’s always adding awesome things to it.
> 5 votes

# Answer
Here is the hit list I would go down:

* Check the email addresses on outgoing messages (Admin -\> Email Configuration AND Members -\> Preferences). The shopping carts that set up member accounts have additional settings.
* Learn about the SPF (Sender Policy Framework) DNS records which notify other mail servers of who may send mail from your domain. GoDaddy has a tutorial, and you can find others around.
* Make sure that your hosting provider (the IP sending messages) has not been blacklisted by some spam service. If this has happened, you might end up with email messages bounced back to you which explain how to get taken off the list.
> 3 votes

---
Tags: members, email, registration
---


title: MSM and Custom Bootstrap Config

text:
# Question
Title: MSM and Custom Bootstrap Config
I'm running on my own "multi environment config" bootstrap file (https://github.com/madebymayo/ExpressionEngine-Environment-Config), but i've never used it with a site running on MSM (Multi Site Manager)

At first I ran in to the problem with the whole site not showing up, and giving me a 500 error. But I realised I hadn't added this:

```
$config['multiple_sites_enabled'] = "y";

```

So after adding this in, the site started to show this:

```
Site Error: Unable to Load Site Preferences; No Preferences Found

```

I've double checked my admin.php and index.php files are in each of my MSM folders.

Am I missing some sort of config hook to make my own config file work with a MSM site?

Any help would be great.

# Answer
Removing this line in my config file:

> $config\['site\_name'\] = "";

Fixed this issue.
> 1 votes

# Answer
Check to see if switching URI PROTOCOL in the config.php from 'AUTO' to

```
$config['uri_protocol'] = "PATH_INFO";

```

works for you. It's worked for me before.
> 0 votes

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


title: Low Search - Dynamic Collections

text:
# Question
Title: Low Search - Dynamic Collections
Is there a way to create more dynamic collections?

I am talking about creating collections like

* collections that contain channel entries that have X field
* collections that contain channel entries who's A field is equal to 1
* collections that contain channel entries that are from date X to date Y

# Answer
> 2 votes
I think you're not fully grasping the concept of Collections in Low Search. If you read the Low Search Primer, you'll find that Collections merely are a means to allow for effective *filtering by keyword*. If you're targeting specific fields, don't necessarily think Collection, but other parameters to get the right *entries*.

* *Entries* that have X field: `search:field_x="not IS_EMPTY"`
* *Entries* who's A field is equal to 1: `search:field_a="=1"`
* *Entries* that are from date X to date Y: depends on what "date" you mean:
    + Entry Date: use `start_from="date1"` and `stop_before="date2"` (native parameters)
    + Custom field: use `range-from:date_field="date1"`, `range-to:date_field="date2"` or `range:date_field="date1;date2"`

Or instead of using tag parameters, add them to the Form tag as input fields with these attributes:

* `name="search:field_x" value="not IS_EMPTY"`
* `name="search:field_a" value="=1"`
* Dates:
    + `name="start_from" value="date1"` and `name="stop_before" value="date2"`
    + `name="range-from:date_field" value="date1"` and `name="range-to:date_field" value="date2"` or `name="range:date_field" value="date1;date2"`

---
Tags: low-search
---


title: Low Search - Filter by Group Id

text:
# Question
Title: Low Search - Filter by Group Id
Channels have author id. Authors are associated with groups (member).

Is it possible to filter collection entries based on group id in Low Search?

# Answer
> 2 votes
The native channel:entries tag supports the `group_id=""` parameter (see the docs), which means you can filter Low Search results by group ID as well. Simply add it as an input field to your search form, for example:

```
<select name="group_id">
    <option value="">All groups</option>
    <option value="1">SuperAdmins</option>
    <option value="x">Group X</option>
    ...
</select>

```

---
Tags: low-search
---


# Question
Title: How to do inclusive range in Low Search?
I have this field

```
{!-- Age Range --}
<fieldset>
    <label>Age:</label>
    <input type="text" name="range-from:age"/> to <input type="text" name="range-to:age"/>
</fieldset>

```

In Low Search, when I do a range search, it seems to be exclusive. Meaning, if I search for 25 to 35, search results do not include 25 and 35 (but will return 26 to 34). How to make this inclusive?

# Answer
> 1 votes
The Low Search Range filters already are inclusive. If you're not getting the expected results, check if the field you're targeting is a valid numeric field: it should be a **Text Input** with **Content Type** set to **Number**, **Integer** or **Decimal**.

---
Tags: low-search
---


title: user editable Freeform emails

text:
# Question
Title: user editable Freeform emails
I'm building an event registration website at the moment and I'm looking for a way to allow the site owners to modify the content of emails sent by Freeform (v3 free version).

As I'm using Low Variables, I tried just adding the Low var to into the notification template and I also tried embedding a template.

I have considered using MX Notify Control but while that allows for customisation of the email templates, it's limiting in others.

# Answer
> 3 votes
Freeform 4 (free version) supports plugins in the “Email Message” notification field.

It should be possible to use one of Low Variables tags instead of the simple global variable syntax:

```
{exp:low_variables:parse var="my_low_variables_var"}

```

Or you could write your own simple plugin that outputs whatever you want.

But I dont’t know if plugin usage in notifications works with Freeform 3. It’s worth a try I would say.

---

Another way could be to use hidden input fields that contain content for the notification mails. You can use Channel data, Low Variables, …:

```
<input type="hidden" value="{my_low_variables_var}">

```

This isn’t very secure in Freeform 3 (or earlier versions of Freeform 4) because it would be easy to manipulate the value of those fields prior submit.

But Jim Wyse from Solspace postet on December 7:

> Freeform 4+ now stores the information that was in hidden fields prior in a parameters table and calls them with the parameter ID, so those are no longer exposed as hidden fields.

This is cool.

---

If there aren’t any reasons to not upgrade to Freeform 4 (free version), I would suggest the upgrade and one of the two solutions above.

---
Tags: templates, solspace-freeform, low-variables
---


title: MSM, Error 500 and Custom Config

text:
# Question
Title: MSM, Error 500 and Custom Config
I'm currently running my custom bootstrap config, and I had a previous problem where MSM wouldn't work with it (Both in the Control Panel and the front end)

I managed to fix this problem, but now I get an "Error 500" on the front end, whenever I enter one of the sites other than the main one.

What could be causing this.

I have possibly nailed it down to being:

```
<?php require('./config.php'); ?>

```

In my "system/expressionengine/config/config.php" requesting my custom config file in the root directory. Could this be causing problems?

My custom config file can be found here:

https://github.com/madebymayo/ExpressionEngine-Environment-Config

EDIT: I must point out, that before placing my custom config in, the original config file worked perfectly for EE and MSM. But it doesn't really work with my workflow :)

# **PARTIALLY SOLVED...Still need help**

My current setup is to have my custom "config.php" bootstrap in the root of my site.

I then Have the require('./config.php') in both the database.php and config.php files within "/system/expressionengine/config/"

My URL's look like this:

http://website.com

http://website.com/website\_1

http://website.com/website\_2

Now I think the problem is the

```
<?php require('./config.php'); ?>

```

I changed it to (Added dot):

```
<?php require('../config.php'); ?>

```

and both my website\_1 and website\_2 work. But it breaks my Control Panel and the Root URL.

Is there an If statement I could put in my config file, to say IF we're inside either website\_1 or website\_2 display:

```
<?php require('../config.php'); ?>

```

But if we're inside the root or in the CP, use:

```
<?php require('./config.php'); ?>

```

# Answer
> 3 votes
Try this:

```
require(dirname(__FILE__).'/path/from/current/file/to/config.php');

```

For example, assuming you have config.php in the standard `system/expressionengine/config` directory, you would use this line:

```
require(dirname(__FILE__).'/../../../config.php');

```

# Answer
> 0 votes
A useful trick I use in circumstances like this is to define an environment variable in an `.htaccess` file. These environment variables can then be accessed via PHP

So in website\_1/ and website\_2/, put the following line at the top of your `.htaccess` file:

```
SetEnv CONFIG_PATH_RELATIVE "../"

```

And then in the root site (where your control panel is), put the following line:

```
SetEnv CONFIG_PATH_RELATIVE "./"

```

Now, inside your main `config.php` file, at the top, do the following:

```
defined('CONFIG_PATH_RELATIVE')
    || define('CONFIG_PATH_RELATIVE', (getenv('CONFIG_PATH_RELATIVE') ? getenv('CONFIG_PATH_RELATIVE') : FCPATH));

```

The above code says, "check for a constant named `CONFIG_PATH_RELATIVE`. If you find it, use it. If not, define that constant as the contents of the *environment variable* `CONFIG_PATH_RELATIVE`, and if you don't find an environment variable with that name, then use the EE built-in constant `FCPATH`."

Last, wherever you're requiring your custom config, change the statement to the following:

```
<?php require_once(CONFIG_PATH_RELATIVE.'config.php'); ?>

```

(Note that I've changed your `require` to a `require_once`. This is almost always better practice.)

The only real caveat is that some web hosts (usually the cheap ones) will not let you set environment vars in `.htaccess`. If you have one of those hosts, this technique will not work for you.

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


# Question
Title: Saving Checked radio buttons in safecracker
I have created a safecracker form that has some fields that with show / hide depending on the previous filed selection. For example:

```
 <label
    for="med">Are you currently taking any prescribed medication?:</label>
    <label><input
    type="radio" name="med" value="Yes"{checked} id="med2"  /> Yes</label><label><input
    type="radio" name="med" value="No"{checked} id="med1"  /> No</label>

    <br>{clear}<br>
<div id="med">
     <label for="medication" class="required">Please detail:</label>    {field:medication}<br></div>

```

This code will show the {field:medication} if the yes radio button is selected. I can't use the normal code provided in the safecracker example as each field option needs to have a different id for the jquery action.

Unfortunately the {checked} code does not save the radio option when the form is saved. I'd appreciate any advice. Thanks

# Answer
> 1 votes
You could use:

```
<input type="radio" name="my_field" value="Yes"{if med == 'Yes'}Checked{/if} />
<input type="radio" name="my_field" value="No"{if med == 'No'}Checked{/if} />

```

If you get problems saving a 'required' field, then try adding hidden inputs:

```
<input name="my_field" type="hidden" value=""/>

```

# Answer
> 2 votes
This should be a comment rather than an answer but I can post better code examples here. So the example for using custom fields looks like:

```
  {if radio}
            {options}
                    <label class="checkbox">{option_value}
                            <input type="radio" id="{field_name}" name="{field_name}" value="{option_value}"{checked}>
                    </label>
            {/options}
    {/if}

```

That includes IDs. Why can't you use that code?

---
Tags: safecracker
---


title: Conditionals and segment_1

text:
# Question
Title: Conditionals and segment_1
Assume the URL: www.domain.com. What is `{segment_1}`? It's empty, right?

Now assume the URL: www.domain.com/foo/. What is `{segment_1}`? It's `foo`, right?

I have this in my template:

```
<h1>{if segment_1 == ''}{segment_1} - case 1{/if}</h1>
<h1>{if segment_1 == 'foo'}{segment_1} - case 2{/if}</h1>

```

On www.domain.com, I get an output of `- case 1` wrapped in `h1` tags followed by an empty pair of `h1` tags. This seems correct to me.

On www.domain.com/foo/, I get an output of `foo - case 1` wrapped in `h1` tags followed again by an empty pair of `h1` tags. **This is wrong.** I should be getting an empty pair of `h1` tags followed by `foo - case 2`. Any idea what's going wrong with my conditionals?

I'm using latest version of EE. Using Stash, too.

# Answer
I think the problem may lie in that you are testing the 1st segment, which according to the user guide should be the name of your template group.

If the template group your template is in is the default template group you can leave it out of the URL structure. But then EE will think that foo is a template in the default template group and try and load it.

If foo isn't a template it will trigger the 404 template if it has been defined, if not it will use the default template group index template. So depending on what code you have in that will determine what happens next.

There is an excellent flow chart of how segments are processed by EE by @\_jamessmith that is essential reading when dealing with templates and segments.

If you put that conditional in a template named foo that is in the default template group and change it to test segment 2 it works fine.
> 3 votes

# Answer
Your H1 tags need to be inside the conditional:

```
{if segment_1 == ''}<h1>{segment_1} - case 1</h1>{/if}
{if segment_1 == 'foo'}<h1>{segment_1} - case 2</h1>{/if}

```
> -2 votes

---
Tags: templates, conditionals, stash
---


# Question
Title: Problems overriding mod.member_settings.php email_prefs_form and update_un_pw_form
I have an extension and module that handles authentication for EE. I'm having some troubles understanding how to go about over-riding the handling in mod.member\_settings.php. There is a hook for update|edit\_user\_preferences but it looks like it used to be that everything was under that hook. Sometime later they split things out but didn't add any additional hooks.

What I need to do is handle the email\_prefs\_form and update\_un\_pw\_form. Ive thought of some ways I can think of doing this with the caveat that I don't how or if any of these are EE ways of doing things. One is to have the actions of the forms handled by my module/extension. Another is to trap sessions\_end and try and return a view from my module's view directory (mod.member\_settings seems to override any attempt to do this). Another might be to get hooks in mod.member\_settings.php somehow to handle the submits.

Does anyone have any specific suggestions? I'm fairly new to EE so I don't really know what questions to ask.

# Answer
> 2 votes
Are you *writing* your own extension? What for? There are plenty of existing extensions which will let you do pretty much anything with members. Perhaps we could better help by suggesting an add-on to use instead of writing something custom (check out FreeMember, Authenticate, Safecracker Registration, Zoo Visitor, or Profile:Edit).

The "EE way of doing things" is for your module to provide tags which allow other developers to completely customize the look and feel - that is why there is no easy way to return view files.

The built-in member module is a bit backwards in this regard, and doesn't follow the normal conventions to allow easy customization of the design. That is why so many add-ons have cropped up to replace the member module.

If you want an example of an EE authentication module, check out FreeMember \- it's open source so should provide you with a good starting point.

---
Tags: add-on-development, extension, module, authenticate
---


# Question
Title: Multilingual Discussion Forum - how to set default language
I'm building out a multilingual site (English and French) with a discussion forum. The multilingual aspect of the site is being powered by Transcribe and is working great.

I'm in the middle of setting up my forums and have them skinned correctly. There are two boards with unique urls one for English and one for French. Is it possible to set the language pack to French when visiting the french forum by default. Currently it's English and when a new visitor comes in French the registration forms and login forms are in English with no way to change them to French that I can find. At least until after the user has successfully registered, logged in and edits their profile.

I've looked all through the forums CP and can't find a way to do this.

# Answer
> 2 votes
I submitted a support request about this and Robin Sowell was able to get me all sorted out. Here is what needs to be done.

> Now what this does is grab everything in the url after the domain name. Well- it should if request\_uri is supported. And then it breaks that into parts, splitting it at the ‘/’.
>
> So any url that has just fr as a segment, it should trigger the language override.

The code added to the index.php file is below:

```
if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '/fr') !== FALSE) { $segs = explode('/', $_SERVER['REQUEST_URI']);

if (in_array('fr', $segs))
{
    // Language override
    $assign_to_config['deft_lang'] = "french";
}
}

```

---
Tags: add-on, forum, multilingual, how-to, transcribe
---


title: Stash embeds: struggling to parse tags

text:
# Question
Title: Stash embeds: struggling to parse tags
I have a chain of embeds in Stash:

* A "main" template that embeds `{stash:embed name="foo:.index"}`
* `foo:.index` has 1 line of code: `{stash:embed name="common:.serp" stash:group_id="6" stash:channel_name="members" stash:permalink_parameter="foo/details"}`
* `common:.serp` has something like this:

> ```
> {exp:stash:set parse_tags="yes"}
>    {stash:channel_entries}
>       {exp:channel:entries channel="{stash:channel_name}" dynamic="no" group_id="{stash:group_id}" limit="10" orderby="date" paginate="bottom" sort="desc"}
>        ...
>        ...
>        {stash:embed name="common:.avatar"}
>
> ```

* In `common:.avatar`, I am trying to access the value of `{member_images:total_rows}`. However, it's just echoed as that tag and not the number I expect it to be. I have verified this field exists in the Channel fields (it's a Matrix field).

I'm a bit confused with EE's parse order. And I've tried putting `process="start"` where I embed `common:.avatar` hoping it would parse {member\_images:total\_rows}. No go. Any ideas what's wrong?

# Answer
> 4 votes
Ok, this is complex so please bear with me.

Unlike process="inline" and process="end", the process="start" parameter is relative to the processing stage of the host EE template, not the processing of the nested Stash template (which is undertaken by a separate instance of the template parser and occurs either in parallel with or after the EE parser has run). Logically therefore process="start" is impossible in a *nested* Stash embed, since the nested embed is included *after* the parent template, which is itself parsed *inline* with the host template parser.

Consequently, your embed `{stash:embed name="common:.avatar"}` is always going to be processed after the channel entries tag has run, since it is nested inside it and the EE parser processes a template from the outside inwards.

Stash embeds are saved into memory as variables with the same name as the embed. After embedding, they are accessible later on in your template parse order as ordinary Stash variables. Therefore one possible solution would be to embed the child template earlier (but not output it), and then access it as a variable.

```
{stash:embed name="common:.avatar" process="inline" output="no"}
{exp:stash:set parse_tags="yes"}
   {stash:channel_entries}
      {exp:channel:entries channel="{stash:channel_name}" dynamic="no" group_id="{stash:group_id}" limit="10" orderby="date" paginate="bottom" sort="desc"}
          {stash:common:.avatar}
          ...
       {/exp:channel:entries}
   {/stash:channel_entries}
{/exp:stash:set}

```

I've never tried this so I'm not entirely sure it will work, please confirm if it does.

Other than the above, I would like to point out that nesting embeds in this way is reintroducing some of the parse order problems that Stash is meant to solve. In addition to allowing code re-use (the DRY principle) Stash allows you to separate the 'data-setting' logic (the viewModel) from the presentation (view). You are mixing up these layers when really you should be trying to separate them - and it's coming back to bite you. It's better to think of your EE host template as the place you grab all the data that you will then 'push' to the embed(s) containing your markup. If you have common patterns of data setting in your host template then encapsulate them as snippets rather than embeds.

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


# Question
Title: Shipping cost based on membership (Expresso Store)?
We are wanting to determine shipping cost threshold based on membership. We have consumer products with orders over $15 free, and we also have trade products for members, and wish to extend the threshold to orders over $100 free shipping.

I have created two shipping methods (using default with rules), and was hoping it'd be as simple as the following on the cart page.

```
{if member_group == "6"}
    <input type="hidden" name="shipping_method" value="5">
{if:else}
    <input type="hidden" name="shipping_method" value="3">
{/if}

```

It almost works, but as we wish to show shipping cost on the main cart page, the above conditional hasn't been processed as the conditional is on the cart page.

Is there another way, or do we simply remove shipping cost from the cart page and only show it on final payment page (not ideal)?

Regards,

Christiaan

# Answer
> 1 votes
That is the best way to approach things. The only piece you are missing is that you either need to not display the shipping cost on your cart page, or automatically submit the form when the customer first hits the checkout to update the totals.

Something like this should do the trick:

```
{if member_group == "6"}
    <input type="hidden" name="shipping_method" value="5">
{if:else}
    <input type="hidden" name="shipping_method" value="3">
{/if}

{!-- automatically update shipping cost on first page load --}
{if shipping_method == ""}
    <script>
    $(function() {
        $('#update_totals_button').click();
    });
    </script>
{/if}

```

---
Tags: add-on, expresso-store, shipping
---


# Question
Title: Removing unwanted newline characters in Wygwam
Wygwam automatically adds some extra space in `<p>` tags by default. Is there any way to remove them without editing the source in Wygwam? I'm using Wygwam 2.6.3.

**What is intended**

```
<p>This is a paragraph</p>

```

**What actually happens**

```
<p>
     This is a paragraph</p>

```

# Answer
The themes/third\_party/wygwam/lib/ckeditor/config.js file actually comes with the code necessary to do this – you just need to uncomment it. Have you tried that?
> 5 votes

# Answer
You'll need to override the default CKEditor rules for processing P tags.

Add this:

```
this.dataProcessor.writer.setRules( 'p',
                {
                    indent : false,
                    breakBeforeOpen : true,
                    breakAfterOpen : false,
                    breakBeforeClose : false,
                    breakAfterClose : true
                });

```

to your: `themes/third_party/wygwam/lib/ckeditor/config.js` file.

More info here: http://ckeditor.com/forums/Support/BUG-CKeditor-adds-new-line-and-tab-space-after-P-tag
> 3 votes

---
Tags: add-on, fieldtype, wygwam, wysiwyg
---


# Question
Title: Does Cartthrob Subscriptions add channel entries after each occurrence?
For the store I'm working on, each standard Cartthrob order creates entries in both the Orders and Purchased Items channels. And I need the Subscriptions orders to do the same after each occurrence.

Does anyone know if Cartthrob Subscriptions does that for EACH occurrence? As far as I could find, the docs only say this...

> CartThrob subscription orders are placed like standard orders, and will show up in the customer's order history. Standard order emails will also be sent in the case of a successful transaction, or in case of failure.

Thanks for your help.

# Answer
I can confirm this since I've been using CT Subscriptions with one of my clients for the last 7 months. Each time a subscription is rebilled, an order entry is created in the orders channel. I can't confirm the purchased items channel as I have that disabled since they're not selling digital goods–but I would believe it would do the same.

You can edit/cancel/update subscriptions right from the subscription module in the CP. Also, there are different notification event triggers for rebills that you should take advantage of too.
> 1 votes

---
Tags: add-on, cartthrob
---


# Question
Title: Does un-assigning a category group remove category assignments?
I'm re-vamping a site, and we have updated the categories. At the moment I have two category groups, the old one and the new one. The old one will never be used again, but I'd prefer to keep the assignments, for posterity.

If I un-assign the old category group from the channels in question (so it doesn't show up in the editor), will those category assignments be lost?

# Answer
> 1 votes
Looking at the function which runs when Channel Group Assignments are updated, I'm going to say **no**, your categories will *not* be unassigned when removing a category group from a channel, so that's safe to do.

(*After* you backup your database of course, haha.)

**UPDATE:** as pointed out below, if you later edit these entries which have now-hidden categories assigned, those old category associations *will* be lost when the entry is updated. (This is because EE deletes all category associations and creates them all anew with the posted category data each time an entry is updated.)

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


title: P&T Assets target added elements

text:
# Question
Title: P&T Assets target added elements
I wish to change the styling of a list of Asset files. See https://dl.dropbox.com/u/34921860/styling%20example.pdf

Since the elements are added using Javascript the html and css changes cannot easily be inspected using Firebug.

Wrapping the Asset-field in a div with id="nn", makes it possible target the inserted table with *div#nn table* and change the background to a dark colour. So far so good.

However, the list that appears when right-clicking on a row needs also to be restyled and div#id ul does not work. Any ideas?

# Answer
> 1 votes
That context menu gets added to the end of the DOM with the class 'assets-contextmenu'. Assets only targets it using ".assets-contextmenu", so even adding a "ul" before that ("ul.assets-contextmenu") in your CSS selectors would be more specific.

Here’s what its DOM looks like:

---
Tags: add-on, css, assets
---


# Question
Title: expresso Store: notify admin when an user make an order or payment
Is it possible with store to send an email to an admin , or another member, or maybe an email, when the user make an order or a payment?

mx notify control doesn't support store

thanks in advance

# Answer
When an order is placed, any email triggered by the default order status will be sent.

For example, if your default order status is "New", and you have an "Order Confirmation" email template set up, and your email template is assigned to the "New" status, it will get sent when each order is placed (this is set up when you first install Store).

Currently you can only send one email per status - but you can easily BCC the store admin so they know an order has been placed.
> 4 votes

---
Tags: expresso-store, email, notification
---


title: Playa Multiple Fields Parameter

text:
# Question
Title: Playa Multiple Fields Parameter
If I am using playa to output the relationships from 2 fields:

```
{exp:playa:children field="employee_board_memberships|employee_investments"}
    ...
{/exp:playa:children}

```

Is there any way inside of the loop to identify which (or both) fields the entry is coming from?

```
{exp:playa:children field="employee_board_memberships|employee_investments"}
    {if from_employee_board_memberships}
        This was from the employee_board_memberships field
    {/if}

    {if from_employee_investments}
        This was from the employee_investments field
    {/if}
{/exp:playa:children}

```

# Answer
Ended up solving this a different way. I stashed the IDs for each relationship and then did a regex match with switchee:

```
{!-- Store the ids for the playa company relationships --}
{exp:stash:set name="board_memberships_ids" parse_tags="yes"}
    ,{employee_board_memberships:child_ids delimiter=","},
{/exp:stash:set}

{exp:stash:set name="investments_ids" parse_tags="yes"}
    ,{employee_investments:child_ids delimiter=","},
{/exp:stash:set}

{!-- Set the related companies list --}
{exp:playa:children field="employee_board_memberships|employee_investments"}
    {exp:stash:append_list name="employees_companies" parse_tags="yes"}
        {stash:item_class}
            {switchee variable="stash:board_memberships_ids" parse="inward"}
                {case value="#,{entry_id},#"}board-members{/case}
            {/switchee}

            {switchee variable="stash:investments_ids" parse="inward"}
                {case value="#,{entry_id},#"}investments{/case}
            {/switchee}

            {if company_investment_stage == "public"}ipos{/if}

            {if company_investment_stage == "acquired-merged"}acquisitions{/if}
         {/stash:item_class}
        {stash:item_sort}{title}{/stash:item_sort}
        {stash:item_content}
            <a href="/portfolio/{url_title}" class="modal-trigger">{title}</a>
        {/stash:item_content}
    {/exp:stash:append_list}
{/exp:playa:children}

```
> 2 votes

# Answer
The answer is No. {exp:playa:children} just figures out the IDs of the entries that should be output, and passes them + the inner template code to Channel-\>entries(), which handles actually grabbing the entries and parsing the template code. So there’s no way for Playa to tell it to add any extra per-entry variables into the mix. (This is why the {parent:xyz} and {child:xyz} values only work if you’re grabbing the children/parents of a single entry at a time.)
> 3 votes

# Answer
You should be able to get by easily by using the following:

```
{exp:playa:children field="employee_board_memberships|employee_investments"}
    {if employee_board_memberships}
        This was from the employee_board_memberships field
    {/if}

    {if employee_investments}
        This was from the employee_investments field
    {/if}
{/exp:playa:children}

```

… shouldn’t you? You’re in essence just testing whether or not that child has either of those fields filled out, so it should return the code you want. You don’t need the `from_` in your example code.
> -1 votes

# Answer
This is untested, but maybe try using the `var_prefix` and nest the `{exp:playa:children}` tags like so:

```
{exp:playa:children field="employee_board_memberships" var_prefix="ebm"}
    {exp:playa:children field="employee_investments" var_prefix="ei"}
    {if ebm:title}
        This was from the employee_board_memberships field
    {/if}

    {if ei:title}
        This was from the employee_investments field
    {/if}
    {/exp:playa:children}
{/exp:playa:children}

```
> -1 votes

---
Tags: playa
---


title: Tax issue with Cart Throb

text:
# Question
Title: Tax issue with Cart Throb
I'm scratching my head with a Cart Throb problem.

I have a custom extension that handles tax, and it is returning the value of tax properly. But the tax is not being added to the total in the cart.

At this point I'm stuck and can't make any progress. Any help would be appreciated.

The extension file is available here: download

So the returned tax value from the extension is correct, but it's not having any effect on the total.

The template code looks like this:

```
{exp:cartthrob:cart_items_info}

        {if first_row}
            <table class="ck-table">
            <tbody>
                <tr class="ck-header">
                    <th class="ck-header-id">ID</th>
                    <th class="ck-header-product">Product</th>
                    <th class="ck-header-price">Price</th>
                    <th class="ck-header-quantity">Quantity</th>
                    <th class="ck-header-cost">Cost</th>
                </tr>
        {/if}

                <tr class="ck-product{if title == 'Cooler Case'} ck-cooler-case{/if}">
                    <td>{prd_id}</td>
                    <td>{title}</td>
                    <td>{item_price}</td>
                    <td>{quantity}</td>
                    <td>{item_subtotal}</td>
                </tr>

        {if last_row}
                <tr class="ck-subtotal">
                    <td colspan="2"></td>
                    <td class="ck-subtotal-label">Subtotal:</td>
                    <td class="ck-subtotal-cost" colspan="2">{cart_subtotal}</td>
                </tr>
        {exp:cartthrob_order_discounts field="order_discounts"}
        {if has_discounts}
        {discounts}
        {if discount_count == 1}
                <tr class="ck-discount-header">
                    <th colspan="2"></th>
                    <th class="ck-discount-title">Discounts</th>
                    <th class="ck-discount-amount" colspan="2">Savings</th>
                </tr>
        {/if}
                <tr class="ck-discount">
                    <td colspan="2"></td>
                    <td class="ck-discount-title">{discount_title}</td>
                    <td class="ck-discount-amount" colspan="2">-{discount_amount}</td>
                </tr>
        {/discounts}
        {/if}
        {/exp:cartthrob_order_discounts}
                {!--
                <tr class="ck-discount">
                    <td colspan="2"></td>
                    <td class="ck-subtotal-label">Total Discounts:</td>
                    <td class="ck-subtotal-cost" colspan="2">-{cart_discount}</td>
                </tr>
                --}
                <tr class="ck-subtotal">
                    <td colspan="2"></td>
                    <td class="ck-subtotal-label">Shipping:</td>
                    <td class="ck-subtotal-cost" colspan="2">{cart_shipping}</td>
                </tr>
                <tr class="ck-subtotal">
                    <td colspan="2"></td>
                    <td class="ck-subtotal-label">Tax:</td>
                    <td class="ck-subtotal-cost" colspan="2">{cart_tax}</td>
                </tr>
                <tr class="ck-total">
                    <td colspan="2"></td>
                    <td class="ck-total-label">Total:</td>
                    <td class="ck-total-cost" colspan="2">{cart_total}</td>
                </tr>
                <tr class="ck-buttons">
                    <td colspan="3"></td>
                    <td colspan="2">
                        <a href="/checkout/payment/" class="btn-sprite" id="btn-continue">Continue</a>
                    </td>
                </tr>
            </tbody>
            </table>
        {/if}

        {if no_results}
            <p>There is nothing in your cart.</p>
        {/if}

    {/exp:cartthrob:cart_items_info}

```

and here is the add to cart form:

```
{exp:cartthrob:add_to_cart_form return="cart"}

    {!-- Required Hidden Fields --}
    <input type="hidden" name="entry_id" value="{entry_id}" />
    {!-- Used by AJAX add to cart --}
    <input type="hidden" name="ajax_product_title" value="{title}" />
    <input type="hidden" name="ajax_image_url" value="{product_detail_image}" />

    <table>
        <tr>
            <th class="pl-add-to-cart-quantity">Qnty.</th>
            <th class="pl-add-to-cart-recipient">Send to</th>
        </tr>
        <tr>
            <td>
                <select name="quantity">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                </select>
            </td>
            <td>
                {!--
                    @NOTE: this outputs a select menu to assign the product to a recipient using item_options[address_id]
                --}
                {exp:cartthrob_multi_shipto:address_select new_recipient="yes" class="recipient-selector"}
            </td>
        </tr>
    </table>

    <a class="submit-image-replace sprite-add-to-cart ajax-add-to-cart" href="/cart/">Add to Cart</a>
    <input type="submit" class="hide" value="Add to Cart" />

{/exp:cartthrob:add_to_cart_form}

```

# Answer
Issue resolved with the CT guys help. For your info...

There is a Cart Throb core file that has a method to calculate the total. That method was checking for the value of the tax plugin but not the extension. They modified the core file and now it checks for both plugin and extension.

Future versions of CT will have this baked in.
> 1 votes

---
Tags: cartthrob, extension
---


# Question
Title: How can I bind custom JS to a Wygwam field after it has intialised?
I'm using EE 2.5.2 and Wygwam 2.6.3. I need to bind some custom javascript to a Wygwam field on the publish/edit screen in the CP once the field has initialised.

Specifically, I need to bind to something like this:

```
$(#cke_field_id_12).find('iframe').contents().find('body');

```

However as the iframe is created dynamically, I need to wait until after Wygwam has initialised for `$(#cke_field_id_12)` to have a child `iframe` plus contents for me to bind to.

Does CKEditor/Wygwam fire an event when it's ready that I can hook into to bind my functionality to? Or is the an alternative way to do this that I haven't thought of?

# Answer
CKEditor’s instanceReady event ought to fit the bill for you:

http://docs.cksource.com/ckeditor\_api/symbols/CKEDITOR.html#event:instanceReady

```
CKEDITOR.on('instanceReady', function(ev) {
    // ...
});

```
> 2 votes

---
Tags: javascript, wygwam
---


# Question
Title: EE 2.5.5 Discussion Forum char limit > 99999
The Discussion Forum forum management max char limit for a post is 99999. Is it possible to significantly increase this?

# Answer
> 2 votes
I think you need to hack the core files to make this change. Look in the theme or module files for the specific field that you want to change. Without knowing which field you want to adjust, I can't point you to a specific file. You can remove the character limit instead of increasing it to make it unlimited.

You may also need to adjust the **string type** of db column where the data is stored to accommodate the larger data. MEDIUMTEXT will store 16,777,215 bytes or ~16MB of data and should do the trick for you. This can be accomplished through a tool like phpmyadmin which your web host most likely supports. This **video** shows you how to change the type setting in phpmyadmin... **NOTE:** You will need to identify the correct database column... the one in this video is not what you should change, it just shows you how to change it.

---
Tags: forum
---


# Question
Title: How can I allow a member to register a limited number of other members?
I am in need of a voting solution for one of my clients that will give members UP TO four votes, and no more. I have looked over the usual polling modules on devot:ee and all of them either allow for single votes or multiple votes, but not up to a specified number of votes.

So that I can use one of these polling add-ons, I will limit voting to a single vote per member, but I will then need the ability to allow users to register an additional three members, and NO MORE.

How can I allow a member to register a limited number of other members?

# Answer
I have been able to put together a solution to give members the ability to register or invite a limited number of other members. This is part of a larger vote/polling system that has some specific needs, but I will answer this question specifically.

Using the Invitations add-on, we can allow members to generate one-time use invitation keys. These keys allow other member, or non-member users, to register or change their member group (thus providing different privileges).

There is no setting in the add-on to limit the number of keys generated by a given member. To create this limitation, we use a conditional in a template that generates keys which checks to see if the keys have already been generated by the member. If NO, then it proceeds with the key generation. If YES, then it shows the key already generated and will not generate any more.

Keys are generated simply by visiting a template that uses the *generate key* tag. By using an embed template for each tag, we can generate multiple unique keys on a single template.

Using this method, we can give members the ability to invite or register a limited number of additional users.
> 1 votes

# Answer
For your original question, I can't say of any add-ons that I know that allow you to limit by number of votes. It's generally one or multiple, but some allow you to specify one vote per day.

That said, *I don't think the question you asked is correct*, and should possibly *be edited*. The question as asked, is looking to limit the number of votes **per** member, so 4 votes per each member. But that isn't what you are actually looking to do. It seems as if you actually want, 1 vote per member, but if the member is part of a band, only 4 members have voting privileges.

This is a bit different of an issue. Because it's either about:

1. Restricting Number of Band Members- as you mentioned above; or
2. Assigning Voting Privileges to Only Some Band Members

Personally, I like the idea of number two, assigning voting privileges, better than restricting number of band members. Because really, if a band has eight people/members, then their listing should probably list 8 members.

**The easiest way, I can think of** in restricting voting privileges is to have the band decide. Assuming that each band has one primary admin— the person who may register other band members, update band profile, and do whatever else your site allows them to do (it could simple just be tied to the member who creates the band account), that individual can select which members would vote.

I don't know how you create band profiles, yet. But let's assume, an individual joins the music association. The register, create their basic profile, and then at some stage they are offered to create a profile for their band.

Let's then also assume that you are storing member data within channels and **NOT** just in EE's default membership module (a number of add-ons allow for this) and band profiles are stored in another data channel. You can then relate members to bands, using Playa or the Relationship module.

Next up you would need at least *two basic components*:

1. Someone or Something to Assign Voting Privileges; and
2. A Method to Show/Hide Vote Option on Poll based on Voting Privileges.

You can get fancier, but I'm just thinking out loud here.

Let's further assume, that you're **NOT** going to create a plugin to randomly assign voting privileges to band members (that would be cool, but let's say it's not on your agenda). Then, you'd probably want: a custom field in member profile called member\_type: individual, duo, band (or whatever your options). Another custom\_field to establish their assignment type: admin (can administer band profile and voting privileges) or member. Then also the custom field '{can\_vote}'.

If none of the members have access to the backend control panel, meaning you are giving them editing privileges via SafeCracker forms, then this is much easier to control. You can check to see if the currently logged\_in member is a band admin, before displaying the option to assign voting privileges and a list of band members. You'd probably need javascript to check that only 4 records where modified to give them voting privileges.

My javascript skills are minimal, so can't help you there. But it should be doable. Basically, the javascript would enforce the 4 limit, not allowing the update to be submit unless 4 or fewer band members were selected for the privilege.

Then the same works with the poll. It would be viewable to all, but you'd ONLY show the vote/submit button if the person is currently logged\_in and has voting privileges. I suppose you could also show to all, and have javascript do a quick query on click to see if they are logged in and have voting privileges.

Those are my initial thoughts.
> 2 votes

# Answer
If you search through Devot:ee you will find several results for polling addons. I haven't used any of them so cannot actually help out with the other part of your question.
> 1 votes

---
Tags: members
---


# Question
Title: Exp:resso Store - price for additional items
I'm using Exp:resso Store for the first time, and I've just set-up my shipping method and its rules. I've created a standard shipping method that includes different countries - this was fairly easy. The problem is that I cannot find a way to add 1,00 GBP only to additional items.

I tried creating different rules:

* if min. Order qty and max. Order qty is 1 then there's no additional rate
* if min. Order qty is 2 then add the additional rate

but in this way if there's more than 1 item then Store adds 1,00 GBP to all items, while I need it to be added to all items *except* the first one.

I just don't understand if this can be achieved by playing with shipping rules or if I need some custom plug-in. As I said I've never used Store before, every suggestion would be much appreciated.

---

## Edit

I might add that I have a base rate of 2.50 £:

* Base shipping rate for UK: 2.50 £
* Shipping rate for additional items (except 1st): 1,00 £

This means that if the customer buys one item total shipping cost would be only 2,50 £ for the shipping.

If the customer buys 2 items, then total shipping cost would be 2,50 + 1,00 = 3,50 £ for the shipping.

For 3 items the total shipping cost would be 4,50£ (that is 2,50 + 1,00 + 1,00). And so on.

# Answer
I asked the same question to Exp:resso Store official support and they confirmed that having a rule that sets a base rate + an additional shipping rate free for the first item is not possible without writing some custom PHP.

Anyhow they suggested to lower base rate to 1.50£ and let Store add the additional rate (1£) to every item:

* 1 product = 1.50 + 1.00 = 2.50
* 2 products = 1.50 + 2.00 = 3.50
* 3 products = 1.50 + 3.00 = 4.50

As you can see the end result would be the same.

I hope the solution suggested by Exp:resso staff will be useful for someone else!
> 2 votes

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


# Question
Title: QUERY join for members that have entries
I'm trying to learn how to do mysql joins. Twitter has helped already get me started.

I'm trying to find the number of members that have entries attached to them...

Then the number of members that have entries with a specific category\_id attached to them.

What I have so far.

```
{exp:query sql="
    SELECT count(*) AS num_members
    FROM exp_members m
    JOIN exp_channel_titles t on t.author = m.member_id"}

    {num_members}

{/exp:query}

```

# Answer
Shouldn't it be t.author\_id instead of t.author?

```
{exp:query sql="
    SELECT count(*) AS num_members
    FROM exp_members m
    JOIN exp_channel_titles t on t.author_id = m.member_id"}

    {num_members}

{/exp:query}

```
> 3 votes

---
Tags: query, queries, querystring
---


# Question
Title: Difference between assign_to_config and config (and or env_config)
I'm using EE Master Config along with Stash.

I know in Master Config that all the configs have been changed from `$config['']` to `$env_config['']`

I noticed with Stash that Mark is using this format: `$assign_to_config['']`

You can see what I mean here in the dev branch of 2.3.6

I guess I'm wondering what is the different between $config and $assign\_to\_config

I usually just convert that over to the EE Master Config format though, now that I think of it, I've never really known what was the proper format or why the assign\_to\_config format exist in the first place.

# Answer
> 15 votes
`$assign_to_config` is an EE-native array used in the index.php file. Here's part of the comments EllisLab left for us to provide context:

> The $assign\_to\_config array below will be passed dynamically to the config class. This allows you to set custom config items or override any default config values found in the config.php file. This can be handy as it permits you to share one application between more then one front controller file, with each file containing different config values.

The use of `$env_config` in our (Focus Lab's) config approach is to clearly display what is set in our config files vs what's set in `index.php`.

> I guess I'm wondering what is the different between $config and $assign\_to\_config

Really the only difference between these two is that `$config` is set in the `config.php` file and `$assign_to_config` is set in the `index.php` file.

They all achieve the same goal though.

It's probably worth noting that if an array key exists in both the `$config` array and the `$assign_to_config` array, the latter will take precedent.

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


title: Does Low Options support checkboxes?

text:
# Question
Title: Does Low Options support checkboxes?
In the devotee page, Low Options has this description

> Low Options displays the list items or options for a given channel field. Compatible with native Select DropDown and Checkboxes fields, as well as Pixel & Tonic's channel fields that use options.

I have looked over the documentation and the plugin itself but nothing seems to point that it supports checkboxes.

Is this correct?

EDIT:

Here is my code

```
<fieldset>
     <label>Pets:</label>
     {exp:low_options:pets}
        {options}
            <label for="{option_label}">{option_label}:</label> <input type="checkbox" name="search:pets[]" value="{option_value}" />
        {/options}
    {/exp:low_options:pets}
</fieldset>

```

"Pets" is a native Dropdown.

# Answer
> 4 votes
It works fine with checkboxes.

For native checkboxes *{option:value}* and *{option:label}* will output the same thing. For the P&T Fieldpack, each one will correspond to the *option : label*.

---
Tags: low-search
---


# Question
Title: Update User-Added Resources to SSL-Friendly URLs?
I have a field in my publish form where users can add embed code for a video, and they can also embed videos using Wygwam.

The entire site has SSL enabled, but the video embed codes use the insecure "http://" protocol, which breaks the site's SSL.

I don't want my client to have to remember to check the "use https" option on YouTube (and some of the videos are from obscure hosting services anyway).

Is there an add-on or technique I can use to automatically convert those embedded video URL protocols to "https"?

# Answer
In your templates you can wrap any custom fields that might contain a non-https embed code with **Low Replace**, finding and replacing any non-https embed sources.

For example:

```
{exp:low_replace
    find="http://www.youtube.com/embed"
    replace="https://www.youtube.com/embed"
}
    {your_custom_field}
{/exp:low_replace}

```

Low Replace will allow you to specify multiple replacements (so you could catch all your different video embed providers in one shot) and has some other useful features, too.
> 4 votes

# Answer
Have you considered using jQuery for this? This **answer on StackOverflow** has a code example that might do the trick.

Here's my quick untested code attempt for your specific case:

```
$('iframe').each(function() {
    var src = $(this).attr('src');
    if (src.indexOf('http:') > -1) {
        src = src.replace('http:', 'https:');
        $(this).attr('src', src);
    }
});

```
> 1 votes

# Answer
Another option is to just have the client enter the video ID and you hard code the iframe embed code into your template. I do this when I need finite control over the video code.

In the field's description, I link to a screenshot showing them how/where to get the video ID from the video URL. Something like this:

Obviously, this will only work if the video isn't embedded in copy and is a unique field.
> 1 votes

---
Tags: wysiwyg, security, video, ssl
---


title: Low Search - How to use with Ajax?

text:
# Question
Title: Low Search - How to use with Ajax?
I have seen this question about using Low Search with Ajax but I still don't see how to integrate them.

Given this form

```
{exp:low_search:form collection="foo" search_mode="any" result_page="foo/search" form_id="search_form"}
  <fieldset>
    <label for="keywords">Keywords</label>
    <input type="search" name="keywords" id="keywords" />
    <button type="submit" id="search">Search</button>
  </fieldset>
{/exp:low_search:form}

```

and this Javascript code

```
$(document).ready(function(){
    $("#search_form").on("submit", function(event){
        event.preventDefault();

        // HOW DO I GET THE ENCODED STRING HERE?

        var aData = [],
            sSource = $(this).attr("action");

        $.ajax(
        {
            'dataType': 'json',
            'type': 'POST',
            'url': sSource,
            'data': aData,
            'success': function (oAjaxData, sTextStatus)
            {
            },
            'error': function (jqXHR, sTextStatus, errorThrown)
            {
                console.log(sTextStatus);
            },
            'complete': function (jqXHR, sTextStatus)
            {}
        });
    });
});

```

How do I get the encoded query string in the Javascript code?

# Answer
> 3 votes
The answer is to use the Low Search URL tag, which can produce a human-readable ACT URL with the keywords as a param.

http://gotolow.com/addons/low-search/docs/tags#url-tag

# Answer
> 2 votes
@juddlyon is correct. I personally prefer to use the the jQuery form plugin which kind of negates the need for the url tag.

Here's the code I used:

```
{preload_replace:template_group="your-template-group"}
<html>
<head>
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="http://malsup.github.com/jquery.form.js"></script>
</head>
<body>
<script>
$(function() {

    var $pageWrap = $('.wrap');

    var options = {
        target: $pageWrap,
        beforeSubmit:  showRequest,
        success: showResponse
    };

    // Show loading message and submit form
    function showRequest(formData, jqForm, options) {
        $pageWrap.addClass("loading").prepend('<div class="search-load">Searching</div>');
        return true;
    }

    function showResponse() {
        $pageWrap.removeClass('loading');
    }

    // bind to the form's submit event
    $('#filter').submit(function() {
        $("#filter").ajaxSubmit(options);
        return false;
    });

});
</script>

    <div class="wrap">
        {exp:low_search:form
            form_id="filter"
            collection="insert_your_collection"
            result_page="/{template_group}/results"
            search_mode="any"
            encode="no"
        }
            <label for="keywords">Keywords</label>
            <input type="search" name="keywords" id="keywords" />
            <input type="submit" name="submit" value="Search" />
        {/exp:low_search:form}
    </div>

</body>
</html>

```

---
Tags: low-search
---


title: Appointment Setting Addon

text:
# Question
Title: Appointment Setting Addon
Does anyone know of a good online appointment solution? It would be for a salon so they would need to be able to book an appointment in 15-30min intervals. I looked at rEEservation but it looks like that one only handles full days. Any help will be appreciated. :)

# Answer
> 2 votes
I have a solution that has over 12 months of solid development, and is built entirely within EE. It's currently being used for a similar purpose to schedule appointments at specific intervals for healthcare providers. It's currently being used by around 10,000 users total and has been well tested.

That said, it's not a conventional add-on one can install and will never be in this current iteration. I do however have a reasonable rate I will install it, and even customize it directly for your needs. I have demoed this system for quite a few people in EE, and would be glad to give you a demo.

This isn't a traditional answer of "a how to" for StackExchange, so sorry for the informality, but I believe this is the absolute best scheduling app available for EE. It's very robust and 100% customizable and works with virtually any other add-on.

If you are interested, contact support\[at\]objectivehtml.com

# Answer
> 1 votes
I've made a booking system for holiday properties using SolSpace Calendar. Although my solution only books full days there is no reason it could not be done in time slots since Calendar supports this.

With that said, it was horrible to do but that is partly down to the other requirements of the site - hundreds of bookable resources and property owners able to create bookings from an SAEF. If you are dealing with a few bookable resources and this bookings are managed in the CP then it would be pretty standard usage of the add-on.

# Answer
> 0 votes
Scheduling in EE isn't easy to setup. Your best bet is to look into Justin's addon or to look at a 3rd party tool which would sit inside an EE template but be served by the 3rd party service via JS or a script you install on the same server which lives beside EE on the server.

There are tons of options for Salon scheduling which do the job well... For example **Simple Salon** has a small monthly fee, no contract, SMS reminders and online bookings.

A Google search for "online scheduling for salons" will get you a ton of options.

---
Tags: add-on, recommendation-request
---


# Question
Title: Setting up MSM on EngineHosting Account?
This might be more general than I'm titling it, if so, I'll correct that.

I am migrating an ExpressionEngine MSM site to EngineHosting. The site was built by another developer. I am upgrading it from EE 1.x to 2.x and doing ongoing site maintenance.

My directory structure is like so:

```
/public_html/www_site_1
/public_html/www_site_2
/public_html/www_site_3

```

The www\_ convention is mirrored from what the original developer set up on another hosting account.

Where I'm confused is if I visit my preview URL supplied by EngineHosting, how do I configure it the server knows to look in the /www\_site\_1 folder?

Currently, both visits to either http://\[PREVIEW\_URL\] or http://\[PREVIEW\_URL\]/www\_site\_1/ fail. I get a 404 on the first (no index page) and Internal Server Error on the second.

# Answer
> 2 votes
Solution was, as suggested by @NevinLyne, to contact tech support who made certain the backend was configured properly and uncovered a glitch in my htaccess file I'd never have uncovered.

---
Tags: server
---


# Question
Title: Custom statuses not displayed for playa within a matrix field
I'm having an issue with displaying custom statuses in my playa-within-matrix field.

I'm looking at an entry (on the front end) that has 4 matrix rows with a related entry in each. 3 of the related entries have a "Paid" status and one is "open".

Using this code, I only see the one entry with the open status:

```
{matrix_field}
  {playa_field}
    {title}
  {/playa_field}
{/matrix_field}

```

Which is fair enough, but if I add the status parameter I still see no entries, even if it's just status="open". ie both of these show no entries:

```
{matrix_field}
  {playa_field status="open"}
    {title}
  {/playa_field}
{/matrix_field}

{matrix_field}
  {playa_field status="open|Paid"}
    {title}
  {/playa_field}
{/matrix_field}

```

I'm on EE 2.4.0 with Matrix 2.5 and Playa 4.3.3.

# Answer
There were some parsing issues in Matrix in 2.5 for fields that had parameters.

Seeing as how you say that when using {playa\_field status="open"} causes no entries to display leads me to believe that you're affected by that one.

Upgrade Matrix to the latest version (2.5.2 currently) and that should fix your issue.
> 3 votes

---
Tags: matrix, playa, status
---


# Question
Title: ExpressionEngine Rich Text - the HTML Output is coming out weird
* In EE's Rich Text editor, I typed in the following content.
* I did not do any fancy markup or formatting.
* All I did was set each heading to an H4, and typed paragraphs normally.
* I did not touch the code or alter any markup.

This is how EE is outputting my (fairly normal) text in my template:

```
    <h4>The Project</h4>
    <p></p>
    <p></p>
    <div>
        <p></p>
        <div>
            <p>An iconic Lorem Ipsum led shopping centre at Location X. The 65,000 square foot multi-use facility includes a Lorem Ipsum Store built upon stilts to house customer parking underneath, together with 28 retail units, a food court, a petrol filling station and 18,000 square feet of office space.</p>
            <div>
                <p></p>
                <div>
                    <p></p>
                    <div>
                        <p>The focus of the design was to make a bold architectural statement and included an ambitious six-storey high, frameless, glass frontage with an unusual curved roof. </p>
                    </div>
                </div>
            </div>
            <h4>The Challenge</h4>
            <div>
                <p></p>
                <div>
                    <p></p>
                    <div>
                        <p>Creating an innovative glass structure, 24 metres high with a 10 degree angled lean. Nothing quite like this had ever been attempted in Europe before. It was a first and whilst Company Name had to ensure they were highly attentive to the practical safety aspects of achieving the construction, they also had to think about the clients aesthetic objectives to creating a striking piece of architecture that would draw in shoppers. </p>
                    </div>
                </div>
            </div>
        </div>
    </div>

```

I am confused why so many blank `<p>` tags are output, and why each subsequent paragraph is nested further and further into a series of nested `<div>`s. Is this normal behaviour for EE? It breaks my styling slightly, as `<div>` have small margins on them. If I were to code this manually, I would put something like `<h4>The Project</h4> <p>The text[...]</p>` \- without wrapping the `<p>` in a `<div>`.

Is there anything I can do about this? Thanks!

# Answer
Whilst this does not solve the issue that you are having with the WYSIWYG editor that is provided with ExpressionEngine, you can upgrade to a different WYSIWYG add-on like Editor or Wygwam.

Both of these are robust though I prefer Editor because it also adds WYSIWYG to the category description field. Though to be honest these are both fantastic add-ons.
> 1 votes

---
Tags: templates, custom-fields, richtext
---


title: set order of dynamically created links

text:
# Question
Title: set order of dynamically created links
I have a list a dynamically created links in my sidebar. I want one particular link to appear first in the list; the order after that is unimportant. How could I accomplish this? Here is my code:

```
<ul class="categories">
        <a href="{path=ministries}"><h2 class="section-header">Ministries</h2></a>
        {exp:channel:entries channel="ministries" dynamic="no" {gv_param_disable_all}}
        <li><a{if segment_2 == url_title || url_title =="get-involved" && segment_2 == ""} class="current"{/if} href="{homepage}/ministries/{url_title}">{title}</a></li>
        {/exp:channel:entries}
</ul>

```

# Answer
> 1 votes
If each link is an entry then you can set the one you want at the top to be "sticky". You can do this in the options tab of the entry form. It will then appear first in any list of entries regardless of other ordering set in the entries tag pair.

http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#sticky

Otherwise you can order by date or use a third party add-on to manage the ordering.

You can also set a custom order on your entries tag-pair but this relies on you knowing the entry ids of the entries you are retrieving.

# Answer
> 1 votes
The quick and simple way is to set the **Entry Date** of your important link so it's later than all the other entries (or, very far into the future and then add `show_future_entries="yes"` to your Channel Entries tag).

The nicer way is to use Low Reorder to set the order of your entries.

---
Tags: channel-entries, list, dynamic
---


# Question
Title: Using Zoo Visitor, on form submit error, entered values don't fill into form
I'm doing a Zoo Visitor registration. If there's a problem with the user inputs, the errors show up fine but it blanks the form. I added code that I thought would fill the values in again but nothing gets filled in.

```
<div class="line">
    <label for="email">First Name:*</label>
    <div class="input_wrap">
        <input id="member_firstname" name="member_firstname" type="text" value="{member_firstname}" />
        {if error:member_firstname}<span class="error">{error:member_firstname}</span>{/if}
    </div>
</div>

<div class="line">
    <label for="email">Last Name:*</label>
    <div class="input_wrap">
        <input id="member_lastname" name="member_lastname" type="text" value="{member_lastname}" />
        {if error:member_lastname}<span class="error">{error:member_lastname}</span>{/if}
    </div>
</div>

<div class="line">
    <label for="email">Email:*</label>
    <div class="input_wrap">
        <input id="email" name="email" type="text" value="{email}" />
        {if error:email}<span class="error">{error:email}</span>{/if}
    </div>
</div>

```

And as I'm writing this I'm wondering has it something to do with parse order? We're using stash and maybe it's causing it not to load or is being overwritten during parsing. For the email field, having {email} as the value, always returns the email address of the super admin account. I've tried this in different browsers, logged out, incognito windows, etc. Always the same.

From looking at code examples and safecracker, zoo visitor stuff, I was under the impression that I use the form element name/id as the EE tag to fill it with data. Maybe I need a prefix or I've got something else running that's causing this.

Any help or suggestions would be greatly appreciated.

Thanks,

Dave

# Answer
I found the answer to my own question...

Inside the stash tag, the form was wrapped in a {exp:channel:entries} tag. I realised I didn't need it, removed it and it worked then. Parse order must have changed things. It's working now though.

Ok, finished talking to myself now.
> 2 votes

---
Tags: safecracker, forms, safecracker-registration
---


# Question
Title: Uploading photos to Amazon S3 using Safecracker?
I'm setting up a form where people will be able to submit photos for a contest. It uses Safecracker and the Safecracker file field to upload a single photo and related metadata with the photo going to a designated directory.

Works fine with smaller images, but chokes once it gets to about 4mb file size. Looks like it's running into the max CPU runtime. I imagine this problem will get worse as the # of entries in that directory increase.

I've been looking into addons for using Amazon S3, but it looks like these are more for file management from within the Control Panel, or integrated with edit forms...and that they leave copies of the images on the site's server. Is there a way to use Safecracker to upload directly to Amazon S3 so I just bypass this problem with the server choking?

Also, I'm trying to figure out the best way to make sure each title/photo has a unique name, and thought the cleanest way would be to append the entryID to each upon submission. Wondered if anyone had another solution. Duplicate photo names right now are getting the word "temp" added automatically, but that looks clunky.

Thanks!

# Answer
You want Simple S3 Uploader \- this will upload directly to S3. I'm using it on a site at this very moment and I'm uploading 6-12Mb Images and it's absolutely fine.
> 3 votes

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