title: Can't get Solspace Tag Entries to work

text:
# Question
Title: Can't get Solspace Tag Entries to work
So I'm developing a site using Solspace Tag. A little background... I have a site that displays tags in two places. One global cloud tag in the footer, and another in an entries detail page (tags associated with that specific entry). When a user clicks on a tag, they should be taken to a page that displays all entries with that particular tag. I've been trying to get the example from the documentation to work, but the page does not output anything. The only thing in the template is the following tag pair.

```
{exp:tag:entries
    inclusive="yes"
    orderby="entry_date"
    sort="asc"
    limit="20"
    paginate="bottom"
}
    <h2>{title}</h2>
    <p>{body}</p>
{tag_paginate}
    <p>Page {tag_current_page} of {tag_total_pages}. {tag_pagination_links}</p>
{/tag_paginate}

{/exp:tag:entries}

```

Do I need to wrap this in an entries tag as well?

```
{exp:channel:entries channel="news|reviews|etc"}{/exp:channel:entries}

```

What does work is {exp:tag:tag\_name}. I can output the tag name based on the URL.

Any help would be great!

# Answer
> 2 votes
I think I figured it out. For anyone interested, the global footer along with the tags in the detail pages uses the `websafe_separator="-"` parameter, while the tag entries page (page that user lands on after they click on a tag" did not have this parameter in it.

More information can be found in the docs here.

---
Tags: solspace-tag
---


# Question
Title: Cartthrob: Controlling tax on products using multi_add_to_cart_form
Hoping someone can help me with this...

We are using the **multi\_add\_to\_cart\_form** to create custom product packages. The site sells classes and the client is offering a class add-on that can be added to the cart when the class is added to the cart. Classes are in one channel, add-ons are in another channel. The add-ons are added to classes via Playa. This works great to create a nice class page with selectable add-ons.

Here's my dilemma - **classes are not taxable. The add-on products are.** How can I allow tax to be applied to the products, but not the classes when they are added to the cart??

If I use:

```
{exp:cartthrob:multi_add_to_cart_form
    tax_exempt="yes"
    shipping_exempt="yes"
    return="store/cart"
}

```

Nothing is taxed. And if I remove the tax\_exempt="yes", everything is taxed. Any way to work around this? Maybe a way to pass a tax variable via hidden field?

Looking forward to any suggestions! And I will buy you many beers! :-)

Thanks, Danielle

# Answer
> 1 votes
Have you tried the hidden input method?

\[ input type="hidden" name="tax\_exempt\[#\]" value="yes" \]

Would be interested to know if this works too.

---
Tags: cartthrob
---


# Question
Title: What is the difference between forceid and entry_id on a template?
I will delete this question if forceid is singular to the site I am dealing with but what is the difference between forceid and entry\_id if they both equal the same thing? I am also dealing with the Page module if that helps.

```
{embed="site/_head" forceid="18" weblogname="main"}
    {exp:weblog:entries weblog="site" show_pages="yes" rdf="off" disable="trackbacks" limit="1" entry_id="18"}
{embed="site/_foot" forceid = "18"}

```

# Answer
> 2 votes
Yes, forceid is specific to your site.

In the context of the {embed} tag, forceid is a user created variable--the same kind of thing as weblogname, in your example:

```
{embed="site/_head" forceid="18" weblogname="main"}

```

These become variables available in the embedded templates. E.g., in site/\_head, one can use {embed:forceid} and {embed:weblogname} variables whose values are set in the above {embed} tag.

---
Tags: entryid
---


title: Increment count in low_replace regex

text:
# Question
Title: Increment count in low_replace regex
I'm using Low Replace to allow users to add footnotes to the content of their entries. Anything wrapped in square brackets (like this: `[[This would become a footnote.]]`) will then be replaced with the appropriate markup on the front-end. Here is the code thus far:

```
{exp:low_replace find="SPACE\[\[(.*?)\]\]" replace="<span class=QUOTEfootnote-numberQUOTE>¹</span><span class=QUOTEfootnoteQUOTE><span class=QUOTEfootnote-numberQUOTE>¹</span> $1</span>" regex="yes"}
    {blog_post_content}
{/exp:low_replace}

```

There will often be multiple footnotes for one entry, so I need to be able to increment that `¹` with each footnote that's found. So, for example, if there were three footnotes they would be marked-up like this:

```
<span class="footnote"><span class="footnote-number">¹</span> Footnote content…</span>
<span class="footnote"><span class="footnote-number">²</span> Footnote content…</span>
<span class="footnote"><span class="footnote-number">³</span> Footnote content…</span>

```

How can I increment that number with each footnote?

# Answer
If you could include the footnote number in the note itself, I think that'd be available via back reference in the Low Replace tag.

So, if your footnotes were like this:

```
[[This is a footnote.#1]]
[[This is another footnote.#2]]

```

Then, I think you could do this in your Low Replace tag:

```
{exp:low_replace find="SPACE\[\[(.*?)(\#\d+)\]\]" replace="<span class=QUOTEfootnote-numberQUOTE>&sup$2;</span><span class=QUOTEfootnoteQUOTE><span class=QUOTEfootnote-numberQUOTE>&sup$2;</span> $1</span>" regex="yes"}
    {blog_post_content}
{/exp:low_replace}

```

But, if changing your footnote authoring style isn't possible / practical, I think you'd have to "post process" your footnote HTML to count notes, and insert the right count per note.
> 1 votes

---
Tags: low-replace, regex
---


# Question
Title: How to display a date if entry is only for one day only
I have an entry that has a date. If it starts and ends on the same day, it should only display the day. Like 'September 21, 2013'.

But right now, my code has it like this:

```
<strong>Date:</strong> {entry_date format='%F %j'}—{expiration_date format='%j'}, {expiration_date format='%Y'}<br />

```

Which pushes out September 21-21, 2013. Is there a way I can modify my code where it would show a single date if the event doesn't stretch over multiple days?

# Answer
Try this:

```
{entry_date format='%F %j'}{if "{entry_date format='%Y%m%d'}" != "{expiration_date format='%Y%m%d'}"}—{expiration_date format='%j'}{/if}, {expiration_date format='%Y'}

```
> 8 votes

# Answer
Might be overkill but another option would be something like Encaf's double date which I've found to be handy on a few projects.
> 1 votes

# Answer
Both entry\_date and expiration\_date are being stored as UNIX timestamp and also output the same if we don't pass the format parameter. So I think, there is no need to format the entry\_date and expiration\_date while comparison. It would be simple to write:

```
{entry_date format='%F %j'}{if entry_date != expiration_date}—{expiration_date format='%j'}{/if}, {expiration_date format='%Y'}

```
> 0 votes

---
Tags: date
---


title: Problem displaying data when sorting

text:
# Question
Title: Problem displaying data when sorting
I'm trying to output a custom field from a channel that stores a formatted date, which gets used for a jQuery datepicker.

I'm using the following code;

```
{exp:channel:entries channel="events" dynamic="no" orderby="url_title" sort="asc"}
["{event_date}"],
{/exp:channel:entries}

```

However, I've noticed a problem in that it won't output entries that have a date like 4-9-13. The {event\_date} custom field is a simple text field.

It seems to be fine for dates stored like; 1-8-13, 12-8-13, 24-8-13, 2-9-13, 3-9-13, 30-9-13 etc - but it just won't output any dates that start with a number 4, 5, 6, 7, 8 or 9.

I wondered if anyone knows a way around this?

Thank you.

# Answer
Turns out it was the silent limit of 100 from EE that was preventing them being displayed. So I just added a limit="200" to fix it.
> 1 votes

---
Tags: sort
---


# Question
Title: Freeform 4.0.12 ceate form button missing in firefox ie and chrome
Hi guys I just installed freeform and cant create a new form when I am inside the form window and click "new form". The form creation page where I enter the form details opens but there is no create or submit button visible to save my work. Is this only available with pro?

Surely someone else has seen this?

# Answer
> 0 votes
Sounds like you may need to reinstall the add-on's themes. You should see a "Save" button at the very bottom of the form creation form.

I can't vouch for EE (where I do sometimes encounter issues like this) but it works fine in Chrome.

Which versions of EE and IE are you using?

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


# Question
Title: Fixed number of displayed images with channel images inside entries loop
I was wondering if anyone has a decent trick to show 4 images in a row from multiple entries containing channel images. So the four newest channel-images no matter which entry they come from.

The problem is that I don't know how may images an entry will contain, since you can put any number of images in an entry.

codewise:

> ```
> {exp:channel:entries limit="4"}
>        {channel_images_field}
>        <img src="{image:url:large}" />
>        {/channel_images_field}
>  {/exp:channel:entries}
>
> ```

Will output any number of images, depending on the amount of images in the channel\_images\_field. It could be 3+2+5+7.

I could of course erase the rest using brute force js frontend or with css overflow:hidden, but I'd rather just parse 4 from the server.

EDIT

The complete tag is inside a category tag and contains another EE field, making it difficult to use the channel\_images tag outside the channel entries tag.

```
{exp:channel:categories channel="gallery"}
{exp:channel:entries channel="gallery" dynamic="no" category="{category_id}" limit="4"}
    {channel_images_field}
        <img src="{image:url:large}" />
        {comment_field_poster}
    {/channel_images_field}
{/exp:channel:entries}
{/exp:channel:categories}

```

I suppose that makes it impossible to really solve it due to nesting issues. It's either all images from a channel, agnostic to the related entries, or the images inside a specified entry tag, agnostic to the channel\_images total.

See it live here: http://www.fotografielessen.nl/index.php/Fotoalbum/ (now showing the first four entries with all the images, sorted by category)

# Answer
> 2 votes
The docs seem to suggest you can use the `{exp:channel_images:images}` tag outside of the `channel:entries` loop. Have you tried that? So adding the channel, category, limit, orderby and sort parameters.

```
{exp:channel_images:images channel="<your-channel>" category="<your-category(s)>" limit="4" orderby="upload_date" sort="desc"}
    <!-- Template Code -->
{/exp:channel_images:images}

```

**EDIT**: Failing that, you could always use a separate `channel:entries` loop for the images and limit that to 4 entries making sure you've ordered it by entry date. Then within that limit your channel\_entries loop to 1 image. This assumes you will always have 1 or more images per channel.

So for your example:

```
{exp:channel:entries orderby="date" sort="desc" limit="4"}
       {channel_images_field limit="1"}
       <img src="{image:url:large}" />
       {/channel_images_field}
 {/exp:channel:entries}

```

