# Question
Title: Trying to use EE form fields in multiple admin_notify chain
This is a follow-up to my previous question

I’m trying to send the output of a particular form to two emails: one, a generic alias that is hardcoded in; and the other, the individual originator's email which is listed in the individual channel entry. When I test the form, I receive notification at the hardcoded email address, but not at the individual entry/originator address. I’ve tried this with the hardcoded email in first position, and in second position; and I still get the same results.

The channel name is “originators”. The field name is “originator\_email”.

The URL is http://dev.soundmtg.com/originator/lesli-schauf (the site’s index.php is hidden from the URLs, so originator is the template group, and this uses the index template in that group.) In the entry, the originator\_email is leslis@fairplay.com.

ExpressionEngine 2.5.3 Freeform 4.0.8

Here’s the code that I’m using:

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

<h1 class="form_title">Quick Quote</h1>

{exp:freeform:form
    form_name="quick_quote"
    return="thanks"
    admin_notify="lesli.schauf@gmail.com|{originator_email}"
    recipient_user_template="quick_quote"
    required="first_name|email_address"
    form:id="quote_form"
    admin_notification_template="quick_quote_notification"
}

<fieldset class="quote_main">
    <fieldset class="left">
        <label for="first_name"><span class="form_star">*</span>First Name</label>
        <input type="text" name="first_name" id="first_name"/>
        <label for="last_name"><span class="form_star">*</span>Last Name</label>
        <input type="text" name="last_name" id="last_name"/>
        </fieldset>
        <fieldset class="left">
        <label for="email_address"><span class="form_star">*</span>Email Address</label>
        <input type="text" name="email_address" id="email_address"/>
        <label for="phone_number"><span class="form_star">*</span>Phone Number</label>
        <input type="text" name="phone_number"/>
    </fieldset>
    <input type="submit" id="form_button" value="Quote Me" title="Quote Me" />
    <input type="button" id="form_button" class="cancel" value="Cancel" title="Cancel">
</fieldset>
{/exp:freeform:form}

{/exp:channel:entries}

```

(Many of the form fields and much of the structural HTML removed from the code snippet above because they work fine - it’s the multi-email notification that isn’t working as expected.)

I expect this to record the form entry in the Freeform console, and to send an email to lesli.schauf@gmail.com, and to also send an email to leslis@fairplay.com. But no matter whether I list the hardcoded email first in the sequence, or second, I see the form entry in the Freeform console and receive an email at lesli.schauf@gmail.com but get nothing at leslis@fairplay.com.

Any suggestions on what I might be doing wrong?

EDIT: I first tried using embedded variables, but that wasn't working either. Here's that syntax:

First, from the template:

```
{exp:channel:entries channel="originators" disable="member_data|categories|member_data|pagination" dynamic="no" url_title="{segment_2}" limit="1"}
{embed="includes/quick-quote" email_addresses="lesli.schauf@gmail.com|{originator_email}"}
{/exp:channel:entries}

```

And then the Freeform tag from the embedded quick-quote template:

```
{exp:freeform:form
    form_name="quick_quote"
    return="thanks"
    admin_notify="{embed:email_addresses}"
    recipient_user_template="quick_quote"
    required="first_name|email_address"
    form:id="quote_form"
    admin_notification_template="quick_quote_notification"
}

```

# Answer
> 1 votes
Since Freeform and Channel are both modules, and parsed at the same stage, it may be the `{originator_email}` custom field is not yet parsed by the Channel module. If so you won't be able to use this as a parameter on the Freeform tag. It may be easiest to work around this by passing that variable to an embed containing your Freeform tags.

If the embed doesn't seem to be doing the job even after you confirm that your embed variable is passed correctly, then the other thing to check is the spam folder for the account where you aren't seeing the email show up.

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


title: Control Panel Themes

text:
# Question
Title: Control Panel Themes
What is the procedure for downloading and installing the alternative themes for ExpressioneEngine's Control Panel?

I've read in one of the books available on the topic that there are three additional Control Panel themes available: "Corporate", "Fruit" and "Mobile", but I can't find them.

Would be grateful for some help!

# Answer
> 1 votes
Corporate is in my cp\_themes folder in the 2.5.5 download, but Fruit & Mobile are not.

You should pose this question to EllisLab via their Support channel or in the Forums as I'm not seeing any way to access these under My Purchases on their site.

# Answer
> 3 votes
There are several control panel themes made by third-party authors. The best place to find them is on Devot-ee.com. Just do a search for "control panel theme."

Different themes may have slightly different installation instructions. Most of them follow these simple steps:

1. Copy the directory with the theme files to /themes/cp\_themes
2. Place $config\['cp\_theme'\] = '(theme\_name)'; into your config.php file to ensure all users see the same theme

Personally, I've found the Nerdery theme to work quite well. It's very simple and minor tweaks, but looks more professional than the default (it's blue instead of pink) and works well with third-party add-ons. Sassy-CP is another good option. It has several color ways to choose from. Both are free.

# Answer
> 0 votes
I haven't seen/heard of Fruit or Mobile either. You can check out Devot-ee for other CP themes at http://devot-ee.com/add-ons/filter?t=cpt Personally, I like Nerdery and Sassy CP.

Basically, the new theme gets put into the "/themes/cp\_themes" folder. So in my case, I have the following folders:

* corporate
* default
* nerdery
* nostalgia
* sassy\_cp

Each of the theme folders should have subfolders like css, images, etc. (could be js too). So make sure that is the case, or else it won't work.

---
Tags: control-panel, cp-themes
---


# Question
Title: Show a channel field based on whether it has a value or not?
More questions I'm afraid!

Hopefully this will be an easy one.

I have a variety of customs fields, not all required. I want to show a block of code, based on whether or not that field has any information in it.

Now if i wanted to just show the field, I can just include it in my template, and if theres no information, it wont show. Fine.

However I want to do something like:

```
{if custom_field has a value}
<div>
  <p>blah blah {custom_field} blah blah</p>
</div
{/if}

```

Hope that makes sense!

EDIT: Sorry, still not quite sure. As an example, lets say I have a custom field called "twitter\_handle" and that users can input their twitter usernames into it. They don't have to, so it could be left blank, or they could fill it in but I'd have no way of knowing what the value would be.

If I then wanted to show it in my template like so...

```
{if twitter_handle}
<div class="add me">
  <a href="http://twitter.com/{twitter_handle}">Add me on Twitter</a>
</div
{/if}

```

Is that right? So i would only get the code wrapped within the if's, provided twitter\_username has a value?

# Answer
> 4 votes
Yep, very simple. Just do this:

```
{if custom_field}
 ... field has any value ...
{/if}

```

If you want to test if the field has a certain value, you can do:

```
{if custom_field == "foobar"}
 show contents
{/if}

```

---
Tags: channel-entries, custom-fields, channel
---


# Question
Title: Extension Development - Use existing settings column or create a new table?
I was pondering this today and trying to decide on the best route when it comes to storing data for an extension.

The data I am storing in an extension involves a many to many relationship with two entities.

When do you use the settings column in exp\_extensions versus creating your own table where the data isn't serialized?

Let's say I have multiple instances, but with each single instance there will be the need to update data, delete, and relate to a member group id in the **extension settings view**.

One route I thought of is to unserialize the data, update the array, and then update the db? Yet with a table, you can utilize CI's active record functionality with data that is stored nicely. I'm confused on when to use one over the other. Help?

# Answer
In this case, I think building your own settings table is the way to go for sure. Using the `settings` column should really only be for very minor yes/no types of settings, not storing actual data. Especially when you get into supporting MSM, where you need settings for each site, it can get hairy fast.

Plus, then your data is more easily searchable and readable, and you can be more selective about what you need to `SELECT` at any given time, etc, etc.

So yes: your own DB table.
> 11 votes

---
Tags: add-on-development, extension, relationships, codeigniter
---


title: Low Search - Pagination

text:
# Question
Title: Low Search - Pagination
Does Low Search support the support the "P" suffix of native pagination of {exp:channel:entries}?

For example, if i have this url

```
test.com/search/jcg4uv8e9w4n09wn0v034mnv09j34ov3459j49g/P4

```

Does it go to the corresponding page(in this case, page 4)?

If not, then how should it handle it?

EDIT:

I tried using paginate\_base but when I used it, the query segment with the long string won't show in the url. The query segment is generated by Low Search.

```
test.com/search/P4

```

# Answer
The `PXX` is the offset of the total results & the limit set within the tag. So if you set a `limit=20` in the `low_search:results` tag, page 4 would be `P80`. `low_search:results` acts just like the `channel:entries` tag, so you can use any of those parameters to tweak your pagination.

```
{exp:low_search:results
   query="{segment_2}"
   limit="20"
   paginate="bottom"
   status="not closed"
   disable="categories|member_data"
}

```
> 3 votes

---
Tags: low-search
---


# Question
Title: MX QR Code Generator: "cannot decode raw data"
I'm trying to use the MX QR Code Generator and using a very basic example from the website like so;

```
<img src='{exp:qr_code type="" action="tel" tel="1234567" data="ExpressionEngine" title=""}' alt="QR code"/>

```

When I load the page Safari just throws "Safari can’t open the page “http://mydomain.tld”. The error is: “cannot decode raw data” (NSURLErrorDomain:-1015)" error.

There is a type parameter in the code as well, but the documentation on the site has no reference to this.

# Answer
I made quick update - try a version 2.0.5.  you can find example on demo-ee

ok. the issue was with image folder - if you use not standart image folder ('/images/'):

```
img src="{exp:qr_code type="" action="" tel="" data="asdasd" title="" email="" subj="" size="10" alt="QR code" base_path="SERVER_PATH_TO_WEB_ROOT"  base_cache="SERVER_PATH_TO_QR_CODE_IMAGE_FOLDER"}"/>

