title: Content disappearing from footer

text:
# Question
Title: Content disappearing from footer
I currently have the following code in my footer. Whenever the content is loaded through either an embed or a snippet, nothing in the tags loads.

```
<div id="footer-wrapper">
            <footer id="page-footer" class="5grid-layout">

                <!-- Content -->
                    <div class="row">
                        <div class="4u">
                            <section class="first">

                                {footer-left-heading}
                                <ul class="style1">
                                     {exp:channel:entries
                                                     channel="contact|donate|events|profile|sponsors"
                                                     limit="5"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="random"
                                                     }
                                    <li><a href="{site_url}page/{url_title}">{title}</a></li>
                                    {/exp:channel:entries}
                                </ul>

                            </section>
                        </div>
                        <div class="4u">
                            <section>
                                    {footer-middle-heading}
                                <ul class="style1-dates">
                                 {exp:channel:entries
                                                     channel="event"
                                                     limit="5"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="event_date"
                                                     sort="asc"
                                                     show_future_entries="yes"
                                                }
                                    <li><span class="date">{exp:low_nice_date date="{event_date}" format="%M %d"}</span> <a onClick="window.open('{title_permalink='page/event'}','Event','width =400,height=200')" href="#">{title}</a></li>
                                 {/exp:channel:entries}
                                </ul>
                            </section>
                        </div>
                        <div class="4u">
                            <section class="box-contact">
                                <h2>Contact Us</h2>
                                <a href="#" class="image"><img src="{site_url}images/pic5.jpg" alt="" /></a>
                                    <ul class="style1">
                                        {exp:channel:entries
                                             channel="company_info"
                                             limit="1"
                                             disable="categories|category_name|member_data|pagination"
                                             show_future_entries="yes"}
                                        <li class="address">{address}</li>
                                        <li class="email"><a href="#">{email_address}</a></li>
                                        <li class="phone">{tel}</li>
                                        {/exp:channel:entries}
                                    </ul>
                            </section>
                        </div>
                    </div>

                <!-- Row Divider -->
                    <div class="row row-divider">
                        <hr class="double" />
                    </div>
                    <!-- Copyright -->
                    <div class="row">
                        <div class="12u" id="copyright">
                            {copyright}
                        </div>
                    </div>

            </footer>
        </div>

```

Footer is loaded into the following page:

```
            <!-- Header -->
            {embed="includes/header"}

        </div>

    <!-- Main -->
        <div id="main-wrapper">
            <div class="5grid-layout">
                <div class="row">
                    <div class="4u">

                        <!-- Sidebar -->
                            {embed="includes/sidebar-box"}

                    </div>
                    <div class="8u mobileUI-main-content">

                        <!-- Content -->
                            <div id="content">
                                <article class="first">
                                        {exp:channel:entries
                                                     channel="issues"
                                                     limit="1"
                                                     disable="categories|category_name|member_data|pagination"
                                                     orderby="date"
                                                     sort="asc"}
                                    <header>
                                        <h2>{title}</h2>
                                    </header>

                                 <p>{issue_short_description}</p>
                                 <p>{issue_description}</p>
                            {/exp:channel:entries}

                                </article>
                            </div>

                    </div>
                </div>
            </div>
        </div>

    <!-- Footer -->
        {footer}

```

# Answer
> 2 votes
To isolate the problem, I would

1. Try with a very simple "hello world" snippet or embed and see if it renders
2. Add a single simple exp:channel:entries tag in there and see if it works
3. Add in your exp:channel:entries one by one to see where it breaks

**EDIT:** Try adding `dynamic="no"` to your channel entries loops, since you don't want EE to try to be intelligently guessing what you want by looking at the URL. That should help

Just replace your entire footer code with this

```
{exp:channel:entries
    channel="event"
    limit="5"
    disable="categories|category_name|member_data|pagination"
    orderby="event_date"
    sort="asc"
    show_future_entries="yes"
    dynamic="no"}

        {if count == 1}<ul>{/if}
            <li>{title}</li>
        {if count == total_results}</ul>{/if}

        {if no_results}<p>No event found</p>{/if}

{/exp:channel:entries}

```

When that works, reconstruct your original file slowly by adding {exp:channel:entries} loops one by one, adding dynamic="no"

What happened here is that, since you didn"t have dynamic="no" EE was trying to be intelligent when displaying the data by looking at the current URL. dynamic="no" tells it to forget about the URL completely and do as it is told.

Also, when working with loops and lists, it is good practice to put `<ul></ul>` inside your loop so as not to have a list with no `<li>` if there are no results. Updated code above.

---
Tags: ee2, dynamic, content
---


title: Using structure and style submenu

text:
# Question
Title: Using structure and style submenu
I'm using the structure add-on and want to generate my main menu with it's submenu. In HTML it should look like this:

```
<ul id="navigation" class="toplevel">
  <li><a class="icon-home" href="">Home</a></li>
  <li><a href="#">item 2</a></li>
  <li><a href="#" class="top active">item 3</a>
    <div class="sublevel">
      <ul class="container">
        <li><a class="active" href="">subitem 3.1</a></li>
        <li><a href="">subitem 3.2</a></li>
        <li><a href="">subitem 3.3</a></li>
      </ul>
    </div>
  </li>
  <li><a href="#">item 4</a></li>
  <li><a href="#">item 5</a></li>
  <li><a href="#">item 6</a></li>
</ul>

```

Using the structure code I should use:

```
{exp:structure:nav start_from="/" show_depth="2" css_class="toplevel" css_id="navigation"}

```

But this gives me the following HTML

```
<ul>
  <li></li>
  <li></li>
  <li>
    <a href="">item 3</a>
    <ul>
      <li class="first"></li>
      <li></li>
      <li class="last"></li>
    </ul>
  </li>
  <li></li>
  <li></li>
  <li></li>
</ul>

```

Does anyone know how to fix the menu as I suggested..?

# Answer
Right now, you would need to use the Structure Entries plugin for custom nav markup: http://devot-ee.com/add-ons/structure-entries
> 2 votes

# Answer
Do you have a timeframe for when we'll be able to do this natively via Structure calls itself? Have been using sturcture entries in the past but i've been having some serious performance isseus with that plugin.

Peter himself has indicated on multiple places that adding features and reformatting the code to increase performance isn't something that's on his current todo list. This is in part because of him not using the plugin himself for the last few months.

I would really hate to have to switch to a different solution because i love the easy of use structure brings to my clients.

With kind regard, Bas van Ginkel
> 0 votes

---
Tags: add-on, structure
---


# Question
Title: The word "title" breaks simple Matrix conditional
Just found a super strange bug which is breaking a basic Matrix conditional.

The conditional is:

```
{if caption != ''}

```

And if the caption is this:

> Gérard Depardieu in the role of the title Rasputin, dir. by Irakli Kvirkadze (2013) this year's closing film

an error is caused:

```
Message: Invalid EE Conditional Variable: {if "Gérard Depardieu in the role of the "Lights, camera, inaction: is Moscow International Film Festival doomed to mediocrity?" Rasputin, dir. by Irakli Kvirkadze (2013) this year's clo" != ''}

```

Because the word "title" is missing from the error, it looks like EE is trying to parse it.

What causes this and what is the fix?

---

Just an update - using Matrix 2.5.5, and EE 2.5.5.

# Answer
Have you tried adding var\_prefix to the matix loop?

eg: {matrix\_field var\_prefix="var"}{if var:caption!=""}{matrix\_field}

This should escape it. Hope it helps.
> 2 votes

---
Tags: matrix
---


