# Question
Title: Mini Calendar day heading not starting on Sunday as first day of week
Here is the code:

```
<!-- Display week day letter heading ( S M T W T F S ) -->
<tr id="mc_days">
  {display_each_day_of_week}
    <th class="{if day_of_week_is_weekend}weekend{/if}
      {if day_of_week_is_current}current{/if}">{day_of_week_one}
    </th>
  {/display_each_day_of_week}
</tr>

```

What happens is for example June 1 2014 is on on Sunday but my calendar has it on Saturday.

The header format displays as S S M T W T F. If I click my next button to go to the month of July the header changes to F S S M T W T. If I go to August the header displays as S S S M T W T as you can see Friday turns into an S.

# Answer
I used the following in my Calendar widget:

```
{calendar_heading}
   <td class="calendarDayHeading">{lang:weekday_short}</td>
{/calendar_heading}

```

Within my entire calendar widget...:

```
{exp:channel:calendar switch="calendarToday|calendarCell" channel="events" show_future_entries="yes"}
  <table class="calendarBG events-calendar" border="0" cellpadding="6" cellspacing="1" summary="My Calendar">
      <tr class="calendarHeader">
        <th>
            <div class="calendarMonthLinks">
                <a href="{previous_path='events/index'}"><<</a>
            </div>
        </th>
        <th colspan="5" class="calendarMonthTitle"><a href="/events/{date format="%Y/%m"}">{date format="%F %Y"}</a></th>
        <th>
            <div class="calendarMonthLinks">
                <a class="calendarMonthLinks" href="{next_path='events/index'}">>></a>
            </div>
        </th>
      </tr>
      <tr>
      {calendar_heading}
      <td class="calendarDayHeading">{lang:weekday_short}</td>
      {/calendar_heading}
      </tr>
      {calendar_rows}
          {row_start}<tr>{/row_start}
          {if entries}
              <td class='{switch}' align='center'><a href="{day_path='events/index'}">{day_number}</a>
              </td>
          {/if}
          {if not_entries}
              <td class='{switch}' align='center'>{day_number}</td>
          {/if}
          {if blank}
              <td class='calendarBlank'>{day_number}</td>
          {/if}
          {row_end}</tr>{/row_end}
      {/calendar_rows}
    </table>
{/exp:channel:calendar}

```
> 0 votes

---
Tags: solspace-calendar
---


# Question
Title: Hosting an external web app within EE pages
Not an EE developer, but trying to answer a question for a client.

They have a database (oracle) that they know they'll need to create a custom front end for, but they want it to somewhat integrate with their EE site. By integrate I just mean they'll create a page called "peoplesearch" and then on that page their custom PHP will execute within the template to connect to the database. I'd imagine that most of the app will change page content via ajax so that it at least won't need to worry much about multiple pages for the app, but it would also be nice if EE would allow for URL manipulation for deep linking into the app for a particular search etc.

ee\_database \<-\> ee\_page -\> webapp \<-\> oracle\_database

Is this possible? Does this question make sense?

# Answer
Yes that's entirely possible. You can execute any PHP within your template, or create a custom extension to manipulate data for you.
> 0 votes

---
Tags: templates, php
---


title: Relationship: what I'm doing wrong?

text:
# Question
Title: Relationship: what I'm doing wrong?
I can not run the relationship feature since upgrading to 2.6.1. I've searched through he forums and I found similar issues, but the answers there didn't help me, so I'm posting my question here. Sorry if I duplicate anything. I have a channel called "noticies" with a field that relates inputs of the same channel. The channel field is single relationship called "noticies\_relacionades" My code is as follows:

```
{exp:channel:entries  status="not closed"}
…
    {if noticia_relacionada}
     <div class="well well-small">
        <p class="blau-fosc bottom">TAMBÉ ET POT INTERESSAR</p>
          {noticia_relacionada}
              <h4 class="top">
                 <a href="{title_permalink="noticies/article"}" target="_top" title="{title}">
                    <i class="icon-arrow-right" style="padding-top: 2px;"></i>
                    {noticia_relacionada:title}
                 </a>
              </h4>
           {/noticia_relacionada}
        </div>
    {/if}
{/exp:channel:entries}

```

Thanks in advance. Any help is wellcome.

# Answer
One change I would recommend is to the structure. Try something like this instead:

```
{exp:channel:entries  status="not closed"}
{if noticia_relacionada:count == "1"}
 <div class="well well-small">
    <p class="blau-fosc bottom">TAMBÉ ET POT INTERESSAR</p>
{/if}
      {noticia_relacionada}
          <h4 class="top">
             <a href="{title_permalink="noticies/article"}" target="_top" title="{title}">
                <i class="icon-arrow-right" style="padding-top: 2px;"></i>
                {noticia_relacionada:title}
             </a>
          </h4>
       {/noticia_relacionada}
{if noticia_relacionada:count == noticia_relacionada:total_results}
    </div>
{/if}
{/exp:channel:entries}

```

A relationship field is a bit different than a regular text field - and so the most practical way to handle the conditional around whether it has any entries within it is to use the loop itself - since it won't return results if no entries (related entries) exist.

I'm not certain if this will solve whatever issue it is that you're facing since you haven't described what's not working about it - but I thought I'd make that recommendation regardless.
> 2 votes

# Answer
I'm not sure if this could be the answer, but just a thought.. instead of status="not closed" using status="open" ?
> 1 votes

# Answer
I believe I had the same problem when I tried using a relationship field relating to the same channel. When I included status="not closed" within the relationship field call as well, it finally worked for me!

Here's my code: `{exp:channel:entries entry_id="133" channel="channel_name" status="not closed"}
 {relationship_field status="not closed"}
 Assigned Student: {relationship_field:title}
 {/relationship_field}
 {parents field="relationship_field" status="not closed"}
 Assigned Coach: {parents:title}
 {/parents}
{/exp:channel:entries}`

Make sure to change out relationship\_field with the name of your custom field.
> 1 votes

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


title: Can't reorder Structure pages

text:
# Question
Title: Can't reorder Structure pages
I'm having issues with Structure module... When I try to make a child page, it does this...

But if I remove it as a child page, and refresh it puts the styling back but the page is in totally the wrong place?!

Why could this be happening?

# Answer
> 1 votes
Turns out all I needed to do was run Structure Debugging on it. I didn't know this existed but it fixed my problem.

> http://buildwithstructure.com/documentation/debug\_mode\_for\_page\_data/

Simply change the debug option to **TRUE** in the MCP file, run the debugging. This removed my entries from Structure, but they were still in **Publish \> Edit**, so I just added a **Structure URL Title** to each entry.

Boom, done.

# Answer
> 1 votes
How many pages/entries are structure managed in total? Looks like you might be suffering from the structure reorder bug (which is not a structure bug).

Take a look at http://madebyhippo.com/blog/view/structure\_reorder\_bug which will give you more details on it.

Alternatively, if you file a support bug with Travis at Structure, quoting this SE post - he can redirect the ticket through to me where I can have a look for you.

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


# Question
Title: If category id = x AND if there is an entry then display
I have a list of images in 4 different categories that I want to display on a search results page. My logic is that the pictures are to be displayed under 2 conditions, 1 - it is in its respective category id, 2 - there are actually entries that have that category.

```
{if "{category_id}" == "1" &&  count >= "1"}
Image group 1
{/if}
{if "{category_id}" == "2" &&  count >= "1"}
Image group 2
{/if}

```

This code is not working,I think I'm messing up the syntax.

Some more code:

```
{exp:channel:categories channel="product" category_group="1" style="linear"   parent_only="yes" show="{embed:prod_cat}" show_empty="no"}
{if count == '1'}
<ul class="tabs-nav clearfix">
{/if}
    <li>
        <a href="#tab_{category_url_title}">{category_name} Product<span class="indicator">        </span></a>
    </li>

    <li class="logo-strip">
        {!-- v neck tees --}
        {if "{category_id}" == "1"}
        <!-- Nike -->
        <img src="/images/logos/nike.jpg" class="float-left">
        <!-- Adidas -->
        <img src="/images/logos/adidas.jpg" class="float-left">
        <!-- Cat -->
        <img src="/images/logos/cat.jpg" class="float-left">
        {/if}

        {!-- long sleeve tees --}
        {if "{category_id}" == "2"}
        <!-- Puma -->
        <img src="/images/logos/cat.jpg" class="float-left">
        <!-- Lacoste -->
         <img src="/images/logos/lacoste.jpg" class="float-left cat_2">
        {/if}

    </li>

    {if count == total_results}
</ul><!-- end nav -->
{/if}
{/exp:channel:categories}

```

# Answer
Your question doesn't say "what" isn't working so I'm going to add here what "should" work without knowing the extent of what you're doing.

```
{exp:channel:categories channel="product" category_group="1" style="linear" parent_only="yes" show="{embed:prod_cat}" show_empty="no"}
    {if category_id == "1"}
        Image group 1
    {/if}
    {if category_id == "2"}
        Image group 2
    {/if}
{/exp:channel:categories}

```

Since you have the parameter `show_empty="no"` set, categories without entries shouldn't be returned. `{if category_id == "1"}` then controls which image shows for the category ID.

If results are not returning correctly, it's possible the `show="{embed:prod_cat}"` parameter is causing your problems.
> 1 votes

---
Tags: conditionals
---


title: Setting default upload area for Assets

text:
# Question
Title: Setting default upload area for Assets
Hopefully a simple answer, but at the moment, I can't figure it out.

I'm using an Assets field in a channel entry. When the client clicks on the "Add file" button, it defaults to the "Recent Uploads" smart source.

The client only has one place they can upload files to, and it's set in the channel field settings (only upload folder checked off).

Is there a way to default to the upload folder vs. the "recent uploads" area?

# Answer
I'd say the answer is no based on this blog post about the addition of that Recent Uploads functionality: http://pixelandtonic.com/blog/assets-2.2

> Now with Assets 2.2, **you’re always taken to the Recent Uploads** source immediately after uploading files, where we can be sure that your file will be visible.

This talks about being taken to Recent Uploads after upload a file which is a little different from your question, but it seems they would have made that universal and so it would also happen when clicking through from an entry.
> 0 votes

---
Tags: assets, pixelandtonic
---


# Question
Title: What is best practice for protecting templates saved as files?
I've just discovered that all of the templates I'm saving to the filesystem are accessible through the browser if the name is known, and now I've got a case of the screamin' heebie jeebies. For example, if I have a template-group/template arrangement such that the URL http://mysite.tld/news/recent delivers content, then when I point my browser at http://mysite.tld/templates/default\_site/news.group/recent.html I'm then presented with all my raw template code. Is this expected behaviour and if so why? Is there a native EE way to stop this from happening, or is it best practice to use rewrite rules at the web server?

I'd really like to hear from some of you on how you've dealt with this problem in your own sites.

Many thanks in advance,

Andy

# Answer
It looks like you moved your templates folder to outside the system folder. Since you already did it, why not move it to above the web root?

Just remember to update the related settings.
*(see "Server path to site’s templates" at the bottom of the page)*

To keep all system files above the web root is good practice.

**Alternatively...**

If for some reason you don't want to or can not move above web root, another solution is to put a `.htaccess` file in your templates directory with:

```
deny from all

