# Question
Title: How do I use Stash Get in exp:channel:entries?
I've got this code on a single entry template - it grabs the entry\_id of the entry each time the template is loaded.

```
{exp:stash:set scope="user" save="yes" name="recently-viewed" replace="yes" parse_tags="yes"}{exp:stash:get name name="recently-viewed" scope="user"}{entry_id}|{/exp:stash:set}

```

In a another template I'm trying to use exp:channel:entries like this:

```
{exp:channel:entries entry_id="{exp:stash:get name='recently-viewed'}"}{title}{/exp:channel:entries}

```

I'm doing something wrong because no entries are being output by exp:channel:entries. If I use {exp:stash:get name="recently-viewed"} outside exp:channel:entries, I'm getting the expected output, e.g. 2883|7365|3837.

I've tried all day to figure it out - can anyone pleaseee point me in the right direction?

Best wishes Lee

# Answer
You can do this with exp:stash:parse

```
{exp:stash:parse}
  {exp:channel:entries entry_id="{stash:recently-viewed}"}{title}{/exp:channel:entries}
{/exp:stash:parse}

```

You may need to add process="end" to the exp:stash:parse tag depending on the order of your templates.
> 3 votes

# Answer
Did you try adding `parse="inward"` to your channel entries loop so things are parsed in the right order? Would also add a `dynamic="no"` parameter in there for good measure.

```
{exp:channel:entries parse="inward" entry_id="{exp:stash:get name='recently-viewed'}" dynamic="no"}{title}{/exp:channel:entries}

```
> 2 votes

# Answer
It looks like your entry id is getting parsed before stash. If you turn on output debugging you should see that your entry id is getting output as {exp:stash:get name='recently-viewed'} rather than as the stashed content.

If you look at the New in V2.2.0 section in the Docs the developer explains parsing much better than I could ever. https://github.com/croxton/Stash

Maybe try the stash:embed functionality
> 1 votes

---
Tags: stash
---


title: Changing member ID in urls to username?

text:
# Question
Title: Changing member ID in urls to username?
I currently use a mixture of Freemember & User to create my customised profile/account pages.

The urls for these types of pages are things like `member/profile/{member_id}/favourites` or `member/profile/{member_id}/bookmarks`

Where segment 3 is always the member ID.

I was wondering if its possible to change segment 3 to use the members username rather than the member ID?

It will make for nicer more personalised urls, but I'm not sure if there's a downside or if it even would work?

# Answer
Yes, you can use the username in the URL and display member profile data based on this username. See User's documentation on the username="" parameter in `{exp:user:stats}` for more details. From the documentation:

> `username="some_username"`
>
> This parameter allows you to show the specified members' stats. A variable like `{segment_3}` can also be used to pull a username from the URL.

The only caveat is when the username contains characters that EE or your server does not allow. Check your EE/Server settings if you encounter *disallowed character*-type errors.

Alternatively, you could make your registration/profile edit forms in a way that prevents the user of anything but alphanumerical characters, for example. A javascript/jQuery validation script could be used for that purpose.
> 2 votes

---
Tags: members, freemember, solspace-user
---


# Question
Title: Is there a way to ignore the field formatting of a custom field?
I know you can change them globally from the Admin menu, but what I was hoping for was someway to temporarily ignore the field formatting selected and simply output the data in the field.

Why? I have a bunch of Smartdown fields (Markdown) that I want to actually show the pre-parsed MD -- without actually changing the formatting of the field.

# Answer
Have a look at Single Field \- it can grab your raw data using its `field_format="raw"` parameter.

Or, just use the Query module:

```
{exp:query sql="SELECT field_id_XX FROM exp_channel_data WHERE entry_id = XX"}
    {field_id_XX}
{/exp:query}

```
> 2 votes

# Answer
I think this might be the random case, where Derek Jones' No Formatting might come in use. It can be used directly on the template like:

```
{exp:no_formatting}{my_field}{/exp:no_formatting}

```

And *should* return just the string of text from the field. I emphasize *should* because I've never used it with 'Markdown' in a field.
> 2 votes

---
Tags: custom-fields
---


# Question
Title: excerpt in simple search shows url of file in search results
I'm using the native EE simple search, and I'm using the {excerpt} tag, which displays the correct information on all the search results except for an audio file that pulled up in the results. For the audio file, it displays the url to the file. How would I prevent this from happening?

# Answer
In your Channel Preferences, you can select which field is used for the contents of `{excerpt}`.
> 2 votes

---
Tags: simple-search
---


# Question
Title: how can I safely change the empty lines /n in the database to </p><p> so they will be rendered correctly when I change the field type?
On a website with many many entries i've recently changed a textarea field to an expresso field.

I now have 2 types of entries, entries with formatting, and without formatting.

My idea so far:

* Buy low\_search, use find and replace
* Write some SQL code, try to find the all the saved `<p>` tags and remove them.

Am I looking at this the wrong way? Is there a way to (re)enforce a text formatting (auto `<br />` or none) to all entries on a site without opening and resaving each entry?

UPDATE: I logged in to the database and found out that the formatting hadn't changed. So no need to add `<p>` or `<br />`. Expression Engine does recognize the empty lines (`/n`) and somehow adds the neccesary tags when the page is rendered.

This changes my question a bit: Is there a way to add html text formatting (`</p><p>`) to all entries in the database so I can switch to another field type without losing my line breaks?

*The original question was: "Is there a way to (re)enforce a text formatting (auto `<br />` or none) to all entries on a site without opening and resaving each entry?"*

UPDATE2: It turns out there is a way to add text-formatting to Expresso, which is the field type i'm using. It's quite simple:

In the file `ft.expresso.php` find the line

> text-format =\> 'none', And change it to text=format =\> 'xhtml',

However, since I got so much help figuring this out AND I changed the question, because I thought it was impossible to change in Expresso itself I'm gonna select the answer given by nonprofit\_tech as the correct answer.

# Answer
> 6 votes
ExpressionEngine allows you to natively, enforce or re-enforce format changes on a field.

This should be done before the switch to Espresso field\_type.

Go to Admin and Select Channel Fields

Go to the field you want to transition to Espresso. Switch the field's default formatting.

You'll note an update option appears in orange under the format type once you've switched. This option will allow you to propagate the change to all entries, using the field.

This is the simplest option.

Unfortunately, with Expresso field\_type, you want to do some of these modifications, **BEFORE** you switch field\_types. For example, if you where using `XHTML` formatting. You'd want to switch that to `<br />` to preserve white space, before switching to Espresso. Why? Because the white space under the current `XHTML` formatting doesn't actually use `<p>` or `<br />` tags and Espresso doesn't recognize new line `\r` or `\n` marks.

If you've **ALREADY** switched field types and lost all your white space, the easiest way to return it, is rollback your database, perform the switches to the field before changing field\_type. Because restoring whitespace after the fact is pretty much a manual operation.

**UPDATED** If you want to add the paragraph tags to the field, you can do so by running a MySQL update query:

```
UPDATE exp_channel_data SET field_id_### = REPLACE(field_id_###, '\r', '</p><p>') WHERE channel_id IN('3');
UPDATE exp_channel_data SET field_id_### = REPLACE(field_id_###, '\n', '</p><p>') WHERE channel_id IN('3');

```

Basically, for the specified field, in the specified channel, you are finding `return marks` replacing them with a close than open paragraph tag, then doing the same for the `new lines`. This works fine, with one exception, 'It doesn't provide the initial 'open' or the last 'close' paragraph tag. You can of course, do so on the template, by enclosing the field like so

```
<p>{expresso-field}</p>

```

or, you can drop into PHP to do it. Since we didn't want to modify a number of templates, one of our consultants (Joe Chellman) whipped up this

```
$db = mysql_connect ('ip_address', 'account', 'password');
mysql_select_db ( 'database' );

mysql_set_charset ( 'utf8' );

$q = "SELECT entry_id, field_id_XXX FROM exp_channel_data WHERE channel_id='##' AND field_id_XXX like '%\n%' AND field_id_XXX not like '%<p>%'";

$result = mysql_query($q);

while ($row = mysql_fetch_object ( $result )) {
    $entry_id = $row->entry_id;
    $body = $row->field_id_XXX;

    // recut the text
    $body = mysql_real_escape_string(paraWrapper($body));

    // put it back
    $restoreQuery = "UPDATE exp_channel_data SET field_id_XXX = '$body' WHERE entry_id = $entry_id";

// print $restoreQuery . "\n";
//  print $query2 . "\n";

    $restoreResult = mysql_query($restoreQuery);
    if (mysql_errno () != 0) {
        print 'Error on update for ' . $entry_id . ':' . mysql_error() . "\n";
    } else {
        print "Update of $entry_id successful.\n";
    }
}

// will you convert?!
// $q_convert = 'UPDATE exp_channel_fields SET field_type = "expresso" WHERE field_id = XX';

function paraWrapper($text) {
    $text = str_replace (array('<br><br>', '<br /><br />'), array('', ''), $text);
    return "<p>" . implode( "</p>\n\n<p>", preg_split( '/\n(?:\s*\n)+/', $text ) ) . "</p>";
}

```

The `XXX`, `XX`, and `##` are where field numbers, channel id's are needed. The last part of the script, also finishes the conversion of the field, from text to espresso. Of course, that's all in a PHP script.

# Answer
> 4 votes
You can do this SQL query:

```
UPDATE exp_channel_data SET field_ft_X = 'none' WHERE channel_id = Y;

```

Where X is the field\_id of the field in question and Y is the channel\_id of the channel in question.

# Answer
> 2 votes
Here's non-SQL way to do it:

Go to the field settings page and change it's formatting to the value that you don't need. You will be shown warning in red and a checkbox, marking which would update all entries with new formatting. Do not check it, hit save.

Then, open the field settings again. Now, select your desired formatting and mark the checkbox to update formatting for all entries.

Voila! - all your entries have same formatting for given field.

---
Tags: expresso, text-formatting
---


# Question
Title: Twitter Search 2 Plugin PHP Error (stdClass::$to_user_id_str)
Some of my ExpressionEngine (EE2) websites that run Twitter Search 2 by Exp:resso have recently started throwing out PHP Error Notifications, and I can't see why.

```
A PHP Error Was Encountered
Severity: Notice

Message: Undefined property: stdClass::$to_user_id_str

Filename: twitter_search/pi.twitter_search.php

Line Number: 107

```

The code inside the template is:

```
{exp:twitter_search q="from:@xxxxxx+OR+from:@xxxxxxxx+OR+from:@xxxxxx" rpp="5" lang="en" cache="yes" auto_links="yes"  refresh="5"}

<div class="tweetItem clearfix">
        <a href="{tweet_url}" target="_blank"><img src="{profile_image_url}" width="40" height="40" border="0"/></a>
        <div class="flRight tweetAuthor"><em><a href="{tweet_url}" target="_blank">{from_user}</a></em> - {text}</div>
        <div class="flRight tweetAuthor tweetDate">{relative_tweet_date} ago</div>
</div>

{/exp:twitter_search}

```