# Question
Title: Embed the new twitter timeline - via the CP - error 500
In a template (any template, EE 2.6.1) I try to add the new twitter timeline code (https://dev.twitter.com/docs/embedded-timelines) but end up with an 500 error.

This is de twitter code:

```
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/the-username"  data-widget-id="MY-WIDGET-ID">Tweets by @the-username</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

```

When submitting the code I get an internal server error.

I tested the code, made a plain html file, uploaded via ftp, everything works perfect. I use the exact same code: copy-paste it in a template and get the internal server error.

What can I do to get this to work?

# Answer
> 0 votes
I ended up feeding the code directly to the database. I made sure to bypass the browser, which enable me to bypass the browser error.

It's really easy to bypass the browser, just enter the correct details in coda or connect to your expression engine installation via mountee.

# Answer
> 0 votes
I would guess that your server has `mod_security` enabled, which is detecting `script` tags in your `POST` and throwing a fit.

Disabling `mod_security` via `.htaccess` doesn't always work (you may have to contact your host instead), but you can try puttig this in the `.htaccess` file which resides in the same directory as your `admin.php` file (or EE system folder):

```
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

```

---
Tags: control-panel, twitter, error-500
---


# Question
Title: wygwam adding paragraph tags when embedding video
I'm trying to embed a video into an entry. My code looks like this

```
<script src="http://releases.flowplayer.org/5.4.0/flowplayer.min.js" type="text/javascript"></script>
<div class="embed_media">
    <div class="flowplayer">
        <video preload="none">
            <source src="/downloads/video/SSS_FallProtection2011.mp4" type="video/mp4"></source></video>
    </div>
</div>

```

After I submit the entry and edit it again... a number of paragraph tags are getting added and the above code starts looking like this:

```
<script src="http://releases.flowplayer.org/5.4.0/flowplayer.min.js" type="text/javascript"></script>
<div class="embed_media">
    <div class="flowplayer">
        <video preload="none">
            <source src="/downloads/video/SSS_FallProtection2011.mp4" type="video/mp4"></source></video>
    </div>
</div>
<p>
    <source src="/downloads/video/SSS_FallProtection2011.mp4" type="video/mp4">
    <p>
        <source src="/downloads/video/SSS_FallProtection2011.mp4" type="video/mp4"></source></p>
    <source src="/downloads/video/SSS_FallProtection2011.mp4" type="video/mp4">

```

I'm running EE 2.5.5 with WYGWAM 2.7.1.

Any thoughts?

# Answer
> 1 votes
When you submit your embed code did you use the embed pop-up?

see attached screenshot of the filmstrip icon. If you click that you paste your embed code there and all should be good.

---
Tags: wygwam
---


# Question
Title: How does the exp:resso store register_member parameter work
This is about a software downloads facility where I want account registration for new members during the order confirmation stage. I have read the documentation about this, but have questions:

1 should I use register\_member="" just like that or is it register\_member="true"

2 do I have to require the email address via parameter or does the presence of the register\_member= parameter cause that?

3 the docs say that an account will be created based on the email address. What feedback is provided when this actually happens?

4 what happens if a returning customer goes through another order process? The docs only say "and the email address must not already be used for a member account." Does this mean an error will be generated or is there a way to steer the user to login before completing the order?

# Answer
> 3 votes
You need to set `register_member="yes"` in your checkout tag. All this does is add a hidden field to the template like this:

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

```

Instead of the template, you could make this a checkbox for your customers:

```
{field:register_member}

```

This would output HTML like this:

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

```

For more details on what fields to submit, see the documentation here.

The `order_email` field is required for every order, regardless of whether an account is being created. However, you may want to make it required on the specific page you are asking for it, using the `require="order_email"` checkout tag parameter.

The customer will also automatically see an error if the email address is already used, if they have opted to create an account. Normally you would give them the option to log into an existing account instead of filling out the order fields, so this wouldn't happen.

Assuming the email is valid, an account will be created after the order is completed. If you have member email confirmation disabled, they will be automatically logged in. If you want more of a manual registration process (or more feedback for your customers), you should probably just add a regular login/register step to your checkout using Freemember or another member management plugin.

# Answer
> 2 votes
I was puzzled with question four as well and figured out another option on how to take orders from logged in members without showing a log in form during the checkout process (if they are already logged in).

On my final checkout page I used the following:

In the exp:store:checkout tag I used register\_member="yes" and used the following on the page.

```
{if logged_out}
<fieldset>
    <legend>Log In or Create an Account</legend>
    <p>This will allow you to track your order.</p>
        <div class="control-group {if error:email}error{/if}">
           <label class="control-label" for="email">Email</label>
               <div class="controls">
                  <input type="email" id="email" name="email" value="" />
                  {if error:email}<br />{error:email}{/if}
                </div>
        </div>

        <div class="control-group {if error:password}error{/if}">
            <label class="control-label" for="password">Password</label>
                <div class="controls">
                   <input type="password" id="password" name="password" value="" />
                   {if error:password}<br />{error:password}{/if}
                </div>
        </div>

        <div class="control-group {if error:password_confirm}error{/if}">
            <label class="control-label" for="password_confirm">Confirm Password</label>
                 <div class="controls">
                    <input type="password" id="password_confirm" name="password_confirm" value="" />
                    {if error:password_confirm}<br />{error:password_confirm}{/if}
                 </div>
        </div>
</fieldset>
{/if}

{if logged_in}
    <input type="hidden" name="register_member" value="0" />
{/if}

```

---
Tags: expresso-store
---


# Question
Title: SQL query getting entries from current day
I am trying to use this script that I have put together, forgive me I am a bit of a newbie with sql.

When I run the script it is outputting an empty csv file, only showing column titles, no data.

What I want it to do is export entries from today's (current date) date only.

i think the issue is with this line:

```
$sql = "SELECT * FROM exp_freeform_form_entries_3 where FROM_UNIXTIME(entry_date) = CURDATE() ORDER BY entry_id";

```

If i remove from "where" onwards it seems to work, but obviously outputs all entries, not todays only.

```
<?php

//delete existing files
$files = glob('/home/sitename/csv/*'); // get all file names
foreach($files as $file){ // iterate files
  if(is_file($file))
    unlink($file); // delete file
}

// Connect and query the database for the users
$conn = new PDO("mysql:host=localhost;dbname=dbname", 'username', 'password');
$sql = "SELECT * FROM exp_freeform_form_entries_3 where FROM_UNIXTIME(entry_date) = CURDATE() ORDER BY entry_id";
$results = $conn->query($sql);

// Pick a filename and destination directory for the file
// Remember that the folder where you want to write the file has to be writable
//$filename = "/tmp/db_user_export_".time().".csv";
$filename = "/home/sitename/csv/db_user_export_".time().".csv";

// Actually create the file
// The w+ parameter will wipe out and overwrite any existing file with the same name
$handle = fopen($filename, 'w+');

// Write the spreadsheet column titles / labels
fputcsv($handle, array('Entry ID','First Name'));

// Write all the user records to the spreadsheet
foreach($results as $row)
{
    fputcsv($handle, array($row['entry_id'],$row['form_field_1']));
}

// Finish writing the file
fclose($handle);

?>

```

# Answer
FROM\_UNIX\_TIME returns a date/time from a Unix timestamp (seconds from 1/1/1970). So:

```
select from_unixtime(12345);
+----------------------+
| from_unixtime(12345) |
+----------------------+
| 1970-01-01 04:25:45  |
+----------------------+
1 row in set (0.00 sec)

```

However CURDATE() returns only the date portion:

```
select curdate();

+------------+
| curdate()  |
+------------+
| 2013-06-26 |
+------------+
1 row in set (0.00 sec)

```

As you can see, they're not the same, so you have no matches.

If you wrap your FROM\_UNIXTIME in a DATE() function, you'll extract just the date portion, so try:

```
SELECT * FROM exp_freeform_form_entries_3 where DATE(FROM_UNIXTIME(entry_date))
= CURDATE() ORDER BY entry_id";

```
> 0 votes

---
Tags: php, database, solspace-freeform, query, sql
---


# Question
Title: How do I access Assets field data within a child relationship in 2.6.1
I have a parent channel of "events" with a relationship field named {cf\_event-map} with a singular relationship to an entry in a channel named "maps". This is the simplified code I'm using, the summary field is displaying fine but the {cf\_images} field is an Assets fieldtype, and I can't find a permutation that retrieves the sub-field data from that field.

```
{exp:channel:entries channel="events" limit="1"}
{cf_event-map:cf_summary}
{cf_event-map:cf_images}{cf_images:url}{/cf_event-map:cf_images} (this doesn't work)
{/exp:channel:entries}

```

# Answer
Assets 2.1.4 will contain the fix for this and should be available next week (3rd July ish). Andris (P&T) sent me some code to change and test and it's working fine. If you need the fix urgently ask me and I can pass on the instructions.

Part of the issue was also how to test if no results in the child, and the code for that is below in case anyone else finds it useful.

```
{if "{relationship_field:assets_field:total_files}"}
<p>Do this</p>
{if:else}
<p>Do something else</p>
{/if}

```
> 1 votes

# Answer
I think you need to wrap the sub-tags with the tag pair.
Try:

```
{exp:channel:entries channel="events" limit="1"}
  {cf_event-map}
    {cf_event-map:cf_summary}
    {cf_event-map:cf_images}{cf_images:url}{/cf_event-map:cf_images}
  {/cf_event-map}
{/exp:channel:entries}

```

Also, inside an Assets loop, you just need to use `{url}`. You don't need to prefix it unless you specify it using `var_prefix="my_prefix"`.
> 1 votes

---
Tags: pixelandtonic, relationships, assets
---


# Question
Title: Addon for placing pinpoints on an image?
I'm looking to do something similar to the pink pinpoints seen on the screenshots here: http://ee-garage.com/nsm-live-look

I want the client to be able to add pins at a certain point on the image and optionally add some content to that pin.

I tried looking through Devot-ee, but couldn't find anything.

# Answer
> 3 votes
I built Pointee a while back, should cover a fair amount of what you need.

http://devot-ee.com/add-ons/pointee

Looking forward to the pull requests :)

# Answer
> 0 votes
Currently there is not a publicly released add-on that allows you to create anything like that.

# Answer
> 0 votes
In case you haven't seen this has just been released:

http://www.devdemon.com/entry\_mapper/

I have just started using it on a site right now and is so far working great.

---
Tags: image
---


# Question
Title: Can I escape "automatically turn URLs/Emails into links"?
I would like this option for the "body" field of an entry, but for another field where I want to take a web address and eventually generate a button link, I don't want it encoded, or of course the button ends up messed up. Any ideas/solutions to this? Thanks for your time.

# Answer
Okay, I kind of found a solution. It looks like EE doesn't automatically turn URLs into links if they're surrounded by quotes. So I just pass 'www.test.com' instead of www.test.com in my link field and omit the quotes in the template.
> 1 votes

---
Tags: entry
---


# Question
Title: Google Maps for ExpressionEngine returning no results for zipcodes that exist
We are using the add-on on a German site using the following code to fetch results within 50km of the town/city or postcode searched;

```
{exp:gmap:search
    cache_post="false"
    channel="salons_de"
    latitude_field="cf_salons_de_latitude"
    longitude_field="cf_salons_de_longitude"
    distance_field="distance_max"
    metric="kilometers"
}
    <div class="txt"  style="float:left; margin-right:30px;">
        <input type="text" name="location" value="{if post:location}{post:location}{/if}" placeholder="Stadt oder Postleitzahl eingeben" />
        <input type="hidden" name="status" value="open" />
        <input type="hidden" name="distance_max" value="50" />
    </div>

    <input class="viewbtn3" style="float:left;" value="Suchen" type="submit">
{/exp:gmap:search}

```

However, it’s not returning results for 'some' zipcodes, even though I’m searching for the exact zipcode entered for an entry.

Wondered if anyone else has had experience with this? :)

Thanks.

# Answer
Just to point others in the right direction, I answers this question on Devotee. http://devot-ee.com/add-ons/support/google-maps/viewthread/9952

From Devotee:

> I am away from my computer traveling to PeersConf this week. I will get back with in detail when I can but essentially you need to geocode two fields. 1) being the zip code 2) a hidden field with “, Germany” hardcoded. This will ensure all the geocoder requests are applicable to Germany.
> 1 votes

---
Tags: google-maps-for-ee, google-maps
---


title: Show channel name in Playa-dropdown

text:
# Question
Title: Show channel name in Playa-dropdown
When relating content from several channels in a Pixel and Tonic Playa-field, my client would like to see which channel the articles are from (they might have several articles with similar or same titles...).

There's no native settings for this, but I was wondering if any of you have dared "hack" Playa to display "Entry Title (in channel name)"?

# Answer
> 2 votes
This might be a timely solution: Playa Links. Here's a blog post with info and images: http://fromtheoutfit.com/blog/playa-links-for-expressionengine

---
Tags: playa, pixelandtonic
---


title: Member Email System

text:
# Question
Title: Member Email System
I'm developing a membership website wherein members should be able to email each other. I do not plan to expose EE's admin to the members. Instead, they will be using a custom built "profile manager." In this profile manager, is there a way I can tap into EE's email system so that I can let my members email each other?

