# Question
Title: Securing Form Submissions with FreeformPro
I'm trying to secure a form submission, but can't get it to work. I have SSL installed, I have the csrf\_protection enabled on my ExpressionEngine config file, and have secure\_action and secure\_return set to yes in my exp:free:composer tag. Not sure what else I'm supposed to do. If I go directly to the form page and add https://, it works. But when there's any other link to that page from my site, it goes to the non-secure version. My understanding is that the secure form would load if I added the secure\_action variable in the tag. Is this the wrong way?

# Answer
> 1 votes
`secure_action=""` and `secure_return=""` do not force, or redirect, the form's URL to be HTTPS. These parameters set the URL protocol for **after** the form is submitted.

The `secure_action=""` parameter will make your form's `action=""` attribute use **https**, eg: **https**://mysite.com/index.php?ACT=123

The `secure_return=""` parameter will return you to a URL using **https** after submitting the form. For example with `secure_action="yes"` and `return="contact/thank_you"`, Freeform will send you to **https**://mysite.com/contact/thank\_you after submitting the form.

The actual form page can be http or https, depending on the URL you visit. Freeform is not involved at that point. You would need to use .htaccess to force https pages on your site, or set up EE's config.php file to make all links https when you're visiting an https version of the site. For the config.php settings, this would still not prevent a user from visiting an http URL though.

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


# Question
Title: How to show related channel entries using Structure?
Okay first of all, many apologies for the title of this post. Having a bit of a brain drain today and couldn't really think of a better way of putting it.

Here goes though.

I am using Structure on a site running EE 2.6.1. I'd like to have a page which is called 'Winners'. That page is linked to a Channel which will store all the winners names and they will be displayed on that page.

So far so good and easy to do.

Next up I need to have each of those winners names clickable and to go to a new template which will be a blog type page which will show entries from another channel which are related to the winner.

So basically :

1 - A page which lists winners (all entries in a winners channel) 2 - Each name is clickable to another template 3 - When reaching this template a Channel tag is on the page (winners\_blog) 4 - The entries in this Channel (winners\_blog) have a relationship field to relate them to the winners. 5 - This template will then only show blog posts for that winner.

1 & 2 are done but I'm having a brain drain on how to now only show the blog posts related to the winner once on that page.

If anyone understands what I'm on about here and can lend a quick hand then that would be greatly appreciated.

Thanks.

Best wishes,

Mark

# Answer
I think one approach here would be as follows:

1) create a blog template e.g. blog/winner

2) this template will expect either the winner id or url\_title field in segment 3 (your preference)

3) this template then does a channel entries tag limit 1 on the winners channel. You may need to set dynamic="no" and then set either the entry\_id or url\_title parameter to {segment\_3} as appropriate

4) within the channel entries tag then use the parents tag to list out the relevant blog entries e.g. {parents field="blog\_winner"}. See https://ellislab.com/expressionengine/user-guide/add-ons/channel/relationships.html#accessing-parents

5) in your winners list template you won't use page\_url in your links. Instead you would use path=blog/winner/{entry\_id} or {url\_title} Although, depending on your set up you may be able to keep using the structure page\_url links as the winner links and then in whichever template ends up being used you would start at step 3.
> 0 votes

---
Tags: structure
---


# Question
Title: Is there a way to for categories to appear in search results
I am using the Low Search plugin to allow visitors to my site to search for content, however I require that categories appear in the search results as well as entries. Is this possible?

# Answer
**Low Search will always return *entries*.** The Results tag is built on the native channel:entries tag, so it can output anything it can, and then some. However, it will still always return unique **channel entries**.

If you want to display categories, you can, but only like you would using the channel:entries tag: using the `{categories}{/categories}` variable pair, which is always associated with an *entry*.

Outputting stand-alone categories as a single search result (as if you were using the channel:categories tag) is *not* possible.
> 2 votes

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


title: Insert a drop down inside Nolan

text:
# Question
Title: Insert a drop down inside Nolan
Nolan is working fine, but it is possible to insert a drop down inside a cell, as the Field Pack dropdown inside a Matrix cell?

# Answer
> 1 votes
NO this is not possible according to the documentation. If this is really important I would suggest contacting the developer to see if that could be added in. If it's possible you'd likely have to pay for the time to add the new functionality.

---
Tags: matrix, drop-down, nolan
---


# Question
Title: External links still display wrong after turned off the "Automatically turn URLs into links" feature
I have a custom URL member field - "Twitterhandle" that contains a link to the member's twitter page. I use the field on single entry template page, within the channel entries tag with the following html:

```
<a href= "{Twitterhandle}">
    <img src= "/images/blog/twitter%20teal.png" width= "24px" height="24px">
</a>

```

The goal is to have a clickable image. I have turned off "Automatically turn URLs and Email Addresses into Links" feature for the Channel, but the link still displays the full text of the url and then the image, not as a clickable image.

Any thoughts on why this is happening and how I can get the result I'm looking for?

# Answer
> 0 votes
There is nothing wrong with the code that you posted in your questions.

---
Tags: channel-entries, members, url
---


# Question
Title: Replacing backslash in content with Low Replace
I am currently using Low Replace to clean up content exported from EE to be used as a JSON object. This means cleaning up new lines, spaces, escaping quotes and backslashes. I am able to get the first three to work. However I cannot seem to find a way to escape a backslash.

I've even tried to map it as a replacement option in pi.low\_replace.php

```
private $_map = array(
        'SPACE'   => ' ',
        'QUOTE'   => '"',
        'NEWLINE' => "\n",
        'PIPE'    => '|',
        'BACKSLASH'    => "\\"
    );

```

No luck.

# Answer
> 1 votes
Figured it out...

```
'BACKSLASH'    => "\/"

```

Also found out I didn't need to modify the plugin.

```
{exp:low_replace multiple='yes' regex='yes' find='\/|QUOTE|NEWLINE|/\t/' replace='\|\QUOTE|SPACE'}

```

Works like a charm.

---
Tags: low-replace, regex
---


# Question
Title: Next/Previous Entry Linking works on some entries but not others
I setup the next/previous entry linking code in an embed because it is positioned within a channel entries tag in the template. Same template, some entries display the links fine, and others don't. Can't figure out why it works for some and not others.

Template debugging says: Channel Next/Prev Entry tag error: Could not resolve single entry page id. But i don't know why.

```
{exp:channel:entries channel="artists" disable="categories|member_data|category_fields|pagination" dynamic="yes"}
    {embed="artists/.next_prev"}
{/exp:channel:entries}

```

.next\_prev embed:

```
        {exp:channel:next_entry}
            <p>Next: <a href="{path='artists'}">{title}</a></p>
        {/exp:channel:next_entry}
        {exp:channel:prev_entry}
            <p>Previous: <a href="{path='artists'}">{title}</a></p>
        {/exp:channel:prev_entry}

```

# Answer
> 1 votes
Make sure to include the channel parameter into your next and prev entry tags.

I would also look into the url\_title parameter because you are embedding these. Just get the segment that has your entries url title

---
Tags: embeds, next-prev
---


# Question
Title: Exp-resso store email template translation
I'm using Exp:presso store on a webshop. This webshop has multiple languages which I did with Publisher.

Now I want to send the customer emails in their native language. Or at least, the language they also used on the website when they ordered something.

Now using publisher phrases in the order confirmation email is working fine, the email is send with translations. This only doesn't work for the Subject, there it will put the phrase in: `{phrase:email_subject}` =\> {phrase:email\_subject}

It also doesn't work for all other emails that are send. Probably because it doesn't know which language it should use.

Is there a way to do what I want? Send emails in the right language? Maybe with something like publisher? Or should I make a email template for each language? And how would I then trigger the right email template?

# Answer
Since Publisher doesn't technically have Store support or vise-versa you won't be able to use Publisher for your additional emails directly.

You could write an extension that would allow you to either set a custom order status for each language during checkout, which would allow you to assign an email template for their language to that order status. This will probably give you the most flexibility in the long term.

Alternatively you could set a order\_customX field during the checkout with the language code from Publisher. So in your checkout template you would want to have something along the lines of:

```
{exp:store:checkout}
 <input type="hidden" name="order_custom1" value="{publisher:current_language_code}">
 Other checkout fields
{/exp:store:checkout}

```

Then in your email template you could use conditionals to show specific content based upon the language value store in order\_customX

```
{if order_custom1 == "en"}
 Show content in English
{/if}

{if order_custom1 == "es"}
 Lets have some Spanish text here
{/if}

```

The only issue that you are going to have with this is that I don't think that the Subject field has full template parsing so I am not sure if you could use the conditionals to show the correct subject.

Having said that I would highly recommend that you goto Store's Feature Request page and vote for Multiple Language Support to be added to Store.
> 2 votes

---
Tags: expresso-store, multi-language
---


title: EE 2.9.0 || Template Routing

text:
# Question
Title: EE 2.9.0 || Template Routing
How would one use Template Routing to route this:

http://MYDOMAINNAME.COM/tournaments/public-schedule/archives/2014/10/

To a Structure template of my choosing? I have this currently set:

Which states:

GROUP: templates TEMPLATE: events

I want to route the Archives/year/month there then run a conditional that will display the low archive tag there. I know how to do this with CraftCMS, but EE's documentation really stinks regarding template routing and I can't find any good posts of this online either.

Thanks for the help community!

Cheers!

# Answer
> 2 votes
I wouldn't say the documentation stinks, there's an example near the top of the page under **Usage** close to what you want.

In your case, it looks like you probably want:

```
/tournaments/public-schedule/archives/{year:regex[(\d{4})]}/{month:regex[(\d{2})]}/

```

Then you will access your segment variables with `{segment:year}` and `{segment:month}`.

---
Tags: templates, low
---


title: Can you embed a Grid field?

text:
# Question
Title: Can you embed a Grid field?
I ran into a situation in which I need to pass a Grid field via embed. Is there a good way of doing this? I won’t know how many entries (rows) have been entered. I have set a max to five (5) and there are three (3) columns.

*Simplified Template Added*

In my primary template, I have a simple call to embed the footer like this:

```
{embed="Footer/index"}

```

That is just a router template.

Footer Router Template

```
{exp:channel:entries
    channel="footer"
    limit="1"
    disable='categories|member_data|pagination'
}

    {!-- FIND THE TEMPLATE CHOSEN --}
    {exp:query
        sql="SELECT template_name FROM exp_templates WHERE template_id = '{footer_layout}' "
    }
        {embed="Footer/{template_name}"
            banner="{banner_text}"
            news_head="{newsletter_subscription_header}"
            news_intro="{newsletter_lead_in_copy}"
            twitter_head="{twitter_feed_header}"
            contact_head="{contact_header}"
            posts_head="{recent_posts_header}"
            work_head="{recent_work_header}"
        }
    {/exp:query}

{/exp:channel:entries}

```