```
> 2 votes

# Answer
I'm not positive, but I'm pretty sure you shouldn't be using the `data="ExpressionEngine"` parameter when you're using the `tel` action. I think it's an either/or situation with tel/data/email parameters. The `data=""` parameter is used for URLs and other data types.
> 1 votes

---
Tags: add-on
---


# Question
Title: Extending expiry dates of certain entries?
A third party is providing an XML feed of courses for me to integrate into an existing channel, which I'm planning to use Andrew Weaver's excellent Datagrab module for. My problem is that some of these courses are ongoing, and have no expiry date, whilst others have a definite expiry date. The current course list on the site is ordered by expiry date (so that the closest course chronologically is listed first, in descending order).

The client I'm doing this for wants to add a +3 month expiry date to these entries that come through as ongoing, and then assess them regularly to refresh that +3 month date when they're about to expire.

I thought about doing this via the query module, or even via php, either as a nightly, or as lookup when someone requests this courses page (although I think that would be expensive performance-wise, I don't need to be looking at them constantly). I can add a category to these entries that makes it easy to pull them out.

I'm wondering if anyone else in the community can think of a good way of handling this? These entries are going to bubble up the listings as their expiry date nears, and then get pushed right down again. I'm not sure this is the best way of doing it, but the client is adamant that they want them integrated into the main list.

Any ideas or suggestions most welcome!

# Answer
> 1 votes
How about adapting one of the import modules from datagrab. From what i get, you could duplicate and edit an import for your own needs. If expiration\_date == 0 then add 3 months. That way it will keep in sync and set the expiration on import.

---
Tags: query, date, datagrab
---


# Question
Title: Change all url titles - Remove illegal characters
I've just noticed that a client has created a large number of entries with illegal characters in the url titles. This is causing all osrts of problems with entries displaying incorrectly.

Is there a quick and dirty way to mass change all of the entry titles to remove the illegal characters (commas, periods, apostrophe's etc)?

# Answer
You can run the update query directly to replace these special characters like:

```
UPDATE exp_channel_titles set url_title = REPLACE(url_title, '+', ' ') WHERE channel_id=1 AND status='open' AND site_id=1

```

The above sql will replace + character with space of all the entries having channel\_id as 1 and status as 'open'.

You need to run the query for each character which you would like to remove/replace.

I would suggest you take a backup to avoid any accident.

I hope it would help you.
> 1 votes

---
Tags: url-title
---


# Question
Title: How to load javascript file in my module
I have a module that is dependant on a couple of Javascript files.

How can I load these Javascript files on the front end when my module is called?

They are quite large so I cannot simply use an inline `<script></script>`

# Answer
> 6 votes
I think you're looking for this page in the EE Developer docs.

Basically, if you only need the JS in the Control Panel (so not on the front-end of the site), put your JS files in the `/your_addon_package/javascript/` folder and then use `$this->EE->cp->load_package_js('my_file');` to load it.

If you need the JS outside of the CP as well, you need to put it in the `/themes/third_party/your_addon_package/` folder and add a `<script>` tag to the header, if you want to use it in the CP.

If you want to output the JS file URL in your templates, create a method in your mod file that outputs `URL_THIRD_THEMES.'your_addon/js/file.js'` or something like that. Then use `{exp:your_addon:your_method}` to output the URL in the template.

---
Tags: add-on-development, module, javascript
---


title: Freeform submit & pre-populate again

text:
# Question
Title: Freeform submit & pre-populate again
Have a curly one for those who know more then me.

Picture this: A site has a form to submit a warranty registration. Capture: Name, email, street address, model name and serial number.

All good,this first part is a no-brainer. Fill out the stuff, submit, fire off thankyou emails to client and company then return to a generic "thanks" page.

What the client seeks though, is rarely, straight forward but must be achievable.

Let's alter the params for a moment. Let's say the user has bought several machines and they want to register each of them. Initial thought is to create say 6 duplicate fields in Freeform (6 X machine name, 6 X serial name) and display them – but a tad redundant to show all 6 if they bought 1 or what happens if they bought 12 ? Plus, too many fields to manage in the backend.

It was suggested that the user fills out all the "personal" details and we only display 1 set of machine/serial fields.

The user then has the choice of 2 buttons, either #1 "submit, I only bought one" or #2 "submit this one and then I'll add another"

If they choose option #2, how could you bring back all the previous "personal" details pre-populated and present a new, empty set of fields for machine/serial#?

Long story short, user submits one entry for one machine (one record per machine, technically speaking), if they choose to submit another, their "personal" details are pre-populated ready for another product registration - how ?

As I write, I see stash in the equation but not sure how to set the variables until they're posted… a good Friday question :)

# Answer
Freeform lets you use the `%%entry_id%%` placeholder in the `return` parameter. You could use this to load the entry that was just submitted (with the `freeform:entries` tag), then populate your personal info with at entry (but exclude the info for the products being registered).

What I'd do is include a checkbox in your initial form for "I have more products to register". Then, on your resulting page, if that box was checked for the first entry, show a new form with the info pre-populated. If it was not, then just show the "thank you" message.

Assuming this:

* you have the aforementioned checkbox and it's named `registration_multiple`
* your initial Freeform Form tag has `return="warranty/submitted/%%entry_id%%`

... here is some quick pseudo-code for your **warranty/submitted** template:

```
{exp:freeform:entries entry_id="{segment_3}" limit="1"}
{if registration_multiple == 'y'}
    {exp:freeform:form form_id="1" `return="warranty/submitted/%%entry_id%%"}
        <input type="text" name="name" value="{name}" />
        <input type="email" name="email" value="{email}" />
        ... etc ..
    {/exp:freeform:form}
{if:else}
    <p>Thank you for registering your product!</p>
{/if}
{/exp:freeform_entries}

```
> 1 votes

# Answer
You could switch from using Freeform to using Safecracker and storing these in entries.

You can use a Matrix field for each product they're registering, and give them a + button to add new rows to their Matrix fields using JavaScript.

We did this with an event registration site, where there was a primary registrant and they would add multiple attendees to their registration within 1 form.

As described in this answer, you can then trigger the notification emails when the Safecracker form is submitted.
> 0 votes

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


# Question
Title: Custom URL Segment for Member Profile Page
What's the best solution to let Members choose their own url-segment to display its profile?

I'm already using Solspaces «User» and «Zoo Visitor» as well as custom builded templates for profiles (like: domain.com/profile/1 … therefore no ee-templates like /member or /forum/member).

I would like to provide a text-field, where the members can define a url-segment like «macsteve» instead of the User-ID -\> domain.com/profile/macsteve instead of domain.com/profile/6547

**EDIT:** If I use the native user\_name-field as the url-segment for the profile-page I can edit mod.channel.php to update the {profile\_path}-tag to display the username instead of the member\_id … but I'm struggling with profile\_path in the forum-module… does someone already did these edits and may share where to edit the forum-files/-paths to get the username instead of author\_id into the profile-paths?

**EDIT 2:** Found it: mod.forum\_core.php line ~4090 change:

```
'path:member_profile' => $this->profile_path($row['author_id']),

```

… to:

```
'path:member_profile' => $this->profile_path($this->EE->db->query("SELECT username FROM exp_members WHERE member_id = ".$row['author_id'])->row('username')),

```

… you may need to change some other profile-path-variables in mod.forum\_core.php — since we've wrote a KISS-and-table-less forum template we need to change only this one declaration.

# Answer
i would go for the "username", and use that for the url-segment. All member add-ons including the 'official' one (as well as free\_member) support changing the user\_name

The main benefit is that the user\_name field already has validation in place to check that the entered name is unique and that it is a valid url (characters).
> 2 votes

# Answer
We do this on devot:ee with some PHP, which we could (and probably should) turn into a plugin. You can read more about it in this devot:ee news article from August 2009: New Feature: Custom Member Profile URLs. We let the user store info in one of the native member profile fields. We have a check in place to make sure they can only edit it once, and have an AJAX lookup on it to make sure they don't select something already taken.

We are not currently using any other member management-related add-ons other than User, and we don't even use that much.

I can't speak to your forum paths questions, because we're not using the forum profile page at all. We've hacked the forum to pieces and stripped out a bunch of things that were unnecessary for us in how we were using it. We're running the support "forums" through a normal template so we can do more with them.
> 2 votes

# Answer
If you are using Zoo Visitor, their `username` becomes their `url_title`. This normally happens automatically, behind the scenes when the user registers, but unless the Documentation says elsewise, than the user should be able to modify the `url_title` after the fact.

**Update:** There maybe some parity required between `username` in the Zoo Visitor channel to work with the EE Member Registration. So to allow editing, you should probably use the Zoo Member update form, rather than say, just SafeCracker.
> 1 votes

---
Tags: members, url, zoo-visitor, solspace-user
---


title: Location for saving a temporary file

text:
# Question
Title: Location for saving a temporary file
Is there a designated location for saving temporary files for serving to the user?

I dynamically create a PDF file and need to save it somewhere for the user to download. Which directory should I use to store these files?

# Answer
> 2 votes
There's no specific location set by ExpressionEngine. Addons use the cache folder for dynamically generated files, but if you're creating an actual PDF I would create a tmp directory in the public\_html directory.

---
Tags: add-on-development, filesystem
---


title: How to rename a tab?

text:
# Question
Title: How to rename a tab?
I've created custom tabs for the Channel entry form. Now, I want to rename it. The the toolbar for configuring the layout is open, I see a pencil icon to the left of my custom tab (as well as all the other tabs). When I click it, nothing happens. What am I supposed to see when I click that? Is that how I should be editing the tab name?

# Answer
Ahh, I realized this is for custom publish layouts. This is not possible by default. A add-on will be needed, use Rename Publish Tabs to accomplish this.

I'll add instructions too for changing the main menu tabs in case someone needs help in the future. To rename main menu tabs, click on your name in the CP (top right), then go to Main Menu Manger (left sidebar), you can rename your tabs there! You're limited to the custom tabs you created only. If you want to customize the entire CP menu, Zoo Flexible Admin is a great add-on.
> 2 votes

# Answer
You can't rename tabs. It's a system limitation. "Easiest" thing to do is create a new one and move your fields there. You can delete the old tab after.
> 1 votes

# Answer
As mentioned in this answer, Zoo Flexible Admin may cover this and is great for customizing navigation & tabs in the Control Panel.
> 0 votes

---
Tags: control-panel
---


# Question
Title: How can I remove filter options in Playa?
In my Playa field I've set a specific Channel, Author, and Status that the user will be able to filter on when on the EE publish page in the control panel. However it still presents a filter option to filter by Author and Status. The options available are only the ones that I set but even so I'd prefer to remove complexity and confusion by removing the option to add a specific filter — just search by typing in the box.

Is this possible? If so, how?

# Answer
> 3 votes
I am assuming that what you're asking is for a way to remove the +/- buttons that allow for additional filter menus (Category/Author/Status) to be shown to the user on the Playa drop panes interface.

If that's the case, the only way you can hide those (as far as I can see) is to use some JS or CSS. You can use CP CSS & JS to add bits of CSS or JS to the Control Panel.

Here is a jQuery snippet that will remove the +/- buttons. Note that you'll need to replace the field\_id (XX) with the actual field\_id.

```
$(document).ready(function() {
    $('#field_id_XX').find('.playa-dp-remove, .playa-dp-add').hide();
});

```

Or with CSS:

```
#field_id_XX .playa-dp-remove,
#field_id_XX .playa-dp-add
{
    display:none;
}