# Answer
> 1 votes
For this purpose, you can use Messaging module (http://devot-ee.com/add-ons/messaging) which works great.

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


title: Carthrob as an inquiry system

text:
# Question
Title: Carthrob as an inquiry system
We're building a couple sites where our clients don't actually sell online but need everything else from an ecommerce tool. Users would add products to a cart, then submit the order to get an inquiry. We've been thinking on using carthrob so they can manage inventory and orders.

However, I can't find docs or examples of sites doing this. How can we checkout an inquiry order? And how would we deal with orders that have some products you can buy and others you need to inquiry for?

We can always do this with plain EE, but I still like using carthrob because it's important to create an order our clients could use. Should I just use SAEF instead?

Looking forward to hearing ideas!

Thanks in advance,

Santiago

# Answer
You don't need CartThrob to do this. Try using something like Remember Me (a really nice free add-on) for creating "enquiry lists" and then Freeform or similar to do the "checkout" part and send an enquiry email to the site owner.

I guess it ultimately rests on what you mean by "an enquiry order". If you use Freeform then each enquiry becomes an entry within Freeform and you can set a status on it to show whether it has been actioned or not.

Or, as you say, you could use SAEF - which might actually be a much neater option come to think of it.

You said that your "clients don't actually sell online" and also ask how you would "deal with orders that have some products you can buy and others you need to inquiry for?"

So do you need an ecommerce solution - i.e. so people can purchase items, or simply an enquiry system that lets your client mark enquiries with various statuses?
> 1 votes

# Answer
As Foamcow suggested to use "Remember Me" addon, yes it can work for it.

I think, you can achieve all those with CartThrob as CartThrob is already installed at your EE setup. There wouldn't be any payment system so you should use Offline Payment option with some more settings.

Now, make the checkout process as inquiry for orders. Also, you would like to have such a feature so that admin can see the items for which user inquired, and this can be done easily with the approach. At CT checkout page, you can have a message field also for the user's message.
> 2 votes

---
Tags: ecommerce
---


# Question
Title: How can I display a member's photo in a template?
I have a template for logged-in users where there's a small sidebar in which I want to display the member's photo. In the EE documentation, it says to to use the {photo\_url} variable, along with {photo\_height} and {photo\_width}. Unfortunately, when I put those into my template, EE doesn't even render them. Am I missing a {exp:} wrapper tag?

Here's what I have now:

```
{exp:member}
 {if photo}
  <div style="background:url({photo_url}); width:141px; height:156px" ></div>
 {if:else}
  <div style="background:url('/images/img1.jpg'); width:141px; height:156px" ></div>
 {/if}
{/exp:member}

```

As it is now, the entire block seems to be erroring out and displaying nothing, however if I remove the `{exp:member}` tags, it always evals to false. I know I have a photo uploaded for the member that I'm testing with, and if I remove the `{if}` block and just leave in `{photo_url}` it prints the literal value "{photo\_url}".

What am I missing?

# Answer
You might use following code:

```
{exp:member:custom_profile_data}
 {if photo}
  <div style="background:url({photo_url}); width:141px; height:156px" ></div>
 {if:else}
  <div style="background:url('/images/img1.jpg'); width:141px; height:156px" ></div>
 {/if}
{/exp:member:custom_profile_data}

```

Take a reference from the doc http://ellislab.com/expressionengine/user-guide/modules/member/#custom-profile-data-tag
> 2 votes

---
Tags: templates, member-details
---


title: Check to see if a page_uri exists

text:
# Question
Title: Check to see if a page_uri exists
Is there a way in EE1 (nice to know for EE2 as well) to check and see if a page\_uri exists and if not redirect them to a 4040 page? Since page\_uri's can be just about anything and any depth it's impossible to use common conditionals to see if a segment is empty or uses a specific keyword. This question came up in regard to an EE1 site but if it's possible to do this in EE2 as well it would be helpful to know.

# Answer
Would it not be the case that if you turned strict URLs on then if the page didn't exist you would get the 404 page?
> 1 votes

# Answer
There's this EE1 plugin Any Segment that should do what you want. Right from the docs

```
{if {exp:any_segment equals="projects"}} ... Show content {/if}

```

In EE2 i would use {last\_segment} since typically your page\_uri would be the last segment.
> 0 votes

# Answer
I'm not 100% what types of 404s you feel you are missing...

If you are worried about entry templates where no entry is specified you can use the "require\_entry" parameter along with the if no\_results conditional.

```
{exp:weblog:entries weblog="whatever" limit="1" require_entry="yes"}
{if no_results}
    {redirect="404"}
{/if}
{/exp:weblog:entries}

```

Does this get at what you are looking for? If not can you elaborate a little and give some examples?
> 0 votes

---
Tags: ee2, conditionals, ee1, pages, page-uri
---


title: Playa parents cannot display categories

text:
# Question
Title: Playa parents cannot display categories
I have a page where I am displaying all the information from a channel entry along with some information from the playa parent field. But I have not been able to get to display the categories associated with the parent. Is it possible to do this? My code is here below

{exp:playa:parents channel="book" disable=""} {title}

{short\_description}

{categories show\_group="9"} {category\_name} {/categories} MORE DETAILS {/exp:playa:parents}

I had a similar problem with exp:playa:children before and I sorted that by adding the disable="members" parameter. Anyone know how I can get this to work?

# Answer
Assuming your playa tags are within the channel entries tag, try adding var\_prefix to separate the playa results from the channel entries results. It might be that the categories tag pair as you have it set up is applying to your channel entries results.

```
{exp:playa:parents
    channel="book"
    disable=""
    var_prefix="pl"
}
    {pl:title}
    {pl:short_description}

    {pl:categories show_group="9"}
        {pl:category_name}
    {/pl:categories}

    MORE DETAILS
{/exp:playa:parents}

```
> 2 votes

---
Tags: playa, categories
---


title: Define links with a trailing slash /

text:
# Question
Title: Define links with a trailing slash /
I have a site where all the main navigation links (Top Navigation, footer nav and html sitemap page) link to URLs without a trailing slash, however the canonical tags for all pages end with trailing slash.

Is there a way to change all the links in the main navigation to link to pages with a trailing slash, or failing that change SEO lite to define a canonical without a trialing slash?

This is my first time using ExpressionEngine.

# Answer
This is an old topic with plenty of useful information that seems to mirror your question. Hopefully this is helpful to you:

https://stackoverflow.com/questions/13213812/getting-the-trailing-slash-back-in-expressionengine-2
> 2 votes

# Answer
In general, **don't try to force EE to use a trailing slash**.

Do the opposite - make the canonical links **without** a trailing slash.

Seriously, that is the way EE likes it, and you are pushing shit uphill trying to do anything else.

**Don't use a 301 htaccess redirect** \- that's ridiculous, because EE generates all URLs without a trailing slash. Then you would be forcing all of your users to make two requests every time they click a link, just so you can have your way. Not a good idea :)

Best bet is figuring out how to make SEO Lite define a canonical URL without the trailing slash (I've never used it). Or just build the canonical meta tag yourself.
> 1 votes

# Answer
There's no way -- that I'm aware of -- to force trailing slashes within EE itself. I would hardcode the trailing slashes into your navigation where possible and failing that use a rewrite rule within your .htaccess file to force it.

```
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+[^/])$ /$1/ [R=301,L]

```

If you're using something like Structure or the Pages module, SEO Lite should use the matching url from the pages array. There's an old support thread that explains the issue and subsequent updates to SEO Lite.
> 0 votes

---
Tags: url, seo, links, seo-lite
---


# Question
Title: Redirect to custom error page after user fails to log in
When a user tries to log in and fails because the username or password is incorrect, he is redirected to the ugly EE error page saying "The existing username and/or password you submitted are not valid". How can I redirect to a custom page (basically the same log in page with a little red error message added to it) instead? The EE user guide doesn't seem to say anything.

# Answer
@Madc

Is this within an EE template? Or are you talking about logging into the control panel?

If you're talking templates, you may want to use ObjectiveHTML's add-on Authenticate. Works like a charm and returns errors inline (if that's what you're looking for instead of EE's default page).
> 1 votes

# Answer
Take a look at FreeMember, which lets you display inline error messages for your login/registration templates, as well as update the user's profile details etc.
> 0 votes

---
Tags: login, redirects
---


# Question
Title: Safecracker Registration, Low Search, and Member Fields
I'm using Safecracker Registration so I can leverage Channels for Member fields. Since EE's Member already have certain fields, should I use those whenever I can instead of defining them as Channel fields? For example, there is a "bio" field in the Member fields. Should I use that or should I define that as a field in my Channel?

I need to implement a search feature and am planning to use Low Search. I will end up having to search these fields whether they exist in the native Member fields or in my Channel. Given this search requirement, which route should I take regarding these Member fields? Use EE's native Member fields or put them in my Channel?

# Answer
I would suggest you to have all the member fields into channel and manage so that EE's default member module would have only required account details fields like (username, password, email, screen name). It would facilitate you following:

* Easy to populate member data at front end.
* In the CP, you can see all the member data within the channel entries.
* Easy to implement search feature on member's channel entries
* In the CP, the filtration of members in EE's member module is limited where channel entries filtration is much better.

There are some other benefits also which you can see :) .
> 1 votes

---
Tags: members, low-search, safecracker-registration
---


# Question
Title: Low Seg2Cat and category images - file path doesn't resolve
I've been using Low Seg2Cat for ages now on my blog pages to display category information and do category archive pages. I just realised today that the {segment\_x\_category\_image} tag is not working properly. If I view the page source I'm getting this:

```
{filedir_1}badge-ideas.gif

```

I know the image is fine because on a single entry page I call it with this:

```
{categories}{category_image}{/categories}

```

and it displays correctly.

Is there something wrong with this Seg2Cat tag?

I've updated to latest version of Seg2Cat and it didn't fix the issue.

# Answer
Low Seg2Cat is meant to be as lightweight as possible. That means narrowing down on DB queries. As it might not be necessary for everyone to use the image tag, that could mean a superfluous query every page load. Instead, use something like Parse File Paths (free) to parse those `{filedir_x}` vars:

```
{exp:parse_file_paths}{segment_x_category_image}{/exp:parse_file_paths}

```
> 3 votes

# Answer
Was trying to avoid having to add another add-on, am already using Surgeree for string stuff so I was able to do this as an alternative:

```
{exp:surgeree:strip_tags}
    {exp:channel:categories show="{segment_2_category_id}"}{category_image}{/exp:channel:categories}
{/exp:surgeree:strip_tags}

```

That leaves you with just the image url, if you use it with Stash you can use the `trim` parameter, e.g. wrap the above with `{exp:stash:set name="main_image" parse_tags="yes"}` and for your image:

```
<img src="{exp:stash:get name="main_image" trim="yes"}" alt="{segment_2_category_name}" />

```

...

Probably makes more sense to use the parse file paths add on. but this will do the trick for me for now.
> 0 votes

---
Tags: add-on, low-seg2cat
---


title: How populate ../stash_templates/

text:
# Question
Title: How populate ../stash_templates/
What do I have to do to get files into the stash\_templates-folder so I can use {stash:embed:test}.

I have been iterating through the new stash-docs over and over but I cant figure it out. Apart from that the new documentation is a great aprovement. Thanks for that!

/David

# Answer
> 1 votes
You literally just have to put them there. :)

