title: Is Low Seg2Cat working correctly?

text:
# Question
Title: Is Low Seg2Cat working correctly?
I am trying to grab the category ID from the last segment to use in a redirect back to that category page but nothing is showing up.

My main page is http://domain.com/store/shop/C28, then you click to view a single entry.

the entry is http://domain.com/store/product\_detail/158

where 158 is the entry\_id to display a dynamic entry showing one product.

In my redirect (after adding the product to a cart) I want to go back to http://domain.com/store/shop/C28

I have tried to use this in my add to cart but nothing is parsing for the seg2cat

```
return="http://hookingrugs.com/store/shop/C{last_segment_category_id}"}

```

When I view source I just see http://hookingrugs.com/store/shop/C"

with no ID.

Even if I just place {last\_segment\_category\_id} on the page outside of any other tags I still get nothing. Why does low seg2cat not pick up on the last entry ID.

# Answer
> 4 votes
Low Seg2Cat doesn't pick-up category information associated with **channel entry IDs** in the URL - it picks up category information associated with **category URL titles** in the URL.

So, it is working, but it doesn't do what you thought it might do.

---
Tags: categories, low-seg2cat, low
---


# Question
Title: Grid Fields - Alternative ways to display editable Grid
I see in the documentation that the grid editable fields is outputted using the tag {field}

{exp:channel:form channel="xxxxxx" ... } {field:foobar} {/exp:channel:form}

This displays the rows and columns, some controls for adding, etc.

My question is, are there ways or custom addons that will allow me to manually output the markup?

The problem with the native solution is that I am not given control on how the markup is done, which means that it looks pretty out of place for my site

# Answer
As you say by default Channel Form can output an editable grid by `{field:grid_field}`.

It's 'useful' how EE displays the table code, names fields and auto loads in the required CSS & JS. Not so handy for styling. One option would be to load in another CSS file after EE's grid CSS to style it how you need - this is the easiest.

To get looping field data use a Custom Field Tag Pair. The docs are unclear how to handle tag pair data like Grid. Frustrating as the docs even reference Grid for the tag pair! http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_form/index.html#custom-field-tag-pair

I've managed to get the data out, but to do so it looks like it's just the normal tags from `channel:entries` doing the work rather than `channel:form`. Importantly EE does save the data back to the Channel entry. The tricky part will be adding JS functionality Grid requires for adding rows etc.

Looking at what field names `{field:grid_field}` outputs I've duplicated them for my custom form fields. On submit EE does update Grid. Theoretically you could write your own JS to add new rows or link to EEs JS, but you'd need to make sure your HTML has the IDs and classes Grid JS is expecting.

```
{exp:channel:form
channel="channel"
entry_id="1"
}

<label for="title">Title</label>
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();">

    <table>
    {grid_field}

        <tr>

            <td>
                <input type="text" name="grid_field[rows][row_id_{grid_field:count}][col_id_1]" value="{grid_field:grid_input}">
            </td>

            <td>
                <textarea name="grid_field[rows][row_id_{grid_field:count}][col_id_2]">{grid_field:grid_text_area}</textarea>
            </td>

        </tr>

    {/grid_field}
    </table>

    <hr>

    <input type="submit" name="submit" value="Submit">

{/exp:channel:form}

```

\** There is an issue with doing like this. Using single tags, EE doesn't update any fields you don't include in the form. Unfortunately leaving out fields from grid, blanked out existing data, so you'd need to include all fields even if hidden.

Also doing it like this, everything is hard-coded so if you added another field to grid you'd have to update your template.
> 1 votes

---
Tags: grid
---


title: CartThrob Securepay Return URL Issue

text:
# Question
Title: CartThrob Securepay Return URL Issue
I'm integrating Securepay DirectPost for a client, which sends the customer off to Securepay and then back again - all is working except no text is appearing on the return page (eg, thanks for your order). I get the emails ok though, just no text, can anyone think of what might be going wrong? I use this function to update the order - $this-\>checkout\_complete\_offsite($auth, $refid); If I use this one - $this-\>gateway\_order\_update($auth,$refid) I just get a blank page (eg, no content at all). I get a 'payment authorised' on the order in admin but I do see that the transaction id has not updated (I put this in the $auth array).

Thanks in advance.

Jill

Add: I have tried the extload.php file as you mentioned but putting $this-\>response\_script(ucfirst(get\_class($this))) as my return\_url just caused an error at securepay and the extload($post) function did not get any post variables returned to it, even if I ran $this-\>relaunch\_cart\_snapshot($txnid) inside it (that was empty too). So I put it back to the return\_url $this-\>get\_notify\_url(ucfirst(get\_class($this)),'success') and it then runs the success function I wrote and updates the database and orders go through, but we're back to the no 'thanks for your order' displaying. Just missing a tiny step!

# Answer
Usually when creating a gateway that uses an html form to post directly to the payment service, we use both of the functions you mentioned. Here's the general overview:

Inside the charge method

* Create the security hash/fingerprint if required
* For the return/redirect URL in the html form, use `$this->response_script(__CLASS__)` this will make use of a file called extload.php and an extload method in your gateway. (Make sure that file is set up correctly with your system path. By default this file is in themes/third\_party/cartthrob/lib/ )
* Add `$this->gateway_exit_offsite(NULL, $url=FALSE, $jump_url= FALSE);` This basically does some maintenance functions to prepare the cart for going offsite.
* Echo out the html form with the required fields

Example of how to use a second credit card form that submits directly to the payment service:

```
public function charge($credit_card_number)
{
    // Do whatever you need to do here before the credit card form.
    // Usually this will include a security hash generation or
    // data formatting that needs to be passed along to the payment service

    // create an array for the credit card form
    $jump_html[] =  "<form method='post' action='YOUR_FORM_ACTION'>";

    // add your form fields
    $jump_html[] = "<input type='hidden' name='SECURITY' value='YOUR_HASH' />";
    $jump_html[] = "<input type='text' name='SOMEFIELD' value='' />";
    $jump_html[] = "<input type='submit' value='submit' />";
    $jump_html[] = "</form>";

    // this is called for maintenance functions.
    // You'll note that we're telling it not to do any redirection or jump pages.
    $this->gateway_exit_offsite(NULL, $url=FALSE, $jump_url= FALSE);

    // echo out the form
    foreach ($jump_html as $line)
    {
        echo $line;
    }
    exit;
}

```

To handle the response from the payment service

* You'll be using a method called extload to handle the response `function extload($post){}` That $post variable will contain the payment service's response. All of the following items take place inside that extload method.
* You generally need to relaunch the cart snapshot you saved earlier when you called the `gateway_exit_offsite` method. The gateway should be returning your order id in its response, in your example I'm guessing the order id is refid.

```
$this->relaunch_cart_snapshot($post['refid']);

```
* Use the $post response to create an array of responses to use with the `{exp:cartthrob:submitted_order_info}` tag. The values contained in the $post response varies by payment service, but there's usually some kind of status code that tells you if the payment is authorized or if there are errors.

Example of the response array:

```
$auth = array(
    'authorized' => FALSE,
    'error_message' => NULL,
    'failed' => TRUE,
    'declined' => FALSE,
    'transaction_id' => NULL,
    'processing' => FALSE
);

```

Those values would need to be updated based on the response returned.
* Return that array and redirect to your Thank you page using:

```
$this->gateway_order_update($auth, $this->order('order_id'), $this->order('return'));
exit;

```
> 5 votes

---
Tags: cartthrob
---


title: Exp:resso Store + UPS Shipping

text:
# Question
Title: Exp:resso Store + UPS Shipping
We're using Store 2.0.1 on EE 2.7.2 and trying to figure out how to get the UPS shipping extension working. I've read and re-read the docs but I'm clearly missing something. :/

Docs say:

> The UPS Shipping extension will automatically add shipping method options to your checkout. To display the shipping options inside your checkout tag, use the {field:shipping\_method} variable.

So, we have `{field:shipping_method}` in our `{exp:store:checkout}` tag but all I see is a drop-down with no options. We don't have anything set up in the Shipping Methods of Store's settings. Have I misunderstood the docs?

# Answer
I had the exact same issue and if it was not for Angie, I would have never figured it out.

"The solution for us ended up being ridiculously simple. Under the UPS Settings (in Extensions), make sure that the Source Country is correct. I had something like "United States" but it should be US."

I had exactly that, "United States", and changing it fixed the problem.
> 2 votes

# Answer
The docs might be a bit out of date for the latest version of Store. You will want to goto Add-ons \> Extensions and enable the UPS plugin. Once it is enabled you will want to click on the settings for the UPS Extension and enter your UPS details and select the boxes for the types of shipping you would like to offer. Once you have done that the `{field:shipping_method}` should populate on the front-end of the site now.

Having said that you will need to make sure that you have a users shipping details before you try to calculate a rate.
> 1 votes

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


# Question
Title: Flexslider and Grid - thumb does not match image
I've set up an Artist gallery on a site that I'm building using FlexSlider. It works great except that there's this really strange issue where the large image is not matched to the thumbnail navigation.

The thumbnails are in the correct order but the large images displayed are off by one. i.e. the first image displayed should be displayed second with the final image being the first one. Really weird.

My EE code is:

```
  {exp:channel:entries channel="exhibition|artist" limit="1"}

  <div class="flexslider">
    <ul class="slides">
      {artist_gallery}
        <li data-thumb="{artist_gallery:art_image:100square}"><img src="{artist_gallery:art_image:570x470}" alt="{artist_gallery:art_title}" /></li>
      {/artist_gallery}
    </ul>
  </div>

  {/exp:channel:entries}

```

And on the front end the source code is:

```
  <div class="flexslider">
    <ul class="slides">

        <li data-thumb="http://domain.com/uploads/general/_100square/test14.jpg"><img src="http://domain.com/uploads/general/_570x470/test14.jpg" alt="" /></li>

        <li data-thumb="http://domain.com/uploads/general/_100square/test4.jpeg"><img src="http://domain.com/uploads/general/_570x470/test4.jpeg" alt="" /></li>

        <li data-thumb="http://domain.com/uploads/general/_100square/test5.jpg"><img src="http://domain.com/uploads/general/_570x470/test5.jpg" alt="" /></li>

        <li data-thumb="http://domain.com/uploads/general/_100square/test7.jpg"><img src="http://domain.com/uploads/general/_570x470/test7.jpg" alt="" /></li>

        <li data-thumb="http://domain.com/uploads/general/_100square/test6.jpg"><img src="http://domain.com/uploads/general/_570x470/test6.jpg" alt="" /></li>

        <li data-thumb=""><img src="" alt="" /></li>

    </ul>
  </div>

```