```

---
Tags: playa, filter
---


title: Looping Through All Channel Fields?

text:
# Question
Title: Looping Through All Channel Fields?
I want to display most of my Channel fields in a table (with some exceptions). Is there a way to loop through the Channel fields and display their labels and field values? Keep in mind that some fields are relationships and I need to use `related_entries` to access the correct data.

Also, I have created a custom publish layout (grouping related fields under certain tabs). It would be even better if I could output separate tables based on the tab organization in my custom publish layout. Doable?

# Answer
> 2 votes
Here's a loop for the Field Labels, assuming you want those as header cells above your Field Values in your table.

```
<tr>
{exp:query sql="Select CONCAT('field_id_',field_id) 'field_id', field_name, field_label
     from exp_channel_fields f join exp_channels c on c.field_group = f.group_id
     where c.channel_id = 1
     order by field_order"}
     <th>{field_label}</th>
{/exp:query}
</tr>

```

I don't think that takes into consideration Publish Layout order. I assume that's also in exp\_channel\_fields, but am not sure how it's stored. It does reference the Field Order you set in the field definition.

If you then looped through the entries in that channel, you might pass the entry\_id for each row into a nested template that will loop through these field IDs and get each value in the same order from exp\_channel\_data.

**Updated:** Trying to query all the corresponding fields in each pass of a channel:entries loop is going to be a lot of queries. Really what you want to do is use the first query to generate a string of column names, such as:

```
field_id_10, field_id_11, field_id_34, field_id_35

```

And then build that into another SQL query:

```
Select field_id_10, field_id_11, field_id_34, field_id_35
from exp_channel_data d join exp_channel_titles t on d.entry_id = t.entry_id where t.channel_id = 1
order by title asc

```

So the first query gets your column headings and can be used to generate a matching field list. The second query gets the field data in the same order as the field list, for every entry. I can't help thinking that should reside in PHP, because then you can use something like:

```
<td>query_result[0]</td>
<td>query_result[1]</td>
<td>query_result[2]</td>
<td>query_result[3]</td>

```

Without having to know the field\_id\_# names. You could also iterate over the length of the results array, so you wouldn't need to know how many fields are being returned. It'd be completely data-driven.

---
Tags: channel-entries, templates, publish-layout
---


title: Is this channel data query possible?

text:
# Question
Title: Is this channel data query possible?
Pseudo Query:

```
Select zoo visitor channel fields from exp_channel data
And author_id from exp_channel_titles (joined on entry_id)
Where channel_id = my zoo visitor channel
And author_id does not have an entry where channel_id = orders channel

```

In english - I want to select some user data for all users who do not have an order. Can this be done entirely in a query, or would PHP be necessary? This isn't strictly an EECMS question, but I'll bet someone here can help. If you can frame out what that query would look like, bonus points!

Here's the query I have now, which is the first 3 lines, but doesn't account for 'no orders':

```
select cd.field_id_XX as first_name, cd.field_id_XX as middle_name,
cd.field_id_XX as last_name, cd.field_id_XX as suffix,
ct.author_id as member_id from exp_channel_data as cd
join exp_channel_titles as ct on cd.entry_id = ct.entry_id
where cd.channel_id = "XX"

```

# Answer
> 4 votes
I think you would need a subquery to make this happen

```
select cd.field_id_XX as first_name, cd.field_id_XX as middle_name,
cd.field_id_XX as last_name, cd.field_id_XX as suffix,
ct.author_id as member_id
from exp_channel_data as `cd`
left join exp_channel_titles as `ct` on cd.entry_id = ct.entry_id
where cd.channel_id = "XX"
and (select count(*) FROM exp_channel_titles where author_id = ct.author_id and channel_id = 'XXX') = 0

```

---
Tags: mysql
---


# Question
Title: Upgrading to Assets 2 broke images and file uploads
**Problem**
After upgrading from Assets 1.0.something to 2.0.3, thumbnails stopped showing up and uploading broke. After doing some digging, I found some PHP errors hidden in the request log:

Excerpt:

```
<h4>A PHP Error was encountered</h4>

<p>Severity: Warning</p>
<p>Message:  fopen(/system/expressionengine/cache/assets/tmp_storage/assets_tmp_510bba325d6994.05248213): failed to open stream: No such file or directory</p>
<p>Filename: assets/helper.php</p>
<p>Line Number: 448</p>

```

Assets is using the cache folder in the CP folder ref. line 573-577:

```
$cache_path = self::_get_EE()->config->item('cache_path');
if (empty($cache_path))
{
    $cache_path = APPPATH.'cache/';
}

```

The webserver doesn't have write permission there. I've tried overriding the cache\_path of EE, but it doesn't seem to fix it.

Could anyone shed some lights on how to override the cache path for Assets? Do anyone know if there is a list of Assets config overrides somewhere?

**Details**
ExpressionEngine v. 2.0.5
Assets 2.0.4

# Answer
> 1 votes
Fred,

You will need to set system/expressionengine/cache to 777 permissions - or be on a setup where it is writable by your user and group without 777 permissions (such as how EngineHosting sets things up).

That should fix the writing to your cache file pretty easily. Are you having trouble writing any other caches? The easiest way to find out is to turn some template caching on and check those folders for files.

-Lisa

---
Tags: assets, pixelandtonic
---


# Question
Title: Ways method to protect members profile edit pages?
Just looking at finding the best ways ways to protect member profile editing pages.

I have members profiles set up under a template structure such as

```
members/profile/{member_id}/sub-page

```

Thats is fine, all these pages are public. I do however show, on the members own profile page, a link to edit their details. This is displayed via the conditional

```
{if segment_3 == logged_in_member_id}
   <a href="{path='members/account/{member_id}/profile'}">Edit Your Account</a>
{/if}

```

I then have the account edit pages such as (this is actually one template using switchee)

```
members/account/{member_id}/profile
members/account/{member_id}/password
members/account/{member_id}/avatar
members/account/{member_id}/notifications

```

But these pages should ***only*** be viewed by the logged in member, which at the moment is easily bypassed via just changing the `member_id` in the URL.

So what would be the best way to protect these pages, so if someone did try and change the `member_id` in the URL, they would not be able to access other users pages.

Thanks!

(And whilst I'm on this subject, is is possible to use the `username` in the URL as opposed to the `member_id` ?

Many thanks!

# Answer
> 5 votes
**Option 1: Use Conditionals**

In your `members/account/{member_id}/profile` template (or portion of your template, since you're using Switchee), you can wrap the profile-editing form and other content in a conditional to make sure the user can only edit their own profile. All other users can be shown alternate content (an error message in this example):

```
{if segment_3 == logged_in_member_id}
   {!-- Profile-editing template stuff here --}
{/if}

{if segment_3 != logged_in_member_id}
   <div class="error">You are not authorized to access this page.</div>
{/if}

```

**Option 2: Avoid segment variables and rely on your add-on(s)**

Another option, since you are using User and/or FreeMember, is to rely on their profile editing tags to take care of locking down the forms so that users cannot edit other user's profiles.

The FreeMember update\_profile tag is automatically tied to the currently logged in user.

Or with User's edit tag you should be able to specify the member\_id parameter to be `{logged_in_member_id}` to limit the edit form only to the currently logged in user.

With either of these two add-on-specific methods you don't need to rely on the `member_id` being in the URL and so you avoid the issue entirely.

# Answer
> 0 votes
By far the simplest way is to use a conditional to check the logged in member ID against the member id in the url. As mentioned in Alex Kendrick's answer.

```
{if logged_in_member_id == segment_3}
    stuff only visible to member
{/if}

```

---
Tags: members, url, member-details
---


# Question
Title: Prevent/Purge Local Caching of S3 Files with CE Image
We're running a portfolio site for a photographer using EE, and he's got about 2 gigs worth of JPEGs on S3. CE Image is used to create two versions of each photo in his portfolio (thubmnail and web-sized).

The problem is, when CE Image does this, it stores a copy of the original source image, as well as the two processed versions, in the local directory specified by `ce_image_remote_dir`, even though the output is going to S3.

```
{exp:ce_img:pair src="{url-to-source-on-s3}" quality="85" max_width="980" bucket="s3-bucket-name" cache="yes" refresh="600"}
    {aws_url}
{/exp:ce_img:pair}

```

As a result, we end up with a full copy of everything the client has on S3 on the EE box; is there any way to prevent the storage of, and/or automatically purge the files in `ce_image_remote_dir`?

# Answer
> 3 votes
> is there any way to prevent the storage of, and/or automatically purge the files in ce\_image\_remote\_dir?

There is not a way to accomplish this with the default extension, but you could accomplish this with a custom one to meet your needs.

PHP has to have a local copy of the image in order to manipulate it. Additionally, it's much faster to check whether or not an image exists on the local server than to perform an http request to check if it exists on S3.

You're still getting the speed benefits of S3, as the manipulated image is being served from the CDN, as opposed to the local server's filesystem.

The S3 extension for CE Image is currently included for no additional charge with the purchase of CE Image. Since you are unhappy with how it works due to the large storage requirements of your site, you could always create a similar extension (using the same hooks) that syncs all of the file data with your local database, and then purges the source and manipulated images from the local server after uploading the later to S3.

---
Tags: ce-image, cache, s3
---


# Question
Title: Can I Edit (make dynamic) the Subject of an Exp:resso Store Order Confirmation Email Template?
How can I alter the subject of an order confirmation email? My client does different promotions throughout the year, and I'm looking to put a variable in the subject, if possible. For example, right now "Cool Company Order Confirmation - Spring Promotion", and then later in the year "Cool Company Order Confirmation - Fall Promotion"

The alternative is to rename the Email Subject periodically, but I'd rather pull a promotion name from the checkout form that generated the order.

# Answer
> 1 votes
You can use the Store custom fields in the email subject, such as:

```
CONFIRMATION: Publication Order - {order_custom9}

```

We're doing this for a client. The data for the field is filled in by a hidden input, for us. But I imagine there maybe other ways to submit it to Store.

Since your promotions aren't always available, you probably want to use an {if statement on whether the promotion is submit to the custom field, and make sure the custom field gets the dash, as well

```
- Fall Promotion

```

So it would only display if the data was submitted to the field.

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


# Question
Title: Upgrading a site from 1.x to 2.x - how to merge back into production?
I am upgrading and redesigning a mid-size, member-driven site from 1.7 to 2.5. I have created a local development environment and upgraded it successfully. Work on the updated templates and so on is happening right now. The question I have is: what will be the best way to merge my changes back into the production site? Obviously, there are database changes between 1 and 2, as well as template tag changes. I will also need to install new add-ons and make other changes that affect the database. Is there any better way to handle this than by manually merging each DB table when I finish? That will work, but it's going to be a huge pain. How have other people handled combination upgrade/redesigns on live sites?

# Answer
Typically speaking there's two ways to handle this, in both, you do what you've done and run through the upgrade once to get all of it working, templates working, etc. Then you do one of the following:

1. Take the site offline, run through the upgrade again to update the database and all content. Then copy over your files from the previous upgrade, run any add-on installs and changes you need to, and bring the site back online.
2. Or, take the site offline, run through the upgrade again but use your previous upgrade as the 'master' version, and copy over any new data and members from the newly upgraded site to your master version, then re-launch that one.

I really wouldn't recommend trying to merge tables from the EE1 to the EE2 site, that will just be a mess. On the other hand, there isn't really a super clean way to launch a 1-2 upgrade on a site with a lot of content coming in.
> 2 votes

---
Tags: upgrade, deployment, staging-server
---


# Question
Title: Is there a way to require a checkbox field on a Log In form?
I've set up a standard exp:member:login form for members-only content. My client has requested that I add a checkbox field that would require users to check before they would be allowed to log in. It doesn't appear that the standard login form allows for "rules:" parameters. I've looked around on Devot-ee, and I haven't seen anything that looks like it would fit the bill.

Is there a way to do this using standard EE tags/parameters? Or maybe an add-on that would allow me to add this functionality? If not, do you have suggestions for how I might build this?

# Answer
> 1 votes
Why not just use Javascript to require the field be checked? That would seem to be the simplest solution to me, since it's just a couple of lines of JS to require it. It could be gotten around by turning JS off of course, but unless it's legally vital, I wouldn't worry about that too much.

You can also, I believe, require custom fields using Profile:Edit or Zoo Visitor if you have either of those installed, since they both build off the SafeCracker tag that allows that.

---
Tags: login
---


# Question
Title: Freemember Update Profile forms not working
Another day, another question!

I've started using Freemember (really like the inline validation).

So i have an update password form.

```
{exp:freemember:update_profile return="members/account/{member_id}/password/success" require="current_password" error_handling="inline" form_class="update-account"}

    <p>In order to change your password you must first enter your current password.</p>

    <div class="control-group">
        <label class="control-label">Current password</label>
        <div class="controls">
            <input type="password" name="current_password" value="{current_password}" class="span11" />
            <span class="help-block">{error:current_password}</span>
        </div>
    </div>

    <p>You can now choose a new password. For security, we recommend a minimum of 6 characters.</p>

    <div class="control-group">
        <label class="control-label">New password</label>
        <div class="controls">
            <input type="password" name="password" value="{password}" class="span11" />
            <span class="help-block">{error:password}</span>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Confirm new password</label>
        <div class="controls">
            <input type="password" name="password_confirm" value="{password_confirm}" class="span11" />
            <span class="help-block">{error:password_confirm}</span>
        </div>
    </div>

    <input type="hidden" name="username" value="{username}" />

    <button type="submit" class="btn btn-green" name="submit" value="Update Profile">Update My Profile</button>

{/exp:freemember:update_profile}

```

it validates inline perfectly, however it does not actually change anything. i.e, if I put in the right "current" password, and change the password, it refreshes, but it does not redirect and no setting are changed.

Any ideas?

# Answer
To troubleshoot forms which are submitting but not displaying errors, you should always remove `error_handling="inline"` as a first step (as Justin mentioned). This means all errors will be displayed, in case you have forgotten to template any inline errors.

To clarify what it sounds like your underlying problem was: If any custom member fields are marked as "required" in the ExpressionEngine member settings, they will be required in FreeMember. When using FreeMember, it's much easier to not make any fields required in the ExpressionEngine member settings - just use the FreeMember validation parameters (such as `require=""`) to make the fields required in your actual registration/update templates.
> 2 votes

---
Tags: forms, validation, freemember
---


# Question
Title: In Expresso Store, how do I use my own buttons for modifiers in place of <select> menus?
Expresso Store's default behavior is to output modifiers as menus. This makes sense when the product is a T-Shirt and the variations are predictable: you have a modifier for size (with options for S, M, L) and a modifier for Color (red, orange, yellow, green). Expresso Store outputs each modifier as a menu, and the built-in Javascript updates the price variable and appropriate SKU so that the correct item is added to the cart when the form is submitted.

But this UI isn't great for things like tickets, where you want to display the modifiers all at once. Suppose each product is a single production, with modifiers for dates and seating. How do you output buttons (essentially radio buttons) so the user can see all their options before clicking anything?

# Answer
Answering my own question as I think this is useful. Adrian at Expresso helped me out.

Basically, we output the menus and also output custom buttons. Then we just hide the menus with CSS. This presumably avoids writing lots of new custom Javascript or introducing new dependencies to the way the form is processed by Store.

See this jsFiddle

**EE code**

```
{!-- EE/Store code for the <select>s that actually control what gets added to the Cart: --}
{modifiers}
    <select id="{modifier_input_name}" name="{modifier_input_name}">
        {modifier_options}
            <option value="{option_id}">
            {option_name} {if price_mod_val} ({price_mod}) {/if}
            </option>
        {/modifier_options}
    </select>
{/modifiers}

<!-- EE/Store code for radio buttons:-->
{modifiers}

<ul class="radio-set">

    {modifier_options}
        <li><a class="radio" data-select="{modifier_input_name}" data-option-val="{option_id}" href="#">{option_name} {if price_mod_val} ({price_mod}) {/if}</a></li>
{/modifier_options}
    </ul>
{/modifiers}

```

**jQuery Code**

```
$(document).ready(function() {

    // highlight the first button, since it corresponds to the (default) <option> in the <select>
    $("ul.radio-set li:first-child a.radio").addClass("active");

    // button clicks: we only need the buttons to change the <select>, not the other way around (since the select will be hidden by CSS
    $('a.radio').click(function() {

        var this_button = $(this);
        var this_ul = this_button.closest("ul.radio-set");
        var neighbor_buttons = this_ul.find('a.radio');

        // remove highlights from all buttons in this group
        $(neighbor_buttons).removeClass("active");

        // highlight this buton
        this_button.addClass("active");

        // get the corresponding select menu
        var select_id = $(this_button).data("select");
        var select = "#"+select_id;

        // get the value of the corresponding option
        var opt_val = $(this_button).data("option-val");

        // Update the select menu with the option content and trigger change() for Store
        $(select).val(opt_val).trigger('change');

        return false;

    });

});

```
> 4 votes

# Answer
What about:

```
{modifiers}
    {modifier_name}:
    {modifier_options}
        <label><input type="radio" name="{modifier_input_name}" value="{option_id}" /> {option_name}</label>
    {/modifier_options}
{/modifiers}

```
> 3 votes

---
Tags: add-on, expresso-store, javascript, jquery
---


# Question
Title: DataGrab Error: "Cannot open file/url" only on production server
I'm having an issue similar to this: http://brandnewbox.co.uk/forums/viewthread/644/

I'm getting "Error: Cannot open file/url" when I try to configure an XML import. I'm building an XML feed with an EE template and then trying to access it Datagrab via a URL. This works for me locally but not on the production server.

If I save an XML file, upload it to my server and then get Datagrab to access thru the server file path, it works fine. I just can access from a URL.

Andrew Weaver mentions in the thread above that PHP might be configured to not allow files to be read over http. Any idea how I could change this setting? Is this something I could fix in a php.ini or .htaccess file?

Any idea what's going on here? Or if there's a more descriptive error I could find by enabling a debug more or looking in a log file?

The problem started when I upgraded from v1.5.0 to v1.7.5. I'm also on a Media Temple grid server.

# Answer
I found the simple solution to this. I just needed to add this line to my .htaccess file to allow PHP to access files across http.

```
php_value allow_url_fopen On

```
> 3 votes

---
Tags: xml, datagrab
---


# Question
Title: How to count number of times a channel entry was viewed in frontend?
Say I have a Channel calls "Products" that contain individual product information. Is there a way to set up EE so it can keep count of the number of times the product was viewed in the front end?

# Answer
ExpressionEngine has 'view tracking' functionality, built into the system, that can be used. Be aware that it can cause a performance hit for heavy traffic sites.

If your site receives a lot of traffic, you may wish to turn off (disable) EE's tracking capabilities and use a third party add-on, such as Solspace's Tracker. Tracker has some intelligence involved, and tries to exclude traffic from bots and search engines.

Here's sample code for using EE's internal `view_count`

```
{exp:channel:entries channel="books" orderby="date" sort="desc" limit="1" track_views="one" disable="categories|category_fields|member_data|pagination|trackbacks"}

<h2 class="title">{title}</h2>
<p><b>Author</b>: {book_author}
<br /><b>Publisher</b>: {book_publisher}</p>

{book_review}

{/exp:channel:entries}

```

Just adding the `track_views="one"` to a single article/view page, will start the view count process. To display, the number of views or to just sort by popularity, you would then use `view_count`.

If you are using the Tracker Module, you would add the view count like so

```
{exp:channel:entries channel="books" orderby="date" sort="desc" limit="1" disable="categories|category_fields|member_data|pagination|trackbacks"}

{exp:tracker:track channel="books" entry_id="{entry_id}"}

<h2 class="title">{title}</h2>
<p><b>Author</b>: {book_author}
<br /><b>Publisher</b>: {book_publisher}</p>

{book_review}

{/exp:channel:entries}

```

Tracker, also provides an interface for looking at the data internally in the control panel.

This can be beneficial, when you want to see popularity, but don't want to display it on the front-end of the site.

Either way, don't forget to set-up one or two Google Analytic Dashboards. Dashboard Junkies create some of my favorite GA Dashboards. See this one for tracking sales, Dashboard 11: Sales Cockpit

You can add them to your Google Analytics account, to dive into your data, faster. As well as customize them to better suit your website. You probably want to add some data funnels as well, so you can see, if and when users drop out of the sales process.
> 3 votes

# Answer
ExpressionEngine does have an Entry “Views” Tracking Tag

However, it's probably better to use something like Google Analytics for this. The problem with counting views from server hits is it will include things like GoogleBot indexing your site, which isn't particularly helpful for telling which page is the most popular. I'm not aware of any plugins which can access the Google Analytics API to return the view count for a particular page, but it's certainly possible, so a plugin may exist, or you could create one.
> 0 votes

---
Tags: channel-entries
---


title: CartThrob Checkout as Member

text:
# Question
Title: CartThrob Checkout as Member
I've set up a form on a site for super-admins to check out as other users, , making use of the member\_id parameter found here - http://cartthrob.com/docs/tags\_detail/checkout\_form/index.html#member\_id . This is being used, essentially, to gift a purchase to these users, who need this purchase to do certain things on the site.

Here's the opening tag I have:

```
{exp:cartthrob:checkout_form
id="checkout_form"
name="checkout_form"
return="/foo/bar"
gateway="ct_offline_payments"
required="first_name|last_name|phone|address|city|state|zip"
cart_empty_redirect="/foo/bar"
member_id="{segment_3}"
price="0"
}

```

However, when I use the checkout form, my orders are going in with the user id of the admin checking out. I also notice that forum topics on the CT support forums with responses as recent as November, like this one - http://cartthrob.com/forums/viewthread/4636/ \- reference a separate extension and custom fields to do this.

Does anyone have familiarity with doing this, or has used the parameter above effectively?

# Answer
> 2 votes
I think the member\_id param only works when checking out with a subscription. So either the docs are wrong, or this is a bug. I think you'll have to use that extension to get it to work properly.

---
Tags: cartthrob, ecommerce
---


# Question
Title: Transferring data from one field to another
I have a current checkbox field which contains 8 options.

I want to change this field to a P&T checkbox field, to make use of the `option_name : Option Label` ability.

I've been told I can run an SQL find and replace from within the CP, but I've never done this before.

My field ID for the original field is id=6, and the new one is id=38

Can anyone help me with how I can transfer (or copy) the channel entires data from one field to another? Thanks!

**Update**

Thanks for the suggestions, will take a look at the fields now, and try it out.

Just so I'm sure i'm not doing anything unnecessarily, I am moving the data to a P&T field, as I need the ability to put the label and value. In order for the following code to work...

```
{walk_features_new}

    <li class="{option_name}"><strong>{option}</strong>
     <p>
      {if "{option_name}" == "option1"}Description for option 1{/if}
      {if "{option_name}" == "option2"}Description for option 2{/if}
      {if "{option_name}" == "option3"}Description for option 3{/if}
      {if "{option_name}" == "option4"}Description for option 4{/if}
      {if "{option_name}" == "option5"}Description for option 5{/if}
      {if "{option_name}" == "option6"}Description for option 6{/if}
      {if "{option_name}" == "option7"}Description for option 7{/if}
      {if "{option_name}" == "option8"}Description for option 8{/if}
    </p>
    </li>                               {/walk_features_new}

```

I am right in think that this would not be do-able with the standard checkbox field, as I could only output the `{option}` right?

Cheers!

# Answer
You can run this SQL:

```
UPDATE exp_channel_data SET field_id_38=REPLACE(field_id_6, "|", "\n")

```

Where field with id 38 would be P&T checkboxes and field with id 6 would be checkboxes.

This SQL would work fine although it would be better if you can take a backup of database table exp\_channel\_data.
> 1 votes

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


title: Dynamic Main Navigation?

text:
# Question
Title: Dynamic Main Navigation?
Is there a way to dynamically create a main navigation (e.g. every template group appears in the main nav)? I want to set up EE so that when the client/user adds pages, they'll appear as either a new item in the navigation, or an item under the navigation, etc.

I'm trying to avoid having the client/user actually make edits in the templates.

# Answer
> 1 votes
With the top nav it's a little trickier, but with the sub nav within a given section, I do that all the time. I tend to think of top nav as being fixed, not only programmatically, but from a business perspective, your top nav is a representation of what you do, so planned accordingly, it may not change often (obviously, this depends on what you do). The pages within a given section though, I tend to approach with entries creating pages within the given section, and therefore i can choose whether they display in the top nav. I can make it to that ever page appears as a dropdown item within a given channel's main nav item, or i can even make that optional by adding an admin/owner checkbox or something like that to indicate whether the item should os shouldn't be included in the top nav. I've also done things like an alternate title field for use in the dropdown nav (since the "real" title may be a bit long so you might want it represented differently in the navigation, for example).

Taking that approach requires a bit of planning, but I do it often and it works just fine. As nonprofit\_tech indicated, having your client creating templates groups, etc. means more work for them than the simple creation of entries, so it may not be ideal.

# Answer
> 0 votes
This is probably easiest, if you matched `template_group` names to `channels` or `sections` of the site. You would basically create a custom query, that pull just not excluded channels. This assumes, there are some channels, where data is combined into a different section, or that are used for utility purposes, like `sectional_text` or `transactions`, etc.

```
SELECT channel_title, channel_description, channel_name, channel_url, total_entries
FROM exp_channels
WHERE channel_id
NOT IN ('15','14','13','9','2','17','4')
ORDER BY FIELD(channel_name,'item2','item5','item4','item1');

```

You can also custom order them as needed. You don't need to pull `channel_description` and other options if they won't be used.

You'd, of course still need the run the subqueries for generation, the page listings under the main `section` navigation. But that should get you started. The primary point is to use MySQL's `NOT IN` so you can list out the excluded items, since they are far less likely to change.

Though it occurs to me, if you don't have clients creating new template groups, why would you have them creating new channels. So this response, probably isn't exactly what you are looking for.

---
Tags: templates
---


# Question
Title: How can I quickly create files for all of my templates?
I'm working on a site with hundreds of templates that were all saved in the database. If I run a query to change "save\_template\_file" to "y" and then run synchronize, will that work? Any horror stories around doing this?

# Answer
Does running the query & sync create the files? In the past I've had to export all the templates. That will create a default\_site.zip open that, dump that into where I'm saving templates and then run the query to change save\_template\_file to 'y'
> 3 votes

# Answer
The query you'd use to change all templates to be saved as files is:

```
UPDATE `yourDBname`.`exp_templates`
SET `save_template_file` = 'y';

```

And if you wanted to limit it to only a certain group you'd use the following:

```
UPDATE `yourDBname`.`exp_templates`
SET `save_template_file` = 'y'
WHERE `exp_templates`.`group_id` =X;

```

Change out `yourDBname` for your actual database name in both cases and change `X` for the number which equals your template group\_id number in the second case.

You could run this direct from the SQL tab in PMA (phpMyAdmin) or using a tool like Sequel Pro or Navicat etc.

**Make sure you have a DB backup first of course!**
> 5 votes

---
Tags: templates
---


# Question
Title: Body field of an entry(channel) not being styled?
I hope this is the right place, not sure if its a css issue, or whether or not it has something to do with what EE is doing.

I have a news channel setup, with a main "body" field. This is a textarea. When the entry is outputted, it doe not take on the css styling. I do not have this problem anywhere else within my templates, just these main body fields.

When I inspect it, all the HTML markup is there, however its just plain straight text.

Could EE be having any play in it, or am I missing something with regards to my css?

# Answer
> 1 votes
If the field is a textarea type then it will be devoid of styling. Further to that there should be some simple options like auto br, none, can't recall the rest when you set the field up or edit it, these options are helpful dependant on how you want the field to behave.

if you wrap your tag in

tags in your template you'll at least get proper p styling, combine with setting your textarea field up with auto br you'll then get line breaks.

if you want more control, try making it a rte field or look at devot-ee for wysiwyg field types like wygwam or editor.

failing all that and I've misread your post can you throw up some screen shots of how you've set up your field.

---
Tags: css, richtext
---


# Question
Title: Exp:resso Store - Change checkout button from input to href
I am using a custom button which uses a href and I was wondering if it is possible to change the input submit checkout button from using an input to using a href?

So from something like this

```
<input type="submit" name="submit" value="Add to Cart" class="btn btn-primary" />

```

to

```
<a href="#">Add to Cart</a>

```

?

# Answer
> 1 votes
Not possible, because an `<a>` element doesn't submit the form.

If you don't like `<input type="submit">`, you can also use `<input type="image">` or a `<button>` element, and you are free to style all of these however you like using CSS.

---
Tags: expresso-store
---


# Question
Title: Problem setting Fieldframe path on EE 1.x site
I'm trying to recreate an EE 1.7 site locally under MAMP but whenever I enter the correct Fieldframe path, I get a blank page in the CP with:

> Notice: unserialize() \[function.unserialize\]: Error at offset 85 of 99 bytes in /system/core/core.extensions.php on line 235
>
> Warning: array\_merge() \[function.array-merge\]: Argument #2 is not an array in /system/extensions/ext.fieldframe.php on line 301

Without the correct path the CP renders but I still get the notices above as well as these ones:

> Warning: Cannot modify header information - headers already sent by (output started at /system/core/core.extensions.php:235) in /system/core/core.functions.php on line 752
>
> Notice: unserialize() \[function.unserialize\]: Error at offset 85 of 99 bytes in /system/cp/cp.utilities.php on line 288

Obviously, I'd like to get Fieldframe working properly because I need to use Matrix. ;)

# Answer
> 1 votes
I normally bootstrap the EE1 config with https://gist.github.com/3188642

Assume you have the latest FF?

---
Tags: fieldtype
---


# Question
Title: Is it more efficient to use native image manipulations or a plugin like CE Image?
I've been using the outdated Imgsizr plugin for ages, but now I'm looking to update to something more efficient, etc. It's worth mentioning that I'm using Assets 2 for all uploads, and would eventually like to move all images to an s3 bucket.

I've played around with the native EE image manipulation settings. It seems that it would be much easier to control various image sizes through the native method, especially since I would be able to resize and regenerate all of these thumbnails at once from a centralized location, rather than rely on the first pageview from a user.

What are some pro/cons of using the native method vs using CE Image?

# Answer
> 19 votes
I'm the author of CE Image and a long-time EE user. I'll try to be impartial in my response, as both methods definitely have pros and cons.

**Native Pros**

* The manipulations happen 1 time, up front.
* You can regenerate the images anytime you need.
* You can set up multiple sizes.
* It's free (well, you get it with the EE license).

**Native Cons**

* If the sizes ever change, or the images need to be used at a different size, you will need to regenerate the images.
* Not as powerful or flexible as CE Image.
* All of the images in an upload location will be resized to the specified sizes, whether you need them to be or not.

**CE Image Pros**

* You and your clients don't ever need to go into the control panel setting to generate (or regenerate) images, or segregate lots of different upload locations in order to only size specific images. This is particularly nice when some images may be used in different parts of the site, and you don't want to have to upload them to multiple upload locations.
* Works with remote images (image URLs from other sites).
* You can customize and resize images only when/where they're needed, as opposed to which upload directory they happen to be in.
* You can manipulate the image names, cache directories, etc.
* Automatically resize images inside WYSIWYG fields (and HTML) using the Bulk tag. So if your clients insert a large image into a WYSIWYG field (or an image from a different site that is large) and scale it down, it will be resized and compressed into a more manageable size.
* More customization than the native settings. For example, on a photo gallery site, you may want to crop your images from the top, instead of from the center (so you don't decapitate people in the photos).
* Great image handling and compression.
* Images are cached, so the image manipulation only has to happen once.

**CE Image Cons**

* There will be a slower page load the first time an image is manipulated.
* Will be run on each page load and can result in slightly slower page speeds. This is not too big a deal if you use native tag caching `cache="yes" refresh="600"`, and virtually eliminated if you use a more robust caching solution.
* It costs money.

**Notes**

There are probably more pros and cons than I have listed here. Ultimately, the native solution shines because it resizes the images up-front. CE Image shines because of its flexibility and power.

# Answer
> 2 votes
I'm using CE image for serving up thumbs and and main images that populate a slider on each of my main single page views. I have played around with the settings and adjusted the quality of the thumbs down to 60, with default sharpening. They look really good on both 27" screen and retina devices. After the initial "call" they serve up nice and quickly. The only thing I've ever been a big concerned over is the fact that all images get made into one single folder, but I've been running my site for almost a year and not had any problems.

---
Tags: image, ce-image
---


# Question
Title: Running an EE site on IIS. What are the "gotchas"?
I may be taking on a project for a large EE site that would most likely be running on IIS. Although I have some very minor experience of IIS I have never run PHP on it let alone an EE site. I don't envisage problems with getting things sorted on the server since the company I will be working with are an IT firm.

Are there any specific things I should be looking out for with regards to running an ExpressionEngine site in this environment?

# Answer
If at all possible try to convince the client to let you run WAMP. I had to manage an IIS EE site for 3 years and it was an absolute nightmare.

1. Make sure you have .php set as a default document and higher priority than .html.
2. You may want to purchase ISAPI\_Rewrite, which would allow you to use an .htaccess for any URL rewriting.
3. Permissions are a nightmare. You have to use the Windows Explorer "permissions" interface to set upload directories and whatnot.

The biggest recommendation I have is reading through Microsoft's guide. Let us know if you run into anything crazy and I, for one, am happy to help.
> 3 votes

---
Tags: server, windows, iis
---


# Question
Title: Buy one get one free sales with exp:store
Using Exp:resso's store addon, is it possible to do buy one get one free type sales?

I see the promo codes but they dont seem to have the option to require more than one item in the cart to use it or anything like that

# Answer
> 2 votes
There's no way to do this using promo codes and Store. You would be able to create an extension to do this using our custom hooks.

The ability to create discounts like this is high on our feature request list and will be addressed in a future version (though there is no specific timeframe, so if you need it now it's best to go with an extension).

# Answer
> 1 votes
From recent memory of trying this. As of the current version this isn't available. Best bet would be a custom extension.

---
Tags: expresso-store
---


title: {size} is displayed unformatted?

text:
# Question
Title: {size} is displayed unformatted?
I have the following code:

```
    {cf_concerts_media_assets var_prefix="asset"}
        <li><a class="download_icon" href="{asset:url}">{if asset:title}{asset:title}{if:else}{asset:filename}{/if} ({asset:size})</a></li>
    {/cf_concerts_media_assets}

```

with or without the prefix it is rendering the size in bytes instead of the formatted version? I am on EE 2.5.5 and assets 2.0.3

cheers stefan

# Answer
Yeah, there was another bug which prevented this from working with var\_prefix. Will be fixed in the next release, but you can just replace line 553 in helper.php with

```
if (empty($file_vars[$var_prefix.$key]))

```

and that should hot-fix your issue while we get the next release out the door.

Cheers, Andris
> 1 votes

# Answer
This should have been fixed in Assets 2.0.4, which we released today.
> 2 votes

---
Tags: assets
---


# Question
Title: Change status of an exp-resso store entry using safecracker
On a website/webshop running EE 2.5.5, and Exp-resso store 1.6.2 i'm trying to simplify the stock keeping process. I'd like to close an entry with a safecracker form.

For test purposes i created a new, blank template with only the following code:

```
{exp:safecracker channel="products" return="" entry_id="{segment_2}" }

<select name="status" id="status">
    {statuses}
            <option value="{status}"{selected}>{status}</option>
    {/statuses}
</select>

<input type="submit" name="submit" value="Apply" />

{/exp:safecracker}

```

I change the status, press "submit" and get an error:

> A Database Error Occurred
>
> You must use the "set" method to update an entry.
>
> Filename: third\_party/store/models/store\_products\_model.php
>
> Line Number: 315
>
> « Back

The strange thing is: the status does change, so i'm not sure why i'm getting this error.

Inside the store\_products\_model.php the lines around 315 look like this:

**I want to change the status on the front end using safecracker, error free. What should I do?**

A workaround question might be:

**How can i change the status without triggering the store\_products\_model?**

# Answer
Adrian wrote a fix. I can now use Safecracker to change the status without errors.

The fix wil be included in the next release of exp-resso store.
> 0 votes

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


# Question
Title: Website's Company Information Stored In A Channel - good or bad?
I created a channel that has fields like:

* company name
* address
* a matrix of daily working hours
* etc

Throughout the site, I need to display bits and pieces of this data. Does that mean I need to use `exp:channel:entries` every time to get the info? Seems expensive.

# Answer
> 7 votes
If the project has relatively low needs in terms of site-wide data (read, If you don't need custom fields), then I tend to store these in global variables and snippets.

When I need to store more advanced content, I personally use low variables. Pretty much a default now on medium or big EE builds. You can then use custom fields like Matrix, Wygwam, playa, etc. The native custom fields it offers are also great and worth looking into. Not to mention the fact that you can tweak parse order ... do I sound enthusiastic?

# Answer
> 0 votes
You can approach it as a channel entry with decent performance if you store the bits you need for re-use with Stash. Low Variables may be the approach I would prefer for bits like this, but I have done it with channel entries and stash before and it has worked well, stashing content bits with a scope of "site" and with a high refresh interval since this type of content is not likely to change often.

---
Tags: channel-entries, channel, global-variables
---


title: Unable to access site after upgrade?

text:
# Question
Title: Unable to access site after upgrade?
OK, I've just tried upgrading from 2.5.2 to 2.5.5, and it didn't go well!

I managed to run the installer, and it got me to the confirmation screen, where I deleted the installer, I can access the login page, and enter my details, and it starts to login in then sits on this url

`http://mydomain.co.uk/admin.php?S=0&D=cp&C=login&M=authenticate`

Nothing happens (in Safari) and in Chrome, it says 500 Internal server error.

As this didn't work, I removed all files and uploaded my backup, and now I'm still getting the same!

Any ideas?

**UPDATE**

Changed debug `$debug = 1;` in admin.php, and now get the following error on the admin page.

**UPDATE 2**

OK, so went into database and had a look at the exp\_security\_hashes table, and I had a field titles session\_id, I changed this to ip\_address and it seems as though its now up and working.

Will keep an eye out and see what happens!

# Answer
> 1 votes
It sounds like an extension issue if it gets stuck on that URL. That's just a guess though.

Turn on the debug setting to get a better sense of what's happening. This will show errors to the screen when the pages loads.

In your config file change or add this:

`$config['debug'] = '1';`

This should help print the error message(s) to the screen. If you aren't sure what they mean you can update the post with that information.

If error messages don't show up after that, you can check your apache error log on the server. Do you know how to find that?

# Answer
> 1 votes
I have had that happen before when the permissions of the index.php or admin.php got uploaded without being executable. Give that a look.

---
Tags: upgrade, updating
---


title: Grouped <select> custom field?

text:
# Question
Title: Grouped <select> custom field?
I have a safecracker form that allows users to post location details. At the moment, I use a combination of a standard for them to choose the country, and the reegion select fieldtype to select the UK county. Based on there selections, I manually add the category based on these selections.

I am looking for an easier way for the user to add the details in teh safecracker form, and what I would ideally like, is a way for them to choose just the county, from a grouped select.

Something like:

Which would be,

England

* County
* County
* etc

Scotland

* County
* County
* Etc

and so one.

This means they only have to make one select within the form, and it would be easy to validate. Is there a way to produce this type of dropdown from an EE field, that would also be compatible with safecracker and its inline validation?

I'm thinking I could also make this a grouped category dropdown maybe? Although I do like to have the country/county replicated in normal fields as it's easier to pull into templates.

Any help appreciated!

Thanks!

# Answer
> 2 votes
Absolutely - you can use the P&T Dropdown fieldtype (part of the free P&T Field Pack). You'd setup your options in the fieldtype settings like so to create grouped options:

```
 : Select your county
England
    County 1
    County 2
    County 3
Scotland
    County 1
    County 2
    County 3

```

---
Tags: custom-fields, channel, fields, drop-down
---


# Question
Title: Pagination works when using /group/template, but not when using /
I'm breaking my head over this one. maybe it's pretty simple, and am i just being blind. however, something is not going right with pagination. On the homepage we want to display general info, a content slider, and the lates 5 projects, with a pagination for the older projects.

All things are parsed nicely, except when it comes to the pagination. When i call the homepage(www.domain.com) the pagination is not working. I see the pagination buttons, but the items are allways the same, the latest 5. However, if i call www.domain.com/site/index, everything works the way it should.

```
{exp:channel:entries channel='algemene_teksten_nl' limit='1' dynamic="no" url_title='home'}
{embed='_inc/.header' pagetitle='{algemene_teksten_nl_browsertitle}' pagedescription='{algemene_teksten_nl_description}'
}
{/exp:channel:entries}
{embed="_inc/.home-boxes"}

```

And the embed is

```
{exp:channel:entries channel="projecten_nl|boxes_nl" status="not niet-op-home" limit="5" paginate="bottom" paginate_base="/" dynamic="no"}
<h2>{if channel_short_name == "projecten_nl"}{box_title}{if channel_short_name != "projecten_nl"}{title}{/if}</h2>
{paginate}
            {pagination_links}
                <ul class="pagination">
                    {page}
                        <li{if current_page} class="current"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
                    {/page}
                </ul>
            {/pagination_links}
        {/paginate}
{/exp:channel:entries}

```

And oh yeah, i'm on 2.5.5...

# Answer
i figured it out. i had Zoo triggers installed. i wasn't using it, but in the output profiler i saw it did get called. i had to de-install it completely, but the issue was gone...

guess i'll be back soon for some help with categories and archives....
> 0 votes

# Answer
I wanted to expand a bit on my earlier comment but couldn't edit it so here I go.

The `pagination_base` parameter allows you to specify a specific template that will be used for pagination oppose to the default behavior of EE which would be to use the current URL. A perfect example of when you might want to use this would be if you had a blog (with the url structure domain.com/blog/articles) and on the homepage you wanted to show 5 of the most recent articles. Lets say that you want to then have the viewer directed to your paginated entries if they wanted to view more articles from your blog. So in your template you would have soemthing along the lines of:

```
{!-- Homepage template snippet --}
{exp:channel:entries channel="blog" limit="5" paginate="bottom" pagination_base="blog/articles"}
<a href="{url_title_auto_path}">{title}</a>
{custom_field}

{paginate}
{pagination_links}
    <ul class="pagination">
        {page}
            <li{if current_page} class="current"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
    </ul>
{/pagination_links}
{/paginate}
{/exp:channel:entries}

```

This would allow the user to view the 5 most recent articles then when they clicked on the pagination link the page that would be loaded would be domain.com/blog/articles/P5. For that template to actually load the next set of articles you would need to have the following:

```
{!-- blog/articles template snippet --}
{exp:channel:entries channel="blog" limit="5" paginate="bottom" }
<a href="{url_title_auto_path}">{title}</a>
{custom_field}

{paginate}
{pagination_links}
    <ul class="pagination">
        {page}
            <li{if current_page} class="current"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
    </ul>
{/pagination_links}
{/paginate}
{/exp:channel:entries}

```

Since we are already on blog/articles we no longer need to add `pagination_base="blog/articles` as EE will default to that since it is in the URL.

Another example of when you would possibly want to use `pagination_base` would be in the event that you are wanting to load your entries via AJAX and dont want to add the weight of loading your entire template. A while back I wrote an article on my blog about implementing an (infinite-scroll script) where I used the `pagination_base` parameter.
> 1 votes

---
Tags: pagination
---


title: Param Parse Order Question

text:
# Question
Title: Param Parse Order Question
Lets say I have this code

```
{exp:channel:entries
  limit="3"
  channel="inventory"
  paginate="bottom"
}
...
{/exp:channel:entries}

```

Lets say I want to make one of the parameters dynamic based on a result of a plugin tag

```
{exp:channel:entries
     limit="3"
     {if {exp:foo:bar param_key="param_value"}}
       channel="inventory"
     {/if}
     paginate="bottom"
 }
 ...
{/exp:channel:entries}

```

When I run this, I get a parse error.

How do you solve this parse order problem?

UPDATE:

I am now using Stash to be able to set variables.

So what I did was set the variable....

```
{if {exp:foo:bar param_key="param_value"}}
     {exp:stash:set name="my_inventory_name"}inventory="{segment_2}"{/exp:stash:set}
{if:else}
     {exp:stash:set name="my_inventory_name"}{/exp:stash:set}
{/if}

```

then use it inside the tag

```
 {exp:channel:entries
         limit="3"
         {exp:stash:get name="my_inventory_name"}
         paginate="bottom"
 }
 ...
 {/exp:channel:entries}

```

No more parse errors. But based on the results, it seems that the stash variable was not parsed because the results did not filter by it.

# Answer
> 2 votes
Please take a look on ExpressionEngine’s Parse Order PDF by Lodewijk Schutte

Advanced conditionals (like the one that you have) are parsed after module tags. So such setup will not work.

This blog post by Derek Allard explains the difference between simple and advanced conditionals very well.

Depending on your exact requirements, you might find helpful some third-party add-ons, like Low Variables, CE Variables or Switchee.

# Answer
> 2 votes
When you pass a tag as a parameter you need to use `parse="inward"` to tell the template parser to parse each of the parameter values. You also need to be careful to use double quotes to wrap the value and single quotes for the tag passed as a parameter (or vice versa - just be consistent). Finally, never use line-breaks in a parameter value - this will choke the parser. Example:

```
{exp:channel:entries
     limit="3"
     channel="{exp:stash:get name='my_inventory_name'}"
     parse="inward"
}

```

In you updated question you are trying to set a Stash variable based on an advanced conditional. This will never work as expected because of the way EE parses advanced conditionals: all possible outcomes are parsed, and the non-matching condition removed at the end of template parsing. Instead, use Switchee, IfElse or Stash's own match/against and default parameters to set the value:

```
{!-- match non-empty values only, use default to set the fallback value --}
{!-- using trim="yes" to remove linebreaks / whitespace --}
{exp:stash:set
    name="my_inventory_name"
    match="#\S+#"
    against="{exp:foo:bar param_key='param_value'}"
    default="default_channel"
    trim="yes"
    parse="inward"
}
    {segment_2}
{/exp:stash:set}

```

# Answer
> 0 votes
What if you try it like this?

```
{exp:chanel:entries
     limit="3"
     channel="{if {exp:foo:bar param_key='param_value'}}inventory{/if}"
     paginate="bottom"
     parse="inward"
 }

```

Remember to add the parse='inward' parameter.

– Wouter

---
Tags: parse-order
---


# Question
Title: How to create a plugin which returns channel entry data
I've created a plugin that gets the entry\_id's of the most popular selling items in the exp:resso store. I'd like to extend it by letting a user loop through each of those entries and output them on the page (much like the standard {exp:channel:entries} loop.

I can't find any documentation about how to pull together the right information within my plugin as in the example below.

At the moment my template tag:

```
{exp:expresso_store_most_popular_items category="2" limit="3"}

```

Exports a list of entry\_id's of the most popular products eg:

```
12,13,2

```

How do I export each entry\_id in such a way that i can be used as a tag {entry\_id} in a loop such as in the example below:

```
{exp:expresso_store_most_popular_items category="2" limit="3"}
    {exp:store:product entry_id="{entry_id}"}
        {title}
        {price}
    {/exp:store:product}
{/exp:expresso_store_most_popular_items}

```

Any pointers much appreciated, thanks in advance.

Tom

# Answer
> 11 votes
There are a couple of ways to create plugins which return entry IDs like that.

The first, and most obvious, is for your plugin to return a pipe-separated list of entries, which is then passed to a channel entries tag. In your plugin file:

```
$tag_vars = array(array('search_entry_ids' => '4|6|12|19'));
$this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $tag_vars);

```

This can then be used in a template with the help of `parse="inward"`:

```
{exp:my_plugin parse="inward"}
    {exp:channel:entries fixed_order="{search_entry_ids}"}
        <!-- results -->
    {/exp:channel:entries}
{/exp:my_plugin}

```

**Note** I used the `fixed_order` paramter here. It behaves exactly the same as the `entry_id=""` parameter, except it keeps entries in the order you specify.

The other, slightly more cunning alternative is to actually extend the channel entries plugin. For example, this is what we do with the Store Search tag.

In your plugin, generate the same pipe-separated list of entry IDs. Then, load the channel entries tag and pass over handling to it:

```
$search_entry_ids = '4|6|12|19';

if (empty($search_entry_ids))
{
    return $this->EE->TMPL->no_results;
}

// save our results into the fixed_order parameter
$this->EE->TMPL->tagparams['fixed_order'] = $search_entry_ids;

// load channel entries tag
if ( ! class_exists('Channel'))
{
    require_once(APPPATH.'modules/channel/mod.channel.php');
}

// let channel entries tag do all the hard work
$channel = new Channel();
$this->return_data = $channel->entries();

```

Now people using your plugin don't have to worry about parsing or any messy variables:

```
{exp:my_plugin}
    <!-- all variables which work inside exp:channel:entries work here -->
{/exp:my_plugin}

```

Credit: I originally got this idea from this helpful gist.

# Answer
> 0 votes
The entry ids should be pipe separated like 12|13|2 and simply use the code like:

```
{exp:store:product entry_id="{exp:expresso_store_most_popular_items category='2' limit='3'}" parse="inward"}
    {title}
    {price}
{/exp:store:product}

```

It would be fine if you can share your query here which you are using within the plugin expresso\_store\_most\_popular\_items.

---
Tags: ee2, expresso-store, add-on-development, plugin, tags
---


title: Playa with conditionals and snippets

text:
# Question
Title: Playa with conditionals and snippets
I seem to have a problem with Playa + conditionals + snippets. I've emailed P&T since it may be an error in Playa.

I'm trying to accomplish a listings page where the information displayed depends on the membership package of each entry. If statements don't seem to work correctly, perhaps it's the parse order?

```
{exp:channel:entries channel="companies" dynamic="no"}

  {!-- this works --}
  {company_membership_package var_prefix="pkg"}
    {pkg:title}
  {/company_membership_package}

  {!-- this works --}
  {company_membership_package}
    {title}
  {/company_membership_package}

  {!-- this fails - nothing displayed --}
  {company_membership_package var_prefix="pkg"}
    {if {pkg:title} == "Premium"}
      {snp_company-listings_Premium}
    {if:elseif pkg:title == "Premium"}
      {snp_company-listings_Premium}
    {/if}
  {/company_membership_package}

  {!-- this fails - outputs {snp_company-listings_Premium} --}
  {exp:playa:children var_prefix="pkg"}
      {snp_company-listings_{pkg:title}}
   {/exp:playa:children}

{/exp:channel:entries}

```

{company\_membership\_package} is a Playa field.

Thanks,
Paul

# Answer
> 2 votes
did you check if your if statements are matched? something like

```
{company_membership_package var_prefix="pkg"}
    {if '{pkg:title}' == 'Premium'}
      ppackage title is Premium
    {if:else}
      package title is not Premium
    {/if}
  {/company_membership_package}

```

By the way, maybe using single quotes as i did might help too

---
Tags: channel-entries, playa, conditionals, snippets, advanced-conditionals
---


# Question
Title: Advanced conditional to show entries where a field is empty
I'm trying to show a list of all entries in a certain channel, in a certain category. I've got that much. In that, I'm trying to list all entries where a certain field is empty. I'm not getting the results I'm expecting, and I'm having trouble finding how to list a field value as being empty.

Here's the code I'm using:

```
<ul>
{exp:channel:entries channel="spc-content" category="5" orderby="title"}
{if content_featureimage ==""}<li>{title}</li>
{/if}
{/exp:channel:entries}</ul>

```

Here's the output I'm getting, on this page. (Yes, the formatting is nonexistent. This list is essentially "housekeeping" - so that I can more easily figure out which entries I need to go back and fix.) I'm expecting at least four times the number of entries I'm getting in that list, so it's possible that my if-statement syntax is not the world's best. But...what should the correct syntax be, if I want to see a list of all entries that don't have anything in the content\_featureimage field?

I'm running EE 2.5.4.

# Answer
I think, you should use parameter `search:content_featureimage="IS_EMPTY"` within channel entry tag.
> 4 votes

# Answer
or you can try `{if '{content_featureimage}' == ''}<li>{title}</li>{/if}`
> 0 votes

---
Tags: ee2, conditionals, syntax
---


# Question
Title: In the control panel, is it possible to only show a field when editing a single particular entry using JS/jQuery?
In the control panel, is it possible to only show a field when editing a single particular entry using JS/jQuery?

It's a matrix field, in case this makes any difference.

Thanks

# Answer
Yes. You could write jQuery script that you put in the Instructions field for that entry. You could check the URL in JavaScript/jQuery for the particular Entry ID you want to isolate, and then hide the corresponding field & label.

**Updated:** A Matrix field will still have an Instructions field in its Channel Fields definition, and that Instructions field can store HTML or script tags that will be processed when the page is rendered. You'll just need to View Source to see what the HTML is that contains the field, and hide it based on that HTML reference using jQuery.
> 2 votes

---
Tags: control-panel, javascript, jquery
---


# Question
Title: Do I lose data if I change a text area field to Wygwam?
I have a live site with many entries and the client would like to change the Text Areas to Wygwam fields in order to leverage the Wygwam features.

If I make this change, will I lose any existing data? Is there something I need to do to avoid losing data in the change over?

Thanks.

# Answer
> 3 votes
No, you will not lose any existing data. Additionally, Wygwam gives you an option to "convert previous entries" which is very handy if your textarea field formatting was set to "Auto \<br /\>" or "XHTML"

---
Tags: wygwam
---


# Question
Title: CE Image - Only generating half the images?
I've recently moved an EE site to a new server (a reasonably beefy VPS from Memset), after lots of hunting around changing paths, I've the site working with only one problem. CE Image is used on the site heavily, and it seems to be only creating around half the thumbnails per page.

The problem pages are listing pages, so 24 entries per page, each entry has a small thumb created, and a larger (hover) thumb created. On the new server only half of them are being created (interestingly always the thumb + the hover)

I've checked the originals exist (they do!) If I reduce from 24 per page to 12 per page, it seems to create 8 of the 12 pairs Template Debugging is showing no errors.

So I'm a little stumped.. this code works perfectly on the other server, so I'm thinking possibly an Apache / PHP set up issue (more ram? Threads? Workers needed?)

If I inspect the generated code, the HTML looks fine and dandy, with all the file names looking as they should but only half of the images actually exist.

Template code snippet below

```
<li>
    <a href="/image/{url_title}" title="{title}" class="thumb" data-large="{exp:ce_img:pair src="/originals/if{entry_id}.jpg" max="400" filename="hover-{url_title}" cache="yes" refresh="360"}{made}{/exp:ce_img:pair}">
        {exp:ce_img:pair src="/originals/if{entry_id}.jpg" max="110" cache="yes" refresh="360"}<img src="{made}" alt="{title}" />{/exp:ce_img:pair}
    </a>
    <abbr title="{title}">#{entry_id} / /originals/if{entry_id}.jpg <!-- This shows the correct image path / entry ID etc --> </abbr>
    <a href="/image/{url_title}" title="{title}">view</a> | <a href="#{entry_id}" class="add" rel="{entry_id}">add to lightbox</a>
</li>

```

Some versions and server info

```
PHP 5.4.11 (128MB memory limit)
MySQL 5.1.66
Apache 2.2.16 (Debian)
ExpressionEngine 2.4.0
CE Image 2.4.1
Server is a VPS, 2 Cores, 2Gb ram etc.

```

Any help / ideas / pointers greatly appreciated! Thanks :-)