If you have a `stash_templates/` directory already created then create your files in here with a regular .html extension. Stash will know where they are by what you tell it in your index:

```
$assign_to_config['stash_file_basepath'] = '/path/to/stash_templates/';

```

Then when you use the `{stash:embed:test}` tag it will look in that directory for 'test.html\` and pull in whatever is in there.

If you want to split things up into sub-directories then that's fine too. You can just add the subdirectory into the call

```
{stash:embed:subdir:test}

```

---
Tags: stash
---


title: Order Confirmation Emails

text:
# Question
Title: Order Confirmation Emails
I am running Exp-resso store. When an order is placed the customer gets a confirmation email but the admin doesnt.

I am sure i am missing something very simple here but not sure what. Where do you set the email address order confirmations should go to? Is there a way of testing it?

I have coded my own custom payment gateway dont think this is the problem though as the order registers as payed within the system.

Any ideas?

# Answer
> 3 votes
1. Use the store\_order\_complete\_end extension hooks to execute custom code upon successful completion of an order https://expresso.com/docs/store/extension\_hooks.html
2. If you want an easy solution without coding us the BCC field in the the control panel of exp-resso store, that is: Modules \> Expresso Store \> Settings \> Email Templates \> Edit Email Template.

Best, Daniel

---
Tags: expresso-store, email
---


# Question
Title: Expresso Store - Customize the PDF Invoice
I would like to add a header with the company information and logo to the top of the pdf invoice that gets generated. I would also like to eith add this as an attachment or link in the confirmation email that gets sent out after an order is complete.

# Answer
I think, Expresso Store module module outputs PDF from a view file "order\_details\_pdf.php" so you can alter this file to add company information at the top.

The view file path is: "expressionengine/third\_party/store/views/order\_details\_pdf.php".
> 1 votes

# Answer
You're better off just creating your own invoice using the `{exp:store:orders}` tag. That way you don't need to edit any core files, and you can use a standard EE template to build it. You can also link to it from any of the emails which are sent out.

There's no way to use Store's PDF generator in template tags, so to create the actual PDF your best bet would be to check out some of the PDF generation plugins on Devot:ee.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: is there a maximum number of members for EE?
is there a maximum number of members for EE? I'm debating using EE to create a membership website for a yearly program. Each year 500 member accounts would be created.

Thanks

Peter T

# Answer
No, there is no maximum number of members in EE.
> 1 votes

# Answer
500 per year will be no problem at all. There are EE sites running tens of thousands of members, and I would be surprised if it cannot handle hundreds of thousands (athough at that point you may need to look at measuring and optimizing your SQL indexes, but that would apply regardless of the CMS or framework you chose).
> 1 votes

---
Tags: members
---


# Question
Title: Assets panel not loading when static html file is present in root
I have used Assets before and everything worked fine but on a fresh install of EE 2.6.1 and Assets 2.1.3 I have the following problem. I have a static index.html file whilst developing the new site. When I click upload and the assets panel is displayed, it shows the content of the index.html. If I remove the html file then the assets panel loads correctly.

Any thoughts on why this is occurring. The only things I have done (as always) is to remove the index.php via htaccess and also rename the admin.php.

Thanks

Brian

# Answer
> 1 votes
Assets sends off it's Ajax request to the Site URL specified in CP settings. The request has to reach EE somehow. If you have left the index.php out of the Site URL, Apache might be directing the request to the index.html file and causing the Ajax request miss it's target.

---
Tags: assets, error
---


title: Unique url title with hash or something

text:
# Question
Title: Unique url title with hash or something
I need to use some kind of "encoded" value for title/url-title, and I was thinking of using md5 or sha-1 hash code for this. The idea is that user receives email link to the entry, but it is supposed to be hard to guess other public entries (if I based them only on enrty\_id for example).

Is this best way of doing this or there is maybe some other kind of code it would be suitable. My idea was to generate random md5 and put it on title (safecracker).

Thanks dp

# Answer
> 1 votes
As I think, you would like to set entry page URLs wouldn't have url-title or entry-id so that no other URLs couldn't be guessed and your URL would be like yoursiteurl.com/\[encoded string in MD5 or SHA1\]. Right ???

If so I would suggest you to use EE's Pages module or Structure module and enter the Page URI as encoded in either MD5 or SHA1. You can code you template code to detect those URIs and show the entry page.

Also, you can make this encoding dynamic so that there wouldn't be needed for admin to enter encoded Page URI while editing/publishing an entry by creating an extension which will do it.

---
Tags: safecracker, url-title, encode
---


title: how to populate ../static_cache/

text:
# Question
Title: how to populate ../static_cache/
What do I have to do to get files into the /static\_cache/-folder so I can use the {exp:stash:cache}-tag.

I have yet again been iterating through the new stash-docs over and over but I cant figure it out.

I am pretty sure I got the prefs-files right but a little unsure on configuring the htaccess-file. Do I change anything else than the domain and the path of the static\_cache-file?

/David

# Answer
Files are **written** to the static cache directory by Stash - you don't put files in there. Typically these cached files would be your fully rendered HTML pages. This is the opposite of the stash template directory, where you add template files (containing EE tags, variables etc.) which are **read** by Stash.

After creating a folder called 'static\_cache' (or whatever pleases you) in your public webroot, you need to customise the `.htaccess` file with three values:

* The path to your stash\_cache directory
* The URL to your stash\_cache directory
* The site\_id of your site. If you are NOT using the Multiple Site Manager then the site\_id will always have a value of 1.

Let's say your path is `/home/mysite/public_html/static_cache/`, your *relative* url is `/static_cache` (you could use an absolute url instead if you prefer) and your site\_id is `1`. Your file would look like this:

```
    RewriteEngine on

    #################################################################################
    # START STASH STATIC CACHE

    # Exclude POST requests
    RewriteCond %{REQUEST_METHOD} !=POST

    # Exclude CSS/ACT EE URLs
    RewriteCond %{QUERY_STRING} !^(css|ACT|URL)

    # Remove index.php from conditions
    RewriteCond $1 ^(index.php/)*(.*)(/*)$

    # Check if cached index.html exists
    RewriteCond /home/mysite/public_html/static_cache/1/$2/index.html (.*\.(.*))$
    RewriteCond %1 -f

    # Rewrite to the cached page
    RewriteRule ^(index.php/*)*(.*)(/*) /static_cache/1/$2/index.%2 [L]

    # END STASH STATIC CACHE RULES
    #################################################################################

    # -------------------------------------------------------------------------------
    # Officially supported method to remove index.php from ExpressionEngine URLs
    # See: http://ellislab.com/expressionengine/user-guide/urls/remove_index.php.html
    # -------------------------------------------------------------------------------

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

    </IfModule>

```

Now to actually use static caching you can use the `{exp:stash:static}` tag, the `{exp:stash:cache}` with `process="static"` or the `{stash:embed}` with `process="static"`.
> 5 votes

---
Tags: stash, cache
---


# Question
Title: Assets doesn't refresh after deleting folder
When a new subfolder is created and deleted right after, the refresh button keeps spinning and the folder still appears in the list. This only happens when no files are uploaded into it. After a page refresh the folder is deleted.

I have updated assets to v2.1.3

Any ideas why the refresh isn't triggering?

**support answer:**

ahh, the old trick with glob() returning false instead of an empty array on servers with open\_basedir set to On.

Can you open up source.ee.php file in third\_party/assets/sources/ee folder, locate the method \_delete\_source\_folder and replace it with the one I'm attaching? That should fix your problem. Also, no matter how trustworthy I sound, always back up your files before doing stuff like this :)

Alternatively, you could wait a day and a half - word on the street is that Assets 2.1.4 might be released tomorrow US time, that would have this and a bunch of other bugfixes.

# Answer
Sounds like an unexpected Ajax response when deleting the empty folder. Since I can't reproduce this on my end, could you send over CP access to support@pixelandtonic.com so we can take a closer look?
> 0 votes

---
Tags: assets
---


title: show unassigned category

text:
# Question
Title: show unassigned category
I have a category which is unassigned i.e. not tied to any channel. I want to display it, but I could not so far

I have tried...

```
 {exp:channel:categories show_empty="yes" restrict_channel="no"}
    {category_name}
  {/exp:channel:categories}

```

Show future, expired, open, etc. dynamic="no" and show="{number}" and even with category group

Any ideas?

## EE 2.5.5

I ended up creating a dummy channel, but is not ideal.

# Answer
> 0 votes
First of all categories aren't being assigned to channel, Category Group is being assigned to channel. You can use GWCODE CATEGORIES (http://gwcode.com/add-ons/gwcode-categories) with the following code example:

```
{exp:gwcode_categories group_id="x|y|z"}
    {cat_name}
{/exp:gwcode_categories}

```

---
Tags: categories
---


# Question
Title: add new channel fields for existing site
I´ve a site with a channel, this channel has a channel field group with 2 fields. So far, so standard. My problem: I know exactly, that after some time when the site evolves I´ll ned more channel fields. But I don´t know exactly what kind of fields I will need to add. I can be a text field or a textarea or even a file upload field or a matrix. As a startup there will be some pivoting.

My question: If I add a new field, will it be available for all entries in this channel (new and existing) and can users update their entry accordingly. I would send my members a mail saying "we now offer the feature X, go ahead and update your entry".

Will adding channel fields to a channel that has already entries corrupt the database?

# Answer
> 2 votes
> If I add a new field, will it be available for all entries in this channel (new and existing) and can users update their entry accordingly

