# Question
Title: Members - Can a member turn off email notifications for messages?
Can a member turn off email notifications for messages?

If so, is there a way to save this setting for each member in a Safecracker form?

# Answer
> 1 votes
I think, you are using Safecracker Registration for the member registration process. For turning off the email notification for messages the member's `notify_of_pm` need to be set as 'n'. Can you just try by having an input field within form tag:

```
<input type="text" name="notify_of_pm" value="n" />

```

and then check within exp\_members for `notify_of_pm` column value for that member if set as 'n'.

If it didn't work, you will need to create an extension for it which will update it.

---
Tags: members, email, notification, messages
---


# Question
Title: Does {name} always equal {username} in Forgotten Password template?
Does the name variable in the forgot password email template always equal the username?

# Answer
Yes, {name} variable in the forgot password email template always equals the username.

To be sure, you can see it within the file `system/expressionengine/modules/member/mod.member_auth.php` around line number 732 - 740 (EE v2.6.1).
> 1 votes

---
Tags: templates, system-messages, forgot-password, messages, username
---


# Question
Title: Converting EE1 Text Field with Image tag to EE2 File Field
I've a EE1 - EE2 project where I have a native text field storing a full image tag like:

```
<img src="{filedir_2}sh-275.jpg" style="border: 0;" alt="SH-641 humidity chamber" />

```

This being the result of the EE1 upload process. I'd like to get this turned into an EE2 file field so need the field contents to just be:

```
{filedir_2}sh-275.jpg

```

The main goal is so that I can use the EE image resizing.

Has anyone come up with some clever SQL to do that in an automated fashion? I'd rather not have to touch each entry.

I know I have the option to use a template-level image resizer yet but would rather see about getting the native tool working first.

# Answer
> 2 votes
Straight SQL is much more difficult than a little bit of PHP in a one-off PHP-enabled template.

JayF is right that a new File field to hold your extracted data is a good idea - you can delete the old field after you see the migration has worked as expected.

This code assumes you've upgraded to EE 2.6+. Replace the top two field names, throw it in a PHP-enabled template, and load it up.

```
<?php

$old_field = 'field_id_XX';
$new_field = 'field_id_XX';

$images = ee()->db->query("
    SELECT entry_id, $old_field FROM exp_channel_data WHERE $old_field != ''
");
foreach($images->result_array() as $image)
{
    preg_match('/src="([^"]*)"/i', $image[$old_field], $match);
    if(!empty($match))
    {
        $data = array(
            $new_field => $match[1]
        );
        ee()->db->query(
            ee()->db->update_string('exp_channel_data', $data, 'entry_id = '.$image['entry_id'])
        );
    }
}

?>

```

# Answer
> 2 votes
I've done this kind of thing in SQL. The trick is matching what you need using just SQL, since its string matching is somewhat verbose. I've also done this using SQL in PHP--just looping through a query result set, making the changes using PHP's RegEx or basic string substitution, and then updating the entries.

To get at the field data in EE1, you'll want to do a query like:

```
select entry_id, field_id_10 from exp_weblog_data
where channel_id = 1 and field_id_10 like '%src="{filedir_2}%.jpg%'

```

You can find the field\_ids for the fields you need, via this:

```
select * from exp_weblog_fields

```

Or, go to edit a field in the EE control panel, and grab the field ID from the URL.

---

**updated:** here's an example query for parsing out the file info. Note that there's a +4 in the equation because we look-up the position of .jpg (which is 4 characters). If you end-up doing this totally in SQL, then I'd run separate queries for .jpg, .gif, .png as needed.

```
select entry_id, field_id_10,
substr(field_id_10,
locate('{filedir_2}', field_id_10),
locate('.jpg', field_id_10, locate('{filedir_2}', field_id_10))
- locate('{filedir_2}', field_id_10) + 4
)
from exp_weblog_data
where channel_id = 1 and field_id_10 like '%src="{filedir_2}%.jpg%'

```

So, ultimately, you'd want to create a new field for the new image value (say it's field\_id\_11), and do something like this:

```
update exp_weblog_data set field_id_11 =
substr(field_id_10,
locate('{filedir_2}', field_id_10),
locate('.jpg', field_id_10, locate('{filedir_2}', field_id_10))
- locate('{filedir_2}', field_id_10) + 4
)
where channel_id = 1 and field_id_10 like '%src="{filedir_2}%.jpg%'

```

---
Tags: file-uploads, fieldtype
---


# Question
Title: simple multi language site (two languages, mostly static content)
This is my first multi language project and should be very simple. The only dinamic content is for blog, but it doesn't need to be translated. I thought to take these steps, i would like to have some opinion if I'm doing something wrong

**Templates:**

For the main language:

* /index
* /contatti
* /blog
* etc..

For english language i create the template\_group "en"

* en/index
* en/contact
* en/blog

**Global variables/embed templates**

i.e.

* "head\_html" and "en\_head\_html"
* "body" "en\_body"
* etc...

Is this correct or i'm doing something wrong? Are there better methods for a simple situation like this? Thanks in advance

# Answer
> 2 votes
You can have some guidance from http://www.sidd3.com/multi-language-website-with-expressionengine/

Hope, it would help you.

# Answer
> 3 votes
In addition to the tips provided in the link Bhashkar provided, I would strongly recommend you have a look at Low Variables \- it's a terrifically powerful add-on that gives you the ability to simultaneously create language-version variables as you create them, which when coupled with the language segment global system variables you'd likely create as directed in the article above, becomes a very fast and efficient way to use a single template to conditionally load language-specific content, both static variables, as well as entries.

# Answer
> 2 votes
Just started a repo on Github for a multilingual text fieldtype I'm working on which could help you out, or at least give you some more options : Babeltext

# Answer
> 1 votes
Here's my practical approach http://digitalevangelist.net/blog/multi-lingual-expressionengine-practical

I used Freebie and Republic Variables mainly

# Answer
> 1 votes
I used Publisher add-on and worked great. Gives you the options to see which entries have a translation in draft or published form when you are in the entry list.

I'm still trying to import a Data Base and relate the entries to their translation, but Brian Litzinger, the developer has been very helpful in answering some previous questions.

---
Tags: multilingual, multi-language
---


# Question
Title: If using Expresso Store, is it possible to feature products in non-store pages? Is there a way to feature "related products"?
Maybe a dumb question, but I have zero experience with Expresso Store. Since products are channel entries, is it possible to 1) feature products in non-store pages (say the homepage) and 2) use categories or relationships in order to show products related to the product the user is viewing?

Bonus question: Are the expensive SSL certificates with the green URL background worth the $$? How low can I go with SSL costs and still be secure?

Thanks!

# Answer
Yes, you can display them anywhere on the site, as you say they're just entries. Obviously you'll need to include the store product tags to output the price details or any modifiers if required.

Due to EE's flexibility there are many ways to display featured or related products, some of the easiest is to use a category, relationships or I'd recommend using Playa, or a combination of each of them depending on what you require.

For example, I use Playa on product entries so the client can simply choose by dragging and dropping the other products that they want to up-sell on that page (related). Same on the homepage, a "featured" Playa field that the client can select 30 (say) products and the homepage outputs 10 of these randomly keeping the content fresh.

**Bonus Answer**: Depending on the browser you get different display of the padlock and the more expensive SSLs will also display differently - so not always that prominent.

Example reference (no recommendation - just first result from Google!)

Besides the additional display, these types of SSL show the owner of the SSL. Most consumers/visitors wouldn't have a clue regarding the difference this made and doubtful they'd even understand that an SSL could be registered by a different company from the owners of the website.

Personally as a developer, I wouldn't recommend to a client as I don't think it's any more beneficial to them, especially at the cost. As a customer visiting a site, I'd be happy for just a normal padlock and security - as long as the site looked respectable, decent and trustworthy.
> 3 votes

---
Tags: expresso-store
---


title: Programmatically empty cart

text:
# Question
Title: Programmatically empty cart
Is there a way to programmatically empty the cart? I know you can by submitting a form with name="empty\_cart", but I'd like to do it programmatically between page loads, not requiring a user input.

If it's not possible with native tags, is this something we could build an extension for?

# Answer
> 3 votes
It depends what you're trying to achieve. If you want to programmatically empty the cart using PHP, this will do the trick (Store v2):

```
// load the Store module if you haven't already
require(PATH_THIRD.'store/autoload.php');

ee()->store->orders->clear_cart_cookie();

```

In Store v1:

```
$this->EE->store_cart->empty();

```

If you want to do it using template tags, I would suggest just making a basic template with the checkout form on it, and using javascript to submit the form as soon as the page loads.

By the time you're doing that though, you may as well just use a small checkout form with an `empty_cart` button instead of linking to the page in question.

---
Tags: expresso-store
---


title: Backspace in modifiers?

text:
# Question
Title: Backspace in modifiers?
I'm using Exp-resso Store. Is there a way to use the `backspace` parameter in the {modifiers} tag? For the cart view, I'm hoping to list the modifiers that are being used, something like this:

```
{modifiers backspace="2"}
    <strong>{modifier_name}:</strong> {modifier_value}
{/modifiers}

```

That would output something like: **Color:** Blue, **Size:** X-Large

Thanks a ton, Brennan

# Answer
There's no backspace parameter.

One possible solution I can think of would be to use css and the `:last-child` selector. For example:

```
<div class="modifiers">
    {modifiers}
        <span class="modifier"><strong>{modifier_name}:</strong> {modifier_value}<span class="separator">,</span></span>
    {/modifiers}
</div>

```

With css:

```
.modifiers .modifier:last-child .separator {
    display: none;
}

```

This would work in all browsers except IE8, and it doesn't seem like a big deal if IE8 users see an extra comma.
> 2 votes

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


title: WYGWAM - text align center?

text:
# Question
Title: WYGWAM - text align center?
I just updated to Wygwams latest version and I don't see the "text align" option anymore. How do I restore it?

# Answer
We just released Wygwam 3.1.2 which brought back the text alignment buttons.
> 4 votes

# Answer
Had this problem too. Looks like they removed it from the default set-up. First thing to check is under 'themes/third\_party/wygwam/lib/ckeditor/plugins' you have the 'justify' plugin installed. If not just download it here (http://ckeditor.com/addon/justify?page=1) and place the whole folder in the plugins folder.

Next you need to be in 'system/expressionengine/third\_party/wygwam/helper.php'

Around line 67 you'll see them setting up a multi-dimensional array in the 'tb\_groups' function (this is where the CP Editor Configuration is pulling it's list of toolbar options from). Add a new array like so

```
array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock')

```

Around line 577 you'll see them loading in some extra Plugins (there was 'wygwam' and 'readmore' in my file. You need to load the 'justify' extra in the same way.