```

This will prevent direct access to the templates at URLs like `http://example.com/templates/default_site/news.group/index.html`, but ExpressionEngine will still be able to load the template just fine at `http://example.com/news`
> 5 votes

---
Tags: templates, security, template-scripting
---


title: freeform: give freeform a name

text:
# Question
Title: freeform: give freeform a name
I want to give my form a name but it's not appearing

something like

```
{exp:freeform:form

   name='myform'

   collection=""
   required="
   return=""
   template=""
   send_user_email="no"

}

```

gives but not a string with name='myform'

# Answer
I believe the appropriate syntax is `form:name='myform'`

It looks like you're using an older version of Freeform (since you're using the collection parameter), so you may need to dig up the docs for that version, or update.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Redeem Coupon Form Inside Expresso Store Checkout
I am using expresso store as my checkout form (which is already using the checkout & product tags to wrap the products inside of the cart), but need an additional form which consists of a simple textbox and button inside of these tags which will redeem a specific coupon. If I use the HTML tag, the button to go to the next step does not work (as there are now two forms on the page). How would I be able to include this form and then link the 'Redeem' button to a function that I already have in my module? Is there a way to achieve this?

# Answer
Follow Justin's good advice for coupon redemption using the built-in Store functionality. See Update Cart on the Checkout Tag Docs.

> How would I be able to include this form and then link the 'Redeem' button to a function that I already have in my module?

Then along *with* using the native update cart function you can run your own method when a coupon is redeemed by putting your method in an *extension* that uses one of Store's Hooks. See Store's Order Update Hooks.
> 4 votes

# Answer
You should be able to add a field for the coupon code into your existing HTML form for the checkout then just include an update cart button next to the coupon code input.
> 3 votes

---
Tags: expresso-store, checkout, ee, act
---


# Question
Title: How to link Extensal CSS files and link external image paths in css files?
When i use EE's internal CSS template, the css works fine.

But i have decided to take the css and javascripts out of ee templates and keep them in their own separate folders at the root of EE installation.

Here is my structure:

* root

+ assets
        - scripts
        - styles
    + images
    + system
    + themes

This is the code in my index.html header area

### (1st Try)

```
<link rel="stylesheet" href="{path='assets/styles/style.css'}" media="all" />
<link rel="stylesheet" href="{path='assets/styles/color.css'}" media="all" />

```

### (2nd Try)

```
<link rel="stylesheet" href="{site_url}assets/styles/inner.css" />
<link rel="stylesheet" href="{site_url}assets/styles/flexslider.css" />

```

Here are the

```
#selector{ background:url({site_url}images/front/top-pattern.png);}

```

## Note:

**The css files are loaded correctly in HTML but the images are not loaded.**

I checked with firbug and it says

> Failed to load the given URL

The issue is with the image path inside the css files.

I cant figure out what am i missing ?

# Answer
> 3 votes
EE won't parse tags that are stored outside of templates unless you do some trickery to send them back into the parser.

Keep them in templates if you need the tags parsed. Though I should note that the parsing abilities for CSS and Javascript templates seem limited.

While you are at it be sure to look into a minimizing module, this doesn't solve your problem but they are useful for speeding up your site and combining css/js files. I use Automin, there's another called Minimee.

# Answer
> 2 votes
I'd avoid anything based on {site\_url} and opt for relative paths instead. With what you've supplied, simply placing an "/" instead of {site\_url} would suffice.

That being said I would also avoid placing css in a template and do it the old fashioned way to stop this errant behaviour which also gives the added benefit of making solving any css issue, that much easier because you've removed it from ee control.

# Answer
> 0 votes
If the CSS file isn't being parsed by EECMS, using the `path` variable, you can't use variables or snippets on it.

This **isn't** an EECMS issue.

Since the image directory isn't a sibling of your CSS directory (`/assets/styles`), but a sibling of its parent (`/assets`), you need to go up to levels on your image paths.

```
#selector{ background:url(../../images/front/top-pattern.png); }

```

The first `../` goes up to the `assets` folder. The second goes one level up, to the `root` folder. Just then you can go down to the `images` folder.

---
Tags: javascript, css, links, image-path
---


# Question
Title: Automatically delete entries missing from import with Solspace Importer?
I have a client who will be maintaining a phone directory on their site, updating it on a roughly monthly basis. The import will be a CSV file, and my plan is to use Solspace Importer to turn the data into channel entries.