Yes, any new custom fields added to that channel will show up for new & existing entries. Your members will be able to update fine.

If you change a existing field to a new fieldtype (ie. text input ==\> Matrix), existing entries will "lose" that data from the text input.

---
Tags: custom-fields, channel, database
---


# Question
Title: infinite scroll appearing below pagination
This is my second question on Infinite Scroll and hopefully it is not another typo causing the problem!

I have everything working now, with one exception. New results are appearing below my pagination link. So when I select view more, they load below that, rather than at the bottom of the new entry's listed.

So I want the pagination to remain below all entries shown. Below is my code:

**SNIPPET:**

```
    <div class="col" id="blog-container">
        {exp:channel:entries
            channel="blog"
            dynamic="no"
            order_by="date"
            limit="2"
            status="open|tall|regular"
            paginate_base="_embed/ajax_scroll"
        }
        <div class="entry">
            <article>
                <header>
                    <p class="meta">
                        <span class="category">{categories}{category_name}{/categories}</span> / <span class="date">{entry_date format="%F %d, %Y"}</span>
                    </p>
                    <h1><a href="{url_title_path='blog/details'}">{title}</a></h1>
                </header>
                <img src="{blog_image}" alt="">
                {blog_excerpt}      <a href="{url_title_path='blog/details'}" style="display: inline-block;">read more</a>
            </article>
        </div> <!-- /.entry -->

        {paginate}
        <p class="morePosts">
            {if next_page}<a href="{auto_path}" class="more">See More Posts</a>{/if}
        </p>
        {/paginate}
        {/exp:channel:entries}
    </div> <!-- /.col -->

```

**TEMPLATE:** {embed="\_inc/site\_head"}

AniA Collection Bridal Blog