# Answer
> 1 votes
To get the most recent 4 images from a channel simply do:

```
{exp:channel_images:images channel="gallery" limit="4"}
<img src="{image:url}" alt="{image:title}">
{/exp:channel_images:images}

```

Brad

# Answer
> 0 votes
```
{exp:channel:entries channel="channel_name" limit="10"}
        {exp:channel_images:images entry_id="{entry_id}" prefix="nested" limit="4"}
        {/exp:channel_images:images}
{/exp:channel:entries}
```

Try that. Basic stuff. Read the docs on channel images.

---
Tags: channel-images
---


title: Writing markup outside of entries' loop

text:
# Question
Title: Writing markup outside of entries' loop
I was wondering how to properly call information from a channel but outside of the loop, so it doesn't repeat along with the entries. The output would look something like this:

```
<div id="entries" class="row">
  <div class="module">Entry 1</div> // These modules go inside loop
  <div class="module">Entry 2</div>
  <div class="module">Entry 3</div>
</div>
<div id="meta" class="row">
  <div class="aside">Content Related to channel</div> // Outside of loop
</div>

```

In the ee template I want to wrap all that in a single `{exp}` tag. I feel like that would be more efficient, in terms of code and server resources. Is that the right approach? If so how do I make the `#meta` element not repeat with the loop?

Or is the correct approach to have 2 `{exp}` sections, one for the loop and one for the other part, and wouldn't this be inefficient at some point?

Thanks in advance!

# Answer
> 1 votes
The EE way is to do multiple exp:channel tags and pull out the relevant info. It's no big thing if you're site has average hits per day or you're not querying 1000 items.

The 'new' way involves Stash which you basically set a series of variables to the fields you want to record in one pass of exp:channel tags then output those variables wherever you like but this question indicates you're fairly new to EE so best get familiar with the way EE works and move on to some more advanced functionality once your familiar with it.

# Answer
> 3 votes
You could wrap the meta data inside a conditional matching the count of 1 like so:

```
{exp:channel:entries
  limit="10"
  channel="page"
  dynamic="no"
}

  <div class="module">{title}</div>

  {if count == "1"}
  <div id="meta" class="row">
    <div class="aside">Content Related to channel</div> // Outside of loop
  </div>
  {/if}

{/exp:channel:entries}

```

Does that help?

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


# Question
Title: Sharing an entry on two pages in Structure
I have a head-scratcher here.

I’m working on a site that I'm building with Structure where I have at least 50 services that the client would like to promote in two different sections. I'm trying to conceptualize a possible way to have each service as a single entry and associated with two different pages.

**Section 1**

1. Consulting
2. Economic Research
3. Training
4. Business Evaluation

**Section 2**

1. Training
2. Consulting
3. Economic Research
4. Business Evaluation

A few things to note:

1. I need to keep each service as a page in Structure because the client wants it in the navigation's mega menu.
2. The services will be arranged differently in each section - one alphabetically and the other in a random order of importance.

At this point the only solution I can think of is maintaining two identical entries for each service and was wondering if there were some plug-in that I'm not aware of that would allow me to do this within the confines of structure and a mega menu.

Any insight will be appreciated. Thanks!

# Answer
> 0 votes
I just ran across this issue, and used the instructions found here:

http://buildwithstructure.com/documentation/duplicate\_pages\_in\_navigation/

This allowed me to create one single navigation, with duplicate pages listed in what ever order the client specified in the Structure module.

# Answer
> 1 votes
Be a bit mad to have duplicate content, messy and the trying to keep both in sync would be a nightmare. You also want to consider duplicate content in the eyes of Google.

Your best bet would be to leave the content as is (only one copy), but have duplicate navigation. There are many ways to do this, one would be to have categories Section 1 and Section 2 in say a navigation category group. Then you can render out all the entries associated with each category to build the relevant navigation (and entries can reside in both navigations). The ordering can then be set to either alphabetically by title, or random.

Also with categories, if the client really, really, really wants to have two separate URLs to the same content (based on service route) and you can't convince them otherwise, you can use categories in the URL and then pull the url\_title from the last segment then use as channel:entries parameter and not use structure page\_uri or er, page 'structure'. So the same entry will be used for both URLs. This doesn't mean you don't use the Structure module, you're just not using the URLs that it's producing (or you only use their URLs for one of the sections and a category based URL for the other).

You don't need a category identifier in the URL either, just use segment\_1 that matches the template group. For example, in Structure have a parent that is "Services" which then has child entries for the 50 services. Then have either 2 template groups "section-one" and "section-two" which list out the relevant services (segment\_1 equals the template group), and then segment\_2 is used to pull the url\_title into the channel\_entries showing the details for the relevant service. Alternatively for more flexibility have 1 template group called "services" (segment\_1) and then use the category url for segment\_2, then segment\_3 would be your url\_title.

Remember to use dynamic="no" and url\_title="{segment\_3}" for the channel:entries parameters.

Alternatively look at Navee to generate the navigation.

If you really want to pursue duplicate content, the only plugin I'm aware of is Cloner, but that's just for copying it, and not sure how it will behave with Structure.

---
Tags: structure, navigation
---


# Question
Title: How to set "Admin Notify" preference based on form input value?
I have a {exp:freeform:form} in my template and would like to set the admin\_notify paramter based on value selected from a radio button or drop down.

Is this possible? I am building a simple form that needs to be send to the relevent person so the admin email address depends on the option selected..

Thanks

# Answer
I think you're looking for the freeform recipients tag pair, which allows the user to select from a list of possible delivery options.
> 1 votes

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