```
$extraPlugins[] = 'justify';

```

You should now have the 4 alignment options in the EE Wygwam editor configuration pages to drag and drop into your toolbar and those options should also display in both the EE new/edit entry pages and also in Safecracker forms.
> 3 votes

---
Tags: wygwam, html, text-formatting
---


# Question
Title: Prevent duplicate rows with matrix when using ajax submit?
I'm having some trouble determining a good solution to save a Matrix field using Safecracker and AJAX.

From what I see matrix creates new rows by using `field_name[row_new_0][col_id_xxx]` or `field_name[row_id_xxxx][col_id_xxx]` when editing an existing row. I would have hoped that the row\_id\_xxxx was just an increment and would be replaced but that's not the case, instead it's a unique id.

The form I am creating allows the user to save a form before they submit it completely and what happens is it will continue to create "new" rows once it is saved.

Any ideas on how to prevent this?

# Answer
Here's my solution. It simply makes an additional request to the form to grab the matrix fields and reinitializes them. I had to trim this up so it may or may not work in it's entirety but you get the idea.

```
$(function () {

    // ajax form post
    $("button[type='submit']").bind('click', function (e) {

        // select your form
        var $form = $('#yourform');

        // submit the form
        $.ajax({
            type: "POST",
            dataType: "json",
            url: $form.attr('action'),
            data: $form.serializeArray();,
            success: function (data) {
                if (data.success)
                {
                    reloadMatrices(); // here's the magic
                    if ($form.find('[name="action"]').val() == "submit") // your form will have multiple <button name="action"> tags with different values such as "submit" or "save"
                    {
                        alert("Thank you for your submission! We will be contacting you shortly.");
                        window.location = "//" + window.location.hostname + "/confirmation"; // redirect to confirmation page
                    }
                }
            }
        });

    });
});

/**
 * function reloadMatrices()
 *
 * Requests the same form and replaces all instances of a Matrix fieldtype with the new form from the request and reinitializes them.
 */
function reloadMatrices() {
    $.ajax({
        type: "GET",
        url: window.location,
        success: function (data) {
            var $data = $(data);

            // you might be able to use .load() here instead for more concise code
            $('.matrix-ee2').each(function () {
                var $this = $(this);
                $this.replaceWith($data.find("#" + $this.attr('id')));

                // reinitialize all of the matrices so they work as intended
                // IMPORTANT: requires an md5 jQuery plugin such as https://github.com/placemarker/jQuery-MD5
                window['initMatrix_' + $.md5($this.attr('id'))]();
            });

        }
    });
}

```
> 1 votes

# Answer
This sounds pretty complicated on the account of unique row IDs.

How about a sneaky workaround, since you're using AJAX already - after saving the partial form data, including Matrix, do an AJAX request that would return a safecracker form with Matrix field rendered with {field:matrix\_field} and then parse that HTML with Javascript for the row IDs that you need?
> 0 votes

---
Tags: matrix, safecracker
---


# Question
Title: Import image to Expression Engine from XML file
I have purchased the Solspace Importer plugin to import xml data (properties data) into one of my client's website.

It managed to grab the data from the REAXML file manually but I'm having trouble displaying the given image url from the XML file into the site.

This is the example file: demo.slickdesign.com.au/rance-cms/mydesktop/residential\_sample.xml

My question is, how do I grab the image url from the XML file and map it into Expression Engine field?

Any help is much appreciated.

Thanks Vic

# Answer
> 1 votes
According to your XML file link, images are stored in an XML node's attribute. Eg:

```
<floorplan id="1" modTime="2009-01-01-12:30:00" url="http://www.realestate.com.au/tmp/floorplan1.gif" format="gif"/>

```

Unfortunately Importer cannot read XML node attributes, nor read self-closing XML nodes as of this writing.

The correct format to import the image URL in EE using Importer would be, eg.

```
<floorplan>http://www.realestate.com.au/tmp/floorplan1.gif</floorplan>

```

★ As additional/bonus information, if you're looking to import images into EE's **File field**, for example, you need to import the filename *only*, preceded by the target upload directory's ID. For example, if I want to import `my_file.jpg` into my upload directory 1, I would import this string:

```
{filedir_1}my_file.jpg

```

...followed by uploading my actual image file in the upload directory through FTP or other means.

# Answer
> 0 votes
I hope i understand you well, create new folder in *EE File upload preferences* with the specific path that you need later in your channel field you can pick that folder that you created with the specific path

More about image preference http://ellislab.com/expressionengine/user-guide/cp/content/files/file\_upload\_preferences.html

---
Tags: solspace, solspace-importer
---


# Question
Title: Has color button gone on the latest Wygwam 3.0.2?
I upgraded the Wygwam to the latest version on the latest EE installation and I seem to have lost the option to preset the the colour button. Seems to be a lot less options on this version. Is that correct or is it just hidden?

Cheers

# Answer
We just released Wygwam 3.1.2, which brings back the text color buttons.
> 1 votes

---
Tags: wygwam
---


# Question
Title: How to bulk import multi-language data to channel entries?
I'm trying to import a data base that has multi-language entries to EE and thought of using DataGrab. I'm using Publisher plugin to relate multi-language entries. Is there a way that I can import the DB without losing the relation between entries and their translations?

# Answer
The 'relationship' is the entry\_id. So if you can import the default language, grab the entry id, then import the translated entry and assign the same entry\_id it should work. I'm not sure DataGrab would do that out of the box.
> 1 votes

---
Tags: channel-entries, database, multi-language, datagrab, import
---


# Question
Title: Get (Solspace) calendar occurences sorted by date
I want to get all occurrences of a single calendar and sort them by the occurrence start date. The reason why I want to do this is because I want to create an occurrence details page. To do that I need the occurrence ID, the calendar:cal tag does not seem to give me the occurrence id when printing out a single occurrence. I have tried the calendar:occurrences tag, but I cannot get that one to sort the occurrences by occurence\_start date. I have tried using the default orderby and sort options to accomplish the sorting, but to no avail.

How can I do this? What are my options?

# Answer
First, I highly recommend having a look at this documentation page explaining the differences between some of the more common Calendar tags. Always useful:

http://www.solspace.com/docs/calendar/getting\_started/

In detail, if you're looking to create a **chronological list of events/occurrences**, use **`{exp:calendar:cal}`**. This is the only tag that will make the necessary calculations to list your occurrences in chronological order. Each occurrence will be listed chronologically, with `{event_start_date}` displaying the start date of each occurrence:

```
{exp:calendar:cal
   date_range_start="1 month ago"
   date_range_end="+1 month"
   pad_short_weeks="n"}
   {events}
       [{event_id}] {event_title} - {event_start_date format="%Y-%m-%d"}<br />
   {/events}
{/exp:calendar:cal}

```

Occurrences do not have their own occurrence\_id unless the occurrence is edited in the Control Panel. By default the ID is the same as the "master" event\_id set up in the "Calendar: Events" channel entry form.

To print out information about a single occurrence (for a specific day, for example), a good solution is to pass three elements in the URL:

* The start date
* The end date (if different from the start date)
* The "master" event\_id

For example, if you want to display occurrence data for 2013-08-19 (for master event "123"), make a URL like this:

```
http://mysite.com/calendar/event/2013/08/09/123

```

...and use {exp:calendar:cal} to "zoom in" on that occurrence:

```
<h3>Occurrence details:</h3>
{exp:calendar:cal
   date_range_start="{segment_3}-{segment_4}-{segment_5}"
   date_range_end="{segment_3}-{segment_4}-{segment_5}"
   pad_short_weeks="n"
   event_id="{segment_6}"
}
   {events}
       {event_title} occurrence data:<br />
       Starts on  {event_start_date format="%Y-%m-%d"}<br />
       Ends on  {event_end_date format="%Y-%m-%d"}<br />
   {/events}
{/exp:calendar:cal}

```

Of course you can change the structure of the URL to be

```
http://mysite.com/calendar/event/2013-08-09/123

```

...and use {exp:calendar:cal} accordingly:

```
{exp:calendar:cal
   date_range_start="{segment_3}"
   date_range_end="{segment_3}"
   pad_short_weeks="n"
   event_id="{segment_4}"
}
// the rest of the code...

```
> 2 votes

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


title: Language switcher

text:
# Question
Title: Language switcher
Using this plug-in. http://biberltd.com/en/documentation/software/biber\_ltd\_multi\_language\_support/

How can I switch from one language to another.

I've got the code switching from FR/EN on the top right menu but can't get it to work when a user is deaper into the site.

I'm confused between settings in my htaccess and site structure could anyone offer any insight?

Language switching works from main site: link to site in question: http://kanuk.com/dev/

Language switching does not work from deeper link: http://kanuk.com/dev/index.php/Collection/femmes/manteaux-chauds

# Answer
That's because of your index.php isn't included in your language changer link.

http://kanuk.com/dev/index.php/Collection/femmes/manteaux-chauds

goes to:

http://kanuk.com/dev/fr/Collection/femmes/manteaux-chauds

which is missing the index.php element:

http://kanuk.com/dev/fr/**index.php**/Collection/femmes/manteaux-chauds/

Either modify your htaccess so it removes the index.php (recommended), or change the links in the language changer so they generate the URL with index.php in it.
> 1 votes

---
Tags: switch, language
---


# Question
Title: Get old fieldtype data to prepend with new?
I am trying to create a fieldtype that requires comparison to it's previous data. Any idea how to get this data in the `save()` function? I tried using `$this->field_data` but that just returns the "new" data submitted to the form.

To provide a tangible example, what I am trying to do is take the prior data and store it with the new data as an array so my `save()` function looks like this (if $this-\>field\_data worked this should have):

```
function save($data)
{
    if (!empty($this->field_data)) $data = json_decode($this->field_data, TRUE);
    $data[] = $data;

    return json_encode($data);
}

```

# Answer
This solution uses the channel\_entries model:

```
function save($data)
{
    if (ee()->input->post('entry_id'))
    {
        // look up old data
        ee()->load->model('channel_entries_model');
        $query = $this->EE->channel_entries_model
            ->get_entry(
                ee()->input->post('entry_id'),
                ee()->input->post('channel_id')
            );
        $result = $query->row_array();

        // if exists set old data
        if ($query->num_rows() > 0) $return = json_decode($result[$this->field_name], TRUE);

        // append new data
        $return[] = $data;

        return json_encode($return);
    }

    return "";
}

```
> 1 votes

# Answer
The only way to get the old data is to query for it:

```
//are we saving a new entry or updating an existing?
$entry_id = ee()->input->get('entry_id');

if ($entry_id)
{
  //get the old data from the database
  $query = ee()->db->select('field_id_'.$this->field_id)
                   ->where('entry_id', $entry_id)
                   ->get('channel_data');

  $old_data = $query->row('field_id_'.$this->field_id);

  $query->free_result();
}

```
> 0 votes