Nothing has been changed in the template code or server side, it just started throwing these notices.

I'm wondering whether it could be Twitter API limits as the sites are on the same server, but the tweets are still being pulled and rendered correctly, so it's not just appearing blank.

Any suggestions would be greatly appreciated.

# Answer
> 3 votes
Twitter's switch to v1.1 of their API isn't supposed to happen until next month, though this may have been one of their "blackout tests". Definitely API related at any rate.

Regardless, CE Tweet is the only Twitter add-on I know of that's currently compliant with the API changes. I would strongly recommend migrating.

# Answer
> 2 votes
This has been fixed as of 5 minutes ago in v2.0.8 of Twitter Search. You can grab a fresh copy here:

https://github.com/expressodev/twitter\_search

It seems there were some slight changes to the Twitter search API results which the plugin wasn't expecting.

Note: Twitter Search uses the Twitter Search API which is completely separate from the main Twitter API (it does not use authentication at all), and therefore should not be affected by the upcoming Twitter API v1.1 changes (AFAIK, only time will tell for sure).

---
Tags: php, search, error, twitter-search-2
---


title: FreeForm 3.1.4 Blank page when sending

text:
# Question
Title: FreeForm 3.1.4 Blank page when sending
FreeForm 3.1.4 ExpressionEngine 2.5.5 Build 20121220

Hi There,

When submitting my form, it takes you to the root domain (www.domain.com) and shows a white/blank page. It is not adding the entry to the database either or at least it isn’t showing in the Entries Tab.

I have tried with no .htaccess file Communicate tab works.

It happens on another form on the same site as well.

Any ideas? See my template code below:

```
{exp:freeform:form
           collection="Contact Form"
           required="name|email|question"
           return="/contact/thank-you"
           notify="mark@domain.com"
           template="contact"
        }

        <p class="form-element">
            <label>Name: </label>
            <input type="text" name="name" class="txtbox" />
        </p>

        <p class="form-element">
            <label>Email: </label>
            <input type="text" name="email" class="txtbox" />
        </p>

        <p class="form-element">
            <label>How did you hear about us?</label>
            <select name="how_hear" />
                <option value="Please Select">Please Select</option>
                <option value="Word of mouth">Word of mouth</option>
                <option value="Search engine">Search engine</option>
                <option value="Online school listing">Online school listing</option>
                <option value="Facebook">Facebook</option>
                <option value="Twitter">Twitter</option>
                <option value="Press">Press</option>
                <option value="Banners">Banners</option>
                <option value="School minibus">School minibus</option>
                <option value="Toddler class">Toddler class</option>
                <option value="Other">Other</option>
            </select>
        </p>

        <p class="form-element">
            <label>If other, please specify: </label>
            <input type="text" name="other" class="txtbox" />
        </p>

        <p class="form-element">
            <label>Questions or Comments:</label>
            <textarea name="question"></textarea>
        </p>

        <p><input type="submit" id="submit" name="submit" value="Submit" /></p>

        {/exp:freeform:form}

```

Many thanks

# Answer
> 2 votes
This was resolved in the Solspace forums here: http://www.solspace.com/forums/viewthread/15814/

Basically, once debugging was enabled the blank page displays this message:

> A Database Error Occurred
>
> Error Number: 1054 Unknown column ‘ip\_address’ in ‘where clause’
>
> SELECT COUNT(\*) AS count FROM exp\_security\_hashes WHERE hash=‘181350a948fdb9c1b7e2c0646bebf75b7c7c5ea1’ AND ip\_address = ‘86.146.35.53’ AND date \> UNIX\_TIMESTAMP()-7200
>
> Filename: third\_party/freeform/mod.freeform.php
>
> Line Number: 1106

This is an issue with EE 2.5.4+ removing the **ip\_address** column from the **exp\_security\_hashes** table.

Upgrading to Freeform 3.1.5 or Freeform 4, which have this fixed, should resolve the issue.

---
Tags: solspace-freeform
---


# Question
Title: Search channel from non 'channel_data' database table in low search
We are building a plugin that uploads content via a cron and updates the database. However because of the volume of data involved we decided against using the channel data tables, where we have quite a lot of valuable data and created a unique table for it instead.

Does anyone know if it is possible to create a low search collection from data other than that in the channel data table?

Thanks

# Answer
> 2 votes
First of all, you should know this:

**Low Search will always return channel entries.**

If you're using a dedicated table to store your data, you might also be using your own set of template tags to display the output of that data, circumventing the `exp:channel:entries` tag. If that is indeed the case, and there is no relation between your custom data and channel entries, then you can't use Low Search to search/display your data.

One way of creating such a relationship is to build a custom fieldtype that relates a channel entry with the data in your custom table. You can then use the search index API to generate custom data that is used in the Low Search index.

But the easiest route is probably changing your approach and *do* store the data in the exp\_channel\_data table. This makes things much easier to integrate. You can use the Channel Entries API to create/update/delete entries, extension hooks will be triggered when you do, so indexes are kept up to date automatically. Or you could use the same cron job to automatically re-index the Low Search collections.

---
Tags: search, low-search, plugin
---


# Question
Title: Bulk moving entries to a different channel
Can anyone confirm for me that the best way to move entries from one channel to another is to export the entries, then import the entries? I can't find an addon that will map custom fields from one channel to the custom fields from another channel to make that move. (I ask because I'm optimizing the content model and hope to get rid of about ten channels with similar custom fields that can use categories instead to differentiate them.)

Thanks!

# Answer
If you're not planning to do this via MySQL. Then I'd probably recommend the following add-ons to assist you in the process:

* Andrew Weaver's AJW Export This will allow you to export your items from the channels you want to remove as .csv or .xml to re-import back into the system.
* Andrew Weaver's DataGrab This will allow you to map the data back into the system.

Alternatives for exporting would be Eric Lambs, Export It. And an Alternative for importing would be Solspace's Importer.

I frequently just do MySQL queries, but when the jobs quick or needs to be repeated regularly, I admit Andrew and his company BrandNewBox have been a godsend. It's like we share some data cleaning and migration synergy.

Don't be afraid to add a spreadsheet in there to check that all the data came out properly formatted and ready to import back into the system. But overall, Andrew's stuff is easy to set-up, easy to use.
> 2 votes

---
Tags: channel-entries
---


title: Matrix bootstrap carousel

text:
# Question
Title: Matrix bootstrap carousel
I want to make a Bootstrap carousel with matrix when the user adds 2 or more images. the first part i get, but how can i make matrix deal with the complex code from bootstrap?

```
{visitor:profiel_fotos}
    {if total_rows=="1"}
        {exp:ce_img:pair src="{profiel_fotobestand}" width="600" height="350" crop="y" allow_scale_larger="yes"}
            <img src="{made}" width="{width}" height="{height}"/>
        {/exp:ce_img:pair}
    {if:else}
<!-- Carousel-->
        <div id="myCarousel" class="carousel slide">
          <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
            <li data-target="#myCarousel" data-slide-to="3"></li>
          </ol>
         <div class="carousel-inner">
<!-- Carousel items -->
            {if row_count=="1"}
                    {exp:ce_img:pair src="{profiel_fotobestand}" width="600" height="350" crop="y" allow_scale_larger="yes"}
                        <div class="active item"><img src="{made}" width="{width}" height="{height}"/></div>
                    {/exp:ce_img:pair}
                {if:else}
                    {exp:ce_img:pair src="{profiel_fotobestand}" width="600" height="350" crop="y" allow_scale_larger="yes"}
                        <div class="item"><img src="{made}" width="{width}" height="{height}"/></div>
                    {/exp:ce_img:pair}
                {/exp:ce_img:pair}
            {/if}
         </div>
<!-- Carousel nav -->
          <a class="carousel-control left" href="#myCarousel" data-slide="prev"><i class="websymbol1"><</i></a>
          <a class="carousel-control right" href="#myCarousel" data-slide="next"><i class="websymbol1">></i></a>
<!--/ Carousel-->
        </div>
    {/if}
{/visitor:profiel_fotos}

```

# Answer
> 2 votes
Probably the most direct (although not necessarily the most efficient) way is something like the following:

```
{if '{matrix_field:total_rows}' == 1}
    {exp:ce_img:single src="{profiel_fotobestand}" width="600" height="350" crop="y" allow_scale_larger="yes"}
{/if}

{if '{matrix_field:total_rows}' > 1}
<div id="myCarousel" class="carousel slide">
    <ol class="carousel-indicators">
        {matrix_field}
            <li data-target="#myCarousel" data-slide-to="{row_index}" {if row_count == 1}class="active"{/if}></li>
        {/matrix_field}
    </ol>

    <!-- Carousel items -->
    <div class="carousel-inner">
        {matrix_field}
            <div class="{if row_count == 1}active{/if} item">
                {exp:ce_img:single src="{profiel_fotobestand}" width="600" height="350" crop="y" allow_scale_larger="yes"}
            </div>
        {/matrix_field}
    </div>

    <!-- Carousel nav -->
    <a class="carousel-control left" href="#myCarousel" data-slide="prev"><i class="websymbol1"><</i></a>
    <a class="carousel-control right" href="#myCarousel" data-slide="next"><i class="websymbol1">></i></a>
</div>
{/if}

```

You could also build the pagers with a javascript function to eliminate an extra matrix loop, or use something like Stash to loop through once and get the pager and slides in different containers.

---
Tags: matrix, pixelandtonic, bootstrap
---


# Question
Title: Assign different and specific subfolder to each Member with Assets
i've to assign a subfolder to each member so when "User1" uses the Assets field to upload his photo, this is stored in a subfolder "main\_upload\_folder/user1\_subfolder/". When "User2" uses the Assets field to upload his photo, this is stored in a subfolder "main\_upload\_folder/user2\_subfolder/"

And this for each member, so when user upload a photo other users can't see other's member photo.

Is it possible?

# Answer
> 2 votes
This is the exact reason why I choose Channel Images in this case. With Channel Images you can choose if a user can see the stored images and if so, you can choose to show all or only the users images.

Also, if a user deletes the entry, the image will be deleted as well (which is also a hazard I experienced, not sure if this can be set)

# Answer
> 0 votes
Alessio,

This is not possible with the current version of Assets. It is something that we may consider for a future Assets version - but no guarantees right now.

-Lisa

---
Tags: assets, custom-fields, file-uploads
---


# Question
Title: Where to change text for Mailing List Form errors
I'm using the mailing list module as a newsletter signup form. I want to edit the error text that is shown if the user doesn't fill out the form correctly. Here is the error text:

> The form you submitted contained the following errors
>
> * The username you chose is not available
> * List item the screen name you chose is not available
> * The email you chose is not available
> * Please type both words that appear in the image

I'm not using captcha so the last bullet doesn't make any sense. I simply with to remove that text. Can someone please tell me where to do that?

# Answer
> 1 votes
If you want to edit the actual text of the 'message' then you need to edit the language files here: system/expressionengine/language/english/

If you want more control over the design of the templates etc then check out the Custom System Messages add-on http://dvt.ee/csm ($12)

# Answer
> 1 votes
OR - go to CP -\> Tools -\> Utilities -\> Translation Utility you need to edit "mailinglist\_lang.php"

---
Tags: forms
---


# Question
Title: Low Variable as email address for Freeform
I'm wanting to use a Freeform across multiple MSM sites, using a low variable to change the admin notifier for each site.

Currently the code is as follows:-

`{exp:freeform:composer inline_errors="yes" admin_notify="{var_email}" form_name="contact" composer_template_name="acme" return="{page_uri}/thanks"}`

However the template isn't parsing {var\_email} in time on either "Early Parsing" or Normal.

Does anybody know if this is possible?

Cheers!

# Answer
First, try to enable Early Parsing on the Low Variable in question.

If that doesn't work, then it's because by the time Freeform gets it the value will still be {var\_email}.

On a related note, I actually requested the use of {webmaster\_email} as a feature to SolSpace a while back: http://www.solspace.com/forums/viewthread/966/

Not sure if they have fixed this or not but this is how I hacked it to work back then: http://www.solspace.com/forums/viewthread/966/#41796

Something similar will work for you if you don't have an issue with hacking the core. Instead of fetching {webmaster\_email} from the config you need to fetch the global variable named "var\_email". This may or may not have been loaded at the time, so add this function to fetch it:

`private function get_gv($variable_name)
 {
 if(!isset($this->EE->config->_global_vars[$variable_name])) {
 $q = $this->EE->db->get_where('global_variables', array('variable_name' => $variable_name));
 if($q->num_rows() > 0) {
 return $q->row('variable_data');
 }
 } else {
 return $this->EE->config->_global_vars[$variable_name];
 }
 }`

So (in that version of Freeform) this would be:

```
if($this->params['ee_notify'] == '{var_email}') { $this->params['ee_notify'] = $this->get_gv('var_email'); }

```

Good luck :-)
> 1 votes

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


# Question
Title: htaccess: need help hiding index.php and doing a redirect without conflict?
I need to redirect a page on a client site to an outside URL. I have been using the following redirect, which works - sort of:

```
redirect 301 /durhamchapelhill http://gds.chapelhilluumc.org

```

The problem is that the resulting URL is cluttered:

> http://gds.chapelhilluumc.org/?/durhamchapelhill

I sought help on StackOverflow and got a really good redirect

```
RewriteEngine On
RewriteBase /

RewriteRule ^durhamchapelhill$ http://gds.chapelhilluumc.org [R]

```

By itself, it does an awesome job and returns a nice clean URL. Which brings up the thorny issue of hiding the index.php page.

Before all of this started I was using the following to hide index.php and it works great:

```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

```

The problem is I need both (hide index.php and redirect).

Here is the combination I tried:

```
RewriteEngine On
RewriteBase /

RewriteRule ^durhamchapelhill$ http://gds.chapelhilluumc.org [R]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

```

However, if I combine the two rules the redirect fails.

Is there an htaccess doctor in the house that can assist with setting this straight?

Thanks!

# Answer
Here are three variations to try:

```
RewriteRule ^durhamchapelhill$ http://gds.chapelhilluumc.org [R,L]

```

OR

```
RewriteRule ^durhamchapelhill http://gds.chapelhilluumc.org [R,L]

```

OR

```
RewriteRule ^durhamchapelhill(.*)$ http://gds.chapelhilluumc.org$1 [R,L]

```
> 1 votes

---
Tags: htaccess, redirects
---


title: Errors from libraries/Email.php

text:
# Question
Title: Errors from libraries/Email.php
After making a new form, using Free Form in EE, and adding the "notify" parameter, I get PHP errors. The data gets submitted, but the re-direct to the thank you page doesn't happen for the end user. It seems like if it sits for a day, then the redirect works, but the notification still doesn't happen. If I don't add the "notify" parameter, everything seems to work.

I didn't do the initial install of EE or FreeForm, so I don't know how it all goes together. Or how to trouble shoot. The hosting company recently switched servers, so I thought that might be the problem, but they updated permissions and don't think they are the issue.

Here are some examples of the errors:

A PHP Error was encountered Severity: Warning Message: fsockopen() \[function.fsockopen\]: php\_network\_getaddresses: getaddrinfo failed: Name or service not known Filename: libraries/Email.php

A PHP Error was encountered Severity: Warning Message: fwrite(): supplied argument is not a valid stream resource Filename: libraries/Email.php

A PHP Error was encountered Severity: Warning Message: fgets(): supplied argument is not a valid stream resource Filename: libraries/Email.php

# Answer
Sounds like you're using SMTP as your mail protocol, but either you haven't put proper credentials in, or your host doesn't support it. Try switching to Mail as your email protocol.
> 0 votes

# Answer
There may be additional information if you turn on **Enable Email Debugging**

> When this option is enabled, detailed messages will be displayed whenever you send an email using the Communicate page. This information can be useful in helping to track down any problems you may be experiencing. If you are having difficulty sending email you are encouraged to enable this option.

Then sent test messages from the **Communicate page** to see the debugging details.

---
> 0 votes

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


# Question
Title: Entries take a long time to update on live site. EE 1.6.8
My organization's site in running EE 1.6.8 hosted on Rackspace Cloud Sites. In the last few weeks we have noticed that it takes longer and longer to update an entry in the control panel. We are now at approximately 20-30 seconds from the time we click "Update" to when we get the preview screen verifying the entry has been updated. Other aspects of the CP load quickly like opening entries or viewing entries in a particular category.

Strange thing is that we have a staging version of the site also hosted on Rackspace Cloud Sites that has its own database but it is just a copy of the live site and the stage site CP updates entries quickly - 2 seconds max.

The front end of both run okay as well. For some reason it just seems like the live site hangs when writing new info to the DB.

Here is the debug info from the bottom of the preview screen of an updated entry:

> ExpressionEngine 1.6.8 - © Copyright 2003 - 2009 - EllisLab, Inc. Script executed in 0.4475 seconds 19 SQL queries used Build: 20090915

0.4475 seconds ? More like 25 seconds in real time.

If both sites have the same DB, site files, addons etc what are your guesses for the slowness?

Thanks!

# Answer
> 2 votes
Several things to look at:

1. If you are using EE caching on templates (page or tag), try disabling all caching. EE clears the cache when entries are saves so it's possible there is a hangup with the clearing. Make sure your cache directory is set to 777.
2. Take a look at the Network tab in Firefox to see what you can see. You're looking for any errors or any part of the page load that is getting delayed.
3. Open phpMyAdmin or whatever tool you use for connecting to the DB and run a SHOW PROCESSLIST query while you are saving an entry to see if there is some holdup with a specific query. In phpMyAdmin, you can also load the Processes tab to see this info (http://screencast.com/t/G7DONsI7Fu9). If you keep refreshing that page as the editing delay is occurring, you can see updated info.
4. Check your php error log. There may be clues there.

---
Tags: control-panel, ee1, performance
---


# Question
Title: CartThrob Issue with item_options:input:my_option and certain characters
Haven't been able to get a reply from the guys at CartThrob since November, so hopefully someone here can help out.

We have the following in our add to cart form:

```
{if cf_products_stampinglimit}
 <p>
  <label for="stamping">
   <span class="label">Stamping:</span>
   {item_options:input:stamping type="text" value=""}
   <span class="note">Character limit: {cf_products_stampinglimit}. If you're ordering more than one charm, separate each stamp with a comma.</span>
  </label>
 </p>
{/if}

```

While it works well 99% of the time, I’ve recently discovered that if a customer types something like “a + b” in the field, then the email shows up blank or with this error message:

`Parse error: syntax error, unexpected T_STRING in /my/path/to/system/expressionengine/libraries/Functions.php(680) : eval()'d code on line 94`

The field is filled out just fine in the order entry though (i.e., it gets saved just fine). Here’s the code snippet for that piece in the email template:

```
{if "{item:stamping}"}Stamping: <em>{item:stamping}</em><br />{/if}

```

I’ve tested this extensively and the email appears normally unless it has something like “x + x”. Any idea on how to fix this?

Running EE 2.5.2 and CartThrob 2.1.5.

**Update:** We've since upgraded to EE 2.5.5 and CT 2.2.9 and now, instead of getting a blank email, this error is sent instead:

`Parse error: syntax error, unexpected '" != "' (T_CONSTANT_ENCAPSED_STRING) in /path/to/system/expressionengine/libraries/Functions.php(683) : eval()'d code on line 81`

Additionally, this is the case for various characters: + & ;

# Answer
> 1 votes
Finally got to the bottom of this. The issue wasn't even with the `{item:stamping}` field, it was with another one (SKU) that the site manager's fill in. On a few products the SKU included `"` and that's what was causing the problem.

So I simply changed the code to use single quotes and everything is working great:

`{if '{item:cf_products_sku}' != ""}SKU #{item:cf_products_sku}<br />{/if}`

# Answer
> 1 votes
Have you tried using javascript to replace the + with `+` or `+` before submitting? That section of EE code is encoding the email and calling the typography library, something in there may be choking on the +.

# Answer
> 0 votes
Try the conditional written like any of the following:

```
{if "{item:stamping}" != ""}

```

or

```
{if '{item:stamping}' != ''}

```

or

```
{if {item:stamping} != ""}

```

---
Tags: ee2, cartthrob, shopping-cart
---


# Question
Title: How do I use low variable to create a yearly archive?
I am trying to use low variables to create a dynamic page that shows all the entries from a given year and am having some difficulty in creating the resulting dynamic page.

# Answer
Have you considered another of Low's add-ons? Low Yearly Archives
> 5 votes

# Answer
You can also try adding a dynamic url parameter to the channel:entries tag. I had a site where I needed yearly posts with pagination and used the following:

```
{exp:channel:entries channel="{channel_name}" dynamic="no"
    start_on="{if segment_4}{segment_4}-01-01 00:01{/if}"
    stop_before="{if segment_4}{segment_4}-12-31 24:59{/if}"}

   {!-- content goes here --}

{/exp:channel:entries}

```

My `{segment_4}` was just a 4 digit year like `2012` Not the most elegant solution in the world, but it worked. :)
> 1 votes