# Question
Title: Why is my Safecracker form only visible to super-admins?
I built a safecracker form to allow users to post events to a Solspace calendar, however, for some reason, the actual form is only showing on the page when a superuser is logged in. If anyone who is a regular member views the page, the form doesn't display. I've looked at the source and everything is there EXCEPT what would be between the form tags (or the `{exp:safecracker}` tags.

To be clear, the page itself is visible to the appropriate user groups. It's just the actual form that seems to be omitted if I attempt to view the page as a regular (logged in) user.

The reason for the safecracker form in the first place is because I found the Solspace calendar pre-fab form doesn't quite work... and if I'm logged in as superuser, the form I built works great! (which is making it that much more frustrating).

The form itself is quite simple, with the required fields set as hidden and some jquery magic to handle the formatting of the values.

```
  {exp:safecracker channel="calendar_events" return="home" include_jquery="no" safecracker_head="no"}

    <input type="hidden" name="calendar_id" value="23" />
    <input type="hidden" name="start_date[0]" id="startDate" value="" />
    <input type="hidden" name="end_date[0]" id="endDate" value="" />
    <input type="hidden" name="start_time[0]" id="startTime" value="" />
    <input type="hidden" name="end_time[0]" id="endTime" value="" />
    <input type="hidden" name="event_created_by" value="{member_id}" />

 ...

{/exp:safecracker}

```

# Answer
> 6 votes
Easy to forget, but make sure you give the member group you want to edit the safecracker form the ability to edit that channel in member group prefs. "Can post and edit entries in: \[your\_channel\_name\]" selected for that member group (Edit Member Group \> Channel Posting Privileges).

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


# Question
Title: Can I relate entries AND assign extra data to those entries with P&T Playa, Matrix, or anything else?
This is my first EE build. I'm building a system that allows users to create content entries to be displayed anywhere on the site and in various different display formats (eg: featured, compact, thumbnail etc.). One entry could appear on several different pages and look different depending what display type it was given for that page.

Here's what I have already set up:

* **Create entries in a "Content" channel with various fields like rich text, images, links etc.**

I know EE Relationships will do this:

* **Assign any number of those entries in any order to an entry in the "Pages" channel**

I NEED to do this:

* ***Associate a "Display Type" with each of those entries at the time of relating them to a page***

This would allow me to share those entries across the site, but separate their display types from the data without that being done in templates.

If a combination of Playa, Matrix, Low Variables or any other add-on will help, I'd love to know!

I have to get purchase orders every time I spend an tiny amount of money so it's difficult to purchase add-ons unless I really know I can use it. :(

Thanks!

Mat

# Answer
> 1 votes
If I understand your scenario correctly, you can do what you want using the combination of Matrix and Playa.

So, simplified scenario for a field in your Pages channel:

A **Matrix** field with two columns: **Display Type** and **Content**.

**Display Type** is whatever kind of field you'd like to use for setting type (e.g., a select drop-down).

**Content** is a **Playa** field with a relationship to the Content channel.

Does that match what you're asking? Happy to provide more details if you have questions about any of the nuances about this.

---
Tags: matrix, playa, pixelandtonic, relationships
---


# Question
Title: Is Matrix EE1 still available somewhere?
I would like to use the fieldframe FF Matrix Bulk/Multiple Upload. Is there any way I can acquire Matrix version 1.3.5 or newer so I can use the Bulk add on?

# Answer
> 6 votes
Pixel and Tonic obliged me with this request recently. Just purchase a license for Matrix, then email them to request the last available EE1-compatible version (I believe it's 2.5.3).

---
Tags: matrix, pixelandtonic, ee1, bulk
---


# Question
Title: can't upload pdf's with wygwam and file manager
I am getting "The filetype you are attempting to upload is not allowed." error when uploading pdf's with the file manager via wygwam.

The upload directory is writeable, has all field types allowed and xss filtering is turned off. I can upload other file types just fine.

I can upload pdf's when I use the file manager by itself (not via publish layout). I can also upload pdf's using the same upload directory and the rte field type.

I am running ee 2.6.1 and wygwam 3.1.2.

Cheers

# Answer
I think you are trying to upload using the image upload button. When you upload through the link button it might work. It's one of those things :-)
> 2 votes

---
Tags: wygwam
---


# Question
Title: Selecting images to represent category *combinations*
I have a challenge that I'm struggling to figure out a good solution for. I have a client that sells jewellery & gifts. They are categorised into brands and types, so I might have:

* Brand A Rings
* Brand A Pendants
* Brand B Rings
* Brand B Pendants
* Brand C Rings
* ... etc

They have brand pages where every relevant type is listed under each brand, and want to be able to select a representative image for each *brand type* (so, two combined categories):

* Brand A Rings \[manually selected image\]
* Brand A Pendants \[manually selected image\]
* Brand B Rings \[manually selected image\]

At the moment I've come up with a 'showcase' category so I look for products categorised as 'showcase', and then use them within the brand page. However, this isn't that satisfactory as it's a clunky process to add the category, and there's no management of old showcase products etc.

I'm trying to think of a more visual way to handle this that won't also introduce too much of a performance impact in terms of queries when I come to pull it all back together in the UI. Because I'm working with category combinations, I'm finding it quite tricky... I'm just wondering if anyone else out there has tackled a similar problem, or if there's a 3rd party add-on that I don't know about. I thought about Low Variables, or Channel Images, but I don't think either of them will help.

# Answer
I think you should use a status.

Set the status of products as "showcase" and add a fieldtype to its showcase photos.

Since you can't sort entries by status, you can use two `channel:entries` modules.

```
{exp:channel:entries channel="products" limit="1" status="showcase"}
    <div class="item">
    [...]
    </div>
    {embed="products/.list" showcase_product="not {entry_id}"}
    {if no_results}
    {embed="products/.list"}
    {/if}
{/exp:channel:entries}

```

And, on an embed:

```
{exp:channel:entries channel="products" limit="10" status="showcase|open" entry_id="{embed:showcase_product}"}
    <div class="item">
    [...]
    </div>
{/exp:channel:entries}

```

Of course, this way the showcase entry will be the first one on a list. You can just grab the first showcase item to change a background or a header and list your entries normally.

I set the status parameter on embed as both "open" and "showcase" in case the user forget to change some entry back to the open state.

You can use sticky\_entries too, but they can make some mess on other lists around the website.
> 1 votes

# Answer
Since you mentioned that the images are "manually selected," maybe it'd be effective to focus on making the manual selection process easier, rather than on the data mapping from brand + type to an image?

For example, could you have an entry in EE for each brand page, and within that entry, a Matrix field that allows the editor to select both the type name and a product image? Something like that would be easy and efficient to output on the brand page.

I like doing this kind of thing, because it makes all of the relationships very explicit and easy to "manually" manage. But, if you have a lot of things (types, images) and/or editors who need the content to be much easier to access, this might not work.

Another idea, that "pulls" images from the Product entries:

In the product entries themselves, add specific products to a category named "Representative" (and, if necessary, have a separate "representative image" field). Then, in your template, pull entries that match brand & type & representative. E.g.,:

```
category="3&7&8"

```

Might either of those approaches work for you?
> 0 votes

---
Tags: categories
---


# Question
Title: Wygwam 3.1.1 + GWCode syntaxhighlighter 1.0.0 - does this work for anybody?
I am trying to use GWCode syntaxhighlighter plugin with wygwam. I get the \[code\] icon in the toolbar, but then when I click it, I get a javascript error attempting to open the syntaxhighlight dialog box.

I suspect the problem is that wygwam updated to a newer version of ckeditor and left syntaxhighlighter behind.

(I asked this initially about wygwam 3.0.2, but update to 3.1.1 unfortunately changed nothing)

# Answer
Answer (with thanks to Brandon for helping me figure it out): no.

I did get it to work by updating GWCode Syntaxhighlighter plugin to the current version of the underlying ckeditor-syntaxhighlight plugin.
> 1 votes

---
Tags: wygwam
---


title: Syntax Highlighting in posts

text:
# Question
Title: Syntax Highlighting in posts
I'm trying to build a blog in ExpressionEngine that supports syntax highlighting in posts, so that snippets of code in the post will be displayed with line numbers, syntax highlighting, etc.

In WordPress you use the SyntaxHighlighter Evolved plugin to do this (http://wordpress.org/plugins/syntaxhighlighter/). You wrap the snippet of code to highlight in shortcodes, and the actual highlighting is done on the front end with javascript (http://alexgorbatchev.com/SyntaxHighlighter/).

In ExpressionEngine??? I thought I would do it the same way: wygwam uses CKEditor, and CKEditor has a plugin to generate the html that the javascript SyntaxHighlighter operates on. The problem I have is that I don't want to include the syntax highlighting javascript on every blog page, just on the ones that need it. How to identify them?

Or, is there some other way entirely I should be doing this?

# Answer
> 1 votes
I got this to work. Use:

And then everything works...

---
Tags: wygwam
---


title: Resetting Private Messages data

text:
# Question
Title: Resetting Private Messages data
Is there a painless way to reset messages their related data?

What I mean is to delete everything and clean up data and start with a clean slate, somewhat like what `TRUNCATE` does to a MySQL table.

The reason I want to do this is to remove some bad data deliberately injected because of testing.

Any ideas?

# Answer
> 3 votes
To clean up message data, you will need to TRUNCATE following database tables:

```
exp_message_attachments
exp_message_copies
exp_message_data

```

You can run following SQLs:

```
TRUNCATE exp_message_attachments;
TRUNCATE exp_message_copies;
TRUNCATE exp_message_data;

```

Also, EE stores number of private messages within exp\_members database table (column private\_messages). So you will need to run this SQL:

```
UPDATE exp_members SET private_messages = 0

```

Please take a backup of database to avoid any other data problem.

**Note**: Anyone can see my same answer here also.

---
Tags: messages
---


# Question
Title: Is it possible to access an Expression Engine module on a standalone URL, outside the EE template system?
I am developing a module that uses Paypal's IPN callback. So in my module code I need to put in the IPN URL.

But in EE the module is called using template tags, so it could be accessed by any URL that any EE developer decides to put the module on (the template group and name).

Is it possible to call the module without going through the EE template group and name? e.g. www.mydomain.co.uk/mymodule/paypalipn

I could probably still pass the IPN URL depending on what template we are on, but I am also only allowing logged in users to access this module, but the IPN should not be for logged in users. The login script is controlled in the template. I dont want to have to write conditionals in the template whether its the IPN method or not. Hope that makes sense!

Thanks

# Answer
Yes via ACTion URLs, tutorial here.

Basically in your install method (in your upd. file):

```
    //###   Create ACTion IDs for the relevant functions   ###
    $formActions = array(
        "YOUR-METHOD-NAME"
    );
    foreach ($formActions as $method) {
        $data = array(
            'class' => $this->class,
            'method' => $method
        );
        $this->EE->db->insert('actions', $data);
    }//###   End of foreach

```

This then creates Action ID that will trigger your modules method (in mod. file) - see exp\_actions table for other ACTion IDs for other modules.

Some modules display the ACT URL in the backend settings (e.g. for setting up a cronjob), others will have a frontend tag that will output the link, either way get the ACTion ID like so:

```
$actionID = $this->EE->functions->fetch_action_id(__CLASS__, 'YOUR-METHOD-NAME');

```

Typically a URL will look like this:

```
www.your-domain-name.com?ACT=45

```

Can also be done via POST data (so {site\_url} for the form action and hidden field for ACT value).
> 4 votes

---
Tags: module
---


title: Moving content to new installation

text:
# Question
Title: Moving content to new installation
Looking to clean up an EE-installation used for playing etc for some years now, and move relevant content (channels) into a complete new installation. Any thoughts on tools or methods for doing this?

The only "specials" used are Channel Images and Tagger from DevDemon. Both old and new sites will be MSM, but only main site to be exported.

Preferred workflow: Set up new EE-installation Install relevant plugins etc Create relavant channels etc --Import data from old site Change DNS to new site

Channels, Configs, Variables, Templates etc I'll do manually but it would be nice to be able to transfer content.

/patrick

# Answer
There are two steps here. First, getting the data out of the first install. And second, getting it back into the new one.

For exporting, there's a number of routes you can take. Since you're relying on some fieldtypes that use their own tables, the easiest route might be to create an XML template for each channel. That will allow you the flexibility to use the template parser to output those fields. A pretty simple `{exp:channel:entries}` tag pair will output all of the entries as XML nodes. (You could use JSON instead, but I've found that it's easier to output XML from a template.) I've also written custom scripts that run against the EE database to create the XML files. Obviously, that requires a bit more work to prepare the queries joining all the necessary tables and parsing the output.

For importing, I highly recommend Datagrab. It's very flexible with importing and works with a number of fieldtypes.

There is also Solspace Importer, but I don't have any experience with that tool.

One last tip: Make sure you create a field in each channel of the new site to hold the old entry ID. This will allow you to easily update all the entries you just imported if some of the data doesn't come through right. You can just configure Datagrab to match based off of the old ID, and it will know to update the entry instead of create a new on.
> 3 votes

---
Tags: multi-site-manager, channel-images, export
---


title: Freeform form:action killing freeform

text:
# Question
Title: Freeform form:action killing freeform
I am including a `form:action=""` parameter in my Freeform tag that runs a script. The script runs correctly, but the Freeform submission doesn't get saved to the database or emailed. Am I missing a step?

# Answer
> 0 votes
form:action must point to a page that runs the index.php. If you want to run an additional script, try using the form:onsubmit parameter. http://www.solspace.com/docs/freeform/form/#form\_attribute\_name

---
Tags: solspace-freeform
---


# Question
Title: Does Solspace’s Tag add-on not allow for tags with ampersands?
My company’s name has an ampersand in it, so you can imagine it appears quite frequently in tags. The tag displays correctly on the page, but clicking it always leads you to a page with no results. There should be some `urlencode` going on in the plugin to allow for things like this.

Is my only option to modify the Tag add-on myself to `urlencode` links and `urldecode` on the results page?

# Answer
> 1 votes
Are you using the {websafe\_tag} param to create your links? http://www.solspace.com/docs/tag/tags/#websafe\_tag

---
Tags: add-on, solspace, solspace-tag
---


# Question
Title: Conditionally display a field from a related entry if it's not empty (native relationships field)
I am using EE 2.6.1 with a relationship field. The two entries in the venue related entry (telephone and email) are not mandatory fields, so the way I would usually do it is wrap it in an if statement and only display if the field is populated. Like so:

```
<div class="contact-details">
            {if course-venue:telephone}<p>Telephone: {course-venue:telephone}</p>{/if}
            {if course-venue:venue-email}
                <p>Email: {encode="{course-venue:venue-email}" title="{course-venue:venue-email}"}</p>
            {/if}
        </div>

```

Problem is that EE's native relationships field doesn't seem to work this way, does anyone know how I can achieve the same result? This just displays nothing.

Thanks in advance!

# Answer
I hate to suggest it, but have you tried:

```
{if course-venue:telephone != ""}<p>Telephone: {course-venue:telephone}</p>{/if}

```

or alternatively

```
{if '{course-venue:telephone}' != ""}<p>Telephone: {course-venue:telephone}</p>{/if}

```

It seems like logically what you tried should work, but I've not used the new native relationship field to try something like this. You do of course have the chunk you included above wrapped in {course-venue} and {/course-venue}, right?

Does it return the right data without the conditional (i.e. for your other related custom fields in the related entry)?
> 2 votes

---
Tags: conditionals, relationships
---


title: Javascript array of custom Fields

text:
# Question
Title: Javascript array of custom Fields
I have a custom CSV field for coordinates {map\_coordinates} (e.g., "47.262223,-122.451725") and would like to loop through each entry and plot those coordinates onto a maps (using the Google Maps A:PI v3) as well as add listeners to each.

```
function initialize() {

  var map;

  /* this works. It gets the most recent entry and if you use a marker it plots it
     just fine. It's when dealing with multiple markers (vis., no 'limit' on returning
     entries) that it negates to plot anything and breaks (the map doesn't even show). */
  {exp:channel:entries channel="maps_channel" limit="1"}
    /* {map_coordinates} is the custom field */
    var mLatLng = new google.maps.LatLng({map_coordinates});
    map = new google.maps.Map(document.getElementById("map-canvas"), {
      center: mLatLng,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      zoom: 13
    });
  {/exp:channel:entries}

```

It's this lower section ( the one to plot all of the coords for the map) that I'm having trouble with. Ideally the upper and lower section should be integrated, but for the time-being I'm just trying to get it to work :p

```
  /* Create an array with the size of the total entries in the channel */
  var articles = new Array({total_results});
  var marker, i;

  /* add markers for each article
     add listeners for each article */

  for (i = 0; i < articles.length; i++) {
    marker = new google.maps.Marker({
      /* get the {map_coordinates} at the current
         index 'i' and plot them with a new marker.
         the code 'position: articles[i]{map_coordinates} doesn't
          work and I didn't expect it to; I'm including it to show
          exactly what I need done.*/
      position: articles[i]{map_coordinates},
      map: map
    });
  }
}

```

As you would be well to assume I am new to EE and somewhat new to JS.

I've been using the following resources to try and remedy this:

http://net.tutsplus.com/tutorials/cmss/creating-a-google-map-with-expressionengine/

https://stackoverflow.com/questions/3059044/google-maps-js-api-v3-simple-multiple-marker-example

# Answer
> 2 votes
Try This...

```
function initialize() {
  var map, marker, pos;
  {exp:channel:entries channel="maps_channel"}
    {if count == 1}
      var mLatLng = new google.maps.LatLng({map_coordinates});
      map = new google.maps.Map(document.getElementById("map-canvas"), {
        center: mLatLng,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        zoom: 13
      });
    {/if}

    pos = new google.maps.LatLng({map_coordinates});
    marker = new google.maps.Marker({
        position: pos,
        title: "{title}",
        map: map
    });
  {/exp:channel:entries}
}

```

Note: I've also added title just to show it's possible.

You might also want to consider one of these instead:

---
Tags: custom-fields, javascript, google-maps
---


# Question
Title: How do I decode columns in the exp_sites table?
I need to look at the contents of the site\_system\_preferences column in the exp\_sites table. How do I decode this data?

# Answer
> 6 votes
The encoded string stored in the site\_system\_preferences column is a base64 encoded serialized array. Follow these steps to both unserialize and decode the string:

1. Go to http://blog.tanist.co.uk/files/unserialize/index.php
2. Paste the entire string from the site\_system\_preferences column into the "Unserializer input" textarea field on the left of the page
3. Make sure to select the "base64 decode (top level)" checkbox located at the bottom right of the field
4. Click the "Unserialize" button

This will show you the contents of the site\_system\_preferences column.

---

This also applies to these columns in the exp\_sites table:

* site\_mailinglist\_preferences
* site\_member\_preferences
* site\_template\_preferences
* site\_channel\_preferences
* site\_bootstrap\_checksums
* site\_pages

---
Tags: database, how-to, site-preferences
---


# Question
Title: FreeForm Pro form with "add another row" field
I'm creating a form where a user can add named people with a Name, Address, Phone and Email. There's also a javascript in place that allows a user to add another row/person. When they click this, it reveals another set of fields for Name, Address, Phone and Email for the second person and so on.

My question is how would I then get this submitted into the form in the Control Panel?

I was wondering if anyone has built anything like this before?

Thanks.

# Answer
Two possible strategies come to mind for this:

* As another user suggested, create as many Name, Address, Phone and Email fields as you need or think will need, and add a suffix for each field name (eg. `name_1`, `name_2`, etc)
* If you're manually creating your fields in the template using `{exp:freeform:form}`, add brackets `[]` to your field names so that you save the data as an *array* of data. Eg.

`Name: <input type="text" name="name[]" />
Name: <input type="text" name="name[]" />
// etc...`

For #2, this will however store all data in a single custom field, separated by a linebreak (**not** `<br />`, by the way). For example, in the "name" field in the CP you would have the following stored for three names entered:

```
Curly
Larry
Moe

```

You'll need PHP to break those apart if you need them later (using PHP's `explode()` function or a third-party plugin that does something similar).
> 2 votes

---
Tags: solspace-freeform, javascript, solspace
---


title: RSVP Module not obeying default status

text:
# Question
Title: RSVP Module not obeying default status
I'm using the RSVP Module with a site and it is great, but despite its default being set to "enabled", new entries always have it disabled.

I'd like to know, at the least, what I can hook into in the module's code to view what is happening when the entry is being created (through safecracker).

When publishing an entry through the admin panel, this feature does work as expected, so I'm kind of geared towards writing a safecracker hook, but I could really use some direction.

Thanks

# Answer
> 1 votes
Came up with the solution. After the entry has been submitted, hook into safecracker and insert an rsvp entry for the id.

```
public function safecracker_submit_entry_end( &$safecracker ) {
// Verify this only runs where it should.
if(  ! $this->_inEventScope() ) {
    return false;
}

$entryID = $safecracker->entry('entry_id');

if( isset( $entryID ) && !empty( $entryID ) ) {

    $data = array(
        'entry_id' => $entryID,
        'total_seats' => 0
    );

    $query = $this->EE->db->insert( 'exp_cm_rsvp_events', $data );
}

```

}

---
Tags: add-on, safecracker, module
---


# Question
Title: How do I show a field if it contains content, but hide it if it's empty?
I have:

```
{exp:channel:entries channel="products" limit="1" status="open"}

<ul class="arrow-side-2">
<li><h4>Properties</h4></li>
</ul>
    <p>{properties}</p>

<ul class="arrow-side-2">
<li><h4>Applications</h4></li>
</ul>
    <p>{applications}</p>

<ul class="arrow-side-2">
<li><h4>Production</h4></li>
</ul>
        <p>{production}</p>

<ul class="arrow-side-2">
<li><h4>Packaging</h4></li>
</ul>
    <p>{packaging}</p>

{/exp:channel:entries}

```

How do I hide:

```
<ul class="arrow-side-2">
<li><h4>Production</h4></li>
</ul>
        <p>{production}</p>

```

If there is nothing in the {production} field?

Thanks.

# Answer
Or, you can just do:

```
{if production}<p>{production}</p>{/if}

```
> 4 votes

# Answer
```
{if production != ""}
    <p>{production}</p>
{/if}

```
> 0 votes

---
Tags: ee2
---


# Question
Title: Assets URL in Low Variables Wygwam field not displaying on Front end
Similar to this post I'm getting incorrect file paths being displayed on the front end when using Assets from within Wygwam. Unlike that post I'm actually getting this rendered on the front end:

`{assets_104:{filedir_1}News/3F1A0399_1.jpg}`

I've tried the fix referred to in the comments to no avail.

It doesn't matter how many times I save the entry, so I don't think it's the same issue described here

Another difference I believe is probably key here is that the Wygwam filed is a Low Variables field type.

I'm running EE v2.5.5, Low Variables v2.3.5, Assets v2.1.4 & Wygwam 3.1.2.

Thanks.

# Answer
To make sure extra processing is done before the var is put in the template, use the **tag syntax** rather than the variable syntax:

```
{exp:low_variables:single var="my_wygwam_var"}

```
> 4 votes

---
Tags: assets, wygwam, pixelandtonic, low-variables
---


title: Why is WYGWAM failing after upgrade

text:
# Question
Title: Why is WYGWAM failing after upgrade
I've just upgraded from EE 2.5.3 to 2.6.1 and am fighting through all the damage it's done to my site. At the moment I'm stuck on the seeming failure of WYGWAM (3.1.1).

I'm having the same issue which is mentioned here but which wasn't resolved in a public or global way.

Whether editing existing content, creating new content, or even creating a new field group and channel and then creating new content with that, I see the same behavior:

The WYGWAM field flashes once quickly (blank white for new content, white with raw source content visible for existing content) and then disappears to show only the grey background of the console.

My production site still uses WYGWAM 2.3.5 but there is no evidence of a skin.js file in that package, so that "fix" mentioned in another post is not applicable.

Anybody have any ideas where I can look, or what I can do to debug this?

I haven't yet tried un-installing and reinstalling, because there doesn't seem to be a way to do that without losing all the data, which I very much want to avoid.

\[**brief update**: just discovered that WYGWAM 3.1.2 is available. Installed it, problem remains.\]

\[Sorry, forgot to list my installed addons\] ab\_pagination, assets, ce\_cache, ce\_str, child\_categories, force\_ssl, freeform, matrix, my\_title\_control, playa, primary\_category, sitemap, str\_rexp, taggable, tagstripper, trunchtml, url\_encode, wygwam

Andy

# Answer
This turns out to have been a problem unique to our site and therefore not very likely to be of help to anybody else, except, of course, in a very generic way.

That generic help would be, check your console output.

When WYGWAM "fails" in the way described here and in at least one other similar question, the cause is often missing files in the theme package, and those will be noted in the console output.

In our case it was an addition we had made ourselves, to be able to add a number of styled pull-quote boxes to content entered in a WYGWAM field. Three of us had completely forgotten about that obscure little folder nested many layers deep in the wygwam theme folder, and it had simply not been moved across in the upgrade.

Thanks again to Brad Bell, for a nudge in the right direction.

A
> 1 votes

---
Tags: wygwam, ee2-upgrades
---


title: Matrix/Playa approach to i18n

text:
# Question
Title: Matrix/Playa approach to i18n
My current solution for making my site multilingual is using this very simple plugin which is very close to how Codeigniter does it.

However, it seems this cannot be used for things like Matrix/Playa since the strings are not in the template files.

What is the best approach for making Matrix/Playa multilingual?

# Answer
You can try the Publisher add-on, it supports both Playa and Matrix.

More information can be found on the boldminded.com website.
> 1 votes

---
Tags: matrix, playa, multi-language, multilingual
---


# Question
Title: Assets & S3: Output Source Folder + Subfolder + Filename
I have a file on S3 uploaded with Assets. The full URL is:

`http://s3-us-west-2.amazonaws.com/my-bucket/source-folder/subfolder/file-name.pdf`

`source-folder` is the subfolder in the bucket where the Assets directory is set.

I want to output this path:

`source-folder/subfolder/file-name.pdf`

`{my_assets_field:server_path}` gets me `/subfolder/file-name.pdf`, but I can't find any way in the Assets field tag to dynamically output the source folder.

# Answer
> 1 votes
As of version 2.1, you have to hard-code the source folder:

`source-folder/{assets_field:server_path}`

However, a solution for this is in active development for version 2.2.

---
Tags: assets, s3
---


# Question
Title: Restrict Upload Directories in Wygwam field
The site I'm working on has multiple upload directories with different permissions on them.

The content administrator is building public-facing pages and including PDFs via the page's Wygwam field, but by default Wygwam is selecting the first upload directory the content administrator has access to, which is not a public file directory (e.g. it selects "Private" instead of "Public", presumably because it appears first alphabetically).

Is there a way in my Wygwam field to specify what upload directories it can use, like in a file custom field? If there is, I'm not seeing it.

Thanks,

Tim

# Answer
You con configure each of your Wygwam configs to be restricted to a particular upload directory by going to Add-Ons \> Modules \> Wygwam \> \[your config name\], and setting the Upload Directory setting.
> 1 votes

---
Tags: wygwam, file-uploads, file-manager
---


# Question
Title: EE1 - FF Multi-select inside of another FFMS loop
I have two fields on an older site in EE 1.6.7. I am completely rebuilding the site in EE2, but in the meantime, they have a field I need help with. There are two fields in the entry that are both FF Multi-select fields. One lets them select which fields will be in the lead capture form. The other is to let them select which fields are required. Both fields have the same selections available: First Name, Last Name, E-mail, Phone Number. The fields name is {landing\_form\_form\_fields} and the required field is {form\_field\_requirements}. I looked for the docs on the old FF Multi-select field but couldn't find anything. Is it possible to nest them like this or do I need to rebuild this somehow?

Inside the form, was this:

```
{landing_form_form_fields}
    {if "{option_name}" == "First Name"}
        <label for="firstName">{form_field_requirements}{if "{option_name}" == "First Name - Required"}* {/if}{/form_field_requirements}First Name</label>
        <input id="firstName" name="firstName" type="text" />
    {/if}
    {if "{option_name}" == "Last Name"}
        <label for="lastName">{form_field_requirements}{if "{option_name}" == "Last Name - Required"}* {/if}{/form_field_requirements}Last Name</label>
        <input id="lastName" name="lastName" type="text" />
    {/if}
    {if "{option_name}" == "E-mail"}
        <label for="email">{form_field_requirements}{if "{option_name}" == "E-mail - Required"}* {/if}{/form_field_requirements}E-mail</label>
        <input id="email" name="email" type="text" />
    {/if}
    {if "{option_name}" == "Phone Number"}
        <label for="phone">{form_field_requirements}{if "{option_name}" == "Phone Number - Required"}* {/if}{/form_field_requirements}Phone Number<span class="right">XXX-XXX-XXXX</span></label>
        <input id="phone" name="phone" type="text" />
    {/if}
{/landing_form_form_fields}

```

# Answer
Trevor Davis had written an article a while back about this kind of form building tool http://trevordavis.net/blog/freeform-fieldframe-expressionengine-form-builder \- you may get some mileage out of it
> 0 votes

---
Tags: ee1, forms, multiselect, nesting
---


# Question
Title: {exp:stash:get_list} sorting by a numeric column
Having tested {exp:stash:get\_list}, I found out that any numeric column used as a reference for sorting is evaluated as a string, not as a number.

So I get something like this in order,

```
1
10
11
12
...
2
20
21
22
...
3

```

How do I make it so that it evaluates that column as a number?

**Example Code**

```
{exp:stash:set_list name="message_list_items" parse_tags="yes"}
    {exp:example:message
        conversation_id="{segment_2}"
        limit="{limit}"
        paginate="bottom"
        sort="desc"
    }
        {if '{count}' == 1}
            {stash:opening_tag}
            {!- Some Stuff here --}
            <ol>
            {/stash:opening_tag}
        {/if}
        {stash:message_order}{count}{/stash:message_order}
        {stash:message}
                <li>
                    {!- Some Stuff here --}
                </li>
        {/stash:message}
    {/exp:example:message}
{/exp:stash:set_list}

{exp:stash:get_list
    name="message_list_items"
    {if '{embed:arbitrary_condition}' != 'y'}
        orderby="message_order"
        sort="asc"
    {/if}
}
    {if '{count}' == 1}
        {opening_tag}
    {/if}
    {message_order}
    {message}
{/exp:stash:get_list}
{/ol}

```

# Answer
You can use the `sort_type="integer"` parameter when you use `get_list`. That might help you out.

Here's the wiki for the get\_list.
> 3 votes

# Answer
I think, you are setting channel entries as list via Stash. Right? If so see that channel field's settings for `Field Content` under `Field Options` and select it as `Number`. You set\_list/get\_list would work properly by sorting with number.
> 0 votes

---
Tags: stash
---


title: EE 2.6 Relationships, or Playa?

text:
# Question
Title: EE 2.6 Relationships, or Playa?
I'm building quite a complex travel company site, where things like different vacation packages need to be linked to different modes of transport, hotels, various different statuses and categories etc.

For example, a tour might have 4 different trains and a boat. I have created a channel, Trains, and another channel, Boats. I'm wondering what the best way to link these up is.

**What are the advantages/disadvantages of using EE 2.6's improved Relationships feature vs something more comprehensive like Playa?**

Thanks!

# Answer
> 6 votes
My decision to use playa over Ellis' new relationships, is based on:

1) When you buy an addon from a top-notch developer like Brandon Kelly, it comes with developer support, which can include timely addition of future features that you request v. paying for a support plan from Ellis if you don't have one already.

