# Question
Title: Solspace Calendar Cal tag multiple months
Using Solspace Calendar, Cal tag to display a range of months. However I am experiencing some odd behaviour. See the link below. The Cal is getting the Start/End date from the URL. http://www.245207.temp-dns.com/calendar/2012/10/2013/05

It seems to mixing some of the days up and adding out\_of\_range css classes to days. I read somewhere that it is because of the way the Calendar module calculates the days in a month.

Here is my code:

```
        <div id="month-cal">

    {exp:calendar:cal date_range_start="{segment_2}-{segment_3}-01" date_range_end="{segment_4}-{segment_5}-last"}

      {display_each_month}
      <table id="fc_outer">
         <thead>
            <tr id="month_year">
               <th colspan="2">« <a href="{path='calendar/month'}/{prev_month format="%Y/%m"}/">{prev_month format="%F"}</a></th>
               <th colspan="3">{date format="%F %Y"}</th>
               <th colspan="2"><a href="{path='calendar/month'}/{next_month format="%Y/%m"}/">{next_month format="%F"}</a> »</th>
            </tr>
         </thead>
         <tbody>
            <tr>
               <td colspan="7">
                  <div class="wrap">
                  <table id="fc_inner">
                     <thead>
                        <tr id="days_of_week">
                           {display_each_day_of_week}
                           <th class="day_of_week {day_of_week}">{day_of_week}</th>
                           {/display_each_day_of_week}
                        </tr>
                     </thead>
                     <tbody>
                        {display_each_week}
                           <tr>
                              {display_each_day}
                              {if day_in_current_month}
                                 <td class="day_cell"><div class="date">{date format="%j"}</div>
                              {if:else}
                                 <td class="day_cell out_of_range"><div class="date"><span class="num">{date format="%j"}</span></div>
                              {/if}
                              {display_each_hour}
                                 {events}
                                    <div
                                      class="
                                         event {if event_all_day}all_day{/if}
                                         {if event_multi_day}multi_day{/if}
                                         {if event_first_day}first_day{/if}
                                         {if event_last_day}last_day{/if}
                                         {if all_day_event_index_difference > 0}index_difference_{all_day_event_index_difference}{/if}
                                      ">
                                   {if event_multi_day}
                                      {if event_all_day == FALSE}
                                         {if event_first_day}
                                            {event_start_time}
                                         {/if}
                                         {if event_last_day}
                                            {event_end_time}
                                         {/if}
                                      {/if}
                                         <a href="{path='calendar/event'}/{event_id}/">{event_title}</a>
                                   {if:else}
                                      {if event_all_day == ''}
                                         {event_start_date format="%g"}{if event_start_minute > 0}:{event_start_minute}{/if}{if event_end_time != event_start_time && event_end_time != '00:00'}–{event_end_date format="%g"}{if event_end_minute > 0}:{event_end_minute}{/if}{event_end_date format="%a"}{if:else}{event_start_date format="%a"}{/if}
                                      {/if}
                                         <a href="{path='calendar/event'}/{event_id}/">{event_title}</a>
                                   {/if}
                                    </div>
                                 {/events}
                              {/display_each_hour}
                           </td>
                           {/display_each_day}
                        </tr>
                        {/display_each_week}
                     </tbody>
                  </table>
               </div>
            </td>
         </tbody>
      </table>

   {/display_each_month}
   {/exp:calendar:cal}
  </div><!-- end month-cal -->

```

I was wondering if there was a way to get around this?

Thanks

# Answer
> 1 votes
the link you provided doesn't seem to be working anymore, getting just blank page.

Solspace calendar will pad weeks at the beginning and ending of the month, this is used to support a standard grid calendar layout. If you're using the cal tag for displaying a list you might want to pass in this parameter:

```
pad_short_weeks="n"

```

This will eliminate the padding and could prevent some weird display issues

Here's the documentation for reference http://www.solspace.com/docs/calendar/calendar/

---
Tags: solspace, solspace-calendar
---


# Question
Title: P&T switch in with lightbox integration issue
I'm sure i have selected the perfect title for this however, if someone can come up with a better title, feel free to edit.

Anyway, I am having a slight issue integrating a combination of functions using P&T switch. I am currently using the Jquery plugin fancybox for my gallery \[Click here\]\[2\] when you click on the image it meant to open a pop window.

I am using P&T switch as the gallery will feature both images and videos, In the expression control panel have created variables that look like the following This will enable the user to select a video or image, The video will navigate to the template {'pop/video'} and the images will navigate to {'pop/video-pop'}.

In order for me to a achieve this i have attempted to apply the following code to my gallery, however it's not working

```
<div class="am-container" id="am-container">
        {exp:low_reorder:entries set="gallery_set" channel="gallery" disable="pagination|member_data|trackbacks"}
            <a class="various" href="{if video_switch == "image"}{path='pop/index/{url_title}'}{/if}{if video_switch == "video"}{path='pop/video-pop/{url_title}'}{/if}">
            <img onmouseover="removeFilter(this)" onmouseout="addFilter(this)" src="{g_image}" alt="{url_title}" class="filter"></a>
        {/exp:low_reorder:entries}
        </div>

```

Can someone please guide me in the right direction..?

# Answer
I've looked at your link and can't see from looking at the front-end what would be the issue. What always helps for me is adding "debug" info to my HTML. You could for example try this:

```
{exp:low_reorder:entries set='gallery'}
    <!-- {video_switch} -->
{/exp:low_reorder:entries}

```

To output the value of this field for your entries. If the output is what you expect it, you could test further like so:

```
{exp:low_reorder:entries set='gallery'}
    {if '{video_switch}' == 'image'}
        <!-- this must be an image -->
    {/if}
    {if '{video_switch}' == 'video'}
        <!-- this ought to be a video -->
    {/if}
{/exp:low_reorder:entries}

```

It might be a typo or something. If you need further assistance set up a page that has code along these lines and please share the code and the url.

Good luck!
> 2 votes

---
Tags: channel-entries, templates, custom-fields
---


# Question
Title: P&T Checkbox field not outputting on site?
I've been working on a dev site for the past month or so. Everything was working fine. Started to upgrade the live site just now. It's pretty much all gone smoothly, except for 2 fields that are not showing on the site.

They are two P&T Checkbox custom fields. (Same channel). They are visible in the CP, and every entry has some options selected.

Now on the front end where I am displaying these options, nothing is output. It's the exact same template and set up that I am using in the dev site, which is working fine.

Not sure where to start trying or testing? Any ideas?

# Answer
> 1 votes
OK, not sure based on the comments whether or not this was the actual reason it was solved, but when I enabled the "field pack" it then started showing. I already had the P&T checkboxes field enabled, and with just that, nothing was showing on the front end. Enabled the field pack, and all good.

---
Tags: custom-fields, pixelandtonic, pt-checkboxes
---


# Question
Title: Adding Cidoc Sphinx theme to my documentation
I am following instructions given here

I get the following error when entering $ git submodule add git@github.com:adrianmacneil/cidoc.git user\_guide\_src/\_themes/cidoc in the terminal:

fatal: Not a git repository (or any of the parent directories): .git

Help?

# Answer
> 1 votes
Adrian may have a better answer, but this works for me...

If your add-on is not a Git repository, of if you would rather install the theme manually rather than as a submodule, you can just download the theme from Github and put it in your Sphinx documentation setup.

Just make sure your `conf.py` file has the correct path to the theme.

So if your documentation setup looks like this:

You'd have this in your `conf.py`

```
html_theme_path = ['_themes']
html_theme = 'cidoc'

```

If you aren't already familiar with Sphinx I found this to be a really helpful guide: Easy and beautiful documentation with Sphinx. Along with the official doc's First Steps with Sphinx.

Thanks to Adrian for making this available!

---
Tags: git
---


title: Graphical asset-select for Safecracker

text:
# Question
Title: Graphical asset-select for Safecracker
I want to give my client the ability to visually select a file from one of my file-folders in safecracker. I was thinking of using an embed with `{exp:assets:files}` loop in there, something along these lines:

```
{exp:assets:files folder_id='1' kind='image'}
    <li><a href="#" data-url="{url}"><img src="{url}" alt="{filename}"></a></li>
{/exp:assets:files}

```

Now what would I feed back to the safecracker-form in order for my assets-field in this entry to be updated with the file I just clicked? Should I feed the file's url to a hidden `<input>` element?

Thanks,

* Steven

# Answer
> 1 votes
currently there's no way to do what you want that I can think of, but I like the idea. Seeing as we have Assets 2.1 in development, I'll have a chat with Brandon and we'll see what we can come up with to make you happy.

Cheers, Andris

# Answer
> 0 votes
I think it's probably going to be a bit more complex than that. Assets may be doing that work with JavaScript rather than just routing a selected file to a field.

I would recommend opening up Firebug in Firefox or Developer Tools in Chrome or Safari, and instantiating a full-blown Assets field in your Safecracker template. You can then see:

* The HTML it generates for the dynamic form field
* The JavaScript references and any inline script it bundles into the form
* What happens when you actually select a file and where that's stored until the form is submitted

You'll then have a sense of what you need to reproduce on your end to accomplish your goal.

I've never done this with Assets. We've done it with Matrix, where it's just a matter of adding sets of form fields with a `new` fieldname convention. I suspect Assets is going to go a little deeper, though.

---
Tags: safecracker, assets
---


# Question
Title: Conditional based on the age of an entry
I want to embed a template if the entry\_date of an entry is less than a certain age, and display something else otherwise. Is there a good way to do this natively? With addons? I tried the timespan plugin, but the documentation seems to halfway be for a previous version of the app that was named differently, and none of it seems to actually work.

In my specific case I want to embed the template if the entry is less than 3 years old, but otherwise display a message that we don't provide this information for old entries.

I think the most common useful case for this is a contact form (or comment field though there are addons for expiring comments) for each entry in a channel and you start to get hammered with spam on old entries.

# Answer
> 4 votes
Here are two options you could try. Vim Interactive has a date plug-in, DT Plugin, that lets you set the year offset within the plug-in tag itself. Solspace also has a date plug-in called Date Field Filter. To set the offset you require would mean you need to turn on PHP in your templates. I'd recommend trying Vim's plug-in first and see of this solves your problem before going down the Solspace route. Both plug-ins are free so there's no reason not to give them a shot.

update from further expirimentation:

```
embed tag:{embed="grp/tmp" ent_date="{exp:dt set="{entry_date format="%m/%d/%y"}" ee_format=“true" format="%y%m%d"}" 3_years="{exp:dt year="-3" ee_format=“true" format="%y%m%d"}"}

```