I've checked the console and there are no errors. I'm completely flummoxed on this one. Especially considering that in the source view the thumbs and large images line up correctly. Any ideas?

# Answer
So it looks like the issue was with the flexslider zip. I looked at the demo included in the zip and it has the same issue. I resolved the problem by grabbing the js file from the live demo page.
> 2 votes

---
Tags: jquery, grid, template-scripting
---


# Question
Title: CartThrob Edit Permission Item - Submit button doesn't do anything
If I create a permission item (i.e. `CartThrob` \> `Add-Ons` \> `Create permission item`) and then save it. Everything seems to work as expected.

However, when I enter "edit" mode and then try to `Submit`, absolutely nothing happens...

Google Chrome Inspector does not show any errors and there is no Network activity going on either.

> Expression Engine version 2.7.3
>
> CartThrob version 2.4

Let me know if I can provide any further details to help debug this.

Thanks.

> **UPDATE:**
>
> Upon further investigation it appears there is no opening `<form>` tag. Does anyone know where this file is located or have any advice?

# Answer
A new Cartthrob Permissions Admin module (version 2.5) was released today. It should fix the "edit" problem.
> 0 votes

---
Tags: cartthrob, permissions
---


# Question
Title: CartThrob Permissions FieldType added to product channel now I get error:
After I add the CartThrob Permissions field to my product channel, I am no longer able to edit my channel. If I select channel \> edit and then click a product I desire to edit, I get the following:

> An Error Was Encountered
>
> Unable to locate the model you have specified: cartthrob\_field\_model

* Expression Engine version 2.7.3
* CartThrob version 2.4

What can I do, or what additional information would be helpful to debug this?

Thanks in advanced.

# Answer
> 0 votes
I haven't been able to replicate the error you're reporting. A new Cartthrob Permissions Admin module (version 2.5) was released today. I would recommend installing that update and if you continue to have this problem book a support appointment here: http://support.mightybigrobot.com

---
Tags: cartthrob, error, fieldtype, permissions
---


title: Import fails with Internal Server Error

text:
# Question
Title: Import fails with Internal Server Error
I have a batch import I used about a year ago that I was revisiting for some new posts. After making the necessary modifications (different channel but identical fields, different source but similar data) I get an error. It's an alert box with the following "There was error during the processing: Internal Server Error".

After trying multiple modification and even creating a new batch from scratch I can't seem to get a different outcome. Any help would be great.

EE 2.7.3 Importer 2.2.3

# Answer
> 1 votes
I've had similar try limiting the import to say 10 or 20 entries as every time this has happened its been caused by memory issues on the server.

You could try increasing the memory which may help. But start with a small subset of data and build up from there.

---
Tags: solspace-importer
---


title: Embed Error Debugging

text:
# Question
Title: Embed Error Debugging
Is there a way to display debugging information for an embed tag?

I can't use the administrator template debugging feature since the page I put the embed tag into is only accessible to non-logged in users.

The problem with the tag is that its not showing for one installation and its showing for another installation which is a clone of the former.

# Answer
Why not simply copy the content of the embed into another, stand-alone, template and visit that?

If there are parameters passed to the embed then just hardcode values into your test template.
> 1 votes

---
Tags: embeds
---


# Question
Title: stash {exp:stash:set} and {exp:stash:set_list}
```
{exp:channel:entries channel="about"}
{exp:stash:set name="page_meta_description"}{about_meta_description}{/exp:stash:set}
{exp:stash:set name="page_meta_keyword"}{about_meta_keyword}{/exp:stash:set}

{exp:stash:set_list name="about" parse_tags="yes" parse_depth="2"}
{/exp:stash:set_list}
{/exp:channel:entries}

```

Possible set stash and set stash list with 1 channel entry tag? like mention above. currently i seperate it to 2 entry tag, cause above one won't work.

# Answer
It's definitely possible, I do it all the time. Can't really tell much from yor example though as you're not setting anything inside the list itself. Can you post a more complete example?
> 1 votes

---
Tags: stash
---


# Question
Title: Solspace Freeform (free version) {freeform:all_form_fields} not working
I am looking at the Solspace Freeform (free version) documentation and **I see this**:

```
{freeform:all_form_fields}
<p>
    <label>{freeform:field_label}</label>
    {freeform:field_output}
    {if freeform:field_type == 'text'}
        hello!
    {/if}
</p>
{/freeform:all_form_fields}

```

I am using this in my code:

```
{exp:freeform:entries form_name="expert_request"}

    {freeform:all_form_fields}
        <label>{freeform:field_label}</label>
        {freeform:field_output}
    {/freeform:all_form_fields}

{/exp:freeform:entries}

```

And this is what outputs on my site:

```
{freeform:field_label}
{freeform:field_output}
{freeform:field_label}
{freeform:field_output}
{freeform:field_label}
{freeform:field_output}

```

Can anyone tell me why the output on the tags is returning nothing? Thanks for any help.

***~DVL***

# Answer
Looks like you need to ensure you have created your fields and connect them to the correct freeform "form" - in your case it'd be "expert\_request".
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Image Editing Fieldtype (Matrix/Grid compatible)
I'm looking for a fieldtype that would open a basic image editor with option to Scale + Crop (maintaining proportions as option).

I've reviewed Channel Images which would be OK, but I can't use it in tandem with Playa/Relationships so lose a level of complexity and depth that is very handy for big content sites. I also love how sturdy Matrix is and how quick it is for clients to understand/use.

Is there one knocking about that works inside the control panel, as I'm keen not to have to persuade them that we'll automate it using a tool like CE:img.

Cheers.

# Answer
> 0 votes
Photo Frame from ObjectiveHTML sounds like it would do exactly what you want, and it does support Matrix. It's crazy powerful with an extensible feature set and Justin provides excellent support.

---
Tags: matrix, fieldtype, image, editor
---


title: Custom Change Password Page

text:
# Question
Title: Custom Change Password Page
Is there a way to change the HTML markup of the page where you change your password(the page you go to when clicking on the reset password link sent to your email)?

I would like it to match the look and feel of my EE site.

# Answer
> 5 votes
You could use custom system messages which sets up the EE specialty templates as editable files: http://devot-ee.com/add-ons/custom-system-messages

Or freemember which allows you to use your own templates for member specific actions: http://devot-ee.com/add-ons/freemember

I've used libraree previously as it gives access to system templates as well as saving globals & snippets as files as well: http://devot-ee.com/add-ons/libraree

# Answer
> 1 votes
If you decide to use one of the great members as entries add-ons (Profile:Edit, Zoo Visitor, Safecracker Registration), which bridge the gab between the member module and channel entries, they provide a mechanism for you to access member data in regular templates (making it considerably easier to do whatever you need to do in terms of look and feel, etc.). Freemember does some of that unshackling as well, but I don't know that it uses channel entries for the member data at all.

---
Tags: forgot-password
---


# Question
Title: Grid hooks to change dynamically change table headers on the fly
I am looking for a hook where I can dynamically change the table headers of a displayed Grid field in the frontend on the fly.

There are hooks for grid, grid\_query and grid\_save. So far in the documentation, I don't see anything where I can change the table headers output text.

Am I just missing something in these hooks or is there no way to change the table headers output other than editing the core files?