(This is where I would like to embed the Grid fields if possible to kep from deep nested templates)

In the entry template, I am using Better Pages to allow them to choose a layout. There is one layout that when chosen, allows them to add up to 4 columns of mini navigational elements. This is where the Grid fields come into play.

There are four fields that display for this page template selection. Each has the following 2 Grid fields:

The first is an options grid field {column\_1\_options}. 1 row 3 columns. Text 'Header', Dropdown 'Automatic' or 'Manual', and Dropdown 'Blog' or 'Portfolio' or 'Twitter'.

The second is a links grid field {column\_1\_links} for them to populate the navigational elements if they choose 'Manual' in the Dropdown above. It contains 0-5 Rows with 2 Text Input columns named 'Link' and 'Text'.

Currently I use stash lists to gather these like this:

```
{exp:channel:entries
    channel="footer"
    limit="1"
    disable="categories|member_data|pagination"
}
    {column_1_options}
        {exp:stash:col_1_head}{column_1_options:column_1_header}{/exp:stash:col_1_head}
        {exp:stash:col_1_method}{column_1_options:automatic_or_manual}{/exp:stash:col_1_method}
        {exp:stash:col_1_section}{column_1_options:section_for_automatic_links}{/exp:stash:col_1_section}
    {/column_1_options}
    {exp:stash:set_list name="column_1_links" parse_tags="yes"}
        {column_1_links}
            {stash:href}{column_1_links:link}{/stash:href}
            {stash:text}{column_1_links:text}{/stash:text}
        {/column_1_links}
    {/exp:stash:set_list}
{/exp:channel:entries}

```

This is in a stash template that I call in the header of my primary templates like this:

```
{!-- STASH SITE SETTINGS --}
    {stash:embed:partials:site_variables process="start" replace="yes" parse="yes"}
{!-- /STASH SITE SETTINGS --}

```

In my footer template for the one they choose (The one with these options), I display their choices by pulling out the stash variables like this:

```
            <div class="row">
                <div class="col-md-3">
                    <h5>{if "{exp:stash:get name='col_1_head'}" != ""}{exp:stash:get name='col_1_head'}{/if}</h5>
                    {if "{exp:stash:col_1_method}" == "Manual"}
                        <ul class="list icons list-unstyled">
                            {exp:stash:get_list name="column_1_links"}
                                <li><i class="icon icon-caret-right"></i> <a href="{href}">{text}</a></li>
                            {/exp:stash:get_list}
                        </ul>
                    {if:else}
                        {if "{exp:stash:get name='col_1_section'}" == "Blog"}
                            <ul class="list icons list-unstyled">
                                {exp:channel:entries
                                    channel="blog_post"
                                    limit="5"
                                }
                                    <li><i class="icon icon-caret-right"></i> <a title="{title}" href="{title_permalink='blog/entry'}">{exp:eehive_hacksaw words="5" append = "..." allow = "<b><a><p>"}{title}{/exp:eehive_hacksaw}</a></li>
                                {/exp:channel:entries}
                            </ul>
                        {/if}
                        {if "{exp:stash:get name='col_1_section'}" == "Portfolio"}
                            {exp:channel:entries
                                channel="portfolio_item"
                                limit="5"
                            }
                                <li><i class="icon icon-caret-right"></i> <a title="{title}" href="{title_permalink='portfolio/item'}">{exp:eehive_hacksaw words="5" append = "..." allow = "<b><a><p>"}{title}{/exp:eehive_hacksaw}</a></li>
                            {/exp:channel:entries}
                        {/if}
                        {if "{exp:stash:get name='col_1_section'}" == "Twitter"}
                            <div id="tweet" class="twitter" data-account-id="{exp:stash:get name='twitter-id'}">
                            <p>Please wait...</p>
                        {/if}
                    {/if}
                </div>
                ...
            </div>

```

I would just like to be able to better utilize core features when available. I am always wanting to expand my knowledge of how to better build and simplify sites. :)

# Answer
So the channel entries tag that outputs this lives somewhere other than where your navigation is built, I'm assuming. Without seeing your template I couldn't say for sure, but this sounds like a great case for using a template layout. If you update your question with a simplified version of your templates, I could provide a more specific example, but the documentation covers what you would need: the layout wrapper, and layout variables.
> 1 votes

---
Tags: ee2, grid, embeds
---


# Question
Title: MSM and Store Product Price isn't saving
I have a MSM install.

Whenever I save an entry for 25.00 it saves as 2500. The other issue is the price for Product Options changes to +5 instead of 5.00

Is this a settings configuration for store? It currently has 2 decimal places etc

Currently I have store installed on the subdomain store.domain.com and the channel is in the www.domain.com because I will need to share the channel info.

# Answer
> 1 votes
Just to explain why this happens.

This will occur if you have Store installed on one site in MSM and use the fieldtype in another Site. The fieldtype doesn't have any settings for that site and no configuration options like decimal points, etc exist. Store requires that it be installed on each installation of an MSM site.

# Answer
> 0 votes
As Brad mentioned you can not share the fields across sites.

If you need to share information across sites the easiest way to do that is to set up a new channel on the sub-domain with a playa/relationship field and a Store field so you can enter the product info on the sub-domain and then relate the entry to the product on the main site to pull in all of the other custom field data.

I would also recommend heading over to their feature request page and vote for making Store MSM aware.

---
Tags: expresso-store
---


# Question
Title: Conditional Examination of Dates within a Matrix Field
We are utilizing a Matrix field to list information by date (each day has it's own row - first column being "date". We want only today's row to be displayed (similar to a calendar). HOWEVER, if an entry containing matrix rows - all of which are outdated, then a note to display "outdated" should appear.

Channel Entry : Department Channel Field : Calendar (Matrix) Columns: Date | Information

For entries that contain an updated monthly calendar, we are correctly identifying and displaying the single row with today's information using this code:

```
{calendar}
    {if "{date format='%Y%m%d'}" == "{current_time format='%Y%m%d'}"}
        <information here>
    {if}
{/calendar}

```

BUT, we need it to be a conditional examination of the all of the matrix rows within the entry so that if none of the rows matches current\_time, then a notice of "outdated calendar" displays.

Here's the catch - when we have used conditionals like the following, we get repeated display of "outdated" for every row that does not match today.

```
{calendar}
    {if "{date format='%Y%m%d'}" == "{current_time format='%Y%m%d'}"}
        <information here>
    {if:elseif "{date format='%Y%m%d'}" != "{current_time format='%Y%m%d'}"}
        <"Your calendar is outdated">
    {/if}
{/calendar}

```

Thus this results in 30 rows of "Your calendar is outdated" - instead of just one.

We ONLY want one item displayed - either today's info (on a row that contains today's date) - OR outdated (if no rows match today's date)

Please help!

# Answer
You can search to see if there are any rows which have a current or future date, then proceed accordingly:

```
{if '{calendar:total_rows search:date=">={current_time}"}' > 0}
    Your calendar is outdated
{if:else}
    {calendar}
        {if "{date format='%Y%m%d'}" == "{current_time format='%Y%m%d'}"}
            <information here>
        {if}
    {/calendar}
{/if}

```
> 1 votes

---
Tags: matrix, conditionals, date
---


# Question
Title: Playa - get all entries where playa is empty
I have articles related to products (set up with Playa), and then some articles are not related to any product.

Is there a way to get all the articles where the Playa-field is empty?

# Answer
Since you need some help with a query, I wrote this. You will need to change the part where channel = 4, and enable php on input for this template. I think this might work for you.

EDIT: You can just use the not in the entry id parameter

```
<?php

    // First we get the entries that are a playa parent
    $dontIncludeArray = array();

    $dontIncludeQuery = ee()->db->select('parent_entry_id')
                        ->from('playa_relationships')
                        ->get();

    foreach ( $dontIncludeQuery->result_array() as $row )
    {

        $dontIncludeArray[] = $row['parent_entry_id'];

    }

    $dontInclude = implode('|' , $dontIncludeArray);
    ?>
 {exp:channel:entries channel="foo" entry_id="not <?php echo $dontInclude; ?>"}
        {title}<br>
    {/exp:channel:entries}

```
> 1 votes

---
Tags: playa
---


# Question
Title: Redirect from Member/Register is not working
In order to prevent unwanted member registration I have set up a redirect from the member/register page using the following code in the .htaccess file:

`Redirect 301 /member/register http://sitexyz.com/`

This should be working but it is not and returns the following url and still displays the registration page.

```
http://sitexyz.com/?/member/register

```

Am I missing something in the redirect?

# Answer
> 1 votes
Try using:

```
RewriteRule ^member/register$ http://sitexyz.com/ [R=301,NC,L]

```

and make sure to place it before any index.php rewrite rules in your root htaccess file.

---
Tags: members, htaccess, registration
---


# Question
Title: Expresso Store: shipping_same_as_billing issue since upgrade to 2.3.1
Since upgrading to 2.3.1 I've found that even if the customer unticks the 'shipping\_same\_as\_billing' box then on the next screen they are told that the Shipping address is the same as the billing address.

This worked fine up to this upgrade.

Thanks in advance for your help

Code on checkout 2.

```
<div class="control-group same-billing">
            <div class="controls">
                <label for="shipping_same_as_billing" class="checkbox">
                    {field:shipping_same_as_billing} Same as Billing Details
                </label>
            </div>
        </div>

```

Code on checkout 3

```
 <div class="control-group">
                    {if shipping_same_as_billing}
ALWAYS SHOWS AS TRUE!
                        <p><strong>Same as Billing Details</strong></p>
                    {if:else}
                        <div><strong>{shipping_name}</strong></div>
                        <div>{shipping_address1}</div>
                        <div>{shipping_address2}</div>
                        <div>{shipping_address3} </div>
                        <div>{shipping_postcode}</div>
                        <div>{shipping_region_name}</div>
                        <div>{shipping_country_name}</div>
                        <div>{shipping_phone}</div>
                    {/if}
                </div>

```

# Answer
Ok - found a fix for this.

This simple condition

```
 {if shipping_same_as_billing}
ALWAYS SHOWS AS TRUE!
                        <p><strong>Same as Billing Details</strong></p>
                    {if:else}

```

No longer works, but altering the condition to be more specific does.

```
{if shipping_same_as_billing == 1}
                        <p><strong>Same as Billing Details</strong></p>
                    {if:else}

```
> 4 votes

---
Tags: expresso-store, tags, checkout
---


# Question
Title: Invalid URI being generated by transcribe
We have a static page created in which we have a bunch of links. The editor is appending the site uri automatically so it generates the wrong link.

For example: We type

```
<a href="{exp:transcribe:uri path='/'}">...</a>

```

then save it. It changes it to

```
<a href="http://www.xyz.com/{exp:transcribe:uri path='/'}">...</a>

```

The above of course generates the wrong url:

```
http://www.xyz.com/http://www.xyz.com/pt-br/

```

I am almost certain that it is a config issue but I have no idea what it is. I have searched and have found nothing.

Any insight would be greatly appreciated.

# Answer
> 0 votes
hope this still helps.

Use the uri tag either like this

`<a href="{exp:transcribe:uri path='example'}">Example</a>`

or

`<a href="http://domain.tld/{transcribe:language_abbreviation}/{exp:transcribe:uri path='example' site_url='no'}">Example</a>`

You'll need to check that the slashes are correct but the general idea is there.

---
Tags: url, transcribe
---


# Question
Title: Transcribe randomly outputs completely wrong URI
I'm using Transcribe 1.6.1 and EE 2.8.1.

I'm getting a weird thing happening when using the `{exp:transcribe:uri}` tag to output different URLs.

In my footer I have the usual Sitemap | Terms | Disclaimer| Privacy | Contact links, but only Contact isn't working correctly. It outputs `M140o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr` instead of `/en/contact`

I've done some debugging on this one and I've found that the rest of the links output in the format of `http://domain.tld/en/path` but contact is outputting `/contact/` only. I looked into it further and discovered that even though `site_url='yes'` is supposed to be default param for this function but when parsing contact it is set as no. So I've gotten around this issue by explicitly setting `site_url='yes'` in my code.

I'm happy to have fixed the problem but this one is really bugging me why it's being so weird. Anyone have any ideas on this one?

Also, couldn't find any way to contact the developer on this one.

# Answer
Unfortunately the long random string is the result of a run time pseudo caching that the template system in ExpressionEngine uses. (If you google that string M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr you will find loads of live EE sites where this issue is present). That being said, the fix is very easy! This happens when the same tag is present on a given page multiple times. Usually one is inside a tag pair and the other isn't (so the pseudo caching doesn't get cleaned up). If you go to the tag where this is present and just add something like work="yes" (really just making it so the tag string is seen differentially by the template parser) it should do the trick. (please note, this should only be done on tags that display on the front end as that random string.)
> 2 votes