2} Playa has been vetted for many years in the real world by a very large number of users with very complex needs

3) Playa is much more robust. It is well integrated with the P & T first class add-on line-up and many other very popular add-ons.

4) It is low variables compatible

5) When the user community supports our top-notch developer community, we keep EE excellent.

---
Tags: channel-entries, playa, relationships
---


# Question
Title: Why don't the Comments field display in the Admin Notification Template?
I am using freeform 4.0.12 on EE 2.6.1. Everything works except the comments textarea field contents are not displaying in the Admin Notification.

Here is the form:

```
{exp:freeform:form
form_id="1"
form:id="contact"
required="name|email"
return="contact/thank-you"
notify_admin="yes"
notify_admin_template="contact"
}

<label for="first_name"><span>First Name:</span>
<input type="text" name="first_name" id="first_name" value="" />
</label>

<label for="last_name"><span>Last Name:</span>
<input type="text" name="last_name" id="last_name" value="" />
</label>

<label for="email"><span>Email:</span>
<input type="text" name="email" id="email" value="" />
</label>

<label for="phone"><span>Phone:</span>
<input type="text" name="phone" id="phone" value="" />
</label>

<label for="comments"><span>Comments:</span>
<textarea name="textarea" name="comments" id="comments" rows="10" cols="50"></textarea>
</label>

<label for="captcha"><span>Enter this value:</span><br />
{freeform:captcha} </label><br />
<label for="captcha-2"><span>Here:</span>
<input class="captcha" type="text" name="captcha" value="" />
</label>

<input checked="submit_button" type="image" src="/photos/btn_submit.png" alt="submit form" />
{/exp:freeform:form}

```

