# Question
Title: RSS / Atom feed is outputting encoded entities instead of quotes in titles
When publishing my Atom feed, quotation marks are being converted to HTML entities and being output without conversion back to the character.

Example:

Article title: `What's New Today!`

Output in Atom feed as: `What’s New Today!`

I created my Atom feed based off of the Atom feed examples in the EE documentation.

# Answer
The issue here is that the EE example feed encloses the title between CDATA tags, which instructs the feed reader to ignore any entities in that text and output it exactly as is.

The solution to this is to replace this:

`<title><![CDATA[{title}]]></title>`

...with this:

`<title>{exp:xml_encode}{title}{/exp:xml_encode}</title>`

Note that there are two places to do this if you're starting from the example feed. Also note that the "Agile Records" example feed *does* use the correct method, and it appears that the use of CDATA in the documentation example is an error.

Here's the forum post where I found this info: http://ellislab.com/forums/viewthread/220237/
> 5 votes

---
Tags: html-entities, rss
---


# Question
Title: Registration spam possible attack vectors
I have dealt with spam problems previously with some valuable help from this forum but I've got a site that is suffering with registration spam at the moment and no matter what I try, nothing seems to reduce it.

So far I have tried; Standard EE CAPTCHA Then added a honeypot Then changed the CAPTCHA to Use ReCAPTCHA Finally added Low Anti Spam and hooked it up with Akismet

Even with all that the site is still getting registration spam so I'm wondering if there's some URL that I've forgotten about that provides a registration form or some means by which a spammer can bypass the anti-spam measures.

EDIT: Here's the registration form in case anyone has any ideas

pccs-books\[dot\]co\[dot\]uk\[slash\]pccs-register

UPDATE: I had thought I'd cracked this but noticed that Low No Spam was blocking any attempt I made to create an account (though I think this was an Akismet issue - I can't find the Typepad API registration page anymore).

So I have removed Low No Spam for now and added MX Stop Spam, Barricade and also changed the URL of the registration form.