---
Tags: url, transcribe, path, site-url
---


# Question
Title: EE isn't parsing PHP code, even though it should be
I'm sending an Ajax request via jQuery to an EE template. This is the entire contents of the EE template:

```
{exp:channel:entries channel="tours" url_title="<?php echo $_POST["entry"]; ?>" limit="1" dynamic="no"}
    <p>Hello world. {title} - <?php echo $_POST["entry"]; ?></p>
{/exp:channel:entries}

```

PHP is Enabled for this template in the control panel, and the template has been fully synced to/from DB and filesystem.

When I simplify the file to just the following:

```
<p>Entry title: <?php echo $_POST["entry"]; ?></p>

```

It outputs: `Entry title: test-entry-name`, as `$_POST['entry']` is the URL title being sent via Ajax.

However I couldn't get it to return the `{title}` for the entry no matter what. When I enabled the Output Profiler, this is the query EE is running:

```
SELECT t.entry_id FROM exp_channel_titles AS t
                LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id !='' AND t.site_id IN ('1')  AND t.entry_date < 1409069885  AND (t.expiration_date = 0 OR t.expiration_date > 1409069885) AND t.url_title = '<?php echo $_POST[' AND t.channel_id = '7' AND t.status = 'open' ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc LIMIT 0, 1

```

As you can see it's not parsing the PHP properly for some reason, but I can't work out why. Any ideas?

Thanks,

Jack

# Answer
Jumped the gun a bit there, I've solved it the moment I posted the question. Hopefully my answer might help someone else having the same problem.

The solution was to change the PHP parsing stage in the template from "Output" to "Input".
> 0 votes

---
Tags: php, ajax
---


# Question
Title: A PHP Error was encountered Severity: 8192
I have some php code that I have embedded. Which seems to work fine alone on the server however when embedded I get this error.

```
A PHP Error was encountered

Severity: 8192

Message: Function split() is deprecated

Filename: libraries/Functions.php(679) : eval()'d code

Line Number: 221

```

How do I go about correcting this error?

# Answer
> 2 votes
If you are using the split method in you php code, you shouldn't. If you see on the documentation page, the split method is being deprecated. You should use one of the alternate functions listed there.

If you aren't trying to use regular expressions, you should probably just use the explode method.

---
Tags: error, php, embeds
---


title: Only some PHP being outputted

text:
# Question
Title: Only some PHP being outputted
I have the following php code in a template and it's not parsing the whole thing. Any idea what the issue is?

Here's the php code:

```
<?php
include "Eventbrite.php";

$authentication_tokens = array('app_key'  => 'YOUR_APP_KEY',
                           'user_key' => 'YOUR_USER_KEY');

$eb_client = new Eventbrite( $authentication_tokens );

$events = $eb_client->user_list_events();
?>

```

Here's what's being outputted on frontend:

*'YOUR\_APP\_KEY', 'user\_key'=\>'YOUR\_USER\_KEY'); $eb\_client = new Eventbrite( $authentication\_tokens ); $events = $eb\_client-\>user\_list\_events(); ?\>*

# Answer
First thing, do you have php enabled on the template? It looks like it is thinking that:

```
<?php
include "Eventbrite.php";

$authentication_tokens = array('app_key'  =>

```

Is just a bad html element. So make sure to enable php on (I think you want) input.

Second, make sure that Eventbrite.php is actually being included correctly.
> 1 votes

---
Tags: templates, php, parse-order
---


# Question
Title: Database Error - Unknown column parent_is_draft in where clause using Playa plugin
I have a channel in my website called Careers. I have a playa field setup for locations. I'm trying to add the location to the job posting in the careers channel.

After I hit submit, I get this error:

A Database Error Occurred Error Number: 1054 Unknown column 'parent\_is\_draft' in 'where clause' DELETE FROM `exp_playa_relationships` WHERE `parent_entry_id` = '440' AND `parent_field_id` = '26' AND `parent_is_draft` = 0 Filename: third\_party/playa/ft.playa.php Line Number: 2558

Has anyone every seen this error before? Do you have any idea how to fix it?

EE v2.7.3 Playa Plugin v4.4.5

Also use Blueprints and Structure plugins in our EE install.

# Answer
> 1 votes
Make sure you have added your license key in the fieldtype settings. This is required for the plugin to update your database tables correctly.

---
Tags: ee2, playa
---


title: Order Channel Custom Field Options

text:
# Question
Title: Order Channel Custom Field Options
I know, still asking newbie questions.

Maybe it is because I am running version 2.3.1, but it's not working for me.

I have a custom field options and I am trying to sort the checkboxes.

I have tried the following:

1) In the products template

```
{product_sizes markup="ul" orderby="product_sizes" sort="asc"}

```

2) In the Channel Fields\> Edit Field\> Field Options, I have literally ordered the options manually. They have to come up in order, right? Nope

Let me know what I am missing or is this a known issue?

Thanks in advance

Update with example:

```
<ul>
<li>32 oz, 32 servings</li>
<li>4 oz, 4 servings</li>
<li>16 oz, 16 servings</li>
</ul>

```

I would like it to be:

```
<ul>
<li>4 oz, 4 servings</li>
<li>16 oz, 16 servings</li>
<li>32 oz, 32 servings</li>
</ul>

```

I have also tried:

```
{product_sizes markup="ul" orderby="field_list_items" sort="asc"}

```

Should I change the database type for field\_list\_items from "text" to something else. I have read in other postings, that it cannot sort unless you change the type to INT, but how would I have a list of checkboxes, if it is type INT?

# Answer
> 0 votes
the documentation does not seem to offer sort options. you can see the docs here: https://ellislab.com/expressionengine/user-guide/add-ons/channel/custom\_fields.html#checkbox-fields

I did a test output in a site that I have in v2.5.3 (that's as old as I could test) and the fields output exactly as entered. If yours are not, and you've reordered them in the field definition, perhaps you need to a) clear template caches and/or b) re-save an entry to see if that changes anything.

**CONFIRMED**: Re-saving the entry will display the items in the proper order.

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


# Question
Title: Display results in Low Search which have value in custom_field_1 OR custom_field_2
I have a Low Search results page where I want to filter the results based on the presence of a value in one or more custom fields. In this case I am searching across two collections and I want to filter the results to only include entries where custom\_field\_1 OR custom\_field\_2 have a positive integer value.

```
{exp:low_search:results search:custom_field_1=">0" search:custom_field_2=">0" query="{segment_3}"}

```

However of course the tag above will only return entries where both fields are a positive integer, not one or the other.

The reason for doing this? I've populated an integer field in each of the channels I'm using with Expresso Store with a 1 or 0 using a custom extension that checks if a price is set. I thought this might be a neat way to be able to leverage Low Search with Store entries but alas, because I have multiple store channels I'm stumped at the last hurdle! Any ideas?

# Answer
When I need to use LowSearch with Store I usually also use Solspace PreParse in that channel too. To set this up you will need to do a few steps.

1. Create an additional textarea field in your field group `store_detailes_parsed` make sure that it searchable.
2. Create an additional template in your partials/embeds folder `_partials/store_search`
3. In the newly created template you will want to have something along the lines of:

{exp:channel:entries entry\_id="{preparse\_entry\_id}"}
{!-- assuming your store field is called store\_details --} {!-- we dont need to have the form or javascript in most cases --} {exp:store:product disable\_form="yes" disable\_javascript="yes"} {!-- Now we need to output anything that we might want to make searchable like price or product variations --}

{if on\_sale}{sale\_price}{if:else}{regular\_price}{/if} {!-- in Store 2.x the sale price is not set in the channel entry so be careful because preparse will only update when the entry is saved again. --}

{!-- output the modifiers so they are also searchable and the --} {modifier\_options} {option\_name} {price\_inc\_mod}{!-- show value for each option --} {modifier\_options}

{ any other fieldtype items you want } {/exp:store:product} {/exp:channel:entries}
4. Goto Add-ons \> Extensions \> PreParse and select the channel of your Store field and then the name of your custom field for Store. This should refresh the right content area you will want to select your newly created `store_details_parsed` field and the `_partials/store_search` respectively.
5. Save and repeat for each additional channel.
6. Now you will need to modify your LowSearch Collections to use also search your newly created field.
7. Rebuild your search indexes.