Geoff

Edit

A sample of the template debug out put (Basically 24 times the following, with names replaced of course!)

```
(0.162424 / 10.88MB)        ***  CE Image debug: Base path: '/srv/www/redacted.com/public_html/'
(0.162442 / 10.88MB)        ***  CE Image debug: Source image: '/originals/if133979.jpg', Fallback image: ''
(0.162451 / 10.88MB)        ***  CE Image debug: The image '/srv/www/redacted.com/public_html/images/made/originals/hover-file_name_300_400.jpg' is not cached.
(0.162459 / 10.88MB)        ***  CE Image debug: Image opened '/srv/www/redacted.com/public_html/originals/if133979.jpg'.
(0.162466 / 10.88MB)        ***  CE Image debug: Image saved to /srv/www/redacted.com/public_html/images/made/originals/hover-file_name_300_400.jpg.
(0.162998 / 10.24MB)       -> Data Returned

```

# Answer
Thank you all for the help.

After a lot of digging around, once again the culprit was everyone's friend htaccess. There was a rogue rule that included /images/ which seems to occasionally interfere, removing the rule, clearing the /made folder, clearing the EE tag cache and we are back in business.

Phew...

Lesson learnt, if in doubt it's always blooming .htaccess :-)
> 3 votes

# Answer
I'd first delete all "cache" created files for CE Image so you are starting with all newly created images. Then rerun the page.