Here is the code in the notification form:

```
{first_name} {last_name} submitted the following information from the website contact page:

{all_form_fields}
    {field_label}
    {field_data}
{/all_form_fields}

```

When I get the response back it looks like this:

> Mark Twain submitted the following information from the website contact page:
>
> First Name Mark
>
> Last Name Twain
>
> Email markt@macx.com
>
> Phone 919-000-0000
>
> Comments

Note: The comments are blank. So sad.

Any ideas?

Thanks.

# Answer
> 1 votes
Your `<textarea>` as shown has *TWO* `name=` parameters. I doubt that's helping matters.

---
Tags: solspace-freeform
---


# Question
Title: can not retrieve values from cache in custom module
I am building a module and I set the cache in the form function, which will be retrieved in the insert\_new\_email function.

I can retrieve the cached data in the form function, but I can not in the insert\_new\_email function.

Below is the class I use for my mod.email\_blast.php file

```
class email_blast {

    public $return_data;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->EE =& get_instance();
        $this->EE->load->library('session');
        if (!class_exists('MCAPI'))
        {
            require PATH_THIRD.'email_blast/libraries/MCAPI.php';
        }
    }

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

    public function form() {
        $service = $this->EE->TMPL->fetch_param('service', false);
        $api_key = $this->EE->TMPL->fetch_param('api_key', false);
        $list_id = $this->EE->TMPL->fetch_param('list_id', false);

        if($api_key == FALSE || $list_id == FALSE) {
            return "You are missing parameter(s)";
        }

        $this->EE->session->set_cache('email_blast', 'api_key', $api_key);
        $this->EE->session->set_cache('email_blast', 'list_id', $list_id);
        $this->EE->session->set_cache('email_blast', 'service', $service);

        // Build an array to hold the form's hidden fields
        $hidden_fields = array(
            'ACT'       => ee()->functions->fetch_action_id('Email_blast', 'insert_new_email'),
            'RET'       => ee()->functions->fetch_current_uri(),
            'API_KEY'   => $this->EE->session->cache('email_blast', 'api_key')
        );

        // Build an array with the form data
        $form_data = array(
            "id" => $this->EE->TMPL->form_id,
            "class" => $this->EE->TMPL->form_class,
            "hidden_fields" => $hidden_fields,
        );

        // Fetch contents of the tag pair, ie, the form contents
        $tagdata = $this->EE->TMPL->tagdata;

        $form = $this->EE->functions->form_declaration($form_data) .
            $tagdata . "</form>";

        return $form;
    }

    function insert_new_email()
    {
        $email = ee()->input->get_post('email');
        $email = trim(strip_tags($email));
        $api_key = $this->EE->session->cache('email_blast', 'api_key');
        $api = new MCAPI($api_key);
        $merge_vars = array ("OPTINIP" => $_SERVER['REMOTE_ADDR']);
        $list_id = $this->EE->session->cache('email_blast', 'list_id');
        $result = $api->listSubscribe($list_id, $email, $merge_vars, 'html', 'false', 'true', 'false', 'true');

        $data = array(
            'title'     => 'Mailing list',
            'heading'   => 'Thank you',
            'content'   => $list_id,
            'link'      => array($_POST['RET'], 'Site name here'),
            'email'     => $email,
        );

        ee()->output->show_message($data);
    }
}

```