to add variables to the embedded template, and then:

```
{if {embed:ent_date} < {embed:3_years}}Old Entry Message{if:else}New Entry Content{/if}

```

# Answer
> 1 votes
you could check if the current date minus the date of the entry exceeds 3 years:

```
{if '{current_time format="%U"}' - '{entry_date format="%U"}' >= 31536000}
    // entry is older than 3 years
{/if}

```

note that this isn't a 100% correct, as the '31536000' is the amount of seconds in a normal year, so this neglects leap-years..

# Answer
> 0 votes
Having had a quick look at the Timespan source code I think you'd want to try something like this if you haven't already:

```
{exp:timespan date="{entry_date}"}
    {if '{timespan:years}' < '3'}
        DOSTUFF
    {if:else}
        OTHERSTUFF
    {/if}
{/exp:timespan}

```

I'm not sure why their sample code includes references to `{exp:ellapsed}` \- maybe it was an earlier name for the addon.

---
Tags: channel-entries, conditionals, date, spam
---


# Question
Title: Zoo Visitor and Structure - Different Urls and Templates per member group
I'm using Structure and Zoo Visitor for a Recruitment site I'm currently working on which will have two distinct types of users (I have two seperate member groups for permissions).

1. Staff Members (Login access to CP, add/edit/delete Blog Posts, Jobs Postings, etc).
2. Candidates (No Access to CP. Register on Front-end, edit their own profile, Apply for Jobs etc.)

What I'm struggling with is how I'd setup the Urls bearing in mind I use Structure to manage that. How will I be able to distiguish between the two member groups so I can have different Urls / Templates etc?

I've added the Zoo Visitor Member channel to Structure as a listing, but I notice the Structure tab is missing when editing an Entry. Which would make sense as there doesn't look like any way to determine which member group you're dealing with.

Ideally I'd like to have:

```
/team/ (listing of all Staff members).
/team/joe-bloggs (an individual staff member)

/candidate (only display your own profile when logged in)
/candidate/login (speaks for itself).

```

**EDIT**: I can accomplish the `/candidate/` section of the site fine using the standard Zoo Visitor templates. What I can't seem to do is assign a specific template to the the staff member part `/team/joe-bloggs/`. The Structure tab is missing from the Add / Edit Entry form in CP.

# Answer
Looks like it was just a matter of resetting the publishing layout when editing a Zoo Visitor Member. The Structure tab is now restored and I can assign the desired template to the entry.

Possibly caused by installing Zoo Visitor after Structure? No idea, but it's all working now!

Thanks to the Zoo guys for pointing me in the right direction.
> 1 votes

# Answer
Couldn't you wrap the different navigation sets in if member conditionals and show them based on their permissions?
> 1 votes

---
Tags: structure, zoo-visitor
---


title: Old URLs and strict URLs

text:
# Question
Title: Old URLs and strict URLs
If I enter the URL to a channel that was deleted months ago, my EE install seems to default to the homepage. I have read up on strict URLs, but if enabled, EE checks whether the first segment in the URL corresponds to a template group so its not possible to access templates directly inside the site group folder without adding it into the URL. Is there anyway to ensure old URLs like this display the 404 page listed, rather than the homepage without the use of a manual 301 redirect?

# Answer
> 1 votes
Enabling strict urls means that EE checks whether the first segment in any URL corresponds to a template group. If that's not the case, EE will display a 404. To my knowledge there is no relationship between this and what you say here

> any templates in the site directory need to have the site folder name in the URL

Maybe you have to edit your question and elaborate. As far as I can see, simply enabling site URL should work in your case. If you want to target entries rather than template group, have a look at the require\_entry parameter for the channel entries loop. If you want an in depth look at 404 pages, I recommend this guide to 404 pages in ExpressionEngine.

**EDIT: question clearer now**

> I want to be able to access domain.com/template.html, not domain.com/site/template.html, but at the same time, not have domain.com/old\_template\_group/template take me to the homepage, instead take me to the 404 error page.

**EDIT: cannot see any easy way**

If you activate strict\_url and then do a mod rewrite from /template to /site/template, EE will still redirect you to a 404 because your first segment will not be a legit template group.

---
Tags: url
---


# Question
Title: Postmaster doesn't email on bulk status change
I have several status change parcels that work great both from Safecracker forms as well as single edits on the cp, however if I bulk edit the entries to change multiple entries status' the status changes parcel are not triggered.

Any ideas?

-Mike

# Answer
I guess it was an oversight when I first built Postmaster, but this functionality is currently not supported. Postmaster is just triggered by the entry\_submission\_end hook, not the bulk update.It could easily be added, but currently it's not available.

I will definitely add this to the list of things to support in the next release, which is v1.3. I don't have any ETA available for this release, so email support\[at\]objectivehtml.com if you have a tight deadline and we might be able to work out something.

The real problem I see is that the native EE hook doesn't pass much data. So you would have to rely on the POST data and loop through the entry\_id's.
> 2 votes

---
Tags: postmaster
---


# Question
Title: Expresso Store - Change order_id start point
My client would like the order numbers (order\_id)'s to start at 30000 (thirty thousand) rather than starting at 0.

Looking at the database I can see in the exp\_store\_orders table that order\_id is set to auto\_increment. This would lead me to believe that I should be able to bump up the numbers by just doing the following on that table:

```
ALTER TABLE exp_store_orders AUTO_INCREMENT = 30000

```

As this site is almost ready to go live I don't want to FUBAR it, so I'd appreciate confirmation that this is the only place I need to make a change!

Your advice is much appreciated.

# Answer
Yes, that is the correct way to do it. To clarify this for others, you will need to open up PHPMyAdmin, or any other SQL client which will let you run SQL queries directly.

You can also go to Tools \> Data \> SQL Manager \> Database Query Form in the ExpressionEngine control panel.

Then run this query, replacing `30000` with the order ID you want to assign to the next order:

```
ALTER TABLE `exp_store_orders` AUTO_INCREMENT = 30000;

```

This won't break anything, because it's exactly how Store generates new order IDs (using the MySQL auto increment counter).
> 5 votes

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


# Question
Title: Exp:resso Store - skipping payment gateways, free orders
slightly strange requirement! We have a setup which requires the user to reserve the products they want to buy via an add to cart/checkout system.

So they add what they want to basket, click 'reserve' (checkout, if you like), fill out their name, the date they want to collect it and the store that want to collect it from, then submit it so the site admin can sort it out for collection. No payment involved (though that might come later).

Is this something Exp:resso Store can handle? Effectively skipping the payment bit and submitting a free order, despite the products having prices.

# Answer
> 5 votes
You would be best suited to use the Manual Payment Gateway (doc link). It is intended for things like bank transfers or cheque but would also serve the purpose of allowing the order to be completed without requiring a user to enter any payment details.

You could then use the `{exp:store:payments}` tag pair down the road to allow for the user to make a payment.

---
Tags: expresso-store
---


# Question
Title: How do I implement EE security best practice with vhost dedicated server
I was attempting the implement the additional security steps highlighted in the post installation documentation here on a dedicated server. I came to realize after talking with a Rackspace, my hosting provider, that this document and setup is intended for shared hosting as my vhosted dedicated server is not laid out in the manner described in the tutorial.

Anyone ever accomplished this? Google searches keep turning up dedicated hosting solutions. Rackspace offered a solution of creating an additional folder inside my current folder housing everything and than redirect to this nested folder allowing me to place admin files at the same level, they were not aware of how this would affect EE though.

# Answer
> We are on Rackspace Managed Cloud Servers. We have vhosts set up. My folder structure looks like this: -/var/www/vhosts/mysite.com If this what you expect? could I just put the admin files in "www"?

My setup is the same. I configure my vhosts with the following:

```
mysite.com
  database
  log
  public
  system

```
* Public is where the vhost actually points to to serve up the website.
* Log is where log files are stored.
* Database is a folder I create to store mysql dump files to move copies of my db around.
* System is the EE system directory, one level up from `index.php`.

Once you change your `index.php` and `admin.php` to use `../` syntax to look 1 directory up, it should all work.

We also use Focus Lab's Master Config approach.

Within public, I create a `ee` directory that contains `config` and `third_party`. This is where I manage third party add-ons and my config.php within the `public` directory.

I also store `templates` in the public directory, nested within another directory containing our front-end assets (images, css, js). This lets us point CodeKit at 1 directory instead of having it monitor the whole application.

If you're accessing the server via SSH/command line, your vhost configurations are typically in a location such as `/etc/apache2/sites-available` (on Ubuntu). If you edit that file, you'll see that you can point the website to the public directory. I'm assuming this is what they're referring to when they say "redirect to this nested folder."

A few years back I printed out a set of Slicehost's articles and put them in a binder. I use those every time I set up a new Ubuntu server, from SSH accounts to firewall to Apache/PHP/MySQL and vhost config. You can start here or jump right to vhosts config.
> 3 votes

---
Tags: security
---


# Question
Title: Local site breaks with production database
I've been using the Focus Labs bootstrap with great success for my last few projects. However just now I ran into a snag. I exported my production database, imported it locally, and now the site does not work and I get these errors:

```
A PHP Error was encountered
Severity: Notice
Message: Undefined property: EE::$session
Filename: libraries/Functions.php
Line Number: 377

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: libraries/Functions.php
Line Number: 377

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at    /Users/User/Sites/example/system/codeigniter/system/core/Exceptions.php:170)
Filename: libraries/Functions.php
Line Number: 402

```

If I turn off extensions in my config file things do work, sans extensions.

I did another export/import of the database to be sure, compared all my add on versions (all are the same), went back to my old local database (that works), and sync'd all my templates to the new production database. None of these fixed the issue.

Turning off all extensions via the database (Sequel Pro) allowed me to isolate it to Force SSL and specifically the on\_page\_load method.

At least now I can work locally, but would like to get things running smoothly again. I've posted in the Devot-ee forums and will link back to here.

# Answer
I suspect there are some sessions/cookies referenced in the DB that that exist on the production server, but not the other environment; removing said references from the DB could resolve it.
> 2 votes

---
Tags: extension, bootstrap, php-errors
---


title: Control Panel - Strange WSOD Issue

text:
# Question
Title: Control Panel - Strange WSOD Issue
Yesterday I went live with a site from my development server (WAMP) to my production server (LAMP). I made all of my changes to paths and DB, and while the site was coming up, I was having some issues getting into the CP. I think it was a URL issue as the domain name under which I was developing was different than the live site. I finally got it straightened out and was able to get logged in.