Also, clear browser cache and force a hard page load.

Check PHP error logs to see if there are any memory errors. Might also just increase PHP memory for kicks.
> 0 votes

# Answer
I had this problem recently with CE Image and a server move. The fix was to put the path to the HTML document root in EE's config.php file like so:

```
$config['ce_image_document_root'] = '/path/to/html';

```

I hope this works for you as it did for me.
> 0 votes

---
Tags: php, ce-image, apache
---


# Question
Title: Wygwam Adding Extra Span Tags with Font-Size Style
I am running into an error when editing content in Chrome on Mac. I upgraded to Wygwam v2.7 to ensure I was using the latest version. I am using EE v2.5.3.

When adjusting paragraph text, if I delete the break and merge it with the previous paragraph then create a new paragraph, SPAN tags are being added. You can see the example in this video, http://cl.ly/3S2N0z2p1G3p

Any ideas what is causing the issue?

# Answer
> 2 votes
It appears that this may be a bug with CKEditor That bug report is for v4, but looks like it may also impact v3.x as well.

# Answer
> 2 votes
As a good stop gap solution, Tyssen suggested that I add this code to my CSS: `span[style]: line-height: inherit !important; font-size: inherit !important;`

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


# Question
Title: EE's Native Image Manipulations Stored on S3 with Assets 2?
When storing images to S3 with Assets 2, is it possible to store the images created by ExpressionEngine's native image manipulation functionality to S3 as well, or must they be saved to a local directory?