# Answer
> 4 votes
The session cache only lasts for a single page request. So by the time your action gets called, that cache is gone. You'd be better off adding those to the form as hidden fields, and then grabbing them from POST in your action.

---
Tags: module, cache
---


title: Freeform 4.0.12 and Multiple Recipients

text:
# Question
Title: Freeform 4.0.12 and Multiple Recipients
OK - I need some fresh eyes on this as I think it all looks correct but I'm not getting emails coming through.

* Freeform 4.0.12
* EE 2.6.1
* CP-generated email coming through fine
* Form entries appearing in FreeForm CP

Goals:

* Multiple recipients based on selected checkboxes
* Defaulting checkbox choice based on URL
* Selected names/appearing in the notification email

Template Code:

```
 {exp:freeform:form
form:id="contact-form"
form_name="contact"
required="name|email"
return="contact/thanks"
recipients="yes"
recipient_limit="10"
recipient_template="to_era"
recipient1="recipient1|email1@email.com"
recipient2="recipient2|email2@email.com"
recipient3="recipient3|email3@email.com"
recipient4="recipient4|email4@email.com"
recipient5="recipient5|email5@email.com"
recipient6="recipient6|email6@email.com"
recipient7="recipient7|email7@email.com"
recipient8="recipient8|email8@email.com"
recipient9="recipient9|email9@email.com"
recipient10="recipient10|email10@email.com"
}

<p>
    <label for="name">Name:</label><br />
    <input type="text" id="name" name="name" size="40" maxlength="64" value="" class="textfield" />
  </p>

  <p>
    <label for="email">Email:</label><br />
    <input type="text" id="email" name="email" size="40" maxlength="128" value="" class="textfield" />
  </p>

  <p>
    <label for="telephone">Telephone:</label><br />
    <input type="text" id="telephone" name="telephone" size="40" maxlength="16" value="" class="textfield" />
  </p>

  <p>
    <label for="availability">What is the best time for us to reach you?</label><br />
    <input type="text" id="availability" name="availability" size="40" value="" class="textfield" />
  </p>

  <p>
    <label for="message">Message:</label><br />
    <textarea id="message" name="message" rows="18" cols="40" class="textfield"></textarea>
  </p>

  <fieldset id="community_checkboxes">
      <legend>Select each of the communities are you interested in.</legend>

        <p> {!-- ravenna --}
           <input{if segment_2=="ravenna"} checked{/if} type="checkbox" id="{freeform:recipient_value1}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value1}">{freeform:recipient_name1}</label>
        </p>

        <p>
           <input{if segment_2=="wallingford"} checked{/if} type="checkbox" id="{freeform:recipient_value2}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value2}">{freeform:recipient_name2}</label>
        </p>

          <p> {!--lakeshore--}
           <input{if segment_2=="north-seattle"} checked{/if} type="checkbox" id="{freeform:recipient_value3}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value3}">{freeform:recipient_name3}</label>
        </p>

        <p> {!-- broadview --}
           <input{if segment_2=="mercer-island"} checked{/if} type="checkbox" id="{freeform:recipient_value4}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value4}">{freeform:recipient_name4}</label>
        </p>

        <p> {!--wallingford --}
           <input{if segment_2=="lakeshore"} checked{/if} type="checkbox" id="{freeform:recipient_value5}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value5}">{freeform:recipient_name5}</label>
        </p>

        <p> {!-- mercer-island --}
           <input{if segment_2=="issaquah"} checked{/if} type="checkbox" id="{freeform:recipient_value6}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value6}">{freeform:recipient_name6}</label>
        </p>

        <p> {!--issaquah --}
           <input{if segment_2=="broadview"} checked{/if} type="checkbox" id="{freeform:recipient_value7}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value7}">{freeform:recipient_name7}</label>
        </p>

        <p> {!--bellevue --}
           <input{if segment_2=="bellevue"} checked{/if} type="checkbox" id="{freeform:recipient_value8}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value8}">{freeform:recipient_name8}</label>
        </p>

         <p>
           <input type="checkbox" id="{freeform:recipient_value10}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value10}">{freeform:recipient_name10}</label>
        </p>

        <p>
           <input{if segment_2==""} checked{/if} type="checkbox" id="{freeform:recipient_value9}" class="community_chbx" value="" name="recipient_email[]">
           <label for="{freeform:recipient_value9}">{freeform:recipient_name9}</label>
        </p>

  </fieldset>

  <p><input id="button_submit" name="submit" type='submit' value='Submit Form' /></p>
{/exp:freeform:form}

```

Have I missed something obvious?

# Answer
> 1 votes
try setting value="{freeform:recipient\_value1}, etc.

# Answer
> 0 votes
You have recipient1 repeated as a param rather than recipient1, recipient2, etc. May be nothing, or that may be it.

# Answer
> 0 votes
Since data is hitting Freeform but emails aren't arriving, the first thing to test is whether or not emails from EE are being delivered correctly. Test this by sending an email to yourself from the Communicate page (Tools \>\> Communicate).

If the email arrives, I'd conclude it's an issue in your template.

If the email doesn't arrive, I'd conclude the issue is with email delivery.

One way to test the actual delivery is to connect EE to an SMTP account... either your own or a free http://www.mandrill.com account. You can make this adjustment at (Admin \>\> Email Configuration). Select SMTP from the Email Protocol dropdown and add your credentials in the fields below.

---
Tags: solspace-freeform
---


# Question
Title: Possible to add data-validate="x" to Safecracker form tag?
I'm wanting to add a new parameter (data-validate="parsley") to the Safecracker form tag. I know this isn't possible out of the box but was wondering whether it was possible to write a simple(ish) extension that could do it?

If anyone can give me some pointers, I'm willing to have a go.

Cheers

Jim

# Answer
> 6 votes
I've created an extension that'll let you do it.
https://github.com/jazonv/SafeCracker-HTML5-Attributes

In addition to `data-foo="bar"`, it'll also lets you use `autocomplete="no"` and `novalidate="novalidate"`.

*(Inspired by this gist by Objective HTML)*

Disclaimer:
I'm by no means a PHP/Add-on dev. I just wanted to 'have a go' too. Hopefully there's nothing wrong with it.
If any better-versed devs want to give it a once over, that'd be appreciated.

---
Tags: safecracker, add-on-development
---


# Question
Title: Backup Pro(ish) is exporting empty SQL files
I've just installed Backup Pro(ish). This is my first time using the addon, so the problem I'm having could very well be "user error. I have the database backup method set to "MySQLDUMP", unfortunately every time I perform a backup and export the database it's an empty file. I've tried the PHP backup method and this appears to work, but I would prefer to get the SQL file.

I'm running EE v2.6.1 and am using the Focus Lab master config. I'm not sure if that would have any affect on the issue.

Thanks in advance.

# Answer
> 1 votes
Can you check phpinfo and see if your server has SuHosin enabled. I had a similar issue and it turned out that unfortunately Backup Pro doesn't work on servers with this enabled.

---
Tags: ee2
---


title: Bizarre whitescreen of death issue

text:
# Question
Title: Bizarre whitescreen of death issue
I've just moved a site using 2.5.5 from my local setup to our hosting account under a sub-domain for staging but am having some odd issues.

At first the site is fine but if I visit the add-ons tab I get the whitescreen of death front-end and CP. I turned on debugging and got the following error

```
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/EE_Config.php
Line Number: 211

```

Disabling extensions in config.php didnt help but if I change the database user (ie create a new user and update database.php) the site comes back fine.

Even with extensions disabled, if I try to access add-ons, I get the same routine…

I have a 2.5.3 site in another subdomain on the same server with no issues at all.

I have the following third-party add-ons installed: Assets 2, Matrix, CP Analytics, Field Editor, Freeform, Google Maps for EE, Low Reorder, NavEE, REElocate, Sitemap, Environment, Health Check, NSM Addon Updater, Low Alphabet, P&T Field Pack, Playa, Expresso, CE Image

The local install is running perfectly.

# Answer
> 1 votes
It appears that this is an Assets2 memory issue. Cranking the memory limit up to 128Mb (from 32Mb) seemed to solve the whitescreen of death problem but I had other issues with Assets not indexing correctly etc. increasing the memory limit solved the problems.

# Answer
> 1 votes
My suspect is that MySQL server is blocking the user for some reason - you should inspect server logs or talk to your hosting provider about that.

---
Tags: white-screen-of-death
---


# Question
Title: Upgraded to 2.6.x from 1.6.x - Site functionality and styles all broken
So after an entire laundry list of stuff that has gone wrong, I have finally “successfully” migrated a client’s old EE site to the latest version (at their insistence).

The most vexing problem, as of this moment, is that the entire site has imploded all over itself. Insofar as I can tell, functionality remains nominally intact. However, the CSS is now a complete train wreck in spite of the fact that all of the styles are seemingly being referenced and are intact. I can access them through the template manager and make changes just fine..

So why did this upgrade ruin everything? Is there a way to fix this?

The client is, naturally, wholly displeased with this in spite of advanced warnings rendered.

Some of the functionality is also broken, like drop down lists and so on. The site can be seen here:

http://lenoirmemorial.org/

Is there a fix for this, or am I really going to have to try and rebuild all of the styles and functionality for a website I did not help create? My employers do not have the original employee(s) or design templates for the site- so I do not even have a real reference to go off of in the hopes of rebuilding.

There's also instances of tags being used not supported by EE2, and I've not any idea where they originate from (google has not helped). Such as {exp:convert\_to\_title\_case}:

```
<title>{if segment_2}{exp:convert_to_title_case}{segment_2} » {/exp:convert_to_title_case}{/if}{if segment_1}{exp:convert_to_title_case}{segment_1} | {/exp:convert_to_title_case}{/if}Lenoir Memorial Hospital, Kinston, North Carolina</title>

```

I've made database backups and retained all of the old EE files and folders.. Is there a viable way to rollback to an earlier version or am I stuck?

# Answer
Good goddy lordy.

You *should* be able to roll back - I hope you have been! - but that's one heck of a huge jump. Note to anyone else considering a big EE upgrade like this, my advise would be rebuild the site in a new database, import your members and the simplest content piecemeal slowly, and then just quick-change the front-end files when you have everything all squared away. When I was just trying to upgrade from 1.6.9 to 2.1.0, there were enough kludgy problems (and the control panel ran SO SLOWLY!!!) that I decided, forget it, enough with the legacy crud, I'm starting fresh. It took some time (3K entries to import) but in the end I'm glad I went with that option. The site runs better, the control panel runs MUCH better, and I have no problems when I want to install new plugins. (The sheer number of steps is one factor in why this upgrade was so wobbly. The 1x -\> 2x is another factor. If someone's going from 2.5.2 to 2.6.1, I wouldn't necessarily start over. But from 1.x to 2.6.1...yeah. Save yourself some pain and a goodly deal of headbeating.)
> 0 votes

# Answer
For the {exp:convert\_to\_title\_case} you could install CE String http://www.causingeffect.com/software/expressionengine/ce-string/user-guide/custom\_methods and use its to\_title method - just switch out the tags in your templates.

Currently I'm seeing "*The system path does not appear to be set correctly. Please open your path.php file and correct the path.*" at the mentioned URL so it's hard to say what's going on. I feel your pain bro, 1-\>2 updates can be a PITA.
> 0 votes

---
Tags: ee2-upgrades, css, html
---


# Question
Title: Assets and Matrix server error on save with high numbers of Matrix rows
I had an issue on an earlier site build where entries containing a Matrix field with numbers of rows in excess of about 60 wouldn't save. The Matrix field in question contained two Assets fields, a couple of text fields and a PT Pill. I thought I had traced the issue to a problem in upgrading from Assets 1 to 2, and for various reasons ended up downgrading to 1 again as a solution.

I've now run into the same issue again on a brand new site, with fields exactly as described above, using Assets 2. It's for a photographic portfolio - the like of which I've built several times before using Assets 1 and never had this problem. What happens is that when I try to save the entry, when having gone above a certain number of rows, the browser load bar sticks, and eventually (after several minutes) I get an internal server error message.

There's no issue on entries with lower numbers of rows, and there's no issue with opening the entry for editing, only when saving.

Any ideas?

# Answer
> 2 votes
I hit this recently. You need to increase the max\_execution\_time in php.ini. i went with 300 and this fixed it right up for me. Also make sure you have sufficient memory. I specify 128Mb+

# Answer
> 0 votes
In addition to increasing the memory in the php.ini as Damien\_Buckley stated, you might also want to talk to the server admin, see if there's a way on his end to increase the memory or otherwise optimize the server. Otherwise, in another six or eight months, you may hit this same problem again if your site keeps expanding / adding Assets and Matrix rows.