It does look like spam registrations are getting thrown straight into the "Banned" group however my client is more concerned about the flood of notifications they get (they don't seem to want to simply turn notifications off). So I am still trying to find a way to just stop the form being filled in by spammers. I realise this is a big ask and the harder you make it the less likely real people will register but I'd be grateful for any suggestions.

# Answer
> 6 votes
You've taken some good steps. While it's possible to stop all registration spam, you can probably reduce it a fair amount. One thing I notice is your registration url is very easy to get to. Most automated spam registration scripts/bots will easily be able to guess `/register` as a link. Having something slightly more obscure could help, like `/book-lovers/register` or maybe even `/pccs-register`.

I prefer ReCAPTCHA to ExpressionEngine's built-in CAPTCHA system, but generally speaking try to avoid captchas.

With Low NoSpam, I'd say also take a look at Barricade.

The Blacklist Module and your .htaccess file can also help in these battles. We use the 5G Blacklist updated annually by Perishable Press. It's chocked full of goodness, but be careful, you may have to comment out some rules that interfere with your set-ups behavior. For example: we modify this statement:

```
RedirectMatch 403 (\,|//|\)\+|/\,/|\{0\}|\(/\(|\.\.\.|\+\+\+|\||\\\"\\\")

```

the statement that disallows commas in the url, since we use Tags, and want to allow 2 or 3 combinations, but NOT unlimited combinations. The biggest boost this provided is just not allowing known spam bots to even hit the site.

CloudFlare is also good for this as well. It provides an all around extra security boots for the site, while improving site speed.

So make sure Blacklist is properly configured, that you look into the 5G Blacklist, and potentially use a CDN like Cloudflare as well.

That said, a lot more registration spam these days are created by actual people, who've created real email addresses. The get paid through services like Amazon Mechanical Turk to complete registration forms. It's still spam, but powers through CAPTCHA's, challenges, and other prevention methods.

Read this article on Fighting Registration Spam. What's true about it is that almost 99% of our registration spam have usable email addresses. Meaning that, even though we do self-activation, those activations don't bounce. We use Mandrill to monitor the normal black hole that is CMS email transactions. We thought that registration emails would have a high bounce rate, for one of our clients, because they have close to 70,000 registered members, and many of them are obviously just spam accounts.

Just remember, common names like `register` can be easily targeted via bots, especially if they are in strategically known locations, such as `/register`, `member/register` etc. So change the trigger (which you've done, but change the page name as well. If you are using something other than the default EE registration, like Authenticate or Safecracker Registration, Users, Zoo Visitor, etc., you can adjust the file name to whatever you like.

But also remember, now days you are mostly combatting humans, so beef up your overall security. Use blacklist, and .htaccess to other tools to help.

**Update:** Dealing with Client Notification There is no way to successfully stop *all spam*. Any method that you find today, will eventually be cracked and attacked. Obviously, having systems to combat spam is good, but the real problem seems to be the client's need for notification. They don't want *ALL* notification, they really only want *good* notification. Which means, you don't want to send pending or banned notifications, rather just successful activations (those could also be spam, but it would be far less email).

I'm not certain of any system that does this outright. Possibly PostMaster could be used to do it. Otherwise, I'd look into seeing if you could combine Registration Codes with MX Notify Control to get something closer to what you need.

Otherwise, its just important to let your client know, they can't stop spam. Unless they want to turn their site into an invite only registration system, which I'd assume would hurt sales. Make them understand, the more complicated they make it for the 'purchaser' the higher the abandon rate. If you have Google Analytics set-up, you can create a funnel and provide data.

Ultimately, the site, by some fluke, could get 50-100, legitimate or semi-legitimate registrations per day, that don't turn into purchases or subscriptions. Do they really want to deal with all those notifications?

Some clients won't see reason, but it doesn't mean we shouldn't try to make them do so. It also means sometimes you have to say, 'this is the best we can do…' I can't stop your spam problem, I can *ONLY* reduce it.

# Answer
> 0 votes
Some ideas to try...

* Remove all footprints in the registration and forum templates as **per this article**.
* If you are using a custom registration form in an EE template, remove the one in the forum header so all your registrations go through the custom form. It's possible the one in the forum isn't using your captcha methods.
* Try **Snaptcha** addon. Lots of regular positive feedback for this addon via Twitter.
* Change the location of the registration template you have in place to a new URL.
* Change the forum trigger word to something new.
* Checkout this addon, **MX Stop Spammers**.
* Add this addon, **Members**, to easily spot spammers.
* Take a look at **Project Cerberus**.

---
Tags: url, registration, spam
---


# Question
Title: How can I get Assets to regenerate S3 thumbnails after cache dir cleared?
Kicking the tires on the awesome Assets 2.02

When your system/expressionengine/cache directory is cleared, the thumbnails aren't regenerated for files that reside on S3 buckets.

The action calls the method `view_thumbnail()` which returns a broken image. It appears that when the thumbnail is not found, the script tries to resize a file that doesn't exist from `system/expressionengine/cache/assets/s3_sources` (this is where a thumbnail is created when the image is first uploaded).

The thumbnails are regenerated for normal filesystem images, so this is S3 specific.

Please supply a code patch if possible or a fix in the new version.

# Answer
> 1 votes
This has been fixed in Assets 2.0.3.

---
Tags: assets, s3
---


# Question
Title: With Assets 2 is it possible to restrict upload access to a folder within an S3 bucket?
Currently I have about 20 upload paths set in the native EE file manager. all of them point to a variation of subfolders within my main /images folder.

I was originally planning to use Assets 2 to host all of my images in a single Amazon S3 bucket like images.domain.com and use the same structure I currently have to restrict access to specific sub folders.

After playing around with Assets 2, it doesn't apear that you can restrict to a subfolder as restrictions are set on a per bucket basis.

Is there a way to do what I'm wanting?

# Answer
> 1 votes
Currently it’s all or nothing – the most you can do to restrict access is prevent certain member groups from accessing the Assets MCP in its entirety, and limiting individual Assets fields to specific EE upload directories and S3 buckets.

Fine-grained permissions are on Assets’ v.Next list, so they’ll be coming soon. (Probably 2.2.)

---
Tags: assets
---


# Question
Title: Matrix "Move to top/bottom" feature erases content from Wygwam Field
EE 2.5.3, Matrix 2.5.2, Wygwam 2.6.3

---

When a Wygwam cell is part of a Matrix and that row is dragged and dropped into a new order, everything is fine.

However, if you use the "Move to top" (or bottom) feature from the cell options dialog, the field moves and the Wygwam content is cleared.

Before moving:

After moving:

# Answer
This was fixed in Matrix 2.5.3. http://pixelandtonic.com/matrix/releasenotes
> 4 votes

# Answer
Just a guess, but there is a matrix.js file in the Wygwam folder that handles the drag events. I suppose its possible there is not an event for move to top/bottom, or no methods are bound to those events?
> 2 votes

---
Tags: matrix, wygwam
---


title: Deduplicating stash output

text:
# Question
Title: Deduplicating stash output
I'm trying to create a dropdown filter based off a custom field in channel entries.

```
{exp:channel:entries channel="events"}

  {!-- Build the complete listing --}
  {exp:stash:append name="listing"}
    <li><a href="{title_permalink='events/detail'}">{title}</a></li>
  {/exp:stash:append}

  {!-- Build the dropdown filter options. This is what I want to contain unique values --}
  {exp:stash:append name="locations"}
    <option>{event_location}</option>
  {/exp:stash:append}

{/exp:channel:entries}

<select>
  {exp:stash:get name="locations"}
</select>

<ul>
  {exp:stash:get name="listing"}
</ul>

```

This might output something like:

```
<select>
  <option>USA</option>
  <option>USA</option>
  <option>Australia</option>
  <option>Canada</option>
</select>

<ul>
  <li><a href="...">First US Event</a></li>
  <li><a href="...">Second US Event</a></li>
  <li><a href="...">Australian Event</a></li>
  <li><a href="...">Canadian Event</a></li>
</ul>

```

However, I want the values in the `{exp:stash:get name="locations"}` to only be output once.
ie. USA once, not twice.
Is this possible?

**Edit:**
Turns out it does what I wanted on its own in the code I posted.
However my *actual* code had a `{count}` variable thrown in for testing.

```
{exp:stash:append name="locations"}
  <option>{count} - {event_location}</option>
{/exp:stash:append}

```

The `{count}` made each row unique.

# Answer
Stash will automatically deduplicate the values if you are setting the exact same value more than once.
> 0 votes

# Answer
If you can use the `{exp:stash:get_list}` tag pair you have access to the `unique="yes"` **parameter**. Might try it on the `exp:stash:get` tag.
> 1 votes

# Answer
You can use a query to do this instead of the channel:entries tag:

```
{exp:query sql="SELECT DISTINCT field_id_1 as location FROM exp_channel_data WHERE channel_id = '2'"}
    {exp:stash:append name="locations"}
            <option>{location}</option>
    {/exp:stash:append}
{/exp:query}

```

Change `channel_id` to match the ID of your events channel and `field_id_1` to match your location field ID
> 0 votes

---
Tags: add-on, stash
---


# Question
Title: "File" fieldtype missing when trying to add a new channel field
My "File" fieldtype is missing when trying to add a new channel field after installing file module and safecracker. - I have tried uninstalling the both modules, but the field type has not come back. I have tried clearing all my caches but nothing is making it return. All previous file field types have disappeared too. ?

# Answer
> 1 votes
Got it - I must have uninstalled the file fieldtype when I uninstalled the file module. (Add-ons \> Fieldtypes) –

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


# Question
Title: Low Variable and conditional logic generating silent database queries
I’ve discovered a tricky question about parse order and low variables I’ve run into. This is a code base I’ve inherited, so I’m not sure how best to handle. (My apologies in advance; I am neither an EE nor a LV expert.) Any thoughts you have would be much appreciated.

Template pseudocode:

```
{if segment_2 ==“books”}
  {Generate list of books here—lots of heavy SQL}
    {if no_results}
  sorry, no books found
  {/if}
{lv_classic_display}  // This is a template for what we want to display for each book
{/if}

{if segment_2 == “authors”}
  ... same as above, but SQL pulls up authors

{if segment_3 == “publishers”}
  ... same as above, but SQL pulls up publishers

```

The problem I’m having is that the SQL stuff is being executed for ALL options on the page. So, even if my segment\_2 = “publishers”, it is still running the full SQL for pulling up all authors, and for pulling up all books, in addition to for publishers. The stuff is never displayed on the page, because of the IF statements in there, but the SQL is causing a major performance drag. It’s running hundreds of unnecessary queries in the background.

If I remove the {lv\_classic\_display}, the SQL does not execute. So it appears to me that the inclusion of the low variable is forcing the loop around it to execute BEFORE the IF statement.

Early Parsing is turned on on the site—and I don’t think I can turn that off. Is there a way for me to modify this to prevent this?

I have tried using the alternate syntax:

```
{exp:low_variables:parse var=“lv_classic_display”}

```

and while that DOES eliminate the database queries, it also outputs just the { } code, rather than executing it. So for each book my output looks like this:

{ml\_author\_name}

{ml\_screen\_name}

Any suggestions for how I might be able to adjust this? The performance on this page is getting killed by these silent SQL queries running in the background that aren’t ever going to get displayed….

Thank you very much.

Dave V.

# Answer
> 3 votes
The issue is that any `{if:else}` conditional nested inside the simple conditional `{if segment_x}` makes it an advanced conditional, which is parsed late in the template. So using exp:ifelse or exp:switchee is one fix.

Another more hidden trick (without add-ons) (thanx to low), is to set the if:else with a preload\_replace. The simple conditional is parsed first, finding no `{if:else}` inside the tag, the parser then replaces the `{ifelse}` variable with preload\_replace value after that.

```
{preload_replace:ifelse="{if:else}"}
{if segment_1 != ''}
{exp:class:method}
    {if var == "foo"}
        Lorem
    {ifelse}
        Ipsum
    {/if}
{/exp:class:method}
{/if}

```

https://gist.github.com/1391783
http://gotolow.com/blog/snippets-and-preload-replace-variables

# Answer
> 1 votes
Use the IfElse add-on to prevent the unresolved conditionals from being executed.

All you really have to do is wrap all your conditionals with `{exp:ifelse parse="inward"}{/exp:ifelse}`.

---
Tags: database, performance, low-variables
---


# Question
Title: email encode tag returning the tag as is in channel entries
I've just discovered that for some channel fields (from investigations so far, those that are marked for markdown formatting) `{encode email="you@example.com" title="send me an email"}` will that tag as is in the output. Obviously the whole point of using encode was not to expose the raw email address, so how can I get the encoding to work again?

**UPDATE:** Let me clarify that even though I have an answer up here, I'm looking for a better answer, so that is why I haven't marked mine as accepted yet.

**UPDATE 2** After some more poking around I've found that I have this issue in any fieldtype and any channel (as far as my testing has roamed) From discussions with others it doesn't seem to be the case that encode doesn't work in general anymore so it must be either something in my configuration, something in my environment, or something in my install.

I have checked through my config bootstrap and my config.php and see nothing that should be causing this, though I'm not aware of an option for disabling the encode tag, so I don't know what I'm looking for.

My server environment has not had any significant changes recently, I don't think this is likely to be it though I won't rule it out 100% if someone has an idea of an environment related cause that I should look into.

My install is potentially the cause. I have some unreleased (session handling related) code from EllisLab that was necessary to address some security concerns raised by a security audit we performed. This had a bug in it before which caused an issue with doing ajax queries in the control panel. I don't think it is likely that there is a bug in that code causing this, but it is possible. Any guidance on where in the EE codebase I should look for the code that should be doing the transform (the typography class?) I'll jump in and debug it.

The end result of this is that I don't have a good guess for what the cause of this issue is, and would like some help in figuring it out.

**UPDATE 3** I can confirm that the code that handles email encoding seems to be in the typography class, but I'm having some difficulty figuring out why my `{encode}` tags are not working. I'll put a bounty on this question to try out the bounty system, and to see if I can get an answer to this. I'll be trying to find the answer first. Feel free to beat me to it.

**UPDATE 4** I found a partial answer and have posted it in the answers section of this question. Now I'm looking for an answer about why convert\_curly is on in my install and how to turn it off without changing a core file.

# Answer
> 1 votes
If you're using EE 2.5.3, this is a bug. There's a hotfix here if upgrading is too difficult:

{path=} tag resolving correctly in one channel but not in another

Fix and discussion in bug tracker: https://support.ellislab.com/bugs/detail/18239

Also, your syntax is incorrect - it should be `{encode="you@example.com" title="Email Me!"}`

Edit to add - I read that you found the hotfix manually, however I don't think this was the true fix that made it into the 2.5.4+ version, so comparing that line in the typography file with the new version is misleading.

# Answer
> 2 votes
One solution I found is to use `[email="you@example.com"]send me an email[/email]` instead of the curly bracket method. It seems like the parser is converting the curly bracket to an entity and then not parsing the tag as expected.

This solution seems like it is going to require some fairly extensive search and replace either using the search and replace tool provided by EE, or writing my own script (or find an addon) to let me do a regular expression search and replace on the database, so it would be better if there was a way to make `{encode}` work as expected.

# Answer
> 1 votes
Markdown isn't one of the normal formatting options, which add-on are you using to add the functionality? Is it this one?

Can you temporarily revert the field back to 'none', or 'xhtml and see if the {encode} options works then?

The `{encode}` option should work with the normal field formatting options. But it's good to test anyway. If it works with the normal field formatting, then the issue is the add-on.

Generally speaking, it's the javascript that converts the mark-up. From what I've been able to discern is that most of these field\_types or formatting options, all assume that the user will want to occasionally showcase code as part of a post. You can see the issue, in one of the sample images provided by Markdown Field below:

The sample image, shows off Markdown being able to display code. Notice what is part of the code `{}`. That means the field or formatting type will convert brackets to html entities so that they display. This renders `{encode}` non-executable, but since normal brackets \[\] normally aren't converted, they are fine to use.

You can hack your add-on and remove `{}` from the convert options, or you can use the BBCode option, which is a nice failsafe, built right into ExpressionEngine for these situations ( I don't know if that was why it was included, but I'm glad it works ).

If it's highly unlikely that you will ever need to display any type of code. I say, hack away. If you aren't using the Markdown Field, then I'd start where most WYSIWYG field\_types do this, in one or more javascript files in the `third party` folder of `themes` for the related item, that contains the code.

If you are using the Markdown Field, then look in the `library` folder under `expression engine/third_party/markdown/` the file `markdown.php` contains this code at lines 201-203

```
201    # Table of hash values for escaped characters:
202    var $escape_chars = '\`*_{}[]()>#+-.!';
203    var $escape_chars_re;

```

That's the starting point for `{}` references. But you also need to examine the rest of the code, to see if there are other references, and modify them as needed.

I know it's not ideal, but one of the issues of converting plain text and html text to something else, is you get easier formatting, but other things may fall to the wayside. The `[email][/email]` isn't a bad option, and you can use FIND and REPLACE to handle adjusting any prior `{encode}`.

# Answer
> 1 votes
So, going in a wildly different direction; the easiest way to fix this is to wrap this in `{exp:allow_eecode}` plugin-tags, provided by the Allow EECode plugin from EllisLab themselves.

# Answer
> 0 votes
This turns out to be a result of expression engine converting the curly brackets into entities before parsing for encode tags. On line 118 of my system/expressionengine/libraries/EE\_Typography.php file I see the following line:

```
$this->convert_curly        = TRUE;     // Convert Curly Brackets Into Entities

```

Changing the TRUE to FALSE, resolves the issue. Obviously editing this in core is less than ideal and it actually changes the default behavior for the Typography class.

I downloaded the latest version of expressionengine and checked the value for this variable in the default install and indeed it is set to TRUE, so it isn't a matter of me having somehow inadvertently changed it by accident. I find it strange that no one else seems to be having this issue:

Have people just not noticed that their encode tags are now exposing their email addresses? Am I the only one with encode tags still on their site? Is there an override set somewhere that I need to find?

I welcome comments to this answer to confirm whether the encode tag works for you on your install, and separate answers for how to get it to work again without modifying core.

# Answer
> -2 votes
(from https://superuser.com/a/236152 ) (opiniated bold mine)
There was an interesting article by Cory Doctorow recently on this subject here\* which argued that email obfuscation doesn't serve much purpose, and a more optimal approach is intelligently managing the spam you get.

TL;DR version:

* The objective of this entire exercise is not to reduce the amount of spam you get in your email, but the amount of spam you manually have to remove from your inbox.
* **Email obfuscation is a constant battle to come up with ever sophisticated bot-proof, human-readable encoding, and is a drain on the productivity of both the creator, and the correspondent.**
* "Almost any email address that you use for any length of time eventually becomes widely enough known that you should assume all the spammers have it."
* **"The convenience of stable, easily copy-pastable email addresses" wins over trying to hide from the spambots.**

* http://www.guardian.co.uk/technology/2010/dec/21/keeping-email-address-secret-spambots

---
Tags: ee2, email, encode
---


# Question
Title: Template partials and caching via Stash and CE Cache
Wondering what the best method is for caching with Stash and or CE Cache when using Template Partials. Some questions come to mind:

* Is it best to use CE Cache in the wrapper (this seems easiest?)
* Should we be using CE Cache in each of the partials instead of the wrapper?
* Should we be using Stash caching in the viewModels first?

Again, hope to see some best practices in regards to working with ExpressionEngine template partials approach for caching with Stash and or CE Cache.

# Answer
@Jae - You can use rules in the same way with CE Cache. The parameter tag= allows to you add tags and then in the cp, control when they are refreshed - hope that helps.

In terms caching and partials, I use CE to cache the wrapper with the parameter global="yes" and then escape the stash:get. Then within the stash:set cache the page.

I also set the caching timeout in the config to 0 so it's there for good, then with the above mentioned tagging, any update to the entry/channel results in cache being reset but not the global wrapper.

It works well for us, I'd be interested to hear any other approaches. This gives us flexibility and some great caching. Also, on non-dynamic sites (no user logged in stuff), CE has static caching - which is like lightening.

Is this what you are doing? Anything better out there?
> 3 votes

# Answer
Perhaps a bit off-topic, but for partials, we tend to go with Solspace Template Morsels. CE Cache is great to wrap multiple blocks of code, but the fact that TM comes with both time-based and edit-based rules is a real plus (i.e., update cache when an entry from channel xyz is edited/created).
> 0 votes

---
Tags: stash, caching, ce-cache, template-partials
---


# Question
Title: How to keep admins at /admin.php and out of /system?
When using admin.php to point to the /system folder, sometimes admins will end up redirected from urls with /admin.php to urls with /system. This presents problems with various add-ons, and generally speaking if I set everything up with /admin.ph pI'd like to keep them there. Is there an .htaccess rule I can use that will ensure that?

# Answer
> 1 votes
One thing I've noticed, which may not apply to your issue, is that if you create a Nav shortcut to a page in the EECP, and then later change the URL to your CP, those previously created Nav shortcuts will not be updated. This will cause missing pages should you click those shortcuts after the URL move.

The solution is to delete the shortcuts and recreate them. Maybe there's a way to edit them, but that's what I did to fix that particular issue.

---
Tags: control-panel, htaccess
---


title: Orderby & sort not returning entries

text:
# Question
Title: Orderby & sort not returning entries
I'm using the code below on EE2.5.3 and playa 4.3.3 and am not getting expected results. With the orderby and sort parameters in place, I only get 1 entry returned.

If I remove the orderby and sort parameters I get 4 entries returned, albeit not in the order I want.

Can anyone explain this disparity?

```
    {exp:channel:entries channel="subcontractors" orderby="title" sort="asc" dynamic="no" disable="categories|category_fields|member_data|pagination"}
        {if {exp:playa:total_parents} >= 1}
            <li>{title} → {exp:playa:total_parents} Warranty items</li>
        {/if}
    {/exp:channel:entries}

```

# Answer
You can use the Playa Children tag to show children, rather than the channel entries tag and then a conditional.

```
{exp:playa:children field="field_where_relationship_was_made"}
  <li>{title} → {exp:playa:total_parents} Warranty items</li>
{/exp:playa:children}

```
> 2 votes

---
Tags: add-on, channel-entries, playa
---


# Question
Title: Moved /images, errors in log from those images, solution?
I moved the /images folder on a site, which contained uploaded images, to a new containing folder. I was able to update all the images used by the site itself to use the new path, but there's still a lot of links out there in user generated content both on the site and elsewhere that points to that old folder location. Is there a solution to those errors, maybe an htaccess rule?

# Answer
There certainly is an .htaccess rule you can use. Try this:

```
RewriteEngine on
RewriteBase /
RewriteRule ^images/(.*)$ http://www.example.com/new/images/$1 [R=301,L]

```

Give that a shot and let us know how it works.
> 2 votes

# Answer
There is a "search & replace" tool in the CP under Tools \> Data which you can do to make the change to the entries directly. Back up the DB first of course.
> 0 votes

---
Tags: htaccess
---


# Question
Title: Profile:Edit New Member Password Saving Issue
When using Profile:Edit and CartThrob together we are saving member data as part of checkout.

If we look directly at the DB the password is being saved but there is nothing in the salt column of the `exp_members` table. If you try to login on the website EE throws a `The existing username and/or password you submitted are not valid` error.

If you then go to member management of the CP and enter the password just like it was during checkout, a value is added to the salt column of the DB and you can login on the website without issue.

Does anyone have suggestions about how to get Profile:Edit/CT to salt the password?

Thanks for your time.

# Answer
You shouldn't need the password salted for login to work. ExpressionEngine's member login code is designed to automatically add a salt and improve the hash up login. It's pretty common for a newly-created member to not have a salt.

Obviously this doesn't answer your question completely, but maybe it'll help you narrow down the causes of your issue.
> 1 votes

---
Tags: members, cartthrob, password
---


# Question
Title: Channel Field Date: Ignore timestamp during comparisons
I have a channel field named start of campaign and one named end of campaign. I want to make do a conditional that says if today is equal to or later than the start of campaign AND today is before the end of the campaign then do something.

But what I've noticed is if you use %U for formatting it includes the time the entry was created which means the date range is more like 1/1/13 1:13PM -\> 1/5/13 1:13PM when what I really want is 1/1/13 12:00AM -\> 1/5/13 11:59PM

```
{if '{start_of_campaign format="%U"}' <= '{current_time format="%U"}' AND '{end_of_campaign format="%U"}' > '{current_time format="%U"}'}

```

That is what I am currently using but that cant be accurate right?

# Answer
I usually use the following format for dates comparisons

```
{if '{start_of_campaign format="%Y%m%d"}' <= '{current_time format="%Y%m%d"}' AND '{end_of_campaign format="%Y%m%d"}' > '{current_time format="%Y%m%d"}'}

```

That should give you numbers that can easily be compared.
> 0 votes

# Answer
I was unable to get Lisa's method to compare properly when it came to different years. I did find this example which seems to be resolving correctly:

```
{if "{current_time format='%Y-%m-%d - %H:%i:%s'}" > "2010-04-03 - 17:00:00" }
code
{/if}

```

compare dates
> 1 votes

# Answer
Instead of using %U - you can build out the format you want yourself:

`format="%n/%j/%y"`
> 0 votes

---
Tags: custom-fields, date, date-format, comparison
---


# Question
Title: How do I filter Low Search results based on custom fields?
just looking for a bit of help in expanding my sites search capabilities.

I have a very basic search box at the moment, handled by Low Search.

It searches one channel (a single collection) and returns results fine.

What I would like is to be able to filter these results based in custom field data within the entries.

For example, I have a checkbox field that lists several "features" for that entry.

I would like the user to be able to select one (or more) of these features and then update the search results with the entries that have these features with the custom field.

I'm thinking something along the lines of the filter section of Devotee.

The Low Search docs have info on creating a more complex search form with more options, but I cannot seem to see anything about "filtering" results.

Just not sure how to implement it, so any pointers would be good!

**UPDATE**

Right, I've had a go at trying this out, but cannot get it to work properly.

Maybe its the way I'm set up.

I have a main listing template, that is changed via Switchee, with one of the variables being my search results template, however my actual search form is contained within a sidebar that is within a Low Variable :)

This is my search form code:

```
{exp:low_search:form query="{segment_3}" result_page="walks/results"}

            <label>Search for a walk:</label>
            <input type="text" name="keywords" id="keywords" class="span5" />

            {exp:low_options:walk_features_new}
                {options}
                    <label>
                        <input type="checkbox" name="walk_features_new[]" value="{option:value}"
                        {if "{option:value}" IN ({low_search_search:walk_features_new})} checked="checked"{/if} />
                        {option:label}
                    </label>
                {/options}
            {/exp:low_options:walk_features_new}

            <button class="btn btn-block btn-blue" type="submit">Search</button>

        {/exp:low_search:form}

```

**Note:** the IN-conditional works in EE 2.8.1 or below. If you're using EE 2.9 or up, use a different syntax.

And my results page has the following within the switchee case:

```
{exp:low_search:results query="{segment_3}" collection="walks" search_mode="all"  status="open|new" show_expired="yes" dynamic="off" limit="10" paginate="bottom"}

                {lv_walkdetails_main}

                {lv_pagination}

                {if switchee_no_results}

                    <p>Sorry, no results!</p>

                {/if}

            {/exp:low_search:results}

```

When i run a search via the search box (keywords) it works fine, but when I select one of the options, it does provide correct results, or remember what was selected.

Anything obvious wrong?

(not sure if it helps, or makes a difference but it's a P&T checkbox field.)

# Answer
> 7 votes
For the record, I know devot-ee uses Low Search for searching only. The filtering you mention is done by a custom add-on they have developed internally. But that doesn't mean you can't achieve something similar with Low Search; you just have to approach things a bit differently.

First, you need to create a Low Search form on the results page. You then add the `query` parameter to it, just like the Results tag. This will make the Form tag 'remember' the posted query.

You then need to add the checkbox list to the form tag. If you're not going to hard-code it in your template, you could use Low Options (free) to generate it. For example, say your checkbox field is called `features`, then use this code inside your Form tag:

```
{exp:low_options:features}
    {options}
        <label>
            <input type="checkbox" name="search:features[]" value="{option:value}"
            {if "{option:value}" IN ({low_search_search:features})} checked="checked"{/if} />
            {option:label}
        </label>
    {/options}
{/exp:low_options:features}

```

...which will generate a list of checkboxes, remembering which was checked when the form was submitted again.

Note that this will give you results for *any* of the checked values, not *all*. If you only want entries that have *all* the features checked, make sure you add that to the `require_all` parameter of the Form tag: `require_all="search:features"`.

Also note: the IN-conditional works in EE 2.8.1 or below. If you're using EE 2.9 or up, use a different syntax.

---
Tags: search, low-search, filter
---


title: Restyling site without going offline

text:
# Question
Title: Restyling site without going offline
I want to renew my site without going offline I thought these steps:

1. Copy all the files and db from remote to local (on wamp)
2. Make the changes
3. Move from local to remote

is this the easiest way to do this? There are better ways?

Thank You

# Answer
> 2 votes
It sounds like you want to set up a development site on your local machine.

The easiest way to do this would be to first download all the files from the live server then make a database backup.

On your local machine, set up your environment, drop your files in place then create a new database using the backup you just made from the live site.

Update your config and database files as necessary to use the new paths and database connection on your local machine.

Do your work.

The tricky bit comes next. Depending on the changes you're making you will need to restore the files and data to the live server.

If no content has changed on the live server (including member registrations etc) then you can simply replace the database and upload your new files.

If content on the live server has changed then it's going to be harder as you need to get the databases in sync somehow and get your new fields, add-on data onto the live server while retaining the site content.

If the changes are just to templates then you should be fine. Equally if just a few new fields and add-ons were added then it might be easier just to recreate them on the live server (after taking another backup of course).

There may well be a better way to get the databases 'in sync' by doing some kind of 'merge'. I'd be interested in hearing them myself!

# Answer
> 2 votes
You might like to check out FocusLab's master config approach, which lets you setup multiple environments. That way you get local, dev and live environments setup. Make changes to your local version, then when you're ready just deploy to live site manually or using something like Git.

---
Tags: offline
---


title: "is_system_on" problem

text:
# Question
Title: "is_system_on" problem
I am having a tough time getting "is\_system\_on" to work right in production. In the "General Config" page in the CP, neither the "yes" or "no" radio buttons are set. When I select one and click submit, they go blank again.

In 'config.php', I am seeing something like the following, with multiple "is\_system\_on" settings which looks suspicious. Any ideas?

```
$config['app_version'] = "253";
$config['install_lock'] = "";
$config['license_number'] = "xxxx-xxxx-xxxx-xxxx";
$config['debug'] = "1";
$config['cp_url'] = "http://local.site.com/admin/index.php";
$config['doc_url'] = "http://expressionengine.com/user_guide/";
$config['is_system_on'] = "y";
$config['allow_extensions'] = 'y';
$config['site_label'] = 'My Site';
$config['cookie_prefix'] = '';
$config['is_system_on'] = "n";
$config['is_system_on'] = "n";

```

My config.php file is writeable (obviously, since the extra entries are showing up). I am using the focus labs config stuff, but removed the line hard-coding the is\_system\_on variable.

# Answer
> 1 votes
If you're using FocusLab's master config, just double-check that is\_system\_on isn't being set as an environment config somewhere else (e.g. config/config.prod.php).

# Answer
> 0 votes
The config var is being set 3 times. That said, based on that, the radio button should be showing as 'no' within the CP.

I would imagine in production (unless you're just about to put the site live and don't want anyone other than super admins accessing) you want to remove all but 1 instance of the variable, and set it to 'y'.

---
Tags: control-panel, config
---


# Question
Title: embed member information in another member's profile
I am using zoo visitor, safecracker and solspace user to enable a site member to act as an agent and register other client members to the site. These new members are linked to the agent via a hidden text field that is filled during the registration process with the agent's member\_id.

```
<input type="hidden" name="agent_id" id="agent_id" value="{exp:user:is_mine     member_id="{member_id}"}{member_id}{/exp:user:is_mine}">

```

I now need to show some of the agent's info in the client's template. (agent name and logo) I'm sure I could use an embed of some sort but I'm not quite sure where to start!

# Answer
> 2 votes
When the agent signs up a member write the member id of the agent to a custom member field of the user.

Then when outputting details of the user, you can use an embed of some sort and pass the agent's member ID to it something like;

Assuming {agent\_id} is the name of the custom profile field in which the agent's member id is stored.

```
embed('includes/_agentinfo' agentid="{agent_id}')

```

---
Tags: embeds, zoo-visitor
---


title: Php error after upgrading to Assets 2

text:
# Question
Title: Php error after upgrading to Assets 2
After upgrading assets most pages work fine, but I do have problems with empty assets entries. When viewing such a page the following error occurs:

> Uncaught exception 'Exception' with message 'unknown\_source' in .../expressionengine/third\_party/assets/libraries/assets\_lib.php:1188 Stack trace: #0 .../expressionengine/third\_party/assets/ft.assets.php(1114): Assets\_lib-\>instantiate\_source\_type(Object(stdClass)) #1 \[internal function\]: Assets\_ft-\>pre\_process('{filedir\_3}foto...') #2 .../expressionengine/libraries/api/Api\_channel\_fields.php(350): call\_user\_func\_array(Array, Array) #3 .../expressionengine/modules/channel/mod.channel.php(3790): Api\_channel\_fields-\>apply('pre\_process', Array) #4 ...expressionengine/modules/channel/mod.channel.php(323): Channel-\>parse\_channel\_entries() #5 .../expressionengine/libraries/ in .../expressionengine/third\_party/assets/libraries/assets\_lib.php on line 1188

I've managed to solve this by re-saving all entries that cause the conflict. Since this is not a huge site that was doable. But it might be worth knowing what's the cause.

It's an MSM site, 2.4.0

# Answer
> 2 votes
this will be fixed in an upcoming release - apparently we didn't think of everything :)

---
Tags: assets, upgrade
---


# Question
Title: Only allow users to see files they previously uploaded in Assets
With the new html upload form would it be possible to add files like using safecracker file upload?

I want members to be able to upload images/files (ideally with assets) and then they can only see what they have uploaded and not the directory of files. Is this possible?

# Answer
> 1 votes
This isn't possible with Assets: Assets does not track who uploaded a file, so this kind of association is not there.

---
Tags: add-on, assets, uploads, safecracker-file
---


# Question
Title: Image manipulations with category images
Is it possible to use image manipulations with category images? I have heard conflicting reports and it's not working for me. There is a spot to designate image manipulations for category images, but it does not work to reference `{category_image:medium}` in a template.

# Answer
I tested this on 2.5.5 and it doesn't work. I noticed a few posts in the forums that EL staff said this might not even be available. There was one forum post which I wasn't able to read because it was for "development preview" members so, I wonder if that is the fix being tested or something.

I can agree with Michael in that it does in fact create the folder and resize the image though, the tag isn't being parsed. You just get the tag itself like Mike said.

Consider submitting a bug report (or possibly a feature request as I've seen EL suggest in the forums.)
> 5 votes

# Answer
Doing a test on my local machine, I'd declare this to be a bug.

I see that the resized image used for the category image gets created, but when I reference it by the image manipulation name specified in the Upload Pref I just get "`{category_image:manipulation_name}`" rendered out into the source code while removing and just using `{category_image}` works fine.

Oops - just saw my local install is on 2.5.2 yet. I don't see any reference to the issue in the bug tracker or change log however.
> 3 votes

---
Tags: image, categories
---


# Question
Title: How to remove category URL indicator segment?
I have a products section with 5 different product categories and all products are assigned to one category only. The current URLs are like this --\>http://site.com/products/category/oral-care/. I would like to remove the "category" segment so the URLs are more like this http://site.com/products/oral-care/.

As weird as this sounds I *have* done this before on a different site. I used a combo of GWCode Categories and LowSeg2Cat to create my product links based on nested categories and successfully created URL's with this format http://site2.com/products/food/fruits/. In that URL food is a category and fruits is a subcategory. I can't figure out what I did to get this working and can't get it working on the new site. Is there a different method? Thanks for any info.

# Answer
> 4 votes
Yup, this is a snap with Low Seg2Cat. Example:

```
{if segment_2}
    {exp:channel:entries channel="channel" category="{segment_category_ids}"}
    ....
    {/exp:channel:entries}
{/if}

```

(If you're going to be using other filters, or pagination, in your `products/index` template, then you need to do more advanced checking in that conditional to determine whether you should add the `category=""` parameter - in which case I'd suggest using Switchee for that conditional.)

When it comes to creating links to those category URLs, you can't use the `{path=""}` variables, but instead you need to build the links manually:

```
{categories backspace="2"}<a href="/products/{category_url_title}">{category_name}</a>, {/categories}

```

---
Tags: categories, url, segments
---


# Question
Title: custom fields in e-mail module's contact form
I'm using EE's built in e-mail module for a contact form on my site. I'd like to add additional fields to the form that it doesn't have out of the box. I know freeform by solspace will do this, but I was hoping there is a way without spending $100 on a plugin.

# Answer
EE's contact form does not support custom fields per se (i.e., it doesn't support the custom fields you'd use for your channels), but you can have multiple fields populate the message by naming each with an array syntax:

```
<label for="message">Your Message</label>
<textarea name="message[]" id="message"></textarea>

<label for="how">How did you hear about us?</label>
<textarea name="message[]" id="how"></textarea>

<label for="age">How old are you?</label>
<select name="message[]" id="age">
    <option value="16-20">16-20 years</option>
    <option value="21-30">21-30 years</option>
    <option value="31-40">31-40 years</option>
</select>

```

(Docs.)

I'll also point out that there is a free version of Freeform 4 which lets you add as many fields as you like to your message - just not all of the custom field types.
> 5 votes

---
Tags: email, module
---


title: MSM with separate add-ons enabled?

text:
# Question
Title: MSM with separate add-ons enabled?
Can I have separate add-ons installed for each site when using MSM?

For instance, for an EE install using MSM:

* One or more sites within the EE install will use Transcribe for localization.
* One or more sites within the EE install will not have localization

If possible, I'd like to avoid having Transcribe enabled for a site with no localization.

# Answer
> 1 votes
None of the `exp_extensions`, `exp_fieldtypes`, or `exp_modules` tables have a `site_id` column, so no - enabled for one site is enabled for all sites.

But Dom is right \- good add-ons will have *settings* per-site, which in most cases should prevent any issues with having add-ons enabled on sites where you don't need them.

# Answer
> 1 votes
Addons are available to all sites in an MSM install, however they can have per-site preferences (that's up to the developer). Your best bet would probably be to contact the Transcribe devs to clarify the addon's MSM functionality and whether it's possible to have a mixture of localised and non-localised sites running from a single EE install.

---
Tags: add-on, multi-site-manager
---


# Question
Title: send email to different recipient based upon drop-down selection
I have a select drop-down with different values in it on my contact form, and I want to direct the e-mail to a different person based upon the value selected in the drop down. How could I accomplish this?

# Answer
Solspace's Freeform has a dynamic recipients functionality that just might serve your needs.

I quote:

> `recipients="yes"`
>
> This parameter allows you to let your users select recipient email addresses dynamically within the form itself. So for example, you can have a dropdown select menu that allows your users to select the destination for their email (Sales, Support, Service, etc). You can have corresponding email addresses to those options and the result is that the user can direct which email the notification should go to.
> 5 votes

---
Tags: email, module
---


# Question
Title: How do I obtain the entry_id in the Publish screen for use in javascript (EE1 and EE2)?
This Fieldtype will need to allow the "profile admin interface" created from the API to appear on the Entry Publish/Edit page. The only thing that I was told I'll need to add to the script (as a variable) is the current entry's ID. I tried to find a fieldtype I could use as a reference and I see fieldtypes like Color Picker http://devot-ee.com/add-ons/color-picker that may be similar but that one doesn't load the entry ID into the script as a variable. I don't believe I'll need to store anything in the database, because the script will send any selections by the author to the remote site to store (associated to the entry ID and an API key from https://electnext.com/) so hopefully it won't be that difficult.

I'm mainly a front-end coder so this is a bit out of my comfort zone, but I'm fairly confident I can pull it off with some guidance.

Thanks!

# Answer
> 1 votes
I believe it is stored in a hidden form input on the page, like so:

```
<input type="hidden" name="entry_id" value="123" />

```

So you could grab it with JQuery with something like this:

```
var id = $('input[name=entry_id]').val();

```

It should also be in the query string of the URL as a get variable if you wanted to go that route, but finding it on the page would probably be more direct.

---
Tags: ee2, add-on-development, ee1, fieldtype, entryid
---


title: Related_Entries how-to?

text:
# Question
Title: Related_Entries how-to?
Perhaps I've misunderstood what Related\_Entries is aimed at accomplishing, but I've tried a number of variations and can't seem to get some very simple template code to parse correctly.

**Channel Setup**

I've got a Matches channel and a Teams channel. The Matches channel has two fields in it labeled as "Team 1" and "Team 2". They're both set as a Relationship to the Teams channel. I've created some test Matches and assigned Teams to them and everything appears fine there. However, I'm attempting to create a sample template using all of this information. See below:

**Template code**

```
<!DOCTYPE html>
<html>
<head>
    <title>Matches</title>
    <meta charset="utf-8">
</head>
<body>
<h1>List of current matches.</h1>

{exp:channel:entries channel="Matches" limit="10"}
<h2>{title}</h2>

{related_entries id="Teams" entry_id="{team_1}"}
  {team_name}
{/related_entries}

vs

{related_entries id="Teams" entry_id="{team_2}"}
  {team_name}
{/related_entries}

{/exp:channel:entries}
</body>
</html>

```

{team\_1} appears to just be returning an id of some sort... I presume it is the rel\_id.

**exp\_relationships/clearing cache/table behavior**

To further muddy the waters, while troubleshooting, it was recommended I clear the Relationship cache within EE through the Admin interface. This action cleared out all data within the rel\_data column in this table but I've yet to find an *ideal* way to repopulate this data. The only way I've found is to go into Content \> Edit \> Matches, edit one of the matches and CHANGE the team participating in the Match and then change it back. Simply hitting "Update" doesn't appear to re-populate the table.

**EDIT: SOLUTION**

I made a mistake and read the documentation on the related\_entries tag incorrectly. The accepted answer below is based on the comment he made pointing out that I need to use the field id instead of the Channel name.

The changed line(s) should look something like

```
{related_entries id="team_1"}

```

# Answer
Try removing `entry_id=""` the only parameter to the related\_entries tag is the id parameter, which is the shortname of the relationship field. This means the name of the field where the dropdown allowing you to select a relationship lives. As an example, I have a channel called `programs` in which the channel field naming convention is three letter channel code underscore 2 letter language code underscore name. Here is my code for one of those related\_entries tags:

```
{related_entries id="pro_related_program"}
    <p>This session is part of a larger series.  For more information see <a href="{title_permalink="programs/catalogue"}" title="TDLC: {title}">{title}</a></p>
{/related_entries}

```
> 0 votes

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


title: WYGWAM 2.6.3 and Image URL tags

text:
# Question
Title: WYGWAM 2.6.3 and Image URL tags
I have an issue where I upload an image through WYGWAM 2.6.3, then using Assets 2.0.1 as a file browser, and when I view the Source it has the IMG tag in there. I save / submit the entry, but when I view it on the live published site it has the IMG tag stripped out leaving just the URL as plain text. There isn't any parameters to my WYGWAM custom field tag and it's just the name of the field. The text formatting around the image shows up, it's just the IMG tag that doesn't. Odd.

Not sure what's going on. Any help?

Assets 2.0.1, WYGWAM 2.6.3, EE 2.5.5

**EDITS:** *Process*

I have a WYGWAM field set to Brandon's original "Basic" configuration. WYGWAM 2.6.3, Assets 2.0.1 are being used.

1. I load the entry, click in the field to where I want to insert the image
2. Click the little picture icon, it loads Assets, I choose to upload a new image
3. I upload it
4. Choose the file in Assets, it inserts my uploaded image.
5. Next I view the source and I see the IMG tag with the SRC to a URL (that image path does load an image by itself).
6. I go and view the entry on my page and it just has the URL as plain text, tags are gone.

Those are my steps.

# Answer
This may be an issue with Channel Videos. I'll consider this response from Lisa Wess as an answer in that it isn't a WYGWAM issue. Thank you Lisa for helping out.
> 1 votes

---
Tags: assets, wygwam
---


# Question
Title: Assets 2 thumbnails not showing in s3 sources sub directories
The files show up but it just says "JPG" instead of showing the thumbnail. The strange thing is that any images just in the root of the bucket show the thumbnail just fine but if i move that same image into a sub-directory I get nothing.

Seems to be pretty consistant throughout the site no matter what i do. I updated the indexes, tried uploading files directly to the bucket or through the interface, and i double checked permissions on both the local cache directory and the s3 bucket.

Related would it to filter a field to the sub-directory level instead of just the "source" level? we use one master s3 account for all of our clients and would be nice to "bucket" their directories together. I realize its a slippery slope with directories within directories but just one level would help us a lot..

# Answer
> 1 votes
The issue you're describing sounds pretty weird and I suggest you email us at support@pixelandtonic.com, so we can work with you individually to resolve this - most likely we'll bee needing FTP and Superadmin access to pull out all the stops on our debugging skills.

As for the other request you mentioned - am I understanding correctly that all your client resources are thrown together in a single bucket, only the subfolders differ? That by far is not the most optimal choice of managing files - I strongly suggest you use a different bucket for each client and thusly eliminate the problem. What you're asking for is a cure for the symptoms, not the problem :)

---
Tags: add-on, assets, thumbnails
---


# Question
Title: Problems with {low_search_search:channel_field} tag
I have this form

```
{exp:low_search:form collection="test" secure="no" search_mode="any" loose_ends="yes" result_page="test/"}
    <fieldset>
        <h2>{low_search_search:region}</h2>
        <h2>{low_search_search_mode}</h2>

        <label for="region">Region:</label>
        <select class="span12" name="search:region" id="region">
            <option></option>
            {exp:channel:entries channel="regions" orderby="region_name" sort="asc"}
                <option value="{region_name}">{region_name}</option>
            {/exp:channel:entries}
        </select>

    <button type="submit" class="btn btn-primary">Search</button>
    </fieldset>
{/exp:low_search:form}

```

I tried choosing a region and then submit it. This form submits it to itself.

But after submission, the content of the first h2 tag above(low\_search\_search:region) is empty while the second one(low\_search\_search\_mode) is showing "any".

Why isn't "low\_search\_search:channel\_field" working? Is there something wrong that I am doing?

# Answer
Add `query="{segment_2}"` to the Form tag, so it knows what has been submitted.
> 0 votes

---
Tags: low-search
---


title: Low Search - Range Search

text:
# Question
Title: Low Search - Range Search
Lets say I have this form

```
{exp:low_search:form collection="members" secure="no" search_mode="any" loose_ends="yes" result_page="flatmates/"}
    <fieldset>
        <p>Age</p>
        <select class="span5" name="range-from:age" id="age_from">
            <option></option>
            <option value="18">18</option>
            <option value="19">19</option>
            ....
            <option value="65">65</option>
        </select>

        <select class="span5" name="range-to:age" id="age_to">
            <option></option>
            <option value="18">18</option>
            <option value="19">19</option>
            ....
            <option value="65">65</option>
        </select>
    </fieldset>
{/exp:low_search:form}

```

What happens to the search results when I make it so that the "from" is greater than the "to" value or the "to" value less than "from"(for example, if I choose 40 for the "from" and then 18 for the "to"?

How does Low Search handle this? Does it somehow swap them or intepret the lesser value as the "from" and the greater value as the "to"? Or does it do nothing(no swaps, no errors, etc)?

# Answer
> 2 votes
Low Search will do what you tell it to do. So, if you set the from-value to 40 and the to-value to 18, it will search for `field >= 40 AND field <= 18`, which will return no results. No swapping, no errors.

If you need validation, you can take care of that on the front-end, using JavaScript. Or use pre-defined date ranges in a single `<select>` element, for example:

```
 <select name="range:age">
     <option value="">Select age</option>
     <option value=";17">Under 18</option>
     <option value="18;25">18 - 25</option>
     <option value="25;35">25 - 35</option>
     <option value="35;50">35 - 50</option>
     <option value="50;">50+</option>
</select>

```

---
Tags: low-search
---


title: Looking for an Auction Plug-in

text:
# Question
Title: Looking for an Auction Plug-in
I have a client looking into setting up a low volume auction site for a niche market. The user would like to avoid a different login for members and admins and prefers to stay with EE if at all possible

1. Are there any available add-ons that are designed to allow community members (non-admins) to post their own auction items, timed and buy it now options and require a commission payout to the website upon auction completion.
2. Can this functionality be rolled out with any of the existing store add-ons (espresso, cart-throb, brilliant retail), if so, how would you approach this?

Thanks for any input.

# Answer
I think this is actually possible with ANY existing e-commerce solutions (CartThrob, BrilliantRetail, Store) PLUS custom add-on.

The store should be set up in a way that items would be visible, but not available for purchase until the auction is complete.

The auction add-on should record all bids and change item's price.

When auction is complete, the item status should be changed (so it becomes available for purchase) - but the auction add-on should restrict the purchase to be available only to member whose bid was winning.

Regarding adding items to auction, I'm not sure what approach BR and Store use for it, but with CartThrob it can be done by simply providing SafeCracker form.
> 2 votes

# Answer
A quick search at Devot-ee shows no auction add-ons, though it's possible that one was created and not posted there. But, I do recall their being a discussion about an Auction Module for EE awhile back and went searching in my bookmarks.

The reference I found was a tutorial on how to build your first module, an Auction Module. The tutorial is done by Andrew Weaver, who's built a number of great add-ons for ExpressionEngine. It's part of his ExpressionEngine Add-on Recipes website, which is…

> a collection of articles and tutorials to help you learn how to build ExpressionEngine add-ons.

So far there is an eight part series on 'Building an Auction Module'-Our First Module, that can probably be stepped through in under a week. Downside, you'd need to do it yourself and I'm not certain if the series is fully complete or is at something like 8 of 10 entries. But Andrew could probably be contacted to help you finish off any remaining components. His email is available right on the site.

I'd think that after the auction is won, you could probably use Simple Commerce or Exp:resso Store to handle the final payment transaction. That part could be a little tricky, but shouldn't be to hard. All auction items would need to start with a base price/bid, that will allow you to complete the Store record. But the final price could possibly be handled the same way donations are, by using the quantity field instead of the price field, when the price field is set to $1. That way a bid of $500 would be Qty: 500 x Price $1, to record the final sale price.
> 2 votes

---
Tags: add-on, ecommerce
---


title: Assets 2 not indexing

text:
# Question
Title: Assets 2 not indexing
I have installed Assets 2 on a 2.5.5 EE install.

I have tried to index the files, but it just sits there and does nothing. No loading bars display like on another website I have used this on.

I left it until the session expired, and nothing.

Anyone have any ideas?

# Answer
OMG: I found the problem!

It's because in my .htaccess I added a www. and I set my base\_url without www.

so it's just a www. or no www. issue for me! hope that helps!

cheers
stefan
> 5 votes

---
Tags: assets
---


# Question
Title: Can I hide individual elements from Store product details field
I'd like to hide certain unused fields from the store product details field on the publish page. Is this possible?

Have a product channel with a store product details tag and like to hide the "min. order quantity" field as it is irrelevant in this particular situation and it only confuses the user.

# Answer
> 1 votes
There's no built in way to customize the look of the Store product details field in the control panel entry screen.

One option you have if you need to do this is create an extension which uses the `cp_css_end` hook to add your own CSS to the control panel, which hides the fields you don't need.

# Answer
> 0 votes
Inside the channel:entries tag you can write conditionals based on the **{channel\_id}** or **{channel\_short\_name}**. For example:

```
{if channel_id != "10"}SHOW "min. order quantity" field{/if}

```

or

```
{if channel_short_name != "big_products" OR channel_short_name != "small_products"}SHOW "min. order quantity" field{/if}

```

---
Tags: expresso-store
---


# Question
Title: Using stash, what's the most efficient way of dealing with long paginated lists
I have a website with more or less a thousand news items in a channel and was wondering what was the best way to handle this with stash if I want to separate the logic from the HTML code as much as possible.

**1. Using set\_list / get\_list**

Wrapping your `channel:entries` tags in a `set_list` then using `get_list` and stash pagination does not look like it is the right approach since getting 1000 items with a channel entry loop is going to be very time consuming. What's nice is that you can cache the list and not hit the channel entries tags on subsequent visits.

**2. Using append\_list / get\_list**

The approach I currently favor is to use `channel:entries` tags on the outside and using an `append_list` tag pair on the inside and stashing the pagination works fine. But there, we hit the `channel:entries` tags on every page load and I don't see how stash caching could be useful in that context.

```
{!-- Build news list --}
{exp:channel:entries disable="categories|category_fields|member_data|trackbacks" channel="news" status="open" orderby="date" sort="desc" limit="10" paginate="bottom"}

    {exp:stash:append_list name="st_news"}
        {stash:st_title}{title}{/stash:st_title}
        {stash:st_date}{entry_date format="%F %d, %Y"}{/stash:st_date}
        {stash:st_machinedate}{entry_date format="%Y-%m-%d"}{/stash:st_machinedate}
        {stash:st_url}{url_title_path="news_press/news"}{/stash:st_url}
        {stash:st_image}{cf_news_img}{/stash:st_image}
        {stash:st_summary}{exp:eehive_hacksaw words="30" append="..."}{cf_news_summary}{/exp:eehive_hacksaw}{/stash:st_summary}
    {/exp:stash:append_list}

    {paginate}
        {exp:stash:set name="st_pagination" parse_tags="yes"}
            {pagination_links}
                <ul class="pagination group">
                    {first_page}<li><a href="{pagination_url}">First</a></li>{/first_page}
                    {page}<li><a href="{pagination_url}"{if current_page} class="current"{/if}>{pagination_page_number}</a></li>{/page}
                    {last_page}<li><a href="{pagination_url}">Last</a></li>{/last_page}
                </ul>
            {/pagination_links}
        {/exp:stash:set}
    {/paginate}

{/exp:channel:entries}

```

and then in a snippet or in the same template

```
{exp:stash:get_list name="st_news" prefix="stashprefix"}

    {if count == "1"}<ul class="horizimglist">{/if}
        <li class="group">
            <p class="imgholder"><a href="{st_url}">{exp:ce_img:pair src="{st_image}" width="680" height="382" crop="yes|center, center" allow_scale_larger="yes"}<img src="{made}" alt="{title}" />{/exp:ce_img:pair}</a></p>
            <div class="postcontent">
                <p class="info"><time datetime="{st_machinedate}" pubdate="pubdate">{st_date}</time></p>
                <h2><a href="{st_url}">{st_title}</a></h2>
                <p>{st_summary}</p>
            </div>
        </li>
    {if count == total_results}</ul>{/if}

    {!-- if no results --}
    {if stashprefix:no_results}<p>No News Found</p>{/if}

    {!-- Pagination --}
    {if count == total_results}{exp:stash:get name="st_pagination"}{/if}

{/exp:stash:get_list}

```

I was just curious to know:

* what is the approach stash experts use in such a context
* are there stash options/parameters (save/refresh/replace) I could use to have better performance

# Answer
You could use the pagination segment as a context for your stashed variables. Each page of results would then be cached independently. The challenge with this approach is clearing the cache once any one of those cached pages expires (since the entire resultset may have changed since last cache).

```
{exp:stash:context name="{segment_3}"}
{exp:stash:set_list name="st_news" context="@" parse_tags="yes" save="yes" scope="site" replace="no" refresh="60" parse_depth="2"}

{!-- flush ALL site-scoped cached variables. This bit is clumsy, sorry. --}
{exp:stash:unset scope="site"}

{exp:channel:entries disable="categories|category_fields|member_data|trackbacks" channel="news" status="open" orderby="date" sort="desc" limit="10" paginate="bottom"}
        {stash:st_title}{title}{/stash:st_title}
        {stash:st_date}{entry_date format="%F %d, %Y"}{/stash:st_date}
        {stash:st_machinedate}{entry_date format="%Y-%m-%d"}{/stash:st_machinedate}
        {stash:st_url}{url_title_path="news_press/news"}{/stash:st_url}
        {stash:st_image}{cf_news_img}{/stash:st_image}
        {stash:st_summary}{exp:eehive_hacksaw words="30" append="..."}{cf_news_summary}{/exp:eehive_hacksaw}{/stash:st_summary}

    {paginate}
        {exp:stash:set name="st_pagination" context="@" parse_tags="yes" save="yes" scope="site" replace="yes" refresh="61"}
            {pagination_links}
                <ul class="pagination group">
                    {first_page}<li><a href="{pagination_url}">First</a></li>{/first_page}
                    {page}<li><a href="{pagination_url}"{if current_page} class="current"{/if}>{pagination_page_number}</a></li>{/page}
                    {last_page}<li><a href="{pagination_url}">Last</a></li>{/last_page}
                </ul>
            {/pagination_links}
        {/exp:stash:set}
    {/paginate}

{/exp:channel:entries}

{/exp:stash:set_list}

```

And retrieve like this:

```
{exp:stash:get_list name="st_news" context="@" scope="site"}
...
{/exp:stash:get_list}
{exp:stash:get name="st_pagination" context="@" scope="site" process="end"}

```

Note that we're caching the pagination block for slightly longer than the list, and using replace="yes". This is because the list should always expire first, and once it does it will run the enclosed tags and will always regenerate the associated pagination block (since replace="yes").

The site-scoped cache flushing I consider somewhat clumsy since it should really target the meta-grouping of cached variables that constitutes all the pages of results only, rather than all site-scoped variables. There is in fact a way to group variables that has been in Stash since the very beginning ("bundles") but which I am only now fleshing out more fully. In future you will be able to use the `bundle=""` parameter to group or flush an arbitrary set of related variables (from either your template code or using a new CP interface for cache management).
> 5 votes

---
Tags: stash, performance
---


# Question
Title: Add-on for limiting by paragraph and words/characters?
Are there any add-ons for EE 2 that can handle limiting both by paragraph and number of words (or characters)? With just paragraph I might end up with too much text if the paragraph is long and with just words or characters I end up with several paragraphs if they're shorter. Ideally, I don't want to use multiple add-ons.

# Answer
> 2 votes
I find https://github.com/EllisLab/Word-Limit by EllisLab to be very effective in this scenario.

Another favourite is Hacksaw http://devot-ee.com/add-ons/hacksaw

There are quite a few other options as well on Devot-ee http://devot-ee.com/search/results?keywords=word+limit&collection=addons&addon\_version\_support=ee2

---
Tags: add-on
---


title: 301 Redirects Appending Query String?

text:
# Question
Title: 301 Redirects Appending Query String?
First time this has happend to me and I can't figure out how to fix my 301 redirects. The redirect is appending the rule to the end of destination/new url:

```
Redirect 301 /products.htm http//www.domain.com/products/

```

Redirects to:

```
http://www.domain.com/products/?/products.htm

```

The site is on a MediaTemple (dv) 4.0. My `.htaccess` file is:

```
## BEGIN Expression Engine Rewrite

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

# END Expression Engine Rewrite

# Redirect to www
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

#
# Old site URL 301 Redirects
#

Redirect 301 /products.htm http://www.domain.com/products/
# plus many more...

```

### UPDATE:

Just wanted to add what I've tried with no success:

```
`$config['uri_protocol']    = 'AUTO'; // tried all 5 options. nothing seemed to change`

```

I tried appending `?` to the end of the redirect, which removed the appending rule, but kept the `?`:

```
Redirect 301 /products.htm http://www.domain.com/products/?

```

I have successfully setup redirects before in EE1, and referenced a site & noticed the rewrite rule for removing the `index.php` file didn't have the `?` at the end. Is this something specific to EE2 or the server envirnoment as when I remove that I get the `no input file specified` error:

```
# EE1
RewriteRule ^(.*)$ /index.php/$1 [L]

```

# Answer
Thanks for nudge Derek. I was totally unaware that the site was running as a FastCGI process. This is the default with (mt) dv 4.0 & Plesk 11.0.9 when creating new hosts. Which maybe explains other user's issues with removing index.php at MediaTemple

I switched it back to Apache and removed the `?` from the rewrite rule and the redirects are working properly.

```
RewriteRule ^(.*)$ /index.php/$1 [L]

```

To change PHP support at MediaTemple (dv) 4.0, go to the domain in Plesk. Open the Control panel and click the website & domains tab. Click the advanced operations then Website Scription & Security. Select Apache from the PHP select menu.

### Update For Fix w/PHP running as CGI process – 1/31/13

If PHP is running as CGI process and the query string `?` is appended to the URL, you can use this rewrite rule instead of redirect:

```
RewriteRule ^old-url?/?$ http://www.website.com/new-url [L,R=301]

```

> See comment below for reference article
> 9 votes

---
Tags: htaccess, redirects, querystring
---


# Question
Title: change from file to assets does not show thumbnails
I imported a lot of pictures via datagrab to a file field.
this all worked as expected. the thumbs of the file is displayed etc.

then I changed the file field to an asset field. with the same upload directories. now the thumbs are not showing!

If I upload another image, then suddently both thumbnails are displayed...

how could I display the thumbs directely?

could I downgrade to assets 1 somehow?

cheers stefan

# Answer
Stefan,

Can you go to Modules \> Assets and in the upper right click "Update Indexes" - then check all of those boxes and update those?

That should fix this up, if I am understanding correctly. You can then go visit and make sure the thumbnails show up appropriately.

There is no downgrade to Assets 1 unless you have a backup of files and database and roll those back.
> 2 votes

---
Tags: assets
---


title: Custom fields on comments?

text:
# Question
Title: Custom fields on comments?
Is there a way to add custom fields to content comments?

For example, I would like to add a date input field and a subject field.

Alternatively could this be accomplished with the Solspace plugin "Freeform Pro 4.0.8"?

# Answer
There is no native way to add additional fields to the EE Comment module, no.

Freeform could work. You would have to have a hidden field that stored the `entry_id` of the entry being commented on, so that you could then use `search:comment_entry_id="{entry_id}"` when listing the comments with the Freeform Entries tag.

(Note that you'd likely have to either embed your "comments" Freeform Entries loop and pass the `entry_id` via an embed variable, or grab the `entry_id` from the URL - `{segment_3}` for example - in order to avoid variable collisions with the Channel Entries tag.)
> 9 votes

# Answer
I would say the easiest thing to do would be to repurpose use of one of the existing fields, unless you are already using all of them. Comments can capture: name, email, url, location, and comment. I'm excluding creation and edit dates, as well as entry\_id, ip\_address, etc.

For example, if you are not using 'location' then use it and re-label it 'subject'.

Of course a number of sites, bypass EE's built in commenting system and use Disqus or Facebook.
> 5 votes

# Answer
I would check out the Rating Module which offers "custom fields" for comments/reviews.

Edited to note: There is also DevDemon's Channel Ratings which might also be worth looking into.

Each one offers different capabilities and one might fit your needs better than the other.
> 4 votes

# Answer
I'd go with a custom extension. Here's the hooks you'll need:

* Create new database cols in exp\_comments when you install the extension
* Add additional fields to the database insert array using the insert\_comment\_insert\_array hook
* Then when comments are rendered use the comment\_entries\_tagdata hook to replace tags for the new comment fields.
> 1 votes

# Answer
I've developed an add-on called Custom Comment Fields that allows custom fields to be submitted with comments (handles text inputs, textares and attachments via Safecracker File field). Datepicker not supported yet, but is in plans.
> 0 votes

---
Tags: ee2, templates, comment-form
---


# Question
Title: Trying to use Playa to assign "categories" instead of using categories, can't wrap my head around how to set it up in templates
First I want to say I initially setup the Products section of this site using categories and it works great. BUT, I need more custom fields added to categories which I don't think is possible so I'm exploring alternate methods.

I read about creating a "Categories" channel and adding a Playa field to my "Products" channel to assign a "category". I setup the "Categories" channel and assigned a "category" to each product using Playa.

It's important to have the url structures remain the same as it is in the image below. "Product Cat1, Product Cat2, etc." are the categories. The items listed below those, "Apple, Banana, etc.", are entries with the category assigned to them. I need to be able to dynamically create the sidenav as shown in the pic below. This was relatively simple using the categories tag, but I'm having problems figuring out the template code using Playa.

When a product is clicked, a "product detail" page is shown. Again, I need the URL structure to remain the same as before. If anyone has any comments on the template code for the sidenav and main content area it would be greatly appreciated!

# Answer
> 0 votes
I got my current setup working using the info from this post https://expressionengine.stackexchange.com/a/177/603. Still wish there was an easier way for the client though.

---
Tags: templates, categories, playa
---


title: output data based on relationships

text:
# Question
Title: output data based on relationships
I'm trying to figure out the best way to output data and effectively create relationships between a product and it's availability based on the enduser's location.

I'm building a site for consumers of local seasonal vegetables and produce. Basically what would happen is that a user comes to the site and chooses a State via drop down menu, based on their choice, it then populates another form field for cities in that state where local seasonal vegetables and produce are available, the user picks a city and a list of available items gets generated. Then you can click on the item \[for this case I'll use broccoli\], and it gives you information about that item such as nutritional value, growing season, climate, etc.

Sounds pretty simple, I know. But here's where I'm struggling in figuring out how to create relationships and filter data. For example, on the backend I have listing channel for vegetables that lists all the vegetables available in, say - California, Oregon and Washington for that season. Local organic broccoli is currently available in Seattle WA, Portland OR and Sacramento CA. I need to have broccoli associated with each state, then subsequent city that it's available in. Currently, I have Tagger tags on broccoli for all 6 of those locations, but after further thought, I'm not sure this is a good way to do this because ultimately I'd like to have the farmers markets the broccoli is available in to be dynamically listed on the broccoli page based on the users choices from the drop-downs from the previous page location as well.

I'm not necessarily a newb with EE, but I've not done anything like this before and I'm not sure if there are existing add-ons that would help me do what I'm trying to do, or if I've just got to figure out a way to tie these things together and generate the proper output. I'm a frontend developer trying to figure out how to create relationships with data - not really in my wheelhouse...

If anyone has suggestions, thoughts, advice in how I can properly and effectively create these relationships to output them correctly and have subsidiary data associated with a location \[such as markets\] tied to the process…it would be immensely appreciated!

Thanks for taking a look at my problem!

# Answer
> 2 votes
If you have a channel for veg, and a channel as a holder for states and cities and a channel for markets, you could set it up from the veg selected (broccoli) and within that entry in the admin panel, you have two playa Playa fields that reference states, cities, and markets channels respectively.

The only reason I would use playa is to make it so multiple states/markets could be selected. There is probably another way of doing that, like having the states be a category list, but I find playa is nice to use.

Then I always think back from the final URL you want to look over the details from and work your way back. In this case it might be:

> http://domain.com/state/city/

Then you would do a lookup for any vegetable that has both the state and city in its record. Within the record you have a market field that spits out the details of that market.

You could also use something like Low Search in place of the entries tag, to spit back things on a more granular level or to include ifs/ands or fuzzy logic.

From that point, you need to have a search form to get you to that URL. A lot like Low Search has in it too, but it could be a custom form as well.

---
Tags: add-on, relationships, filter
---


# Question
Title: “You are not authorized to perform this action” with Low Search
I'm using Low Search on a site and during testing we are seeing the error “You are not authorized to perform this action” pretty frequently on the site after submitting the search form. Does anyone know why this is happening?

# Answer
> 7 votes
The "You are not authorized to perform this action" error in this case was caused by users using their browser's back button while testing the form.

Adding the `secure="no"` parameter to the `exp:low_search:form` tag fixed the problem:

```
{exp:low_search:form secure="no"}

```

---
Tags: low-search, error
---