Somewhere along the line, I must have made an adjustment that then broke things. The front end of the site still works, but I’m now getting the dreaded WSoD when accessing the CP. Very strange since it was workign fine. So somewhere I must have made an adjustment that broke things. Retracing my steps hasn't solved anything. Hopefully the following provides something that triggers an idea.

When logging in, it goes to the authenticate URL, then to the home page URL where it gives me the WSoD.

I've tried altering the URL to see if I could access other parts of the CP. Here are the results:

* WSoD – any of the add-ons (modules, accessories, extensions, field-types, plugins)
* WSoD – home page
* CAN ACCESS – templates, template manager, snippets, etc.
* CAN ACCESS – area to manage members and groups

I’ve tried to turn on debugging in my admin.php template, as well as the index.php and system/index.php. Doing so provides no additional information. I’ve also re-uploaded the files and dropped the DB and imported again.

I spent several hours last night trying everything I could think of. So any help is very much appreciated. The answer is probably in front of me, but my head is hurting from banging it on the wall!

# Answer
> 1 votes
OK, so I contacted EllisLab Support for assistance - and they were fantastic. It turns out that I had a second (and possibly older/different) Switchee folder in my third\_party add-ons folder (I had one folder "switchee" and another "croxton-Switchee-b813d5b". As soon as I removed the latter, I was able to log in. They said that the error was suppressed due to an @ on the include. They would look into removing that for easier debugging in the future.

The thing that is still strange to me is that my local dev site still works just fine (with the duplicate folder). But I'm not going to spend any more time trying to figure out why. It's working!

Thanks again to Alex, and especially Anna for your continued attempts to assist!

# Answer
> 1 votes
My first suggestion would be to start your migration over. Move files and database freshly since things did work when you first moved over.

Then before you log into the CP on the production server, clear your browser cache and cookies, then add this to your config.php file:

```
$config['cookie_domain'] = "";
$config['cookie_path'] = "";
$config['cookie_prefix'] = "";
$config['admin_session_type'] = "s";
$config['user_session_type'] = "c";
$config['require_ip_for_login'] = "n";
$config['require_ip_for_posting'] = "n";
$config['secure_forms'] = "n";

```

---
Tags: control-panel, white-screen-of-death
---


# Question
Title: Need to upload an HTML file and display contents of DIV and nothing else
I have a case in which a client needs to be able to upload a JS and an HTML file to be displayed on a page via file upload fields.

The problem is that the HTML file that is delivered to the client is a full HTML file with headers, meta, styling.

I need to be able to have the client upload the full HTML file as they receive it, but pull out only the contents of a particular DIV to be displayed within the template/page.

```
<div class="CherryPickedHTMLWrapper">

```

How would I approach this scenario?

# Answer
> 3 votes
I'm not sure I fully understand what you're trying to accomplish, but if you have a saved *.html* file on your site (via custom file upload or however you need) and want to display just the *CherryPickedHTMLWrapper* div, then the simplest option may be to load it via JQuery's `.load()` method: documentation. This method can load a local file into an element on your page, and you can even specify a page fragment, like so:

```
$('.result').load('uploads/test.html .CherryPickedHTMLWrapper');

```

If you prefer to do it server side, you would likely want to create a custom plugin to read in the file and parse the DOM to get the element you need. There are some tools to make this easier, such as PHP Simple HTML DOM Parser.

---
Tags: file-uploads, html, strip-html
---


# Question
Title: Validating CC while using Membrr and Stripe
When a new user is created on my site, its suppose to bill the account a recurring fee of $8 but for some reason an account can be created without entering any Credit Card information at all. Heres a picture of the plans from the Membrr Module.

The Transaction doesnt even show up in Stripe which I'm not sure if its suppose to in test mode, but just in case it is I thought I would mention that. The API Keys I used were the Test Secret Key, and Live Secret Key if that helps any

How can I stop the user from getting pass the registration page if they enter incorrect or no Credit Card Information?

**Edit after nonprofit\_tech's reply:**

I'm trying to allow users that are logged into the "members" member group to have access to specific content on the website. On the registration page, the user is asked to add in their Billing Information and Login Details. They are given a 30 day free trial and the credit card would be charged when the trial period ends.

Here is my form

After registration the user is moved to the group "members" and on expiration they are moved to "expired members"

So with the way the registration process is here, would it be possible to validate the Billing Information at this point, or is the only option after the 30 days when the card is to be charged?

In OpenGateway, I have stripe set up as the only Gateway.

**Stripe Details In Open Gateway:**

* Enable This gateway?: Enabled
* Enabled Mode: Live Mode
* Test API Key: sk\_test\_xxxxxxx
* Live API Key: sk\_live\_xxxxxxx
* Accept Visa: Yes
* Accept MasterCard: Yes
* Accept Discover: Yes
* Accept American Express: Yes

# Answer
> 1 votes
Your question is missing a fair amount of detail, but I'm going to make some assumptions. The first assumption is that you are set-up in test mode. The second is that you haven't created a default **'no privilege'** member account.

From what I can see from the Membrr Docs is that Membrr doesn't so much interfere with the standard ExpressionEngine registration process, as opposed to allowing you to charge. The following information from the Membrr Docs is what I'm looking at:

> Member Group after Purchase - (Optional) What member group should the user be moved to when they are a subscriber to this plan?

and

> Member Group after Expiration - (Optional) What member group should the user be moved to after their subscription to this plan expires?

I could be wrong, but basically new registration should go into a membership level with no privileges, say just 'members'. Then, **Membrr** will handle transferring them to a member\_group with privileges after payment has been processed, so they could be moved from say 'members' to 'monthly', 'yearly', or 'fitness'.

You'd then use the membership level to restrict or provide access to various content on the site.

Your test set-up of Stripe should log your test transactions. That's the purpose, to see if the gateway is working for you. So I'd assume there's something wrong with your set-up there, as well.

But more detail about, what you want to do, maybe some sample code of how you set-up registration, etc. would be good.

---
Tags: membrr
---


# Question
Title: How do I remove an 'index' template from a Template Group?
Please let me know if I'm doing this correctly. I've created a new EE website with a template group called `about_us`, which has an `index` template - just the way I want it.

However, I also have another template group called `resources`, in which I intend to place things like CSS Templates and Javascript Templates. As such, I don't want an `index` HTML template in this group.

There doesn't seem to be a button to delete an `index` template. Is this possible, or am I approaching this the wrong way?

# Answer
> 7 votes
You can't have a template group without an index template, but you don't have to use it. You could either set the preferences for the template in the CP to have it inaccessible to guests or simply place `{if segment_2==""}{redirect="whatever"}{/if}` in it to prevent access to the template directly.

# Answer
> 5 votes
There seem to be two different questions here:

**Where do you store "assets" like CSS or JS files in an EE install?**

Personally, I store them out of EE and access them using either a path relative to root or using the {site\_url} variable.

```
<link rel="stylesheet" type="text/css" media="screen" href="{site_url}/assets/css/screen.css" />

<link rel="stylesheet" type="text/css" media="screen" href="/assets/css/screen.css" />

```

Storing those assets externally means that they won't have to be parsed by EE and thus will not take resources. Reusable chunks (for lack of a better word) of your site will be stored in Global Variables (or Low Variables), Snippets or Embedded templates depending on what you need.

**Can you make whole template groups inaccessible or remove index file from template groups if you do not use them?**

Tyssen gave you a good answer there: template preferences or using 404 or other redirects based on segments.

---
Tags: templates
---


title: Using Stash to get related lists

text:
# Question
Title: Using Stash to get related lists
I'm using Stash for the first time and having a little trouble getting a list of channel entries relating to a Zoo Visitor Member.

The main issue seems to be with the `set_list`. If I hard-code the `author_id`, it works fine, but if I try and pass it the member\_id, it fails. I'm sure it's something simple and parse order related, but I'm just not seeing it.

I have checked out a couple of other answers: here and here. They have got me this far, but I'm still missing the final piece of the jigsaw!

Also, if there is any improvements to the way I've laid things out, I'd be very receptive to any tips, like I said it's my first time using Stash and I'd like to be doing it properly and as DRY as possible. Should I move the markup which is in the stash:content into a partial for example?

Here is the code I'm using:

```
{stash:embed:layouts:site}

{exp:channel:entries status="not closed"}
{exp:zoo_visitor:details member_entry_id="{entry_id}"}
    {exp:stash:set name="team_member_id"}{visitor:member_id}{/exp:stash:set}
{/exp:zoo_visitor:details}
{exp:stash:set name="title"}{title}{/exp:stash:set}
{exp:stash:set name="h1"}{title}{/exp:stash:set}
{exp:stash:set name="team_member_photo"}{member_staff_photo}<img src="{url}" alt="{title}" title="{title}" />{/member_staff_photo}{/exp:stash:set}
{categories limit="1"}
    {exp:stash:set name="team_member_category"}{category_name}{/exp:stash:set}
{/categories}
{exp:stash:set name="team_member_biog"}{member_biography}{/exp:stash:set}
{exp:stash:set name="team_member_firstname"}{member_firstname}{/exp:stash:set}
{/exp:channel:entries}

{exp:stash:set_list name="jobs" parse_tags="yes"}
{exp:channel:entries channel="job" status="not closed" dynamic="no" author_id="{exp:stash:get name="team_member_id"}"}
    {stash:job_title}{title}{/stash:job_title}
{/exp:channel:entries}
{/exp:stash:set_list}

{exp:stash:set name="content"}
<div class="main">
<div class="banner">
    <div class="content">
        <h2 class="bb">Banner Title</h2>
        <div>
            <p>Banner Copy</p>
        </div>
    </div>
</div>
<div class="g2">
    <div class="item single team">
        <p>{exp:stash:get name="team_member_category"}</p>
    </div>

    <div class="item single">
        {exp:stash:get name="team_member_photo"}
    </div>

    <div class="jobs double team">
        <h3>{exp:stash:get name="team_member_firstname"}'s Jobs</h3>
        <ul>
        {exp:stash:get_list name="jobs"}
            <li>{job_title}</li>
        {/exp:stash:get_list}
        </ul>
    </div>
    <div class="biog quad">
        {exp:stash:get name="team_member_biog"}
    </div>
</div>
</div>
{/exp:stash:set}

```

EDIT: Updated code adding gets and sets to stash tags to make more readable.

EDIT 2: Thanks to Jérôme for the solution, it's a combination of his suggestions. Here is the new working code for reference (the content section was unchanged, so is not included here):

```
{exp:stash:set parse_tags="yes" parse_depth="2"}
{exp:channel:entries status="not closed"}
{exp:zoo_visitor:details member_entry_id="{entry_id}"}
    {stash:team_member_id}{visitor:member_id}{/stash:team_member_id}
{/exp:zoo_visitor:details}
{stash:title}{title}{/stash:title}
{stash:h1}{title}{/stash:h1}
{stash:team_member_photo}{member_staff_photo}<img src="{url}" alt="{title}" title="{title}" />{/member_staff_photo}{/stash:team_member_photo}
{categories limit="1"}
    {stash:team_member_category}{category_name}{/stash:team_member_category}
{/categories}
{stash:team_member_biog}{member_biography}{/stash:team_member_biog}
{stash:team_member_firstname}{member_firstname}{/stash:team_member_firstname}
{/exp:channel:entries}
{/exp:stash:set}

{exp:stash:set_list name="jobs" parse_tags="yes"}
{exp:channel:entries parse="inward" channel="job" status="not closed" dynamic="no" author_id="{exp:stash:team_member_id}"}
    {stash:job_title}{title}{/stash:job_title}
{/exp:channel:entries}
{/exp:stash:set_list}

```

# Answer
> 3 votes
I think this is indeed a parse order problem. IMHO {exp:stash:team\_member\_id} is not set yet when you call it. You can track it down if you read the template debugging.

Looks like the problem is that when you set team\_member\_id, you are in a channel entries loop, when you try to get it you are outside. Two different layer of the (now) proverbial oignon here, I think.

`parse="inward"` is needed in your channel entries tag so things are parsed in the right order

**Proposed solution 1: use process="end"**

EDIT: That one didn't work, because it does not solve the fact that the set is inside EE tags, while the get is outside.

You could also delay the parsing of that part of the template using {exp:stash:parse process="end"}

```
{exp:stash:parse process="end"}
    {exp:stash:set_list name="jobs" parse_tags="yes"}
        {exp:channel:entries parse="inward" channel="job" status="not closed" dynamic="no" author_id="{exp:stash:team_member_id}"}
            {stash:job_title}{title}{/stash:job_title}
        {/exp:channel:entries}
    {/exp:stash:set_list}
{/exp:stash:parse}

```

I always find those difficult to debug. The way I go about these is to break them down to simple components and test them one by one.

**proposed solution 2: wrapping the first entries loop in a big stash set**

Putting all EE tags in the same "oignon layer" by wrapping the channel entries loop in one big stash set did the trick (see Steve's code above). Now everything is using the same structure in terms of layers:

1. stash tags
2. ee tags
3. stash set / get

**template organisation**

As far as your template organisation goes, that's pretty much how I work as well. I tend to use get and set, though. Its clearer to me when I read code down the line.

# Answer
> 2 votes
You don't appear to have any `{exp:stash:set}` or `{exp:stash:get}` tags in your template. You can only do `{stash:variable_name}` inside a `{exp:stash:set}` or `{exp:stash:set_list}`.

---
Tags: templates, stash, zoo-visitor
---


title: Expresso Store - PHP in email template

text:
# Question
Title: Expresso Store - PHP in email template
Is it possible to allow PHP in the Expresso Store email templates? I can't see settings to do so in the admin.

The reason I need to do so is as follows.

We are going to use the Status message field to pass a parcel tracking code to the email template so the customer can track their parcel. However, if the parcel is going to the USA then we need to allow 2 tracking codes (one for the UK, then the next for the US leg of the journey).

We were going to enter both codes in the message box separated by the | (pipe) symbol, but we obviously need some way to split that apart on the template.

If anyone can suggest a better way to add two tracking codes then I'd be glad to hear it!

Thanks in advance for your advice.

T

# Answer
I couldn't work out how to make PHP work, but I did realise that I could use almost EE tag in the email - so I wrote a new plugin that would expose the PHP explode function to the template via a tag.

I've submitted the plugin to Devot-ee http://devot-ee.com/add-ons/string-explode-tag but the code is below as well!

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * String Explode Tag Class
 *
 * @package     ExpressionEngine
 * @category    Plugin
 * @author      Tom Burr
 * @copyright   Copyright (c) 2013, Turned Out Nice Again
 * @link        http://niceagain.co.uk
 */

$plugin_info = array(
    'pi_name'           => 'Explode String Exp',
    'pi_version'        => '1.0',
'pi_author'         => 'Tom Burr',
'pi_author_url'     => 'http://niceagain.co.uk/',
'pi_description'    => 'Tag for PHP explode() function.',
'pi_usage'          =>  StrExplode::usage()
);

class StrExplode
{

public $return_data = "";

// --------------------------------------------------------------------

/**
 * Str Explode creator
 *
 * This function explodes a string into an array and returns the designated index value
 *
 * @access  public
 * @return  string
 */
public function __construct()
{
    $this->EE =& get_instance();
    $this->return_data = "";

    $string = $this->EE->TMPL->fetch_param('string', '');
    $delimiter = $this->EE->TMPL->fetch_param('delimiter', '');
    $index  = intval($this->EE->TMPL->fetch_param('index', "0"));

    //Output transformed string
    $tempArray = explode($delimiter, $string);
    if(count($tempArray) - 1 < $index)
    {
        $this->return_data = $tempArray[count($tempArray) - 1];
    }
    else
    {
        $this->return_data = $tempArray[$index];
    }
}

// --------------------------------------------------------------------

/**
 * Usage
 *
 * This function describes how the plugin is used.
 *
 * @access  public
 * @return  string
 */
public static function usage()
{
    ob_start();
    ?>

    Sometimes you need to use PHP functions but don't want to
    enable PHP in the template. This plugin allows you to use
    the PHP explode function in an EE tag passing the
    delimiter, array index, and string to search as parameters.

    With this plugin you can pass EE variables to the tag
    which will process them and return the index value from the array.

    This example returns the string 'value2';

    {exp:strexplode delimiter="|" index="1" string="value1|value2" }

    ------

    Thanks to Christopher Reding's ( http://christopherreding.com/ ) "Tag for PHP str_replace() function" for the inspiration for this plugin.

    <?php
    $buffer = ob_get_contents();

    ob_end_clean();

    return $buffer;
}

}
/* End of file pi.strexplode.php */
/* Location: ./system/expressionengine/third_party/strexplode/pi.strexplode.php */

```

This can then be called in the email (or any) template using the tag:

```
{exp:strexplode index="0" string="{order_status_message}" delimiter="|"}

```
> 2 votes

---
Tags: expresso-store, status, messages
---


# Question
Title: Cartthrob: Does the Purchased Items channel call ‘entry_submission_end’ EE hook?
When an order is complete, and a new entry has been created within the ‘Purchased Items’ channel, does the `entry_submission_end` EE hook fire? I need to process some data as orders are completed with the data held within this channel.

# Answer
> 1 votes
You should use the `cartthrob_on_authorize` hook. From there you can find the entry ID's of the saved purchased items entries:

```
$entry_ids = $this->EE->cartthrob->cart->order('purchased_items');

foreach ($entry_ids as $entry_id)
{
    //do some more processing here
}

```

# Answer
> 2 votes
CartThrob doesn't use the Channel Entries API, so the entry\_submission\_end hook is never triggered. You will need to use one of the hooks they provide instead.

---
Tags: cartthrob
---


# Question
Title: Trying to output first_page and last_page pagination links when there's less than four pages
I've been having problems getting the first\_page and last\_page pagination links to work correctly. I then spotted a user comment in the docs that said they only appear if there's four or more pages (though I hoped this just applied to the auto-generated pagination\_links variable). I'm trying to output them at all times and thought the pagination variables would give me that flexibility.

I've inserted my code below - can anyone see if I'm doing anything wrong here? Or is there another way to be going about this? Or is it by design or a bug that the first\_page and last\_page only work when there's four or more pages? The links do indeed work when there's 4 or more pages.

```
{paginate}
  {pagination_links}
    <div class="search-pagination">
      <ul>
        <li class="first"><a href="{first_page}{pagination_url}{/first_page}">First</a></li>
        <li class="prev"><a href="{previous_page}{pagination_url}{/previous_page}">Previous</a></li>
        <li class="page-info">Page {current_page} of {total_pages}</li>
        <li class="next"><a href="{next_page}{pagination_url}{/next_page}">Next</a></li>
        <li class="last"><a href="{last_page}{pagination_url}{/last_page}">Last</a></li>
      </ul>
    </div><!--search-pagination-->
  {/pagination_links}
{/paginate}

```

# Answer
> 0 votes
Try a conditional like this:

```
{if next_page}
    CODE
{if:else}
    CODE
{/if}

```

If that doesn't work, you'd need to hack the \system\expressionengine\libraries\EE\_Pagination.php file.

Or take a look at some of the pagination addons on **Devot-EE**.

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


title: Matrix no results equivalent?

text:
# Question
Title: Matrix no results equivalent?
I have a Matrix field (parent) in a channel set to have exactly 4 rows. The rows feature a Playa drop-down. These will serve as promotional tiles in the page templates to cross-promote other pages in the site

In the templates I must always display 4 tiles so need to write a fallback so if only 3 are selected then 1 extra random tile is shown, if only 2 are selected then 2 extra random tiles are shown, etc.

I've got this working fine using the Search parameter, eg:

```
{parent search:child="not IS_EMPTY"}
    DO THIS
{/parent}

```

However, the problem I'm experiencing is what to do if no options are selected (i.e. all Playa fields/rows are empty). Ideally would be able to do an `{if no_results}` conditional but can't access from within the `{parent}` loop and because using search cannot access via a `{if parent:total_rows==0}` conditional.

Any thoughts?

# Answer
> 2 votes
You can use the `search:col_name=` parameter in combination with `:total_rows`:

```
{if '{parent:total_rows search:child="not IS_EMPTY"}' == 0}
    ...
{/if}

```

Hope that helps!

# Answer
> 0 votes
Thanks Brandon for the relpy. I couldn't get this to work in Matrix without returning a PHP error but was able to achieve the desired effect by using the native ExpressionEngine query module, eg

```
{exp:query sql="SELECT * FROM exp_matrix_data WHERE col_id_7 != '' && entry_id = '{entry_id}'"}
  {if no_results}
    {embed='embeds/footer-tiles' total_rows='0'}
  {/if}
{/exp:query}

```

If trying something similar you might need to run in an embedded template so as not to cause a conflicted {no\_results} result!

Hope this helps somebody else!

Cole

---
Tags: matrix, playa
---


title: Pre populate a text input field

text:
# Question
Title: Pre populate a text input field
I have a number of text input fields in an event registration channel that I would like to be pre-poulated with defaults and so not require entering anything unless it's different. This thread gives the javascript to add in the instructions box for Matrix fields, but I want it for a single Text input field and my javascript is rubbish.

# Answer
> 6 votes
Since Field Instructions will allow HTML and JS, you can add the following in the Field Instructions for that custom field:

```
<script type="text/javascript">
    $(document).ready(function() {
        if ($('#field_id_23').is(':empty')) {
            $('#field_id_23').val('This is the default text');
        }
    });
</script>

```

Just be sure to change `field_id_23` to the correct field\_id in your instance.

**Important note:** If you are entering this snippet in a custom field's Field Instructions make sure it does not use space characters for the indentation. If you copy and paste directly from here it will and they will be encoded to ` ` which will break the JS.

As an alternative to using Field Instructions to hold your JavaScript, CP CSS & JS is useful for adding snippets of JS to the Control Panel.

---

Note that the above jQuery assumes you would never want to leave the text input blank. If that isn't the case, you'll want to incorporate a check that this is a *new* entry instead of relying on the `.is(':empty')` conditional:

```
<script type="text/javascript">
    $(document).ready(function() {
        if ($('input[name="entry_id"]').val() == '0') {
            $('#field_id_23').val('This is the default text');
        }
    });
</script>

```

---
Tags: custom-fields, pre-populate
---


# Question
Title: has anyone done a plugin for an automatic magazine layout?
before I get my hands dirty, I wanted to ask if someone in the community has done an automatic layout tool for expressionengine?

I am talking about the method here: http://alistapart.com/article/magazinelayout

the php code is available, but I think it has no caching and I don't speak php...

any hints welcome!

# Answer
There is no currently-available add-on for this ... so many variables involved with EE's flexibility.

IMHO, a javascript-based solution - like Masonry \- would make much more sense, especially in the age of responsive design and fluid layouts. This "magazine" approach only makes sense for fixed-width viewports.
> 3 votes

# Answer
I've certainly never seen an add-on that does that for EE - that's some deep math. :) You can run PHP within an php-enabled EE template though. You could also experiment with some of the other great add-ons out there like Assets and CE Image.
> 0 votes

---
Tags: automation
---


title: How to optimise safecracker js & css

text:
# Question
Title: How to optimise safecracker js & css
I have a safecracker form that uses a number of third-party fieldtypes. The fieldtypes all require their own external javascript and css files. On what looks like a simple form the combined fields use approximately 30 asset files that add up to around 900 kb which isn't ideal.

Is there a good way to optimise this? My current thinking is to use the `include_jquery="no"` and `safecracker_head="no"` parameters and manually include the asset files and combine and minify using Minimee. However this isn't ideal as I'll need to reexamine all the assets files whenever an add-on is updated.

# Answer
There is no solution to this currently. The best route to optimization is what you're doing already. Carry-on!
> 0 votes

---
Tags: safecracker, javascript, css
---


# Question
Title: Cookies appear to ignore subdomain restrictions? (EE1)
Ok, I've got my primary site running EE1 at www.example.com. I've set up a subdomain of static.example.com, from which I want to serve static assets; specifically, files that don't need cookies being attached to the requests.

My EE -\> Admin -\> SysPrefs -\> Cookie Settings are:

```
Cookie Domain: .www.example.com
Cookie Path:        (ie. blank)
Cookie Prefix:        (also blank)

```

Once those settings are verified, I logout of the backend and use Firebug + FireCookie to remove all cookies for the current domain. Loading up, say, `static.example.com/css/main.css` shows that indeed, there are no cookies being transmitted with the static file request.

However, if I then load up the frontend of the EE site at `www.example.com`, I see a number of cookies being stored: a JW Player cookie and a few Facebook and Google Analytics cookies - all of which are expected, along with 3 EE cookies: `exp_tracker`, `exp_last_visit`, and `exp_last_activity`. All of those EE cookies have domains of `.www.example.com` \- but somehow ALL of them are *also* being transmitted when I request the aforementioned `static.example.com/css/main.css` file.

I'm no cookie expert, but I would have expected that by specifying the `.www` subdomain for the cookies in EE, they would have been restricted to requests that include that subdomain.

What am I doing wrong?

# Answer
> 1 votes
Sandwich, I'm no expert here either, but looked over your problem to see if I could learn something. Here's what I could suggest.

* I think the basis is that cookie domain setting in EE is for the purpose of defining what domain sent cookies will be assigned to - but it isn't about whether to send cookies. Sending cookies is presumed.
* I thought of working with the cookie consent module, which does allow restricting cookie sending. However, this is a (recent) EE2 addition, so it's not going to help on an EE1 site.

I'm not sure why you want to restrict cookies on resources, but maybe you could segregate those static resources further, and only put on the subdomain things that are truly static. Even a css file as in your example can be so, of course, and you could just copy-paste from a css template if you develop there. Then you wouldn't invoke EE at all on the subdomain -- by not putting an index.php there, and by the way you address the resources in your templates or other html. Then there would be no cookies.

If the question is actually to do with EU cookie restrictions, then I think you'd need to update to latest EE2 to gain best use of the new module. Reference Cookie Consent, and be sure to notice the comment at bottom which says where to get the module at present.

---
Tags: cookies, subdomain
---


# Question
Title: MSM: links not working in the second domain, shows only default template
I’m working on a MSM setup and I’ve got the index template going, but the system won’t show the subtemplates.

To explain the basis situation:

I setup the Multiple Site Manager for two domains. One is the first domain, which worked as expected, The second one is in a subfolder with it's own DNS domain name.

Basically I setup the sites with the index.php and admin php files placed in their folders as instructed in the docs, but for some reason links didn't work in the second domain. Every link just shows the default template.

I've set the index.php file for the second domain as follows:

config settings:

> $assign\_to\_config\[‘site\_name’\] = ‘f....\_nl’;
> $assign\_to\_config\[‘cp\_url’\] = ‘........nl/admin.php’;
> $assign\_to\_config\[‘site\_url’\] = ‘.......nl’;

Thanks!

# Answer
> 2 votes
Meanwhile I've got it sorted out with the help of the EE team.

The odd behaviour was that the main site worked, and the secondary domain too, but links didn't work in the second domain, every url parsed the default index template. Setting

> $config\['uri\_protocol'\] = "PATH\_INFO";

In the config file was the solution to making it work normally. (although the behaviour confused Robin from EE too).

---
Tags: templates, multi-site-manager
---


# Question
Title: Send order-confirmation to different emails in Expresso-Store
I've created an order-based store using ... Store! Recently my client asked if certain orders could be send to a different email-adress based on which member-category (using IntoEEtive's Member Categories) the customer belonged to.

I created a hidden input-field on the check-out-page, with an email dynamically inserted based on the member's category. Can I use that value in any way to send confirmation-emails? When I tried to enter {order\_custom1} in the BBC-field I got an error (of course...).

# Answer
The BBC field uses CodeIgnitors "valid\_emails" form rules to make sure that the emails entered are valid. I might be mistaken but even removing that rule from the code would not allow for order fields to be parsed in the BBC field.

At the moment you would need to write an extension based upon the `store_order_complete_end` tag to send the email after the order has been completed.
> 2 votes

# Answer
I haven't tried this, but we used a similar message to customize the outgoing message subject, when orders were processed from different sections and sub-sites, so it may also work for email.

```
CONFIRMATION: Publication Order from {order_custom9}

```

Basically, we created a `custom order field` and inserted that into the subject from the `checkout_review` template, with a hidden input variable

```
<input type="hidden" name="order_custom9" value="Social Science Store" />

```

So, I imagine, but can't guarantee this would work, but you could insert a custom field into the **BCC:** field, like:

```
BCC: default@domain.org, {order_custom10}

<div class="form-actions">
    <input type="hidden" name="payment_method" value="free" />
    <input type="hidden" name="order_custom10" value="{selected_email}" />
    <a href="{path='store/order_checkout'}" class="btn">Back</a>
    <input type="submit" name="submit" value="Place Order" class="btn btn-success" />
</div>

```

where the `{selected_email}` would be the results of whatever calculation you use to determine the proper email address. This could be straight up text, with an `{if}{if:else}` statement or potentially a field. We've worked with just straight up text, so I can't say a field would work, but it could.

Anyway, there's no harm in trying. But this is how we've been using `custom_fields`, basically to modify the outgoing email messages.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: Simple Search provide Status Dynamically
I have a simple search form that I would like to submit a status dynamically, is there any way to do this, right now I am using javascript to submit the form and depending on what status options are toggled i would like to limit the status fields it searches.

If I cannot change the available status's on submission, can I restrict the status on the results page something like this?

```
{exp:search:search_results status="closed|draft"}

```

I can always use the template to not display status's on the results page, but I would prefer not to loop over 10 status's for every result.

# Answer
> 1 votes
The docs don't indicate you can set status from the search form but you can **set status on the search results page** with the `status="draft|reviewed|published"` parameter .

---

You might also consider these two addons:

**Super Search** OR **Low Search** which both give you more advanced search capabilities.

---
Tags: status, simple-search
---


title: P&T Field pack within Safecracker

text:
# Question
Title: P&T Field pack within Safecracker
Having a few problems with the P&T field pack working within safecracker.

I am trying to get a checkbox field working...

If I use the short field name tag i.e. `{field:mycheckboxes}` it works, it submits the correct checked boxes, and it remains checked if other elements of the form fail validation.

However, I want to specifically target the options in order to apply styling, but any combination I've used other than the short name, all fails to submit the data.

I've tried Low options, like so

```
{exp:low_options:walk_features_new}
{options}
  <label class="checkbox">
  <input type="checkbox" name="walk_features_new[]" value="{walk_features_new:value}"/>
    {option:label}
  </label>
{/options}
{/exp:low_options:walk_features_new}

```

It all outputs correctly into the form, but nothing gets submitted.

# Answer
> 1 votes
This is rather a HTML issue. "Look at the source Luke".

Use Chrome Devtools or Firebug to see how the basic {field:fieldname} field is rendered. Target your options from there. And even if you need and use an addon, look at the docs https://github.com/lodewijk/low\_options. from what i read there it is {option:value}, not {fieldname:value}

---
Tags: safecracker, fieldtype
---


# Question
Title: Exp:resso Store form created by products tag - I just want to submit a single SKU
In continuation of my thread here, I'm still interested in setting up a products form where all the SKUs are laid out, and a visitor simply clicks a button beside the SKU to add exactly one of that product, in that SKU variation, to the cart.

James Muspratt posted a slick solution here in which the modifier options are laid out as stylized radio buttons, which use jQuery to manipulate the modifier drop downs (hidden with CSS). That's *almost* what I need, but rather than a row of radio button choices connected to the individual modifier drop downs, I need the options combined as an SKU option in one button. The submit button, ideally, would then just submit that SKU to the cart.

I think that it would somehow be possible to do, but I'm having trouble following the generated block of code beginning with "" , and I do not understand what the Products form is actually submitting (particularly in the hidden field '\_params').

I don't have any issue pulling the SKUs for a product out of the Store tables with MySQL. I just have an issue with submitting it.

For example, I can use the following MySQL to pull the t-shirt SKU variation that is male cut, black, and size small. I can produce a button that is enabled or disabled depending if stock is available. For some reason, however, the code doesn't actually submit the SKU to the cart:

```
{exp:channel_entries entry_id="953"} <!-- simplified channel_entry tag -->
{exp:query sql="SELECT sku, entry_id, stock_level FROM exp_store_stock WHERE entry_id = '{entry_id}' AND sku LIKE '%_m_sm_black%'"}
<!-- this works because the SKU format contains consistent code for the item -->

{exp:store:product entry_id="{entry_id}"}
    <input type="hidden" id="item_qty" name="item_qty" value="1" />
<input type="hidden" name="item_sku" value="{sku}">
    <button type="submit" name="submit" {if stock_level < 1}disabled="disabled" class="disabled"{/if}>S</button>
    <br/>{stock_level}
{/exp:store:product}

{/exp:query}
{/exp:channel_entries}

```

Anyway, I feel like I'm missing hidden variables of some kind, or completely misunderstanding what fields and data need to be submitted to the cart (in the normal drop-down modifier option entry procedure) in order to add a cart item this way.

Does the SKU get figured out (based on the product ID and the modifier selections) between the event of hitting the "add to cart" button and returning the page? I guess that another way of saying what I want to do is submit a fixed quantity and an SKU of an item directly to the cart. I hope this is not totally beyond the capability of Store.

If you made it this far, once again, thanks for turning this question about Store's product submission forms over in your mind.

—Rob

# Answer
You're on the right track.

To clarify the `_params` hidden field, it is just an encrypted record of any parameters you used in the tag. It's not used much in the add to cart form, but for example in the checkout tag, if you specify required fields we need to encrypt these, otherwise the customer could simply edit the hidden field and make them not required. Just submit the `_params` hidden field intact and you won't have any problems.

> Does the SKU get figured out (based on the product ID and the modifier selections) between the event of hitting the "add to cart" button and returning the page?

Exactly. In the add to cart form, you submit the modifiers, and the SKU is figured out automatically. You don't specify a SKU directly. This is because some products have modifiers which aren't related to the SKU (e.g. "gift wrapping" yes/no), and also because if a product has more than one modifier, submitting the SKU would require javascript to figure out the matching SKU rather than just submitting the drop-downs and letting Store do the hard work.

Therefore, instead of this:

```
<input type="hidden" name="item_sku" value="{sku}">

```

You need something like this:

```
<input type="hidden" name="modifiers_16" value="38">
<input type="hidden" name="modifiers_17" value="43">

```

The `name` field refers to the `product_mod_id`, and the `value` field refers to the `product_opt_id` related to that SKU.

So assuming you wanted to keep your existing SKU loop, something like this will probably work to output the correct modifiers (completely untested, but hopefully it puts you on the right track):

```
{exp:store:product entry_id="{entry_id}"}
    <input type="hidden" id="item_qty" name="item_qty" value="1" />
    {exp:query sql="SELECT * FROM exp_store_stock_options WHERE sku = '{sku}'}
        <input type="hidden" name="modifiers_{product_mod_id}" value="{product_opt_id}">
    {/exp:query}
{/exp:store:product}

```
> 3 votes

---
Tags: expresso-store, forms, shopping-cart
---


# Question
Title: Additional mime types in Focus Lab config - how to add?
Is it possible to add additional mime types to the $mimes array (/system/expressionengine/config/mimes.php) from the config.master.php when using the Focus Lab config setup?

I really don't want to start changing files in the expressionengine directory to have it potentially be skipped when upgrading EE core software. Need to add in mime types for kml/kmz files.

# Answer
> 2 votes
The Focus Lab config will only override variables in config.php and database.php by default. You could add an additional `require xxx/config.master.php` to mimes.php if you wanted to, but since that requires editing the file anyway, and it unnecessarily complicates things, you're better off just adding the new mime types directly.

```
// Custom mime types
'kml'   =>  'application/vnd.google-earth.kml+xml',
'kmz'   =>  'application/vnd.google-earth.kmz'

```

I'd suggest also submitting a support request/bug report/email to EL requesting that those mime types are included in future releases.

# Answer
> 0 votes
Not sure if this will work, only guessing:

```
$env_config['mimes'] = array(
    'kml' => 'whatever'
);

```

---
Tags: focus-lab-master-config, bootstrap
---


title: Run extension on page refresh?

text:
# Question
Title: Run extension on page refresh?
I am new to plugin/extension development in EE. I currently have an extension that creates a cookie and saves a value to it. What I want is on every page refresh this value to be updated.

Is there a way to have the extension run on each page refresh?

# Answer
Yes: use the sessions\_end hook. It runs on every page load. Be sure to check to see if you're using it on the front-end before you set your cookie (I assume you want this for the front-end only).

```
if(REQ != 'CP')
{
    // do your stuff
}

```
> 4 votes

---
Tags: extension, plugin
---


# Question
Title: Force SSL on some URLs but non-SSL on others with .htaccess
I'd like to redirect requests for certain urls to secure https with .htaccess rules. I found this excellent tutorial:

https://exp-resso.com/blog/post/2011/08/securing-your-expressionengine-website-with-https

Based on this, I can redirect everything in the "account" template group, my system folder and the admin.php file with the following:

```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond $1 ^(account|system|admin\.php) [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```

This works perfectly. But now I'm trying to find out how to do the opposite, redirect other URLs to non-secure http. I don't want to hard code navigation with http URLs. I'd rather use {path=''} and {site\_url} variables.

Also, ideally it would work so that I don't have to hard-code all my non-secure template groups and pages into the .htaccess file.

```
RewriteCond $1 ^(about|contact|calendar|unicorns|etc) [NC]

```

This would be too hard to maintain.

# Answer
After a lot of research and experimenting, I think I found a solution:

```
# Force non-SSL on these URLs
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(account|system|admin\.php)  [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

```

This rule checks if the request IS https, is not a form's POST action, isn't a file or directory that exists, and isn't one of the secure URLs (account, system, or admin.php). If all of those conditions are met, is redirect to non-secure http.

But for my homepage, www.example.com with no trailing URL segments, I had to write another rule.

```
# Force non-SSL on the homepage
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} !^ACT= [NC]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond $1 ^$  [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

```

I had to add a line to exclude ACTion ID URLs for things like Safecracker.

This solution seems to be working for me right now, but I'd love to hear any additional input. Either if I can streamline this or if I've overlooked something.

## Update

As commenters have mentioned, using HTTPS everywhere is a better option. And it's most likely easier than jumping thru hoops with your htaccess rules.
> 5 votes

# Answer
Just throwing it out there but I've used this module before and it only requires a small tag in templates you want to serve via https. http://devot-ee.com/add-ons/dm-force-ssl
> 2 votes

# Answer
We've got this in a project where we wanted to exclude SSL for certain directories. We wanted it on the frontend, but not on the system & dashboard, where we were having issues with popups and custom fields:

```
RewriteCond %{ENV:SECURE_REDIRECT} != on
RewriteRule ^(system|dashboard) https://www.yourdomain.com%{REQUEST_URI} [NC,R=301]

```

**Updated:** That's specific to EngineHosting. Standard method is the following, which may still be more concise to exclude directories:

```
RewriteCond %{HTTPS} != on
RewriteRule ^(system|dashboard) https://www.yourdomain.com%{REQUEST_URI} [NC,R=301]

```
> 1 votes

---
Tags: htaccess, ssl
---


# Question
Title: How to remove the 'Add html button' button from the formatting toolbar
If you show/allow the default HTML formatting buttons for a custom field there is a red cross that allows you to add HTML formatting buttons.

Many of my users find this confusing and don't understand what is on offer or how to do it, so I'd like to be able to remove it.

Ideally I'd rather not have to hack a core file, but if that's the only way to do it which file contains the means?

# Answer
> 1 votes
This red cross?

As far as I can tell the only way to remove this without hacking the core is to use override.css or to add a CSS snippet to the control panel (use CP CSS & JS).

```
.markItUpHeader .btn_plus {
    display: none;
}

```

---
Tags: control-panel, custom-fields
---


# Question
Title: Assets2 not displaying all uploaded images
I think I have a problem with the box that appears when you want to select an uploaded image.

* I have a folder with about 150 images in it.
* When I browse this folder via the Assets2 module I am able to see all of the images.
* When I try and select an image using the Assets field type in a Matrix cell the pop up box only shows a few of the images.
* I know the image is because it appears when I manually search for the file name.
* I think the problem is that the images are not refreshing when I pull the scroll bar down. Using Safari 5.1.7 and Chrome 24.0.1312.57

# Answer
Kenny,

It sounds like this is happening in the publish page; I reported a bug on that the other day to our team. This should be fixed in a future release, but I do not have an update right now. I've made a note to come back to this thread and update once it is fixed.

-Lisa
> 1 votes

---
Tags: assets
---


# Question
Title: PT Checkboxes returning label instead of value
ExpressionEngine 2.5.3
PT Fieldpack 1.0.3
Matrix 2.4.3

Maybe I'm going crazy, but PT Checkboxes seems to be showing labels for the value instead of the value. My {winner} fieldtype is structured like this:

one : 1st Place
two : 2nd Place
three : 3rd Place

It shows like this in the Publish form:

x 1st Place
x 2nd Place
x 3rd Place

However, **{winner}** returns 1st Place, 2nd Place, 3rd Place in the template. **{winner:label}** returns one, two, three. Isn't that backwards?

Additionally, I'm having the same issue with PT multi-select. It saves the appropriate value to the DB, but I have no way of displaying it.

**Code Added**

```
     {exp:channel:entries channel="awards" dynamic="no" limit="1"  disable="categories|category_fields|member_data|pagination"}
    {awards_results}
        <p>Value: {award-highlight}<br/> Label: {award-highlight:label}</p>
    {/awards_results}
 {/exp:channel:entries}

```

# Answer
Here's the right code for what you want, and will give you the customization you need. This is from the PT Checkbox docs included in the download for the FieldPack. I didn't actually see a reference to the :label argument in our docs for Checkbox (though 'tis there for other addons, such as the Dropdowns). So do please use the variable pair approach:

```
    {exp:channel:entries}
<h1>{title}</h1>
    {pt_check}
    {option_name}: {option}<br />
    {/pt_check}
<hr />
{/exp:channel:entries}

```

{pt\_check} is my checkbox field. So if you're doing this in Matrix, you'll have that inside of your Matrix variable pair.
> 0 votes

---
Tags: add-on, pixelandtonic, pt-checkboxes
---


# Question
Title: Altering the 'forgot password' behavior?
Under our login form, I have a 'forgot password' link which goes to the native EE page for this: /members/forgot\_password. When the link is clicked:

* EE sends an email to the user.
* User clicks on link.
* EE resets password to something random.
* EE emails new password to user.

I'd like the change this sequence so the user can create a new password. How would I do this?

Thx.

# Answer
There are at least two add-ons which will allow the password reset to work as you described, with the user entering their own password:

**FreeMember**
See the reset\_password tag

> The Reset Password tag allows users to change their password directly, after they click the link in their email.

OR

**Securit:ee**
See the forgot\_password tag

> Instead of resetting a password Securit:ee sends a confirmation code, that auto expires, and allows users to set their own passwords
> 3 votes

---
Tags: login, users, password, authentication
---


# Question
Title: Problem with injecting stash pipe separated entry_ids into channel entries loop when no results
I've came across a problem today where I wanted to 'inject' a stash pipe separated list of entry\_ids into the entry\_id parameter of a channel entries loop.

The problem wasn't to do with stash as such. I'd got my parse order correct, and stash was doing it's job as expected. The problem was that when my stash variable didn't contain any entry\_ids, the channel\_entries loop just output the latest entries in that channel rather than output nothing.

Here's my initial code that didn't do what I wanted:

```
{exp:stash:set name="recently_viewed_ids" output="no" parse_tags="yes" trim="yes"}
{exp:channel:entries channel="properties" disable="categories|member_data|pagination|trackbacks" dynamic="no" backspace="1"}{entry_id}|{/exp:channel:entries}
{/exp:stash:set}

```

and the channel entries loop that used the stash variable:

```
{exp:channel:entries
    channel="properties"
    entry_id="{exp:stash:get name='recently_viewed_ids'}"
    limit="4"
    disable="categories|member_data|pagination|trackbacks"
    parse="inward"
}
{!-- display custom fields here --}
{/exp:channel:entries}

```

So even if recently\_viewed\_ids was empty, EE returned the 4 latest entries in the channel, rather than nothing.

So what's the way around this?

Jim

# Answer
> 5 votes
After much searching and head scratching I finally turned to Twitter and got help from the fabulous @mediagirl and @low.

The solution to this is fairly simple:

To trigger a 'no\_results' situation in the channel\_entries loop using the entry\_id parameter we have to enter either "-1" or "0|":

```
entry_id = "0|"

```

In my case I used "0|" and actually fixed\_order instead of entry\_id to preserve the order that the entry\_ids are in.

So my final working code now looks like this:

```
{exp:channel:entries
    channel="properties"
    fixed_order="0|{exp:stash:get name='recently_viewed_ids'}"
    limit="4"
    disable="categories|member_data|pagination|trackbacks"
    parse="inward"
}
    {!-- display custom fields here --}
{/exp:channel:entries}

```

I hope that this manages to help someone else.

Incidentally, I should add that I'm using the JP Recently Viewed extension, so my original channel\_entries loop also contains recently\_viewed="y".

Cheers

Jim

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


title: member site suggestions

text:
# Question
Title: member site suggestions
I wondered if anyone could suggest the best direction to take for this site.

The site is mainly a site with members profiles. Members will add a profile and others will search through their profiles. The members will fill out a short form with bio/contact/ and other information.

IS it best to have everything in member fields using something like Solspace User or have a simple member form and have all the content in a channel entry?

What sort of things do I need to consider in making this choice? I will want to be able to sort and filter the members profiles with items such as categories etc.

# Answer
> 1 votes
You could use an add-on like Zoo Visitor, Profile:Edit or Safecracker Registration which all use channel entries for their members. You'll then be able to treat members like you would any other channel. (Safecracker, etc)

---
Tags: members
---


# Question
Title: Looking for a Matrix-like add-on which allows large textareas
I'm looking for an add-on that gives me a custom field with the "unlimited rows" aspect of Matrix, but I don't need the columns or need to specify additional fieldypes.

Is there an add-on that would allow me to add an arbitrary number of free-form chunks of data to an entry?

Updated to say: I'm looking to be able to add unlimited new textareas to an entry, in which I need to enter editable text. The limited size of Matrix/Grid Lite/P&T List fields don't quite work (but I'll fall back to Matrix if nothing else works out).

# Answer
> 1 votes
Grid Lite may be of use to you. (I haven't tried it though)

Also, I think Objective HTML may be working on a table-esque fieldtype.

# Answer
> 1 votes
Would P&T List meet your project's needs?

---
Tags: add-on, matrix
---


# Question
Title: Are there any custom field types, besides Matrix, that allow you to create an updatable, non-finite list of things?
One of my main use cases for Matrix is when I need to manage a non-finite list of things related to an entry (e.g. translation links for articles may trickle in over time, and there's no pre-defined list of sources of them).

Sometimes Matrix feels like overkill, so I'm wondering what other folks use for this purpose.

Edited:

Someone mentioned Pixel & Tonic's List, which is a good one for my translation links use case; it's available in their Dive Bar: http://pixelandtonic.com/divebar

Another common use case is images: how do you allow users to add a non-finite set of images to an entry?

# Answer
> 4 votes
Grid Lite is pretty similar to Matrix, and free. So if you're using matrix solely for translation links, this seems perfect.

# Answer
> 3 votes
Have you looked at Content Elements? http://dvt.ee/ad0g9RJ

---
Tags: custom-fields, matrix, fieldtype
---


# Question
Title: in Expression engine form Admin section there is option of validating "Is this a required field?"
in Expression engine form Admin section there is option of validating "Is this a required field?". doing the check box also it the validation is not working. please any body help me as soon as possible

it already there in admin section saying "Is this a required field?", i checked the check box and submit it. but still the validation is not happening. location of page is CP\>Home\>Administration\>Custom Channel\> Fields\>Edit Field

Field Type is Matrix. Matrix Configuration is file type

# Answer
> 5 votes
If your field is a Matrix field, just checking the native "Is this a required field?" is not sufficient. You need to look further down in your Matrix columns. There is an "Is col required" setting for each column in your matrix field. Tick those and presto, required columns in a matrix field.

You can also constrain the number of rows by using the min rows and max rows parameters

---
Tags: validation
---


# Question
Title: Expresso Store Stripe integration - "The Token field is required." problem
I've got a payment form set up with all the requisite stripe javascript in place. I can see that at the point of submission, the stripeResponseHandler is getting fired and is coming back with a token, which is being inserted into my form before it's finally submitted.

```
<input type="hidden" name="stripeToken" value="tok_...">

```

So I can't understand why I'm getting this error on my payment form:

> The Token field is required.

I mean, it's there, plain as day. I'm getting returned to the checkout page, with that error, instead of going to the final 'order' page. No order is being created in the CP, so something's definitely not working, but it all looks good according to the Stripe docs.

Is this a known issue? Have I made a silly error somewhere?

# Answer
Yeah, just a minor mistake, but that's all it takes.

Try changing this:

```
<input type="hidden" name="stripeToken" value="tok_...">

```

To this:

```
<input type="hidden" name="payment[token]" value="tok_...">

```

As documented here :)
> 3 votes

---
Tags: expresso-store
---


# Question
Title: Set sender email address in frontend using Solspace Freeform (v4)
I'm trying to make a form, using the free version of Solspace Freeform (v4). And I would like to set the "from" field in the email.

```
{exp:freeform:form form_id="2" required="message|email|recipient_email" recipient_user_input="yes" recipient_user_limit="1" recipient_user_template="original" }

    <fieldset class="message">

        <legend>Your personal message</legend>
        <textarea name="message" id="message" placeholder="Hello..."></textarea>

    </fieldset>

    <fieldset class="emails">

        <label for="email">Your email address</label>
        <input type="email" name="email" id="email" placeholder="email@example.com" />

        <label for="recipient_email_user">Receivers email address</label>
        <input type="email" name="recipient_email_user" id="recipient_email_user" placeholder="email@example.com" />

    </fieldset>

{/exp:freeform:form}

```

Can this be done?

# Answer
Yes. In your notification template (in this case, the one called "original", just put `{email}` in the "From" field.

OR, perhaps even better, use an email address originating from your domain (say, `website@yourdomain.com`) in "From", and use `{email}` as the "Reply-To" address. (This will help with deliverability, as some servers may reject email which is from an address that does not originate on the sending domain.)
> 2 votes

---
Tags: solspace-freeform
---


title: Assets tag pair not outputting anything

text:
# Question
Title: Assets tag pair not outputting anything
I have an Assets field set up with multiple images selected inside a channel entry. When I try to output these images using the code below, nothing appears.

```
{exp:channel:entries channel="list_photos" entry_id="37" limit="1" disable="categories|pagination|member_data"}
  {photo}
    <li><a href="{photo:url}" class="gal" rel="group" title="{photo_description}"><img src="/phpthumb/phpThumb.php?src={photo:url}&w=200&h=140&zc=1&q=80" width="200" height="140" /></a></li>
  {/photo}
{/exp:channel:entries}

```

Can anyone identify the problem?

EE 2.5.5

Assets 2.0.5

# Answer
> 2 votes
Don't use the prefix when you're within the tag pair (the `field_name` prefix is only for when you want to access one of the field's properties outside of the tag pair):

```
{photo}
    <li><a href="{url}" class="gal" rel="group" title="{photo_description}"><img src="/phpthumb/phpThumb.php?src={url}&w=200&h=140&zc=1&q=80" width="200" height="140" /></a></li>
{/photo}

```

---
Tags: assets, pixelandtonic
---


# Question
Title: SafeCracker Entries Created With Status “Closed”
Here is how its setup.

The Channel: Personal Trainer Directory

### Edit Group Assignments

Status Groups: Statuses

### Edit Preferences

Default Status: Open

### Member Group Settings

Channel Assignment

Can post and edit entries in Personal Trainer Directory: Yes

Module Access Privileges

Can access module SafeCracker: Yes

### SafeCracker Module Settings

Personal Trainer Directory

Default Status: Open

SafeCracker tag

```
{exp:safecracker
channel="personal_trainer_directory"
return="/member/profile"
entry_id="{segment_3}"
status="open"
safecracker_head="no"
use_live_url="no"
url_title=""
}

```

The entries are being created fine, just dont understand why they are showing up as closed still. Is there anything that I forgot?

**Edit:** I added the Member Group Settings section above, I forgot to add that initially so I'm still having the same issue

# Answer
> 7 votes
Make sure that the member adding the entry is in a group that has access to the non-closed statuses. Before you do that, ensure a status group is assigned to the channel. Superadmins can use Open and Closed even without a status group assigned; but others can't - and that is the most common cause of what you're seeing.

# Answer
> 0 votes
I was having this problem. Try removing `status="open"` from the Safecracker tag altogether. Worked for me.

---
Tags: safecracker
---


# Question
Title: Is there a downside of using WYGWAM over Rich Text formatting buttons
I've always tried to avoid using WYSIWYG except for the main body field, thinking that it was better to try and keep as much as possible as plain text in the database.

But the conflicting methods/styles could confuse content editors, so I'm now thinking it might be better to use a constrained version of WYGWAM for all textareas instead of the Rich Text Formatting buttons/toolbar.

Is there any performance loss or a problem further down the line that may cause me to regret going down this road?

# Answer
> 1 votes
The only downside I've ever run across is the lag when loading Wygwam on the publish pages, especially if there are more than one on the page. Wygwam is still using CK Editor 3 so it's possible that when they eventually update this to CK Editor 4 (like Wyvern has) the performance issues will be reduced or eliminated altogether. The upside for me, however, far outweighs the downside. I have FULL CONTROL over the toolset I can give clients and pretty much anywhere I would use a text area, I use a Wygwam field.

The UX benefits are important to me so when clients see a field where they can enter a paragraph they see the WYSWIG field. The tools they are given are applicable to the content they are entering. If it makes sense to allow them to add bulleted lists they get the bulleted list menu. If I want to only allow them to bold or italicize text, pretty much everything is removed from the toolbar.

The only buttons that are consistent across ALL Wygwam fields for me are the source code button, the show outline boxes, and some form of the format drop down menu. The format drop down ALWAYS contains the normal style so if a paragraph somehow is removed they can easily fix it without having to deal with the source code. The show outlines is only there so they can turn off the default state of the outlines being on and the source code button is there for emergencies.

A lot of this applies to using Wyvern but I prefer the control panel Pixel and Tonic has provided for working with CK Editor and the advanced features much better then Wyvern. While I like the effort put into Redactor, I am not all that impressed with the results in use compared to Wygwam or Wyvern so I avoid Redactee and Editor. I stopped using Tiny MCE after figuring out what I can do with the advanced config settings in Wygwam.

# Answer
> 1 votes
I usually install a very stripped down version of any WYSIWYG editor, Wygwam included. That's usually less confusing for the client than seeing the code produced by the Rich Text Formatting buttons. If all you need are basic tags, the source code formatting is not that bad

Aside from the RTE shipping with ExpressionEngine, here are the popular solutions. All of these have options to customise the formatting options available to the end user.

* NSM Tiny MCE (built on Tiny MCE - free)
* Wygwam (built on CK Editor - commercial)
* Wyvern (built on CK Editor - commercial)
* Redactee (built on Redactor - commercial)
* Editor (built on Redactor - commercial)

Additional factors to consider:

* integration with other add-ons (Structure, Matrix, Low variables)
* ease of customisation
* responsiveness in the CP (if you use many of them in one publish form).

# Answer
> 1 votes
I can think of one potential drawback when using a wysiwyg for *all* your textarea needs:

There are times where even though you want the user to have bold, italics, or link buttons, you *don't* want them to be able to add multiple paragraphs!

If you find yourself in that situation when replacing textareas with wysiwyg fields, one reliable way around that is to use an html stripping plugin to strip `p` tags. Wygwam has a built-in parameter to do just that (Text-Only Mode).

But if you're only worried about extra *paragraphs* in Wygwam, not line breaks, you can approximate the EE textarea's "Auto \<br\>" format by creating a Wygwam editor configuration that uses CKEditor's enterMode config. Wygwam has a handy UI for setting CKEditor configuration options.

# Answer
> 0 votes
One thing I don't like about Wygwam (although I assume it's really to do with CKEditor) is that the source code formatting is a mess. I've been told that can be corrected, but the fixes I've read about didn't work for me.

---
Tags: custom-fields, wygwam, wysiwyg
---


# Question
Title: Is there a way to display inline Status & Error Messages?
I'm new to ExpressionEngine and I was wondering if there is a way to display status and error messages inline instead of on their own page?

For instance, it would be nice, if someone got their password wrong, if it didn't show you that on a separate page, but instead showed you that on the same page (similar to the way Drupal does it).

thanks!

# Answer
It depends for each scenario. For member registration & login with inline error handling, we have created a free plugin called FreeMember which is quite popular.

There are also other commercial member plugins which provide inline error handling and more (e.g. custom member fields using any fieldtype) such as Zoo Visitor, Profile:Edit and Safecracker Registration.

For each scenario you need to look for different plugins. For example, Safecracker (front end entry forms) provides inline error handling out of the box. Comment forms you will need to investigate different solutions etc.
> 2 votes

# Answer
I don't know of a way to display system errors in a template tag.

But you can use the **Custom System Messages** addon to move system messages into a template. This gives you more control over customizing the errors.

If you have JS skills, there's no reason you shouldn't be able to submit your login form using Ajax and show an appropriate error on the screen. You'd write a conditional based on the action ID (`{action}`) in the template to handle login errors in a specific manner and all other errors regularly.

> This extension lets you define any 2 templates within your template groups to be used as the error page. You have access to all the usual variables from the Specialty Templates, plus two new ones {referrer} and {action}.
> 2 votes

---
Tags: ee2, error, status, system-messages, messages
---


# Question
Title: Can I make a Matrix Fieldtype and put in a row another Matrix fieldtype that contain file fieldtype?
I need to make a Matrix fieldtype where i have: 1 Column -\> Text field -\> Label: Chapter 2 Column -\> Matrix -\> 1 Column -\> Text field -\> Label: Slide -\> 2 Column -\> File field -\> file

I need to do it like a PowerPoint slideshow where Members can make a new slideshow with an entry in a channel "presentation", and add "chapter 1" -\> add slide 1, add slide 2, add slide 3 ... Then add "chapter 2" -\> add slide 4, add slide 5, add slide 6 ...

Can you help me to understad how?

# Answer
If you're needing to have multiple slides per Matrix row, why not use Assets to upload multiple files for each row? You'd have an Assets column in your Matrix to handle that.
> 1 votes

# Answer
Whilst you may be able to cobble this together using something like Nolan, I would instead recommend using two separate channels - one for Presentations and another for Slides, then use Playa to pull in the relevant slides into a presentation. This will give you much more flexibility (multiple custom fields/matrices per-slide) and will probably perform better too.
> 0 votes

---
Tags: matrix
---


title: Hiding filters for a playa field

text:
# Question
Title: Hiding filters for a playa field
Is there a way to hide the filters for a Playa field that has is set to allow multiple entries? This is being used in a safecracker form and I don't want users to see statuses, categories, member groups etc - just a simple drag and drop list that shows entries from A-Z.

Thanks

# Answer
Thanks to Alex Kendrick - I don't know why I didn't think of hiding the plus/minus buttons with the site theme's CSS: https://expressionengine.stackexchange.com/a/5710/22
> 1 votes

---
Tags: playa
---


# Question
Title: {order_id} in CartThrob not using correct ID
I have the radio button for "Create sequential order/invoice numbers" and it is adding the proper order id to the entry title, but I'd like {order\_id} to return that as well.

order\_id column in exp\_cartthrob\_order\_items has a completely different number.

For instance:

"Last Order Number" field shows the next ID should be 548. In the DB the last order\_id was 3487. As I said, the 548 is showing up as the entry title, just not saving as the order id. Any thoughts?

R

# Answer
> 0 votes
The `{order_id}` corresponds to the `{entry_id}`, not the 'order number' in the title.
As far as I know, you can't get that number in your templates.

However, you could change your title prefix from lets say "Order #" to just blank, then in your template just reference `{title}`.

Then instead of just using `<h1>{title}</h1>`, you'd use `<h1>Order #{title}</h1>`.

---
Tags: add-on, cartthrob
---


# Question
Title: Specify Location on Expresso Store Order Submission
I'm looking for a way to identify which 'Store' an order came from.

A little context, our client, a restaurant, uses Expresso Store to handle their online ordering. They've just opened a new location, and online orders all go to the same email address, making it impossible for them to determine which location the order refers to.

I'm working around this using a cookie that gets set to a value depending on which page they are ordering from. On submission, I'd like to set the order status depending on the cookie value.

Am I right in assuming I'll need to use the 'store\_order\_complete\_end' hook to change order status on submission? Or is there a way to set status before submitting the order?

Thanks in advance.

Bobby

**EDIT:** I believe the change, if possible, would have to be made within the {exp:store:payment} tag pair. I noticed that it has access to the {exp:store:order} tags, including the order\_status parameter. In the latter, it's used as a filter, but when used in the {exp:store:payment} tag pair, could it be used to set the order status?

**FINAL EDIT:** Hey guys, just wanted to let you know I've found a workaround for this problem using Michael's advice below. I'm using a custom variable. Basically, there is a page for each location that has an address checker (to see if you're within the delivery zone). On success, both are directed to the same order page, and the custom variable is set. This value is appended to the subject line for the Order / Payment Confirmation emails.

There is a master email address that is BCC'd on all emails. We then use filtering to forward to individual store email addresses depending on the subject line.

All in all, it's not the most elegant solution, but it does work. Thanks again for the help.

# Answer
> 2 votes
You could write an extension using the \*store\_order\_submit\_end\* hook, which runs each time an order is submitted (i.e. runs whether the order "completes" or not).

However, it might be more semantically useful to reserve the "Status" to states like "In Progress", "Submitted to the Kitchen", "Out for Delivery", etc.

**Have you considered using Store's custom variables to mark orders as belonging to one location or another?**

Orders in Store can have up to 9 custom variables. You can name them whatever you want, set their values using form fields, use them to filter/sort results in your templates, and review them in the CP as part of the Order Details.

That way, you could use statuses to represent the status of the order, and still have values to add a location dimension for use in your business logic.

**Check out the Order Fields page in your Store settings**, and feel free to post a follow-up question if I can explain anything better.

---
Tags: expresso-store
---