---
Tags: add-on-development, fieldtype
---


title: EE1 to EE2 error on 2.1.4

text:
# Question
Title: EE1 to EE2 error on 2.1.4
did everything as described in the docs on upgrading EE1 to EE2 and getting stuck around 2.1.4 and then this error comes up on the screen. How do I upgrade to 2.6.1 from 1.7.3 without getting this error?

```
A Database Error Occurred
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`wm_name` varchar(80), `wm_type` varchar(10) DEFAULT 'text', `wm_image_path` v' at line 3

ALTER TABLE `exp_member_groups` ADD `wm_id` int(4) UNSIGNED AUTO_INCREMENT, `wm_name` varchar(80), `wm_type` varchar(10) DEFAULT 'text', `wm_image_path` varchar(100), `wm_test_image_path` varchar(100), `wm_use_font` char(1) DEFAULT 'y', `wm_font` varchar(30), `wm_font_size` int(3) UNSIGNED, `wm_text` varchar(100), `wm_vrt_alignment` varchar(10) DEFAULT 'top', `wm_hor_alignment` varchar(10) DEFAULT 'left', `wm_padding` int(3) UNSIGNED, `wm_opacity` int(3) UNSIGNED, `wm_x_offset` int(4) UNSIGNED, `wm_y_offset` int(4) UNSIGNED, `wm_x_transp` int(4), `wm_y_transp` int(4), `wm_font_color` varchar(7), `wm_use_drop_shadow` char(1) DEFAULT 'y', `wm_shadow_distance` int(3) UNSIGNED, `wm_shadow_color` varchar(7), `id` int(10) UNSIGNED AUTO_INCREMENT, `upload_location_id` int(4) UNSIGNED DEFAULT '0', `title` varchar(255), `short_name` varchar(255) DEFAULT '', `resize_type` varchar(50) DEFAULT '', `width` int(10) DEFAULT '0', `height` int(10) DEFAULT '0', `watermark_id` int(4) UNSIGNED, `file_id` int(10) UNSIGNED AUTO_INCREMENT, `cat_id` int(10) UNSIGNED, `sort` int(10) UNSIGNED DEFAULT '0', `is_cover` char(1) DEFAULT 'n', `site_id` int(4) UNSIGNED DEFAULT '1', `rel_path` varchar(255), `status` char(1) DEFAULT 'o', `mime_type` varchar(255), `file_name` varchar(255), `file_size` int(10) DEFAULT '0', `field_1` text, `field_1_fmt` tinytext, `field_2` text, `field_2_fmt` tinytext, `field_3` text, `field_3_fmt` tinytext, `field_4` text, `field_4_fmt` tinytext, `field_5` text, `field_5_fmt` tinytext, `field_6` text, `field_6_fmt` tinytext, `metadata` mediumtext NULL, `uploaded_by_member_id` int(10) UNSIGNED DEFAULT '0', `upload_date` int(10), `modified_by_member_id` int(10) UNSIGNED DEFAULT '0', `modified_date` int(10), `file_hw_original` varchar(20), `can_admin_upload_prefs` CHAR(1) DEFAULT 'n' NOT NULL AFTER `can_admin_channels`

Filename: /home/user/admin/expressionengine/libraries/Smartforge.php

Line Number: 122

```

So I then remove all the new EE2 files and try and go back to EE1, I load my homepage and get this error:

```
Site Error: Unable to Load Site Preferences; Invalid Preference Data

```

# Answer
Are the columns the script is trying to add to exp\_member\_groups already present, perhaps from an earlier aborted attempt at an upgrade?

Looks like that was the issue when someone posted a similar question on EllisLab forum.

You mentioned that you restored the files, but did you restore the database as well?
> 1 votes

---
Tags: ee1, upgrade, ee2-upgrades
---


# Question
Title: Wygwam fullscreen toolbar not showing up in Firefox
Wygwam 3.1.1 and EE v2.6.1 - Build Date: 20130506

I noticed today that the in Firefox 23, after clicking on the "maximize" option in the toolbar, the entire tool set disappears when in full screen, compared to Chrome, where the toolbar is positioned at the top of the screen and visible even when scrolling.

Bug?

# Answer
> 1 votes
Gah. A restart fixed it :-| Thank you!

---
Tags: wygwam
---


title: orderby the last activity date

text:
# Question
Title: orderby the last activity date
I currently have a build in progress and am trying to achieve somthing that seems to be simple but is proving not quite so.

I would like to list say 50 entries, those 50 entries should be in a chronological order of either entry\_date or last\_comment\_date. Using entry\_date is fine for strict chronological but I'm also looking to see last\_comment\_date as well. If last\_comment\_date is newer then anothers entry\_date then it should be higher up the tree.

Using `orderyby="most_recent_comment|entry_date"` yields most recent comments first then lists by entry date which isnt what is required.

I basically want to order by the last activity date - comment or entry. Is this approach possible ?

# Answer
> 0 votes
I ended up using Stash. Stash records each entry into a stash\_list with an extra item that checks if there is at least one comment (if there is it must be newer then the entry\_date) if there are no comments then the entry\_date is the value.

Save the result of the if if:else as Unix Timestamp and then use stash:get\_list and orderby the Unix Timestamp Var :)

```
{stash:activity_date}
{if comment_total > 0}{recent_comment_date format="U%"}{if:else}{entry_date format="%U"}{/if}
{/stash:activity_date}

```

Yet another reason to use Stash :)

---
Tags: date, entries, orderby
---


title: Missing embed tool in Wygwam?

text:
# Question
Title: Missing embed tool in Wygwam?
I recently purchased and installed WYGWAM 3.1.1 and noticed that in the embed feature is missing. 5 o'clock on a Friday might have something to do with it, but I can't seem to find it. I would rather not have my client click on the "Source" button to add such things as well.

Any help would be great!

# Answer
> 1 votes
If you’re referring to Embed Media, it’s still there, it just has a different icon than it did in Wgywam 2 (as with all the other buttons). It’s the one that looks like a chunk of a video reel’s tape.

# Answer
> 0 votes
Embed what?

Go to Add-ons -\> Fieldtypes -\> Wygwam, you'll see Editor configurations. Select Full or Basic.

Drag and drop the controls you want or don't want from/to the toolbar. click on an item to disable/enable.

Ensure that your field is set to the appropriate configuration.

---
Tags: wygwam
---


# Question
Title: Generating link to full map with MX Google Maps
I have MX Google Maps working fine on a per-entry basis, but I'd like to give the user an option to view the full map on Google Maps.

This doesn't work:

```
<p>{the-map}
<a href="http://maps.google.com/maps?q={title}+{address}+{city}+
{state}+{zipcode}@{latitude},{longitude}" target="_blank">
Full-size Google Map</a>
{/the-map}

```

Ideas why?

# Answer
> 3 votes
I'm not sure what about your example doesn't work, but you don't need your link to contain so much information if you don't need it to. Simply using the longitude / latitude is enough to get your location up in Google Maps.

For example Tower Bridge, London can be linked just using:

`https://maps.google.com/maps?q=51.505591,-0.075402`

So with your example it'd be:

```
<p>{the-map}
<a href="http://maps.google.com/maps?q={latitude},{longitude}" target="_blank">
Full-size Google Map</a>
{/the-map}

```

If after all that, it's your MX Google Map tags that aren't outputting correctly then this will be of no help what so ever!

---
Tags: mx-google-map
---


title: Simple Commerce - IPN not sent

text:
# Question
Title: Simple Commerce - IPN not sent
I'm trying to sell subscriptions (yearly memberships) using the Simple Commerce module. I've set-up everything on EE side and on PayPal's (including the Instant Notification URL). Since I'm still testing everything, I'm not using encryption. Also I'm not using sandbox, but doing tests with 0,01p payments using real paypal accounts - my business and personal accounts, both verified. My business account is set to accept payments automatically.

When the payment is received, a first instant message to notify the subscription is sent successfully. Then PayPal tries to send another ipn, to notify the payment, but this one gets stuck with a "error 500".

It took me a while to get the first IPN, because one of the 3rd party extensions (VZ Bad Behavior, just in case someone else is experiencing the same problem) didn't allow paypal to hit the url. But if the first IPN gets through, why not the 2nd one?

Also, I'm using Expresso Store on the same install, and never had a problem with IPNs.

Any suggestion would be much appreciated.

# Answer
> 3 votes
Out of the box, simple commerce (SC) works to a point. 500 error, hmm have you changed any source code? If not, your settings are wrong. Reread the documentation.

Having said that, i have just completed programming of a similar project with subscriptions. The subscription side of things for SC only handles a few ipn messages. In fact, ee docs suggest you handle subscriptions via paypal anyway ( not sc) Check the ipn txn\_type that errored. Ensure SC has a method for it. If you want a better solution than SC, check out memberr. It has many good features. After purchasing memberr and playing with it for a month, we ditched it and rewrote and extended parts of SC to handle the ipn messages i needed - EOT, CANCEL, PURCHASE etc, added a few extra db tables for the subscriptions and created new control panel screens. I would have preferred to use an off the shelf product like memberr but found it had a bug in the code somewhere that wasnt setting the status of members entry correctly when the subscription expired.

Final thought, the purchase ipn is handled by SC for items but not subscriptions.

---
Tags: ecommerce, paypal, paypal-express-checkout
---


# Question
Title: How do I set up simple commerce to perform actions on a successful purchase/unsubscription?
I'm trying to set simple commerce to update a member field when a purchase has been made. How do I do this? I'd also like to do this when a user unsubscribes from our site.

# Answer
You need to write some custom code in the Simple Commerce module. Get the txn\_type for the ipn then add a method to handle it. For an out of the box solution, check if memberr can do what you want.
> 3 votes

---
Tags: members, ecommerce, paypal, commerce
---


# Question
Title: save_entry or submit_new_entry Channel API Methods: How do you store module field data?
I am working on an add-on solution where I would like to create a channel entry and set a value to a module custom tab field for that entry.

Here's some code to share what I am up to:

```
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_entries');

// Build data array
$data = array(
    'author_id' => $member_id, // Member ID
    'title' => $title,
    'entry_date' => $date,
    'modl_giving_impact_member_opportunities__opportunity_id_token' => $opportunity_id_token, // Giving Opportunity token
    );

// Add new entry into channel
$this->EE->api_channel_entries->submit_new_entry($channel_id, $data);

```

Here's how I am attempting to target the module field:

`modl_giving_impact_member_opportunities__opportunity_id_token`

\[module class name\]\__\[field name\]

Entry is being created but no luck with module field data being stored.