---
Tags: low-variables
---


# Question
Title: Easy way to combine lightbox-functionality with Expresso
Has anyone come up with an easy way for non-html-savvy users to put lightbox-style images into an Expresso (CKEditor) field.

Meaning, link a thumbnail with a bigger version of an image and fire some lightbox-script on click.

Having the user supply both the thumbnail and the big picture would be OK but the process shouldn't be too complicated and must not involve editing the HTML source.

# Answer
About the most "user-friendly" way I've found (for generic CKeditor) is as follows:

1. Use "Browse Server" to insert thumbnail then link the large scale image with "browse server"
2. Under "advanced" tab in link menu type in a specific class name (like "lightbox") into the stylesheet classes.
3. Use javascript to come back and hook onto all the .lightbox classes. You can also use the Relationship field in the advanced tab to create galleries (at least with fancybox.)

It's still a couple steps, but it doesn't involve seeing any HTML :)

Note: I'm using the WYGWAM flavor of CKeditor so I'm not sure if the expresso build has the exact same interface, but the principle should still apply.
> 1 votes

---
Tags: channel, image, expresso, entry
---


title: MSM Control Panel

text:
# Question
Title: MSM Control Panel
I have 2 sites setup using MSM, but I am having a slight issue with the second sites control panel theme.

My current setup is as follows:

```
site1
  List item
  index.php
  admin.php
  system
  etc

site2
  index.php
  admin.php
  templates

```

I have edited the index.php and admin.php of site 2 to change the $system\_path for site 2. When I go to www.site2.com/admin.php the admin panel is working, but there is no CSS, its just a white screen. I have tried editing the general configuration of site 2 but I'm struggling to get the control panel theme to work.

Any suggestions appreciated.

Many thanks Ben

# Answer
Chances are that your Theme Folder URL is set to something relative (e.g., `/themes/`), which won't work unless you have the theme folder copied to both sites.

Try setting it to `http://site1.com/themes/`.

FWIW, I generally make my clients administer all sites in an MSM setup from one master control panel location (the parent domain, if you will) to prevent issues like these.
> 4 votes

---
Tags: multi-site-manager, system
---


# Question
Title: After upgrading an EE1 site to EE2, should you delete any unused database tables?
For example, exp\_weblog\_ or exp\_trackbacks? Any others? Is this something that you normally do?

# Answer
I found that this was happening because I was importing the database from a dev server, into the production server database, without first dropping all tables...which left unused/old tables still in the production database.
> 4 votes

# Answer
I would've thought that any exp\_weblog\_ tables should automatically get converted to exp\_channel\_ so if they're still there, that would raise a red-flag with me.

Same with exp\_trackbacks; if you've selected not to keep them during the upgrade process, then that table should be removed.

The only tables that should be left over would be ones that were added by older add-ons that you're not using anymore.
> 2 votes

---
Tags: database, ee2-upgrades
---


title: Trouble Editing Categories for Admins

text:
# Question
Title: Trouble Editing Categories for Admins
I'm having some difficulties having clients adding/editing categories within entries.

As the Super Admin, I can simply open an entry, click Categories and can add/edit categories without any troubles. When I log in as an Admin account type however, I am unable to add categories. When I click the link, I get two JS errors, one being a 500 Internal Server error, the other, "Uncaught ReferenceError: $loading is not defined."

Any ideas as to why this is not affecting Super Admins, but only the Admins?

We're using EE 2.5.3. Any help would be greatly appreciated!

# Answer
SuperAdmins have access to everything, hence no issues.

First step is to make sure the Admin group has permissions to add/edit categories enabled. The setting is called **"Can edit and add new categories"** and it's located here: Members ‣ Member Groups ‣ Create/Edit. I you want them to be able to delete categories, enable "Can delete categories" as well.

Second step is to make these two changes to the **category group** settings as well.

Once done, your Admin group should be able to manage categories correctly.
> 4 votes

---
Tags: categories
---


# Question
Title: Changed a textarea to a RTE textarea, now not working in safecracker
I had a custom field in a channel that was a standard text area. This was also included within a safecracker form. I recently changed the field to a RTE text area field, and all my existing entries updated nicely.

However I have this field in a safecracker form like so

```
<textarea rows="8" class="span16" name="my_custom_field" id="my_custom_field" value="my_custom_field">{my_custom_field}</textarea>

```

and now when an entry is submitted via the safecracker form, it throws up an error

with `Message: Undefined property: EE::$rte_lib`

So I am assuming this is because i have change this field. Can I easily change the safecracker form to work with this field?

**Should add:** I'm not worried about the RTE features being available on the front end, just in the CP. Not sure if this helps things!

# Answer
> 1 votes
Make sure you have the RTE Module, Field Type and Extension installed. You might be missing one of these.

---
Tags: safecracker, custom-fields
---


title: Sort or Filter Members in Control Panel

text:
# Question
Title: Sort or Filter Members in Control Panel
I'm hoping to provide a client with the ability to filter custom member fields in the CP.

I know Zenbu has this functionality for channels, but I need it specifically for members and their \[custom\] fields. Does anyone know if anything like this exists? I can build something front-end, but would like to keep it isolated to the CP.

Edit: I realize this is probably best accomplished with something like Zoo Visitor. Just wondering if there is anything else out there :)

# Answer
I don't know any addons that does this.

But there is no reason you can't build this yourself in a custom template which only the SuperAdmin members can see... then link to the template from inside the CP.

The **jQuery Tablesorter plugin** would handle the sorting for you and a custom query to get the member data that you need.
> 1 votes

---
Tags: members, filter
---


# Question
Title: Have Total update automatically when different shipping option chosen in Expresso Store
Is there a way, on the Checkout page, to have the Total automatically update when the buyer chooses a different shipping option (without clicking Update Totals)?

# Answer
> 1 votes
Since the shipping option and subsequently the total are not updated until the cart is updated you would need to write some javascript that submitted the cart via AJAX and then updated the total accordingly.

---
Tags: expresso-store
---


title: Allow EE Code w/ XHTML auto formatting?

text:
# Question
Title: Allow EE Code w/ XHTML auto formatting?
Is it possible to use the Allow EE Code plugin and textarea formatting option and also have formatting as XHTML?

I have an existing field (textarea with XHTML formatting) with lots of content in many existing entries. I would like to change that field to Allow EE Code, but still have it auto format as XHTML. As far as I can tell, when you change a field to format as "Allow EE Code" it doesn't use XHTML or Auto BR formatting. No auto formatting at all.

Is there any way to marry the two and have the best of both worlds?

# Answer
> 1 votes
Yes. You can leave the custom field formatting set to xhtml, and then in your template just wrap the custom field in the Allow EE Code plugin.

```
{exp:allow_eecode}{your_custom_field}{/exp:allow_eecode}

```

You could also do the reverse, setting the field formatting to Allow EE Code and then use the xhtml typography plugin in the template.

```
{exp:xhtml:full}{your_custom_field}{/exp:xhtml:full}

```

That said, these approaches may not be super-useful because of the way xhtml formatting wraps line breaks in `p` tags. Hard to say without knowing more about your use case. In my experience the times I need the Allow EE Code plugin I'm applying any html myself along with the EE tags rather than relying on auto xhtml. So you *could* consider setting the field formatting to none.

Again, this might be off target for you but if you provide a bit more information and some of your template code you might get a better answer.

---
Tags: formatting, allow-eecode, field-conversion, text-formatting
---


# Question
Title: Safecracker New Entry already filled out?
On my safecracker form I'm trying to allow each user to add 1 entry to be listed in a directory. I just created a new account, trying to test the form, but it has the values from the previous account for some reason. Heres the form

What did I do wrong?

# Answer
> 1 votes
You're using a lot of different calls in the form you provided. I'm not certain they are in the proper order. You're calling Solspace's User, then Channel Entries, then Membrr, then SafeCracker, like so…

```
{exp:user:edit return="member/profile"}

    {exp:channel:entries
    channel="personal_trainer_directory"
    limit="1"
    dynamic="no"
    }

    {if logged_in AND total_entries < 1}

    {exp:membrr:subscribed plan="1003"}

    {exp:safecracker
    channel="personal_trainer_directory"
    return="/member/profile"
    entry_id=""
    safecracker_head="no"
    use_live_url="no"
    url_title=""
    }

```

While other things could also be a factor, say 'cache', I'm wondering about your call order. Solspace's User:Edit form edits the **currently** logged in user, unless you are providing a `member_id` or `username` in the url. You didn't provide a sample url, but let's assume, it's something like:

```
http://mysite.com/directory/personal-trainers/joe-bob

```

That would work for providing 'User' with the identification it needs, but in your next statement…

```
{exp:channel:entries
    channel="personal_trainer_directory"
    limit="1"
    dynamic="no"
    }

```

you turn, dynamic processing off, which means channel:entries **won't** check the 3rd segment for unique identification data, but you aren't telling it what to use as a unique identifier: an `entry_id`, `url_title`, `segment_4`. So I'm not really certain what that statement is doing.

It seems as if you want it to count the number of records entered by the current or provided user, but as is, I think it will always provide *NO* records. Which technically, satisfies your next component…

```
{if logged_in AND total_entries < 1}

```

since 0 is less than 1. I think this may also be your culprit here, because unless you've set-up specific page error trapping, when 'no record' is found using `channel:entries` then the last record entered is displayed.

The other information, looks fine. But I think your problem is in the `channel:entries` statement:

```
{exp:channel:entries
        channel="personal_trainer_directory"
        limit="1"
        dynamic="no"
        }

```

You need to tell it what to check for, so it doesn't just return the last record.

# Answer
> 0 votes
If you are seeing previous form entries it could be caching - check this template isn't cached, clear the cache and try it again.

---
Tags: safecracker
---


# Question
Title: Expresso Store - field:register_member default to checked
I don't want to force my customers to register as members (by using the register\_member parameter on the checkout tag, but I would like to assume they'd like to by defaulting the checkbox created by the {field:register\_member} tag to checked.

I can't find any documentation on wether this is possible. I don't want to have to use JS to do this if possible.

Any guidance much appreciated.

T

# Answer
Assuming you have more than one page to your checkout process, the easiest way to do this is simply to submit a hidden field on the first page of your checkout which checks the register\_member field.

For example, simply add this to the first page of your checkout form:

```
<input type="hidden" name="register_member" value="1" />

```

Now, by the time the customer reaches step 2, the box will already be checked, but they are free to uncheck it if they like :)

Keep in mind that checking it by default only makes sense if you have already given the customer the option to log in. Otherwise you are just making life hard for your repeat customers.
> 2 votes

---
Tags: expresso-store, members, forms, tags
---


# Question
Title: Replace a variable within a plugin tag pair?
So if I have a plugin, with a tag like this:

```
{exp:reggy mask="yes"}
    {head-type}
{/exp:reggy}

```

And I want to replace {head-type} with "horse mask" in the plugin code, how do I do that? EE docs account for replacing the whole text or modifying it, but don't specifically address variable replacement.

# Answer
> 9 votes
```
$variables[] = array('variable_name' => 'Your value');
$variables[] = array('variable_name' => 'Different Value');
$variables[] = array('variable_name' => 'Another one');
$this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $variables);

```

It is important to not manually specify indexes for the $variables array. The above example would loop through your tag pair three times and replace the output. Of course, normally you wouldn't be manually creating each individual iteration and it would come from query results or some other set of data.

For more information on variable parsing, go here.

# Answer
> 4 votes
You want to use the EE-\>TMPL-\>parse\_variables function. Here's an example block

```
public function reggy() {
   $variables = array();

   $tagdata = $this->EE->TMPL->tagdata;

   $variables[] = array('head_type' => 'horse mask');

   return $this->EE->TMPL->parse_variables($tagdata, $variables);
}

```

You can define other replacement variables by simply adding to the $variables array, the key will be the tag name.

---
Tags: add-on-development, plugin
---


# Question
Title: {email] tag defaulting to EE admin email address for guest user
The {email} tag in my comments form is entering the EE admin email address for a guest user. Is this expected behaviour?

Is there a way to get it to default to an empty field?

All advice much appreciated.

# Answer
> 3 votes
I'm guessing your comment form is nested inside a Channel Entries tag? Try using `{logged_in_email}` instead.

---
Tags: email, tags, comment-form
---


title: Get Count From Channel Categories

text:
# Question
Title: Get Count From Channel Categories
I've searched the EE forum archives and have been unable to find a solution to a problem I'm having. I have a custom category field that I'm using to determine placement of category links throughout my website (e.g main nav, supporting links, etc). This is working fine, however, my issue is that I'd like to not write the ',' after the category link (see code snippet below) if its the last category to be displayed of those that are flagged to show. I can't use {count} and {total\_results} vars here since I don't know up front which categories will need to be displayed (based on the custom field). If these were channel entries, I could use the search:field\_name option to filter the entries and then use count and total\_results vars, but that doesn't exist for the channel:categories tag. Any ideas of how to solve this one? I'm running EE 2.5.5

```
{exp:channel:categories style="linear" category_group="3"}
            {if nav_location == 'Display in primary and header navigation'}
                <a href="{path="{category_url_title}"}">{category_name}</a>,
            {/if}
{/exp:channel:categories}

```

# Answer
If you were to output them as a list, you could apply the comma using a pseudo element and then NOT apply it on the last item:

```
<ul class="cat-list">
{exp:channel:categories style="linear" category_group="3"}
        {if nav_location == 'Display in primary and header navigation'}
            <li><a href="{path="{category_url_title}"}">{category_name}</a></li>
        {/if}
{/exp:channel:categories}
</ul>

<style>
    ul.cat-list li:after {
        content: ', ';
    }
    ul.cat-list li:last-child:after {
        content: '';
    }
</style>

```

And of course the remaining styling needed to display this inline as a comma separated list. Downside here is you'd be subject to the browser support for the :after pseudo-element though.
> 2 votes

# Answer
Try backspace="1" like this:

{exp:channel:categories style="linear" category\_group="3" backspace="1"}

Should remove the trailing comma from the last category.
> 1 votes

---
Tags: categories
---


# Question
Title: 403 Error with Assets 2.0.5 and Freemember
I'm running into an issue with Assets and Freemember running together. I've narrowed it down to some code in Assets.

Freemember is throwing a 403 error on register because it's generating the template from the ACTION function. This is causing Assets to throw a 403 because it's checking for an ACTION request on line 24 of sources/ee/source.ee.php.

Is this something that can be fixed in assets or should Freemember fix it?

This is happening on:
EE 2.5.5
Assets 2.0.5
Freemember 2.1.1

Thanks,

Chris

# Answer
> 2 votes
Turned out that this was, indeed, an issue with Assets.

Andris worked on this overnight and figured out what was going on. Essentially, Assets thought that if it reached that part of the code and had to submit an ACT request, then Assets would be the one doing the ACTion. That is not always the case.

This will be fixed Assets 2.1 but that is a bit off. So, here is the patch with instructions for where to apply the code changes.

http://pastie.org/private/stx2abio8navxese2i4zq

Make sure you back up your files first!

---
Tags: add-on, assets, freemember
---


title: Linking a Category Image

text:
# Question
Title: Linking a Category Image
Is it possible to link a category image in Expression Engine 2+? I have logos as my category images and I'd like to link them to external sites. Thanks.

# Answer
Definitely - you could create a custom category field for the URL and then use it in your template conditionally if it has a value.
> 1 votes

---
Tags: categories
---


# Question
Title: "Closed" status pages urls still exist - How do I make these display the 404 page instead?
My client sometimes needs to set a page as "Closed", but the url still gets traffic, and the users will now see a broken template page.

I would like to redirect the user to a 404 page upon visiting a "Closed" page.

How would I go about doing this? I'm very unfamiliar with EE, but because this site was made years ago by an earlier employee, I must find a solution to this, even with my lack of experience.

This exact type of question was explained here - redirect\_to\_404\_when\_expressionengine\_entry\_has\_closed\_status

...but I couldn't manage to make any sense of it, with so many comments giving different solutions and fixes of their own, I was left confused, and while trying what the post explains, I've yet to get it to work, and I can't necessarily follow the steps correctly, since I don't know too much about how EE works. This is a ExpressionEngine v 1.7.0 site.

I have FTP access and Super Admin access.

# Answer
I've never used EE before version 2 so not 100% sure this will work, but hopefully it helps.

Inside your weblog entries tag (I am assuming it is a weblog entries tag, if it is not, post what it is here) put the following code:

```
{if no_results}
    {redirect="404"}
{/if}

```

This also assumes you have a 404 page set up in your configuration. This may not work, but if it doesn't we'll need more information, namely the tag in question that is displaying the entries (something like: {exp:weblog:entries ...}).
> 6 votes

---
Tags: redirects, 404
---


title: Image rendition's height and width

text:
# Question
Title: Image rendition's height and width
SEE: http://ellislab.com/expressionengine/user-guide/modules/channel/custom\_fields.html#variable-pair-usage

I have my images resized to multiple thumbnail sizes. How do I access the url, height, and width of a specific image thumbnail? I tried something like this:

```
{my_image_file:150x100}
   {url}, {height}, {width}
{/my_image_file:150x100}

```

It didn't seem to work. Instead, it looks like I was getting the original image (instead of the thumbnail). Suggestions?

Note: I'm using Matrix. Not sure if it matters. But there is an outer tag pair to loop through all the `my_image_file`.

**UPDATE 1:**

I thought this worked:

```
{my_image_file}
   {url:150x100}, {height:150x100}, {width:150x100}
{/my_image_file}

```

It only worked for `url`

# Answer
> 2 votes
This works for me, tested in EE2.5.5 and Matrix 2.4.1

```
{my_image_file}
{url:150x100}, {height}, {width}
{/my_image_file}

```

---
Tags: file-uploads, image
---


# Question
Title: Excerpt field in search results not rendering
I have a simple search set up to search for the submitted term across two channels. This works and the correct results are shown in my search results page. However, the "excerpt" field for only one of the channels works. For results from the second channel, the excerpt field is always blank.

I've set up the respective "summary" field from each channel as the excerpt field -- one is called "summary" and the other channel is "rick\_summary". Stuff in the "summary" field from the first channel renders, nothing renders from the "rick\_summary" field even though the rest of the row is populated with the post title, author, comments, etc.

Any ideas?

Can't figure out how to post the template, markdown gets all screwed up...

# Answer
In another post where I mentioned this problem, it was suggested that I use custom\_fields and the EEHive plugin eehive\_hacksaw to limit words on my summary fields. This works great and also solve formatting issues with the customer field contents. I just do this:

```
 <td class="{switch}" width="30%" valign="top">
 {if summary!=""}{exp:eehive_hacksaw words="25"}{summary}{/exp:eehive_hacksaw}{/if}
 {if rick_summary!=""}{exp:eehive_hacksaw words="25"}{rick_summary}{/exp:eehive_hacksaw}         {/if}
 </td>

```
> 1 votes

# Answer
You may also want to try using CE String (http://www.causingeffect.com/software/expressionengine/ce-string) to achieve the same goal. I had issues with Hacksaw not properly closing tags, and found for the cost I could do a lot more with CE String.
> 0 votes

# Answer
Worth checking to see the custom field you want to use as the excerpt is marked as "Is field searchable = Yes", see Admin\>Channel administration\>Channel fields\>Your field group\>Your field.
> 0 votes

---
Tags: simple-search
---


title: System Offline not working

text:
# Question
Title: System Offline not working
I have set the system to offline and double checked this in my config file, yet it doesn't work, I can still view the site when logged out. I have tried on different browsers and devices but the site still shows.

EE version v2.5.3 with MSM installed. Have tried this on 2 of the sites on this install with the same results.

Thanks in advance. Ben

# Answer
> 3 votes
First, make sure you're not logged in as Superadmin. Then also double check that your "Guest" group is not set to be able to view the site when offline.

Hopefully one of those two things is it. :)

# Answer
> 0 votes
Are you using Chrome browser - it's well known to cache like mad, I've seen a lot of issues with it lately not serving up correct page views.

---
Tags: system-messages, system, offline
---


# Question
Title: File Uploads Not Being Stored in Entry ID Folder
I've created a File Upload Directory called Films where images for Film Channel Entries are stored. The upload works and displays correctly in my templates, but I noticed in the Upload Directory that the uploaded images are being stored in the root of the directory and not in the entry's Channel ID folder.

The Channel ID folders are being created but the images are being stored outside of it (see screenshot). Is this how it is supposed to work or is something buggy going on? I'm using EE 2.4.0.

# Answer
Native EE file uploads do not use sub folders within the upload directory nor can the native file manger and uploader see any subfolders. Channel Images does create Channel ID sub folders so that is creating your Channel ID folders when you upload something to that Channel Images field (based on your comment above).

It's a big fat pain, and something that I've always been annoyed about with native uploads, but that is the way things are.
> 3 votes

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


# Question
Title: WYGWAM taking styles from website css file?
Does anyone know why or have ever experienced WYGWAM taking styles from their css file? I recently moved EE from one server to another and on the new server the WYGWAM entry field is taking styles from my css. Can anyone offer any help to why this is happening and how to fix it? (See attached image for better explanation)

Thanks. Stephen.

# Answer
I think it's an intentional feature of Wygwam to style the content using your website CSS so when editing it can look exactly like the live content will. At least that's how I always set it up.