{embed="\_embed/blog\_search"} {snip\_ajax\_scroll} $(document).ready(function(){ $('#blog-container').infinitescroll({ behavior : 'twitter', navSelector : ".morePosts", nextSelector : "a.more", itemSelector : ".entry", contentSelector: "#blog-container", loading: { finishedMsg: "", //#text you want to appear when you reach the end of the list msgText: "", //#text to appear while loading more items img: "" //#image to display while loading }, extractLink: true, // This is crucial if you want it work properly. Setting this to false or excluding it will not allow the script to work with EE }) }); // Unbind normal behavior $(window).unbind('.infscr');
```
        // Bind normal behavior to the click function and prevent the browser from redirecting to the URL.
        $('a.more').click(function(){
            $(document).trigger('retrieve.infscr');
            //$(this).hide("fast");
            //$(this).parent("p.morePosts").hide("fast");
            return false;
         });
    </script>
    {embed="_embed/blog_nav"}
</div> <!-- /#mainContent -->

```

Thanks and let me know if you need anything else!

# Answer
Not sure but you could try adding paginate=bottom as detailed here: http://ellislab.com/expressionengine/user-guide/modules/channel/pagination\_page.html
> 1 votes

# Answer
Ah, I ran into this exact problem on a site a few months ago. Looking at your code, my guess is that you have pagination within the first channel entry tag pair.

So where you have

```
{paginate}
    <p class="morePosts">
        {if next_page}<a href="{auto_path}" class="more">See More Posts</a>{/if}
    </p>
{/paginate}
{/exp:channel:entries}

```

I would change to be outside of your main div container, and outside of your channel entry tag pair:

```
{/exp:channel:entries}
</div>

<nav id="pagination">
    {exp:channel:entries channel="blog" dynamic="no" paginate_base="_embed/ajax_scroll"}
       {paginate}
         <p class="morePosts">
           {if next_page}<a href="{auto_path}" class="more">See More Posts</a>{/if}
         </p>
       {/paginate}
    {/exp:channel:entries}
</nav>

```

Basically, this is a problem with your HTML structure, not with EE.

The reason your problem is happening is because in EE, the channel entry tag pair loops out EVERYTHING inside of it. So because your pagination exists within your tag pair, it's looping out all of the blog content PLUS the pagination. So taking the pagination tag pair out of your blog content, will keep it out of the loop.
> 0 votes

---
Tags: jquery
---


# Question
Title: url issues - relationship field with multiple channels
I've got 2 channels, "message" and "message series" and I'm using a relationship field in the message channel to tie a sermon to a sermon series. My template group is called media, and there is a media-view template that I'm trying to use to display a listing of all the sermons in a particular sermon series. My issue is that when I click one of the sermon series to view the sermons in that particular series, it goes to a blank page with my header and footer on it, but no content. It's trying to go to media/media-view/name-of-sermon-series. However, when I view the rendered template from the EE control panel, it displays correctly at media/media-view. That would be fine except, if I change my link to go to media/media-view, and click the link to a sermon series, it always takes me to the same sermon series page, regardless of which link I'm clicking. Something in my code is off, and I can't for the life of me figure out what it is. Any help would be greatly appreciated.

here's my code from my media template:

```
{embed="embeds/html_header" page_title="Media"}
{exp:channel:entries channel="message_series" orderby="date" sort="asc" limit="10" paginate="bottom" {gv_param_disable_default}}

        <li class="section-post">
            <a class="message-link" href="{path=media/media-view/{url_title}}"><img src="{series_image}" class="message-image" title="{title}" alt="{title}">
            <span class="mask">
                <img src="{site_url}/images/interface/ico-search.png">
            </span>
            </a>
            <a href="{path=media/media-view/{url_title}}"><h2 class="inline-header">{title}</a></h2><br />
            <p><i>{series_begin_date format='%Y'}{if series_association != ""}, Series{/if} </i></p>

        </li>
{/exp:channel:entries}

```

and here's my code from my media/media-view template:

```
{embed="embeds/html_header" page_title="{exp:channel:entries channel="message"}{title}                {/exp:channel:entries}"}
{exp:channel:entries channel="message" limit="1" {gv_param_disable_default}}

                    {series_association}
                    <h1 class="section-header">{series_association:title}</h2>
                    {snp_social_share}
                    <div class="section-post">
                    <p>{series_association:series_summary}</p>
                    <img src="{series_association:series_image}" class="drop-shadow message-image" title="{series_association:title}" alt="{series_association:title}">
                    <br /><br />
                    {/series_association}
            {/exp:channel:entries}
                <ul>
            {exp:channel:entries channel="message" orderby="date" sort="asc" {gv_param_disable_default}}
                    <li class="media-view">
                        <h2><u>{title}</u> - <i><h5>{message_date format='%F %d %Y'}</h5></i></h2>
                        <p>{if message_speaker}<i>Speaker:</i> {message_speaker}{/if}
                        <p>{if message_scripture}<i>Scripture Reference:</i> {message_scripture}{/if}
                        <p>{message_summary}</p>
                        <audio src="{message_audio}" preload="none" />
                        <h5>{message_date format="%F %j, %Y"}</h5>
                    <li>
                    <br />
            {/exp:channel:entries}
                </ul>

```

# Answer
I would try changing the message tag to the following:

```
{exp:channel:entries channel="message" limit="1" dynamic="no" url_title="{segment_3}" {gv_param_disable_default}}

```

This should disable any "guessing" EE might be doing and force it to match the entry you're actually requesting.
> 1 votes

---
Tags: channel-entries, templates, relationships, url-title
---


# Question
Title: Has anyone successfully setup a jQuery file uploader with safecracker?
Has anyone successfully setup a jQuery file uploader with safecracker?

I am looking to have a jQuery file uploader in a safecracker form for a new project I am about to start.

Any guidance, or experience in the matter would be greatly appreciated.

Thanks

# Answer
I just wanted to officially follow up with this thread. A couple weeks ago Photo Frame was released, which can be a replacement for Safecracker File among many other things. Photo Frame is a very robust add-on that allows users to upload, manage, edit, and crop photos right within ExpressionEngine and is compatible with many of the most popular add-ons. At the core it asynchronously uploads photos with a visible progress bar and clear interface. Photo Frame comes with 100's of features, and has additional expansion packs available for even more capabilities. Photo Frame is by far the most robust and advanced photo editor for ExpressionEngine, and developers will rejoice when using the API's for some serious customization.

Official Release

https://objectivehtml.com/articles/read/photo-frame-1.0

Overview

https://objectivehtml.com/photo-frame
> 1 votes

---
Tags: safecracker, file-uploads, jquery, safecracker-file
---


# Question
Title: Matrix: possible to customize in SafeCracker?
I'm displaying a Matrix in a Safecracker form. Is there a way to customize the way it is outputted? For example, it seems that I need to have `include_jquery="yes"` and `safecracker_head="yes"` in order to make it work. This mucks up the markup as it injects JS in the middle of my page. For the JS, I'd like to have it as an external file so that it can be cached.

The styling of the table also clashes with my design. And a big problem is that the matrix table is not responsive. I'd like to set my own classes (I'm using Twitter Bootstrap) to make it responsive.

I'm happy to do the markup myself. I just need to somehow let Safecracker/Matrix know that the table I create is for a particular matrix field. I'd also need to support those Matrix options like "Delete row".

Is this possible?

# Answer
> 2 votes
This question was already asked several times, I found this tutorial http://themetaq.com/articles/bring-matrix-data-editing-to-the-front-end pretty good. I'm doing this same action right now and I disabled jquery and head on safecracker for better optimization.

Just a tip: when you disable safecracker\_head you also disable all assets on other fields, when using predefined dropdown in matrix, there is hardcoded function with all the data that is used for creating new rows, so be sure to enable safecracker\_head \> copy that inline js data to your file \> disable safecracker\_head

d

# Answer
> 1 votes
Here's what you'll need to do:

1. Use an inspector to look at the code your browser outputs for the matrix table when you use the simple {field:my\_matrix\_field}. You'll notice each table cell has a unique name.
2. Format your output to your liking. For each input field, you'll use the name provided by the browser for the corresponding cell. The name should look something like: my\_matrix\_field\[row\_id\_{row\_id}\]\[col\_id\_xx\]. You should replace my\_matrix\_field with the name of your matrix field, and the xx with the column id of that particular cell (this is where your browser code comes in handy). The row id updates automatically.
3. Here's an example of one of my input fields. It pulls the content already in the field.

`<input type="text" name="section_3_timeline[row_id_{row_id}][col_id_42]" value="{date}">`

1. Don't forget to add your matrix field tag pair if you plan to loop, or pull existing content in for display. This will also require a {exp:channel:entries} tag.
2. Regarding the other functionality (adding/deleting rows), I personally have not had too much luck with that. This article, and the comments at the bottom may be able to help you more.

---
Tags: matrix, safecracker
---


# Question
Title: Redirect URLS with disallowed key characters
I have a site that was converted to EE from a different blog platform, and I'm getting a bunch of crawl errors from previously indexed urls that now lead to a "disallowed key characters" error.

The urls that are causing the errors follow one of three patterns:

```
http://www.example.com/general/404/?404%3Bhttp://old.example.com:80/old-blog/random/segments

```

or

```
http://www.example.com/blog/?404%3Bhttp://old.example.com:80/old-blog/random/segments

```

or

```
http://www.example.com/blog/Default.aspx?404;http://old.example.com:80/old-blog/random/segments

```

In these urls, /general/404 is the path to my site's 404 page, and /blog/ is the path to the blog index page.

I was able to redirect the urls from the third example using this code:

```
RewriteRule ^blog/Default.aspx?/?$ http://www.example.com/general/404/? [L,R=301]

```

Is there a way I can intercept the other URLS with htaccess before they hit EE and redirect them to my 404 page? I'm not sure how to target them specifically since there is nothing before the ? in the query string url segment.

# Answer
> 0 votes
I was able to target the remaining urls using this code:

```
RewriteCond %{QUERY_STRING} ^404(%3B|;) [NC]
RewriteRule ^ http://www.example.com/general/404/? [L,R=301]

```

---
Tags: error, url, htaccess, redirects
---


title: P&T Dropdown and "orderby" in Matrix

text:
# Question
Title: P&T Dropdown and "orderby" in Matrix
I need to display a matrix of schedule, which has the fields: `day`, `start_time`, `end_time`. The `day` field is P&T Dropdown with the following values: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.

Since I cannot control what order the user enters rows in the matrix, I'd like to display the schedule in "proper" order, starting with Sunday and ending with Saturday. How do I order the matrix rows by `day`? If I do something like: `orderby="day" sort="asc"`, it'll sort alphabetically.

# Answer
Can you try by having P&T Dropdown options (in the field setting) like:

```
0 : Sunday
1 : Monday
2 : Tuesday
3 : Wednesday
4 : Thursday
5 : Friday
6 : Saturday

```

To output day name, you should use `{custom_field_name:label}` which will output Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.

If you are using `{custom_field_name}`, then it will output day number like 0, 1, 2, 3, 4...
> 2 votes

---
Tags: matrix, pt-dropdown
---


# Question
Title: Should i buy expression engine? or is dead project?
Hello guys first of all sorry for my bad english , never i use expression engine, i was reading in his web and looks amazing, but in a lot of blogs and forums, i saw about is a little abandoned , and the support suck , what u think guys? i am a little company trying to find solutions , with a strong plataform and good support , if ee is dead , you have other alternative? processwire? yesterday i founded statamic looks cool is no database and they claim can handle complex and big sites (and is cheap) .

Thanks guys for you time and answers.

# Answer
No ExpressionEngine isn't dead or abandoned, although it seems to have had a rocky road in the past year or so with some long term bugs not getting resolved, but it's still a strong commercial option. There's quite a few users who have voiced opinions (quite rightly), because of the direction and progress that EE has taken, that doesn't make it a bad CMS and it continues to be a leading commercial offering.

I've tried a lot of CMS's and although I favour Wordpress for "budget" sites, no other CMS allows for the freedom and unlimited scope as ExpressionEngine does. And that's why I continue to use it.

ExpressionEngine has a good grounding and large add-on library (http://devot-ee.com), although each project tends to have a license overhead now that I normally allow for around $500+ or more depending on the complexity. That's not to say you need that budget, but if you want all the bells and whistles and top quality build, or complexities such as multi-language, commerce, etc, you have to pay for it.

Both Statamic (http://statamic.com) and Craft (http://buildwithcraft.com) have been created from developers who have very strong background in EE and although I've not had a chance to use either, I expect them to be extremely good offerings, albeit still young projects.
> 5 votes

---
Tags: ee2
---


# Question
Title: 2.6+ and add-on compatability -- do all add-ons need to be upgraded?
I skipped upgrading to 2.6 since I kept seeing comments about bugs, but now that 2.7 is on the way I need to get my add-ons sorted.

What I am wondering is if all add-ons need to be upgraded to work with 2.6 or only those using some specific functions?

# Answer
> 0 votes
Not all addons need to be upgraded but it's always best to update the addons when updating EE to ensure compatibility.

In most cases they will still work but you may be a few messages in the dev log warning about the use of deprecated functions. These aren't critical but provide a warning that they may break in the future.

In a small number of cases you may find that some are more critical but addon developers are well ahead of the game in most cases and would most likely have already pushed through an update to fix the problem so that's why it's best to keep up with the updates.

If you find both EE and addon updates a bit laborious then I'd highly recommend Updater. It greatly speeds up the updating process for both.

---
Tags: add-on
---


# Question
Title: Safecracker Registration - Custom Confirmation Page
Is there a way to customize or replace the account confirmation page?

I want the page to align with the design philosophy of the site. So I want it to look close to the other pages I have.

Is there a way to do this?

# Answer
When using Safecracker Registration you can avoid the ugly default User Message Templates altogether if you set a `return` parameter. As an example:

```
{exp:safecracker
    channel="members"
    dynamic_title="[member_first_name] [member_last_name] - [email]"
    include_jquery="no"
    register_member="yes"
    error_handling="inline"
    return="/some/url/path"
}

```

This way you can specify where the user will be sent for account confirmation using regular EE templates rather than standard User Message Templates.

---

**EDIT: Updated to include options for editing EE's User Message Templates**

Most actions performed in EE, such as logging in/out, safecracker submission etc, will result in seeing the User Message Template in EE. This can be modified by navigating to

Design \> Message Pages \> User Messages

The control here is fairly limited in that it's one message template which applies to ALL system messages. It's also not possible to parse other template tags but at a basic level it does the job.

If you want a little more control over your *User Message Templates* and *Speciality Templates* in general however then you could look to use either Custom System Messages or Libraree to bring bring them into regular EE templates which can be saved as files. As regular EE templates you'll also have the ability to then use other tags along with embeds to keep things DRY. It all depends on how much control you need.
> 1 votes

---
Tags: safecracker-registration
---


# Question
Title: dubbel EE installations , top root and sub folder
On the root there is an EE install with a .htaccess to remove the index.php Now there is a new installation in the www.root.be/test/newEE

in the newEE there is a new EE installation for testing

But because of the htacess of the root, whatever url's i type they keep redirecting to something totally different than the goal or how standard EE should be.

for example i have a template called "home" with a page in it called "form" Trying to find a way to correctly put the url and view the page but that is not working out i tried several options www.site.com/test/newEE/{template name}/{specific page} www.site.com/test/newEE/index.php/{template name}/{specific page} www.site.com/test/newEE/{specific page}

but nothing seems to work how can i fix this please?

this is the htacess:

```
# Enable Rewrite Engine
#—————————————————————————————————————
RewriteEngine On

RewriteBase /

# Redirect index.php Requests
#—————————————————————————————————————
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

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

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

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff

AddType audio/mp3 .mp3
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
SetEnvIfNoCase Request_URI \.(og[gv]|mp4|m4v|webm)$ no-gzip dont-vary

<FilesMatch "\.(ttf|otf|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>

<IfModule mod_expires.c>
    ExpiresActive on

    ExpiresDefault                          "access plus 1 month"
    ExpiresByType text/css                  "access plus 2 months"
    ExpiresByType application/javascript    "access plus 2 months"
    ExpiresByType text/javascript           "access plus 2 months"

    <IfModule mod_headers.c>
        Header append Cache-Control "public"
    </IfModule>

</IfModule>

```

# Answer
You really need to take the second installation out and place it on a subdomain. `test.root.be` for instance. Then it can operate completely independently and wont clash with your existing install. What you're effectively doing there is running EE within EE as far as the URL schema is concerned.
> 1 votes

---
Tags: htaccess, redirection
---


# Question
Title: Playa parent ids automatically shows future entries ids
I noticed that `{exp:playa:parent_ids}` returns the parent ids, even if that parent's entry date is in the future. Isn't it confusing to change the way EE works with future entries?

**support answer:**

\*_ids tags currently don't support the show\_future\_entries parameter.

There's an upside, though - we are releasing a new Playa version today and this will be fixed in that, so you'll have your issues fixed with the latest version.

# Answer
> 0 votes
The playa tag supports almost all of EE's channel entry tag parameters out of the box so if you wanted to not show future entries then you just need to add that as a parameter:

```
{exp:playa:parent_ids show_future_entries="no"}

```

---
Tags: playa
---


title: Date fields in Safecracker form

text:
# Question
Title: Date fields in Safecracker form
I'm trying to collect birthdate information in my Safecracker form. I have a field that is a Date field type. It seems that I am being forced to enter in this format: `YYYY-MM-DD HH:MM`. I don't want to force my users to enter hours and minutes. How do I work around this such that I only collect year, month, day? I am not using that date picker feature (I have `datepicker="no"`) and would like to implement something "cleaner" (it seems like `include_jquery="yes"`, `safecracker_head="yes"`, etc. mucks up my markup).

Later on, I want to implement a search by age (I'll be using Low Search). Am I on the right track by collecting the birthdate?

# Answer
As you mentioned that you are not using the date picker feature so you are instructing the users to enter date of birth in input text in the format of YYYY-MM-DD and field type is Date. Right ??? The Date field type of EE will always require time also (HH:MM) so you can apply some JavaScript stuff which will amend the date value with time. For example: an user is entering date of birth as 1980-01-31 so you have to put some JavaScript so that it changes the date of birth value to 1980-01-31 12:00PM before submit. Rest of the things will be performed by EE. Also, you can populate that date of birth in YYYY-MM-DD format by passing "format" parameter with the field.

You mentioned that you are using Low Search module and want to implement a search by age feature. You can achieve it by adding Range Filter (http://gotolow.com/addons/low-search/docs/tags#form-tag-ranges). You can see within the doc that Low Search automatically detects the date field type of the channel and perform search as well.

For range filter, you will need to have this field something like:

```
<select name="range:date_of_birth_field">
    <option value="">All</option>
    <option value="<?php echo date('Y-m-d', strtotime('-20 years')).';'.date('Y-m-d', strtotime('-25 years')) ;?>">20 - 25</option>
    <option value="<?php echo date('Y-m-d', strtotime('-25 years')).';'.date('Y-m-d', strtotime('-30 years')) ;?>">25 - 30</option>
    <option value="<?php echo date('Y-m-d', strtotime('-30 years')).';'.date('Y-m-d', strtotime('-35 years')) ;?>">30 - 35</option>
    <option value="<?php echo date('Y-m-d', strtotime('-35 years')).';'.date('Y-m-d', strtotime('-40 years')) ;?>">35 - 40</option>
    <option value="<?php echo date('Y-m-d', strtotime('-40 years')).';'.date('Y-m-d', strtotime('-45 years')) ;?>">40 - 45</option>
    <option value="<?php echo date('Y-m-d', strtotime('-45 years')).';'.date('Y-m-d', strtotime('-50 years')) ;?>">45 - 50</option>
    <option value="<?php echo date('Y-m-d', strtotime('-50 years')).';'.date('Y-m-d', strtotime('-55 years')) ;?>">50 - 55</option>
    <option value="<?php echo date('Y-m-d', strtotime('-55 years')).';'.date('Y-m-d', strtotime('-60 years')) ;?>">55 - 60</option>
    <option value="<?php echo date('Y-m-d', strtotime('-60 years')).';'.date('Y-m-d', strtotime('-65 years')) ;?>">60 - 65</option>
    <option value="<?php echo date('Y-m-d', strtotime('-65 years')).';'.date('Y-m-d', strtotime('-70 years')) ;?>">65 - 70</option>
</select>

```

You can see, I am using PHP code to output the proper range for the date of birth so you can to enable PHP for that template.
> 1 votes

# Answer
If you're not using the datepicker feature, as you mentioned, then the easiest solution is to use the excellent DropDate addon. I normally default to that when dealing with date collection in both the front and back-end. In the front-end you are then free to take advantage of all of PHP's date formatting options. For instance:

```
{dropdate format='jS F, Y'}     // 2nd July, 2013
{dropdate format='Y-m-d'}       // 2013-07-02

```
> 0 votes

---
Tags: safecracker, search, low-search
---


# Question
Title: Safecracker Registration - Documentation on Hooks
In the changelog, I see that developer hooks was added as a feature in 1.2.0

But looking that documentation, I don't see any thing about hooks.

Is there any place or site that can point me to Safecracker Registration Hooks?

# Answer
No docs on this stuff at this time. I added those a while a back and forgot to include them in the docs. They are pretty straight forward though. If you want me to help you with anything specifically, email support@objectivehtml.com.

I will add this documentation to my list of to-do's and hopefully have this updated this week. So in the meantime, just email me for quick assistance.
> 1 votes

---
Tags: safecracker-registration
---


# Question
Title: Safecracker Membership: how to get the entry id of a member?
I'm using Safecracker Registration so I can leverage Channels for my member data. When the member is logged in (in my own UI, not EE's CP), is there a way for me to get the entry id in the Channel that's associated with the member?

My idea is to do a search like:

```
{exp:channel:entries channel="profiles" author_id="CURRENT_USER"}
   {entry_id}
{/exp:channel:entries}

```

Presumably, there will only be one `entry_id`. And although this may work, I'm reluctant to use this approach because I'll need to loop through this exact same channel several times on that page (e.g. in the header, in the footer, etc.) as my templates are broken up into parts for reusability.

I'm hoping for a non-Stash solution at this point. Suggestions?

# Answer
> 1 votes
Your proposed solution should work fine, it's exactly what I use. What is your issue with using that tag?

An alternative would be to use my Entries plugin, which is free. Stash however is perfect for this. The logic is, you stash the output of that entries tag and output in multiple places in the template. So you run the logic 1 time and output it where it is needed. I can understand not wanting to use Stash if it's a little complicated and verbose.

Here is an example of my Entries add-on. This tag is nestable within other channel entries tags and can even be prefixed. Entries is stable, I use it on every site, I just haven't officially released it yet.

```
{exp:entries:profile channel="profiles"}
    {entry_id}
{/exp:entries:profile}

```

https://objectivehtml.com/entries/documentation/tag/profile

# Answer
> 0 votes
Have you tried:

```
{exp:channel:entries entry_id="{entry_id}"}
    {entry_id}
{/exp:channel:entries}

```

---
Tags: channel-entries
---


title: Related Categories Mode and search

text:
# Question
Title: Related Categories Mode and search
I have a single entry page with the url\_title in segment\_3. I want to get all the other entries in that category, but also apply a search filter.

```
{exp:channel:entries channel="academy-items"
related_categories_mode="yes"
search:audience="Customer-Support"}
{title}<br>
{/exp:channel:entries}

```

It looks like search doesn't work in this instance. Is there another way to get this data?

# Answer
> 2 votes
Contrary to EE docs, it appears you can access the search parameter when using related\_categories="yes". I just had my syntax wrong.

```
{exp:channel:entries channel="academy-items"
related_categories_mode="yes"
custom_fields="yes"
search:a-audience="Customer-Support"}
...
{/exp:channel_entries}

```

# Answer
> 1 votes
Using a conditional instead of search you could:

```
{exp:channel:entries
    channel="academy-items"
    related_categories_mode="yes"
    custom_fields="yes"
}
    {if audience == "Customer-Support"}{title}<br>{/if}

    {!-- or the syntax might instead be: --}
    {if "{audience}" == "Customer-Support"}{title}<br>{/if}
{/exp:channel:entries}

```

# Answer
> 1 votes
Is the "audience" field type one of those that the search parameter supports? From the docs:

> Only fields of the type “**Text Input**”, “**Textarea**”, and “**Drop-down Lists**” are searched with this parameter.

---
Tags: categories, search, related
---


# Question
Title: Displaying column labels from a Matrix field
Is there's a way to display column labels from a Matrix field in templates?

```
{matrix_field}
{column:label} : {columnvalue}
{/matrix_field}

```

# Answer
> 1 votes
As far as I know, I don't think you can. However, Matrix has a table tag that quickly creates a HTML table:

```
{my_matrix_field:table cellspacing="0" cellpadding="0"}

```

If that doesn't work, I suggest using conditionals to hard code the 'labels' within your template. I would have to see a sample of the code first to help with conditionals

---
Tags: matrix
---


title: entry_id is not working

text:
# Question
Title: entry_id is not working
Just running a test and this should be working as I have an entry in my "event" channel with and id of "907"

```
{exp:channel:entries
    channel="event"
    entry_id="907"
    dynamic="no"
}

    {title}

{/exp:channel:entries}

```

Instead nothing is returned. If I take entry\_id off, everything works fine.

Here's a screenshot of my table:

https://i.stack.imgur.com/I1ei3.png

# Answer
The date in the screen shot says 2014? Is it possible it's not active yet?
> 1 votes

---
Tags: channel-entries, entryid
---


# Question
Title: Building a list of entries from a single category with exp:query
I'm trying to speed my site up with a few direct queries.

Like:

> {exp:query sql="SELECT field\_id\_16 FROM exp\_channel\_data WHERE channel\_id='4' "} {field\_id\_16}
>
> {/exp:query}

What query will I need to restrict these entries to a certain category? I'll probably need to join exp\_category\_posts?

# Answer
Off the top of my head I'm pretty sure this should work for you :

```
SELECT field_id_16 FROM exp_channel_data cd
LEFT JOIN exp_category_posts cp
ON cd.entry_id = cp.entry_id
WHERE cp.cat_id = 1

```

Change the cp.cat\_id = 1 number to whichever category ID you need and I'm fairly certain you should be good to go.
> 2 votes

---
Tags: query, sql
---


title: WSoD on CartThrob Settings Screens

text:
# Question
Title: WSoD on CartThrob Settings Screens
I just updated a site from EE 2.5.1 to 2.6.1, and from CartThrob 2.1.3 to 2.3.2. When I try to access any CartThrob settings pages, I get a white screen of death. The CartThrob Order Manager works fine. Here's what I've tried, with no luck:

* I enabled debugging on my `admin.php` file. No new errors.
* I enabled debugging in `system/index.php`. No new errors.
* My PHP error log is blank
* My PHP memory limit is *really* high (750M on my local server)
* I disabled extensions

Suggestions?

# Answer
I had this issue myself. I uninstalled the HealthCheck accessory and viola - CT Settings! If you are using HealthCheck, you will have problems with CartThrob.
> 3 votes

---
Tags: cartthrob, white-screen-of-death
---


# Question
Title: Memberr - Automatic Cancellation feature?
In the documentation, I see that you can cancel manually via {exp:membrr:cancel} tag.

But is there a way to cancel automatically?

Basically, what I was looking for is that if a membrr profile that I have is deleted, I would want it to automatically cancel all subscriptions that profile has subscribed to.

Is it possible?

# Answer
Yes, it possible by creating an extension with the hook "member\_delete". Within this extension, you can call the Membrr cancel subscription method by passing member's subscription ids.

The cancellation code would be something like:

```
$sub_id = x; // Get the member's subscription id with query
require PATH_THIRD.'membrr/class.membrr_ee.php';
$membrr = new Membrr_EE;
$membrr->CancelSubscription($sub_id);

```

It would work. Although, I would suggest you to test at your end.
> 1 votes

---
Tags: membrr
---


title: Assets thumbnails not showing

text:
# Question
Title: Assets thumbnails not showing
Running ExpressionEngine V2.6.1 (20130506) and Assets 2.1.3 and whenever I upload images to Assets or have some already uploaded and try to view them either in Assets or WygWam (which I'm also using on a site) then there are no thumbnails shown for any images at all.

I have checked on the server and in the \_thumbs folder there are actually images in there which are small however these images have permissions of 666 and Owner & Group = apache where all other files that I have uploaded have Owner = sitename & Group = psacIn (not sure if it is an I or a lowercase l as my FTP editor won't allow me to copy that text).

Just wondering if the Owner & Group is the culprit here or is there something else I should be looking into?

Thanks,

Mark

# Answer
> 1 votes
Assets stores it's thumbnails in the /cache folder. If you had previously uploaded images in the upload directories, did you run the "Update indexes" function? http://docs.pixelandtonic.com/assets/using/indexing.html

That should get your thumbs back.

# Answer
> 1 votes
sorry to hear you're having troubles!

The thumbnails for Assets are not being stored in the \_thumbs folder - that's for EE's Filemanager. Since Assets serves thumbnails in different sizes, we're storing it in system/expressionengine/cache/assets folder. Can you make sure that the system/expressionengine/cache folder is writable?

If it is, then please do shoot us an email to support@pixelandtonic.com so we can track this down and fix it for you.

---
Tags: assets
---


# Question
Title: Display channel entry by date and limit to upcoming only
Unsure how to get this... I need to display from a gigantic list of events, sorted by start-date but only displaying 1 event that is set to happen the soonest but not already ended.

```
{if entry_date >= current_time}
    {title}
{/if}

```

The above shouldn't work because the limit applies before the loop. Any thoughts?

# Answer
You can use the `start_on` parameter within the channel entries tag. Something like:

```
{exp:channel:entries
    channel="channel_name"
    limit="1"
    sort="asc"
    start_on="{current_time format='%Y-%m-%d %H:%i'}"
    show_future_entries="yes"
}

```
> 0 votes

# Answer
You could use the free Solspace add-on called Date Field Filter. It would allow you to dynamically set a start date of current\_time which would then be future-friendly in the way you're looking for.
> 0 votes

# Answer
Using the start\_on and stop\_on has flexibility without using an add-on. Add a bit of PHP to increase your options. I frequently want to display just entries that are dated either in the next and/or last 7 days. You need to allow PHP on input in the template. Change the 604800 to however many seconds you want the time period to be.

```
<?php
$start_time = $this->EE->localize->format_date('%Y-%m-%d %H:%i', $this->EE->localize->now - 604800);
?>
<?php
$stop_time = $this->EE->localize->format_date('%Y-%m-%d %H:%i', $this->EE->localize->now + 604800);
?>

{exp:channel:entries channel="channel_name" show_future_entries="yes" dynamic="no" start_on="<?php echo $start_time; ?>" stop_before="<?php echo $stop_time; ?>" orderby="entry_date" sort="desc"}

```
> 0 votes

---
Tags: channel-entries, date
---


# Question
Title: User registeration form valid registration code error
I've tried the Solspace User module registration form and the standard EE registration form and I'm get the same error on both submissions:

The form you submitted contained the following errors: You must provide a valid registration code to complete your registration. (note: Registration codes, like passwords, are case-sensitive.)

I have no reference to registration codes or even a captcha in my registration forms. In my member preferences I have allow member registrations set to yes, require terms of service is no, enable membership captcha is no.

I'm not sure what is wrong and what registration code EE is looking for?

Any help would be very much appreciated.

Julie

# Answer
Could it be anything to do with the User Key?

http://www.solspace.com/docs/user/key/

I haven't used them before but it rang a bell...
> 1 votes

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


# Question
Title: Build a forum? Or buy forum addon? What about blog?
How simple is it to build a basic forum in EE? I assume Categories can be used for forum categories. Then create a channel "Forum Topics" with a "Message" field. Then perhaps use the Comment addon so everyone can comment on the forum topic? I'd like to be able to support search, as well. That means being able to search the entries in "Forum Topics" and the comments.

Or would it be easier to use an addon? I've taken a look at EE's forum addon. It's too full featured for what I need. Also, the markup, etc. is very messy. I'd need to integrate it with Twitter Bootstrap -- and maybe that's too huge of an undertaking. Maybe it's easier to just build something on my own?

Thoughts?

NOTE: If I were to build a blog, would I take the same approach? A simple Channel with a "content" field, Comments addon, and maybe a tag addon?

# Answer
For the forum you could use the Ellis Lab add on. I've used it a couple of times and can't say I'm a fan but it will do the job and you can template it as simple or as complex as you need (there's a good starting template framework around I believe). To be honest I'd probably look at using some non-EE solution unless you needed member integration between the Forum and other parts of the site.

Blogs are simple with EE. Do it like you suggest and use the Comments module to handle your comments. There are some good examples in the EE docs on how to do this.
> 2 votes

---
Tags: add-on, forum, addons
---


# Question
Title: Duplicate email address allowed in member registration?
Does EE allow multiple members to use the same email address when registering? I'm able to register members using the same email address, which is something I don't want to happen. This Allow duplicate emails/no email address on Member Registration seems to suggest that EE does not allow it, though. Is this supposed to be a setting or something?

# Answer
ExpressionEngine doesn't allow this by default. It's possible another add-on has built this into their product, but Safecracker Registration just combined member registrations with Safecracker to get the benefit of channel entries. So by design, Safecracker Registration is limited by what the native member module can do, at least as far the settings go.
> 1 votes

# Answer
Yes, EE doesn't allow duplicate email for registration. I think, you are using "Profile: Edit" module for the registration process. If so go to Extension Settings -\> Profile Edit. From here select "No" for "Allow Multiple Profiles".
> 1 votes

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


title: Add a randomised body class

text:
# Question
Title: Add a randomised body class
I need to add a random class from a selection of pre-defined classes to the body tag of a template.

I did it with JS but the change is visible so I would like to do it before the page is rendered.

Any ideas?

Many thanks Mikee

# Answer
> 4 votes
You could use Low Random maybe?

`{exp:low_random:item items="cat|dog|ferret|raptor"}`

# Answer
> 3 votes
Low Random looks like it'd do the job.

# Answer
> 0 votes
Inefficient I guess but you could use channel entries with a random sort order, a matrix field with the same or I think Low Variables would be the most efficient way.

# Answer
> 0 votes
People have mentioned low Random, but the Randomizer plugin can also be used to add strings to just about anything (images, text, whole paragraphs, a class...) It's lightweight, it's easy to use (though you have to edit the PHP file to build the arrays) and it will insert the content before the page is rendered.

---
Tags: random
---


# Question
Title: Re-enable password autocomplete for CP login
Since ExpressionEngine 2.5.3 the form used to log into the control panel has `autocomplete="off"` set on the password input field. This means that browsers won't offer to remember passwords when they're entered.

When creating new passwords for super-admins I generate a long, unique passwords using Keychain. I'll never remember these, and there's no way my clients will either. Because of this, I always recommend that people have their browsers remember passwords. I believe this is in every way more secure than remembering the password (i.e. writing down on a sticky note somewhere) and entering it (i.e. having it read by a keylogger) every time.

**My question is:** can the `autocomplete="off"` attribute be removed from the password input field somehow?

# Answer
Check out these instructions from the EllisLab forum:

> You can just create your own CP theme by copying the file found at /system/expressionengine/views/accounts/login.php to /themes/cp\_themes/my\_theme/accounts/login.php and editing it to your liking. Now when you choose that theme instead of the default theme, EE will use your file instead. For all the files not found in your theme, EE will fall back to the default theme’s files.

http://ellislab.com/forums/viewthread/227881/#1035125
> 1 votes

---
Tags: login, admin, password
---


title: N+1 queries for categories

text:
# Question
Title: N+1 queries for categories
I am working on a feature where I need to get every entries category and that categories parent category. This is leading to a lot of DB queries. Is there a way to get the category of an entry and that categories parent. Ultimately I am after just the category url title.

```
Psuedo code
    {exp:channel:entries}
      {entry:category:url_title}
      {entry:category:parent_category:url_title
    {/exp:channel:entries}

```

# Answer
> 1 votes
Would using the channel categories tag allow you to get the results you need?

```
{exp:channel:categories
    channel="your_channel"
    show_empty="no"
    parent_only="yes"
}
    {category_url_title}<br>
{/exp:channel:categories}

```

---
Tags: channel-entries, categories
---


# Question
Title: Update weight of a product with jquery upon select.
I am currently using a modification on a certain product. It's set up basically as a price modifier however, the weight on one of the products has changed.

Is possible to modify the weight on a selected modifier without creating a separate product?

```
$('modifiers[10]').change(function(){
if($(this).val() == '42'){
$('.store_product_weight').text(' 44<small>lb.</small>/ 5<small>Gal</small>Pails'); // Change Text
}
});

```

I'm pretty sure I can modify the text but what about the actual value?

Thanks

# Answer
> 3 votes
To modify the actual weight of the item so that it adjust things like shipping weight you would need to write an extension (available hooks) that would adjust the actual values for calculations.

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


# Question
Title: Does Expresso Store Have a USPS International shipping plugin?
I am tring to add an international shipping method. But the Store USPS plugin uses 'API' =\> 'RateV4' Which is for domestic shipping. 'API' =\> 'RateV2' is for International Shipping. Do I need to just change some values in the default USPS Shipping plugin to make this work?

# Answer
USPS has separated the International API from Domestic API (Docs) so you would need a new shipping plugin to calculate international rates. In the meantime you can use UPS, FedEx or the Default Shipping Plugin for international orders.
> 1 votes

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


# Question
Title: Expresso Store: Order a single modifier in the store product tag
I'm trying to order a product that has one or more modifiers. I added a modifier which let's the user order a box or bag of a specific product. Now I'd like to be able to purchase that modifier with a push of a button. So I can show both modifiers with an amount, the modifier name and the order button to add it to the cart. Is such a thing possible?

```
{modifiers}
{if modifier_type == 'var_single_sku'}
{modifier_options}
                <table border="0">
                    <thead>
                        <th colspan="2">{option_name}</th>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <input type="hidden" value="{option_id}" name="{modifier_input_name}">
                                <input type="text" size="2" id="frm-order-number" value="1" name="item_qty" data-required="true">
                            </td>
                            <td><input type="submit" title="Orderww" value="Add" title="Add to cart"></td>
                        </tr>
                    </tbody>
                </table>
{/modifier_options}
{/if}
{/modifiers}

```

# Answer
If a product has more than one modifier then this wouldn't be possible as you'd need the user to select the options. A size modifier and a colour modifier for instance present two different choices so you couldn't have an individual quantity field or button for each one.

If you *did* just have one modifier per product however then it may be possible to use the Product Form tag which allows the customer to specify quantities for more than one product at a time and then add them all to the cart at once. It's primary use however, is intended for individual products so it would take a little creative templating and possible a query or two to get it to work with modifiers of the same product.
> 1 votes

# Answer
As Ian mentioned it is not possible out of the box unless you get very creative. If you build a query that grabs the particular SKUs for each product variation in theory you could have a quantity field for each variation. Direct access to exp\_store\_stock exp\_store\_stock\_options tables via Expresso Store tags? briefly touches on it as does Exp:resso Store form created by products tag - I just want to submit a single SKU
> 0 votes

---
Tags: expresso-store
---