Anyway know how to properly include module data field data in my $data array?

# Answer
Field/entry data isn't really related to a module in EE, so it never know what to do with what you've passed it. Fields aren't part of modules, their fieldtypes, so you may need to rethink your approach and include a fieldtype along with your module.

How is your data held? Is it cross referenced in another table, or are you storing in the normal way inside channel\_data automatically?

If it's the normal straight forward way, then fields aren't referenced by their field name, but their field ID, typically "field\_id\_x", then there's a lookup to exp\_channel\_fields table on the field\_id to get the name or reference name (in your case "opportunity\_id\_token").

Depending on where the data came from that you want to set you may need to hard code (or via settings) what the field is (either ID, or name and do a lookup to find the ID). Or you could do a lookup to see which field is associated with your fieldtype (assumes only 1 field would ever use your fieldtype), then add that reference to your array:

```
// Build data array
$data = array(
    'author_id' => $member_id, // Member ID
    'title' => $title,
    'entry_date' => $date,
    'field_id_xx' => $opportunity_id_token, // Giving Opportunity token
);

```

Note: `submit_new_entry` is being depreciated as of EE v2.6, you should use `save_entry` instead. Ref There are also examples referencing the field IDs in that link.

If you want to associate data relating to an entry in your own table - so the Giving Opportunity token isn't shown on the Control Panel edit/publish entries pages, but kept separate - then this could be done purely in your module. All you'd need to do is once you've created the entry (with basic details) via the API, use:

```
$this->EE->api_channel_entries->entry_id;

```

To get the entry just created via the API. then save your module data in your own table cross-referencing the entry\_id.
> 2 votes

---
Tags: add-on-development
---


# Question
Title: Where to find dev documentation for multiple fieldtypes
I have looked at the docs for 2.6, but am unable to find an explanation for how to set up multiple fieldtypes in a single package. Can anyone enlighten - I really need this ability.

# Answer
> 4 votes
Any ft files in the root of your package directory (system/expressionengine/third\_party/your\_package) will be recognized as part of the package. See P&T's Field Pack for an example.

# Answer
> 3 votes
There is no documentation on this. Think of a fieldtype not as a single input or textfield, but as a single piece of data. So you could build multiple fieldtypes as separate files and folders (and completely different add-ons) or there's a couple of other ways to approach it: either storing the data in channel\_data table as delimited or serialized data (for the multiple fields), or building another table that stores the values separately in different columns.

Your single fieldtype class can simply output 2 input boxes in the view (so appearing as two field(types)s):

```
<input type="text" name="my_field[value1]" id="cart-tax-rate" value="<?= $existingData['my_value1']; ?>" />
<input type="text" name="my_field[value2]" id="cart-tax-rate" value="<?= $existingData['my_value2']; ?>" />

```

Then your fieldype method to save the data would either serialize it, or delimiter it in some way.

Alternatively, you take the data submitted and store it in your own table using the reference of the entry ID.