Now you should be able to preform a search form the front-end of the site and have Store specific details be populated in the search. If you wanted to provide a bit more control you could only output the price into one field and the variations into another custom field and the sale price into yet another field. You would just need to repeat the steps 1-4 again but instead of selecting the store\_details each time you would need to select a different custom field. This should work without an issue because you are not using the `{prepare_data}` variable in the PreParse templates.
> 3 votes

---
Tags: expresso-store, search, low-search
---


# Question
Title: Playa Upgrade 2.9 - playa not installed and now unable to load site preferences error
I upgraded a site from EE 1.7.3 to EE 2.9.1 - the last piece was upgrading Playa. The site was working fine until that point. When I went to upgrade Playa, I received the following error:

> Error Number: 1060 Duplicate column name 'parent\_element\_id' ALTER TABLE exp\_playa\_relationships ADD parent\_element\_id VARCHAR(255) NULL AFTER parent\_var\_id Filename: third\_party/playa/ft.playa.php Line Number: 488

After checking for parent\_var\_id and parent\_is\_draft (both exist) I went to set the version number to 4.5 in exp\_fieldtypes - however there is no playa field listed in that table.

Also, now the site and control panel do not load and instead I'm getting:

> Site Error: Unable to Load Site Preferences; Invalid Preference Data

Thanks for any help you can provide.

# Answer
Here's the solution to the above issue: https://expressionengine.stackexchange.com/a/24657/189

in short, run this SQL and run module updates again:

```
UPDATE  `exp_fieldtypes` SET  `version` =  '4.5' WHERE `name` =  'playa'

```
> 1 votes

---
Tags: playa, error, upgrade
---


title: Postcode lookup with territories

text:
# Question
Title: Postcode lookup with territories
I wonder if anyone can point me in the right direction or even tell if there is something than can do the following.

Basically i want a postcode lookup that will return an entry based on territories/location so for example:

* I type my postcode in "LL28 4AU"
* Returns an entry that relates to that postcode
* if the postcode is not covered return a message saying sorry your area is not covered.

I dont want it to work from radius though because if there is an entry that is technically closer to the postcode but isnt actually covered by that entry and is actually covered one slightly further i would have a problem.

I need it to relate to terriroties / postcodes covered.

Sorry for badly worded question i cant find an easy way to say what i need.

Thankyou to anyone that can help.

# Answer
> 0 votes
It looks like you're working with UK postcodes which is going to make this difficult or at least costly to do "properly".

Unfortunately, and perhaps wrongly, the UK postcode data belongs to The Royal Mail. You can use it, but you have to but the data from them. Consequently there aren't any add-ons that can hook into this data to do what you want.

You may be able to get a list of postcode lat/lng details but I'm not sure how this would work since postcodes don't cover areas of similar size or shape.

I don't really understand the following:

> I dont want it to work from radius though because if there is an entry that is technically closer to the postcode but isnt actually covered by that entry and is actually covered one slightly further i would have a problem.

Do you mean that you have a series of entries for, say, dealerships and each dealership covers specific postcodes? If so, then I think your best bet would be to make use of a simple text search.

Have a text field for each entry which contains the postcodes that it covers then run your search on that field to find a match. You may need to write a custom MySQL query and use the Query Module to execute it but from that point on it should be pretty straightforward to implement.

---
Tags: geofinder
---


title: WYGWAM making [i] italicise content

text:
# Question
Title: WYGWAM making [i] italicise content
I've a client who has written an article with footnotes.

Those footnotes are notated by them adding \[i\] \[ii\] and so on.

For some reason though, WYGWAM seems to take that as a cue to open italics.

Won't be surprised to find this is one of CKEditor's advanced config settings but not sure what should be changed.

Has anyone experienced similar?

# Answer
> 3 votes
It's a BBCode problem: http://ellislab.com/expressionengine/user-guide/general/bbcode.html

Pretty sure the issue here is the first \[i\] only, all subsequent \[ii\], \[iii\] should not be replaced as bbcode by EE.

A dirty but effective method would be to change the very first instance of \[i\] to \[i\] which is the html entity for the letter i.

I tried a more elegant method using Low Replace but I think the parse order was doing its thing as usual.

Hope it gets you somewhere. jfp

# Answer
> 1 votes
Heh... I used to run into this all the time on forums. The slightly hacky but fairly straightforward workaround is to "interrupt" the BBCode you *don't* want to get parsed with something that *does* get parsed into an invisible output, such as an empty tag.

So when you have this:

```
He said "[i]t was a fine day for sailing..."

```

Do this:

```
He said "[[b][/b]i]t was a fine day for sailing..."

```

More details in my comment to the EE docs' BBCode tag.

# Answer
> 0 votes
A common problem it seems https://support.ellislab.com/bugs/detail/19755/i-in-entry-text-interpreted-as-unclosed-bbcode-italics

I tried the extension that Derek posted but it has stopped all fields from rendering.

---
Tags: wygwam, tags, formatting
---


# Question
Title: Is there a way to disable BBCode parsing in Channel Entries?
I have several articles that contain "\[I\]" as part of a quote. EE sees this as BBcode and renders the entire remainder of the entry as italic text (because there is no corresponding closing tag).

The only other mention of this issue I can find is in an archived EL forum thread from several years ago, which suggests there is no way to change this default behavior... Is there still no way to disable BBCode parsing?

# Answer
> 2 votes
You should be able to use an html entity to overcome this. Try changing your \[I\] (capital i?) to:

```
[I]

```

in your EE entries and see if that works.

# Answer
> 0 votes
I'll give the same answer I gave in the other thread (is it ok to do that on SE?):

> Heh... I used to run into this all the time on forums. The slightly hacky but fairly straightforward workaround is to "interrupt" the BBCode you *don't* want to get parsed with something that *does* get parsed into an invisible output, such as an empty tag.
>
> So when you have this:
>
> ```
> He said "[i]t was a fine day for sailing..."
>
> ```
>
> Do this:
>
> ```
> He said "[[b][/b]i]t was a fine day for sailing..."
>
> ```
>
> More details in my comment to the EE docs' BBCode tag.

---
Tags: parsing
---


# Question
Title: CartThrob - Change of Status Notifications being sent, even without change of Status
I'm using Channel Form to edit the data stored for a CartThrob Order entry. I have a couple of CartThrob notifications set up to send an email when the status is changed. These work just fine. However, they are also being triggered when any data field is changed... without the Status being changed.

For example, if an Entry Status is set to "Booked", a Notification is sent. If I edit the Entry (using Channel Form) but leave the Status as it is (still as "Booked"), the Notification email is sent again anyway.

Am I doing something wrong?

# Answer
> 0 votes
Sounds like a bug to me...the cartthorb notifications/status update system is a bit ropey in all.

I have been poking around in that area for other reasons...I suspect you could trap this and stop the emails going out by modifying

third\_party/cartthrob/libraries/cartthrob\_email.php

around line 49 you could add an extra condition to make sure the status actually has changed...the following code is NOT tested but might get you started:

From:
                    if ($status_end && ($notification['status_end'] == "ANY" || $notification['status_end'] == $status_end))

To:

```
                if (($status_end && ($notification['status_end'] == "ANY" || $notification['status_end'] == $status_end)) && $status_start !== $status_end)

```

It's a hack you'll have to maintain, so I would book a call in with the CartThrob folks (and/or ping them on twitter) - and get it fixed properly, but this might work in the meantime.

# Answer
> 0 votes
I contacted CartThrob Support and this what they came back with...

"I reviewed the edit that the other user offered on StackExchange. After testing locally, I discovered that their fix is a good start, but won't fix the problem entirely. The current channel form hook that triggers the email unfortunately already has both the start and end statuses set to the end status by the time it reaches the function to send the email. Basically whenever Channel Form submits, the start and end statuses are the same so that updated conditional will not send an email. I made some edits to the ext.cartthrob.php file and the libraries/Cartthrob\_emails.php file and it seems to be working now."

I don't know what specific changes were made in those files, but let me know if you'd like me to send you copies. :-)

---
Tags: cartthrob, safecracker, status, notification
---


# Question
Title: DevDemon Forms: The Forms Module requires jQuery 1.3 or higher. (jQuery not found)
I recently upgraded a site from EE2.5.4 to EE2.9 and upgraded Forms from 3.3.1 to 3.4.11

On the old version of the site, forms were storing in the dashboard & sending the relevant emails to admin & user. Since the upgrade I get the error:

**The Forms Module requires jQuery 1.3 or higher. (jQuery not found)**

whenever I load a page with a form on it & the form doesn't save or send. I'm not seeing the success message either.

has anyone come across this & fixed it before?

# Answer
> 1 votes
The version of forms that I updated the site to has a tag that does all of this for you. http://www.devdemon.com/documentation/tag/output-javascript/ explains it all. Always helps to read the docs.

Added queue\_js="yes" inside my forms tag & then added {exp:forms:output\_js} just after I called jQuery at the bottom of my page.

---
Tags: error, jquery, devdemon, devdemon-forms
---


# Question
Title: Solspace freeform composer fieldtype - inline errors
I couldn't see it in the docs - is there a way to do inline error handling with a Freeform Composer form when you've selected the form in a fieldtype? I want the authors to be able to add a form of their choice to a page by selecting the form in the dropdown, but also have the error handling done inline.

The docs simply suggest using the field's short name which outputs the form, but the errors go to the ugly error screen and the info added is lost when you go back.

I can see there's a {exp:freeform:composer} tag, but I'm not sure how to grab the relevant form ID from the selected option in the fieldtype?

Cheers

# Answer
> 1 votes
To have inline errors in Freeform Composer, you need to create a **custom Composer Template** since the default template does not contain inline error code.