I've find the best method for this is:

1. Point it to your default CSS file but also supply so Wygwam-only overrides to tweak how it looks in the editor window (e.g. I often add padding to text doesn't hit the left side of the box) or,
2. Provide it with a special Wygwam only stylesheet that is a simpler modified version of your default styles.
> 0 votes

---
Tags: wygwam, pixelandtonic
---


# Question
Title: "No file" error when trying to upload files via the file manager
I'm getting a "No file" error when trying to upload files via the native file manager. You can see the browser uploading the image but then you get the rather unhelpful red error message.

I was able to upload files no problem a few weeks ago and the only thing that's changed since then is upgrading to 2.5.5.

Anyone else had this problem?

# Answer
Try turning off the "Apply XSS Filtering to uploaded files?" setting under Admin \> Security and Privacy \> Security and Sessions.

I've seen that filtering reject uploads with unhelpful error messages before, especially if you're uploading a PDF or non-image.
> 3 votes

# Answer
Try reuploading the themes folder from the 2.5.5 install. It's possible there is new JS that didn't get updated.
> 0 votes

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


# Question
Title: Stash set_list and cartthrob order_items not playing nicely, parse order perhaps?
I've got the following code which is meant to output a list of authors of orders in cartthrob that match a certain entry id:

```
{exp:stash:set_list name="participants" scope="user" save="yes" parse_tags="yes"}

         {exp:channel:entries channel="orders" dynamic="no" status="Paid"}

                    {exp:cartthrob:order_items order_id="{entry_id}"}
                           {stash:authors_id}{item:author_id}{/stash:authors_id}
                     {/exp:cartthrob:order_items}

           {/exp:channel:entries}

   {/exp:stash:set_list}

```

But it doesn't pick up the author\_id from the cartthrob tag at all. If i take out that cartthrob tag and just get stash to pick up the author\_id from the channel tag it works fine. I've tried every combination of parse="inward" you can imagine but nothing gives.

Any ideas?

# Answer
> 2 votes
The default `parse_depth` is 1. In this case you need to parse two layers deep (because you have two nested tag pairs), so set `parse_depth="2"`.

---
Tags: cartthrob, stash, parse-order
---


title: NTLM authentication with EE

text:
# Question
Title: NTLM authentication with EE
My project needs NTLM authentication. This is not core function as i found here: Can ExpressionEngine….?

Are there any existing add-ons which provide this? If not, where would be an appropriate place to find a developer for this?

Thanks!

# Answer
> 1 votes
There are no existing add-ons for NTLM authentication out in the wild.

If you're looking for an EE add-on, do a search on devot:ee. If you don't find anything there, I'd suggest looking for a developer to write one for you - try director-ee. (It is certainly possible using these extension hooks).

---
Tags: add-on-development, email
---


# Question
Title: How can i test in code if current page is the homepage
Is there a code condition that I can call to detect if the user is currently on my sites homepage.

In Wordpress (and I'm sure I will get panned for making this comparison) there is an 'is\_homepage' conditional that returns true when the homepage is being viewed.

Any tips much appreciated.

# Answer
> 5 votes
Generally speaking the home page can be called to ways: (1) in absence of `{segment_1}` or (2) when the site is using the designated primary template\_group and index.

Let's deal the first one first, you'd just use the conditional

```
{if segment_1 ==""} what you want {/if}

```

Will test for the home page. Now, if you **also** consider it the 'homepage' when people are on the designated 'index' page, regardless of if they are at your base domain, then you'd want

```
{if segment_1=="archive" && segment_2=="index" OR segment_1==""} {/if}

```

where 'archive' would be whichever template\_group you set to hold the primary index page.

You'll want to test the second option, but it should work. You'd want to use the conditional that requires the AND statement before the condition that is the OR.

---
Tags: conditionals
---


# Question
Title: Profile:Edit ajax login form doesn't display errors
I have a login form saved as a snippet, which I include in the pages where it's needed, and the script that runs it is in the header include template. Basically, I use Ajax to avoid showing that interstitial page when logging in, and it works as expected for that. However, when I add `error_handling="inline"` and put error variables in the form template, nothing shows up -- the form clears itself, but no messages show up.

This is the form:

```
{exp:profile:login return="{path={segment_1}/{segment_2}/{segment_3}/{segment_4}}" include_jquery="no" json="yes" error_handling="inline"}
<label for="username">Username</label>
<input type="text" name="username" value=""  maxlength="32" class="input" size="25" />        {error:username}
<label for="password">Password</label>
<input type="password" name="password" value="" maxlength="32" class="input" size="25" />{error:password}
     {if auto_login} <br />
     <label for="auto_login">Remember Me? </label>
     <input type="checkbox" name="auto_login" value="1" checked="checked"> {/if}
<span id="logmein" class="btnGrey">Login</span>
  {/exp:profile:login}
 |{errors}{error}:{field}|{/errors}

```

This is the jQuery, just in case that's the problem:

```
<script>
var login_options = {
    success: do_login,
    dataType: 'json',
    resetForm: true
};
    function do_login(data, statusText, xhr, $form)  {
    if (data.success) {
        $("input[name=XID]").val(data.XID);
        window.location.replace("{path={segment_1}/{segment_2}/{segment_3}/{segment_4}}");
    }
    return true;
};
$(document).ready(function() {
$("#logmein").click(function(){
  var form = $(this).closest("form");
   $(form).ajaxForm(login_options);
   $(form).submit();
});
...
</script>

```

I am running EE version 2.5.5 and Profile:Edit 1.0.7. I tried all the variations of error variables shown here, and nothing works.

# Answer
> 1 votes
If memory serves me correctly, the profile:login form already avoids EE's interstitial page, unlike the standard EE login form. So you may not need to do any of this at all.

But if that's not that case...submitting a form via ajax will override any error\_handling chosen. So instead of getting inline errors, you get an object in the JSON response (`data.errors`) which contains all of the error messages. You should use an else condition where you've got `if (data.success)`, loop through `data.errors` and append them to your form.

---
Tags: add-on
---


title: FreeForm File Upload

text:
# Question
Title: FreeForm File Upload
I have a form that has a file field on it. I think I am missing something simple. The code for the form is as follows:

```
{exp:freeform:form form_name="product_support" required="customer_name|email" return="contact/thanks" notify_admin="yes" admin_notification_template="product_support" form:id="freeform" form:class="contact-form"}
<label for="support-logs">Upload error logs as a zip file</label>
<input type="file" id="support-logs" name="file1">
<button type="submit" class="submit bordered blue arrow">Submit</button>{/exp:freeform:form}

```

The form submits and all of the values are stored but for whatever reason the file that was specified does not get saved. I have verified that in FreeForm 4.0.10 the field exists, is assigned to the proper form and has file upload as it's type. I also verified that the location on the server exists and is set to 777.

There seemed to be more parameters with FreeForm 3.x so I was looking for those in the documents but did not see them. Perhaps I am missing things like file\_upload/allowed\_file\_types and the like? Or maybe the CP settings have taken over this functionality.

Thoughts?

ANSWER: Since StackExchange won't allow me to answer my question yet I'll edit here to give the answer.

Changed the input field for the file upload to a FreeForm field like so:

```
{freeform:field:file1 show="1"}

```

Works like a charm now.

Thanks!

# Answer
This is happening since we moved file fields to custom fields in Freeform 4 `enctype="multipart/form-data"` doesn't get added automatically to the element opener.

If you want to do file fields manually you can use the param `form:enctype="multipart/form-data"` which will add the param to the opening element.
> 2 votes

# Answer
Since StackExchange won't allow me to answer my question yet I'll edit here to give the answer.

Changed the input field for the file upload to a FreeForm field like so:

```
{freeform:field:file1 show="1"}

```

Works like a charm now.

Thanks!
> 1 votes

# Answer
Can you add a parameter like?

```
enctype="multipart/form-data"

```
> 0 votes

---
Tags: solspace-freeform
---


title: SSL on multi-language site

text:
# Question
Title: SSL on multi-language site
I'm trying to get the checkout template working with SSL. When I set the Require SSL parameter to YES in CP / Store / General. loading the checkout template (https://www.mydomain.com/nl/store) fails and returning an error page: "The requested URL /nl/store/checkout was not found on this server".

I've used a multi language set-up where each country has it's on folder in the root, containing a separate .htacces and index.php file. Other then the SSL issues the site and store functioning properly.

## .htacces:

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

```

## index.php:

```
$assign_to_config['site_index'] = '';
$assign_to_config['site_url'] = 'http://www.mydomain.com/nl/';
$assign_to_config['site_404'] = 'site/404';
$assign_to_config['global_vars'] = array(
    "country_code" => "nl",
    "language" => "Nederlands"
); // This array must be associative

```

# Answer
> 3 votes
Try changing

```
$assign_to_config['site_url'] = 'http://www.mydomain.com/nl/';

```

to

```
$assign_to_config['site_url'] = '//www.mydomain.com/nl/';

```

we haven't done with Store before, but had to use it in other areas of sites we've done, so that the page will properly load as SSL. The process is called 'protocol-relative'. We were having a slew of SSL issues, due to assets— images, css files, javascripts, etc. All that used `http://` when we were trying to initiate `https://` and that helped, tremendously.

Can't say if it will work, but no harm in trying.

---
Tags: expresso-store, htaccess, ssl
---


# Question
Title: download links not showing up Order history Cartthrob
I am trying to display my download links on the page that displays all your purchases. This code below just does not seem to work.

```
<h1>Your Purchases</h1>
{exp:channel:entries channel="orders" author_id="CURRENT_USER" status="open|Completed|closed|Registration Closed"}
{exp:cartthrob:order_items order_id="{entry_id}" variable_prefix="items_"}
{if items_first_item}
Total number of items: {items_total_results}.
<table>
<thead>
<tr>
<td width="60">ID</td>
<td width="350">Title</td>
<td width="20">Qty</td>
<td width="90">Invoice</td>
<td> </td>
</tr>
</thead>
<tbody>
{/if}
<tr class="{items_switch="odd|even"}">
                        <td valign="top">#{items_count}: {items_entry_id}</td>
                        <td valign="top">
                      {items_title}{if items_size} - {items_size}{/if}</td>
                      <td valign="top">{items_quantity}</td>
                      <td valign="top"><a href="{path=courses/invoice}/{entry_id}">View invoice</a></td>
<td valign="top">
{if item:product_download_url}
<span ><a href="{exp:cartthrob:get_download_link field='product_download_url' entry_id='{item:entry_id}'}">Download</a></span>
{/if}
    {if purchased_license_number}
    <p>License number: {purchased_license_number}</p>
    {/if}</td>
                    </tr>
                    {if items_count == items_total_results}
                </tbody>
        </table>
        {/if}
    {/exp:cartthrob:order_items}
    {if no_results}
<p><strong>You have no orders in your account.</strong></p>
{/if}
{/exp:channel:entries}

```

# Answer
> 2 votes
I've had success using the following to display download links:

```
{exp:cartthrob:download_file_form field="product_download_url" entry_id="{item:entry_id}" }
        <input type="submit" value="Download Now!" />
{/exp:cartthrob:download_file_form}

```

Also, I don't know if it would make a difference but what happens if instead of

`order_id="{entry_id}"`

you use

`order_id="{purchased_order_id}"`

---
Tags: cartthrob
---


title: Bulk edit in Assets

text:
# Question
Title: Bulk edit in Assets
Is it possible to select multiple images for editing their attributes? e.g. changing keywords, date etc.

# Answer
> 1 votes
Cem - This is not currently possible in Assets 2. I'll be happy to send your request off to the team for consideration.

---
Tags: assets
---


# Question
Title: Different Content showing depending on the domain a visitor arrives on
A client's site has a main domain ('A'), they also have a parked domain as well ('B'). Depending on the domain that the visitor arrives on the site at, the site would show an older version of some entries, but not others.

Having checked the settings in the control panel, I may have narrowed down that some URLs in the settings had reverted to the parked 'B' domain. This has now been fixed using Deeploy Helper.

My main concern is that the site was showing out of date content which shouldn't have existed. Had anyone ever seen this happen before?

# Answer
did you try clearing your cache ? ( browser cache and/or cache provided by EE or an add-on like ce cache )
> 1 votes

# Answer
@janvi Myself and client both cleared local caches, and the EE cache.

Turned out issue was related to a recent server move and the IP address and URL hadn't been updated (both in the CMS and in the DNS settings, amazingly) to the correct server when it should have been.
> 1 votes

---
Tags: channel-entries
---


# Question
Title: How to edit what is considered safe html for comments
I'd like to be able to edit what is considered safe html for comments. I searched devotee but there's no addon making this easy to do so I guess I need to hack the core files. Where would one go to do this?

# Answer
I thought I'd seen this somewhere!

In /system/expressionengine/libraries/EE\_Typography.php at around line 142 there are a couple of arrays for "safe" tags.

I'm not 100% sure if they appear anywhere else but it's worth having a look there and testing it out.
> 1 votes

---
Tags: comments, core-hacks
---


# Question
Title: PHP not processed when Stash parses conditionals in the same template
I've got a template with PHP enabled and set to `On Output`, and *any PHP at all* is getting commented and printed, without being processed, in the HTML.

Template (simplified):

```
{embed=".header"}

{exp:stash:set name="some_value" parse_conditionals="yes" parse_tags="yes"}{if 'something' == 'somethingelse'}y{/if}{/exp:stash:set}

<div>
    <?php echo 'foo'; ?>
</div>

{embed=".footer"}

```

Output:

```
<html>
<head>
    <title>Oh the Confusion</title>
</head>
<body>

<div>
    <!--<?php echo 'foo'; ?>-->
</div>

</body>
</html>

```

Other templates use Stash and conditionals, many use PHP, and this is the only one that combines both Stash (parsing conditionals) and embedded PHP. Caching is not an issue here. This looks like a friendly, intentional thing since the PHP obviously isn't plainly visible to the viewer, but why is this happening?

ExpressionEngine 2.5.5 with a bajillion addons that I can list if it's helpful.

**Note: I've simplified my question after figuring out how to ask it better with the help of Lisa Wess. This one seems brief and cheeky because I'll be answering it myself for posterity.**

# Answer
> 2 votes
**You'll need to turn your PHP into a plugin or embed it in a sub-template.**

You could have saved yourself a lot of time if you'd noticed that Mark Croxton himself pointed out that Stash doesn't parse PHP.

---
Tags: templates, stash, php
---


title: Switch inside Channel:Categories?

text:
# Question
Title: Switch inside Channel:Categories?
I would like to insert a clearfix div after every third category listing. I have used this method successfully when outputting from `{exp:channel:entries}` tag pairs, but it appears that the `{switch}` variable is not available for `{exp:channel:categories}` tag pairs.

Is there another way to accomplish this (perhaps with CSS, jQuery, or another EE function I'm unaware of)?

```
{exp:channel:categories channel="Projects" style="linear" show_empty="no" dynamic="no" disable="member_data|pagination"}
<div class="column one-third">
    <div class="pic">
        <a href="{path='our-work/list'}">
        {if category_image}{exp:ce_img:single src="{category_image}" crop="yes" width="420" height="290" filter="auto_sharpen"}
        {if:else}<img src="{lv_shortcuts_project_image_none}" alt=""/>{/if}
        <div class="img_overlay"></div></a>
    </div>
    <h3><a href="{path='our-work/list'}">{category_name}</a></h3>
    <p>{category_description}</p>
</div>
{switch='||<div class="clearfix"></div>'} <!-- DOES NOT WORK -->
{/exp:channel:categories}

```

Thanks!

# Answer
If you know the exact number of categories that will be displayed, you can use conditionals in combination with the {count} variable.
> 1 votes

# Answer
The **GWcode Alternate addon** will accomplish what you need.

> This simple plugin for ExpressionEngine 1 and 2 lets you rotate through any number of values to create alternations, for CSS classes for example.
>
> You can use this plugin to rotate through any number of values, similar to the switch variable in the {exp:channel:entries} tag for example.
>
> The most straightforward use for this would be to alternate CSS classes.

**Code example**

```
<ul>
    {exp:channel:categories channel="example" style="linear"}
        {exp:gwcode_alternate count="{count}" alternate="one|two|three"}<li class="{alternate_value}">{alternate_value}: {category_name}</li>{/exp:gwcode_alternate}
    {/exp:channel:categories}
</ul>

```
> 5 votes

# Answer
I see this has already been answered, but there is a jQuery option that might be better for you. At least it won't matter how many categories there are:

```
$('.selector:nth-child(3n)').after($('<div />').addClass('clearfix'));

```

This will select every 3rd element that matches `.selector` and insert `<div class="clearfix"></div>` after it.
> 3 votes

---
Tags: categories, switch
---


# Question
Title: How to hide unwanted fields in CP register form
Is there a simple way to hide unwanted non required extra registration fields in the CP member register form?

# Answer
> 2 votes
Nope - no hooks exist in the new member form I'm afraid. I suppose you could hide them with some jQuery?

# Answer
> 1 votes
Yes, Anna is right. The view file is "/expressionengine/views/members/register.php". Also, an extension can be developed with the hook cp\_js\_end by having necessary JQuery code.

# Answer
> 1 votes
I personally hack the view as needed if needed. Not ideal but you gotta do what you gotta do.

# Answer
> 0 votes
Or if you get really keen, you could use one of the members-as-entries add-ons and then you can present whatever fields you want using regular channel entry fieldtypes.

---
Tags: members, fields, register
---


# Question
Title: Executing multiple SQL statements with Database class
Using `$this->EE->db->query();` is it possible to execute a query as complicated as this:

```
CREATE TEMPORARY TABLE exp_temp_table (...);
INSERT INTO exp_temp_table () SELECT ...;
UPDATE exp_temp_table ... SET ...;
SELECT ... FROM exp_temp_table ...;

```

For obvious reasons I've removed most of the actual statements.

This code executes perfectly in phpMyAdmin, but when I try to use `$this->EE->db->query();` I get a SQL error at `INSERT INTO exp_temp_table ()...` \- is it not possible to execute queries with multiple statements? If not, is there some way I can work around this?

# Answer
> 2 votes
I was worried about the temporary table not persisting between queries but the following code worked correctly:

```
$this->EE->db->query('CREATE TEMPORARY TABLE exp_temp_table (...)');
$this->EE->db->query('INSERT INTO exp_temp_table () SELECT ...');
$this->EE->db->query('UPDATE exp_temp_table ... SET ...');
$query = $this->EE->db->query('SELECT ... FROM exp_temp_table ...');

```

# Answer
> 1 votes
I think, you should run queries via Transactions. You can find the doc from CodeIgnitor's user guide http://ellislab.com/codeigniter/user-guide/database/transactions.html and it also works within EE.

---
Tags: add-on-development, database, mysql
---


# Question
Title: Is there a way to use $_GET variables on an EE site to pass Google Analytics the referrer info?
I manage a site for a local live-performance theatre that uses ExpressionEngine to manage their content and TicketMaster for it's online ticket sales.

When a user buys a ticket through TM, they send out a receipt with links back to the theatre's website. Unfortunately, the links are appended with a url query string—specifically `?camefrom=ticketmaster`.

Unfortunately, this url causes a 404 Not Found error because EE is trying to parse the get variable as a slug, controller, or page. There is no flexibility on TM's part to create different URLs because it's all automated.

The information I've found thus far concludes that EE doesn't like URL variables at all. Is there any way to circumvent the URL rewrite engine while stile passing this variable to the server (because they'd also like to keep track of the referrals from TicketMaster via an email).

Adding a second parameter (ie, ?camefrom=tm&foo=bar) *works*, but isn't an option because TM will not change the URL they place in the emails.

Does anyone have an idea?

# Answer
In the past I've always used:

```
# Catch any Google campaigns directed to the home page
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^(utm_.*)
RewriteRule ^(.*)$ /index.php/ [L,PT]

```

:)
> 1 votes

---
Tags: url, querystring, analytics
---


title: Add "name" to mailing list

text:
# Question
Title: Add "name" to mailing list
Im using Freeform to submit a form which adds the sender automatically to a mailing list.

Does anyone know if it is possible to add "name" to a mailing list? One would have though this should be a built-in feature be alas.

Thanks for any pointers.

Kippi

# Answer
> 4 votes
No there isn't. The internal mailing list just handles email addresses. It's not meant to be a full Email Management System, just a method for you to provide general communications via ExpressionEngine.

ExpressionEngine integrates well with numerous other Email Management Solutions (EMS). You can use *MailChimp, Campaign Monitor, Emma, Constant Contact*, etc.

MailChimp and Campaign Monitor have add-ons that allow extended integration, but generally speaking as long as the EMS provides javascript embed forms, you can use any solution you like. Using a full fledge EMS provides a lot more benefits, since you can allow segmentation, auto responders, etc.

Using EE's **Mailing List Module** doesn't really allow for list segmentation. You can create multiple lists, so people could sign-up to receive say 'event notices' vs 'general announcements', but it can be hard enough to get someone to sign-up for one mailing let alone two or three.

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


title: CE Cache and Freeform

text:
# Question
Title: CE Cache and Freeform
We are using CE Cache's static caching on our site because of some performance issues on our server. We are also using Freeform to place a newsletter sign up form on just about every page. Obviously this caused problems as Freeform uses the XID parameter for security purposes and when the page (and thus form) are cached it fails that security check.

We were wondering about possible options to get around this. The obvious option is to not cache the pages in that way, but the page load would behave strangely as some parts would be cached and load quickly, while other parts would take a long time to load. Some other options we considered: have that form submit to an in-between page that then does the actual Freeform submission (this seems to messy and too much overhead), have the form load in an iframe on the page (this would work except for the above issue that the whole page would load and leave that empty iframe until it loads), or move servers (ugh).

Is there any way to disable that security check for Freeform? Or is there a way around this issue? I was surprised to see that a google search on the topic didn't bring up any results, I just wanted to make sure I covered all the options before picking one. Any insights on this issue from others that may have experienced something similar?

# Answer
I think the best way to handle that situation would be to use fragment caching on that page, instead of static caching. That way, you can cache most of the page, but escape the parts that you want to remain dynamic (see the Partial Caching documentation for more details).

Using fragment caching will still allow the page to be very fast. Not as fast as a statically cached page, but fast nonetheless. :)

Disclosure: I'm the author of the CE Cache add-on.

Edit: I actually do this on the Causing Effect site. I use the Static driver for visitors that are not logged-in, and fragment caching with the Redis driver for those that are logged-in. I don't use any static caching on the Contact page either (just fragment caching). I'm guessing I could get it to work fine, but I didn't bother with it.
> 7 votes

# Answer
Another option is to put your form into its own template, then use **jQuery load()** to load that URL on page load into a div that's included in the pages. That form template won't be cached so you will have a fresh XID each time.

```
<div id="subscription-form"></div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#subscription-form').load('template-group/form-template');
    });
</script>

```

Your form goes into the "template-group/form-template" template.
> 4 votes

# Answer
I realized that with CE Cache it's going to need an extra condition in the .htaccess, to avoid using a cache of the requested data. No time to do it right now, but considering how to rescue a contact form that is getting rejected when not logged in as super admin, because the security code is fixed, not correct. Looks right, but isn't. Cheers, Anna.
> 0 votes

---
Tags: solspace-freeform, ce-cache
---


title: Use if status safecracker

text:
# Question
Title: Use if status safecracker
I want to show or hide the status option based on the current status in a safecracker form. This because i want that people can edit statuses form entries which are open or closed, but not the one who are denied.

So far no success because safecracker doesn't like the IF statement, i think i can do it with jquery but is there a good EE solution to get the result i want?

```
{exp:safecracker
     channel="nieuws"
     return="profiel/nieuws"
     entry_id={segment_3}"
     author_only="yes"
     error_handling="inline"
     status="open|closed|denied"}

{if status=="denied"}
    Can't change the status
{if:else}
    <label for="status">Status</label>
    <select name="status" id="status">
        <option value="open">Open</option>
        <option value="closed">Closed</option>
    </select>
{/if}

```

# Answer
You can try what Anna suggested. While editing an entry via Safecraker, its populate all the variables of channel entries within safecraker tag so {status} variable also be populated as well.

Also, while looking at your code it seems that you are missing opening double quote while passing parameter entry\_id.

Check it.
> 1 votes

# Answer
Try this instead;

```
{if "{status}" =="denied"}
    Can't change the status
{if:else}
    <label for="status">Status</label>
    <select name="status" id="status">
        <option value="open">Open</option>
        <option value="closed">Closed</option>
    </select>
{/if}

```
> 0 votes

---
Tags: safecracker, status
---


# Question
Title: Spanish form field labels in DevDemon's Forms?
Is there a way to translate the form fields for devdemon's Forms (default Form Tools and Powertools label fields) in spanish? Has anyone done this before\>

# Answer
> 2 votes
It's not covered in the docs, but apparently, according to this forum post, there are language packs for the forms module to allow you to do this, yes. I'd check in with the DevDemon folks to find out which languages are available and how to go about loading the language pack.

# Answer
> 0 votes
I contacted DevDemon and the answer is:

You need to copy the english folder to a folder called spanish, then change all the text in the file to Spanish.

---
Tags: forms, multi-language
---


title: Getting server error upgrading 2.5.5

text:
# Question
Title: Getting server error upgrading 2.5.5
I'm upgrading from 2.5.2 to 2.5.5 and in the upgrade process everything went well until I tried to go from 2.5.4 to 2.5.5. When I hit the link to upgrade to 2.5.5 I am now getting the following error:

= = =

Server error The website encountered an error while retrieving http://domain.com/admin.php?C=wizard&M=do\_update&language=english&ajax\_progress=yes. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

= = =

Has anyone come across this before? Any advice greatly appreciated. I can confirm that the server is up - it's just when I get this that I receive the error.

# Answer
I was able to figure this out. Ultimately the issue was that there was a module still installed in the system directory when i was running the upgrade. Was able to glean this bit of information by changing debug to 1 in the admin.php file and reloading it for the upgrade. Once that was figured out I cleared out the rogue module and everything went normally.
> 2 votes

# Answer
For me, temporarily renaming my system/expressionengine/third\_party folder until the upgrade completed and then renaming it back worked.

Interestingly enough, the update script had updated the app\_version variable in config.php to 254 before it failed (I was upgrading from 2.5.3). Not sure if that helps anyone figure out where in the process it's failing, but I wonder if there's anything that the 254/255 part of the update which touches the third\_party folder that's causing the failure.
> 2 votes

---
Tags: upgrade
---


# Question
Title: Is there a way to have pagination show up at the bottom of a table?
Entry pagination is a pretty simple thing except with tables. Whenever I do pagination on table data it only displays at the top. Is there a way to get it to show up at the bottom?

Here is the code I am using.

```
<table id="vip">
<thead>
<tr>

<th scope="col">State</th>
<th scope="col">CC</th>
<th scope="col">Name</th>
<th scope="col">Posiition</th>
<th scope="col">Address</th>
<th scope="col">Phone</th>
<th scope="col">email</th>
</tr>
</thead>
<tbody>
{exp:user:users orderby="stake" sort="asc" group_id="9|12" limit="50" paginate="top"}
<tr>

<td><strong>{state}</strong></td>
<td>{council}</td>
<td>{screen_name}</td>
<td>{occupation}</td>
<td>{location}</td>
<td>{phone}</td>
<td><a href="mailto:{email}">{email}</a></td>
</tr>
{paginate}
<p id="pagination">Page {current_page} of {total_pages} page(s)  {pagination_links}</p>
{/paginate}
{/exp:user:users}
</tbody>

</table>

```

If I do paginate="both", I get two pagination links at the top. Any ideas?

Thanks.

# Answer
Try using table tags in your pagination code:

```
{paginate}
    <tr>
        <td colspan="7"><p id="pagination">Page {current_page} of {total_pages} page(s)  {pagination_links}</p></td>
    </tr>
{/paginate}

```
> 1 votes

# Answer
Try this.

```
{exp:user:users orderby="stake" sort="asc" group_id="9|12" limit="50" paginate="bottom"}
{if count == 1}
<table id="vip">
<thead>
<tr>

<th scope="col">State</th>
<th scope="col">CC</th>
<th scope="col">Name</th>
<th scope="col">Posiition</th>
<th scope="col">Address</th>
<th scope="col">Phone</th>
<th scope="col">email</th>
</tr>
</thead>
<tbody>
{/if}

<tr>

<td><strong>{state}</strong></td>
<td>{council}</td>
<td>{screen_name}</td>
<td>{occupation}</td>
<td>{location}</td>
<td>{phone}</td>
<td><a href="mailto:{email}">{email}</a></td>
</tr>

{if count == total_results}
</tbody>

</table>
{/if}

{paginate}
<p id="pagination">Page {current_page} of {total_pages} page(s)  {pagination_links}</p>
{/paginate}
{/exp:user:users}

```
> 1 votes

---
Tags: pagination
---


title: Navigation on 404 page

text:
# Question
Title: Navigation on 404 page
I have dynamic navigation based on the current page in my header snippet. I have it setup like this:

```
    {if segment_1 == "" OR "{404}" == "true"}
        {exp:structure:nav start_from="/wat-doen-wij" max_depth="1" current_class="active"}
    {/if}

    {if segment_1 == "wat-doen-wij" AND "{404}" != "true"}
        <div class="subnav_wrapper">
            {exp:structure:nav start_from="/wat-doen-wij" max_depth="1" current_class="active"}
        </div>
    {/if}

    {if segment_1 != "" AND segment_1 != "wat-doen-wij" AND segment_1 != "zoekresultaten" AND segment_1 != "waarbij-helpen-wij" AND "{404}" != "true"}
        <div class="subnav_wrapper">
            {exp:structure:nav start_from="{freebie_1}" max_depth="1" current_class="active"}
        </div>
    {/if}

```

On my 404 template I use the following statement to set my 404 variable:

```
{preload_replace:404="true"}

```

However, this breaks all my other pages. How can I fix this? I need to know which template I am currently on. Can I do it based on header infomation? I can't use {segment} because segment\_1 could be anything.

# Answer
> 1 votes
`{preload_replace:404="true"}` will never work as you are using it because it's not passed to the header. This variable is only available for use in the same template... **docs for Preload Text Replacements are here**.

> Preload Replacements act as a straight string replacement ***for use later in the same template.***

Instead use this in your 404 and header templates:

**IN 404 TEMPLATE:**

```
{embed="includes/header" 404="true"}

```

**IN HEADER TEMPLATE:**

```
{if segment_1 == "" OR "{embed:404}" == "true"}
    {exp:structure:nav start_from="/wat-doen-wij" max_depth="1" current_class="active"}
{/if}

{if segment_1 == "wat-doen-wij" AND "{embed:404}" != "true"}
    <div class="subnav_wrapper">
        {exp:structure:nav start_from="/wat-doen-wij" max_depth="1" current_class="active"}
    </div>
{/if}

{if segment_1 != "" AND segment_1 != "wat-doen-wij" AND segment_1 != "zoekresultaten" AND segment_1 != "waarbij-helpen-wij" AND "{embed:404}" != "true"}
    <div class="subnav_wrapper">
        {exp:structure:nav start_from="{freebie_1}" max_depth="1" current_class="active"}
    </div>
{/if}

```

# Answer
> 0 votes
Not really solving your problems here but I think you need to be aware that you've got 3 nav tags inside advanced conditionals, just for your 404 'problem'.

Doing it this way, all the nav tags are going to get parsed, always. This is adding a bunch of overhead (queries, template parsing etc) to every single page load on your site.

There are lots of articles about this if you google 'ExpressionEnging parse order' but here's one to get you started.

IMO a 404 doesn't need a subnav, it just needs to obviously tell the user they are on a broken page. Main navigation, yes. Sub navigation of any section they *might* be on, not really.

---
Tags: navigation, 404, dynamic
---