Your field type will also need to pull this data on display too (or format it if you chose the first option.

Any data stored in the channel\_data table can also be used for searching, so if you do hold the data in your own table, you might want to consider dropping key pieces of data into the native channel\_data column for your fieldtype for search purposes.

---
Tags: add-on-development, fieldtype, development
---


# Question
Title: How to get the logged in member id from PHP / hooks?
Is there a hook-independent way to get the logged in member id inside a hook handler?

Something like a function or a global variable?

# Answer
Yip. You're looking for:

```
ee()->session->userdata('member_id');

```

It's in the session class:

http://ellislab.com/expressionengine/user-guide/development/usage/session.html
> 9 votes

---
Tags: members, hook
---


# Question
Title: Expresso: Store - 0 handling charges when selecting a particular shipping method
I have a webstore which has products that add a different handling charge to the shipping if the user selects 'registered mail' shipping.

How do I set the handling charges to 0 when a user selects a particular shipping method (Pick up at store)?

Regards, Rin

# Answer
The easiest way to do this would be to use the Default Shipping Plugin with a name of "Store Pickup" or similar. Then create a new rule that does not add any cost. Then you can create a second Default Shipping Plugin (actually you can use any Shipping gateway) instance for your regular delivery items that will allow you to calculate shipping cost based upon rules supplied.
> 1 votes

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


# Question
Title: Order discount not calculating on first submit
I have a process in my checkout whereby orders with a value over £750 get 5% discount applied. To do this I have a hidden promo\_code field which has a value of 'bulkorder' if {order\_subtotal\_val} is \> £750. This works fine until the customer amends the quantity in the cart to bring the subtotal below £750.

I have some script on the submit action (update cart totals) of the form to remove the promo\_code, which works fine - however on refresh the form has a blank promo\_code but the {order\_discount} applies the removed promo code anyway. If I click the submit again the order\_discount refreshes to 0 as expected.

A similar thing happens if I the increase the total above £750 - submitting the form adds the promo\_code to the field but until I submit a 2nd time, the {order\_discount} remains at 0.

Any ideas?

# Answer
> 1 votes
{order\_subtotal\_val} hasn't recalculated until after the form is submitted. Therefore need to submit form via Ajax to refresh for the user

---
Tags: expresso-store
---


# Question
Title: Show entries for a certain date with a custom date field using Super Search
I am looking to display entries based on a custom date field using Solspace Super Search.

I want to be able to use a date picker to select a date in a search form and then use Super Search to only show entries based on that particular date, no entries before or after it.

The dates are stored in EE using a native EE date field.

My field name is next\_box

Thanks

# Answer
> 0 votes
Set your field name to: next\_box-exact

Then. SuperSearch will return only those entries that match that date.

---
Tags: custom-fields, date, solspace, supersearch
---


# Question
Title: Trying to limit displayed entries to 2 - stops before it finds entries to display so nothing shows
We are building a fairly large & complex site. The problem I am running into is one of limiting. Here's what I need it to do:

There are various sectors. Each sector has a landing page. On the landing pages we display news stories relating to that particular sector. The way we do this is to use Playa in the news story entry to select the related sector(s), and then pull through the entries on the sector landing page templates like this:

```
{exp:channel:entries channel="news-article" dynamic="off" orderby="date" sort="desc"}
        {exp:playa:children var_prefix="news" field="news-related-sector"}
            {if {structure:page:entry_id} == {news:entry_id}}
                <article class="aside-news-listing">
                    <a href="{page_url}">
                        {if news-thumbnail}
                            <img src="{news-thumbnail:news-thumbnail}" alt="{title}" />
                        {if:elseif news-image}
                            <img src="{news-image:news-thumbnail}" alt="{title}" />
                        {/if}
                    </a>
                    <div class="article-text-block">
                        <h3><a href="{page_url}">{title}</a></h3>
                        <ul>
                            {categories}
                                <a href="{path='news/'}"><li class="sector1text">{category_name}</li></a>
                            {/categories}
                        </ul>
                        <span>{entry_date format='%d %F %Y'}</span>
                    </div>
                </article>
            {/if}
        {/exp:playa:children}
    {/exp:channel:entries}

```

Now this works fine - but it pulls through all news entries related to that sector, and we only want to display the latest 2.

I have tried using limit="2" on the channel entries tag and nothing displays. I'm guessing this is because it just selects the first 2 entries and never hits one that is related to the sector.

I have also tried using limit="2" on the playa children tag but all related news stories display - not limited.

I have tried using an {if count \<= 2} conditiona inside and outside of the playa tag and inside the entry\_id conditional and nothing is displayed in any case. I'm now out of ideas! Can anyone shed some light on this?

Thanks!

Notes: I am using EE 2.6.1 and Playa 4.4.5. I know this might not be the best way to achieve what we want to - but I didn't build it and it's what I have to work with :-P

# Answer
I think you want to use `playa:parents` instead (as the news entries are the "parents" of the selected sector). I gather from your code that the landing page is a Structure page so you'll have to pass that page's entry ID directly (as don't think Playa will be able to glean it from the URL as normal).

```
{exp:playa:parents channel="news-article" entry_id="{structure:page:entry_id}" field="news-related-sector" limit="2" disable="member_data|pagination"}
<article class="aside-news-listing">
    <a href="{page_url}">
        {if news-thumbnail}
        <img src="{news-thumbnail:news-thumbnail}" alt="{title}" />
    {if:elseif news-image}
        <img src="{news-image:news-thumbnail}" alt="{title}" />
    {/if}
    </a>
    <div class="article-text-block">
    <h3><a href="{page_url}">{title}</a></h3>
    <ul>
        {categories}
        <a href="{path='news/'}"><li class="sector1text">{category_name}</li></a>
        {/categories}
    </ul>
    <span>{entry_date format='%d %F %Y'}</span>
    </div>
</article>
{/exp:playa:parents}

```
> 0 votes

---
Tags: ee2, channel-entries, playa, pixelandtonic, conditionals
---


# Question
Title: SafeCracker problems... Playa Field inside a Matrix
I'm having trouble getting Safecracker to create the rows on a Matrix field. I've managed to get this to work IF the field is a 'Text Input' field.

But when the field is a Playa field, it doesn't create the row.

My code is (I'm pulling the data from a channel:entries loop):

```
{!-- Create New Row --}
<input type="hidden" name="member_courses[row_order][]" value="row_new_{exp:mx_calc expression="{count}-1"}">

{!-- Course ID / Name --}
<input type="hidden" name="member_courses[row_new_{exp:mx_calc expression="{count}-1"}][col_id_20]" value="[{entry_id}] [{url_title}] {title}">

```

I found that if you add this:

```
<input type="hidden" name="member_courses[selections][]" value="{entry_id}">

```

It should work, but it doesn't.

How can I get Safecracker to create an entry, that creates rows in a Matrix (But also creates the relationship)

# Answer
You need to set the Playa input name to this:

```
field_name[row_new_X][col_id_Y][selections][]

```

And the value should only be the entry ID.

So in your case I guess that would be:

```
<input type="hidden"
       name="member_courses[row_new_{exp:mx_calc expression="{count}-1"}][col_id_20][selections][]"
       value="{entry_id}">

```
> 1 votes

---
Tags: matrix, safecracker, playa, zoo-visitor
---


title: Alphabetise pre-populated select field

text:
# Question
Title: Alphabetise pre-populated select field
I have a channel where each entry has a field called "Brand". This coincides with an entry title in a different "brands" channel. The best way I've found to set this up is to use a select field type and use the populate feature to draw in these titles. That all works perfectly with one problem...

How do I get it to populate the field in alphabetical order? Currently it's in order of entry which isn't alphabetic and so it's making it hard to use.

# Answer
> 1 votes
Instead of using a select field type and pulling from another channel, you might try using a Relationships field. You can choose the field to order by and sort order as well. Then on your templates it also opens up more opportunity to more easily pull in additional info from other fields in your brands channel entries if needed.

---
Tags: ee2, fieldtype, sort
---


# Question
Title: Solspace's user add-on, allow for custom fields in the registration form?
The user add-on, does that allow us to set up custom fields to be used in the new member registration form?

Fields such as: twitter username, favorite color, etc?

Or is that something we can't do during the new member registration form and that would have to be done when the user edits their profile?

I know you can set custom fields for a user's profile, but I am wondering about custom fields in the registration form.

Thanks!

# Answer
Any custom member fields you create in the admin should be available for use as fields on the registration form: http://www.solspace.com/docs/user/register/#form\_fields . You can also use their select tag pair for custom fields:

```
<select name="your_custom_field">
{select_your_custom_field}
    <option value="{value}">{value}</option>
{/select_your_custom_field}
</select>

```
> 4 votes

---
Tags: solspace, solspace-user
---


# Question
Title: Replacing Wygwam p tag with h1 also adds an empty p
I have the following to strip out the p tags that are auto generated by Wygwam. For some reason it's not happening for me!

```
<h1>{exp:low_replace find="<p>"}{hero_article:articles_title}{/exp:low_replace}</h1>

```

This outputs an empty paragraph tag within the h1 tags.

Any idea why this might be? I've also tried `parse="outward"`.

# Answer
> 3 votes
You might want to remove the closing `</p>` as well:

```
{exp:low_replace find="<p>|</p>" multiple="yes"} ... {/exp:low_replace}

```

# Answer
> 0 votes
You'd be better off using Streeng in this way:

```
{exp:streeng allowed="h1" parse="inward"}<h1>{hero_article:articles_title}</h1>{/exp:streeng}

```

---
Tags: wygwam, low-replace
---


# Question
Title: Playa select not displaying content after upgrade EE1 to EE2
I've upgraded from EE1 to EE2 and downloaded the latest version of Playa for our project.

Upgrade seemed to go as planned as the admin is all cool and drop panes and selects display the correct data etc.

The drop panes fields display perfectly on the front end templates but for some reason the fields using selects do not display on the front end. The select is showing the correctly selected channel entry in the admin though which is strange.

The database is showing the following data in the field:

\[15278\] \[aquaforce-awards-2012\] Aquaforce Awards 2012

Which all seems good but my frontend template tags spit out nothing.

Cheers Jonny

# Answer
Perhaps you're still using the old, pre-2.0 Playa syntax - which was simply `{related_entries}` and `{reverse_related_entries}`?

Since 2.0, Playa has had its own template tags.
> 1 votes

---
Tags: playa
---


title: screen_name changes to id

text:
# Question
Title: screen_name changes to id
I am using the SolSpace user plugin and ran into a minor issue and hope someone can help.

I have an input field that users can change their screen name but when I go to change my screen name it removes my name and replaces it with an ID and not my new screen name (From Tony to 1) I used the sample code from the SolSpace site but just don't know why the screen name is deleted and replaced with an ID.

I know its a silly thing but just don't know what?! Thanks in advance for your help.

Regards, Tony

# Answer
Are you perhaps using the **Screen Name Override** feature? If so, your screen\_name field might be saved as something else based on the contents of the fields set for the **Screen Name Override**. For example, if your **Screen Name Override** setting is `first_name|last_name`, whatever you set for the screen\_name will be replaced by what is in fields `first_name` and `last_name`.

If this isn't the case, try the `{exp:user:edit}` form on a completely, absolutely blank EE template with nothing whatsoever on it besides the code. This is to rule out any effect of javascript/jQuery or other tags (native or third-party) on your form.
> 0 votes

---
Tags: solspace-user, solspace
---


# Question
Title: Using Solspace User extension, can I pass the email address of the user to the 'return' page?
In Expression Engine, I have 'Require Member Account Activation?' set to 'Manual activation by administrator', but I would like to send them an email on registration. I'm using Solspace User for registration ( exp:user:register ), and I was thinking the simplest solution would be to just send an email from the 'return' page. But they aren't logged in at that point, so I don't have their email address. Any ideas on a way to get the users email address on the Thank You return page?

# Answer
Unfortunately there are no options for the return="" parameter to carry over any data after someone has registered. A query of the exp\_members database for the latest email address entered is an approach, but on a popular site with many registration per second, you might inadvertently display the wrong email if someone else registered between sending your form and viewing the thank-you page.

However, in User's Preferences page (CP =\> Add-ons =\> Modules =\> User =\> Preferences), there is a **Welcome Email** setting where you can create an email notification message when registration is **complete**. The notification email can contain the `{email}` variable, among other variables. Of course, this email would be sent only after the administrator has activated the account.

(User version as of this writing: 3.4.4)
> 2 votes

---
Tags: solspace, solspace-user, registration
---


# Question
Title: Best ways of categorising/tagging properties of entries?
I'm setting up ExpressionEngine to list a variety of holidays. We'd like tickboxes to store "tags" about these entries.

For example, a holiday might have multiple departure months (e.g. it could depart in January, February, and April). It might have a certain duration (14 days, 7 days, etc.), or it might be seasonal (Summer/Winter/Spring/Christmas).

My holidays will be Channel Entries, so what's the best way to categorise this information within the channel entry, ideally so that it can be filtered and pulled through individually to entry pages at a later date?

* Should I create a Category (e.g. "Season") with Category Items (e.g. Summer/Winter/Fall)
* Should I create a Status (e.g. "Season"), with Statuses (e.g. Summer/Winter/Fall)
* Is there an Addon that would work best for this kind of thing?

Thanks,

Jack

# Answer
> 2 votes
It really depends on how you're going to filter the entries. Categories would work if you're going to rigidly filter by specific months, durations, and seasons (ex: output holidays that depart in January, or that are 14 days long). Just have one category group per filter type (Departure Months, Duration, Season).

However, if you need to filter based on a custom range (ex: output all holidays between Aug. 8 - Dec. 15), then you'll likely need a calendar add-on, like Solspace Calendar, that stores information in timestamp format and allows for recurring events.

# Answer
> 0 votes
I don't think you should use Statuses for this purpose, these are good to handle workflow related labels and they should be kept that way in my opinion.

I think that you can either use categories organised in category groups (ex:Season, Duration and Departure) or a mix of categories and perhaps Low events http://gotolow.com/addons/low-events, in which Low Events would handle the duration and departure. As kgrote said it depends on how you need to filter the entries.

---
Tags: add-on, channel-entries, categories, plugin, status
---


# Question
Title: Wes Baker's "Subscriber" works with Solspace' User?
I'm looking for a way to add via Solspace User to a mailchimp list and I found http://devot-ee.com/add-ons/subscriber and not sure if it works. Wes told me he hasn't tried. Any ideas?

# Answer
I have never used Subscriber with Solspace User, so can't really give a final answer, but keep in mind that User stores EE member data the same way and in the same place as the native EE Member Module does. If subscriber works with the native EE Member Module, then chances are it would work with User as well.

If you're tying to simply display a member's name and email address in the "name" and "email" address of the Subscriber form, then I assume User would work here. In fact, even native EE tools can be used to get a user's name and email if that's the only purpose. :)
> 1 votes

---
Tags: solspace
---


# Question
Title: SafeCracker Calendar (Solspace) Entry - Limit Shown Calendars
We are utilizing Solspace Calendar, and are allowing Guests to post calendar events (that post as pending), but ONLY want them to be able to post to ONE of the available calendars (we have 4).

Currently the widget displays all 4 calendars...how can we limit to only show the single "Public Events" calendar within this SafeCracker form?

# Answer
Unfortunately the Calendar widget comes as-is, and there is no setting for limiting which Calendar can be used. Calendar does a number of other processes to register the event when selecting a dropdown option. However, with some javascript/jQuery (and perhaps CSS), you could create a script that pre-selects a calendar and hides the dropdown.

The following small jQuery script is an example of a script that would select a calendar\_id (ID 9 in this case), then hide the dropdown. Don’t forget to change the `val()` value to the calendar\_id you want selected.

```
<script>
$(document).ready(function () {
   $('[name="calendar_calendar_id"]').val('9').change().hide();
   $('div#calendar_calendars').next("div").show();
});
</script>

```

The hide() function will hide your dropdown after selecting a value.

Old Solspace Forums reference: http://www.solspace.com/forums/viewthread/12433/
> 1 votes

---
Tags: safecracker, solspace, solspace-calendar
---


# Question
Title: Listing Page pullling in latest article for every article
I have created a listing page and each time a new entry is created the information is pulled in correctly in the loop. Although when I click on the link for a specific blog article it always displays the latest articles info, regardless of what blog article I click. The URL is always correct, although the content that is being displayed is wrong. You can see here for yourself here: http://www.neilmct.com/updates

Can anyone help me please? I'm having a melt down here.

Listing Page:

```
            {exp:channel:entries channel="updates" dynamic="no" limit="5" dynamic="off" status="open" disable="categories|category_fields|member_data|pagination"}
                <div class="nine columns">
                        <h3>
                            {title}
                        </h3>
                        <img src="{updates_image}" alt="{title}" width="300" height="200"
                        class="updates-bleep">
                        {exp:eehive_hacksaw chars="540" append="…" allow=""}
                            <p class="article-excerpt" style="color: #000; display: inline">{updates_excerpt}</p>
                        {/exp:eehive_hacksaw}
                        <a href="{page_url}" style="display: block">
                            <button> READ MORE
                                <img src="/assets/images/button-white.png" style="float:right"/>
                            </button>
                        </a>
                    </article>
                </div>
            {/exp:channel:entries}

```

Detail Page:

```
            {exp:channel:entries channel="updates" dynamic="no" limit="1" dynamic="off" status="open" disable="categories|category_fields|member_data|pagination"}
                <div class="nine columns">
                    <article class="box-services-updates alpha">
                        <h3>
                            {title}
                        </h3>
                        <img src="{updates_image}" alt="{title}">
                            <p class="article-article">{updates_article}
                            </p>
                    </article>
                    <a class="updates-back" href="/updates"> « Back </a>
                </div>
            {/exp:channel:entries}

```

# Answer
On your detail page, assuming the content is triggered off the URL?

If so, you need to have dynamic="yes" to affect the channel entries tag:

```
{exp:channel:entries channel="updates" dynamic="yes" limit="1" status="open" disable="categories|category_fields|member_data|pagination"}

```

Note too that you have both dynamic="off" and dynamic="no" in there. On your detail page, try removing both of those, and replace with dynamic="yes"
> 1 votes

---
Tags: listing
---


title: Primary Category '$' bug?

text:
# Question
Title: Primary Category '$' bug?
I've just updated my version of Primary Category from Solspace from version 2.0.2 to 2.2.1 in my EE 2.5.2 install and run into what I think is a bug. A BIG change in the update is that you now need to wrap your primary category variables inside a `{primary_categories}` tag pair inside the channel entries tag (in the past you could just use the primary category variables inside channel entries without the wrapper). So I updated my templates, but when I put in the wrapper tags I had some channel entries that suddenly were displaying duplicate and broken content. After investigating I found the common thread for the broken entries was that they had channel field content that contained the '$' symbol. So for example a reference to a price, like $1,099.00, in the title or body. This appears to be a bug in Primary Category.

Has anyone run across this same issue and if so do you have a fix or work around?

Thanks.

# Answer
This obviously needs to be tested, but I was able to find this article and employing the solution it offered seems to work:

http://www.procata.com/blog/archives/2005/11/13/two-preg\_replace-escaping-gotchas/

The issue is that the '$' has significance in the preg\_replace replacement pattern so the $1 in the $1,099 becomes a back reference.

Just before line 1198 in the `ext.primary_category.php` file I added this line:

`$tag_pair_data = preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', $tag_pair_data);`

This seems to have resolved the bug for me. I've forwarded my findings to Solspace and I am posting this here just for completeness. Personally I would wait for an official fix from Solspace, but if you're brave (or desperate) you might try this.
> 0 votes

# Answer
This indeed appears to be an (odd) bug in Primary Category, which is reported. This seems to affect only dollar signs followed by numbers only (i.e. `$hello` gets parsed correctly, but not `$123`, which outputs `3`).

One workaround I found was to avoid having the dollar sign followed immediately by a number. Adding a space between the $ and number seems to prevent the odd parsing.

Eg. Change `$1,009.00` to `$ 1,009.00` (please note the space).
> 0 votes

---
Tags: add-on, channel-entries, categories, solspace
---


# Question
Title: Backslashes added to templates, login not working
About a week ago, one of our sites started acting very strangely. For some reason, ExpressionEngine has started adding backslashes to all the quotes in the templates. For example:

```
<section id=\"main\">

        <!-- ABOUT SECTION SIDE NAV -->
        <nav id=\"sub_nav\">
            <ul>
                <li><a class=\"scroll ir\" href=\"#/about/overview\">Overview</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/design-excellence\">Design Excellence</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/rare-abilities\">Rare Abilities</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/relationships\">Relationships</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/testimonials\">Testimonials</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/our-partners-clients\">Our Partners & Clients</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/leadership\">Leadership</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/community\">Community</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/latest-news\">Latest News</a></li>
                <li><a class=\"scroll ir\" href=\"#/about/interested\">Interested?</a></li>
            </ul>
        </nav>

```

Notice all the backslashes (this sample is all static code in the template, BTW). In the actual template file... no backslashes. Also, EE won't load in embedded templates. I assume that is because it is adding the backslash to the template path as well and can't find them. I can't for the life of me figure out why.

In addition, we are not able to access the Admin through ANY of our logins. No matter what we use, it says that the login is incorrect. I have even "successfully" reset the passwords through the "forgot your password" function, but even the reset logins don't work.

Our client did have access to the admin, so my guess is that they added something somewhere that is causing the problem (they swear they didn't, of course). The site has been running fine for months until just a few days ago.

I found someone else online that had a similar issue, but it was due to the word censor going haywire (see http://ellislab.com/forums/viewthread/190206/). They were able to turn it off then back on in the Admin and the problem went away. Even though the symptoms are similar, I don't think that's the issue here. We aren't able to access the Admin to change the settings, and I commented out the word censor function in EE and it still added the slashes.

If anyone has any ideas on what is happening, I'd greatly appreciate the help. I'm at my wits end. Thanks!

# Answer
Well.... You were right, Adam. Apparently the host switched on Magic Quotes. Not sure why, but they did. I disabled it in the php.ini file and the site is back to normal. NEVER thought of that. Thanks for your quick response!
> 2 votes

---
Tags: templates, parsing
---


# Question
Title: Can other member groups register members?
I have a member group for a client and I want to give them access to manage and register members.

Settings:

**Control Panel Access** Can access MEMBERS section: YES

**Control Panel Administration** Can administrate members accounts YES
Can change the group that a member is assigned to (Unlocked groups only) YES
Can administrate member profile templates YES
Can delete members YES

They seem to be able to manage existing users, but get this error when they try and register a member "You do not have the required permissions to add new members to any group." Any ideas?

# Answer
> 1 votes
Ah, found it...Enable Group Security Lock...first time I had to even mess with that.

---
Tags: members, member-management
---


# Question
Title: What's the best way to setup one-off pages in EE?
Each section of this site uses single entries as pages. So in the ABOUT US section, each page under ABOUT US is an entry in the about-us channel. Same for other main sections of the site. The client also needs one-off pages that are not in any of these sections. I've never used the Pages module because I've heard it's crap since I started using EE so I'm not sure if that is an option or not. I've used Structure before, but this site is too far along to install that. What's the best way to set this up so it's easy to do for the client?

# Answer
> 1 votes
I use the Pages module extensively for standalone pages. I usually create a "Standalone Web Pages" channel to hold these.

I'd create multiple different channels if I needed significantly different fields on different pages, and/or different categories or statuses. But, otherwise, one channel is fine.

The main human thing with using EE Pages is that you need content editors to enter the Page URI, rather than the URL title. I hide the URL title entry field on channels where I want a Page URI, and move the Page URI field where I'd otherwise put the URL Title.

(Also, you need content editors to choose good Page URIs--if that's a big risk, then this might not work.)

So, what's wrong with EE Pages, imho? Not much, really--but:

* if you list links to pages programmatically (e.g., Search module), you need to switch between {page\_uri} and {url\_title} depending on which is relevant to the specific entry
* if you ever want to run queries on the Pages in the database, you might need to go through an arcane process of extracting Page URIs via PHP, since they're stored in a seriously fugly manner in the database (they're all serialized into a single row/field in exp\_sites!)

Otherwise, I find EE Pages sufficiently convenient for all standalone page content.

---
Tags: pages
---


# Question
Title: Changing the default page from Pages module
I am still learning Expression Engine so please forgive any misunderstanding or ignorance that I might have. I am using the Pages module and I want to be able to set which page is the default page for the whole site regardless of which template is used. Is this possible? If I need to elaborate upon any details please inform me.

# Answer
> 3 votes
You can't do that from the Pages module. You can set the default template, and then, in that template, call a specific entry by entry\_id.

This is an example of what I typically do in the default template (site home page)--e.g., site/index:

```
{exp:channel:entries
    entry_id="1"
    channel="home_page"
    disable="member_data|trackbacks|pagination|categories"
    limit="1"
    dynamic="no"
}

... your template and page content...

{/exp:channel:entries}

```

So, the template is pulling in a single entry's content. And, it's not using the Page URI at all on the entry with entry\_id = 1.

Would that work for you? It's not exactly what you described, but you *can't* literally set a default Page for the site.

---
Tags: templates, module, pages
---


# Question
Title: author_only="yes" shows edit form, but wont allow save, error "safecracker_author_only"
I have a strange issue I can't find reference to anywhere on Google!

The following code allows me to display a Safecracker form to edit an entry. When I click save I get the error below.

```
{exp:safecracker
    channel="member_news"
    return="members/profile#tab3"
    author_only="yes"
    form_class="uniform"
    error_handling="inline"
    entry_id="{segment_4}"
}

    <p>
        <label for="title">Title</label>
        <input name="title" type="text" value="{title}">
    <p>

    <p>
        <label for="title">Summary</label>
        {field:member_news_summary}
    <p>

    <p>
        <label for="title">Content</label>
        {field:member_news_content}
    <p>

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

{/exp:safecracker}

```

This is the error:

```
The form you submitted contained the following errors

safecracker_author_only

```

I find this strange because I am the author of the entry, it wont even show the edit form to other entries I am not the author of, so author\_only="yes" seems to be working with that respect. But clicking save its as if it then thinks I am not the author.

Removing author\_only="yes" will allow me to edit AND save, any form, which is obviously bad.

So I am not sure what the issue is. Using v 2.6.1

# Answer
> 1 votes
Your code looks right. Trust me, author\_only does work. First rule out the obvious: In your safecracker form, output {author\_id} and {member\_id} and make sure they match. Second, suggest checking member group settings that you can edit entry

# Answer
> 0 votes
Ok, I've been able to replicate the same issue in my setup up and solved it with a plugin as follows:

```
{exp:yak_bus:grant_access url_title = "{segment_3}"}{if response == "no"}{redirect="access/not_authorised"}{/if}{/exp:yak_bus:grant_access}

public function grant_access ()
{
    $url_title = (ee()->TMPL->fetch_param('url_title') != '') ? ee()->db->escape_str(ee()->TMPL->fetch_param('url_title')) : FALSE;

    if ( ! $url_title) return;

    $query = ee()->db->query("SELECT url_title, author_id
        FROM exp_channel_titles
        WHERE url_title = '" .$url_title . "'");

    if ($query->num_rows == 0 )
    {
        // not a valid url - so could be another page within mybusiness, thats ok
        return;
    }

    if ($query->row('author_id') != ee()->session->userdata('member_id'))
    {
        $vars = array('response' => 'no');
        return $this->return_data = ee()->TMPL->parse_variables_row(ee()->TMPL->tagdata, $vars);
    }

    return;
}
```

And if you need a start with a plugin pkg,io

---
Tags: safecracker
---


title: {exp:stash:prepend_list) not working

text:
# Question
Title: {exp:stash:prepend_list) not working
Based on the documentation for stash list, there are 2 ways to specify lists.

One is to use `{exp:stash:append_list}` or `{exp:stash:prepend_list}`.

The other is to use `{exp:stash:set_list}`.

I am using #1 because I need to list the items in reverse order.

```
{exp:low_replace find="\r|\n|\t" replace="" regex="yes"}
    {exp:messages:foo
        limit="10"
        paginate="bottom"
        sort="desc"
    }
        {exp:stash:prepend name="test"}
            {stash:message}<section>{message}</section>{/stash:message}
        {/exp:stash:prepend}
    {/exp:messages:foo}

    {exp:stash:get_list name="test"}
        {message}
    {/exp:stash:get_list}
{/exp:low_replace}

```

The above doesn't work. Is it because I am using wrong tag to retrieve the list? Is prepend working at all?

UPDATE:

Apparently, I need to use `{exp:stash:prepend_list}` so I amended the code and tested it.

```
{exp:low_replace find="\r|\n|\t" replace="" regex="yes"}
    {exp:messages:foo
        limit="10"
        paginate="bottom"
        sort="desc"
    }
        {exp:stash:prepend_list name="test"}
            {stash:message}<section>{message}</section>{/stash:message}
        {/exp:stash:prepend_list}
    {/exp:messages:foo}

    {exp:stash:get_list name="test"}
        {message}
    {/exp:stash:get_list}
{/exp:low_replace}

```

Still, I get no results.

# Answer
Your original code can't work because of parse order. Tag pairs are not parsed procedurally as you assume.

Module tags are parsed from the outer layer inwards - like peeling an onion. Plugin tags (the low\_replace tag in this instance) are parsed in the opposite direction (unless parse="inward").

In your code therefore the get\_list (layer 2) occurs before you have captured the list (layer 3).

You can solve this in several ways.

Set the list on the same parse layer as where you get it, using stash's ability to parse the tags it contains:

```
{exp:low_replace find="\r|\n|\t" replace="" regex="yes"}
    {exp:stash:set_list name="test" parse_tags="yes"}
        {exp:messages:foo
            limit="10"
            paginate="bottom"
            sort="desc"
        }
            {stash:message}<section>{message}</section>{/stash:message}
        {/exp:messages:foo}
    {/exp:stash:set_list}

    {exp:stash:get_list name="test"}
        {message}
    {/exp:stash:get_list}
{/exp:low_replace}

```

Or move the get\_list to the end of template parsing. You'll need to get Stash to parse the low\_replace tag too since EE has finished tag parsing by that point.

```
{exp:messages:foo
    limit="10"
    paginate="bottom"
    sort="desc"
}
    {exp:stash:prepend_list name="test"}
        {stash:message}<section>{message}</section>{/stash:message}
    {/exp:stash:prepend_list}
{/exp:messages:foo}

{exp:stash:get_list name="test" process="end" parse_tags="yes"}
    {exp:low_replace find="\r|\n|\t" replace="" regex="yes"}
            {message}
    {/exp:low_replace}
{/exp:stash:get_list}

```
> 3 votes

# Answer
I think your code has the wrong Stash tag--it's using "prepend," but needs "prepend\_list:

```
{exp:stash:prepend_list name="test"}
    {stash:message}<section>{message}</section>{/stash:message}
{/exp:stash:prepend_list}

```

Does that fix it?

**Updated:**

Try this (moving the stash tag outside of your messages tag), instead:

```
{exp:stash:prepend_list name="test"}
   {exp:messages:foo
      limit="10"
      paginate="bottom"
      sort="desc"
    }
        {stash:message}<section>{message}</section>{/stash:message}
    {/exp:messages:foo}
{/exp:stash:prepend_list}

```
> 0 votes

# Answer
Mark croxton has responded to your issue. He's the author of stash. Read his post. Read the documentation for stash. Your issue is parse order.
> 0 votes

---
Tags: stash, list
---


title: Expresso Store iDEAL update status?

text:
# Question
Title: Expresso Store iDEAL update status?
I was wondering if anybody knows what the status is on Store updating the iDEAL payment method. Is it gonna be updated to the new version of iDEAL in the next version of Store? Is there a release date already?

Any information will be helpull.

Thanks in advance.

# Answer
> 1 votes
For these type of questions it is usually best to email support@exp-resso.com.

Having said that a new version of Store is currently under active development which will support iDEAL v3 but I do not have an estimated release date. You should be able to contact iDEAL about having v2 implemented for your account which will allow you to use it with the currently released version of Store (1.6.4).

---
Tags: expresso-store, payment-gateway
---


# Question
Title: are reverse relationships still possible in 2.6.1
There are several portions of my site that rely upon self referencing relationships, that are (or rather were) gathered through the reverse\_related\_entries tag pair.

Quick example:

I have a channel for press releases. One of the attributes of that channel is a relationship called translations, which points to its own channel, press releases.

When a PR is entered it is usually in English only. Often though, there will be other translations of that same PR, so when they go into the system, the relationship attribute is used to “point” to the origin press release. Then in a template where the origin press release is being shown, I used a reverse\_related\_entries pair to loop through and show me all the other language press releases that pointed to “this” one.

Well, I’ve just upgraded to 2.6.x from 2.5.x and all my templates which used relationships in any way are now broken, because there is no backwards compatibility here. Sucks big time, but what can ya do…

The problem is, as sexy as the re-designed relationship functionality looks to be at first glance, I cannot for the life of me figure out how to reproduce what I was doing before. Everything seems to rely on being inside of a exp:channel:entries call where the channel in question has clear relationships downward to children. It’s a bit confusing.

Given the scenario I’ve described above, is there anybody alive who can tell me how to duplicate the reverse\_related\_entries functionality in the new format?

I’m truly desperate here and any help is hugely appreciated.

Andy

# Answer
> 3 votes
I think the `{parents}` tag is what you're looking for. Where other articles are essentially "pointing" to this one, you should be able to do something like:

```
<h2>Also available in:</h2>
<ul>
{parents field="original_article_relationship_field_name"}
    <li><a href="{parents:url_title}">{parents:language}</a></li>
{/parents}
</ul>

```

The nearest example in the EE documentation is The Pizza Shop

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


# Question
Title: How to remove "index.php" from Transcribe's language prefix
I am using Transcribe add-on which does a good job in managing a multi lingual site. I would like to take advantage of the option to include the language abbreviation as a prefix on the url but having problems with producing a "clean" url for pages with language prefix.

For example, with the language prefix switched on ("es" for Spanish), the system generates these types of urls domain-name.com/index.php/es/page-name instead of domain-name.com/page-name. I would like to use the prefix without the "index.php" that preceeds it but not sure how to.

I already have the normal bit of htaccess code that removes "index.php" from tempalte groups.

Thanks

# Answer
> 2 votes
I think I got it to work:

With the add-on language prefix option turned on, the add-on prefixes urls with “index.php/es” like this http://domain-name.com/index.php/es, http://domain-name.com/index.php/es/page-name, etc. I created a new template group called “es” and it seems the existing htaccess code that removes “index.php” from templates groups has dealt with it. So now these links with just the language prefix work http://domain-name.com/es and http://domain-name.com/es/page-name.

---
Tags: multi-language, transcribe
---


# Question
Title: changing the assigned template to Structure listing
Have inherited an EE build that uses Structure and has a handful of channels.

There is 1 'page' type and 4 'listings'. Unfortunately, the dev has decided to use 1 template for the single entry views of each.

Does anyone know how I can modify the template being used for each of the entries (1000s) in a given channel?

I know there's this script but that changes the template for everything http://buildwithstructure.com/documentation/how\_can\_i\_batch\_update\_templates\_for\_existing\_entries/

It seems that Structure stores the template against the entry in a base64 encoded field (site\_pages) inside exp\_sites but can't see any way to change.

# Answer
Give this script a try to edit the templates: http://buildwithstructure.com/documentation/how\_can\_i\_batch\_update\_templates\_for\_existing\_entries/
> 1 votes

# Answer
Couldn't you modify the provided script to make it do what you want?

The script already takes the serialized data and changes template X to Y. What you want is X changed to something else depending on the listing channel. After looking at the script there's few ways to go about it.

1) Get all entry IDs for a specific listing channel and use that to determine which templates get switched.

2) If listing channels have a base URL segment (such as news, products, staff) you could use that to determine which templates get switched.

Structure maps entry ids to template ids. All it should take is few IF conditions to accomplish what you want.
> 0 votes

---
Tags: php, structure, mysql, template-scripting
---


# Question
Title: Multilangauge Solution that doesn't require using segments
I have looked at Multi Language Module and Multi Language Support add-ons as solutions for multi language support.

However, both of them require adding a segment in the url/ Something like

```
http://domain.com/en/page
http://domain.com/fr/page

```

Now, I really don't like this because it would break pages which rely on how segments are placed. For example, if I expected `segment_3` to be X data in a page without the two-char language code in the url, adding the language code would break that page.

Are there other solutions/addons that don't need to do this? Maybe something like a global variable is set instead.

Or are there ways in the listed addons to circumvent this?

# Answer
The language code within the URL wouldn't break the URL segment for the pages. It would be same as http://yoursite.com/en/segment\_1/segment\_2/segment\_3

You can take a look at Multi Language Website with ExpressionEngine how a multilanguage website can be managed easily.
> 2 votes

# Answer
There aren't many solutions that don't require an addon. Here's how I did one recently http://digitalevangelist.net/blog/multi-lingual-expressionengine-practical and here's the one I've used that doesn't need an addon http://cwcrawley.co.uk/2010/01/multi-lingual-websites-in-expressionengine/
> 1 votes

# Answer
> Now, I really don't like this because it would break pages which rely on how segments are placed. For example, if I expected segment\_3 to be X data in a page without the two-char language code in the url, adding the language code would break that page.

Can't you just have a two character language code for each language, even the default one? This way your segment\_x variables would always be consisent, segment\_1 being the language, segment\_2 being the first data segment?

Or if you have everything else working beautifully, but your only problem is that default language starts data from segment\_1 and other languages from segment\_2 (seeing for them segment\_1 is the language variable) you could just replace the segment\_x with your own variables.

Basically in your index.php just write a simple IF statement checking if the user is browsing the default language or not and based on that, set segment\_x variables to your own variables, maintaining the same logic.

Default language:

* language = default
* part\_1 = segment\_1
* part\_2 = segment\_2

Other languages:

* language = segment\_1
* part\_1 = segment\_2
* part\_2 = segment\_3

This way you can use part\_1 in your templates and it becomes segment\_1 for default language, segment\_2 for others.
> 1 votes

# Answer
I developed a multi language website without add-ons. The technique I used is good both for subdomains as for different TLDs on the same server.

Take a look at my answer. I can explain again here, if you want to.
> 0 votes

---
Tags: multi-language
---


# Question
Title: EE 2.6.1. Combine relationships and related categories for editorial workflow
On our Single entry pages we recommend other articles. Four slots are available. channel: articles. channel fields: Content Elements field for the text and a native EE Relationship field called "related\_articles"

Here´s the editorial workflow: After writing the article an editor can select between 0 and 4 articles manually. The EE-field "related\_articles" will be used for that. All relationships are between entries of the same channel.

There are 4 slots to fill. EE will fill the empty slots automatically with articles from the same category.

An example: The editor wrote an article in the category A and manually added one related article. Then EE has to add three more category A articles to the mix.

This is my code for the editor´s picks:

```
{exp:channel:entries channel="article"}
    {related_articles}
       <p>{related_articles:title}</p>
    {/related_articles}
{/exp:channel:entries}

```

This is my code for the stuff, that EE adds automatically.

```
{exp:channel:entries channel='article'
    related_categories_mode='yes'
    custom_fields='yes'
    limit='{4 - count_of_editors_pick}'
    entry_id='not {the_IDs_from_editors_pick}'
}
  <p>{title}</p>
{/exp:channel:entries}

```

Both work well solo, but how do I combine them? I tried the math plugin plus the session variables plugin. I stored the {count} for the first loop in {rel\_art}, so I know, how many articles the editor added.

```
{exp:math formula='4 - [1]' params='{exp:session_variables:get name="rel_art"}'}

```

But it seems, that I run into a parse order issue here. I can´t use this to set the limit parameter within the channel entries tag.

**My questions**

1. How do I limit EE´s related categories loop so that it fills up the remaining slots?
2. How do I avoid entry dublications? EE should not add any entries choosen by the editor.

# Answer
Use Stash \- Here's how:

```
{!--  ============================================
STORE A LIST OF RELATED ARTICLES INTO A LIST
================================================== --}

{!-- first the manually chosen ones --}
{exp:stash:set_list name="rels" parse_tags="yes" trim="yes"}
    {exp:channel:entries channel="article"}
        {related_articles}
            {stash:the-title}{related_articles:title}{/stash:the-title}
        {/related_articles}
    {/exp:channel:entries}
{/exp:stash:set_list}

{!-- next append the automatically chosen ones to the same list. No need for more than 4 --}
{exp:channel:entries channel="article" related_categories_mode="yes" custom_fields="yes" limit="4"}
    {exp:stash:append_list name="rels" parse_tags="yes" trim="yes"}
        {stash:the-title}{title}{/stash:the-title}
    {/exp:stash:append_list}
{/exp:channel:entries}

{!--  ============================================
OUTPUT THE DATA
================================================== --}

{exp:stash:parse process="end"}
    <ul>
    {exp:stash:get_list name="rels" unique="yes" limit="4"}
        <li>{the-title}</li>
    {/exp:stash:get_list}
    </ul>
{/exp:stash:parse}

```

Unique="yes" will prevent any duplicates, and setting the chosen related articles before the automatically chosen ones will ensure that the former takes precedence over the latter.

If you're using a separate embedded template for your display output you won't need the stash:parse tag, but if you're getting and setting in the same template you'll need it here to avoid parse order headaches.
> 3 votes

---
Tags: relationships, variable, sessions, related-entries
---


# Question
Title: USPS International Shipping not working all the sudden
We did a site a while back and they have been shipping products all over the country as well as internationally.

They were able to ship something as recently as last month and now they are unable to get international shipping rates. It is saying "No Shipping Options Available".

I am using Brilliant Retail 1.0.2.5 and EE v2.1.3.

# Answer
Thanks to @litzinger on Twitter

USPS came out with an updated API on July 28th the upgraded BR install seems to have this fixed I am going to be looking into updating this for the client so if you absolutely have to stay on the old version of BR like I do let me know.
> 1 votes

---
Tags: ecommerce, brilliantretail
---


# Question
Title: Editing categories with Solspace Primary Category
We're using the Solspace Primary Category add-on for a site and was wondering if it is possible with this add-on to let users add/edit categories via the Categories tab when publishing an entry, as per the default categories behaviour?

# Answer
Sadly, no. It's an omission they're aware of, but for the moment it's not available.
> 1 votes

---
Tags: solspace, categories
---


# Question
Title: Can't Stash global and field errors in Safecracker form
I'm trying to capture in a variable Safecracker's global and field errors so I can display them outside of my Safecracker form. In my Safecracker form, I have the following:

```
{if global_errors:count > 0}
    {exp:stash:set
        name="global_errors"
        save="save"
        scope="user"
    }
        {global_errors}
            <p>{error}</p>
        {/global_errors}
    {/exp:stash:set}

    <h2>Global Errors</h2>
    <h2>{exp:stash:get name="global_errors"}</h2>
{/if}

{if field_errors:count > 0}
    {exp:stash:set
        name="field_errors"
        save="save"
        scope="user"
    }
        {field_errors}
            <p>{error}</p>
        {/field_errors}
    {/exp:stash:set}

    <h2>Field Errors</h2>
    <h2>{exp:stash:get name="field_errors"}</h2>
{/if}

```

At this point, it's not even able to access the variable value right after I set it. So, my guess I am setting this incorrectly. Any ideas what's going on?

# Answer
> 2 votes
When you save a variable with a specific scope (in this case, `scope="user"`) you should use the same scope when you get it.

However, if you're showing the errors within the same page request there's no need to actually save the variable at all.

It's possible in this case that the tag pairs `{global_errors}` and `{field_errors}` are removed from the template by Safecracker and then only output if there are errors. If that is the case you can capture them like this:

```
{field_errors}
    {exp:stash:append_list name="field_errors"}
        {stash:error}{error}{/stash:error}
    {/exp:stash:append_list}
{/field_errors}

```

And access them like this:

```
{exp:stash:get_list name="field_errors" process="end"}
    {if count == 1}<h2>Field Errors</h2>{/if}
    <p>{error}</p>
{/exp:stash:get_list}

```

# Answer
> 1 votes
Try adding process="end" to your get tags:

```
{exp:stash:get name="field_errors" process="end"}

```

# Answer
> 0 votes
Since the stash:set and stash:get are on the same parsing stage, the 15, the values aren't available yet when you're calling them.

If you really need stash, you should move the `stash:get` to an embed.

---
Tags: templates, stash, template-scripting
---


title: solspace freeform alternative

text:
# Question
Title: solspace freeform alternative
I just installed Freeform 4.0.12 and it seems to be completely broken I cant edit or create forms fields or notifications. If I try to create a form there inst a submit button.

If I try to create a field or notification this text appears at the end on the cp page. "PHRhYmxlIGNsYXNzPSJtYWluVGFibGUgcGFkVGFibGUgZnJlZWZvcm1fdGFibGUgaGVhZGxlc3MiIHN0eWxlPSJ3aWR0aDoxMDAlOyI+Cjx0Ym9keT4KPHRyPgo8dGQ+PGxhYmVsIGZvcj0iYWxsb3dlZF91cGxvYWRfY291bnQiPkFsbG93ZWQgdXBsb2FkIGNvdW50PC9sYWJlbD48ZGl2IGNsYXNzPSJzdWJ0ZXh0Ij5NYXhpbXVtIHF1YW50aXR5IG9mIGZpbGVz"

Is there an alternative to freeform for EE2 ?

# Answer
> 3 votes
It sounds as though you did not get all the files uploaded correctly. Try deleting the `/system/expressionengine/third_party/freeform` and `/themes/third_party/freeform` folders and upload them again from scratch.

What version of EE?

---
Tags: ee2, solspace-freeform
---


# Question
Title: EE 2.6.1 Relationships field options "Limit entries by status" does not work
I have entries with the statuses open and featured in my channel "articles". I configured my Relationships field "related\_articles" to show articles with "any" status. I use this code in my template (all entries belong to the same channel "articles")

```
{exp:channel:entries channel="article"}
         {related_articles}
        <p>{related_articles:title}</p>
         {/related_articles}
{/exp:channel:entries}

```

I expected to see all titles of all related articles but I got only the entries with the status "open".

I tried to explicitly choose the statuses "open" and "featured" or even only "featured" in the field settings page.

I added a status="open|featured" to the channel entries tag. The result was always the same: EE gave me the "open" entries. When I limited my entries to "featured" I got nothing.

I even added another custom status and tried to display those entries, but that didn´t work either.

I checked with PhPMyAdmin, but on the database-level all is fine. My entry has the parent\_id of 12 and the two articles I added as related have the child\_IDs 6 and 2. child\_ID 6 has the status "open" and will be shown in the template, child\_ID 2 has the status "featured" and will not be shown in the template.

Since the Relationships field defaults to "any" for all settings options I´m completly clueless, why EE shows this behaviour.

Does anybody know, where EE saves the Relationships-Field settings? At least it´s not exp\_fieldtypes in the database.

# Answer
> 6 votes
The "limit entries by status" setting for the Relationship field controls what entries are available to select in the control panel - *not* what entries will display in your templates.

So if you have the field set to "any status", and you've selected child entries with both "open" and "featured" statuses, then your tag will need an explicit `status` parameter:

```
{related_articles status="not closed"}
    <p>{related_articles:title}</p>
{/related_articles}

```

I know you mentioned you tried that, but maybe you added the `status` parameter to the `channel:entries` tag instead of the `related_articles` tag pair?

---
Tags: relationships, entries, filter, status
---


# Question
Title: Create Tag Cloud of tags related to the channel entries being displayed
Is there a way to create a tag cloud based on tags of channel entries be displayed using {exp:tag:entries}. In other words, tags related to the channel entries currently being displayed.

# Answer
You'll need PHP to create first a list of entry\_ids, which will then be fed to {exp:tag:tags}. Then, you will have to create a list of unique tags, which can also be done with a *PHP array*.

## Creating a list of entry\_ids based on a tag

First we'll need to create a list of entry\_ids to pass into {exp:tag:tags}. Set PHP to **Output**:

```
<?php $entry_ids = ""; ?>
{exp:tag:entries tag="mockups"}
  <?php $entry_ids .= '{entry_id}|'; ?> /* concatenates entry_ids */
{/exp:tag:entries}
<?php $entry_ids = rtrim($entry_ids, '|'); ?> /* removes last pipe character */

{embed="tag/cloud" entry_ids="<?php echo $entry_ids; ?>"}

```

## Creating a unique list of tags based on the entry\_ids

In your "tag/cloud" embed (the template\_group/template naming is up to you), create a unique list of tags using PHP and {exp:tag:tags}. A *PHP array* can be very useful to weed out duplicate data (not just here, but in many add-ons). Set PHP to **Output**:

```
<?php $tags = array(); ?>
{exp:tag:tags entry_id="{embed:entry_ids}"}
  <?php $tags['{tag_id}'] = '{tag}'; ?>
{/exp:tag:tags}

```

The above will result in an array with unique tags in it.

Of course, you can elaborate the above to contain more data, or even create tag hyperlinks directly as the array values.

## Display the tag "cloud"

Once the tag array is complete, you can use PHP to loop through each unique tag to display them:

```
<h3>Tags for these entries:</h3>
<?php foreach($tags as $tag_id => $tag_name) :?>
  <?php echo $tag_name; ?><br />
<?php endforeach ?>

```

A similar strategy might be possible using something like Stash, but this uses the available native EE tools.
> 2 votes

# Answer
I think you'll want to use {exp:tag:tags}.

From the example on that page:

```
{exp:tag:tags
   entry_id="{entry_id}"
   backspace="2"
   orderby="tag_name"
   sort="desc"
   limit="10"
}
   <a href="{path='articles/by_tag'}/tag/{websafe_tag}">{tag}</a>,
{/exp:tag:tags}

```

Does that handle what you need?
> 0 votes

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