1. Go to *CP =\> Add-Ons =\> Modules =\> Freeform =\> Composer Templates* and create a new Composer Template.
2. Under the **Template Params** setting, add your parameters, in particular `inline_errors` / `yes`. You can add other parameters if you need more.
3. In the **Composer Template** section, you should see the code for a default Composer Template. You will need to add inline error template code similar to what is in the documentation (see http://www.solspace.com/docs/freeform/form/#freeform\_error\_field\_name). Find the part that says:

```
{if:else}
    <p>{composer:field_output}</p>
{/if}

```

and add the inline error code (arrange to your liking):

```
{if:else}
    <p>
        {composer:field_output}

        {!-- composer:field_name will parse first to the field's name --}
        {if "{freeform:error:{composer:field_name}}"}
            <strong>{freeform:error:{composer:field_name}}</strong>
        {/if}
    </p>
{/if}

```

If you need inline errors for *general errors* (eg. captcha not filled in, etc), feel free to also add the `{freeform:general_errors}` code (see docs) as well in the Composer template where appropriate (eg. at the top of the Composer Template).
4. Go to the **Forms** section and click the icon in the "Composer" column to edit your Composer form.
5. In the top left of the screen, select your newly created Composer Template from the dropdown. Save you form.
6. Add the Freeform custom field to your custom field group. For this example, let's use `my_freeform_field`
7. Now your users can select the Composer form from the Freeform custom field when filling out the entry form.

In your template, you can display the Composer form selected in the Channel Entry my simply calling its name:

```
{exp:channel:entries /* your parameters */}
   <h3>The form:</h3>
   {my_freeform_field}
{/exp:channel:entries}

```

Unfortunately there are no parameters for the Freeform custom field. If you need to use different parameters or a different Composer Template (and have these options available in the Freeform custom field), unfortunately that requires a new Composer form to link a new Composer Template. (Feature Requests can be written here)

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


title: What's wrong with this SQL query?

text:
# Question
Title: What's wrong with this SQL query?
I have an SQL query which I'm adding to a small search plugin, however when I run the SQL in MySQL it works and results are found, however no rows are being returned when running the code in the plugin. Any ideas?

```
$query = ee()->db->query('
    SELECT c.cat_url_title, c.cat_name, ch.channel_name FROM exp_categories c
    LEFT JOIN exp_channels ch ON ch.cat_group = c.group_id
    WHERE c.cat_name LIKE "%' . ee()->db->escape_str($keywords) . '%"
');

```

UPDATE (moved from further answer) Thanks. I was being thick! the query was working correctly. I was sending it the wrong parameter

# Answer
I ran it and I'm getting results just fine.

Are you outputting the results correctly?

```
$query = ee()->db->query('SELECT cat_url_title, cat_name, ch.channel_name  FROM exp_categories c
        LEFT JOIN exp_channels ch ON ch.cat_group = c.group_id
        WHERE c.cat_name LIKE "%'.ee()->db->escape_str($keywords).'%"');
foreach($query->result_array() as $row)
{
    echo $row['cat_name']."<br>";
}

```
> 3 votes

# Answer
Thanks. I was being thick! the query was working correctly. I was sending it the wrong parameter
> 0 votes

---
Tags: database, mysql, query
---


title: Channel Entry API and Grid field

text:
# Question
Title: Channel Entry API and Grid field
I'm looking for a way to handle a grid field with the channel entry API.

Documentation has nothing, and could barely find anything else online about except for this: Inserting a new Grid row using the API, but there is no solution through the API.

Has anyone figured this one out yet?

# Answer
> 3 votes
I'm pretty sure you can just pass in the fieldname the row and column like

```
$data['field_id_X'][rows][new_row_1][col_id_1] = 'row 1';
$data['field_id_X'][rows][new_row_2][col_id_1] = 'row 2';

```

Just increment new\_row\_x as needed and match up your col\_id\_x numbers

# Answer
> 1 votes
Very close to @johnathan-waters answer I imported new grid rows using this code

`$data['field_id_X']['rows']['new_row_Y']['col_id_Z'] = 'value';`

---
Tags: channel, grid, entries, entry, api
---


title: Inserting a new Grid row using the API

text:
# Question
Title: Inserting a new Grid row using the API
I looked at the documentation in ExpressionEngine about saving/updating a channel entry row.

Unfortunately, the documentation doesn't show anything about adding a new Grid row.

Is it possible to do this? If so, how?

# Answer
I'm not really sure if it's possible to do this in a native way with the Channel Entries API, if someone knows a way please post.

However, I believe you can do grid field updates in your add-ons by using the EE Database Class and inserting/updating the corresponding grid table directly with a mysql query.

If you examine your database tables, you will see that grid fields create their own tables, named `exp_channel_grid_field_##` (where ## is your field number).

You'll also see that each `exp_channel_grid_field_##` entry is associated by entry\_id to the corresponding `channel_title entry_id, and each column_id_#` is for the corresponding column you've set within the grid.
> 0 votes

# Answer
I hope this still helps,

I add new rows to a grid field by this code:

`$data['field_id_X']['rows']['new_row_Y']['col_id_Z'] = 'value';`

Just match X to your grid's field ID, increment new\_row\_Y as needed and match up your col\_id\_Z numbers.
> 0 votes

---
Tags: grid, api
---


title: URL Title and Structure Listing URL

text:
# Question
Title: URL Title and Structure Listing URL
Does ExpressionEngine automatically generate the URL Title and Structure listing URL as the same when the Title for the page is entered?

Do both URL Title and Structure listing URL have to be the same or optional?

When the URL Title or page title is modified, Why EE doesn't update the Structure listing URL automatically?

# Answer
> 1 votes
1.) Yes it does. Unless another entry with the same url-title or structure title, then ee throws an error or appends a number to the title

2.) they do not have to be the same

3.) Because the structure js only modifies the structure title when the title field is updated. You can use a plugin like http://devot-ee.com/add-ons/cp-css-js to bind an onchange event to the url title

# Answer
> 0 votes
We just posted to Devot-ee.com our add-on that forces the URL Title field to match the Structure Page/Listing URL field.

View "URL Title Match" here: http://devot-ee.com/add-ons/url-title-match

---
Tags: structure
---


title: Counting Results Outside Channel Tag

text:
# Question
Title: Counting Results Outside Channel Tag
I have this peice of code:

```
    <div id="slide-block1" class="flexslider">
        <div class="slides">

          {exp:channel:entries
          channel="rotator-slides"
          disable="categories|category_fields|member_data|pagination"
          orderby="random"
          dynamic="no"
          category="262"
          }
              <div class="slide">
                <a href="{slide-link}">
                  {exp:imgsizer:size src="{slide-image}" width="960" height="430"}
                  <img src="{sized}" width="960" height="430" alt="" />
                  {/exp:imgsizer:size}
                </a>
              </div><!-- /.slide -->
          {/exp:channel:entries}

        </div><!-- /.slides -->
      </div><!-- /#slide-block1 -->

```

The problem is that I do not want the first two "div" tags (and therefore the last two closing tags) to appear if the channel with that category has at most 1 entry. How do I get the total number of entries before using the channel tag?

# Answer
> 0 votes
I think I fixed it. I feel stupid. All I needed is to make a condition inside the tag!

```
      {exp:channel:entries
      channel="rotator-slides"
      disable="categories|category_fields|member_data|pagination"
      orderby="random"
      dynamic="no"
      category="262"
      }
      {if total_results > "1" && count=="1"}
      <div id="slide-block1" class="flexslider">
        <div class="slides">
          {/if}
          <div class="slide">
            <a href="{slide-link}">
              {exp:imgsizer:size src="{slide-image}" width="960" height="430"}
              <img src="{sized}" width="960" height="430" alt="" />
              {/exp:imgsizer:size}
            </a>
          </div><!-- /.slide -->
          {if total_results > "1" && count==total_resutls}
        </div><!-- /.slides -->
      </div><!-- /#slide-block1 -->
      {/if}
      {/exp:channel:entries}

```

---
Tags: channel, ifelse
---


title: next / previous entry linking

text:
# Question
Title: next / previous entry linking
I am trying to create links to the next and previous entries NOT using pagination.

I tried the plugin Next / Previous Links Anywhere from McFly but it is not working as described and no longer supported.

Can anyone suggest another plugin that takes the current entry ID from a single page entry and provides a link to the next and previous entries based on the sort order?

# Answer
```
{exp:channel:next_entry channel="blog"}
    <a class="newer" href="{path=blog}"><span>Newer</span></a>
{/exp:channel:next_entry}
{exp:channel:prev_entry channel="blog"}
    <a class="older" href="{path=blog}"><span>Older</span></a>
{/exp:channel:prev_entry}

```
> 1 votes

# Answer
I ended up using the following plugin: http://www.intoeetive.com/index.php/comments/entry-linking-plugin-for-ee-2.x
> 0 votes

---
Tags: pagination, links, next-prev, sort
---


# Question
Title: Error when using Grid field: You are not authorized to perform this action
Getting this error when attempting to use the Grid field: You are not authorized to perform this action

Once I switch to another field type, error goes away...

# Answer
This is a known bug in 2.9.0 and will probably soonish be fixed in an update
See: https://support.ellislab.com/bugs/detail/20462/grid-fieldtype-brings-up-warning-when-rows-are-present-on-entry-submit

(ps. bug report includes patch/fix)
> 3 votes

# Answer
Also just ran into this bug on an E2.9.0 clean install. Just applied the fix mentioned in the post GDmac referenced here. It's working for me so far so good. I hope this helps.
> 0 votes

---
Tags: error, grid, bug
---


# Question
Title: Apparently I don't know how exp:channel:entries status and limit work together
I want to grab the 1 most recent entry and display it big. Then I want to grab the next most 6 recent entries and display them small.

So: {exp:channel:entries channel="blog" limit="1"} and {exp:channel:entries channel="blog" limit="6" offset="1"}

The problem is if my most recent blog entry is closed. Then nothing big shows up and the small items start at the 2 blog entry (the closed entry is offset). I get the same results if I add status="open".

All this time I had assumed exp:channel:entries would consider the status before applying the rest of the params, especially limit and offset. Since status param defaults to open, obviously I want to limit to the open entries.

Am I wrong? Is it something new with v2.8.1? How did you think it worked?

# Answer
> 4 votes
Here's a basic setup for what you're trying to achieve, with the class `.biggie` representing the markup for making your entry big, and the absence of that class indicating a "normal" representation of your remaining entires.

***NOTE:*** *Since the default order for channel entry output is reverse date order (newest first) you do not need to specify any order or sort. If you wanted to sort/order by a different criteria, you would simply add that to the opening parameters.*

```
{exp:channel:entries
  channel="blog"
  limit="7"
}

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

  {if count == "1"}
    <h2 class="biggie">{title}</h2>
    <p class="biggie">{body}</p>

  {if:else}
    <h2>{title}</h2>
    <p>{body}</p>
  {/if}

{/exp:channel:entries}

```

---
Tags: channel-entries, status, parameters
---


title: ExpressionEngine Email Configuration

text:
# Question
Title: ExpressionEngine Email Configuration
I have tried using all three methods in the Email Configuration method and when I test these methods via the Tools \>\> Communicate all three of them work. However when an order is submitted on the website we do not get an Admin Order Notification nor does the customer receive anything. What am I missing here?

# Answer
I was able to find the answer to my problem. I found that my server email was the issue. So I set up an account with Sendgrid and it immediately fixed my problem.

I found others complaining of the same issue with the same versions I have and said that the site server sometimes has issues and those emails get blocked immediately and don't even go to spam, which was probably my case. So they recommended using the Sendgrid services which is free up to 200 emails a day.