# Answer
The Image Manipulations with EE are directly tied to a File Upload preference - which is a local source item, not an S3 bucket. I don't think that what you want is currently possible.

But, what I hear you saying is that you wish to use image manipulations and have those modified images uploaded/stored/referenced via S3. Is that right?
> 2 votes

---
Tags: assets, image, s3
---


title: Assets and WYGWAM 2.7

text:
# Question
Title: Assets and WYGWAM 2.7
I see in the latest version of WYGWAM 2.7 that if I use Assets 2.0.4 it will connect my files if I move or rename them. Does this affect just new files or is it 'clever' enough for all of the past files I've used.

I'm noticing that, even though a folder is indexed, the paths are not updating completely throughout my site. Most of it is, but not all of it.

What is the best way to search this site to find which assets are not being tracked through Assets 2.0.4 versus going through every entry? Would Low Search work to search Assets fields?

# Answer
Mitchell -

Entries will need to be re-saved to take advantage of that feature.
> 1 votes

---
Tags: assets, wygwam
---


# Question
Title: How to show the current position of an entry within all entries
Is there a simple way to show all entries for a channel, and the current entry 'position' from the count without using Pagination (don't want to affect URLS).

So the first entry from three entries for a channel would show:

*1 of 3*

Last entry from same set of entries:

*3 of 3*

I've looked at count, absolute count, total\_results and absolute\_results but can't find a simple solution... Any guidance would be appreciated. I'm sure I'm missing something easy here.

Ta, Liam

# Answer
Ha. That awkward moment when you find the answer to your exact same question answered by yourself a year previously...

http://ellislab.com/forums/viewthread/220271/#1016285

> Is there an easy way to pull and entries count in so it might display on a single entry page like
>
> Product 5 / 40 Where the channel contains 40 products and this is the 5th product in the channel (when sorted by date/name/custom field etc etc).

```
{exp:channel:entries channel="channel" orderby="title" sort="asc" dynamic="no"}
  {if segment_x == url_title}{count} / {total_results}{/if}
{/exp:channel:entries}

```

Shame the redirects for old forum posts aren't quite correct as this wasn't showing in Google, had to do some canny searching to dig it up...

Thanks for the replies all the same chaps.
> 3 votes

---
Tags: pagination
---


# Question
Title: How to enforce a language segment via htaccess in your uri?
we have a multilingual website and everything is based on the language segment in the uri. eg.

* /en/home
* /fr/home
* /nl/home

Now I want my 404 page for a uri without a language segment to redirect to one with a language segment, preferably based on the browser language. That way my 404 page will hava a language attached.

eg. http://www.website.be/test should redirect to http://www.website.be/en/test (when EN is the browserlanguage)

At the moment this is my .htaccess file

```
            # Add www - only for production urls
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} !^website\.localhost [NC]
    RewriteCond %{HTTP_HOST} !^192\..+$ [NC]
    RewriteCond %{HTTP_HOST} !^dev\..+$ [NC]
    RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    # REMOVE TRAILING SLASH
    # Make sure it's not a directory root
    RewriteCond %{REQUEST_FILENAME} !-d
    # Catch any+all characters and throw a slash in as the last character
    RewriteCond %{REQUEST_URI} ^(.+)/$
    # Redirect to same URI sans trailing slash (and use 301 for SEO goodness)
    RewriteRule ^(.+)/$  /$1 [R=301,L]

    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?$1 [L]

    # Redirect based on browser accept language FR
    RewriteCond %{HTTP:Accept-Language} ^fr [NC]
    RewriteCond %{QUERY_STRING} !^(ACT=.*)
    RewriteCond %{QUERY_STRING} !^(MOBILE_ACT=.*)
    RewriteRule ^$ /fr [L,R=301]

    # Redirect based on browser accept language EN
    RewriteCond %{HTTP:Accept-Language} ^en [NC]
    RewriteCond %{QUERY_STRING} !^(ACT=.*)
    RewriteCond %{QUERY_STRING} !^(MOBILE_ACT=.*)
    RewriteRule ^$ /en [L,R=301]

    #NO LANGUAGE FOUND - NL = DEFAULT
    RewriteCond %{QUERY_STRING} !^(ACT=.*)
    RewriteCond %{QUERY_STRING} !^(MOBILE_ACT=.*)
    RewriteRule ^$ /nl [L,R=301]

```

# Answer
Rather than do it via htaccess why not use EE segment tags.

`{if segment_1 != "en"}{if segment_1 != "fr"}{redirect="/en/"}{/if}{/if}`

I've nested so that it's an early parsed simple conditional.

Otherwise you'll be getting into the realm of settings cookies and reading them in the htaccess.
> 2 votes

# Answer
Used the PHP solution below in my 404 template based on Paul's suggestion, so no htaccess more:

```
<?php

    $segment_1 = $this->EE->TMPL->segment_vars["segment_1"];
    if($segment_1!="en" && $segment_1!="fr" && $segment_1!="nl" && $segment_1!="de")
    {
        redirect('/en/' . $segment_1, 'location', 301);
    }

    $this->EE->output->set_header("HTTP/1.0 404 Not Found");
?>

```
> 0 votes

---
Tags: htaccess, multilingual, 404
---