You may also want to ping the Pixelandtonic folks about this issue - see if they can do anything on their end to make future versions run better and avoid this error. (If you haven't already, that is!)

---
Tags: matrix, assets
---


# Question
Title: CE Image - Allowed memory size exhausted
I was working on my site when I suddenly got this error from CE-Image

```
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9940 bytes) in ................./system/expressionengine/third_party/ce_img/libraries/Ce_image.php on line 2834

```

I looked at the line and I saw this

```
$dest = imagecreatetruecolor( $this->width_final, $this->height_final );

```

Seems to me this is a memory error issue.

What steps should I do to correct this? Is this the fault of the plugin or PHP?

# Answer
PHP is letting you know that the maximum amount of memory that it is allowed to use has been exhausted. You need to either do less memory intensive things (work with smaller images, etc), or increase the maximum amount of memory PHP is allowed to use on your server.

When working with really large images, or even doing processor intensive filters on moderately large images, you'll need to increase the maximum amount of memory that PHP can access on your server. You can easily do so in php.ini or right in your EE config.php file like so:

```
$config['ce_image_memory_limit'] = 128;

```

The default limit is 64 (megabytes), so you can try bumping it up a bit. See the CE Image Basic Configuration page for more details on the config setting.

Another thing to keep in mind, is that CE Image is not the only thing that is using memory. The memory usage is comprised of all resources that PHP has in memory: files, snippets, add-on classes, etc. Image manipulation is innately memory heavy though.

Disclaimer: I'm the author of CE Image.
> 5 votes

# Answer
Did you take a look at the original size of the image? Especially the pixel width and height. If above, say, 2000 pixels it might be to much for 64MB memory on your server. If so, use a smaller image or get a bigger buffer on the server. But a full 36 Megapixel image is a challenge for any server/script.
> 0 votes

---
Tags: ce-image
---


# Question
Title: Members upload photos into their own restricted subdirectory?
Can this be done, including blockage to other (members) sub directories?

# Answer
> 1 votes
I've been waiting for this too, this was possible with a plugin in EE1. You might be better off with Channel Images. With Channels Images people only see their own uploads as standard behavior. Upload is direct through the field, there is no in between library access. People can remove images if they can access their own entries.

Another advantage is that images are deleted with the entries.

---
Tags: assets
---


# Question
Title: Wygwam - stripping tags from ul li (class and id) [Advanced Content Filter (ACF)]
Good afternoon,

after upgrading to the latest wygwam version i experienced the problem that the editor is stripping out content from wygwam fields. Not the visible parts but class and id fields from for example ul and li fields.

Most likely the new Advanced Content Filter (ACF) ckeditor implemented is the root cause of this because they have switched it to default on. Problem is that there doesn't seem to that pixel and tonic didn't update the ADVANCED SETTINGS tab so you can disable ACF, only add extraAllowedContent.

My question is, how do i disable ACF? I must set CKEDITOR.config.allowedContent to true to do this but WHERE?

http://docs.ckeditor.com/#!/guide/dev\_advanced\_content\_filter

# Answer
> 4 votes
You can disable CKEditor’s content filtering functionality by going to Add-Ons \> Modules \> Wygwam \> \[your config name\], and changing the “Restrict allowed HTML?” setting to “No”.

That’s a new setting as of Wygwam 3.1, so you may have to update Wygwam first.

---
Tags: wygwam
---


# Question
Title: Solspace User & Expresso Store Questions
I have set up User so customers can edit their billing & shipping info in their member account.

Is there a way to output the billing\_region & billing\_country select fields from Store within a {exp:user:edit} tag? I tried it but it seems to break the form.

Also, if a customer has entered different info for billing & shipping in their member account, when they are logged in and go to checkout, the checkbox for setting the shipping info to "Same as Billing Details" is checked and overwrites what is entered for shipping info in the customer's account.

Is there a way around this?

Thanks for any help!

Added code sample:

```
<article>
    {exp:store:checkout
        form_class="checkout_form"
        form_id="checkout_form"
        next="store/order-confirmation"
    }
    {if no_items}
        {redirect="store/cart"}
    {/if}
    <div class="main-content">
        <h1>Store</h1>
        <ul class="breadcrumb text-center">
            <li><a href="{path='store'}">Store</a></li>
            <li><a href="{path='store/cart'}">Your Cart</a></li>
            <li><a href="{path='store/customer-details'}" class="active">Customer Details</a></li>
        </ul>
        <hr class="main-rule">
        <div class="two-thirds">
            <h2>Customer Details</h2>
            {if logged_out}
            <p>
                Already a customer? <a href="{path='account/login'}">Login</a>
            </p>
            {/if}
            <h4>Billing Details</h4>
            <div class="one-half alpha">
                <p class="control-group">
                    <label for="billing_name">Name</label>
                    <input type="text" name="billing_name" value="{billing_name}" data-msg-required="Please enter your billing name." required>
                </p>
            </div>
            <div class="one-half gamma">
                <p class="control-group">
                    <label for="order_email">Email</label>
                    <input type="text" name="order_email" value="{order_email}" data-rule-email="true" data-msg-required="Please enter your billing email address." data-msg-email="Please enter a valid billing email address." required>
                </p>
            </div>
            <div class="one-half alpha">
                <p class="control-group">
                    <label for="billing_address1">Address</label>
                    <input type="text" name="billing_address1" value="{billing_address1}" data-msg-required="Please enter your billing address." required>
                </p>
            </div>
            <div class="one-half gamma">
                <p class="control-group">
                    <label for="billing_address2">Apt/Suite</label>
                    <input type="text" name="billing_address2" value="{billing_address2}">
                </p>
            </div>

            <div class="one-half alpha">
                <p class="control-group">
                    <label for="billing_address3">City</label>
                    <input type="text" name="billing_address3" value="{billing_address3}" data-msg-required="Please enter your billing city." required>
                </p>
            </div>
            <div class="one-half gamma">
                <p class="control-group{if error:billing_postcode} error{/if}">
                    <label for="billing_postcode">Zip Code/Postcode</label>
                    <input type="text" name="billing_postcode" value="{billing_postcode}" data-msg-required="Please enter your billing zip." required>
                </p>
            </div>
            <div class="one-half alpha">
                <p class="control-group">
                    <label for="billing_region">State/Region</label>
                    <span class="select-menu">
                        {field:billing_region}
                    </span>
                </p>
            </div>
            <div class="one-half gamma">
                <p class="control-group">
                    <label for="billing_country">Country</label>
                    <span class="select-menu">
                        {field:billing_country}
                    </span>
                </p>
            </div>
            <div class="one-half alpha">
                <p class="control-group">
                    <label for="billing_phone">Phone</label>
                    <input type="text" name="billing_phone" value="{billing_phone}" data-msg-required="Please enter your billing phone number." required>
                </p>
            </div>

            <hr />

            <h4>Shipping Details</h4>

            <p>

                    <input type="checkbox" name="shipping_same_as_billing" value="0" id="shipping_same_as_billing"> Same as Billing Details

            </p>

            <div id="shipping_details_drawer">
                                   {exp:member:custom_profile_data}
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="shipping_name">Name</label>
                        <input type="text" name="shipping_name" value="{shipping_name}" data-msg-required="Please enter your shipping name." required>
                    </p>
                </div>
                <div class="one-half gamma">
                </div>
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="shipping_address1">Address</label>
                        <input type="text" name="shipping_address1" value="{shipping_address1}" data-msg-required="Please enter your shipping address." required>
                    </p>
                </div>
                <div class="one-half gamma">
                    <p class="control-group">
                        <label for="shipping_address2">Apt/Suite</label>
                        <input type="text" name="shipping_address2" value="{shipping_address2}">
                    </p>
                </div>
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="shipping_address3">City</label>
                        <input type="text" name="shipping_address3" value="{shipping_address3}" data-msg-required="Please enter your shipping city." required>
                    </p>
                </div>
                <div class="one-half gamma">
                    <p class="control-group">
                        <label for="shipping_postcode">Zip Code/Postcode</label>
                        <input type="text" name="shipping_postcode" value="{shipping_postcode}" data-msg-required="Please enter your shipping zip." required>
                    </p>
                </div>
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="shipping_region">State/Region</label>
                        <span class="select-menu">
                            {field:shipping_region}
                        </span>
                    </p>
                </div>
                <div class="one-half gamma">
                    <p class="control-group">
                        <label for="shipping_country">Country</label>
                        <span class="select-menu">
                            {field:shipping_country}
                        </span>
                    </p>
                </div>
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="shipping_phone">Phone</label>
                        <input type="text" name="shipping_phone" value="{shipping_phone}" data-msg-required="Please enter your shipping phone number." required>
                    </p>
                </div>
            </div>
                            {/exp:member:custom_profile_data}
            {if logged_out}
            <p>
                {field:register_member} <label for="register_member">Register Account? <span class="note">(If your register, we'll save your info so you won't have to enter it next time!)</span></label>
            </p>
            {/if}
            <div id="register_details_drawer">
                <div class="one-half alpha">
                    <p class="control-group">
                        <label for="password">Password</label>
                        <input type="text" id="password" name="password" value="{password}" data-msg-required="Please enter a password." required>
                    </p>
                  </div>
                  <div class="one-half gamma">
                    <p class="control-group">
                        <label for="password_confirm">Confirm Password</label>
                        <input type="text" name="password_confirm" value="{password_confirm}" data-msg-required="Please confirm your password." required>
                    </p>
                  </div>
                  <div class="one-half alpha">
                    <p class="control-group">
                        <label for="username">Username</label>
                        <input type="text" name="username" value="{username}" data-msg-required="Please enter a username." required>
                    </p>
                  </div>
                  <div class="one-half gamma">
                    <p class="control-group">
                        <label for="screen_name">Screen Name</label>
                        <input type="text" name="screen_name" value="{screen_name}" data-msg-required="Please enter a screen name." required>
                    </p>
                  </div>
            </div>
            <div class="alert" style="display:none;"></div>
            <p>
                <a href="{path='store/cart'}" class="button">Back</a>
                <button type="submit" name="next" class="button orange">Review Order</button>
            </p>
            <script>
            $().ready(function() {
                $("#checkout_form").validate({
                    errorLabelContainer: $("#checkout_form div.alert"),
                    rules: {
                        password_confirm: {
                            equalTo: "#password"
                        }
                    },
                    messages: {
                        password_confirm: {
                            equalTo: "Your passwords do not match."
                        }
                    }
                });
            });
            </script>
            <script>
                $('#register_member').change(function() {
                    if (this.checked) {
                        $('#register_details_drawer').slideDown();
                    } else {
                        $('#register_details_drawer').slideUp();
                    }
                });

                if (!$('#register_member').is(':checked')) {
                    $('#register_details_drawer').hide();
                }
            </script>

        </div>
        <div class="one-third">
            {order-info}
        </div>
    </div>
    {/exp:store:checkout}
</article>

```

# Answer
> Also, if a customer has entered different info for billing & shipping in their member account, when they are logged in and go to checkout, the checkbox for setting the shipping info to "Same as Billing Details" is checked and overwrites what is entered for shipping info in the customer's account.
>
> Is there a way around this?

Yes, you can just set this to be unchecked by default. It's under Store \> Settings \> General \> Default Shipping Address.

That is probably the least disruptive method if you are expecting customers to enter these details before they go through the checkout.
> 0 votes

# Answer
> "Is there a way to output the billing\_region & billing\_country select fields from Store"

Yes and No.

Yes you can:

```
{exp:store:cart}
     <select name="billing_country">
         {billing_country_options}
     </select>
{/exp:store:cart}

```

**EDIT**: I originally incorrectly suggested `{exp:store:checkout disable_form="yes"}` \- this is an invalid parameter.

Or just the raw values:

```
{exp:store:cart}
    {billing_country} = {billing_country_name}
{/exp:store:cart}

```

Which can work inside your `{exp:user:edit}` tags.

But the answer is also No - it will only work when the user has an item in their cart, so if they come back at a later date, or have registered prior to adding products into their cart, the tag pairs will fire the `{if no_results}` conditional and nothing will get output :(

Other routes - you could use a third\_party country/region listing plugin such as Reegion Select by Derek Hogue. But then you may have differences in the references for the countries & regions, which may be important for your payment gateway and syncing with Store on Checkout.

Or I've written a plugin that taps into the Expresso Store classes and outputs the regions or countries independently of the `{exp:store:checkout}` tags - On Devot-ee.

> "the checkbox for setting the shipping info to "Same as Billing Details" is checked and overwrites"

You'll need to force this in your template, something like:

```
{if "{shipping_country}" != "{billing_country}"}
    <input type="checkbox" name="shipping_same_as_billing" value="0" id="deliveryCheckbox">
{if:else}
    <input type="checkbox" name="shipping_same_as_billing" value="1" id="deliveryCheckbox" {shipping_same_as_billing_checked} >
{/if}

```

If you find that the shipping details are still being incorrect displayed in the checkout form data being generated by Store, then you could output the shipping details from the member details instead:

```
{exp:member:custom_profile_data}{shipping_country}{/exp:member:custom_profile_data}

```

**Update**

> ...{exp:member:custom\_profile\_data} tags and get the same results either way. My custom member fields are named the same as the Store fields...

You mention your member fields are named the same as the Store fields, that means that the store tags will be parsing the fields first before the member tags get a look in. So you want to change the parse order to get the member tag to kick in first, so use the `parse="inward"` parameter.

```
{exp:store:checkout form_class="checkout_form" form_id="checkout_form" next="store/order-confirmation"}
    ...
    {exp:member:custom_profile_data parse="inward"}
        ...
        <input type="text" name="shipping_address1" value="{shipping_address1}" data-msg-required="Please enter your shipping address." required>
        ...
    {/exp:member:custom_profile_data}
    ...
{/exp:store:checkout}

```
> 1 votes

---
Tags: expresso-store, solspace-user
---


# Question
Title: Tags not parsing - showing on front-end like {slideshow}{/slideshow},{path},{slide_show_links},{file} etc
I am totally new to expression engine. I inherited a project that is built with expression engine because the last developer disappeared. The site was working fine for the last two years so i didn't have to really touch it.

A couple of weeks ago, the site started showing problems. My slideshow galleries and some images aren't showing up anymore. I can even see tags like {slideshow}{/slideshow},{path},{slide\_show\_links},{file} etc.. showing right in the webpage. These tags are supposed to be replaced php code to do things like printing the html mark up of galleries, or printing urls etc...

An example of this problem can be seen at http://hop.ca .

# Answer
> 3 votes
Is it an EE1 site? If so, go to Extensions, then Fieldframe's settings and check the path.

---
Tags: templates, ee1, tags
---


# Question
Title: exp:channel:categories - category_group not working
I have the following code:

```
<ul class="list">
    {exp:channel:categories
    parent_only="no"
    show_empty="no"
    style="linear"
    category_group="{if segment_1 == "cave"}3{/if}{if segment_1 == "clothing"}7{/if}{if segment_1 == "accessories"}8{/if}{if segment_1 == "brands"}2{/if}"}
        <li>
          <article>
            <a href="/{segment_1}/category/{category_url_title}">
              {category_image}
              <h2>{category_name}</h2>
            </a>
          </article>
        </li>
    {/exp:channel:categories}
  </ul>

```

But category\_group doesn't seem to be working, I've tried the segment names in both double quotes and single quote and it still doesn't work any ideas?

# Answer
> 1 votes
Some days ago, I found a bug on parsing adjacent conditionals:

```
{if segment_1 == "foo"}{/if}{if segment_1 == [...]

```

I just had to separate the conditionals:

```
{if segment_1 == "foo"}{/if}
{if segment_1 == [...]

```

So, please, try this:

```
<ul class="list">
    {exp:channel:categories
    parent_only="no"
    show_empty="no"
    style="linear"
    {if segment_1 == "cave"}category_group="3"{/if}
    {if segment_1 == "clothing"}category_group="7"{/if}
    {if segment_1 == "accessories"}category_group="8"{/if}
    {if segment_1 == "brands"}category_group="2"{/if}
    }
        <li>
          <article>
            <a href="/{segment_1}/category/{category_url_title}">
              {category_image}
              <h2>{category_name}</h2>
            </a>
          </article>
        </li>
    {/exp:channel:categories}
</ul>

```

I hope it helps.

# Answer
> 1 votes
I'd try Low's seg2cat and use {segment\_n\_category\_group\_id} http://gotolow.com/addons/low-seg2cat/docs

# Answer
> 1 votes
Christy's solution is a good one for sure.

But just in case your segments don't match the category group `url_title` exactly, try an embed or Stash. Here's the embed version.

In your current template, replace your current tag pair with this:

```
{embed="group/name_your_new_embed_template"
    cat="{if segment_1 == "cave"}3{/if}{if segment_1 == "clothing"}7{/if}{if segment_1 == "accessories"}8{/if}{if segment_1 == "brands"}2{/if}"
}

```

Then, in `group/name_your_new_embed_template` put a similar version of current tag pair, that's reads the values being sent for the `cat` parameter:

```
<ul class="list">
  {exp:channel:categories
    parent_only="no"
    show_empty="no"
    style="linear"
    category_group="{embed:cat}"}
    <li>
      <article>
        <a href="/{segment_1}/category/{category_url_title}">
          {category_image}
          <h2>{category_name}</h2>
        </a>
      </article>
    </li>
  {/exp:channel:categories}
</ul>

```

---
Tags: categories
---