Thanks Justin for trying to help.
> 1 votes

---
Tags: email, config
---


title: Search Date Field with a Custom Format

text:
# Question
Title: Search Date Field with a Custom Format
I'd like to return all entries that are in the future - but based only on the day of the week and time. I've got it working with just %H:%i (Hours/Minutes), but can't get it to respect the day of the week.

Is this possible?

Can you choose a custom date format of a channel field to check against?

**Thanks in advance!**

```
{exp:channel:entries channel="CHANNEL" search:starttime=">{current_time format='%w %H:%i'}"}
     {title}
{/exp:channel:entries}

```

# Answer
The weekday is irrelevant to ***CURRENT\_TIME*** since `current_time` is now. How it's presented on the *front end* is determined by the date formatting code on the backend, but since you are not manipulating `current_time` it's of no consequence here.

Of course, all of that is academic, because if you truly want to…

> …display all entries that are in the future…

…then what you really want is the built-in mechanism of `show_future_entries = 'yes'`. This will accomplish the stated goal without having to create a custom search every time the template's loaded. The docs for `show_future_entries` are **here**.

If you click through to that link, you should also scroll down to the `start_on` parameter and you will see that its limitations include an inability to be dynamic: you MUST enter a fully realized date. That said, you could include some PHP to generate your relative future date, and achieve some arbitrary future entry display that way, but that's not what you asked. ;-)

Or am I missing something in your question? HTH.
> 0 votes

---
Tags: ee2, channel-entries, date-format
---


# Question
Title: Limit playa total returned entries in control panel
We have about 7 playa fields in our entry form.

I want to limit the displaying entries but when searching, still to be available to get the desired one.

I believe that by limiting the number of shown entries, it will improve the loading time when editing a page like this.

# Answer
> 1 votes
There's a dropdown menu on Playa's specific **Add/Edit Channel Field** ( Admin \> Channel Fields \> Group \> Field ) form called **Limit entries to** \- this is where you can set a limit.

Any searches/filters on the playa field will search/filter the all entires ( configured in the CP ) and not just filtered set.

---
Tags: channel-entries, playa, field-editor, memory-limit
---


# Question
Title: Clear cache when Expresso Store Sale is created
I think this question is probably more directed at the guys from Expresso Store, but maybe there's someone else out there that has had to deal with something similar before and can point me in a direction.

We are using CE Cache to cache certain parts of our templates, including product data. We've set up cache breaking for when a product channel entry gets added/updated, no problem here, but because the Sales section of Store is outside of the channel entries view, the caching does not get refreshed again after a sale has been associated to a specific product. It is not really a nice solution for us to tell our client they have to go and edit a product again after creating a sale to break the cache.

The ideal for us would be if there's a hook that gets triggered by Expresso Store when a new sale/discount is created that I can just extend to clear the cache programmatically. Also ideally I would not want to hack Store self. I have looked at the documentation here, but most of the hooks look like they are related to the ordering process.

Any ideas?

# Answer
> 1 votes
Just documenting this if someone else might run into the same issue. It turns out there isn't a hook in Expresso Store (yet) that will allow you to clear caching on updating/inserting of a sale/discount.

How I ended up resolving it was by adding a custom hook into the Sales Controller and Discounts Controller in the Store add-on self. I am not a big fan of hacking third party plugins, but it was the only solution I could come up with at this point.

The code is basically the same in the two controllers, so just search for the comment "**// handle form submit**" and update the code to something like this:

`if ($this->ee->form_validation->run() === true) {
 $sale->save();`

````
// Adding custom hook for when a sale gets updated, so we can clear cache
if ($this->ee->extensions->active_hook('custom_store_cp_sale_update')) {
    $this->ee->extensions->call('custom_store_cp_sale_update');
}

$this->ee->session->set_flashdata('message_success', lang('store.settings.updated'));
$this->ee->functions->redirect(BASE.AMP.STORE_CP.'&sc=sales');

````

`}`

This hook will then be called when a new sale or discount entry is created or when an existing one is edited.

Hope this can help someone.

---
Tags: expresso-store, hook, ce-cache
---


# Question
Title: channel:form is deleting data not included in the channel form
There is an issue with channel:form, it is deleting data it should not. The following channel entry form will delete all grid entries I have for product\_images. The grid\_entry field is product\_images, and there are two columns called image and image\_alt.

Yet using this code (notice I am not editing the grid field product\_images that is being deleted), the grid field will be blank after saving, and no other field will be affected, just this grid field used for images.

```
{exp:channel:form channel="products" return="product" entry_id="801" include_jquery="no" include_assets="no"}

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

{/exp:channel:form}

```

I have other grid fields for the entry that are not deleted, and I have a File field that is not deleted. So its either something to do with this specific field, or to do with the Grid field that has a File field in it.

Using EE 2.7.2

# Answer
This is a known bug, a fix for EE 2.7 is here https://support.ellislab.com/bugs/detail/19772/, and an upgrade to 2.9 fixed it for me.
> 1 votes

---
Tags: safecracker, grid
---


title: CE Image not populating 'made' folder

text:
# Question
Title: CE Image not populating 'made' folder
I'm struggling to get CE Image to work on my install. I'm on a Windows server and have made the 'images/made' and 'images/remote' folders and given full control to everyone to make them writable.

However, when I include the tag pair in my template, it's as if CE Image isn't doing anything. Here's my template code:

```
<?php
            if("{cf_recipes_size}" == "tiny" or "{cf_beers_size}" == "tiny")
            {
                $imgWidth   = "270";
                $imgHeight  = "270";
            }
            else if("{cf_recipes_size}" == "vert" or "{cf_beers_size}" == "vert")
            {
                $imgWidth   = "270";
                $imgHeight  = "540";
            }
            else if("{cf_recipes_size}" == "hori" or "{cf_beers_size}" == "hori")
            {
                $imgWidth   = "540";
                $imgHeight  = "270";
            }
            else if("{cf_recipes_size}" == "big" or "{cf_beers_size}" == "big")
            {
                $imgWidth   = "540";
                $imgHeight  = "540";
            }

            ?>

            {exp:ce_img:pair src="{cf_recipes_image}"}
                    <img src="{made}" alt="" width="<?php echo $imgWidth; ?>px"              height="<?php echo $imgHeight; ?>px" />
            {/exp:ce_img:pair}

```

I've turned on template debugging but there's nothing there to suggest that the directories can't be created. the URL generated from the {made} tag is just the source URL of the uploaded image (via a standard EE file control for a custom field).

The output is

```
<img src="/assets/desserts/orange.png" alt="" width="540px" height="540px" />

```

Any ideas why this isn't working?

# Answer
Looking at your CE\_Img tags **you haven't told it what size to make your image** and you have a weird mix of PHP and EE tags going on. This is most likely the problem.

You also don't need to be echoing out the width and height using PHP. CE\_Img will create variables for both of these values. Just tell it what size you want your image using width, height, max\_width, max\_height parameters in the CE\_Img tag pair.

Try this for starters...

```
{exp:ce_img:pair src="{cf_recipes_image}" allow_scale_larger="yes" max_width="540"}
    <img src="{made}" alt="" width="{width}" height="{height}" />
{/exp:ce_img:pair}

```

This will tell CE\_Img to make a new image that has a maximum width of 540px (and implicitly, any height).

Taking your example I can deduce you wan't a different sized image based on some field values. The easiest way to do this would be with conditionals (using regular if:else EE tags or using something like Switchee)

```
{if "{cf_recipes_size}" == "tiny" or "{cf_beers_size}" == "tiny"}

    {exp:ce_img:pair src="{cf_recipes_image}" width="270" height="270"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}

{if:elseif "{cf_recipes_size}" == "vert" or "{cf_beers_size}" == "vert"}

    {exp:ce_img:pair src="{cf_recipes_image}" width="270" height="540"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}

{if:elseif "{cf_recipes_size}" == "hori" or "{cf_beers_size}" == "hori"}

    {exp:ce_img:pair src="{cf_recipes_image}" width="540" height="270"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}

{if:elseif "{cf_recipes_size}" == "big" or "{cf_beers_size}" == "big"}
    {exp:ce_img:pair src="{cf_recipes_image}" width="540" height="540"}
        <img src="{made}" alt="" width="{width}" height="{height}" />
    {/exp:ce_img:pair}
{/if}

```

You may also find the crop parameter useful.
> 2 votes

# Answer
**Step 1: Make sure you are passing parameters to CE Image**

If no parameters are passed into CE Image, it will simply return the original image.

foamcow is right. You would want to make sure you are passing the desired width and height into CE Image, not simply outputting them in the HTML. Assuming your PHP Parsing Stage is set to "Input", this should work:

```
{exp:ce_img:pair src="{cf_recipes_image}" width="<?php echo $imgWidth; ?>" height="<?php echo $imgHeight; ?>"}
   <img src="{made}" width="{width}" height="{height}" alt="" />
{/exp:ce_img:pair}

```

or simply use the more succinct 'single' (as opposed to 'pair') syntax:

```
{exp:ce_img:single src="{cf_recipes_image}" width="<?php echo $imgWidth; ?>" height="<?php echo $imgHeight; ?>"}

```

Not that there is no reason to pass in 'px' in width or height attributes. That applies to both CE Image and the HTML img element.

**Step 2: Check the template debugger for debug messages**

CE Image outputs debug messages that detail what is happening when it runs. See the Debugging documentation for more information on how to utilize the debug messages.
> 1 votes

---
Tags: ce-image
---


# Question
Title: Using Pages/Better Pages and can't access template/URL without index after template
I am using Pages module and the Better Pages plugin on a site. When I navigate to the 'about' page, http:www/mydomain.com/about does not work and http://www.mydomain.com/about/index does.

Am I missing something in regards to how this is set up? Why do I have to include the template name with the template group? I didn't think the template name was required.

*** EDIT *** Using: EE 2.8.1 Better Pages 1.1.8

*** EDIT ***

My Pages URI is: /about

The following is my index template in the about template group.

{About/Index} Template Code