# Answer
> 1 votes
Yeah, the Grid-related hooks won't help you here. You probably want to look at either the channel\_entries\_row hook (for access to the raw data after it's been queried), or the template-post-parse hook (for access to the complete template after it's been parsed).

---
Tags: grid
---


title: How to get bootstrap to work with EE

text:
# Question
Title: How to get bootstrap to work with EE
I'm making responsive website based on bootstrap front-end framework, but when I "move" static and working HTML pages to EE templates bootstrap parts are not working (for an example accordion effect). Bootstrap CSS and JS are included in the header.

Any particular steps must be taken to get this to work with EE?

Thanks

# Answer
> 0 votes
Be sure to use up to date and plain Bootstrap, no LESS version or use Eeless http://devot-ee.com/add-ons/eeless

---
Tags: bootstrap
---


# Question
Title: Any way to include file in a email sent to user?
We are implementing a Coupon page on a client's website. Basically just a page that displays the coupon JPG. I have a channel setup with a field to upload an image. The client wants the user to be able to input their email address into a form field and submit in order to get the coupon JPG emailed to them. Any ideas how this can be accomplished? The Coupon JPG will update occasionally. Thanks for any info!

# Answer
You cannot attach a file to a notification email unless the file is uploaded along with the form being filled (I recommend submitting this as a Feature Request here: http://support.solspace.com/support/discussions). Usually the best you can do is have a link in your notification email template pointing to your file which users can then download.

With an image file, however, you might have one more option. You will need to enable HTML for your notification email template in Freeform.

Since Freeform 4.x, EE tags can be used in the notification email template body, which means you should be able to retrieve your coupon data from your entry channel. Along with HTML enabled for the entry, you could create an `<img>` tag in your email body, which should display your coupon to the email recipient.

Here's an example. I'll assume, for demonstration purposes, that your channel is called "`coupons`" and that your entry\_id containing the coupon is "`123`". The coupon File custom field would be called `{cf_coupon_image}` in this example. In your email notification template body, you could do this:

```
{exp:channel:entries channel="coupons" entry_id="123" dynamic="no"}
     <img src="{cf_coupon_image}" />
{/exp:channel:entries}

```

If HTML is enabled, and your recipient can view HTML emails, the email body should contain an image of your coupon :)

Only catch: the image is still coming from your site. If you change that image in your entry *and the filename does not change*, this will change the image for the recipient of the email as well.
> 2 votes

---
Tags: solspace-freeform, email, forms, attachment
---


# Question
Title: Switchee segment check in embedded template not working
I'm new to Stash and Switchee and this is probably a parse order issue, but I am not quite sure how. Maybe someone that understands this and Switchee a bit more is able and wouldn't mind explaining why the below isn't working.

On my page template I embed my `layouts/default` template. At the top of that I have this Switchee conditional:

```
{exp:switchee variable="{segment_1}" parse="inward"}
  {case value=""}
    {sn-home-data}
  {/case}
  {case default="yes"}
    {sn-page-data}
  {/case}
{/exp:switchee}

```

The `sn-page-data` snippets contains this:

```
{exp:stash:set parse_tags="yes" parse_conditionals="yes"}
  {exp:channel:entries limit="1" channel="page" disable="categories|member_data|pagination" cache="yes" refresh="6400"}
    {stash:page_title}
      {title}
    {/stash:page_title}
  {/exp:channel:entries}
{/exp:stash:set}

```

When I am calling the `{exp:stash:page_title}` variable in the `layouts/default` template nothing returns.

If I remove `parse="inward"` from the Switchee tag it does work, but if I understand correctly this setting is needed to give Switchee that performance advantage over EE conditionals...

# Answer
This is a tag parse order problem, and it arises because you are (if I understand you correctly) setting your 'page\_title' variable in the view template (the embed) - and trying to access it in the same template. Something like this:

```
{exp:switchee variable="{segment_1}" parse="inward"}
  {case value=""}
    {sn-home-data}
  {/case}
  {case default="yes"}
    {sn-page-data}
  {/case}
{/exp:switchee}

{exp:stash:page_title}

```

Module tags are parsed outwards \> and parse="inward" makes Switchee behave like a module tag, therefore the parse order is:

1. Switchee parsed, returns the unparsed content of `{sn-home-data}` or `{sn-page-data}` to the template, depending on the value of `{segment_1}`
2. `{exp:stash:page_title}` is parsed. It returns nothing, because the variable doesn't exist yet.
3. Now either `{sn-home-data}` or `{sn-page-data}` are parsed and the value of `{exp:stash:page_title}` is set.

So why does removing parse="inward" from Switchee work? Because Switchee is a plugin tag, which are parsed last, after any module tags they wrap (effectively inwards \> outwards"). Thus both `{sn-home-data}` or `{sn-page-data}` would be parsed in step 1.

The easiest solution to this problem is to move your Switchee expression to the parent template. It has no business being in a view template in any case, since you should really be trying to decouple your view and from the model/presentational logic.

If you don't want to do that then you can subvert parse order with the process parameter like so, to move the Stash get tag to the end of parsing:

```
{exp:switchee variable="{segment_1}" parse="inward"}
  {case value=""}
    {sn-home-data}
  {/case}
  {case default="yes"}
    {sn-page-data}
  {/case}
{/exp:switchee}

{exp:stash:get name="page_title" process="end"}

```
> 3 votes

# Answer
So... is that second block of code supposed to be a "set" or a "get"?

I think you're just missing a *process="end"* on one of your blocks.

I would probably do more like so...

Set the page\_title variable:

```
{exp:stash:parse}
   {exp:channel:entries limit="1" channel="page"
    disable="categories|member_data|pagination" cache="yes" refresh="6400"}
      {exp:stash:set name="page_title" value="{title}"}
   {/exp:channel:entries}
{/exp:stash:parse}

```

Getting the variable later:

```
{exp:stash:parse process="end"}
    {stash:page_title}
{/exp:stash:parse}

```

The process="end" portion ensures that this gets parsed after the other one.

Note: You may still need the parse conditionals in your example, etc.

Also, as a footnote - I've problems with caching with Switchee. You may want to try doing this with the cache off. And then loop back to make the caching work right.
> 0 votes

---
Tags: stash, switchee
---


# Question
Title: Multiple channel entry fields per row on publish/edit page
Kind of noob question for EE but is it possible to have multiple channel entry fields per row on a channel (publish/edit) back end? I'm at the point of adding channel fields where are numbers only and came kind of "messy" on publish/edit page.

Thanks

# Answer
Yes, use the Publish Layouts feature. You can drag and drop fields into place and adjust their widths as you please.
> 3 votes

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


title: search:relationship field

text:
# Question
Title: search:relationship field
I'm in need of a way of searching by a relationship. Its not possible out of the box according to the docs, but is there a workaround?

```
{exp:channel:entries
channel="products"
{if get:service}search:product_service_name:url_title="{get:service}"{/if}
}

```

Product Service Name being the relationship.

Any help is appreciated.

Thank you

# Answer
> 1 votes
Low Search is an add-on that makes search a lot more powerful and does provide filtering on relationship fields. Might be worth a look.

# Answer
> 1 votes
Assuming you're using EE 2.6 or newer, you should be able to do this without using the `search=""` parameter.

What's you're really looking for is the parent entries (those with the relationship field and have the target entry selected).

From the documentation, you can access parents like this. (Slightly modified for your situation)

```
{exp:channel:entries url_title="{get:service}" dynamic="no"}
        {parents field="product_service_name"}
                {!-- Do whatever you need to do in here --}
        {/parents}
{/exp:channel:entries}

```

---
Tags: search
---


# Question
Title: Display content customized by member type?
How do you display content by member type?

# Answer
The simplest solution is to use EE's built-in Member Groups, then use conditional checking in your templates:

```
{if logged_in_group_id == "5"}
    // Place some group-specific code here
{/if}

{if logged_in_group_id == "8"}
    // Place some group-specific code here
{/if}

```
> 4 votes

---
Tags: ee2, members, content
---


# Question
Title: Create an extension to update the status
I'm just starting to work with Store 2.x and wondering if it's possible for me to create an extension that updates the order status once the order is complete. I know I'm needing to use the 'store\_order\_complete\_end' hook, but not sure how I can update the status at this point. Can somebody point me in the right direction? I'm basically wanting to update the status to one of 2 things depending on what products they are buying.

Thanks, Dan

# Answer
> 4 votes
Derek was very close. I actually wrote a similar answer to this the other day.

You need to find the actual status before you update the order. Since you already have the $order object, all you need to do is this:

```
$status = Store\Model\Status::where('name', $status_name)->first();
$order->updateStatus($status);

```

FYI in case you are wondering, you can loop through the order items like this:

```
foreach ($order->items as $item) {
    echo($item->entry_id); // etc
}

```

# Answer
> 3 votes
If you do a `print_r($order)` inside of your extension, you'll see what you have access to inside of the `$order` object/array.

You can then loop through the order items it contains and check for your products, then update the `exp_store_orders` table with a new status for that order (I'm sure its `_order_id` is contained in the `$order` object as well).

---
Tags: expresso-store
---


# Question
Title: Matrix & Radio Buttons - how to make radio button part of the same group?
I'm creating a Matrix to allow users to upload images. One of the fields I want to put is a radio button for "Set as default image". That means each row in the Matrix will have a radio button.

Problem: there can only be one default image selected from the list of images. So, if one radio is selected, the other radio needs to be unselected. Is there a way to do this without using a JS solution?

# Answer
There are two available fieldtypes specifically for this purpose. They both work great:

* **MX Lone Star**. It has the added advantage of working not only across rows, but across columns, too.
* **Matrix Radio Group**. By Pixel & Tonic. This one is not on Devot:ee and might only be
described here.
> 5 votes

# Answer
I know this question has already been answered and even though my contribution serves a different purpose, this Q&A result was one of the first to display when I was searching for a solution for radio options within a Matrix cell type. I hope this will help anyone looking for a similar solution.

I found Field Pack (http://devot-ee.com/add-ons/field-pack) by Pixel & Tonic to be a great solution. It is fully compatible with Matrix.

After installing the Fieldtypes you want to use, select "Field Pack - Radio Buttons" as the Matrix Cell Type and then list the radio options on separate lines:

Then when creating the content, this is how the Radio options display:

The selected option will display exactly as you have entered it on the front-end:
> 0 votes

---
Tags: matrix, fields
---


# Question
Title: Assests + MSM + Indexing new site = Uh oh!
SO, I have assets installed on site1 - works great. I add site 2, index the uploads, cool.

I can add images in the module, but when I try to add images within an entry, the buttons are grayed back. Any idea why I can't add images within an entry in site2?

# Answer
> 1 votes
I had same problem, and it was a simple solution for my set up. I had to copy the themes folder from site 1 into site 2, including third party and EE system cp themes etc, with site\_themes being the only folder unique to site 2.

Bit of a pain because of the need to sync the two themes folders manually when adding new add-ons and updates, but since it's only for my occasional MSM site I can handle that.

It is also possible to link to assets using the site 1 links if you want to keep a single themes folder, as long as you don't mind the site 1 links in source code of site 2.

---
Tags: assets, multi-site-manager
---


# Question
Title: Low Search: Search by Postal code, populate latitude, longitude automatically
I'm a little lost here. I have the following situation:

1. I have channel entries (properties) which are geocoded (latitude, longitude)
2. I'm trying to use Low Search to look for properties and have them sorted by distance from preferred location / address

Problem: How do I tell Low Search which geocode the address (City or Street or Postal Code) the user is searching for has?

Here's the detail page of Low Search: http://gotolow.com/addons/low-search/docs/filters#distance

Thanks in advance!

# Answer
Low Search's Distance filter takes lat/long values as from and to values to calculate the distances per entry. If you want to use addresses, it's up to you to transform that into lat/long values, before sending that data off to Low Search.

This Google search will give you a nice start.
> 2 votes

---
Tags: low-search
---


# Question
Title: Super Search category conditional if using multiple inclusive categories?
I'm using two search fields, each searching a different category group, and creating an inclusive category search by combining those fields. The form code looks like this:

```
<form id="directory-search" method="post" action="/directory/search">
        {exp:super_search:search}
        <fieldset class="search">
            <div class="center">
                <h1>Directory</h1>
                <a class="btn directory open-collapsed mobile-only" href="#">Search</a>
                <ul class="search-row">
                    <li>
                        <label for="channel">What?</label>
                        <select class="replace-hfirst" name="category[]">
                            <option value="">- choose vendor type -</option>
                            {exp:channel:categories category_group="10" style="linear" show_empty="no"}
                            <option value="{category_url_title}&&" data-selectedtext="{category_name}" {if super_search_category_{category_url_title}}selected="selected"{/if}>{if parent_id != '0'}    {/if}{category_name}</option>
                            {/exp:channel:categories}
                        </select>
                    </li>
                    <li>
                        <label for="category">Where?</label>
                        <select class="replace-hfirst" name="category[]">
                            <option value="">- choose location -</option>
                            <option value="" data-selectedtext="All Locations" {if super_search_category == ""}selected="selected"{/if}>All Locations</option>
                            {exp:channel:categories category_group="2" style="linear" show_empty="no"}
                            <option value="{category_url_title}" data-selectedtext="{category_name}" {if super_search_category_{category_url_title}}selected="selected"{/if}>{if parent_id != '0'}    {/if}{category_name}</option>
                            {/exp:channel:categories}
                        </select>
                    </li>
                    <li>
                        <label for="keywords">Search</label>
                        <input type="text" class="search" name="keywords" value="{super_search_keywords}" placeholder="Optional Keyword" />
                    </li>
                    <li class="button">
                        <a class="btn directory submit" href="#">Search</a>
                    </li>
                </ul>
            </div><!-- end .center -->
        </fieldset>
        {/exp:super_search:search}
    </form>

```

And the resulting search string could look like this: **search&category=auckland+photo**

"auckland" is a category in one group and "photo" is a category in the second group.

Now I need to find a way to add "selected" to the select option for each category so the searched category is highlighted.

Normally I would do something like:

```
{if super_search_category == "{category_url_title}"}selected="selected"{/if}

```

...inside the select option tag. But that doesn't work now that there are multiple categories combined in the string.

The other logical thing would be something like this:

```
{if super_search_category_{category_url_title}}selected="selected"{/if}

```

Which , according to the docs sounds like it might be the right format to work with multiple inclusive categories, but that doesn't work - probably a parsing issue trying to add in the category\_url\_title.

So how do I go about testing to see if an inclusive search string contains each category\_url\_title so I can select the right option in the select boxes?

# Answer
> 1 votes
When there are multiple categories, `{super_search_category}` will display the entire category string.

In this example, if you have **search&category=auckland+photo**, then `{super_search_category}` will parse to:

> auckland+photo

or, in some setups/EE installations,

> auckland photo

To use the individual selections for something, you'll need to break up this string. You can do this with PHP.

First, turn on PHP for your template and set it to **Output**.

Then, break up the string into an array of individual categories:

```
<?php $cats = explode(" ", '{super_search_category}'); ?>

```

(**Note**: in some cases, you might need to change `" "` to `"+"`)

Next, loop through each category in the array and use a conditional to check if there's a match with your `{category_url_title}`:

```
<?php foreach($cats as $cat) :?>
    <?php if($cat == '{category_url_title}') :?>
        selected="selected"
    <?php endif ?>
<?php endforeach ?>

```

---

The other approach, using `{if super_search_category_{category_url_title}}selected="selected"{/if}`, was close, but there is indeed a parsing issue. If you want to go down that strategy path, you might need embeds and pass in the {category\_url\_title} variable, so that {embed:my\_variable} parses before the conditional. However, you'll have a much bigger performance hit. The only other option would be to hand-code the values for each {category\_url\_title} in {super\_search\_category\_my\_category}, but that's not very dynamic.

# Answer
> 0 votes
I've found an answer to my own follow up question after Solspace's answer which I'll pot here for others.

**To convert multiple Super Search inclusive categories into category names:**

I'm using a combination of an embedded template, channel:categories tag, and CE String (http://devot-ee.com/add-ons/ce-string).

In my results page I have this:

```
{embed="directory/.ss-catname" group="10" cats="{super_search_category}"}

```

and this

```
{embed="directory/.ss-catname" group="2" cats="{super_search_category}"}

```

and then in that embed I have this:

```
{exp:channel:categories category_group="{embed:group}" style="linear"}
{if "{exp:ce_str:ing strpos='{category_url_title}'}{embed:cats}{/exp:ce_str:ing}" != "-1"}{category_name}{/if}
{/exp:channel:categories}
{if {embed:group} == "2" && "{exp:ce_str:ing str_word_count}{embed:cats}{/exp:ce_str:ing}" == "1"}All Locations{/if}

```

---
Tags: solspace, search, supersearch
---


# Question
Title: Google Indexed URL Containing S= and Random Characters
When logged into the Admin of Expression Engine, and then visiting the front of the site, sometimes the URL contains an S followed by lots of characters, like this:

```
www.mydomain.com/S=12a33f9e958c5a998383ba60cd1539210d1fb668/my-page

```

I recently found out Google has indexed a page on my site containing this URL and I wondered if anyone knows why, as this is obviously quite bad.

I noticed User Session Type was set to Session, so I changed that to Cookies, but I am just concerned about how Google indexed it with the session ID.

# Answer
> 2 votes
As you've stated the S stands for session, so EE can identify the user throughout the site visit using a query string. Google can't natively index these links, unless the Googlebot learns to create an account!

I don't know if your site is a member type site, but my guess is either a member of your site has published a link somewhere, or more likely, your client has followed the steps you describe to work out the path to an entry and used the path in a hard coded link - which may still be there. And Google has then index it.

Trouble is you can't use a third party tool to check your links, because it is a valid link, so you'll need to run searches in your database to check the content and templates for the "/S=" element of the URL.

You can use Google Webmaster Tools to de-index the offending URL.

---
Tags: url, google
---


# Question
Title: Filter results between two custom number fields
I have two custom fields. One is a start year and one is an end year. I need to filter my search results based on if the search query falls between that range. I have read the docs related to the range:field\_name filter but can't seem to wrap my head around what I need to do?

e.g. If someone types 1998 into the year custom field, it MUST find an entry where the year falls between the custom\_field\_1 and custom\_field\_2 values.

I tried this as the field name but it errored out with the Disallowed Key Character message.

```
<input type="text" name="range:vehicleYearFrom|vehicleYearTo" id="years" placeholder="Year">

```

I hope this makes sense. :-)

Thanks for your help!

---

**UPDATE:** Everything works except when I try to combine the range and the search filters I get no results. If I use ONLY field search filters it works fine, and if I use ONLY the range filter, it works fine, but when I use both, I get no results. Any ideas why?

```
  {exp:low_search:form
    force_protocol="https"
    result_page="/get-started/%s"
  }
    {error_message}
    <div class="row">
      <div class="small-12 large-8 large-centered columns">
        <div id="your_vehicle">
          <h2>Your Vehicle</h2>
          <p><i>e.g. 2003 Buick Rendezvous</i></p>
          <div class="row">
            <div class="small-12 large-4 columns">
              <input type="text" name="range-from:vehicleYearFrom" id="yearsFrom" placeholder="Year">
              <input type="text" name="range-to:vehicleYearTo" id="yearsTo">
            </div>
            <div class="small-12 large-4 columns">
              <input type="text" name="search:vehicleMake" id="makes" placeholder="Make">
            </div>
            <div class="small-12 large-4 columns">
              <input type="text" name="search:vehicleModel" id="models" placeholder="Model">
            </div>
          </div>
          <br>
          <h5><a href="{path='money-back-warranty'}">100% Money Back Guarantee</a> - Free Shipping on Purchases of $30 or More</h5>
        </div>
      </div>
    </div>
    <button type="submit">Search</button>
  {/exp:low_search:form}

```

# Answer
Having two channel fields for the range means you also need two input fields to filter. The `name` attribute of an input field always takes a *single parameter*. You're actually looking at *two* different ranges. To clarify:

* You have to fields; a `FromYear` field and `ToYear` field.
* You have one value you want to match against, so 2 ranges.
* For the first range you would want all matches where `FromYear` goes *up to* your number.
* For the second range, you would want all matches where `ToYear` *starts at* your number and up.

In an example, the Buick has `FromYear` 2002 and `ToYear` 2007. Enter year 2003.

* `FromYear` should be \<= 2003.
* `ToYear` should be \>= 2003.

In LS ranges, targeting these fields: `range:FromYear="|2003" range:ToYear="2003|"`, or in the different syntax: `range-to:FromYear="2003" range-from:ToYear="2003"`.

Changing that to input fields you can use in your form, you'd probably need something like this:

```
<input type="hidden" name="range-to:FromYear" class="year-range">
<input type="hidden" name="range-from:ToYear" class="year-range">
<input type="text" id="year" placeholder="Year">

```

And then use JavaScript to change the values of the `year-range` hidden input fields on form submit, for example.
> 1 votes

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


# Question
Title: ExpressionEngine Wiki - Show categories in sidebar
Using the EE first party wiki application. I am trying to call all categories in the sidebar of the Wiki.

However the sidebar just prints out the tags. It seems you can only grab the categories in the categories template.

I am thinking that i am going to have to querie the DB directly to build the wiki menu system i want, but before i do has anybody else had any experience / thpoughts on this?

# Answer
> 1 votes
Having spoke to Expressionengine support they have confirmed that The category tag is only going to be parsed on a category type url.

So a custom plugin is the way to proceed with this, using the categories function in mod.wiki.php. as inspiration.

---
Tags: wiki
---


# Question
Title: Is there an EE addon for bulk status change from the entry edit screen?
I'm creating a site with a moderation process that requires all new entries in a certain channel to be saved in draft status, and then an admin or editors will approve those entries and update the status to open.

There could be tens or hundreds of entries to approve at a time. Even with the native batch editing feature you still have a click on the select box for each entry and change the status.

What I really need is something that would allow me to select each draft entry I want to publish and then use a bulk status change action to change them to "open" all at once.

Is there an existing extension that can do this?

# Answer
http://zenbustudio.com/software/zenbu should work for you, it has the ability to change statuses for batches of entries
> 5 votes

# Answer
If you don't want to spend money on an add-on just for this purpose, I found a bit of an inelegant solution.

I recently had to change the Status of hundreds of entries and used Ben Alman's bookmarklet tool to make things a little easier. It allowed me to run a small bit of jQuery on EE's Multi Entry Editor page and set each entry's Entry Status select dropdown to Closed:

* Enter a Bookmarklet name - "Set EE Status to Closed".
* Paste in jQuery code that will target all Entry Status select dropdowns:

```
$("table.mainTable select option[value='closed']").attr("selected","selected");
```
* Click the Generate button then drag the green bookmarklet button to your bookmark bar.
* On the EE Edit page I had to set the results dropdown to the max 150 results.
* Filter your entries however you need to then click the select all entries checkbox.
* Click Submit (obviously with 'Edit Selected' not 'Delete Selected') to access the Multi Entry Editor.
* Click your "Set EE Status to Closed" bookmarklet - all Entry Status dropdowns should be set to Closed
> 3 votes

---
Tags: status, bulk, batch-update, moderation
---


# Question
Title: Single sign-on solutions for ExpressionEngine in enterprise using LDAP / Active Directory
Can a single sign-on solution be used to share credentials between ExpressionEngine and LDAP/Active Directory?

# Answer
This LDAP extension looks like a good place to start \- the extension is older, but it looks like all the pieces are in place. You could build on this as needed.
> 0 votes

# Answer
It's relatively easy to roll your own SSO solution because signing a user into ExpressionEngine is fairly simple.

If you have the appropriate data, it's easy to create an ExpressionEngine user, create a relationship (I've typically done this using a new database table) and sign this user in based on the response from the API you're using.

I'm not familiar with the required effort when it comes to working with LDAP but if you dig into the ExpressionEngine member module source code you'll see how simple it is to sign a user in or instantiate a new user.
> 0 votes

---
Tags: ee2, authentication, single-sign-on
---


# Question
Title: Can I revoke or regenerate an expressionengine license number?
Long story short, client has not paid but I bought and registered with my account. Client has expressed they have no intention to ever pay for serial as agreed, I would like to use this for another client instead so I'm not out $300!

Can I regenerate the license number for this particular copy?

# Answer
> 4 votes
This is going to be opinion based answers and only EllisLab can give you the correct answer - so ideally you'd need to contact them to confirm.

But you can use a license number for a single site, so a duplicate use of that license would be officially a breach of license. But only the license holder/owner can state which is the valid licensed site - it shouldn't be a case of first use.

So if you were to ensure that any notes attached to your EllisLab account and license purchase referred to your new client's website, not the old one and you made it perfectly clear in a formal letter or email that their version of ExpressionEngine is illegal and not formally licensed with polite instructions as to how they should obtain a license.

If they were to try to contact EllisLab to transfer the \[now invalid\] license to their own account, EllisLab would confirm with the account holder (you) first, and you would be able to explain the situation and deny the transfer.

If you purchased the license with an account in their name, you're stuck!

# Answer
> 2 votes
It sounds like you purchased this license and own it under your account. If the client never paid you for this license then it is yours and you're free to do with it what you will.

Report the client to EllisLab if they truly are simply denying to pay for the license. Also, don't work for this client again in the future as it sounds like they're not very appreciative of the value of other peoples' work.

---
Tags: license, licensing
---


title: Stash snippets vs "native" snippets

text:
# Question
Title: Stash snippets vs "native" snippets
I consistently use a few Snippets for things like HTML HEAD boilerplate code, and I've long used the Snippet Sync add-on to give me easy file access to the snippet code.

Now that I'm consistently using Stash, I'm thinking about creating and managing Snippets wholly via Stash embeds and/or variables with `type="snippet"`.

Curious if anyone has already made this switch / if anyone is already handling all of their snippets via Stash?

Any potential downsides in working with Snippets wholly via Stash?

# Answer
I like to use Snippet Sync (http://devot-ee.com/add-ons/snippet-sync) on all of the sites that I work on and we do the same for the sites that we build at The Nerdery.

Using Snippet Sync allows us to save snippets as files which we've found to be much easier manage and it makes it possible to keep snippets under version control which is invaluable. It also gives us the ability to prefix our snippets which is great for code maintainability and readability. IE: snippet/global\_header maps to snippets/default\_site/global.group/header.html

I use Stash for template partials and caching and we've never really felt the need to do anything differently. I recommend that you check out that approach. It seems simpler and easy to manage in the long run.

I would love to hear any reasons for using Stash vs this approach.
> 1 votes

---
Tags: stash, snippets, snippet-sync
---


# Question
Title: Channel images find entry with no set image
I'm making a site for a client which has about two thousand news entries that were imported from a WordPress installation, each entry is using a channel images field. However some entries are missing an image that needs to be uploaded. Is it possible to somehow write a query that would list titles or entry ids of entries that are currently missing an image? It's a pain to go through them all by hand.

Normally it's not a problem to just list entry titles where a certain field is empty but channel images uses a separate table

# Answer
You could make an EE template with simple channel:entries loop and a conditional to see if the field is empty. If empty, print entry name, ID, whatever:

> {exp:channel:entries} {if thumbnail == ""} {title} {/if} {/exp:channel:entries}

In this example **thumbnail** is the name of the channel images field.
> 0 votes

# Answer
Assuming you are looking for entries where *no* images have been added to the Channel Images field...

All you would have to do is query exp\_channel\_data where field\_id\_X is empty (with field\_id\_X as the Channel Images field). Even though Channel Images data is in another table, there is a marker in exp\_channel\_data when the field is not empty.

This isn't tested with the very *latest* version of Channel Images, but for previous versions this works for me:

```
SELECT entry_id
FROM exp_channel_data
WHERE field_id_65 = ''
AND channel_id = '9'

```

Just update your `field_id` as appropriate for your Channel Images field and update the `channel_id` to match the channel of interest.
> 0 votes

---
Tags: query, channel-images
---


# Question
Title: What is the limit of Matrix? Getting redirected to 404 error on entry with large number of Matrix rows
The entry I'm having problems has a Matrix field with over 100 rows, on 8 columns of data (7 simple text fields, 1 dropdown with 2 options). When attempting to add just one more row and hitting the submit button, the server seems to be choking and coming up with a the default 404 page set for the website...no error messages or anything to tell what's actually going on. Checking the PHP error logs also shows nothing up.

I've attempted to up the 'memory\_limit' to 2048M and the 'max\_execution\_time' to 300, but neither of these makes any difference.

Running EE v2.5.5 and Matrix v2.5.10, there's are also another Matrix field, and Assets field and a WYGWAM field on this entry.

A strange thing is that I can update this entry on my local MAMP setup, but not the Production server.

# Answer
As you suspected, you're bumping into some resource or config setting limit, you just have to figure out which one. A common culprit (other than memory\_limit), is max\_input\_vars.
> 1 votes

---
Tags: matrix, assets, pixelandtonic, memory-limit
---


# Question
Title: how to do search between two dates from date and to date using low search in expressionengine
I'm not getting the expected results with low search range. Here is my search form

```
{exp:low_search:form collection="press_releases" required="keywords" result_page="/communications/result"}
<fieldset>
<label for="keywords">Keywords</label>
<input type="text" name="keywords" id="keywords" />
<input name="range-from:entry_date" value="2014-01-01">
<input name="range-to:entry_date" value="2014-01-24">
<button type="submit">Search</button>
</fieldset>
{/exp:low_search:form}

```

Search Result Code:

```
{exp:low_search:results status="not closed" query="{segment_3}" disable="member_data|category_fields"}
{if count ==  1}<ol>{/if}
<li><a href="{path='communications/view'}/{url_title}">{title}</a></li>
{if count == total_results}</ol>{/if}
{if no_results}No search results{/if}
{/exp:low_search:results}

```

How i can handle this with low search using range?

Thanks in advance.

# Answer
Currently, the Range filter only targets custom channel fields. If you want to target the entry\_date, you can use the native start\_on and stop\_before parameters. If you do, make sure the values are formatted as stated in the EE docs, so something like:

```
<input name="start_on" value="2014-01-01 00:00">
<input name="stop_before" value="2014-01-24 23:59">

```
> 1 votes

---
Tags: channel-entries, search, low-search, entries, date
---


title: NSM Better Meta database error

text:
# Question
Title: NSM Better Meta database error
I'm using NSM Better Meta 1.1.3 with EE 2.7.2 . I'm trying add entry specific meta data, however when I use the tag: {exp:nsm\_better\_meta:template url\_title="{segment\_3}"} I get the error below. It seems to the url\_title part that's causing the issue, any other nsm\_better\_tag works just fine.

Any ideas?

Thanks,

```
Error Number: 1054

Unknown column 'exp_channel_titles.dst_enabled' in 'field list'

SELECT exp_members.screen_name   as e_author, exp_channel_titles.entry_id    as e_entry_id, exp_channel_titles.channel_id    as e_channel_id, exp_channel_titles.site_id     as e_site_id, exp_channel_titles.title  as e_title, exp_channel_titles.url_title    as e_url_title, exp_channel_titles.entry_date   as e_date_created, exp_channel_titles.edit_date     as e_date_modified, exp_channel_titles.expiration_date  as e_date_valid, exp_channel_titles.author_id   as e_author_id, exp_channel_titles.day  as e_day, exp_channel_titles.month  as e_month, exp_channel_titles.year     as e_year, exp_channel_titles.dst_enabled   as e_dst_enabled, exp_nsm_better_meta.language_id   as e_language, exp_nsm_better_meta.title    as meta_title, exp_nsm_better_meta.description  as meta_description, exp_nsm_better_meta.keywords   as meta_keywords, exp_nsm_better_meta.keywords_append_default   as meta_keywords_append_default, exp_nsm_better_meta.publisher  as meta_publisher, exp_nsm_better_meta.author   as meta_author, exp_nsm_better_meta.rights  as meta_rights, exp_nsm_better_meta.canonical_url   as meta_canonical_url, exp_nsm_better_meta.robots_index     as meta_robots_index, exp_nsm_better_meta.robots_follow     as meta_robots_follow, exp_nsm_better_meta.robots_archive   as meta_robots_archive, exp_nsm_better_meta.sitemap_include     as meta_sitemap_include, exp_nsm_better_meta.sitemap_change_frequency  as meta_sitemap_change_frequency, exp_nsm_better_meta.sitemap_priority   as meta_sitemap_priority, exp_nsm_better_meta.geo_region    as meta_geo_region, exp_nsm_better_meta.geo_placename   as meta_geo_placename, exp_nsm_better_meta.geo_latitude     as meta_geo_latitude, exp_nsm_better_meta.geo_longitude     as meta_geo_longitude FROM exp_channel_titles INNER JOIN exp_members ON exp_channel_titles.author_id = exp_members.member_id LEFT JOIN exp_nsm_better_meta ON exp_channel_titles.entry_id = exp_nsm_better_meta.entry_id WHERE (exp_channel_titles.url_title = 'about_us' AND exp_channel_titles.site_id = '1') AND ( exp_nsm_better_meta.language_id = 0 OR exp_nsm_better_meta.entry_default = 1 OR # NULL for entries that have no meta exp_nsm_better_meta.language_id IS NULL ) ORDER BY exp_nsm_better_meta.language_id DESC LIMIT 1

Filename: third_party/nsm_better_meta/mod.nsm_better_meta.php

Line Number: 205

```

# Answer
> 2 votes
You'll definitely need to upgrade to NSM Better Meta 1.1.5a \- the release notes mention EE 2.6 compatibility, which likely includes accounting for the database changes which it brought (specifically, the removal of the `dst_enabled` column).

---
Tags: meta, metadata
---


# Question
Title: How do I redirect from a User Message Template
I am trying to figure out how to redirect users once they click on the Mailing List confirmation email link.

Currently, when someone submits their email for inclusion in a mailing list, they get an email that they must respond to by clicking on the link to activate their subscription. Unfortunately this results in a generic EE confirmation page:

Is there any way to redirect them from here to another page on the site? If so how?

# Answer
> 1 votes
I appreciate the input above, but after additional research found the handy extension from Brian Litzinger: Custom System Messages which completely resolved the issue for me.

# Answer
> 0 votes
It would be better to apply some JavaScript to redirect user to another page.

Go to CP -\> Design -\> Message Pages -\> User Messages

```
var delay = 500;
setTimeout(function(){ window.location = URL; }, delay);

```

But note, it would be effected for all the user messages. Although, you can check referrer URL with `document.referrer`

# Answer
> 0 votes
The older 3.X version of Solspace Freeform allowed you to add email addresses of submitted forms to any EE mailing list of your choice. You could replace your existing mailing list signup form with a Freeform form to add users to the list. Then you can use Freeform's "return" param to decide exactly where they go after sign up.

---
Tags: forms, redirects, subscriptions, mailinglist
---


title: I added a comma, and the site went down

text:
# Question
Title: I added a comma, and the site went down
I added a comma, and my site went down. I was only recently granted an admin account, and am wondering if this could be related to my log-in permissions?

# Answer
Jesus Christ, never EVER enter a comma in EE. I bet you brought down gmail yesterday too.
> 11 votes

# Answer
I did that once. I almost got my birthday taken away because of it. If you must add a comma, make sure you spell it out. In Pig Latin.

Ommacay

But make sure you don't have the Pig Latin add-on installed or EE will totally figure out your game and mess you up.
> 2 votes

# Answer
You must be surfing the interwebs on Internet Explorer. It's a well known bug in IE that hammers IE users all of the time. Bill Gates is said to have personally taken up fight on excess comma's. Maybe these tips can help
> 2 votes

---
Tags: error
---


# Question
Title: Unable to force user to input password after editing profile (Solspace User)
I am using Solspace User.

Unable to force user to input current password after modifying their profile.

Using this parameter `password_required="y"` or `password_required="yes"` takes no effect. It is not redirecting me to error page or prompting any error message

I am not logged in as Super Admin

```
{exp:user:edit
    group_id="5|6"
    member_id="{segment_3}"
    password_required="yes"
    required="formal_title|first_name|last_name"
    return="teachers/edit_profile/{segment_3}/success"
            error_page="teachers/error"
}

    <input type="text" name="username" value="{username}" placeholder="Email address"/>
    <br>

    <select name="formal_title">
        {select_formal_title}
            <option value="{value}" {selected}>{value}</option>
        {/select_formal_title}
    </select>
    <br>

    <input type="text" name="first_name" value="{first_name}" placeholder="First name"/>
    <br>

    <input type="text" name="last_name" value="{last_name}" placeholder="Last name"/>
    <br>

    <input type="password" name="current_password" placeholder="Current Password" />
    <br>

    <input type="submit" value="Submit" />

{/exp:user:edit}

```

Any ideas? Appreciate for help

Thanks

# Answer
From the Solspace documentation about the `current_password` form field:

> This form field is available and required in certain instances where the current password is required to update or change certain profile data:
>
> * `password` & `password_confirm` fields are modified (unless the submitter is a Super Admin or in one of the authorized member groups specified in the group\_id parameter).
> * `email` field is modified.
> * `username` field is modified.
> * `screen_name` field is modified, unless screen\_name\_password\_required parameter is specified with value of no.
> * `password_required` parameter is specified with value of yes.

Note that `current_password` isn't affected by editing a custom member field.

Also, `current_password` also isn't necessary if you're logged in as a member whose member group has administrative powers, which is controlled by the `group_id=""` parameter. If you remove your group\_id from the `group_id=""` parameter in your code above, `current_password` becomes required if you modify any of the above fields mentioned in the documentation.
> 1 votes

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


# Question
Title: Searching field types set to VMG Chosen Member in the Control Panel
I'm using VMG Chosen Member as a Field Type so administrators can easily add Members of a custom Member Group 'Customers' to different Channel Entries.

This is fine, but when in the Control Panel I cannot search or filter on this Field Type. I have set the VMG Chosen Member (Customer) to be searchable but this doesn't make a difference.

This is a major issue for my client, as they will need to be able to search and filter entries in the CP by 'Customer'.

Does anyone know if this is an actual issue or something else I could do to get around it?

# Answer
> 1 votes
I believe this is because of how VMG Chosen Member stores the member data in the exp\_channel\_data table, not in a full text format. Unfortunately this isn't an issue with the add-on, it's just how it works.

What you may be able to do is use the Zenbu addon, which overrides the Edit screen. You could then build a custom extension that searches the correct field from the exp\_members table, rather than the default exp\_channel\_data field.

If you haven't worked with extensions before, this wouldn't quite be trivial to do, but it's the only option I can think of.

---
Tags: control-panel, vmg-chosen-member
---


# Question
Title: How do I get all 'relatives' of a Playa entry?
I have Playa field in a channel that is related to the same channel. So each entry in that channel can be related to another one in that channel. The problem is that to show all related entries for each entry, you have to check for children, parents, coparents and siblings and then filter out all duplicates...

Is there an easier way to achieve this?

Thanks

# Answer
My recommendation would be to simply skip over using playa to begin with. I fought and fought with it too at a point.

Now I just do this: https://expressionengine.stackexchange.com/a/18229/1872

Hope it helps you.
> 1 votes

---
Tags: playa
---


# Question
Title: Cart being dropped when adding multiple packages
When I try to add multiple packages, any where from about 6-10, the cart will clear itself. I'm wondering if this has to do with the extra processing a package has to go through since the package information is saved as an array and then serialized? Is it just overloading the server causing it to drop the cart?

# Answer
> 0 votes
one of the support engineers has taken a look at this but cannot replicate your issue with our test install.

If you have not already, can you update Cartthrob to the latest version and if you still have the issue, please schedule a support call at http://support.mightybigrobot.com

Thanks!

---
Tags: cartthrob
---


# Question
Title: Cart throb: One product simply order one product with multiple colors in numerous quantities
Cart throb: I want to have the ability in CT to have a single product and say order 10 black, 20 green adn 5 yellow all with a single add to cart click

RIght now I have to add each color individually.

# Answer
> 2 votes
You'll need to use the multi\_add\_to\_cart\_form. Assuming that the price modifier for your colors is called "product\_color" your form would look something like this:

```
{exp:channel:entries channel="products"}
    {exp:cartthrob:multi_add_to_cart_form return="TEMPLATE_GROUP/TEMPLATE"}
           Product name: {title} Price: {product_price}<br />
           {product_color}
               {option_name}: <input type="text" name="quantity[{count}]" value="0" /><br />
               <input type="hidden" name="entry_id[{count}]" value="{entry_id}" />
               <input type="hidden" name="item_options[{count}][product_color]" value="{option_value}" />
           {/product_color}
           <p><input type="submit" value="Add to Cart"></p>
    {/exp:cartthrob:multi_add_to_cart_form}
{/exp:channel:entries}

```

That will give you a form with your color options printed out with corresponding quantity fields.

---
Tags: cartthrob, ecommerce, shopping-cart
---


title: Simple Commere Email send issues

text:
# Question
Title: Simple Commere Email send issues
Last week I set up a simple commerce section for a client which included two email templates: one to the buyer and one to the seller. In my testing the buyer notice arrived but when other users tested the purchase the notice never came through.

Here is the text of the email:

> Dear {first\_name} {last\_name},
>
> Thank you for your purchase.
>
> You can download the video: http://www.sitename.com/store/success.
>
> Sincerely,
>
> Client Name

Is there anything that would be preventing the emails from getting through to the buyer?

Thanks.

# Answer
I found the answer to my question in the Expression Engine documentation - basement level:

> While you can still use Simple Commerce generated PayPal links to sell items to users browsing your site as guests, the Instant Payment Notification features, such as transaction recording and **email notifications**, will only work for purchases made by logged-in members of your site.

So the system is not broken, it just has limitations.

Thanks.
> 1 votes

---
Tags: email, notification, simple-commerce
---


# Question
Title: Advanced conditional in Category_Archive Channel to show "active" entry (using Structure)
I have wrapped this in a Snippet to advance the parsing order, but I cannot seem to get this to work...hence the {?}.

```
<ul class="accordion">

{exp:channel:category_archive channel="hurricane" style="linear" dynamic="on" }

           {categories}
        {if segment_3 == '{?}'}<li class="active"> {if:else} <li class="">{/if}
          <div class="title">
            <h5>{category_name}</h5>
          </div>{/categories}
          <div class="content">
           {entry_titles}
           <a href="{path='members/hurricane/'}">{title}</a><br />
           {/entry_titles}
          </div>

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

```

# Answer
> 1 votes
Your layout may have to change because EE doesn't yet know if the title is inside the category. If you can transfer the conditional inside the entry\_titles you may have better luck.

```
{entry_titles}
{if segment_x == {url_title}}do something{/if}
{/entry_titles}

```

EE category stuff can be a pita and I've often used gwCode categories. You do get more flexibility and control but its a case by case thing.

# Answer
> 0 votes
What happens when you use:

```
segment_3 == {category_URL_title}

```

Assuming you're looking to see if current category is in the URL.

I try and avoid if:else and simply use 2 simples instead or switchee.

---
Tags: structure, categories, advanced-conditionals
---


title: Pagination links not working

text:
# Question
Title: Pagination links not working
I have deployed pagination to one of templates which should to display only 4 products on a page. Index for that template looks like:

```
{embed="includes/.header-product" body_color="#FFFFFF"}

        {if segment_3}{embed="includes/.nav-main"}{product}{/if}
        {if segment_2 && segment_3==""}{embed="includes/.nav-main-subcategory"}{subcategory}{/if}
        {if segment_1 && segment_2==""}{embed="includes/.nav-main"}{category}{/if}

{embed="includes/.footer"}

```

Switchee version of code above:

```
{embed="includes/.header-product" body_color="#FFFFFF"}

    {!-- Category view --}
    {if segment_1 && segment_2==""}{embed="includes/.nav-main"}{category}
        {!-- /Category view --}
    {if:else}

        {exp:switchee variable="{segment_3}" parse="inward"}

        {case value="#^P(\d+)$#|''"}
                {embed="includes/.nav-main-subcategory"}{embed="furniture/.subcategory"}
        {/case}

        {!-- Subcategory view --}
            {case value=""}
                {embed="includes/.nav-main-subcategory"}{embed="furniture/.subcategory"}
            {/case}
            {!-- /Subcategory view --}

            {!-- Single product view --}
            {case default="Yes"}
                {embed="includes/.nav-main"}{product}
            {/case}
            {!-- /Single product view --}

        {/exp:switchee}
    {/if}

{embed="includes/.footer"}

```

and subcategory snippet code looks like:

```
<div class="container category">

    <div class="row row-category">

    {exp:channel:entries channel="products" category="{segment_2_category_id}" orderby="title" sort="asc" limit="4" paginate="bottom" dynamic="no"}

        {if no_results}
                <div class=""><p>No entries yet.</p></div>
            {/if}

            <div class="col-md-3 col-sm-6 category-item">
                <a href="{site_url}{segment_1}/{segment_2}/{url_title}">
        {product_image limit="1"}
                <img src="{product_image:image}" alt="{product_image:title}" class="img-responsive">
        {/product_image}
                <h3>{title}</h3>
                </a>
            </div>

    {switch='|||</div><div class="row row-category">'}

    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}

    {/exp:channel:entries}

   </div><!--/row-->

</div><!--/container-->

```

First page is OK but other pages comes blank. I think I have done something wrong within index or template structure for furniture group but no clue what can be wrong.

Thanks

# Answer
It seems likely that the conditional that you're using to insert your "subcategory" is getting tripped up by the presence of the segments that pagination would automatically create - segment 3 for example might be blank on your index view, but once you paginate, it's likely occupied, and as such, the terms of your condition can't be met and therefore your listing embed isn't being inserted at all. You may have an easier time with it if you use the excellent switchee add-on which could parse your conditionals earlier using switch case and allow you to detect pagination segments using regex (see the example on the devot-ee page for details).

And to Derek's point - if you don't need an embed - which you would only need if you have a need to either pass a variable (which you're not doing, based on your code), or work around native parse order - you likely could do the same thing with snippets instead and save on performance.
> 1 votes

---
Tags: pagination
---


# Question
Title: Manually arrange product placement in cartthrob
I am wondering if there is a way to make certain items appear first within a category, regardless of default item order?

I would like particular items, buried within several pages because item order defaults to alphabetical, to appear first. Is this possible?

# Answer
You could use the in-built 'sticky' option for an entry. All your sticky entries will appear first, regardless of your other orderby parameter values.

More information on the EE docs: http://ellislab.com/expressionengine/user-guide/cp/content/publish.html#make-entry-sticky
> 1 votes

---
Tags: sort, product
---


# Question
Title: Outputting select field with order_custom fields in Expresso Store
I have a custom field called "newsletter", I've mapped this to order\_custom2 from within the store settings and used the following code:

```
  <div class="control-group {if error:order_custom2}error{/if}">
    <label class="control-label" for="order_custom2">Newsletter</label>
    <div class="controls">
      {field:order_custom2} {error:order_custom2}
    </div>
  </div>

```

However it's outputting the field as a input text box rather than a select box (it was set as a select box in the member preferences) and I can't work out how to change it from a text field to a select box, any ideas?

# Answer
> 3 votes
The shortcut tags provide a quick and easy way to add the field to the page but by default this will output as an input field. You do however have full control over the HTML elements and an output any form component you wish to use by simply ensuring the `name` attribute matches the name of the field. For example:

```
<div class="control-group {if error:order_custom2}error{/if}">
  <label class="control-label" for="order_custom2">Newsletter</label>
  <div class="controls">
    <select name="order_custom2" id="order_custom2" >
      <option value="yes">Subscribe</option>
      <option value="no">Don't Subscribe</option>
    </select>
    {error:order_custom2}
  </div>
</div>

```

Will output a select box with whatever options you wish to provide. The `name` attribute ensures the selected value will be saved to `order_custom2`.

---
Tags: expresso-store, members, custom-fields
---


title: Channel Form (Safecracker) title query

text:
# Question
Title: Channel Form (Safecracker) title query
I'm using Channel Form (formerly Safecracker) to generate a new entry using inline error handling.

The issue I'm having is if there is a reserved (HTML) character in any of the fields - eg `'` \- these are returned as html characters/entities - eg `&#39`;

For example:

Is there any way to suppress this conversion during the form submission process?

Cole

# Answer
Set the fields to type = none in the CP. I think by default they're XHTML.
> 2 votes

---
Tags: safecracker
---


# Question
Title: Solspace Freeform: return to anchor in page when having inline errors
I have a contact form set up with Freeform and when having inline errors, I would like to return to an anchor on the page, since my form is on the bottom of the page.

I tried setting inline\_error\_return="#contact-form", but it doesn't even add the hash to the url.

Hope someone can help me out.

# Answer
I think inline\_error\_return is the way to go, but maybe you need a complete url there, not just the anchor. In a recent site I did, I have inline\_error\_return="{page\_url}/#job-apply-form" which works.
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Plugin to format url_segment as a decimal
Need to take the final url segment which is in the form of **group/index/1030** and format it to be **10.30** to signify a time.

Anyone know of a plugin? The only ones I've found format it as a price and assume it to be 1,030 or suchlike.

# Answer
> 3 votes
ExpressionEngine have a variable {last\_segment} to get the last segment of URL. You can use any Math plugin like "Simple Math" (http://devot-ee.com/add-ons/simple-math) and divide that last segment by 100.

```
{exp:simple_math calculate="{last_segment} / 100"}

```

Also, try by using PHPStringFun (http://engaging.net/products/phpstringfun) to format the number.

---
Tags: segments
---


# Question
Title: Solspace Freeform: cannot send email notification to multiple dynamic emails
I just want to confirm that, if I have a form with two email fields (email and email2) and am using the user\_email\_field. An email can only be sent to one user (email).

I have a form with the following fields:

name1 email name2 email2

If both names and emails are filled in, I would like both email addresses to receive confirmation emails. I don't believe this is possible without using php. Though I'm hoping I am wrong and that using Freeform parameters this is possible. Any chance?

Thanks

Peter T

# Answer
Check out the docs for recipients.

http://www.solspace.com/docs/freeform/form/#recipient\_user\_input
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: how to redirect back 2 pages after add to cart in Cart Throb
I am trying to redirect a user back 2 pages after they add an item to the cart.

Is there any plugins or dynamic methods that would make this work?

# Answer
> 2 votes
check out this add-on http://devot-ee.com/add-ons/mo-variables and it's "Page Tracker" variables that you can use!

---
Tags: cartthrob, redirects, redirection
---


# Question
Title: Playa Coparents: Getting just the matrix row I want
This is what I want to do: Show data just from a Matrix row whose Playa column is the child that 2 channels (coparents) share.

I have 3 channels: Sizes, Colors, and Price Groups. Sizes has a playa field "cf\_price\_group\_playa" which references Price Group, and Colors has a Matrix field, cf\_size\_price, with a playa column, that references the channel Price Group as well. I want to pull *only* the price for this size in the price group that the color I'm currently looking at is in; if I don't search explicitly on that playa column, I get all the matrix rows:

```
{exp:channel:entries channel="colors"}
    {exp:playa:coparents channel="sizes"  field="cf_price_group_playa"}
        {cf_size_price search:price_group="THE_SHARED_PRICE_GROUP"}
        {price}
        {/cf_size_price}
    {/exp:playa:coparents}
{/exp:channel:entries}

```

I'm clearly doing something wrong and am tripping myself up figuring it out. It seems so clear, the relationship among these channels, but I'm not getting the front-end bit right. I appreciate insight from the Playa gurus here!

# Answer
got it! it's all in the var\_prefix'ing, on both the playa field AND the playa parents field:

```
{exp:channel:entries channel="colors"}
    {cf_color_price_group_playa var_prefix="group"}
        {exp:playa:parents channel="sizes" entry_id="{group:entry_id}" var_prefix="size"}
         {size:cf_size_price search:price_group="{group:entry_id}"}{size:price}{/size:cf_size_price}
        {/exp:playa:parents}
    {/cf_color_price_group_playa}
{/exp:channel:entries}

```

this post helped immensely, thanks rob + jason, Playa Parents entry\_id using child ids
> 0 votes

---
Tags: matrix, playa
---


# Question
Title: Using P&T Assets with Multi Site Manager (MSM)
I have Assets set up for Site #1. I've added Site #2, and I would like it, and Site #3, etc., to share the same Assets folders.

I've read through the Assets documentation, but cannot find any reference to Multi Site Manager.

What's the best way to accomplish this?

I'm happy to add settings in config.php.

# Answer
As far as I can tell, it can't be done. See my comment above for alternate solution.
> 0 votes

---
Tags: assets, file-uploads, multi-site-manager
---


# Question
Title: Profile:edit - exp:profile:reset_password - form redirects to index.php
When using the latest release of Profile:edit (Mighty Big Robot module) I get redirected to the homepage when any template contains the reset pass form:

```
{exp:profile:reset_password return="profile/reset_confirmed"}
        <fieldset>
            <label>New Password</label>
            <input type="password" name="password" value="">
            <label>New Password Confirm</label>
            <input type="password" name="password_confirm" value="">
            <input type="submit" value="Submit">
        </fieldset>
    {/exp:profile:reset_password}

```

I've tested as member/admin and under clean cache/cookie situation but I can't get the loop to complete - always redirects (the URLs are definitely correct).

Anyone there from Mighty Big Robot to help? Or another developer who's seen similar?

EE v2.7.3

Ta.

# Answer
I've been working on a EE 2.7.0 site that uses the latest Profile:edit and has this password reset form, and I've **never** seen the issue you're describing.

If this were happening on just one page, I'd say that it sounds like maybe you have EE access restrictions set on your Reset Password page, with the restriction's "unauthorized" redirect pointing to the site homepage. Have you checked for this in the EE Template Manager?

If it's happening on multiple pages, and on pages with no EE access restrictions, then I don't know what's up -- again, I've never seen this issue.

*updated: added the EE version.*
> 1 votes

---
Tags: profile-edit, forgot-password, mightybigrobot
---


# Question
Title: Possible to update stock via template tags in frontend?
Here's the scenario: There's a store that has both a physical department and a web shop (expresso store). The thing is they both share the same inventory. So when someone buys something in the physical store, the inventory in the web shop doesn't match up anymore.

What I want is to make a frontend interface that lists all products, and have the ability to update the stock by either increasing or decreasing it without having to log into the backend. The reasoning being that it's much more cumbersome to do in the backend, and you have to find the product, open it to edit the stock, then save it.

If it could be done in the frontend, the stock adjustment could be done on the same page as the listing of the products.

Is there any way to accomplish this?

# Answer
> 1 votes
Managed to solve this problem with exp:channel:form

Edit

Jeremy: ah yes, sorry, my bad.

Here's what I did.

1) First I used {exp:store:product} to get the product data as per usual

2) Then, I used {exp:channel:form} to access the fields I wanted to edit (i simply inspected the fields in question from within the control panel, and matched the name="" attribute of the fields I wanted to edit. The whole thing looks like this.

```
    {exp:channel:entries
     channel="produkt"
     category="{cat_id}""
     status="promotert|open"
    }
     {exp:store:product entry_id="{entry_id}"}
      {exp:channel:form
       channel="produkt"
       entry_id="{entry_id}"
       return="varelager"
      }

      <!-- Name of product -->
      <input type="text" name="title" id="title" value="{title}">

      <!-- Stock qty -->
      <input type="number" name="store_product_field[stock][0][stock_level]" id="stock" value="{total_stock}" pattern="[0-9]*">

      <input type="submit" value="Save changes">
    {/exp:channel:form}
  {/exp:store:product}
 {/exp:channel:entries}

```

# Answer
> 1 votes
Another option rather than specifying the individual html fields is simply to output the whole Store Product Details field.

Assuming your custom field is named `product_details`, it would look like this:

```
{exp:channel:form channel="products" entry_id="{segment_3}"}

    {field:product_details}

{/exp:channel:form}

```

---
Tags: expresso-store
---


# Question
Title: Retrieve an exp-resso store value from a Store field within an EE relationship
I am not sure what I am doing wrong, but with the following code I am having issues in pulling the 'price' information. see tags towards the end of the code: £{price}

At the moment all the correct images and

### {related\_products:product\_manufacturer}

{related\_products:short\_description} are showing correctly. However the price pulls out the same price for each item, when it should show the correct price for each item, not the same price!

The 'Price' tag is pulled from exp-resso store. And I think this is where the issue is. Could any one help?

Thank you kindly in advance.

The code I'm using below:

```
<section class="related"> <!-- start section -->
    <div class="container"> <!-- start .wrap -->
        <h3 class="upper">You may also like</h3>
        <div class="row">
            <ul class="list-unstyled">
                {exp:channel:entries channel="store" status="open|featured" limit="3"}
                    {related_products}
                        {exp:store:product entry_id="{entry_id}"}
                            <li class="col-md-4 product"> <!-- start .span4 -->
                                <a href="{path="store/detail"}/{related_products:url_title}">
                                    {exp:channel_images:images entry_id="{related_products:entry_id}" field="product_image_one"}
                                        <img src="{image:url}" title="{related_products:title}" alt="{related_products:title}" />
                                    {/exp:channel_images:images}
                                    <div class="overlay"> <!-- start overlay -->
                                        <h3>{related_products:product_manufacturer}</h3>
                                        <h4>{related_products:short_description}</h4>
                                        <p class="price">£{price}</p>
                                    </div>
                        {/exp:store:product}
                                </a>
                            </li>
                    {/related_products}
                {/exp:channel:entries}
            </ul>
        </div>
    </div>
</section>

```

# Answer
> 2 votes
You're using entry\_id in the store tag and not the related entry\_id. Try this:

{exp:store:product entry\_id="{related\_products:entry\_id}"}

---
Tags: expresso-store, relationships
---


# Question
Title: Is there a tag that generates the password reset form?
I see that in Member Management Module, there is a Login Form Tag that allows you to place a login form in any template you choose.

Is there a similar tag for the password reset form?

# Answer
> 2 votes
Take a look at Authenticate, it's my add-on that makes forgot password forms and login forms much better. https://objectivehtml.com/authenticate/examples#forgot

There are other add-ons too like FreeMember, but have never personally used it. http://devot-ee.com/add-ons/freemember

# Answer
> 4 votes
You can actually copy the rendered code from the password reset form to recreate it in any template.

```
<div id="content">
<form id="forgot_password_form" method="post" action="http://www.mydomain.org/"  >
<div class='hiddenFields'>
<input type="hidden" name="XID" value="3a451c89545c8d3044192ebd6aeb00c5114d2e04" />
<input type="hidden" name="ACT" value="11" />
<input type="hidden" name="RET" value="-3" />
<input type="hidden" name="FROM" value="" />
<input type="hidden" name="site_id" value="1" />
</div>

<table class="tableborder" cellpadding="0" cellspacing="0" border="0" style="width:560px;" align="center">
<tr>
<td class="profileHeadingBG" colspan="2"><div class="tableHeading">Forgotten Password</div>
</td>

</tr><tr>

<td class="tableCellOne" colspan="2">

<h3>Your Email Address</h3>

<p><input type="text" name="email" value="" class="input" maxlength="120" size="40" style="width:100%" autocomplete='off' /></p>

<p><input type="submit" value="Submit" class="submit" /></p>

<p><br /><a href="http://www.mydomain.org/subscriber/login">Back to Login</a>

</td>
</tr>
</table>

</form>
</div>

```

Is the relevant portion of the code, though you probably want to at least explore the styles in the original, as well. I believe this is one of the forms, where though an XID is generated, but the security risk isn't that high if it stays they same.

If you're very security minded, then you can use a number of add-ons to get more control, and they'll make sure a new XID is generated every time the form is called. You could also create a php script that generates an XID.

I've used Solspace's User, Authenticate, and Zoo Visitors to handle the creation of registration, login and password forms before. But I recall that in the first project that I had that actually required a custom members area (most of the sites we develop don't), we tested the password rest form and decided the code grab-able.

It's been awhile, but I think we looked to see if the XID was being used to identify the user, but for the site, the front end only used cookies and since the user hadn't logged no session was in play and the other security risks were minimal. Granted, I don't recall, what the other security risk were now. That was +5 years ago, I believe. Right before add-ons customizing the member templates started to show up.

**Update.** Remember to copy the code from your solution. I do believe whatever you use for the XID needs to match your system, but I could be wrong.

**EDIT By Anna Brown**
You can use **{xid\_hash}** to generate a unique hash per page load.

# Answer
> 2 votes
There is not a native tag for outputting the "forgot password" form into an EE template.

A "creative" option would be to strip down the native member template to bare minimum HTML and load the form into your template using jQuery.

**JS would look like this:**

```
<script>
     $('#result').load('/member/forgot_password');
</script>

```

**HTML would look like this:**

```
<div id=""></div>

```

The tag to access the native EE forgot password template is {path='member/forgot\_password'} OR replace "member" with the **member profile trigger word** you have set in your CP. Or just use "/member/forgot\_password".

# Answer
> 0 votes
Sorry it is late.

You dont really have to worry what are the tags since EE is really restricted with those pages

**Simply edit files in**

`themes/profile_themes/default/reset_password_form.html` `themes/profile_themes/default/html_header.html` (If you want it to look pretty)

I was in the same boat with you.

---
Tags: members, forgot-password
---


title: now() function redeclared

text:
# Question
Title: now() function redeclared
I am using a hybrid system that is an ExpressionEngine CMS, which is build with CodeIgniter, and Magento as a store "off to the side" and working together.

We cannot upgrade the existing installation because the contractor that initially built the system did some very weird stuff to the core code that keeps us from upgrading so I am looking to start fresh.

I installed Magento Community 1.8.1 alongside EE 2.7.2.

I wrote a plugin for EE that gets the cart info and the logged in user info but when using the plugin, I get the error:

```
Cannot redeclare now() (previously declared in \codeigniter\system\helpers\date_helper.php:40) in \store\app\code\core\Mage\Core\functions.php on line 123

```

How do I circumvent this without modifying core code on either system?

I also receive errors in other files because it is declared in them as well, such as \store\app\code\core\Mage\Admin\Resource\User.php; I get this one when attempting to login to the BO.

# Answer
> How do I circumvent this without modifying core code on either system?

My guess: you can't.

A `now()` function is being declared in CodeIgniter's Date helper (which is a core file), and in Magento's functions.php (which is also a core file, by the looks of the file path).

EE uses CI's Date helper in various places, so you can't avoid it...
> 1 votes

---
Tags: codeigniter, magento
---


title: Channel Form Dropdown question

text:
# Question
Title: Channel Form Dropdown question
I have a Channel with 4 custom fields which represent half hour timeslots (10-10.30, 10.30-11 etc) - the idea is that the field is populated with the logged in users name to marry them up for an appointment in the required slot. So far so good.

Each person can only choose ONE timeslot so when in an ChannelForm to add/edit/remove their name in the field I would like them to see a drop down where they can choose from the four timeslots (i.e. fields) and then submit (their name can be passed in a hidden field).

This is rather than have a Channel-Form template which actually shows the four fields...in effect it is forcing them to choose one and not allowing them to see the four empty fields...make sense?

Is it doable?

# Answer
> 2 votes
You can do this with JS - make select tag w/o name but with options to choose time (check using JS if custom field(hidden timeslot input) is empty or not. If not empty - add option to select list for this timeslot ). And dependent on what user choose - pre-fill hidden field. But risk of this methods - anybody who have knowledge about debugging page in browser can overwrite your exist data. If something happens with post data during submit - you also can lose your data. This is fundamental risks of method which you choosed.

From my point of view good way is to make 1 entry = 1 order (timeslots submit). You can keep data in specific field and look over this data to understand what timeslots is already booked. Base on information about exist order - dynamically make select list for time field.

For people who will works with data from site just need to make template where this data will display as part of one day.

I see other solutions, more protected, but it is most simple one.

---
Tags: channel-form
---


# Question
Title: Can I specify external upload locations in Assets with MSM via configuration file?
I am working on a ExpressionEngine site with a lot of preexisting content in many MSM sites. Due to the need to put upload files into Amazon's S3 storage service, I am migrating all of file fields and Wygwam content to Pixel & Tonic Assets. I am using Focus Lab's Master Config.

I have added to the master config file the configuration variable mentioned in Asset's documentation:

```
$env_config['assets_source_settings'] = array(

    1 => array(
    'access_key_id'     => $s3_key,
    'secret_access_key' => $s3_secret,
    'bucket'            => $s3_bucket,
    'url_prefix'        => $s3_prefix,
    'subfolder'         => '/files/images/general/',
    ),

    ...

);

```

However when I go to the external sources page for Assets in the control panel, I do not see any of the sources listed. I can successfully use the same credentials and values by manually adding them, but I would prefer to use the configuration file instead as there are 11 sites to replicate across and quite a few upload locations.

# Answer
You can't create sources this way - you can only edit change configuration for already existing sources. Your best bet would be to run an SQL query to insert the rows into exp\_assets\_sources table and then use the configuration file.
> 1 votes

---
Tags: assets, multi-site-manager, focus-lab-master-config
---