What I'm wondering is: is there a way to automatically remove entries if they don't exist in a newer import (for example, an employee has left the company and so isn't in the new CSV file).

I found a similar discussion here: Delete records that were not updated

...but since this directory data won't be be imported on exact intervals, something automated/scheduled with cron won't work.

Thanks in advance for any suggestions.

# Answer
> 0 votes
Importer has the ability to delete an entry when a match is found (using the duplicate entry detection feature), but unfortunately it's not possible to delete entries where a match *wasn't* found. What would therefore need to be done is delete (or close, or expire) entries before importing new ones. Unfortunately Importer doesn't have a feature to clear channels of entries before imports. You would have to do this manually before running the import.

I 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-importer
---


# Question
Title: Would User categories be a good way to allow one user group to manage a subset of members?
I'm envisaging an 'account manager' group, who would be able to view and edit the profiles of other member groups ONLY if they were in the same category.

Different organisations each have multiple employees using the site, and a manager from each organisation needs to be able to edit their employees' details. So the categories would be organisation names, which allows the creation of a User list for each manager, showing only members in their category. They click through to an edit form, which of course should also check that the member really is in their category.

Of course we could create multiple member groups to achieve this, but there are hundreds of organisations, so that's not really an option.

Does this sound feasible? Any security flaws, for example?

# Answer
> 0 votes
Sounds like a viable solution, yes. You would likely use `{exp:user:users}` to list your members, and display only those under a provided category\_id (which is the category\_id assigned to your manager account user) in the `category=""` parameter: http://www.solspace.com/docs/user/users/#category

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


title: Gateway Extension Error

text:
# Question
Title: Gateway Extension Error
I installed a new custom gateway I use via omnipay into EE2 backend, but when I go to 'Expresso Store' and click on 'Payment Gateways' to see if my payment gateway displays in the list, it gives me the following error:

```
Fatal error: Uncaught exception 'Omnipay\Common\Exception\RuntimeException' with message 'Class '\Omnipay\PayU\Gateway' not found' in C:\wamp\www\flook\trunk\backend\expressionengine\third_party\store\vendor\omnipay\common\src\Omnipay\Common\GatewayFactory.php

```

What could the problem be?

# Answer
I misspelt Omnipay (Onmipay) in my extension. Watch your spelling guys! Stupid mistake by me!
> 0 votes

# Answer
You need to tell Store about your new gateway in the ext. file. Use the `store_payment_gateways` hook and pass in the $gateways array:

```
public function store_payment_gateways($gateways)

```

Then ensure that you add your gateway to the list:

```
$gateways[] = 'PayU';

```

Include the autoloader:

```
$composer = require(PATH_THIRD.'store/autoload.php');

```

And tell Composer where to find your gateway:

```
$composer->add('Omnipay', __DIR__);

```

Putting it all together it should look something like this as a single method:

```
public function store_payment_gateways($gateways)
{
    // Language file?
    ee()->lang->loadfile('store_payu');

    // Add the new gateway to Store's known list
    $gateways[] = 'PayU';

    // Tell Store where to find the class files
    $composer = require(PATH_THIRD.'store/autoload.php');
    $composer->add('Omnipay', __DIR__);

    return $gateways;
}

```
> 3 votes

---
Tags: expresso-store, ee2, extension
---


# Question
Title: Expression Engine MSM with 2 main sites and 5 subdomains
Our main question is how do we configure Expression Engine to handle 2 main site and 5 subdomains using Multi Site Manager (MSM), keeping in mind that the development version of the main site (ee28.sode.org) is currently running as a subdomain.

We currently have three sites running on two different versions of Expression Engine on Nexcess eep-100 hosting plan. These three sites have three respective folders on the server.

# 1. *www.sode.org*

* EE1
* set up as the master domain for which Nexcess creates a directory at the root level of the account
* This site is live
* This site will become members.sode.org running on EE1 so we don't have to recreate the membership portal

# 2. *www.plungede.org*

* EE2.8 (base EE install for Multi Site Manager MSM)
* set up as a secondary domain for which Nexcess creates a directory at the root level of the account
* This site is live

# 3. *ee28.sode.org*

* EE2.8 (added with MSM to the plungede.org install. Shares system folder w/ plunge and and templates are inside plungede.org folder on server
* Set up as secondary domain for which Nexcess creates a directory at the root level of the account
* This site is in development site
* This will become www.sode.org
* This will hold the 5 microsites (subdomains).
    + They are each set up as a subdomain and Nexcess creates a directory for each inside the secondary domain directory of sode.org on the server.

Is it possible to configure Expression Engine to handle 2 main site and 5 subdomains, keeping in mind that the development version of the main site (ee28.sode.org) is currently running as a subdomain.

Please feel free to ask questions for clarification as we are a little confused ourselves!

# Answer
The answer is in understanding how MSM works.

MSM doesn't really care what you call your sites, www.domain.com or something.domain.com so technically there are no "main" sites.

If you look at a typical folder structure for an MSM setup you may have in the root folder:

index.php (usually the site that EE is installed in, eg www.mysite.com)

/site2/index.php (an MSM site with full domain mapping, eg www.site2.com)

/site3/index.php (an MSM site with subdomain mapping, eg site3.mysite.com)

/site4/index.php (an MSM site with subdomain mapping, eg site4.mysite.com)

/site5/index.php (an MSM site with subdomain mapping, eg site5.mysite.com)

/site6/index.php (an MSM site with subdomain mapping, eg site6.mysite.com)

/site7/index.php (an MSM site with subdomain mapping, eg site7.mysite.com)

Does that help?
> 1 votes

---
Tags: multiple-sites
---


# Question
Title: Freeform Pro form not appearing in channel entry
I'm using Freeform Pro and added a new form through the Composer, and then added the new form to a channel entry. After saving the channel entry, the form appears in the preview in the backend. However, when viewing the live site, the form does not appear.

Am I missing a step in the implementation that would cause this not to appear?

# Answer
> 0 votes
Re-reading the documentation, I was able to get this working using the following code:

```
{exp:channel:entries}{general-contact}{/exp:channel:entries}

```

{general-contact} is the Freeform channel field short name.

---
Tags: solspace-freeform
---


title: Shipping surcharge on cartthrob orders

text:
# Question
Title: Shipping surcharge on cartthrob orders
I need to add a flat-rate summer shipping surcharge on all orders. What is the best way to do this?

# Answer
> 0 votes
What I ended up doing is duplicating my shipping plugin, so that I have a summer shipping plugin as well as the regular one.

---
Tags: cartthrob
---


# Question
Title: Control Panel checkboxes working incorrectly
I am having an issue where checking a checkbox next to one entry in my control panel is causing all the previous checkboxes to become checked as well. Obviously it's not supposed to do this, and I have no idea how to fix it or what's going on. I thought it might have been Zenbu, but everything works fine on my local version, and the staging version has all the same code and add-ons installed.

I've disabled my custom CP theme to try the default again with no change. I've disabled almost all the extensions, accessories (not modules) and the CP theme that could have been affecting the publish layout without any effect:

* MX extended content menu
* NSM morphine theme
* responsive CP
* Sassy CP theme
* Zenbu

I haven't listed the modules, but Zenbu is the only one I can think of that might be affecting this. If I uninstall the module I will have to set all the layouts up again, but if this fixes the checkboxes, I'm willing to do that.

I checked the console and there are no Javascript errors, so I can't figure out how to troubleshoot this, since disabling almost everything (that won't cause me lots of extra time to set up again) had no effect.

Here is a screenshot of what happens

# Answer
This was a browser extension problem for me. LastPass has an "auto fill" feature that seems to conflict in some way with the way checkboxes work in the EE control panel. Disabling auto fill for the particular site worked.
> 5 votes

---
Tags: control-panel, publish-layout, checkbox
---


# Question
Title: Can Freemember be used for the "Account Activated" EE screen?
EE 2.8.1, Freemember 2.3.2

I'm working on a site where member registration is set to "Self Activation via Email". When a user clicks on the activation link in the email they receive after initial registration, they get sent to the ugly gray box EE profile template screen that states "Thank You! Your account has been activated, etc". Is there any way for Freemember to manage this screen as well?

# Answer
> 1 votes
In a word, no, I don't believe Freemember has template tags to adjust the email activation page.

This could probably be added to freemember with a pull request though, the same way the reset password process works.

---
Tags: freemember, registration, activation
---


title: Pulling Entries by Parent Category

text:
# Question
Title: Pulling Entries by Parent Category
It seems pretty tedious to have to type in all the Category Ids to list all parent & children entries.

```
{exp:channel:entries channel ="channel_name" category="17|4|1|5|13|9|14|25|2|7|24|3|6|28"     }

```

Is there more maintainable way to do this?

# Answer
> 0 votes
If Auto-Assign Category Parents is enabled, you can list just the parents.

---
Tags: categories
---


# Question
Title: Spam Bot Member Registrations in ExpressoStore
I am running Expresso Store on the following site: https://peopleplacestraining.org

Everything seems to be working well, except for one thing…we're getting several spambot user registrations a day from the member registration portion of the checkout form. They're not even going through the order process - they're somehow creating members through the backend.

I have Snaptcha enabled on our site, but because the form used by Expresso Store is not the kind of form Snaptcha seems to recognize, it doesn't work. It just gives the error message even though I'm testing the form as a legitimate user, and have verified that Javascript is enabled.

Next, I tried adding two hidden fields and using PHP to render an error message and a blank page (instead of the order confirmation screen) if those two fields are populated, but I couldn't get it to render the page correctly (it was either totally blank or showed both the error message AND the order confirmation page).

Can someone please explain to me how I'm supposed to prevent Spambots from registering as members on my site using your product? Shouldn't this be a little more secure?

# Answer
> 3 votes
ExpressionEngine automatically creates a 'member' area on each standard installation, by default this is `/member/`.

Looking at your site I would say the spam bots are registering through the generic `/member/register` URL -\> https://www.peopleplacestraining.org/member/register

In the ExpressionEngine control panel, under `Members -> Preferences -> Profile Triggering Word` you can change the value from 'members' to something else, which change the URL of your automatically generated members pages. For example changing the triggering word to `users` would make `/users/register` the new valid URL -- This MAY help curb some spam.

But, I've noticed that you are using the `/members/login` portion of the members templates, and if you change this then the Spam bots will detect your new triggering word and start spamming through that -- I've experienced this myself.

I have no good work around for this. You can set the Profile Triggering Keyword to `#` which will disable it all together. Unfortunately this will also disable your current login pages.

My suggestion is to use Profile:Edit or another plugin from devot-ee.com to handle the login and forgot passsword features.

Update: as suggested by @peter-lewis you could block block the member area with .htaccess

The other option is to hack the `index.php` and simply `exit();` whenever the `$_SERVER['REQUEST_URI'] == '/members/register'`

Good luck!

# Answer
> 2 votes
Given that Store doesn't let you register members without creating an order, and you mentioned that these spam registrations aren't creating orders, it's almost certain that these registrations aren't coming in through Store.

Also, captchas aren't necessary with Store, because no spammer in their right mind would bother going through a credit card payment just to sign up a member on your site or place a fake order :)

It sounds like the question above helped you find the cause of the problem. Just wanted to add that it's unlikely Store was the cause of the problem here in case other people are running into similar issues.

---
Tags: expresso-store, expresso, registration, spam
---


title: Integrating Discovery Miles With PayU

text:
# Question
Title: Integrating Discovery Miles With PayU
I am busy integrating PayU payment gateway with an EE2 website and need to have payu integration on-site rather than off-page, but the client needs the customer to also pay with Discovery Miles, would there be a way to integrate Discovery Miles with the on-site integration of PayU?

I am using the Enterprise API for PayU and using Expresso-Store.

# Answer
> 2 votes
I am not familiar with the PayU API but it shouldn't be a problem if their API allows on-site integration of Discovery Miles. You will just need to write a custom gateway that handles it based upon their API. Store's gateways are built on top of Omnipay ( https://github.com/omnipay/omnipay ) and you should be able to look at the include gateways as examples to get a good starting point. If you aren't comfortable with php I know that the team at Exp:resso also does custom gateway development.

# Answer
> 2 votes
As Justin mentioned, if PayU supports this then it would certainly be possible.

Store (and the payment library Omnipay) supports both on-site and off-site gateways fine, so it's just a case of whether or not PayU supports this at their API level.

---
Tags: expresso-store, ee2, payment-gateway
---


title: SoapVars Not Found In Payment Gateway

text:
# Question
Title: SoapVars Not Found In Payment Gateway
I am trying to integrate a payment gateway (PayU) to an ExpressionEngine2 website. I have created the payment gateway extension and believe I have the required code to execute the payment.

When I do the checkout and I reach the credit card payment stage and clicking on 'Pay', I get the following error: `Fatal error: Class 'Omnipay\PayU\Message\SoapVar' not found in C:\wamp\www\flook\trunk\backend\expressionengine\third_party\store_payu\Omnipay\PayU\Message\PurchaseRequest.php on line 182`

I have also tried to use the SimpleXMLElement() object in php, but get the same error (SimpleXMLElement not found in...). It's as if objects may not be used within this PurchaseRequest class.

I have activated the php\_soap extension in my wamp server and restarted it, but still get the same error. Is there perhaps something else I am missing?

# Answer
> 1 votes
These errors are caused by PHP namespaces. Because your gateway is in the `Omnipay\PayU\Message\` namespace, if you call `new SimpleXMLElement()` then PHP will look for the `Omnipay\PayU\Message\SimpleXMLElement` class, which obviously doesn't exist.

To prevent this error, you either need to add `use SimpleXMLElement;` at the top of your PHP file, or you can add a single backslash at the beginning of the class name (e.g. `new \SimpleXMLElement()`.

For more information, see PHP Namespaces Overview.

---
Tags: expresso-store, ee2, php-errors, payment-gateway
---


# Question
Title: Orderby price doesn't work with dynamic parameters - {exp:store:search}
I'm trying to build some filtering into my store listing. The standard 'low to high' and 'high to low' kind of thing.

Dynamic Parameters seemed like a good option

http://ellislab.com/expressionengine/user-guide/add-ons/channel/dynamic\_parameters.html

By using $\_GET variables, I'm able to control the `sort` & `orderby` parameters. However, when I set `?orderby=price` on my url, the filtering doesn't work.

`?orderby=title` works. `?sort=asc/desc` works.

Price seems to be the only thing that doesn't. I'm wondering if this is a bug. Since the `{exp:store:search}` tag augments the native entries tag, maybe something is getting lost in translation.

Below is an abstract of my code:

```
{exp:store:search
  channel="shop"
  limit="12"
  dynamic_parameters="orderby|sort"
  dynamic="yes"
  paginate="bottom"
  show_future_entries="yes"}

  < Markup in here >

{/exp:store:search}

```

# Answer
> 0 votes
I don't think the Store search tag supports dynamic parameters for internal Store fields.

To work around this, you could put the orderby/sort parameters into segment variables (for example, `orderby="{segment_3}"`.

Alternatively, you could use one of the many EE extensions which allow you to access GET variables as early parsed EE template vars.

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


title: Assets: Log's me out of the cp

text:
# Question
Title: Assets: Log's me out of the cp
I have just installed Assets. But it keeps logging me out of the CP. This error occurs (console): POST http://centiv.local/admin/ 500 (Internal Server Error) It contains: {"error":"

This form has expired. Please refresh and try again.\</p\>"}

This happens when I:

* Visit Modules -\> Assets.
* Try to upload a file in a Assets field.

I have added this to my config file: $config\['disable\_csrf\_protection'\] = "y"; This doesn't give an error but a blank page when I try to access assets from the field in a channel, it say's I'm logged out of the CP.

I don't know what's going on here, any help would me much appreciated! :)

Assets: 2.3.2 ExpressionEngine: 2.8.1

# Answer
Aha, I have found the problem! It was a the setting: "URL to the root directory of your site" under "General configuration" that contained a wrong path :).
> 0 votes

# Answer
A white page in EE pretty much always means a PHP error that is being suppressed.

Here are details from the EE docs on how to troubleshoot blank pages:
http://ellislab.com/expressionengine/user-guide/troubleshooting/general/blank\_pages.html

> Follow these instructions until you are able to see the error message(s) being output by your server:
>
> Open your site’s main index.php file and under the Error Reporting section change:
>
> $debug = 0;
>
> to:
>
> $debug = 1;
>
> Go to Admin ‣ System Administration ‣ Output and Debugging and ensure that Debug Preference is set to 1: PHP/SQL error messages shown only to Super Admins.
>
> Go to Tools ‣ Utilities ‣ PHP Info and search the page for “display\_errors”. Ensure it is set to On under the Local column. If it is not, your host can help change this setting for you.
>
> Check your server’s error logs or contact your host to assist you in cases where errors are being output to logs and not to the screen.
> 1 votes

---
Tags: assets, pixelandtonic, control-panel
---


# Question
Title: Solspace Calendar; list events by day but suppress output of days with no events
I have a client with an older EE (2.1.1) running Calendar 1.5.3.

They want an event list by day that doesn't display days with no events. I'm using this code at present:

```
{exp:calendar:cal date_range_start="today" show_days="30" pad_short_weeks="n"}
 {display_each_day}
  <div class="day_list">
   <h3 class="day">{day format="%l, %F %j"}</h3>
   {if day_event_total == 0}<p>No Events</p>{/if}
    {events}
     <p><a class="event_name" href="#">{event_title}</a> {event_start_date format="%g:%i %a"} - {event_end_date format="%g:%i%a"}</p>
    {/events}
  </div>
 {/display_each_day}
{/exp:calendar:cal}

```

Which essentially works aside from the fact that of course all days with no events display with the message. They're reasoning that there's no need to show a day if there's no event. Is there a way to do this?

MANY thanks in advance!

# Answer
Try adding the `{if day_event_total > 0} ... {/if}` conditional:

```
{exp:calendar:cal date_range_start="today" show_days="30" pad_short_weeks="n"}
 {display_each_day}
  <div class="day_list">
   {if day_event_total > 0}<h3 class="day">{day format="%l, %F %j"}</h3>{/if}
   {if day_event_total == 0}<p>No Events</p>{/if}
    {events}
     <p><a class="event_name" href="#">{event_title}</a> {event_start_date format="%g:%i %a"} - {event_end_date format="%g:%i%a"}</p>
    {/events}
  </div>
 {/display_each_day}
{/exp:calendar:cal}

```

If you really wanted to show *nothing* on days with no events, you could also remove the `{if day_event_total == 0}<p>No Events</p>{/if}` conditional.

Also, it goes without saying that we recommend updating EE and Calendar at some point. Both versions are quite old. (**Make database and file backups before you do**)
> 1 votes

---
Tags: solspace-calendar
---


title: Grid Field Language

text:
# Question
Title: Grid Field Language
I have this grid field which is set for a date (calendar), but when I output the field's date it is printed in English.

I have the dutch language-pack installed, for my Add-On of Low Events EE does print the dates in the dutch language..

Anybody knows why my grid 'date' field prints in English?

Expression Engine v2.8.1 - Language pack from January 2014

Best regards Dave

# Answer
> 3 votes
The point is that EECMS uses **two** folders of languages!

One is `/system/expressionengine/language/` and the other is `/system/codeigniter/system/language`. Both language packs are completely different.

The dates and the form validation messages are used from the one in the Codeigniter folder.

You can find CodeIgniter Language Packs on github, but I don't know if they match the custom version used on EECMS.

My suggestion is to duplicate the contents of the English folder and translate just the parts you need.

Keep the same name on both folders and they will be activated together.

---

Yeap! This is annoying. I already filled a bug report about this, but looks like, despite of what the bug report says, it is still relevant:

> This bug report is over one year old and may not be relevant.

---
Tags: language
---


# Question
Title: Undefined property: Wizard::$cache during upgrade from 2.3.1 to 2.8.1
I am upgrading from 2.3.1 to 2.8.1. I have gone through all the initial documented upgrade steps. I am also running MSM, and I have upgraded these files as well.

The installer loads correctly, then when I click the "Go ahead and upgrade" link (I forget the exact wording) I get a blank page. With debug = 1 I get the following error details:

A PHP Error was encountered Severity: Notice Message: Undefined property: Wizard::$cache Filename: database/DB\_cache.php Line Number: 49

( ! ) Fatal error: Call to a member function get() on a non-object in (...)/admin/codeigniter/system/database/DB\_cache.php on line 49 Call Stack

1 {main}( ) ../index.php:0

2 require\_once( '..../admin/codeigniter/system/core/CodeIgniter.php' ) ../index.php:235

3 Wizard-\>\_remap( ) ../CodeIgniter.php:306

4 Wizard-\>\_license( ) ../wizard.php:266

5 CI\_DB\_active\_record-\>count\_all\_results( ) ../wizard.php:642

6 CI\_DB\_driver-\>query( ) ../DB\_active\_rec.php:1023

7 CI\_DB\_Cache-\>read( ) ../DB\_driver.php:276

# Answer
In my old database config file (expressionengine/config/database.php), there was the setting

```
$db['expressionengine']['cache_on'] = TRUE;

```

I believe this setting is for db query caching, which is not recommended anymore anyway.

In any case, changing this setting to FALSE, or deleting it, solved the issue for me.
> 2 votes

---
Tags: ee2, upgrade, ee2-upgrades
---


# Question
Title: Error: This site is currently unavailable. And unable to login to CP
I'm running into a strange problem. A couple of days ago, my client started noticing that the site has an error:

```
Error Message
This site is currently unavailable

```

And the CP (admin.php) gives me this error:

```
Error
You are not authorized to perform this action

```

So it is impossible to login to the CP

**No luck trying these solutions out:**

* Database settings seems to be right
* DB Connection is fine
* System is ON
* Tried from different device and different IP Address
* Can't find any strange things in my log files
* In my config debug is on. No other errors
* Tried removing my .htaccess
* Cleared my browser cache
* Cleared system/cache folder
* Centos 6.5 is up to date
* Plesk is up to date
* EE is up to date 2.8.1

If you want access or want to see my config file just PM.

Any ideas?

# Answer
The "This site is currently unavailable" error suggests to me the IP addresses or usernames or something has been added to the "banned" list. This is how you check and fix this.

**---------\>\>\>\>\>\>\>\> BEFORE YOU PROCEED... BACK UP YOUR DATABASE**

**---------\>\>\>\>\>\>\>\> THEN BACK THE DATABASE UP AGAIN**

=============================

1. Go into the exp\_sites table in the database
2. Copy the serialized content from site\_system\_preferences onto your clipboard
3. Go to **Online PHP Unserializer**
4. Paste the contents of your clipboard into the "Unserializer input" field on the left
5. Check the "base64 decode (top level)" box that is at the bottom right of that field
6. Click "Unserialize" button
7. Scroll down to see the "Re-serializer input" fields.
8. Check the contents of these items:

* \[banned\_ips\] =\>
    * \[banned\_emails\] =\>
    * \[banned\_usernames\] =\>
    * \[banned\_screen\_names\] =\>
9. Remove anything in the right column of those 4 fields
10. Click "Re-serialize" button
11. Copy the contents of the "Re-serializer output" field to your clipboard
12. Go into the exp\_sites table in the database
13. Remove the contents of site\_system\_preferences and paste the serialized content from your clipboard
14. Save the data
> 3 votes

# Answer
Perhaps the site has been compromised? Do you have access to the site's SuperUser login?

I would be tweaking the database with PHPMyAdmin. Try resetting the SuperUser member, or try tinkering with the system's settings in the DB.

Most likely the 'guest' member group is now 'now allowed to see the site when it is offline', and all other groups are unable to access the control panel?
> 0 votes

# Answer
Can you see in the DB, table exp\_members, if everything is OK, your email address and username for example. It could give you an idea if someone has messed your DB and your login info.
> 0 votes

# Answer
Haha my client banned al the IP numbers except his own. He did not know how to make the site offline.

So problem solved!
> 0 votes

---
Tags: error, login, super-admin, admin.php
---


# Question
Title: Why is this comparison check not working on a Windows box?
I've set up the following code on a site. On my Mac (dev version - identical to the running live code) the template looks like this:

```
{if '{current_path}'=='/'}
...
{/if}

```

And this works fine. But the same code on the live version simply does not get past this if statement.

Rendering `{current_path}` out to the page before or after the `if` statement shows its value as `/`, but I can't get anything to evaluate inside the `if`.

Any clue as to what's going on?

Considerations: the live server is a Windows box.

# Answer
> 1 votes
This looks like a bug, to me. Probably something related to different PHP between the environments. Starting with version 2.9, EECMS changes the way conditionals are evaluated. So this bug is probably gone.

Conditionals should always use the syntax:

```
{if current_path == "/"}
...
{/if}

```

But `{current_path}` is parsed at the end of parsing stages. This conditional will be evaluated after all modules and plugins run.

Why not just check for `{segment_1}`?

```
{if segment_1 == ""}
...
{/if}

```

---
Tags: conditionals, global-variables, advanced-conditionals
---


title: Use conditional to hide or show entry

text:
# Question
Title: Use conditional to hide or show entry
I would like to use a conditional to hide or show information from an entry. The following code is pulling in data from an EE relationship field. If there is no entry I would like this code NOT to show. I have tried to use {if}{/if} statements, but cannot work the code out!

```
<h4>{manufacturer_profile:title}</h4>
<p>{manufacturer_profile:manufacturer_summary}</p>

```

Would really appreciate some help on this.

# Answer
> 1 votes
Just use a variable pair:

```
{manufacturer_profile}
    <h4>{manufacturer_profile:title}</h4>
    <p>{manufacturer_profile:manufacturer_summary}</p>
{/manufacturer_profile}

```

---
Tags: relationships, conditionals
---


title: tabs not working

text:
# Question
Title: tabs not working
I am using Zurb Foundation mark up tabs. When the tabs render it initially stacks all the tabs content instead of putting the content in their individual tabs? I've done this else where on the site and though it was a while ago it works. what am i doing wrong here?

Here is the page, its a little rough design wise but i am trying to get everything working. http://niwot.colorado.edu/index.php/location/3rd\_order\_location/glv\_3rd Here is my simplified code-

```
  <dl class="tabs contained">
         {exp:channel:entries channel="nwt_3rd_order_location_group"}
           {exp:playa:children field="discipline_3rd_order" orderby="title" sort="asc"}
    <dd {if count == '1'}class="active"{/if}><a href="#simpleContained{url_title}">{discipline_short_name}</a></dd>
            {/exp:playa:children}
           {/exp:channel:entries}
  </dl>
  <ul class="tabs-content contained">
       {exp:channel:entries channel="nwt_3rd_order_location_group"}
         {exp:playa:children field="discipline_3rd_order"}
    <li class="active" id="simpleContained{url_title}Tab">

               {discipline_description}
    </li>
          {/exp:playa:children}
       {/exp:channel:entries}
  </ul>

```

# Answer
This is actually a HTML/CSS issue.

You're forgetting that just the first tab content should have the class `active`.

The tabs have a conditional, `{if count == '1'}class="active"{/if}`, but the contents doesn't.

---

You should use the `var_prefix` parameter on playa to avoid conflicts.
> 1 votes

---
Tags: playa, loop, html
---


# Question
Title: Pass a UNIX Timestamp as a URL Segment to display entries edited since that date
I'm trying to create a template that will display a list of entries that have been added or edited since a particular date. The date would be passed as a UNIX timestamp in the URL like so;

mydomain.tld/entries\_since/1391212800

I have tried doing something like this but I believe this is not working due to the edit\_date in ExpressionEngine not being stored as a UNIX timestamp;

```
{exp:channel:entries
    channel="items"
    status="open"
    search:edit_date=">={segment_2}"
}
<pre>Title: {title}, URL: {url_title}, Edit Date: {edit_date format="{DATE_W3C}"}</pre>
{/exp:channel:entries}

```

Wondered if anyone could help? :)

# Answer
> 2 votes
I believe, your options are:

* to change the format of date you're using on the `segment_2`, which isn't a good idea because EllisLab can some day finally normalize all date fields;
* to reformat the date to match the way its used on edit\_date database column;

To change the date format, I suggest you the Low Nice Date plugin:

```
{exp:low_nice_date date="{segment_2}" format="%Y%m%d%H%i%s"}

```

---
Tags: query, date, date-format, entry-date, edit-date
---


title: Read/Unread entries + comments

text:
# Question
Title: Read/Unread entries + comments
I'm looking to re-invent the wheel to some extent and am inquiring how best to go about it.

I'd like to replicate the read/unread functionality of forum software (Not EE but IPB). Thats to say lets say we have 5 entries and I've only read/landed on entry#1, the other 4 would somehow be marked as "unread".

Using entries/comments instead of forums because I want the entire site in my control.

My thinking would be soon as an entry is posted, its ID is recorded in every members "profile" (or a new table mapped to members ID). If a comment is posted, it to is recorded to all members profile (or new table mapped to members ID) not the comment ID but the entry\_id it belongs to.

So entry 4-5 could be recorded like a JSON/array \[entry\_id2\], \[entry\_id3\], \[entry\_id4\], \[entry\_id5\] - don't need comment ID as the comments live on the same page as the entry.

Soon as a member lands on a page with an entry\_id listed in their profile (or table) it would delete the corresponding ID - making it 'read'.

On a "view latest entries" summary page, we could then mark item#1 as read (because its not in the users list of unread ID's) and we could then mark the remaining 4 as unread (because it is in their list of unread ID's).

If you made it this far - great. Now, can I source an approach on what I'll need to know to accomplish this. I know I'll need to do create something module/accessory or plugin but NFI on just how.

As a note, there will be about 30-50 members, with about 5-20 posts per day - so not huge *but* could be – so query/server load will be a factor.

# Answer
Why not to used `:visited` pseudo selectors and fragment identifiers on the links to comments?

On the list of entries:

```
{exp:channel:entries channel="news" limit="10"}
    [...]
    <a href="{title_permalink="channel/archives"}#{recent_comment_date format="%Y-%m-%d"}">link</a>
    [...]
{/exp:channel:entries}

```

On the comments:

```
{exp:comment:entries sort="asc" limit="20"}
    on <time id="{comment_date format="%Y-%m-%d"}">{comment_date format="%Y %m %d"}</time>
    {comment}
{/exp:comment:entries}

```

On your CSS, you can use something like:

```
a:link {
    font-weight: bold;
}
a:visited {
    font-weight: normal;
}

```

I know this can't survive to a change of browser, but... It's simple and easy. And can be used **together** with a server side solution.

Or together with a JavaScript solution! Save on `localStorage` which entries was read. You can suppose, on your CSS, all entries as unread until the JS be loaded and mark the right ones.
> 1 votes

---
Tags: comments, users, how-to
---


# Question
Title: Display a heading for a stash:get_list if there are more than X entries
I have a stash set list that's getting all the entries from a channel as follows;

```
{exp:stash:set_list name="items-{segment_2}" parse_tags="yes" parse_depth="3"}
    {exp:tag:related_entries
        channel="items"
        orderby="title"
        sort="asc"
    }
        {stash:item_id}{entry_id}{/stash:item_id}
        {stash:item_title}{title}{/stash:item_title}
        {stash:item_count}{count}{/stash:item_count}
    {/exp:tag:related_entries}
{/exp:stash:set_list}

```

I'm then using a get list as follows, first to get the first 3 items and then again to get all the rest in the "more\_items" div;

```
<h1>Items <a href="">View more</a></h1>

<div class="items">
{exp:stash:get_list name="items-{segment_2}" limit="3"}
{item_title}
{/exp:stash:get_list}
</div>

<div class="more_items">
{exp:stash:get_list name="items-{segment_2}" offset="3"}
{item_title}
{/exp:stash:get_list}
</div>

```

You'll notice I have a h1 that contains a link to View more. This has some JS to handle the reveal of the "more\_items" div. However, i'd like to hide the View more link if there are only 3 or less items.

I have tried moving the heading inside the first list but because it is limited by 3 it can't figure out if there are more than 3 to show the link.

I would be grateful if anyone has any advice. :)

# Answer
You can use a standard EE conditional with (https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Alist\_count%7D) the stash function list\_count to do this. list\_count can be used to return the total count, or the count of a filtered list. Very handy!
> 2 votes

# Answer
Could you not use the `{count}` or `{absolute_results}` function ?

```
{exp:stash:get_list name="items-{segment_2}" parse_conditionals="yes"}
//^ parse_conditionals may be required
{if absolute_results >= 3}<h1>Items <a href="">View more</a></h1>{/if}
//^ unsure of wrapping results, may need {} ??
{/exp:stash:get_list}

<div class="items">
{exp:stash:get_list name="items-{segment_2}" limit="3"}
{item_title}
{/exp:stash:get_list}
</div>

<div class="more_items">
{exp:stash:get_list name="items-{segment_2}" offset="3"}
{item_title}
{/exp:stash:get_list}
</div>

```

Obviously if you "view more" conditional sat directly beneath the {get\_list limit="3"} you could put the conditional inside and save an additional query.
> 1 votes

---
Tags: stash
---


# Question
Title: Trying to get Solspace Super Search results in an extension
I am building a notification system which should email a user whenever a new entry is added that matches their saved results. The way I plan to make this work is using a Postmaster Notification which will run on CRON job once a day.

I have already built the system that saves searches using Solspace's Super Search (which we are already using the on site anyway - works well).

My notification code gets all the saved searches, and then should run them and email out any new results. What's the best way to run a search? I just need back the entry\_ids I think.

Here's what I have so far:

```
    // Get all the saved searches that are active.
    $searches = ee()->db->select('screen_name, email, search_name, query')
      ->from('super_search_history h')
      ->join('members m', 'h.member_id = m.member_id')
      ->where(array(
        'h.saved' => 'y'
      ))
      ->get();

    // For each search, unhash the query, and pass it to Super Search.
    if ($searches->num_rows() > 0)
    {
        foreach($searches->result_array() as $row)
        {
            $q = unserialize(base64_decode($row['query']));
            // Add information to the query that indicates the timeframe for the search - LATER

            // What are the entry IDs?
            require_once(PATH_THIRD.'super_search/mod.super_search.php');
            $search = Super_search::do_search($q);
        }
    }

```

I think the main issue is me not knowing the best way to call one module's function from within another. I get the error Call to a member function fetch\_param() on a non-object in mod.super\_search.php on line 644.

Do I need to create a version of the "do\_search" function that doesn't use the TMPL class (since we're not calling this function from within a template).

# Answer
> 1 votes
My guess is that if you instantiate the class and it's not working, you need to also dive into their code to see why you aren't getting any results. If I had to guess, it's because there are no template parameters set. You can programmatically set parameters like so:

```
ee()->TMPL->tagparams['param_name'] = 'some value';

```

Or in versions of EE prior to 2.7 (I think)

```
$this->EE->TMPL->tagparams['param_name'] = 'some value';

```

ExpressionEngine is largely based on the singleton programming pattern, so you should be able to update the instance object with whatever you need. The main challenge will be finding out *what you need* and figuring out how to modify the singleton to fit your needs. Just going to point this out for the rest of the people to benefit, but you can access the main singleton like so:

```
ee();

```

Or in older versions prior to 2.7

```
$ee =& get_instance();

```

And in the case of the Template object, it's also a singleton. The class name would be `EE_Template` but EE instantiates it as `TMPL`, and is assigned to the main singleton which is:

```
ee()->TMPL;

```

Unfortunately, this is the best answer I can give without specifically writing the code myself.

---
Tags: solspace, supersearch, postmaster
---


title: Super Search range not working

text:
# Question
Title: Super Search range not working
I've purchased Solspace's Super Search but can't seem to get the range working correctly. I've followed the docs and it seems to be set-up correctly but isn't correctly returning the ranges.

I'm using a simple GET filter form for a size range. The sizes are inputted into EE and are being collated correctly in the form but the results aren't working.

This is my form:

```
<form action="{path='letting/search'}" id="letting_form" method="GET">
        <label>Search by size:</label>
        <select class="small" style="margin-right:6px;" name="unitsize-from">
            <option value="0">From</option>
            <option value="0">0</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="150">150</option>
            <option value="250">250</option>
            <option value="350">350</option>
            <option value="500">500</option>
        </select>

        <select class="small" name="unitsize-to">
            <option value="9999">To</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="150">150</option>
            <option value="250">250</option>
            <option value="350">350</option>
            <option value="500">500</option>
            <option value="750">750</option>
            <option value="1000">1000</option>
        </select>

        <select name="unit_type">
            <option value="">Select Retail or Office Availability</option>
            <option value="retail_space">Retail Space</option>
            <option value="office_space">Office Space</option>
        </select>

        <button type="submit">Search</button>

```

It outputs:

```
/search?unitsize-from=250&unitsize-to=750&unit_type=retail_space

```

This is my output:

```
{exp:super_search:results channel="unit_space"}
    {if unit_availability == "Available"}
    <tr>
        <td>{unit_type}</td>
        <td>{categories}{category_name}{/categories}</td>
        <td>{title}</td>
        <td>{unitsize}</td>
        <td><a href="{unit_brochure}">Download</a></td>
        <td><a class="view-more" href="#{url_title}">View</a></td>
    </tr>
    {if:else}
    <p>There are no units available at this time.</p>
    {/if}
{/exp:super_search:results}

```

# Answer
Super Search works best as a POST form. Try changing your form to have `method="POST"`.

Also, if you haven't done so yet, you might also want to go in the Super Search CP, under the **Fields** tab, and change the field type to an integer to allow better -from/-to range searches based on numbers. Make a backup of your database before you do any changes there.
> 0 votes

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


# Question
Title: 3D Secure Payments With PayU Payment Gateway Using Expresso Store/Omnipay
I am integrating the PayU payment gateway into EE2 by using store and Omnipay. The on-page payment gateway allows the user to pay via credit card, but with 3DSecure enabled to provide an extra layer of security. Hoe would I go about displaying the OTP pin page to the user so he can enter the pin received via SMS, submit this and get on with the transaction?

I got the testing payment to go through successfully, but just need to cater for this 3dsecure feature.

# Answer
Hein

Please look at this Omnipay with 3D secure as a point of reference; as each gateway will require that the Secure 3D process be implemented differently and as such the payment process steps for the module will have to be applied in this manner.

In the case of PayU MEA, 3D Secure (Enterprise API) is a good reference.
> 1 votes

---
Tags: expresso-store, ee2, payment-gateway, omnipay
---


# Question
Title: CP redirecting to invalid login URL after upgrade to 2.8.1
I've just run the installer to upgrade from 2.3.1 to 2.8.1

Now when I try to go to the Control Panel (admin.php), I am redirected to

```
admin.php?/cp/login?return=

```

Which gives the "Disallowed Key Characters" error.

# Answer
> 1 votes
Turns out this is a known bug with 2.8.0+, affecting users with uri\_protocol configuration setting set to ‘PATH\_INFO’.

There is a patch available here:

https://support.ellislab.com/bugs/detail/20192/when-uri\_protocol-is-path\_info-cant-log-into-control-panel-disallowed-key-c

---
Tags: ee2, upgrade, ee2-upgrades, ee
---


# Question
Title: Expresso Store - Show product price with TAX and Shipping costs
I wonder if there is a way to do this without using any modules. I can't seem to figure this out. I just want the regular\_price + tax + shipping.

# Answer
> 1 votes
Shipping is calculated on a per-order basis, so you can't show what the shipping cost on an individual item is (once products are added to the cart, you can calculate the shipping for the whole order).

To display prices inclusive of tax, open Settings \> Taxes and click on your tax rate, then click "included in price". You can then enter product prices inclusive of tax in the control panel, and these will also be displayed on your website's front end.

---
Tags: expresso-store
---


title: Snippet Syncing not working

text:
# Question
Title: Snippet Syncing not working
I am building an html5 theme into expression engine. The theme came with a lot of JS that wasnt needed and it slows the pages down. When initially building the theme into expression engine i broke the site up into snippets and templates as expected. I have now cleaned up the code and removed all unnecessary js. The issue is that my html-header with the JS links in it wont sync. The snippet is still showing the old code and not the updated version. ANy ideas?

# Answer
The issue was that in snippet sync it was looking for {snippet:global\_sidebar} - rather than {sn:global\_sidebar}
> 0 votes

# Answer
Check that the file path matches snippet sync's file path.

```
$config[‘snippet_file_basepath’] = ‘/my/path/’;

```
> 0 votes

# Answer
Just wanted to throw this out there in case some one else ran into it, but I had a similar issue and for some reason snippets were being created with incorrect permissions. Making changes in the text editor appeared to be working correctly, while loading the same snippet via the EE edit panel `Design -> Templates -> snippets -> snippet name` still showed the old code for that snippet. Updating permissions solved this issue.
> 0 votes

---
Tags: javascript, snippets, snippet-sync
---


# Question
Title: After removing index.php from URLs, 404s on every template except homepage
**UPDATE**

When first posting this, I didn't understand the problem. When I removed the index.php from the urls with a .htaccess file (http://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html), all the templates other than the homepage all gave 404s.

**ORIGINAL POST**

I've create a list of the channel entries, but when you click on a link it sends you to the url example.com/title-permalink= and throws up a 404.

I've tried to visit the single entry pages by manually putting in the url but it doesn't work either.

Here's the simple code on the index page.

```
<ul>
   {exp:channel:entries channel="essays"}
      <li><a href="title-permalink="site/essay"}">{title}</a></li>
   {/exp:channel:entries}
</ul>

```

And the single entry page.

```
{exp:channel:entries channel="essays"}
   <h1>{title}</h1>
   {body}
{/exp:channel:entries}

```

I haven't had this problem before. It seems like it must be really simple. What am I missing? Something in the settings?

# Answer
The real problem: After trying to remove the index.php from the urls with a .htaccess file (http://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html), all the templates other than the homepage all gave 404s. I looked around, tried lots of different versions of the .htaccess code, and this one it worked. https://expressionengine.stackexchange.com/a/871/3177

```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

```

It worked on both my local build with MAMP and my hosting on Bluehost, both in sub-directories.
> 0 votes

# Answer
You are missing the opening `{` on the `href`'s tag, and `{title_permalink}` has an underscore `_` not a dash.

```
<li><a href="{title_permalink="site/essay"}">{title}</a></li>

```

See EE Docs on Permalinks
> 3 votes

# Answer
On single entry pages that aren't throwing 404's EE is falling back to the template group's index.html page.

To fix:

Add this to the top of your detail page template. Adjust the segment to a number AFTER your URL Title displays:

```
{if segment_3 != ""}
  {redirect="404"}
{/if}

```

And on single entry pages you should do this to trigger 404's when EE can't find an entry so that it does not fallback to the index.html template in the template group. Adjust the segment to your URL Title segment:

```
{exp:channel:entries
  channel="ch_blog"
  limit="1"
  require_entry="yes"
  url_title="{segment_2}"
  status="open"
  disable="{gv_param_disable_default}"
  dynamic="no"
}

```

Finally, add these to your .htaccess file (where /index.php/site/404 points to your 404 template):

```
ErrorDocument 404 /index.php/site/404

<FilesMatch "(\.jpe?g|gif|png|bmp|css|js|flv)$">
  ErrorDocument 404 "File Not Found"
</FilesMatch>

```

That should do it!
> 0 votes

---
Tags: url, htaccess, 404, links, index
---


# Question
Title: Playa Children Entries not Displaying When Parent has Same Title as Another Entry
I have a sidebar on my website that is displaying entries using Playa, the client can create new entries for the sidebar, choose what sidebar entries they want to appear and order them however they like. This works but on pages/entries that have the same title the sidebar entries do not appear. Any ideas why?

Thanks.

Sidebar Code:

```
{exp:channel:entries channel="page" url_title="{embed:parent}"}
        {sidebar var_prefix="side" transcribe="disable"}

            {side:if channel_short_name == "sidebar_image_component"}
            <div class="component">
                <h4><span class="headerIcon">{side:image_component_header_icon_code}</span>{side:title}</h4>
                <div class="arrowDown"></div>

                <img data-interchange="[{side:image_component_image:small}, (small)], [{side:image_component_image:medium}, (medium)], [{side:image_component_image:large}, (large)]" alt="{side:title}">
                <noscript><img src="{side:image_component_image:large}"></noscript>

                <div class="inner">
                    <p>{side:image_component_text}</p>
                    <a href="{side:image_component_page_link}" class="siteButtonBlue">{side:image_component_link_text} <span><i class="fa fa-arrow-right linkIcon"></i></span></a>
                </div>
            </div>
            {/side:if}

            {side:if channel_short_name == "sidebar_text_component"}
            <div class="component textComponent">
                <h4><span class="headerIcon">{side:text_component_header_icon_code}</span>{side:title}</h4>
                <div class="arrowDown"></div>
                <div class="inner">
                    <p>{side:text_component_text}</p>
                    <a href="{side:text_component_page_link}" class="siteButtonBlue">{side:text_component_link_text} <span><i class="fa fa-arrow-right linkIcon"></i></span></a>
                </div>
            </div>
            {/side:if}

            {side:if channel_short_name == "mind_map"}
            <div class="component">
                <div class="mindMap {side:mind_map_colour}">
                    <h5>{side:title}</h5>
                    <a href="{side:mind_map_page_link}" class="siteButtonWhite">More Info<span><i class="fa fa-arrow-right linkIcon"></i></span></a>
                </div>
            </div>
            {/side:if}

        {/sidebar}
    {/exp:channel:entries}

```

# Answer
It's ok, I was passing the url title in as a parameter, I've changed that to be the full url and it is working perfectly.

Thanks. Stephen.
> 1 votes

---
Tags: playa, structure, transcribe
---


title: WYGWAM stripping classes and styles

text:
# Question
Title: WYGWAM stripping classes and styles
If I add this code using WYGWAM source

```
<h2 class="section-title">Some<span class="blue-text long-word">Title</span></h2>

```

and publish, it works fine.

But if I go back and edit the entry and click source again all the classes are removed.

How do I keep WYGWAM from removing all my classes?

# Answer
Go to *Add-ons \> Modules \> Wygwam \> Editor Configurations* and select the configuration you want to edit.

Look for the *Restrict allowed HTML?* setting and make sure it is set to *No.*
> 9 votes

---
Tags: pixelandtonic, wygwam
---


# Question
Title: Solspace Calendar not showing custom field
I've got Solspace Calendar set up and working using the `{exp:calendar:cal}` tag but I can't get a custom field for location to show up. I've even got the `enable='custom_fields'` parameter set. Shows up like this at the moment: http://cl.ly/image/1I2E411L0m0b

Using EE 2.8.1, Calendar 1.8.9. Here's the code: http://pastie.org/9320357

The events channel is the default one that is installed when you install Calendar with a short name of calendar\_events.

I've tried changing the custom field short name to something else (like "my\_event\_location") and that doesn't fix it.

# Answer
Okay, got it working. Uninstalled & reinstalled Calendar to no avail. Turned out to be incorrect DB in my config file.
> 1 votes

---
Tags: solspace-calendar
---


# Question
Title: Solspace Facebook Connect : Implementing syncing accounts for existing EE members
I am the implementing Facebook Connect module for an existing site that already has a considerable number of registered users. As it's my first time using the module I have a couple of questions on best approach.

1. What is the best way to have existing members sync their accounts? Do I simply use the Login button? Is this context sensitive and will know if the user has already synced accounts and so not launch the whole agree to the app part?
2. How can I check if a user has already synced their EE account with their FB account? I would like a method of prompting users that have not synced to do so but also not bother those that already have.
3. How do I let users un-sync their accounts? I've noticed that if I sync my own account the app replaces my email address with my FB address. If I un-sync will it add back my old email address?

Thanks for any help.

# Answer
> 1 votes
Lots of digging around in the documentation got me some answers:

1. The login button is clever enough to know if you a user has already synced accounts.
2. `{exp:fbc:login_status}
{if fbc_logged_into_facebook_and_ee == "y"}`
3. `{exp:fbc:account_sync_form
return_when_unsynced="account/profile"
}
<input type="checkbox" name="unsync" id="unsync" value="yes">`

---
Tags: solspace-facebookconnect
---


title: Problem installing EE on the server

text:
# Question
Title: Problem installing EE on the server
I have been trying to install expression engine on my server following this tutorial http://www.youtube.com/watch?v=\_4YlHgT4Gdo&index=1&list=PL07271CFF71F8FF22

I transferred all the files through filezilla and changed the numbers of the permission as explained in the tutorial, but I got stuck with one step. I tried to log in to the website by adding admin.php at the end of the link, but bluehost keeps showing this message:

"404 Error File Not Found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable."

What went wrong? how can I continue installing EE?

Thanks!!

# Answer
I checked http://qatarphil.net and got a blank page, but with http://qatarphil.net/index.php I get the "Your config file does not appear to be formatted correctly." message. Which is positive. It looks like your files are all in place and the domain issues are worked out.

Also, check the official install instructions here: http://ellislab.com/expressionengine/user-guide/installation/installation.html

If you go to the admin link (admin.php), you should be able to install the system. If you still have trouble, doublecheck your database name, database username and database password in the Bluehost control panel. I've installed many EE sites on Bluehost, so I know the service is more than capable of handling it.

Good luck. You're almost there.
> 2 votes

---
Tags: error, server
---


# Question
Title: Is there a way to force EE to have unique url_titles for channel entries
I have used channels for different sections of a website, however I have noticed that if a channel entry has the same URL title of another entry in a different channel the `url_title` field is not automatically incremented and the first entry results in a 404 error. Is there a way to automate this? This occurs even if a category url title is the same as a entry.

For example; I have 2 channels, *your-life* and *a-z*; I have a category called *contraception in your-life* and an entry in a-z named *contraception*, both have the `url_title` "contraception".

When I leave them both at *contraception*, the SQL for the your-life category is as below, and the entries in this category do not appear:

```
SELECT DISTINCT(t.entry_id) FROM exp_channel_titles AS t
LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id
LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id
LEFT JOIN exp_members AS m ON m.member_id = t.author_id
INNER JOIN exp_category_posts ON t.entry_id = exp_category_posts.entry_id
INNER JOIN exp_categories ON exp_category_posts.cat_id = exp_categories.cat_id
WHERE t.entry_id !='' AND t.site_id IN ('1') AND t.entry_date < 1403708810  AND (t.expiration_date = 0 OR t.expiration_date > 1403708810) AND t.channel_id = '17' AND t.url_title = 'contraception' AND exp_categories.cat_id = '35' AND t.status = 'open'
ORDER BY t.sticky desc, wd.field_id_97 asc, t.entry_id asc
LIMIT 0, 100
#APP/modules/channel/mod.channel.php L:277  Channel::build_sql_query()

```

and if I change the `url_title` for the a-z entry to "contraception1", the SQL is as below, and the entries in the category are shown

```
SELECT DISTINCT(t.entry_id) FROM exp_channel_titles AS t
LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_channel_data AS wd ON t.entry_id = wd.entry_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id INNER JOIN exp_category_posts ON t.entry_id = exp_category_posts.entry_id
INNER JOIN exp_categories ON exp_category_posts.cat_id = exp_categories.cat_id
WHERE t.entry_id !='' AND t.site_id IN ('1')  AND t.entry_date < 1403709091  AND (t.expiration_date = 0 OR t.expiration_date > 1403709091) AND t.channel_id = '17' AND exp_categories.cat_id = '35' AND t.status = 'open'
ORDER BY t.sticky desc, wd.field_id_97 asc, t.entry_id asc
LIMIT 0, 100
#APP/modules/channel/mod.channel.php L:277  Channel::build_sql_query()

```

EDIT//

```
{if embed:layout == 'Horizontal'}
    <section class="container listing-block">
        <div class="col-xs-offset-1 col-xs-10">
        {exp:channel:entries channel="{embed:segment_1}" category="{embed:category_id}" orderby="yh_order" sort="asc"}
            <article class="listing">
                <div class="main-image">
                    {yh_images}
                    {yh_images:yh_listing_image}
                    <img src="{path}_listing/{filename}.{extension}" alt="{title}">
                    {/yh_images:yh_listing_image}
                    {/yh_images}
                </div>
                <div class="listing-inner">
                    <h2><a href="{title_permalink='{embed:segment_1}/single'}">{title}</a></h2>
                    <a class="btn btn-primary pull-right" href="{title_permalink='{embed:segment_1}/single'}">View more</a>

                </div>
            </article>
        {/exp:channel:entries}
        </div>
    </section>
{if:elseif embed:layout == 'Vertical'}
    {exp:channel:entries channel="{embed:segment_1}" category="{embed:category_id}" orderby="yh_order" sort="asc"}
    <section class="container pageBlock">
        <div class="col-xs-offset-1 col-xs-10  panel pageBlock-{yh_colour}">
            <h1 class="text-center">
                {yh_icon}
                <img src="{path}_button/{filename}.{extension}" alt="{title}">
                {/yh_icon}
                {exp:filthy}{title}{/exp:filthy}
            </h1>
            <article class="panel-body">
                {yh_leader_text}
                <a href="{title_permalink='{embed:segment_1}/single'}" class="center-block btn btn-{yh_colour} filthy">Read more</a>
            </article>
        </div>
    </section>
    {/exp:channel:entries}
{if:elseif embed:layout == 'Icons'}
    {exp:channel:entries channel="{embed:segment_1}" category="{embed:category_id}" orderby="yh_order" sort="asc"}
        {if count == 1}
        <section class="container {if total_results % 3 == 0}fundraise-links{if:elseif total_results % 5 == 0}home-links{if:else}home-links join-in-links{/if}">
            <div class="row col-xs-offset-1 col-xs-10">
                <ul>
        {/if}
                    <li class="text-center {yh_colour} fader">
                        <div>
                            <a href="{title_permalink='{embed:segment_1}/single'}">
                                {yh_icon}
                                <img src="{path}_button/{filename}.{extension}" alt="{title}">
                                {/yh_icon}
                                <h2 class="filthy">{exp:filthy}{title}{/exp:filthy}</h2>
                            </a>
                        </div>
                    </li>
        {if count == total_results}
                </ul>
            </div>
        </section>
        {/if}
    {/exp:channel:entries}
{/if}

```

# Answer
> 8 votes
EE has always maintained a unique entry id, but only unique url titles within a given channel. There is no way that I know of to force unique url titles across all channels.

This usually isn't an issue so long as you are specifying channels in your template code.

Incidentally this is why EE uses a /category/ segment when using category url titles - that's the trigger to know that what follows is a category url title and not an entry url title.

---

But it happens that you're overriding the default behavior. Take a look at this schema.

The segment used for the category URL indicator is the same used for entry `url_title`. If you want to override the URL behavior of EECMS, remember to set the `dynamic` parameter to `no`.

Plus, you're sending the IDs of the categories as embed variables, so they don't even need to be picked from the URL! From the docs:

> Using this parameter will automatically cause ExpressionEngine to ignore any category information specified via the URL. For instance, if you are on a “category page” (e.g. a /C13/ segment in the URL) that will be completely ignored in favor of whatever you have specified via the parameter.

Take some time to study how the URL are used by EECMS.

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


# Question
Title: point of sale / in-store or phone orders
deciding between expresso store and bigcommerce. i need to be able to either sync inventory to POS system such as quickbooks. or use e-commerce that allows for POS point of sale orders in-person or over the phone.

does expresso store have any POS features to take cash payments in store or over the phone orders?

# Answer
There is nothing built into Store that allows it to take cash orders but you could easily create an admin page with Store templates for your employee's then use the Manual gateway which is perfect for cash, checks or similar orders.

With phone orders you could do the same thing or if customers are giving their card number over the phone you could use whatever gateway you are normally using on your site. The only thing is if you are creating orders they would not be linked to a customer's member account if you were logged in so you would probably be best to to use some other form of authentication to block the page from normal users being able to see it and whoever is taking the phone order to be logged out. I would also recommend that you have the person taking the phone get the persons email address so that if the user creates an account existing orders will be linked to their account automatically.
> 2 votes

---
Tags: expresso-store, ee2, expresso, checkout
---


# Question
Title: Using cp_analytics plugin for Expression Engine2
In a website I am busy building in EE2, I need to build a metric dashboard displaying all sorts of tracked analytics for the website. I installed the cp\_analytics plugin into Expression Engine I bought from devot:ee which looks amazing, but how would I retrieve and display other google analytics values such as viewing by device type, visitor stats etc? I suppose I probably need to link the site to a Analytics account? But is there some sort of API I can use to retrieve these values and display them on the dashboard?

Also, is there built in analytics in EE for EE specifc analysis i.e. page views, email analytics etc?

# Answer
> 1 votes
You have two good alternatives to CP Analytics:

Maybe, one of them shows what you need.

---
Tags: ee2, google-analytics
---


# Question
Title: Conditional to show entry by date range?
Have an instance where there are two entries - one needs to be shown for six months of the year and the other for the second six months.... looking at a conditional which essentially says:

> if date\_range = January-June
>
> Show this
>
> If else
>
> Show this

Is it doable with EE's native conditionals or does it need another approach?

# Answer
The following conditional will achieve what you want:

```
{if {current_time format="%m"} <= 6}
  <p>do Jan through June</p>
{if:else}
  <p>do July through December</p>
{/if}

```

---

**Edit:** Replying to request for March-thru-September date range:

Since the `%m` flag on the date format represents each month as a number (and conveniently *one-based* at that), to achieve what you would like you would simply change the code to:

```
{if {current_time format="%m"} >= 3 && {current_time format="%m"} <= 9}
    <p>do March through September</p>
{if:else}
    <p>do January, February, October, November or December</p>
{/if}

```
> 4 votes

---
Tags: conditionals, date
---


title: Low events entries not listing events

text:
# Question
Title: Low events entries not listing events
Not sure i am doing something silly.

I want to list all events from a specific day using low events. So i have this:

```
{exp:low_events:entries channel="events" date="2014-06-26"}

```

I would expect this to return all events for that day.

I have one event with low events fields set to: 2014-06-26 - 2014-06-28 (all day ticked)

Should i see the one event?

# Answer
Check your fieldtype settings. If "Overwrite entry date" is set to Yes, you should also add `show_future_entries="yes"` to the Entries tag.
> 1 votes

---
Tags: low-events
---


# Question
Title: Low events and low search - selecting year
What is the correct syntax for setting the selected year drop down upon a search?

```
{exp:low_events:archive
                events_field="events_date_time"
                show_passed="no"
                show_future_entries="yes"
                unit='year'
            }
<option {if low_search_low_events:date == date_url} selected="selected"{/if} value="{year}">{year}</option>
{/exp:low_events:archive}

```

This works when unit is set to month, but not year.

# Answer
> 1 votes
The value of the option is the `{year}` val, so use `year` instead of `date_url` in your conditional.

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


# Question
Title: Using Stash to set and get a list of entry Solspace Tags
I'm trying to Stash the Solspace Tags for a Channel Entry as a list and then get them on the view template. However, the view template is not displaying any tags, even though there are some assigned.

This is how i'm setting the lists (notice the nested list for the Solspace Tags);

```
{exp:stash:set_list name="place-{segment_1}" parse_tags="yes" parse_depth="10" save="yes" scope="site"}
    {exp:channel:entries
        channel="places"
        status="open"
    }

        {stash:place_title}{title}{/stash:place_title}
        {stash:place_entry_id}{entry_id}{/stash:place_entry_id}

        {exp:tag:tags
            entry_id="{entry_id}"
            backspace="2"
            orderby="tag_name"
            sort="asc"
        }
            {exp:stash:set_list:nested context="{place_entry_id}" name="place-{segment_1}-tags" parse_tags="yes" save="yes" scope="site" refresh="60"}

                {stash:tag}{tag}{/stash:tag}

            {/exp:stash:set_list:nested}
        {/exp:tag:tags}

    {/exp:channel:entries}
{/exp:stash:set_list}

```

This is how i'm trying to get the Tags;

```
{exp:stash:get_list name="place-{segment_1}"}

    {place_title}

    {exp:stash:get_list:nested context="{place_entry_id}" name="place-{segment_1}-tags"}
        {tag}
    {/exp:stash:get_list:nested}

{/exp:stash:get_list}

```

I would be grateful for any assistance. :)

# Answer
You're nearly there. Just got the nested list tags the wrong way round, and you have to use the `{entry_id}` from the channel entries tag as the unique context when setting the list since `{place_entry_id}` is only available when *getting* the list:

```
{exp:stash:set_list name="place-{segment_1}" parse_tags="yes" parse_depth="3" save="yes" scope="site"}
    {exp:channel:entries
        channel="places"
        status="open"
    }
        {stash:place_title}{title}{/stash:place_title}
        {stash:place_entry_id}{entry_id}{/stash:place_entry_id}

        {exp:stash:set_list:nested context="{entry_id}" name="place-{segment_1}-tags" parse_tags="yes" save="yes" scope="site" refresh="60"}
            {exp:tag:tags
                entry_id="{entry_id}"
                orderby="tag_name"
                sort="asc"
            }
                {stash:tag}{tag}{/stash:tag}
            {/exp:tag:tags}
        {/exp:stash:set_list:nested}

    {/exp:channel:entries}
{/exp:stash:set_list}

```
> 1 votes

---
Tags: stash, tags, solspace-tag
---


# Question
Title: How is a postmaster Cart Throb on authorize hook mail formed?
I have this as a template and I am wondering is this the way you build these? The documentation is not quite clear on how the variables are meant to be formed for an html email.

## Order:{hook:transaction\_id}

Thank you for your purchase.

{hook:items} {hook:item:quantity} x {hook:item:title}{hook:item:product\_notes}
{hook:item:price} {/hook:items}

Total: {order\_total}

Email: {hook:order\_customer\_email}

# Answer
I have done this via stash (is there nothing it can't solve?!)

Following the basic approach of the excellent article here: https://pixelfear.com/blog/maintainable-emails-with-stash-and-postmaster

This allows one to pass the entry\_id of the order to the email template.

```

{exp:stash:embed
  name="emails:super_receipt"
  process="start"
  **stash:e_id="{hook:entry_id}"**
}

```

(this is using the cartthrob\_on\_authorize hook, and I have another for cartthrob\_on\_processing)

In the emails:super\_receipt template, I then use this to retrieve the order details and order item details (I actually use some nice encapsulated re-useable stash models for these, but basically these are just channel entries loops which pull the data from the channel and bung it into stash variables and the items into a stash list)

```

{exp:channel:entries channel="orders" entry_id="{stash:e_id}"  status="not closed" dynamic="no" parse="inward"}
    {!-- Order Data--}
    {exp:stash:set name="order_title"}{title}{/exp:stash:set}
    {exp:stash:set name="order_entry_id"}{entry_id}{/exp:stash:set}
    {exp:stash:set name="order_url_title"}{url_title}{/exp:stash:set}
etc.

```

Then printing the data in the email (partial) template so:

{!-- The layout gets filled in with the data below --}
{stash:embed:layouts_emails:layout_basic}

{!-- takes the list order_items from model_order and creates list extended_product_info --}
{stash:embed:order_models:model_order_extended_product_info}
{!-- Gets the basic order data --}
{stash:embed:order_models:model_order}

{exp:stash:set name="email_body"}

```
{!-- ORDER DETAILS --}
{stash:order_title} ({stash:e_id})
<table>
    <thead>
        <tr>
            <th></th><th>Qty.</th><th>Item</th><th>Price<th>Subtotal</th>
        </tr>
    </thead>
    <tbody>

{!-- this list has all the info from cartthrob order_items--}
{exp:stash:get_list name="order_items" parse_tags="yes" parse_depth="5" sort="desc" orderby="item_price_inc_numeric" sort_type="numeric"}

```

etc

The beauty of this is that you can get ALL your order data, and indeed product data (e.g. pictures etc), and package it up how you need, and then have a file based (version controlled) - partial template that fills in a layout, just like you would anywhere else on your site.

It's fantastic and basically once the hook is set up you can stay out of the clunky postmaster editor (actually, it's a great editor for an embedded one, but it's no SublimeText ;)

If you didn't want to take this approach, try doing your set up as a parcel first, rather than a hook, and in the editor get it to parse an order entry so you can see what data is available easily using the editor (although it will be {parcel:entry\_id} rather than {hook:whatever} of course).

Postmaster is great - the documentation for it, though, is severely lacking in some basic examples of each cool thing it can do that would really help people get going with it.
> 0 votes

---
Tags: postmaster
---


# Question
Title: Entries from wrong channel in results page
I've got an issue where results from the wrong channel are showing up on the results page.

Some background on the site:

### Channels

* pages\_nl
* pages\_fr
* pages\_en
* vehicle\_nl
* vehicle\_fr
* vehicle\_en

The search results tag looks like this:

```
{exp:low_search:results
  collection="vehicles_{segment_1}|pages_{segment_1}"
    status="not closed"
    limit="10"
    disable="member_data"
 }

```

The results look like this:

* entry from **vehicle\_nl**, entry\_id is **1401**
* entry from **page\_fr**, entry\_id is **1390**
* entry from **page\_nl**, entry\_id is **1338**
* entry from **page\_en**, entry\_id is **1364**

So if I'm reading it correctly, entries 1390 and 1364 should not be in this list. I've rebuilt all indexes, no joy.

The problem isn't specific to these entries, other queries that have a match in the 3 languages show up as well.

We use the same template/low\_search:results tag for the results pages in the other languages and those are fine.

Any suggestions on how to debug this?

# Answer
> 1 votes
Managed to fix it: some entries were in more then one collection in the exp\_low\_search\_indexes table. Truncated those tables, rebuilt all indexes and the results were correct.

---
Tags: low-search
---


# Question
Title: What are options for a better built-in template editor?
I'm not too happy with EE's template editor. It would be nice to have the following:

* Show line numbers (and column numbers maybe)
* Tab support
* Ability to increase the height of the editor

Are there any options for me?

# Answer
You can (and should) save templates as files and then use the editor of your choice (as well as version your templates with Git/SVN/whatever).

If for some reason that isn't an option for you there's Editee which is an extension that extends the CP template editor to make it more usable.

**EDIT:** There's also ThEEditor and its Code Mirror based derivative ThEEditorCodeMirror, which though I haven't used it looks excellent for those times you **have** to use the template editor (eg because you're halfway up a mountain in the Alps with only an iPhone: true story...).

If you are a Mac user, a third option is Mountee which lets you mount your EE templates (and snippets and more) as files in finder.

Personally I would go with templates as text files though - my general rule is whatever you *can* get out of the DB you *should* \- it makes everything from versioning to moving between environments much easier.

*EDIT: If you wish you can even go so far as to disable the template editor for templates saved as files.*
> 20 votes

# Answer
Enable template-files and use any Code Editor isn't an option?
> 4 votes

# Answer
There are other options. The best (and only) option for me is to save the templates as files and then edit them with whatever editor I please.

http://ellislab.com/expressionengine/user-guide/templates/templates\_as\_files.html

I don't care what features Ellislab is able to provide for template editing. The template editor will never be my home. It will never have the setup / layout of my primary editor. It will never have the flexibility that I reqiure. It will never be Vim!

That said, web based editors are coming a long way. I suppose Ellislab could look at the available options which are gunning for replacing desktop editors.
> 1 votes

# Answer
Personally, I'm a fan of the Mountee approach. We use Mountee with BBEdit and CSSEdit to modify most of our clients templates. But that's a personal preference, I've just never been a fan of the save templates as files approach. Mountee, http://hellomountee.com is a great option. Though it maybe Mac only.
> 1 votes

# Answer
I use Mountee personally because I like being able to edit not only my templates but my global variables and snippets as well. I've also started researching using git for my projects and low and behold Mountee has a KB article about using Mountee with git.
> 1 votes

# Answer
I have ThEEditorCodeMirror installed as an default add-on. (But I don’t use it very often because I save and edit templates as files.)

ThEEditorCodeMirror gives you line numbers, tab support, auto indent, themes and Ctrl-S saving.
> 1 votes

# Answer
Even you *should* save your templates as files, there are solutions you can try Editee addon will do the job you are asking, or you could try Mountee app (mac only) to edit your templates in your favorite editor.
> 0 votes

# Answer
There is a Firefox extension called "It's All Text" that adds a small button to the bottom (default) of the template editing box that opens the contents of the text box in any editor of your choosing. Upon saving, it writes the saved version back. Update and you're done!

It's All Text Download (if you are already in the Firefox browser)
> 0 votes

---
Tags: templates
---


title: Matrix/Playa saving issue

text:
# Question
Title: Matrix/Playa saving issue
Have a problem with using Playa as a field within a Matrix field where the selected entry is not being saved.

Oldish version of EE (2.4) but should be supported. Entry appears to save okay but when revisit entry the field is empty.

Anybody got any thought?

Cole

# Answer
Resolved - upgrading Matrix to the latest version (was 2.2 now 2.5) and tghis has fixed the issue.

Thanks for the feedback and suggestions folk!
> 1 votes

---
Tags: matrix, playa, pixelandtonic
---


# Question
Title: Any way/plugin to automatically change a members group based on an action?
I'm wondering if there is a way to change a users/registered members group based on them performing an action?

At the moment members register into a default group. If that member submits a specific entry via a channel form I would like to change their member group. Is there a way to automate this? Plugin or otherwise?

# Answer
I'm not aware of anything available publicly at this time, but I think a custom extension could be built to accommodate using the following hook:

Channel Form Hook {submit\_entry\_end} \- triggered after a channel form is submitted

*Requires EE 2.7.0+*
> 1 votes

# Answer
I wrote a plug-in to do this some time back for EE1.x, should be pretty easy to upgrade to EE2.x if you want to fork it...

https://github.com/ninefour/change\_member\_group.pi.ee\_addon/blob/master/system/plugins/pi.change\_member\_group.php

Of course, use with caution!

:)
> 1 votes

---
Tags: members
---