```
{!-- STASH SITE SETTINGS --}
    {stash:embed:partials:site_variables process="start" replace="yes" parse="yes"}
{!-- /STASH SITE SETTINGS --}

    {snippet--doctype-html-head}
    {snippet--core-head}

    <link rel="stylesheet" href="{site_url}css/skins/{exp:stash:get name='color'}.css">
    <body class="{exp:stash:get name='style'}">
        <div class="body">

        {!-- Header Router --}
            {exp:channel:entries
                channel="header"
                limit="1"
                disable='categories|member_data|pagination'
            }
                {!-- FIND THE TEMPLATE CHOSEN --}
                {exp:query
                    sql="SELECT template_name FROM exp_templates WHERE template_id = '{header_layout}' "
                }
                    {embed="Header/{template_name}"
                        rail_message="{rail_message}"
                        navigation_type="{navigation}{navigation:navigation_type}{/navigation}"
                        navee="{navigation}{navigation:navee}{/navigation}"
                        manual="{navigation}{navigation:manual}{/navigation}"
                        {if top_links:total_rows > 0}
                            top_links="TRUE"
                        {/if}
                    }
                {/exp:query}
            {/exp:channel:entries}
        {!-- /Header Router --}

        {!-- Page Router --}
            {exp:channel:entries
                channel="about"
                limit="1"
                disable='categories|member_data|pagination'
            }
                {!-- MUST HAVE ENTRY --}
                {if no_results}
                    {redirect="404"}
                {/if}

                {!-- FIND THE TEMPLATE CHOSEN --}
                {exp:query
                    sql="SELECT template_name FROM exp_templates WHERE template_id = '{page_layout}' "
                }
                    {embed="About/{template_name}"}
                {/exp:query}

            {/exp:channel:entries}
        {!-- /Page Router --}

        {!-- Footer Router --}
            {exp:channel:entries
                channel="footer"
                limit="1"
                disable='categories|member_data|pagination'
            }

                {!-- FIND THE TEMPLATE CHOSEN --}
                {exp:query
                    sql="SELECT template_name FROM exp_templates WHERE template_id = '{footer_layout}' "
                }
                    {embed="Footer/{template_name}"
                        banner="{banner_text}"
                        news_head="{newsletter_subscription_header}"
                        news_intro="{newsletter_lead_in_copy}"
                        twitter_head="{twitter_feed_header}"
                        contact_head="{contact_header}"
                        posts_head="{recent_posts_header}"
                        work_head="{recent_work_header}"
                    }
                {/exp:query}

            {/exp:channel:entries}
        {!-- /Footer Router --}

{!-- REQUIRED FOR PREVIEW --}
    {snippet--foot-constants}
{!-- /REQUIRED FOR PREVIEW --}

```

# Answer
Ok, I was able to make this work by doing the following. Maybe I wasn't understanding completely how the Pages Module worked.

In my settings, I kept my default template as 'about/index', and modified the URL in the 'Custom URL' field to '/about/index'.

This allowed me to navigate to http://www.domain.com/about and see the dynamic content fed from the router template at http://www.domain.com/about/index.
> 0 votes

# Answer
Better Pages doesn't actually affect the native functionality of Pages at all. It actually just a fieldtype that makes selecting the template/url a little easier by allowing the end user to filter down the list of available templates to those that are appropriate. BP doesn't affect the way Pages handles routing, or even intercept the way it adds it to the DB. It simply selects the correct options using JS.

If you go to the Pages tab and select the template/url that way, I suspect you will find that you have the same issue.

This isn't really an *answer* as much as a way to rule out that Better Pages would be doing anything funky with your routing. Hoping this helps narrow down your search for a solution.
> 0 votes

---
Tags: ee2, pages
---


# Question
Title: P&T Playa not submitting into Channel Form (EE 2.8 & Playa 4.3.3)
In 2.5.3 with Playa 4.3.3, the following setup worked, but after an upgrade to 2.8.1 and a rebuild of the channel:form, submissions are not working.

I have a channel:form, with several input fields that are submitting correctly. I also have an embed that contains a channel entries loop, so I can display video previews, plus the checkbox for the Playa field. I had this working before in the same setup (same field and channel), but now when it submits, no relationships are made.

```
{exp:channel:form dynamic_title="[order_tv_retailer_name]" channel="store_tv_orders" return="{segment_1}/{segment_2}/order/ENTRY_ID" entry_id="{segment_4}" error_handling="inline" datepicker="no" use_live_url="no" include_assets="no" include_jquery="no" class="form-horizontal form-bordered" site="msm_site"}

{!-- INSIDE OF EMBED {embed=""} --}
{exp:channel:entries channel="tv_commercials" disable="category_fields|member_data" site="msm_site" search:tv_commercials_brand="{site_short_name}\W"}

{tv_commercials_asset kind="=video" var_prefix="file"}

<input type="checkbox" id="order_tv_selection_{entry_id}" value="{entry_id}" name="order_tv_selection[selections][]" class="form-control" required>

{/tv_commercials_asset}

{/exp:channel:entries}
{!-- END OF EMBED --}

.....more input fields that submit correctly.....

{/exp:channel:form}

```

The intention is to make a Playa relationship using channel:form and an embed that loops through the channel entries I would like to relate. I'm following the documentation for a channel:form checkbox for Playa to a tee (http://docs.pixelandtonic.com/playa/templating/channel\_form.html).

Thank you for any suggestions and assistance!

# Answer
> 0 votes
Not could have a relation with member\_data category? It is disabled on your channel field parameter.

---
Tags: playa
---


title: Updater Error Number: 1054

text:
# Question
Title: Updater Error Number: 1054
I've just run the updater from 2.5.5 to 2.9.0 and have gotten:

```
{"error":"
Error Number: 1054\n\n

Unknown column 'csrf_exempt' in 'field list'\n\n

UPDATE `exp_actions` SET `csrf_exempt` = 1 WHERE `class` = 'Search' AND `method` = 'do_search'\n\n

Filename: \/Daves's Sites\/site_name\/system\/expressionengine\/modules\/search\/upd.search.php\n\n

Line Number: 185"}

```

Anyone encountered this before?

# Answer
A bug?

For now, fix this by yourself.

```
ALTER TABLE exp_actions ADD `csrf_exempt` tinyint(1) UNSIGNED NOT NULL default 0

```
> 1 votes

---
Tags: ee2-upgrades
---


# Question
Title: Is it possible to notify the user when their status has changed on a Freeform entry?
Is there any way to send a notification to the user once the form entry status has changed? Ideally I need around 3-4 different status'.

It would need to work so that if a status is changed to *More info* a specified notification is sent out to the user, then the same for approved, denied etc.

Is this something that can be done with FreeForm Pro?

# Answer
> 0 votes
If you're using `{exp:freeform:edit}` (Freeform Pro feature), there is the `notify_on_edit=""` parameter that you can use.

From the documentation (http://www.solspace.com/docs/freeform/edit/#notify\_on\_edit):

> **notify\_on\_edit="yes"**
> If you wish to send out notifications to admins and users with the usual parameters upon successful edit of Freeform entry, you'll need to specify this parameter with a value of **yes**. Default is **no**.

If you want this to happen from the Control Panel (when editing a Freeform entry by changing its status), that is currently not available. We recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on: http://support.solspace.com/support/discussions

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


# Question
Title: Choosing user_notification_template based on selection made in form
Is there a way to specify a user\_notification\_template based on a select made in the form?

I have three options:

```
Red
Green
Blue

```

If the user chooses red then the red notification is sent upon form submit, green for green and blue for blue. Is this at all possible? (Just using colours for simplicity)

I did see How to set "Admin Notify" preference based on form input value? question/answer however I'm not sure how to use this in my case?

Thank you.

# Answer
> 0 votes
Since `user_notification_template=""` is a parameter, and there is no form field for it, it isn't possible to modify this setting once the form has loaded. I recommend submitting this as a Feature Request under the specific add-on category. http://support.solspace.com/support/discussions

This may be far-fetched, but you could use javascript to reload the form with a new user\_notification\_template value after selecting one of your options. The value if the user\_notification\_template would be passed in a segment in the URL.

For example, if you select "Red", the form reloads with a URL link this (this is an *example*): `http://mysite.com/contact/redTemplate`

Then, in your `{exp:freeform:form}` (or `{exp:freeform:composer}`) parameters, use the segment in your `user_notification_template=""` parameter, i.e.:

```
user_notification_template="{segment_3}"

```

Of course make sure to have a `redTemplate` notification template set up in the CP.

> *Be careful of parse order! **Turn on Template Debugging** if necessary*

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


# Question
Title: Is it possible to duplicate the Low reorder sets across the sites automatically?
How can I duplicate the same Low Reorder sets that I have on my master site on all the duplicated sites on MSM?

I have 50 sites to deal with and I don't want to do it manually.

Thanks, Salvo

# Answer
> 0 votes
There aren't any hooks in place for when a MSM site is duplicated, so Low Reorder (nor any other 3rd party add-on) can do certain stuff when this happens.

If you don't want to do this via the CP, you'd have to manually create some SQL queries and insert those in the database yourself.

---
Tags: low-reorder, duplicate
---


# Question
Title: Channel Entries tag pair using a Playa field is not populating in the view template
I have a working template that is included in the right rail of my EE site.

This template pulls from a channel that simply relates entries from other channels to this specific channel on a one-to-one basis and is used as a sort of "highlight reel" or "Top 5" for the sidebar. The relationship is using Playa to link multiple different channel's entries to this one.

It works throughout the site with exception to an entry's view template. In that template it only returns with highlighted entries that match that channel. I am simply using the same embed code for another template that is embedded into every page. It embeds like:

```
index <- right_rail <- highlight_reel

```

For example, the highlight reel can pull from Activities, Events, and Food channels using Playa for the relationship. When you navigate to the view template of a particular Events entry this only displays Events entries that have been related.

Is there a configuration or parameter that needs to be set in order to keep the results consistent?

*Let me know if there is anything else that would help you help me.*
*I've got this question also posted here because I didn't realize that this place existed. I'll sync the two if an answer pops up*

Some additional code for the loop:

```
{exp:channel:entries channel="most_popular" dynamic="yes" orderby="date" sort="desc" limit="5"}
    {exp:playa:children field="popular_entry" status="not closed" disable="members" limit="1"}

```

**Thanks a bundle in advance!**

# Answer
> 0 votes
I was directed to a similar question that was asked and it totally solved the issue.

My mistake was that I had assumed that it would maintain the entry\_id but by embedding it I was able to solve it.

Thanks a bunch!

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


# Question
Title: Category URL Structure in Espresso Store with Relationship Field
We’re currently setting up an Expresso Store and are having a hard time getting the categories to show up in the url through a relationship field. Essentially, we’d like the user to be able to select a product through a relationship field and then have that product’s parent category (ideally parent and child if present) in the url.

The resulting path would be template\_group/category/{parent}/{child}/{individual-product-here}

Code:

```
            {exp:channel:entries channel=“products" limit="1" dynamic="yes"}
                        <!— Relationship Field Begins —>
                        {related_product_1}
                        {exp:store:product entry_id="{related_product_1:entry_id}" form_class="form-horizontal" return="store/shopping-cart"}
                        <div class="product">
                            {exp:channel_images:images entry_id="{entry_id}" limit="1"}
                            {related_product_1:product_gallery}
                            <img src="{image:url:listing}" alt="{title}"  />
                            {/related_product_1:product_gallery}
                            {/exp:channel_images:images}
                            <h3><a href="#">{related_product_1:title}</a></h3>
                            <p class="product-description">
                            {exp:trunchtml chars="60" ending="..."}{related_product_1:product_description}{/exp:trunchtml}
                            </p>
                            <p class=“product-price">{if on_sale}{price}{if:else}{regular_price}{/if}</p>

                            <a href=“{url_title_path=“products/category/…. need help”}”><div class=“glass”></div></a>

                            {!--<button class="add-to-cart" type="submit" value="Add to Cart"></button>--}
                            <a href="#"><div class="add-to-cart"></div></a>
                        </div>
                        {/exp:store:product}
                        {/related_product_1}
                        {/exp:channel:entries}

```

Update: I think I have a resolution with the item, but the displayed results truncate… any help would be appreciated.

```
<p><a href=”{path="products/category/{category_url_title}/{related_product_1:url_title}”}”>{category_name}</a></p>

```

Generates this url:

http://www.example.com/products/category/%7Bcategory\_url\_title/category/controls/featured-product-name-5

I’m not sure why the category\_url\_title is not accurate? Adds a %7B… then the category\_url\_title… but then completes the category url.

# Answer
```
{exp:channel:entries channel="products" limit="1" dynamic="yes"}
                        {related_product_2}
                        {exp:store:product entry_id="{related_product_2:entry_id}" form_class="form-horizontal"}
                        <input type="text" value="1" size="3" name="item_qty" style="visibility:hidden; display:none;">
                        {modifiers}
                          <select name="{modifier_input_name}" style="visibility:hidden; display:none;">
                            {modifier_options}
                              <option value="{option_id}" title="{if price_mod_val} ({price_mod}) {/if}" {if option_first} selected {/if}>
                                {option_name}
                                {if price_mod_val} ({price_mod}) {/if}
                              </option>
                            {/modifier_options}
                          </select>
                        {/modifiers}
                        <div class="product">
                            {exp:channel_images:images entry_id="{entry_id}" limit="1"}
                            {related_product_2:product_gallery}
                            <img src="{image:url:listing}" alt="{title}"  />
                            {/related_product_2:product_gallery}
                            {/exp:channel_images:images}
                            <h3>
                            <a href="{path="products/item/"}{related_product_2:categories show_group="1"}/{category_url_title}{/related_product_2:categories}/{related_product_2:url_title}"}">
                            {related_product_2:title}
                            </a>
                            </h3>
                            <p class="product-description">
                            {exp:trunchtml chars="60" ending="..."}{related_product_2:product_description}{/exp:trunchtml}
                            </p>
                            <p class="product-price">{if on_sale}{price}{if:else}{regular_price}{/if}</p>

                            <a href="{path="products/item/"}{related_product_2:categories show_group="1"}/{category_url_title}{/related_product_2:categories}/{related_product_2:url_title}"}"><div class="glass"></div></a>

                            <input id="related-item-{entry_id}" type="submit" style="display:none;" name="submit" value="1">
                            <input type="hidden" name="XID" value="{XID_HASH}">
                            <a href="javascript:void(0);" onclick="$('#related-item-{entry_id}').click();">
                            <div class="add-to-cart"></div>
                            </a>

                        </div>
                        {/exp:store:product}
                        {/related_product_2}
                        {/exp:channel:entries}

```

Generating the Link:

```
<a href="{path="products/item/"}{related_product_2:categories show_group="1"}/{category_url_title}{/related_product_2:categories}/{related_product_2:url_title}"}"><div class="glass"></div></a>

```
> 0 votes

---
Tags: expresso-store
---


# Question
Title: ExpressionEngine Expresso Store Price Filter in DropDown Select Menu Dynamically Setting Values Question
We’re currently working on http://goo.gl/Cxk5Aw and the client would like to add a price min / max filter on the sidebar, but we’re having an issue with keeping the segments of the url clean. I was curious if it was possible to add the min / max into our drop-down menu and have the data stored in segment\_3 like we have for the pagination entry display value & sort by?

Current Code:

Drop Down List

```
{exp:dynamo:form return="products/specials" search_id="{segment_3}" id="options_form"}
                                <p>Show <select class="form_option" name="limit">
                                <option value="9" {if limit == 9} selected="selected"{/if}> 9 </option>
                                <option value="18" {if limit == 18} selected="selected"{/if}> 18 </option>
                                <option value="27" {if limit == 27} selected="selected"{/if}> 27 </option>
                                </select>
                                per page</p>
                                <p>Sort by <select class="form_option" name="orderby">
                                <option value="title" {if orderby == 'title'} selected="selected"{/if}> Name </option>
                                <option value="price" {if orderby == 'price'} selected="selected"{/if}> Price </option>
                                </select></p>
{/exp:dynamo:form}

```

JavaScript:

```
<script type="text/javascript">
$(document).ready(function() {
    $('.form_option').change(function(e){
        console.log('Change');
        $('#options_form').submit();
    });
});
</script>

```

Store Code:

```
{exp:store:search channel="products" limit="9" dynamic="yes" orderby="date" sort="desc" dynamic_parameters="limit|orderby" search_id="{segment_3}" paginate="both" search:on_sale="yes"}
                    {exp:store:product entry_id="{entry_id}" form_class="form-horizontal" return="store/shopping-cart"}

```

# Answer
> 0 votes
```
{exp:dynamo:form return="products/specials/" search_id="{segment_3}" id="options_form"}
                            <p>Show <select class="form_option" name="limit">
                            <option value="9" {if limit == 9} selected="selected"{/if}> 9 </option>
                            <option value="18" {if limit == 18} selected="selected"{/if}> 18 </option>
                            <option value="27" {if limit == 27} selected="selected"{/if}> 27 </option>
                            </select>
                            per page</p>
                            <p>Sort by <select class="form_option" name="orderby">
                            <option value="title" {if orderby == 'title'} selected="selected"{/if}> Name </option>
                            <option value="price" {if orderby == 'price'} selected="selected"{/if}> Price </option>
                            </select> </p>
                            <p>Min: <select class="form_option" name="search:price:min">
                            <option value="0" {if search:price:min == '0'} selected="selected"{/if}> 0 </option>
                            <option value="100" {if search:price:min == '100'} selected="selected"{/if}> 100 </option>
                            <option value="200" {if search:price:min == '200'} selected="selected"{/if}> 200 </option>
                            <option value="300" {if search:price:min == '300'} selected="selected"{/if}> 300 </option>
                            <option value="400" {if search:price:min == '400'} selected="selected"{/if}> 400 </option>
                            <option value="400" {if search:price:min == '500'} selected="selected"{/if}> 500 </option>
                            </select></p>
                            <p>Max: <select class="form_option" name="search:price:max">
                            <option value="1000" {if search:price:max == '1000'} selected="selected"{/if}> 1,000 </option>
                            <option value="500" {if search:price:max == '500'} selected="selected"{/if}> 500 </option>
                            <option value="400" {if search:price:max == '400'} selected="selected"{/if}> 400 </option>
                            <option value="300" {if search:price:max == '300'} selected="selected"{/if}> 300 </option>
                            <option value="200" {if search:price:max == '200'} selected="selected"{/if}> 200 </option>
                            <option value="100" {if search:price:max == '100'} selected="selected"{/if}> 100 </option>
                            </select>
                            </p>
{/exp:dynamo:form}

```

Product Display Set-Up:

```
{if segment_3 ==''}
                    {exp:store:search channel="products" limit="9" dynamic="yes" orderby="date" sort="desc" dynamic_parameters="limit|orderby" search_id="{segment_3}" paginate="both" search:on_sale="yes" search:price:min="0" search:price:max="100000"}
                    {exp:store:product entry_id="{entry_id}" form_class="form-horizontal" return="store/shopping-cart"}
                    {if:else}
                    {exp:store:search channel="products" limit="9" dynamic="yes" orderby="date" sort="desc" dynamic_parameters="limit|orderby" search_id="{segment_3}" paginate="both" search:on_sale="yes" search:price:min="{segment_3}" search:price:max="{segment_3}"}
                    {exp:store:product entry_id="{entry_id}" form_class="form-horizontal" return="store/shopping-cart"}
                    {/if}

                        <input type="text" value="1" size="3" name="item_qty" style="visibility:hidden; display:none;">
                        <div class="product">
                            {exp:channel_images:images entry_id="{entry_id}" limit="1"}
                            {product_gallery limit="1"}
                            <img src="{image:url:listing}" alt="{title}"  />
                            {/product_gallery}
                            {/exp:channel_images:images}
                            <h3><a href="{path="products/item/"}{categories show_group="1"}/{category_url_title}{/categories}/{url_title}"}">{title}</a></h3>
                            <p class="product-description">
                            {exp:trunchtml chars="60" ending="..."}{product_description}{/exp:trunchtml}
                            </p>
                            <p class="product-price">{if on_sale}{price}{if:else}{regular_price}{/if}</p>
                            <a href="{path="products/item/"}{categories show_group="1"}/{category_url_title}{/categories}/{url_title}"}">
                            <div class="glass"></div>
                            </a>

                            <button class="add-to-cart" type="submit" value="Add to Cart"></button>
                            {!--<a href="#"><div class="add-to-cart"></div></a>--}
                        </div>
                        {/exp:store:product}
                        {/exp:store:search}

```

We set it up use a version of exp:store:search or the other dependent on if segment\_3 was empty or not. This allowed us to store the min / max values in the search\_id which also assists in making the url cleaner and helps with the sites category filter (we don't have to account for two additional segments - min / max)

---
Tags: expresso-store
---


# Question
Title: Expresso Store - Search on Sale w/ Entry Count
Is there a way to incorporate the search:on\_sale and entries\_entries number to display the total number of entries that are on sale?

```
{exp:store:search channel="products" search_id="{segment_3}" search:on_sale="yes"}
{exp:entries_number channel="products"}
{entries_number} Item(s)
{/exp:entries_number}
{/exp:store:search}

```

# Answer
> 0 votes
You will want to use `{total_results}` to show the total. Something along the lines of

```
{exp:store:search channel="products" search_id="{segment_3}" search:on_sale="yes"}
 {if count == 1}
  {total_results} Item{if total_results > 1}s{/if}
 {/if}
All other fields go here

{/exp:store:search}

```

Will show the total number of returned items

---
Tags: expresso-store
---