title: Forum email url & login redirect

text:
# Question
Title: Forum email url & login redirect
I have a site that is using the forum module. Although the forum is password protected itself, members must be logged in to the website using a custom template before they can access the forum.

When someone tries to access a forum URL, they are redirected to the custom template to log in. I did this by putting a PHP redirect in the forum header template.

The problem is when a member is subscribed to a forum thread and gets a notification email from the forum with a URL to a forum post in it, the link takes them to the forum post page but redirects them to the custom login page.

When the member logs in, the chain is broken and they do not get redirected to the forum post.

Os there a way to get this to work correctly?

# Answer
Actually, I figured out the problem. It was a return parameter setting that was sending logged in users to the same page no matter where they came from.
> 1 votes

---
Tags: forum
---


# Question
Title: "Too Many Redirects" browser error after adding some stuff to .htaccess when trying to view control panel login page
```
RewriteCond %{HTTP_HOST} !^\.site\.com$ [NC]
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

```

I added this to my .htaccess file to remove the trailing slash and it has caused a "Too Many Redirects" browser error when trying to access the control panel at site.com/system or site.com/system/. I think EE is trying to add a url back in on refresh and then the htaccess is trying to remove it again. Any ideas how to fix this?

The CP is accessible through site.com/admin.php so my client isn't completely locked out.

EE 2.5.2

Update with full .htaccess file

```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{HTTP_HOST} !^\.site\.com$ [NC]
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

ErrorDocument 404 /error/404

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

```

# Answer
> 2 votes
**Updated:**

The issue caused by the trailing slash redirect happening *after* your EE index.php rewrite. You need to have this redirect happen before rewriting to index.php. (Note: almost always, you want all redirects to happen before the rewrite to index.php.)

So, the simplest way to correctly remove the trailing slash, that shouldn't cause you issues, looks like this:

```
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^(.+)/$ /$1 [R=301,L]

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

```

In addition to the re-ordering of rules, you don't need to have the full {HTTP\_HOST} reference in the trailing slash redirect, so I changed your original:

```
RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

```

to the more simple (but, effectively, the same):

```
RewriteRule ^(.+)/$ /$1 [R=301,L]

```

And, there's no reason to include the condition that this rule applies only to site.com, *unless* you're running other domains on this same virtual host, and want requests to some domain(s) skip this rule. So, I altogether removed this line from your original:

```
RewriteCond %{HTTP_HOST} !^\.site\.com$ [NC]

```

But, if you want to remove the trailing slash on requests only to site.com, but not on requests to other domains (say, site2.com), you could add the condition, like this:

```
RewriteCond %{HTTP_HOST} ^site\.com$ [NC]
RewriteRule ^(.+)/$ /$1 [R=301,L]

```

Or, if you wanted it to apply to all domains **except** site.com, you'd do this, instead:

```
RewriteCond %{HTTP_HOST} !^site\.com$ [NC]
RewriteRule ^(.+)/$ /$1 [R=301,L]

```

Again, the removal of the trailing slash, which is a redirect, should occur before the rewrite to index.php (redirect rules above the rewrite to index.php in htaccess).

Finally, once you make this change, be sure to restart your browser and/or test in a different browser. Browsers can cache 301 redirects, and may not immediately pick-up these changes.

If you're ever testing a redirect, and want to avoid browser caching, use a 302 (temporary) redirect until you're done testing, and then change to a 301 (permanent) redirect. E.g., you can do this for testing:

```
RewriteRule ^(.+)/$ /$1 [R=302,L]

```

**Added:**

If you still have any trouble, you can be even more explicit about where this rule should *not* apply, e.g., to not apply to your themes and system folders, etc:

```
RewriteCond $1 !^(css|images|themes|system)/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)/$ /$1 [R=301,L]

```

---

**Original:**

I'm not sure if this is the cause of what you're seeing, but your first line of the above .htaccess doesn't seem right:

```
RewriteCond %{HTTP_HOST} !^\.site\.com$ [NC]

```

The dot at the beginning means it's excluding the host name .site.com (i.e., extra dot at the beginning).

So, I think you want to remove that . to make it just:

```
RewriteCond %{HTTP_HOST} !^site\.com$ [NC]

```

Does making that change resolve your issue?

---
Tags: control-panel, redirects, .htaccess
---


# Question
Title: How to delete all member accounts with no channel entries
Any EE folks know if there is a way to delete all member accounts that have no channel entries assigned to them?

In my case any accounts with 0 entries would be spam.

Thanks for your time.

# Answer
> 5 votes
If you're comfortable doing this directly in the database, these are SQL queries that delete all members who are not authors of channel entries:

```
delete from exp_members where member_id not in (select author_id from exp_channel_titles);

delete from exp_member_data where member_id not in (select author_id from exp_channel_titles);

delete from exp_member_homepage where member_id not in (select author_id from exp_channel_titles)

```

Be sure to backup your database first!!! Just in case.

(Also, I assume you meant "authors" when you describe entries assigned to members. Is this correct?)

# Answer
> 0 votes
You can delete all those members with single SQL:

```
DELETE exp_members, exp_member_data, exp_member_homepage FROM exp_members
INNER JOIN exp_member_data
INNER JOIN exp_member_homepage
WHERE exp_member_data.member_id = exp_members.member_id
AND exp_members.member_id = exp_member_homepage.member_id
AND exp_members.total_entries = 0

```

I would suggest you to take database backup first.

---
Tags: members, spam
---


# Question
Title: Error 500 Server Error if no trailing slash
New site that we're building in 2.7 is having a weird issue which I don't appear to be able to get any log information about.

we have http://site.com/c/content-url-title-here and if you try accessing this URL we get a 500 Server Error.

However, if we manually add a trailing slash to make the URL http://site.com/c/content-url-title-here/ it loads the page fine.

I can't see anything in the Changelogs that would indicate a specific 2.7 issue around this, has anyone come across this issue?

For Info, this is my .htaccess:

```
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule (.*) /index.php/$1 [L]

```

I've never had this issue before and none of my apache logs are giving any errors at all. Anyone able to advise?

# Answer
Please Ignore this question... the issue was somewhere between the keyboard and the chair!

Regards,

Carl
> 3 votes

# Answer
The "content-url-title-here" might be a reserved word. I've had it before with some hosting setups that they have a high-level htaccess file redirecting to a control panel or web service.
> 0 votes

# Answer
I've had issue lately with Option +FollowSymLinks - my htaccess is also a bit different

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

```
> 0 votes

---
Tags: url, 2.7.0
---


title: Can't login to control panel

text:
# Question
Title: Can't login to control panel
I've just restored a backup of my site, but now whenever I try and login I get a "Invalid username or password" error. I've tried resetting the password, but even the new password brings up the same message. Any ideas what could be causing this?

# Answer
> 4 votes
Might seem like a silly question, but are you sure you're looking at the correct database for the site? For example, do you have a development site/database/configuration file?

Cookie/Session problems will normally just bounce you to the homepage or back to the login screen. This sounds more like an actual problem authenticating the username/password which really can only be because what you're typing in doesn't match what's in the database table.

# Answer
> 4 votes
Try adding these lines on the bottom of your `expressionengine/config/config.php` file:

```
$config['cookie_prefix'] = '';
$config['cookie_path'] = '';
$config['cookie_domain'] = '';
$config['user_session_type'] = 'c';
$config['admin_session_type'] = 's';

```

# Answer
> 1 votes
Few things you can try here, sessions is the likely suspect.

Firstly try clearing your browser cache, or in a browser like Chrome for example, open up an incognito tab, which will temporarily give you a session without any preexisting cookies to mess things up.

In combination with the above, you can try clearing your exp\_sessions table, which will force EE to forget any previous sessions stored in the DB.

In theory if it's sessions causing a failure to login then this would solve your problem.

What you can also try, although I wouldn't expect this to make any difference if the above dont:

Open your config.php, and look for this line:

$config\['admin\_session\_type'\] = "c"

Insert a random value in there, for example:

$config\['admin\_session\_type'\] = "x"

This will change the name of the sessions being created, again fooling EE into creating brand new sessions rather than matching existing ones.

# Answer
> 0 votes
Check that the user account you are trying to log in with is present in `exp_members` in the database. The password will be salted and hashed but you can at least confirm the presence of the account.

Ensure that browser caches are cleared, along with the system cache directory: system \> expressionengine \> cache.

If that still fails then it may be possible that the restore didn't quite complete successfully for some reason so try it again and ensure that you set it to Drop any existing tables already in the database.

---
Tags: login
---


# Question
Title: Cartthrob not returning after transaction with SagePay
I am having an issue with sage. Transactions are going through and money is being taken no problem, but it isn't returning to the desired return= param.

I have tested with PayPal and all works fine. Has anyone else had an issue like this? Any solutions out there?

Cheers

# Answer
have you updated the extload.php inside /themes/third\_party/cartthrob/lib ?
> 1 votes

---
Tags: cartthrob, sagepay
---


# Question
Title: How can I add configurable variables to my add-on?
I have developed a module, and now I would like it to make it configurable by admin users. How do I go about adding editable variables (I assume to the control panel page) and how do I later access these values in my code please?

I can't find any useful tutorials or references on this subject.

# Answer
Modules in EE have no built-in way to store configuration data (unlike Extensions, in which you can store "settings").

So you'll have to create your own custom database table(s) during module installation, then write to/fetch from that table in your module control panel methods.

The module tutorial in the user guide shows how to create a new table during install, and also how to fetch data in your .mcp file, then pass that data to your view file.

I'd strongly suggest reading through the entire add-on development section of the user guide, it will give you a pretty comprehensive overview of how things work in EE add-on development.
> 1 votes

---
Tags: add-on-development, configuration-variables
---


# Question
Title: HTML email support for member registration
Wondering how i can send a HTML email to a user upon registering, I am using Freemember which i believe uses the default EE Email Notification Templates.

Any suggestions?

# Answer
If an account is automatically activated then the activation email isn't sent. You could use Registration Emails or if you need more complex email functionality then use Postmaster.
> 3 votes

# Answer
You need to first enable HTML emails in the **Email Configuration** settings (Control Panel Location: Admin ‣ Email Configuration).

Then edit the **Member Account Activation Instructions template** and any other template you want served as HTML.
> 2 votes

# Answer
You could also use MX Notify Control to fire an email using the Member Register trigger.
> 1 votes

---
Tags: freemember, registration, register
---


# Question
Title: How to add an Auto Responses for the Events created?
I have several events created using ExpressionEngine on my website. Currently when someone registers for a training or workshop, I manually respond via email with a welcome letter and a pdf attachment of a reading list and information. Help me on How to add an AutoResponses on my website so that each event has an auto-response that comes from me when someone signs up for that event.

Thanks N

# Answer
> 1 votes
Have you looked into MX Notify? You can setup all kinds of rules and is really easy to use!

---
Tags: events
---


# Question
Title: Can the Expresso Store download tag deliver web page urls?
Is it possible to use the download tag (https://exp-resso.com/docs/download\_tag.html) in Expresso Store to deliver a url of a web page and not to download a file.

I'm looking for a way to sell access to individual channel entries.

Thanks for any ideas on this...

Regards Lee

# Answer
> 1 votes
The download tag would not allow you to just show a URL if the order has been paid. You could however wrap the content within a `{exp:store:orders}` tag pair then use the conditional `{if is_order_paid}` to only show the content if the order has indeed been paid for.

Also I have seen in the past someone create similar functionality by adding a custom field to the content that they wanted to secure that basically had the entry\_id of the product that could be purchased. So for example let say your product with an entry\_id of 25 was purchased. That product granted access to some content in another channel, in the other channel you would need a field (playa, relationship, text fields or similar) that you entered the value 25 in. Then in your template you would need to write a custom query to search the `exp_store_orders` tables for the currently logged in members orders then check the `exp_store_order_items` for the corresponding ordered items to see if one of the items the currently logged in member purchased was indeed the entry\_id that you specified earlier (in this case 25).

Having said that your best bet would be to extract that query into a little custom plugin instead of having that all at the template level.

---
Tags: expresso-store
---


# Question
Title: How can someone edit categories without editing an entry
I have set up all of the proper permissions for our client to edit categories, and this is working. But so far as I can tell, there is no way to give access to the Admin -\> Channel Settings -\> Categories section without giving them access to the Channel Settings, Channel Fields, etc.

What I am needing is for my client to be able to see, arrange, and edit categories without having to go to an entry and switch to the categories tab. Add-ons welcome.

# Answer
> 2 votes
Unfortunately, you can't give that modular of access for categories. I highly recommend using Zoo Flexible Admin add-on to modify the CP's main menu tabs to essentially hide the areas you don't want them to find.

---
Tags: categories, permissions
---


title: Expression Engine PHP Error Log

text:
# Question
Title: Expression Engine PHP Error Log
How can i find or get an PHP Error Log? Not server-side, only on Expression Engine Level.

On my server i can see an error log but to fix a problem with assets, i need a EE-side php error log.

# Answer
> 1 votes
EE logs errors to the PHP error log. But, you can see errors in EE's responses (i.e., on your web pages) by setting in your config.php:

```
$config['debug'] = '1'; // display errors only to the Super Admin

```

or

```
$config['debug'] = '2'; // display errors to everyone

```

---
Tags: php, error, php-errors
---


# Question
Title: How to enable channel URL and not have EE use template group?
I have a channel named Contact, that will hold basic contact information.

The channel fields for this group I have is short list of a few input text fields and one textarea. The template group I have is a template that holds standard content for most pages, also called Page Content.

I have manually entered the url for the Contact channel, adding contact to end of my site's url.

Of course, when I navigate to this page right, I am getting a 404. I am able to access the page by going to http://mysite.com/page-content/contact.

How do I remove the first segment and have EE load the particular channel URL I have specified for this channel?

# Answer
The **Channel URL** setting is intended to mark the URL of the channel itself, not of just one of its entries.

You should use the Pages Module for this.
> 3 votes

---
Tags: channel, url
---


title: Can I bulk move structure entries?

text:
# Question
Title: Can I bulk move structure entries?
I currently have hundreds of entries listed in structure 2 levels deep like this:

-Category
--Sub Category \[X10\]
---Item \[x10\]

(These are not expression engine categories but structure pages with sub pages)

I want to move all of the items up one level and remove the sub category so it will look like this.

-Category
--Item \[x100\]

Is there an easy way to bulk update these entries or will I have to do it manually?

Thanks,

Colin

# Answer
> 1 votes
I'm afraid you will have to do it manually without writing some sort of custom script.

---
Tags: structure, update, bulk
---


title: ExpressionEngine Classes

text:
# Question
Title: ExpressionEngine Classes
New to using Expression Engine Classes and not sure how to use the Email class. I created the class and placed it within my template, but now i get a Parse Error. Again new to EE. How would I go about using this class, such as submitting the input fields. Here is my code.

```
<form method="post" id="vara-registration">
        <?php
          ee()->load->library('email');
          ee()->load->helper('text');
        ee()->email->wordwrap = true;
        ee()->email->mailtype = 'text';
          $errors = array();

          foreach($member_emails as $username => $from)
       {
        ee()->email->from($from);
        ee()->email->to("email@email.com");
        ee()->email->subject(" Registration Request");
        ee()->email->set_alt_message('User has requested Login verfication');
        ee()->email->send();

    if ( ! ee()->email->send())
    {
        $errors[] = ee()->email->print_debugger();

        // Send failed, data was not cleared
        ee()->email->clear();
    }
    ?>

    <p><label for="name">Name</label><input type="text" name="name" id="name_sec" value=""></p>
            <p><label for="phone">Phone</label><input type="text" name="phone" id="phone_sec" value=""></p>
            <p><label for="Email">Email</label><input type="text" name="email" id="email" value=""></p>
            <p><input type="submit"></p>
    </form>

```

# Answer
I'm a little confused as to what you're trying to accomplish. Are you simply trying to email contents of a form submission? If so, there's no need for you to be using PHP in templates and using the email library.

ExpressionEngine has an email module built in, which allows you to email form submissions. You can read about the email module contact form tag in the documentation.
> 1 votes

---
Tags: php
---


# Question
Title: Low Search form to filter by Solspace Tag GROUPs
I'm building a Low Search form to filter channel entries by Solspace Tag GROUP fields. I have installed Low Search Tag (http://github.com/low/low\_search\_tag) but it looks like my only options are filtering by individual tags, ex:

```
<select name="tag_id:group1[]" multiple="multiple">
  {exp:tag:cloud tag_group_name="group1"}
    <option value="{tag_id}"{if tag_id IN ({low_search_tag_id:group1})} selected="selected"{/if}>
      {tag}
    </option>
  {/exp:tag:cloud}
</select>

```

But I need a similar select dropdown in my form showing the Solspace Tag GROUPS.

CHANNEL FIELDS: Each Tag GROUP belongs in its own channel field (screenshot).

**What name="" attribute do I need for a similar dropdown of Tag Groups so that if a Tag Group is selected, entries with at least one tag in the selected Tag Group will be included in search results?**

# Answer
I can't answer for Low Search, but you can use a query to get a list of tag groups:

```
<select name="i_dont_know_for_low_search">
{exp:query sql="SELECT * FROM exp_tag_groups"}
    <option value="{tag_group_id}">{tag_group_name}</option>
{/exp:query}
</select>

```

Ignoring Low Search for an instant, if you were using a regular HTML form and POST variables (or a plugin such as Mo'Variables to get POST values of a submitted form), for example, you could then use PHP to create a string of pipe-delimited tags using `{exp:tag:tags}` and the `tag_group_id` that you selected.

Then, put this string of tags in `{exp:tag:entries}` to get a list of entries based on the selected tag group.
> 1 votes

# Answer
I've replied to your email already, but will repeat here for visibility.

In short, you want a single dropdown that contains custom fields that in turn relate to tag groups. You want to see if the selected field is not empty. The tricky part is that usually, Low Search fields will target **field values**, not the fields themselves.

Low Search can target specific fields or global entry data. You're looking to see if field A, B or C is not empty (has tags). Normally, that would be accomplished with `search:field_a="not IS_EMPTY"`, `search:field_b="not IS_EMPTY"` etc, which translates into:

```
<input name="search:field_a" value="not IS_EMPTY">
<input name="search:field_b" value="not IS_EMPTY">
etc.

```

The `name` parameter targets the field, the `value` parameter targets the value. Same with `<select>` elements. This means you can't use a single drop down for multiple fields, unless you use javascript to change the name="" parameter of the select-element. For example:

```
<select name="">
    <option value="not IS_EMPTY" data-field="search:field_a">Field A</option>
</select>

```

Add an `onchange` event to the `<select>` to read out the `data-field=""` attribute to change the `name=""` attribute of the `<select>`.
> 1 votes

---
Tags: low-search, solspace-tag
---


# Question
Title: Assets uploads Failing, Server requirements
I'm running EE 2.5.5 and Assets 2.1.4

I have massive upload problems on several websites running assets. assets fails to upload certain images. i get a notification «Could not upload the file - server returned an unexpected response. Please check the server settings»

we had this issue in previous threads. i set the all concerning folders to 777. i checked upload paths and .htaccess. everything seems ok. i can upload files like pdf with the same settings.

i believe there must be some server setting that is wrong but i can't find the requirements for assets. can anybody help?

# Answer
> 1 votes
I was able to solve this problem. it turned out that there was a wrong FastCGI implemented on the server. My host implemented a new version of FastCGI and now the upload with assets works like it should.

---
Tags: assets, uploads
---


# Question
Title: Wygwam 2.6.3 - how to keep full style (image, table) from copying other article to wygwam field
When I copy content of article (from other site) and paste it to my field (field type: wygwam), all styles is removed, only plain text remains. I need my article is the same to the article that I copy from other site. May somebody helps me?

Thanks!

# Answer
By default you need to use paste from Word icon in the toolbar, not the keyboard shortcut Ctrl+V (or Cmd+V).

You can also edit the toolbar configuration within Wygwam and add an advanced setting for "forcePasteAsPlainText" and set it to No. You can then use Ctrl+V (or Cmd+V) and your formatting is retained.

But this will mean that if a user copies from another source, it could contain all the other junk (e.g. copied from Word).
> 0 votes

---
Tags: wygwam
---


# Question
Title: Is it possible to call public methods in my module using the core codeigniter mvc routing?
I am developing a module which resides in the third\_party directory of my expression engine install, which includes a public method which sends an email when called via cron. Currently the only way I can think to call this method is by setting up an action and calling it via the url.

Something like this;

```
http://my.domain/?ACT=52

```

This seems to be confirmed here as a valid approach.

The problem with this is that it breaks as soon as the module gets re-installed, as the action id will be regenerated.

So then I thought about making a template, which has an embedded call to my module method, and visiting the url of this template from my cron job. This is ok, but I don't like the idea of using templates for something that is not in any way a view.

What I would like to do, bearing in mind EE is built on an MCV framework, is use the codeigniter routing to call it. Something like;

```
/third_party/my_module/my_controller/my_email_method

```

But I don't know if this is possible, nor what the form of the url would be if it were possible.

# Answer
> 1 votes
You need a to create a plugin tag that would essentially be an alias for the action id. You don't need a controller, as the controller would be the EE template, and you just need a tag to execute an arbitrary method.

You may want to look into Postmaster. The amount of time you would spend rewriting the functionality would need would be far less than the cost of Postmaster. https://objectivehtml.com/postmaster

However, if you are just wanting your own solution so you can maintain it, Postmaster definitely does everything you need from a logic perspective. It has CRON based notifications using ACT id's, and even has plugin tags, so really any combination of emails are possible. So you can be sure that everything you are trying to do is relatively easy to accomplish with EE. The nice thing about Postmaster however, if you can send emails with any service, so it will scale to your needs in the future (should they grow and change).

---
Tags: add-on-development
---


title: My {title} tags are not showing in IE10

text:
# Question
Title: My {title} tags are not showing in IE10
Bear with me as I am brand new to expression engine and PHP in general but the headers on these pages are not showing up in IE10...running it in compatibility mode fixes it but this needs to not happen. Id like to attempt to find the problem myself so here is a sample page starting at line 1:

```
 {assign_variable:sectionID="products"}
{assign_variable:pageID="index"}
{assign_variable:entryID="32"}
{assign_variable:subnav="n"}

{assign_variable:sectionTitle="Products"}
{assign_variable:pageTitle="-"}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
 {embed="includes/browser-title-tag" pageTitle="{pageTitle}" sectionTitle="    {sectionTitle}"}

{exp:weblog:entries weblog="static_content" entry_id="32"}
<meta name="keywords" content="{sc_meta_tags}" />
<meta name="description" content="{sc_meta_description}" />
{/exp:weblog:entries}

{embed="includes/global-head"}

</head>
<body class="{sectionID}">
{!-- hook to put anything necessary right after the opening body tag --}
{embed="includes/global-page-top"}

    {embed="includes/global-header"}

    {embed="products/subnav" catID="0"}

<div id="centering-content-wrapper">

    <div id="content-wrapper">

        <div id="main-content">
            {!-- shows plain content --}
            {embed='includes/plain-content' entryID="{entryID}" sectionTitle="{sectionTitle}" sectionID="{sectionID}" pageID="{pageID}" subnav="{subnav}"  pageTitle="{pageTitle}" }

            <dl>
{!-- Commercial Lines --}
            {exp:weblog:entries weblog="products" entry_id="50"}
                <dt><a href="{title_permalink=/products/product/}">    {title}</a></dt>
                <dd>{prod_short_desc}</dd>
            {/exp:weblog:entries}

{!-- Personal Lines --}
            {exp:weblog:entries weblog="products" entry_id="51"}
                <dt><a href="{title_permalink=/products/product/}">{title}</a></dt>
                <dd>{prod_short_desc}</dd>
            {/exp:weblog:entries}

{!-- Workers Comp --}
            {exp:weblog:entries weblog="products" entry_id="52"}
                <dt><a href="{title_permalink=/products/product/}">{title}</a></dt>
                <dd>{prod_short_desc}</dd>
            {/exp:weblog:entries}

{!-- Specialty Programs --}
            {exp:weblog:entries weblog="products" entry_id="53"}
                <dt><a href="{title_permalink=/products/product/}">{title}</a></dt>
                <dd>{prod_short_desc}</dd>
            {/exp:weblog:entries}

{!-- All Products --}
            {exp:weblog:entries weblog="products" entry_id="66"}
                <dt><a href="       {title_permalink=/products/product/}">See all our Products</a></dt>
                <dd>{prod_short_desc}</dd>
            {/exp:weblog:entries}
            </dl>

        </div> <!-- /main-content -->

        <div id="secondary-content">

            {embed='includes/sidebars-static' entryID="{entryID}"}

        </div>  <!-- /secondary-content -->

    </div> <!-- /content-wrapper -->

{!-- copyright, footer links, etc. --}
{embed="includes/global-footer"}

</div> <!-- /centering-content-wrapper -->

{!-- hook to put anything necessary right before the body tag, e.g. Google Analytics code --}
{embed="includes/global-page-bottom"}

```

So on this page the header not showing up is "Products" and instead is showing up as three x'S vertically in its place. When viewing the page source after the page loads the titles that are not showing are typically in an tag like in this page's case.

I believe this is EE 1.

Let me know if you need any other code!

# Answer
> 1 votes
assign\_variable has been replaced in EE with preload\_replace in EE2!

It's only assigning the var, it's not calling it.

I would suggest reading how EE works http://ellislab.com/expressionengine/user-guide/how\_to/building\_a\_simple\_news\_site.html

# Answer
> 1 votes
Here are a couple ways you can start to debug this:

1) Look at the rendered HTML source (view source after the page is loaded). What do you see for the `title` tag? Including this in your original question will probably help you get a better answer.

2) Run the HTML source through an HTML validator and see if there are any errors.

---
Tags: templates, title
---


# Question
Title: event_start_date formatting month_09_3 instead of September
I am using {event\_start\_date format="%M %j"} to get the format eg Sep 19

But in some cases it is outputting the month as "month\_09\_3" if the URl segments match the date of that event.

My code is below:

```
        {exp:calendar:cal
                date_range_start="{segment_3}-{segment_4}-{segment_5}"
                show_months="10"
                pad_short_weeks="n"
                {if segment_2 !="all"}calendar_name="{segment_2}"{/if}
        }
        {events}
            <tr>
                <td><strong>{event_start_date format="%M %j"} {if event_multi_day}- {event_end_date format="%M %j"}{/if}</strong></td>
                <td>{event_title}</td>
                <td>{event_calendar_title}</td>
            </tr>
        {/events}
            {if no_results}
            <tr>
                <td colspan="3">
                    There are currently no events to display.
                </td>
            </tr>{/if}

        {/exp:calendar:cal}

```

The url example would be http://www.domain.com/new-calendar/culture/2013/09/19/ segment 2 being the calendar\_name.

Thanks

# Answer
> 1 votes
Pretty sure you should be able to use multiple calendars on one page but in this case it didn't work so embedded each calendar in templates to solve.

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


# Question
Title: Make Matrix NOT display as a table in the backend
is there a way to make Matrix not display as a table in the backend, but simply as a group of stacked fields?

Both WordPress and Drupal have "field collection" modules/plug-ins where each item is presented as a mini-form instead of in table format. Assuming Matrix is the only way to achieve a similar field collection in EE, I'd prefer the mini-form format. Otherwise, when a Matrix field collection has a lot of fields, you end up with a very wide table.

Any way to do this? Thanks!

# Answer
In a word: no. Matrix (and Grid) are designed to have a fixed number of columns and have content added one row at a time.

The simplest solution would be to add several custom fields and just display them in order on the publish screen.

But if that's out for whatever reason, then Content Elements may do the trick for you.
> 1 votes

---
Tags: matrix
---


title: Max number of if statements?

text:
# Question
Title: Max number of if statements?
Folks:

I'm wondering if there's a maximum number of if statements allowed before things fall apart.

I'm evaluating if a field has content. If no, display nothing. If yes, display whatever I say. Code:

```
 {if segment_2 != "product1"}
{related_entries id="product2_specifications"}
<ul>
{if max_height}<li>Maximum height - {max_height}</li>{/if}
{if weight_in_lbs}<li>Weight - {weight_in_lbs}</li>{/if}
<li>Overall length of body - {body_overall_length}</li>
<li>Overall Width - {overall_width}</li>
<li>Inside Seat Width - {inside_seat_width}</li>
<li>Inside Height - {inside_height}</li>
{if legroom_length}<li>Legroom (Length) - {legroom_length}</li>{/if}
{if height_from_ground}<li>Height (from ground) - {height_from_ground}</li>{/if}
{if folded_dimensions}<li>Folded Dimensions - {folded_dimensions}</li>{/if}
{if capacity}<li>Capacity - {capacity}</li>{/if}
{if frame}<li>Frame - {frame}</li>{/if}
{if floor}<li>Floor - {floor}</li>{/if}
{if wheels}<li>Wheels - {wheels}</li>{/if}
{if platform_base_size} <li>Platform base size - {platform_base_size}</li>{/if}
</ul>
{/related_entries}

{if:else}

{related_entries id="product1_specifications"}
<ul>
<li>Maximum payload - {max_payload_product1}</li>
<li>Weight in pounds - {weight_in_lbs_product1}</li>
<li>Overall Length - {overall_length_product1}</li>
<li>Overall Width - {overall_width_product1}</li>
<li>Frame width - {frame_width_product1}</li>
<li>Inside Box - {inside_box_product1}</li>
{if platform_base_size} <li>Platform base size - {platform_base_size}</li>{/if}
</ul>
{/related_entries}

{/if}

```

This code works. Now, if I add a single if statement, the whole thing fails. For example, if I add:

```
{if inside_height}<li>Inside Height - {inside_height}</li>{/if}

```

to the first part, it throws an T\_ENDIF error.

I've tried the ifelse plug-in with no success.

I should also note that this is a snippet placed inside a template. Template has a Switchee switch but the error also occurs with a simple if statement.

```
{exp:switchee variable = "{segment_2}" parse="inward"}
{case value="product2"}
            {exp:channel:entries channel="product2_information"}
            {product_information}
            {/exp:channel:entries}
{/case}
{/exp:switchee}

```

where product\_information is the snippet.

Could very well be an easier way to do this. If so, let me know.

Any help would be appreciated.

# Answer
> 3 votes
There is no maximum number of `if` statements. The `T_ENDIF` error you're getting means that there's either a malformed or unclosed conditional somewhere in your code.

First try removing your snippet from within the Switchee block to eliminate that, then remove/re-add your conditionals line-by-line to see exactly when the error starts.

---
Tags: ee2, conditionals, advanced-conditionals
---


# Question
Title: Ajax is loading entire page instead of pertinent data
I am using ExpressionEngine (2.4) with the Solspace Calendar add-on. I have been following the tutorials here for reference:

I am using a template with a regular 'index' page (where the JS and HTML is) and an 'ajaxlist' template in the same group that contains the solspace:cal stuff.

**JS:**

```
$(document).ready( function() {
  var sortTable = $('#sort-table tbody'),
      trigger   = $('.trigger');
  trigger.click( function() {
    var ajaxTarget  = '<template name>/ajaxlist/' + $(this).attr('data-orderby') + '/';
    sortTable.load(ajaxTarget);
    return false;
  });
});

```

**index:**

```
<a href="{path='<template name>/ajaxlist/test'}" class="trigger" data-orderby="test">Test</a>

<table id="sort-table">
  {embed="<template name>/ajaxlist"}
</table>

```

**ajaxlist**

```
<tbody>
{if segment_3 == 'test'}
{exp:calendar:cal first_day_of_week="{current_time format="%w"}" date_range_start="today"}
    {display_each_day}
        {events}
            {event_title}
        {/events}
    {/display_each_day}
{/exp:calendar:cal}
{/if}
</tbody>

```

please note that the ajaxlist code (without the js to load via ajax) redirects to the url appropriately and loads the data just fine.

**PROBLEM**

When we add the JS it runs but instead of returning the stuff inside 'ajaxlist' it returns the entire web page again inside the `<tbody>`! (Nesting the page within itself :p). I really don't know why and would like some help one what steps to take to remedy this to use in conjunction with ajax or with EE.

A coworker of mine suggested that the 'test' variable isn't working because we don't have (and rightly shouldn't have) anything named 'test'. I'm really confused at this point.

Thanks

**EDIT 1:**

I should note that even when removing the 'test' element from all of the code and just used `<template name>/ajaxlist` it still returns the entire page.

# Answer
By "entire web page" do you mean it loads the current page instead of the fragment template content?

Try debugging the ajax call to make sure you're loading the right URL. I bet this is the issue. Most likely you need a leading slash added to the `ajaxTarget`. Assuming you are removing index.php from your URLs the path to your partial should be "/template\_group\_name\_here/ajaxlist/" instead of "template\_group\_name\_here/ajaxlist/"

To debug, add `console.log(ajaxTarget);` and see what value output in the web inspector console.

```
$(document).ready( function() {
  var sortTable = $('#sort-table tbody'),
      trigger   = $('.trigger');
  trigger.click( function() {
    var ajaxTarget  = '<template name>/ajaxlist/' + $(this).attr('data-orderby') + '/';
    console.log(ajaxTarget); // <----- **ADD THIS TO DEBUG**
    sortTable.load(ajaxTarget);
    return false;
  });
});

```

Alternatively, you could just keep an eye on the "Network" tab in the web inspector and see what URL is being requested by AJAX.
> 1 votes

# Answer
What you are describing is expected behaviour.

If you want to load only a part of the loaded page, specify what container you want loaded like so:

`sortTable.load(ajaxTarget + " #container");`

This is also described in the jQuery docs about the `.load()` function
> 1 votes

# Answer
So i figured it out with the help of @Alex Kendrick and @megatrond and combining their suggestions together.

I really don't know what it was. I incorporated the following items to get ther:

* preceding forward slashes
* sortTable.load(ajaxTarget + " #sort-table");
* moved the `table` into the ajaxlist template
* adding the `td` and `tr` elements

Here's the final code:

**JS**

```
$(document).ready( function() {

    var sortTable = $('#sort-table tbody'),
            trigger     = $('.trigger');

    trigger.click( function() {

            var ajaxTarget  = '/<template name>/ajaxlist/' + $(this).attr('data-orderby');
            sortTable.load(ajaxTarget + " #sort-table");
            return false;
    });

});

```

**index**

```
<a href="{path='/<template name>/ajaxlist/test/'}" class="trigger" data-orderby="test">Test</a>

{embed="<template name>/ajaxlist"}

```

**ajaxlist**

```
<table id="sort-table">
<tbody id="sort-table-body">

    {if segment_3 == 'test'}
    {exp:calendar:cal first_day_of_week="{current_time format="%w"}" date_range_start="today"}

        {display_each_day}
        <tr>
            {events}
                <td>
                    {event_title}
                </td>
            {/events}
        </tr>
        {/display_each_day}

    {/exp:calendar:cal}

    {/if}
</tbody>
</table>

```

Thank you both again for you help today.
> 1 votes

---
Tags: solspace, jquery, ajax, solspace-calendar
---


title: Outputting item options from Cartthrob

text:
# Question
Title: Outputting item options from Cartthrob
I have set up a site for booking various conference events with each event represented by a product.

I am trying to output the booking options (set by the item\_options) for each event. The following works but with a couple of problems:

```
 <table>
    {exp:channel:entries channel="orders"}
{if first_item} <tr><td>Order ID</td>{item_options}<td>{option_label}    </td>{/item_options} </tr>{/if}
    {exp:cartthrob:order_items order_id="{entry_id}" entry_id="{8647}"}
  {if first_item} <tr><td>Order ID</td>{item_options}<td>{option_label}</td>{/item_options} </tr>{/if}
   <tr><td>{order_id}</td>{item_options}<td>{option_value}</td>{/item_options} </tr>

    {/exp:cartthrob:order_items}
    {/exp:channel:entries}
     </table>

```

I am encountering two issues:

1. The table heading is appearing for every row
2. The out put works ok if the item entry id is set directly (ie in this case 8647) but I would like to be able to allow the user to select an event on another page and have the entry id fed to the results via a segment. The following code does not work:

`{exp:cartthrob:order_items order_id="{entry_id}" entry_id="{segment_3}"}`

Any help would be much appreciated! Thanks

EDIT: I managed to get the table header sorted by ysing the following code.

```
{exp:cartthrob:order_items entry_id="8646"}
     {if item:first_item}
                <table>
        <thead>
        <tr>
        <td>entry_id</td>
        <td>title</td>
        {item_options}
            <td>{option_label}</td>
            {/item_options}
        </tr>
        </thead>
        <tbody>
        {/if}
    <tr>
        <td>{entry_id}</td>
   <td> {title}</td>
    {item_options}
    <td>{option_value} </td>
    {/item_options}
</tr>
     {if item:last_item}

                        </tbody>
  </table>
                  {/if}
    {/exp:cartthrob:order_items}

```

The Issue of not being able to output a specific list of order items using the entry\_id="{segment\_3}" still remains.

# Answer
There is no such conditional as `first_item` in `exp:channel:entries`.
You need to do this:

```
{exp:channel:entries channel="orders"}
  {if count == 1}...{/if}
{/exp:channel:entries}

```

But you are repeating the first row inside and outside of the `exp:cartthrob:order_items` tag, so it will be shown anyway.

As for the `order_id` in `exp:cartthrob:order_items`, what does "doesn't work" mean? Nothing gets displayed? Have you tried adding `parse="inward"`?
> 1 votes

---
Tags: cartthrob
---


title: Mixing relationships with categories?

text:
# Question
Title: Mixing relationships with categories?
I have two channels: Program Areas and Stories. They need to be related in certain ways and I'm trying to figure out the best way to do that.

* There are 10 Program Area entries
* There are unlimited Story entries, which the user should be able to browse by category, and the 10 categories correspond to the 10 Program Area entries
* On every Program Area entry, a few *related* Story entries should be listed. For example, the 2 most recent.
* The Program Area pages themselves cannot simply be categories, but full-blown entries, with many fields including Matrix fields.

So I seem to have two options:

1. Create a relationship between Program Areas + Stories. Problem: when the client creates a new Program Area entry, s/he will be confronted with a long list of Stories by title, with no regard to category. If there are 1,000 Stories, the client will have to remember which of those correspond to the new Program Area entry they are creating. There's no way to limit the relationship to a single category ON A PER-ENTRY BASIS. Am I wrong about this?
2. Other option: create a set of categories with the same names as the Program Area entries, and assign them to both the Program Area entries and the Stories entries. Each category will have only a single Program Area entry assigned to it (and many Story entries). If the client wants to create a new Program Area entry, s/he will have to start be creating a new category, etc.

These seem to be my two options, and neither seems particularly elegant. Is there another way to do this--perhaps a relationships plug-in that allows me to pull, not individual related entries (like Playa and now native EE), but categories of entries? Thanks.

# Answer
Unless there's an editorial reason not to do so, you also could allow each Program Area to be assigned to a Story. In other words, in the Story entry, the author would choose from among the 10 Program Areas (rather than choosing Stories in the Program Area entries).

Then on the Program Area pages, you'd do the Reverse Related Entries\* look-up for stories, and, e.g., limit it to two by entry date.

(\* I think in the current Relationships field parlance, the Stories would be the parents of the Program Areas.)

---

I'm working on a similar order of relationships right now, where the issue is that I need full entries rather than categories--but I want those full entries to be used a lot like categories. There really is an absence of a perfect model for this kind of thing in EE--or in any of the major CMS, that I'm aware of.
> 1 votes

---
Tags: categories, relationships
---


# Question
Title: Can Low Search keywords also search in categories?
If I enter the keywords "Topic Name" into the search form, can Low Search also find entries that have been tagged with "Topic Name"? This would be something similar to Solspace's Super Search "keyword\_search\_category\_name" parameter.

# Answer
Yes. From the docs:

> Low Search v2.4+ can also add category information to the index, making entries searchable by keywords present in their categories. Just like the regular channel fields, you can add weight to the category name, description and any of the category custom fields.
>
> Note: if you’re using ExpressionEngine 2.7+, making changes to a category will automatically update the index for the associated entries. However, if you’re using an older version of EE, you will need to rebuild the index manually whenever you edit or delete a category.
> 4 votes

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


title: Importing an existing EE site into MSM

text:
# Question
Title: Importing an existing EE site into MSM
We recently purchased and installed MSM running EE 2.7.0

One of the sites we want to manage with MSM is already up and running on its own using with EE 2.6. Both sites are on the same server.

Is there a easy way to get the structure, templates, etc. out of the existing installation and into MSM?

Figure this is common occurrence, but the docs are a bit confusing in this regard.

EDIT: We were advised by EE support that at least in terms of the templates the best bet is to save them as as files and then relocate them, but it sounds like on a larger level there is no magic trick here.

Not sure on the MySQL side if anyone has any tricks to offer?

# Answer
Yes, EE support is right. The template can be imported via template files. But there would be other data like channels and their entries, categories, images etc would be needed to be imported into MSM site.

1) For channel entries, categories you can have simple way. Just run SQL into existing website and export entries data into CSV. The entries can imported with third party add-ons like Datagrab or Importer modules.

2) For images, make the proper file upload directories and put the images. After that from File Manager do sync all. But note, you should take about directory id because in the channel entry the image path save like {filedir\_x}.

3) There may be some third party addons data also. The simple way would be import with SQLs. For it, you will need to study how those addons store data.

There may some other concerns also but not sure without looking at your existing website and MSM site structure.

I hope, it would help you.
> 1 votes

---
Tags: multi-site-manager
---


# Question
Title: Assets + Safecracker: Preselect folder and/or view type?
I don't use Safecracker very often, but I'm working on an EE 2.6.1 project where `{field:assets_field}` is magically bringing the Assets file manager (and uploads) to the front end.

I see that this involves adding a JSON array to the page which configures the field, but I'm not sure if there's a good (or deliberate/preferred) way to get in there and mess with it before the user interacts with the field.

In specific templates where the thumbnail view is worthless without the filename (like a folder of PDFs), I'd like to preselect the list view. In many templates, I'd like to preselect a specific folder – like one belonging to a certain user – not because the person shouldn't see any other files, but because it'd be more convenient if they didn't have to browse through the file tree.

Is it possible to preselect a folder and/or view type?

# Answer
that's tricky. How Assets determines the view is set in your browser's localStorage.

The setting string is stored there under PT\_Assets\_field\_id\_XX, where XX is the id of the field and you'll have to modify that so that "view" is set to list.
> 1 votes

---
Tags: assets, safecracker
---


# Question
Title: Stash variable changes inside of Playa tag
I have a stash variable set to the value of a transcribe variable at the top of my template:

```
{exp:stash:set name="where_to_buy_translation" parse_tags="yes"}
    {exp:transcribe:uri path='/where-to-buy'}
{/exp:stash:set}

```

Farther down in the template, I have a `{exp:playa:parents}` tag:

```
{exp:playa:parents field="accessory_parent_product" var_prefix="app" entry_id="{entry_id}"}
    <a href='{exp:stash:get name="where_to_buy_translation"}'>Where to Buy</a>
{/exp:playa:parents}

```

If I display the stash variable *before* the playa tag, it outputs correctly:

```
http://domain.com/en/where-to-buy

```

But *inside* the playa tag, it displays seemingly random text. This text is different depending on the channel entry being displayed, but is never the string I'm expecting. Is the value of that stash variable changing, or am I missing something here?

Note: I've tried using both the stash variable and a preload\_replace, and while the output is different *inside* the playa tag it is always incorrect, whereas *before* the playa tag it is correct.

# Answer
Repeated use of an identical single tag (as would be generated by the looping of the Playa tag pair) will cause EE to cache the value of the first instance. That means subsequent tag instances would be replaced with a marker such as `M00093...` which are then replaced with the value of the first instance later in the parse order.

I'm not sure why these markers get replaced with seemingly random text, but you can eliminate caching as a possible cause of your problem by adding the word 'random' to the `{exp:stash:get}`

```
{exp:stash:get name="where_to_buy_translation" random}

```
> 2 votes

# Answer
Try adding 'random' to the end of the opening stash tag without the quotes. {exp:stash ... parse\_tags="yes" random}
> 0 votes

---
Tags: playa, stash, transcribe, preload-replace
---


# Question
Title: What are the implications running EE 2.7 on php 5.1?
We've been developing a mayor update for one of our clients website. Their current website runs EE 2.5. We've made the change to 2.7 for several obvious reasons. And everything worked beautifully on the development server.

Then I noticed that the client hosting is running PHP 5.1. Which is sufficient for EE 2.5. But not for 2.7. Php should be version 5.2.4 or higher. Also, the php upgrade isn't possible without a linux upgrade, so said the hosting company. And that can't be done before the deadline next week.

So my question is, what are the implications of running EE 2.7 on php 5.1?

# Answer
> 4 votes
It won't work at all. EE 2.7 (and most add-ons built for it) use features only available in PHP 5.2+, probably most notable is `json_encode` which EE uses a lot internally. Some add-ons such as Store 2 even require PHP 5.3 as minimum now.

Personally I would ditch the host and find one who takes software updates (and therefore server security) more seriously. PHP is up to version 5.5 now and there is no excuse for running software which was released in 2005.

---
Tags: php, 2.7.0
---


title: get function value in a plugin

text:
# Question
Title: get function value in a plugin
i'm trying to write my own plugin and new to php to simplify i want to grab a string from the tempalte then do something with it How do i call getMyString() in another function?

EDIT:

```
class test
{

    public $return_data = "";

    public function __construct()
    {
        $this->EE =& get_instance();
        $this->return_data =  $this->getMyString();
    }

    public function getMyString() {
        $tagdata = $this->EE->TMPL->tagdata;
        return "<p>TEST : " . $tagdata . "</p>";
    }

    public function newFuction() {
          $this->return_data = self::getMyString();
    }
    // usage stuff here

}

```

Thanks!

# Answer
```
$this->return_data = $this->getMyString();

```

return\_data should only be used for the construct method (nod to Derek ;).

In the EE template:

```
{exp:test}woo hoo{/exp:test}

```

or

```
{exp:test:getMyString}woo hoo{/exp:test:getMyString}

```

I appreciate this is only a test, but you can't return anything from the construct if you're returning stuff from the methods - because the construct will always get called, therefore always return something, then the method will return something - so you'll get incorrect output.

To debug, simply put:

```
echo "<pre>";var_dump($tagdata);echo "</pre>";

```

...before the return in the getMyString method.

Your comment mentioned this:

```
{exp:test} {exp:test:getMyString}My Pretty string here...{/exp:test:getMyString}

```

The first `{exp:test}` tag shouldn't be there (just checking ;) as that will only output "TEST: " because there is no tagdata and as mentioned, it may mess with the tag pair `{exp:test:getMyString}` because it outputs something.
> 1 votes

---
Tags: php, plugin, variable
---


title: Why Php variable repeats 1 entry?

text:
# Question
Title: Why Php variable repeats 1 entry?
```
{exp:cartthrob:order_items order_id="1937" variable_prefix="items_"}
    $titlu_carte = '{items_title} ';
    $gestiune_id = '{product_sku} ';
    $cantitate_carte = '{items_quantity}';
   $pret_numeric_carte = '{items_price_numeric}';
{/exp:cartthrob:order_items}

echo $titlu_carte;
echo $gestiune_id;
echo $cantitate_carte;
echo $pret_numeric_carte;

```

Result:

```
TITLE1 012L000001 2 12 TITLE1 ( again ? why not the next title? ) 2 12

```

Why is it giving me the same book and not the next one in the entry?

# Answer
> 1 votes
I don't think it would be good practice to output data with PHP while you can do the same with tags. In your code, you are outputting the PHP variables out of `{exp:cartthrob:order_items}` which is looping. PHP variables within the paired tag loop will store only the last tag values which will be outputted.

So either prepare your PHP variable (within) loop by concatenating or output within the loop.

---
Tags: cartthrob, conditionals, php, entry
---


title: Redirect during specific date range

text:
# Question
Title: Redirect during specific date range
I have 2 conditionals at the beginning of a template that are supposed to redirect the visitor to a different template if they are hitting the page outside of 2 different time spans, but the redirect is not working.

```
{if '{current_time format="%U"}' < '{start_date_1}' AND '{current_time format="%U"}' > '{end_date_1}'}{redirect="/closed"}{/if}
{if '{current_time format="%U"}' < '{start_date_2}' AND '{current_time format="%U"}' > '{end_date_2}'}{redirect="/closed"}{/if}

```

{start\_date\_1}, {start\_date\_2}, {end\_date\_1} & {end\_date\_2} are global variables.

Any help is appreciated.

# Answer
your conditional doesn't make any sense. It's impossible for a number to be less and greater than an interval at the same time.

You need a `OR`, not an `AND`.

```
{if '{current_time format="%U"}' < '{start_date_1}' OR '{current_time format="%U"}' > '{end_date_1}'}{redirect="/closed"}{/if}
{if '{current_time format="%U"}' < '{start_date_2}' OR '{current_time format="%U"}' > '{end_date_2}'}{redirect="/closed"}{/if}

```
> 3 votes

---
Tags: conditionals, date-format
---


# Question
Title: Matrix 2.4 not adding rows when plus is clicked
Running Matrix 2.4 on EE 2.5

When the plus / + button on a Matrix custom field is clicked, no row is added

Nothing happens

Any ideas?

Thanks!

# Answer
I've run into this before a couple of times - often just a matter of re-uploading the matrix third party theme folder. In other cases it could be a JS conflict with another add-on, which you'd perhaps have to explore after trying the theme re-upload.
> 2 votes

---
Tags: matrix
---


# Question
Title: ExpressionEngine 1.6.8 Contact Form or just upgrade?
I originally posted this on stackoverflow before discovering this specific forum...

I've been asked to make some changes to a site that was built with Expression Engine 1.6.8. Even though I'm not familiar with this CMS, I can find my way around to make the updates, except I'm not sure about adding a contact form. I'm guessing that ultimately I'll have to upgrade this version to the newest (2.7, I believe?) in order to get the tags found on this page to work: http://ellislab.com/expressionengine/user-guide/modules/email/contact\_form.html?

My only hesitation in making the upgrade is my unfamiliarity with EE, and the fact that someone else is probably creating a brand new website for the one I'm working on, and very likely without EE (so I'm learning something that I may not need again). Are there any major issues that I'll run into making this jump from 1.6.8 to 2.7? I wish the previous person maintaining the site had kept up with the upgrades.

Any suggestions for a quick fix, or should I just bite the bullet, upgrade, and use what I've found? \**HOWEVER, I've now realized that I'm probably running core, in which the email module isn't even offered, so I'm sure my options are really limited...

# Answer
> 2 votes
The EE1 docs are still available for download. Just look in the top right corner for a link to download the zipped docs. You can look for the section about the email module, which should do exactly as you need.

In this case, it may be easiest to just work with what you have. Upgrading to 2.7 from 1.6.8 could be quite an undertaking. Sometimes it works out really easily, but other times it can be pretty awful to deal with, it really depends on how the site is built and what add-ons are in play.

# Answer
> 0 votes
I ended up writing my own html code within the template and processed it with a php script to send the form input to an email address, just as I normally would on a website. Not being familiar with ExpressionEngine, I don't think I understood why I was continually being referenced to use a module in order to do this, but I suppose for anyone who is not a coder but is experienced with EE, that would be the way to go. From what I understand, the email module is not free and does not come with the core version, which is what I had to work with, but comes with the licensed version, which made this all the more confusing.

---
Tags: module, email, forms, upgrade, updating
---


# Question
Title: Change file field to assets field without losing the selected image
Does Assets keep the same content when changing from a file field? I just wanted to be sure on this.

Thanks, Diederik

# Answer
Yes, it does - I've done this many times. Just make sure you're using the latest version of Assets.
> 1 votes

---
Tags: assets, file-uploads
---


title: safecracker SAEF form does not sumbit

text:
# Question
Title: safecracker SAEF form does not sumbit
I wish to add a form to my website that will allow customers to add testimonials to the ‘testimonial’ channel as pending status. I have created the channel and custom fields i need and a new status pending. I used mijingo-expressionengine2-episode7 to guide me but since i am using EEv2.5.2 i think exp:channel:entry\_form is no longer of use, so I am using exp:safecracker. Eitherway nothing happens when i submit. Filling in entry\_id=”{segment\_2}” throughs error - ‘You must specify a valid entry to edit.’ but in the EE documentation is says i can leave blank for data entry and this does nothing.

{exp:safecracker form\_class="saef-form" channel="testimonial" status="pending" return="contact/thankyou/en/" entry\_id="" use\_live\_url="no" url\_title="" }

HTML Output hidden fields

```
<form id="publishForm" class="saef-form" method="post" action="http://mysite.com/site/add-testimonial"  enctype="multipart/form-data" >
<div class='hiddenFields'>
<input type="hidden" name="ACT" value="56" />
<input type="hidden" name="RET" value="http://mysite.com/site/add-testimonial" />
<input type="hidden" name="URI" value="site/add-testimonial" />
<input type="hidden" name="XID" value="d4fdd1ccc89be4d869e62c56a38f37ff277b7f6f" />
<input type="hidden" name="return_url" value="contact/thankyou/en/" />
<input type="hidden" name="author_id" value="6" />
<input type="hidden" name="channel_id" value="12" />
<input type="hidden" name="entry_id" value="0" />
<input type="hidden" name="status" value="pending" />
<input type="hidden" name="site_id" value="1" />
<input type="hidden" name="return" value="contact/thankyou/en/" />
<input type="hidden" name="allow_comments" value="n" />
</div>
<fieldset class="contactDetails">

<label for="title">Title</label>
<input id="title" name="title" type="text" size="35" value="" placeholder="Title"/>

<label for="role">Role</label>
<em>Role of the person who gave quote, eg: General Manager</em>
<input id="role" name="role" type="text" size="35" value="" placeholder="Role"/>

<label for="affiliation">Hotel name</label>
<em> Affiliation / hotel name</em>
<input id="affiliation" name="affiliation" type="text" size="35" value="" placeholder="Hotel name"/>

<label for="testimony">Your Thoughts</label>
<em>Instructions:  The main testimony goes here.</em>
<textarea id="testimony" name="testimony" cols="40" rows="4"></textarea>

<input id="saef-submit" class="ba-button" type="submit" value="Submit" />
</fieldset>
</form>

```

i have removed all other scripts from the page. What am I missing?

# Answer
> 1 votes
Your hidden fields match my safecracker forms. So first check the following...

Step 1: Are you logged in as admin or another member group?

* Select: Member \> member groups \> \[for your member group \] edit group
* Find in list: Channel Assignment Ensure this is set to yes: can post and edit entries in \[channelname\]

Step 2: have you allowed access to custom status?

* Select admin \> channel admin \> statuses \> your\_status\_group \> pending
* Ensure group name can access status

Step 3: remove from tag a couple of params so it looks like this

```
{exp:safecracker form_class="saef-form" channel="testimonial" status="pending" return="contact/thankyou/en/"}

```

Step 4: are you adding your own jquery?

From memory, Safecracker uses version 1.7.?. If you try and use 1.10.? it wont work. For now, ensure you arent adding your own jquery in the header. Make sure there is no other js in head (while debugging)

Step 5: simplify form further (for debugging until it works)

Take out all inputs except title ( and submit). Remove status param. Retest

Youve got me stumped. Fyi, this template on my site works.

```
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
{exp:safecracker channel="store" return="browse"}
<input type="text" name="title" value="" size="50" maxlength="100"/>
<input type="submit" value="Submit" />
{/exp:safecracker}
</body>
</html>

```

The script in the source will look something like this...

```
<script type="text/javascript" charset="utf-8" src="http://mysite.com/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1378087729&use_live_url=y&include_jquery=y"></script>

```

I dont know what else to suggest. Im in Australia. Midnight here, so thats it for me now.

---
Tags: safecracker, v2.5.5, saef
---


# Question
Title: MX Google Map's search functionality not returning results for existing locations
I'm using MX Google Map to map various locations. However, when I use the `{exp:mx_google_map:form}` and `{exp:mx_google_map:search}` I can't return any results. I verified the information is filled out in the entry, but doing a search for the same zip code returns no results and the template debugger outputs this information:

```
(0.011036 / 6.35MB) Tag: {exp:mx_google_map:search channel="glo-con" reverse_geocoding="true" address="" long="" lat="" unit="" radius="500" prec="2" prefix="" address_fields="address"}
(0.011161 / 6.36MB) Closing Tag Found
(0.011209 / 6.36MB) Processing Tags
(0.011244 / 6.37MB) Module Tag: Mx_google_map/search
(0.011260 / 6.37MB) Including Files for Plugins and Modules
(0.012097 / 7.28MB) Files for Plugins and Modules All Included
(0.012724 / 7.31MB) Beginning Final Tag Data Processing
(0.012749 / 7.31MB) Calling Class/Method: Mx_google_map/search
(0.012966 / 7.31MB) -> Class Called: Mx_google_map
(0.013003 / 7.32MB) -> Method Called: search
(0.070547 / 9.99MB) Returning No Results Content
(0.070693 / 9.98MB) -> Data Returned

```

My **/contact** page:

```
{exp:mx_google_map:form result_page="/contact/results" long="" lat="" unit=""}
    <div>
        <label>Address<br>
            <input name="address" type="text">
        </label>
    </div>

    <div>
        <label>Radius<br>
            <select name="radius">
                <option value="100">100</option>
                <option value="50" selected="selected">50</option>
                <option value="30">30</option>
                <option value="25">25</option>
                <option value="20">20</option>
                <option value="15">15</option>
                <option value="10">10</option>
            </select>
        </label>
    </div>

    <input type="submit" value="Submit">
{/exp:mx_google_map:form}

```

My **/contact/results** page:

```
<h1>Search Results</h1>
{exp:mx_google_map:search channel="glo-con" reverse_geocoding="true" address="" long="" lat="" unit="" radius="500" prec="2" prefix="" address_fields="address"}

    {entries}
        {glo-con-map}<li>{title}</li>{/glo-con-map}
    {/entries}

{/exp:mx_google_map:search}

```

Am I missing something *very* obvious?

**Version information:**

* ExpressionEngine 2.5.4
* MX Google Maps 1.4

# Answer
> 0 votes
I updated MX Google Map to the latest version to get this to work. (D'oh!)

---
Tags: mx-google-map
---


# Question
Title: customize contact form to save data to DB
I'm a newbie for ee2. The template tag "exp:email:contact\_form" allow me to create a contact form without save form's data to my DB. I need a contact form that save its data to DB, send a email to my gmail account and then I can browse these contacts in CP Admin. Please show me how to do it. May somebody helps me. Thanks.

# Answer
You can use FreeForm module for this purpose.
> 4 votes

---
Tags: forms
---


title: Assets and Channel Form upload only

text:
# Question
Title: Assets and Channel Form upload only
I wondered if it was possible to have a straight-to-upload feature for safecracker (channel form) uploads? On the front end, I'd want to bypass the 'browse' section and only allow users to upload an image (with progress bar) and add/edit their meta data without revealing the other files on the system.

Thanks

# Answer
> 5 votes
Tim,

currently this is not possible, but we do have some interesting ideas that would allow you to accomplish this in the next Assets release, which is currently in active development.

I don't have an ETA for you, but we are working on it

---
Tags: assets, safecracker, channel-form
---


# Question
Title: convert Title to Url Title with unicode characters
I'm a Vietnamese. I'm a newbie for ee2. When I enter "Nước ngập mái nhà sau cơn bão" in Title field, EE2 automatically generates "nc-ngp-mai-nha-sau-cn-baeo" in URL Title. That isn't correct. I need "nuoc-ngap-mai-nha-sau-con-bao" in my URL Title. I created my database with "utf8-general-ci" collation. May somebody help me?. Thanks.

# Answer
> 2 votes
As far as I'm aware no. Because EE will strip out the non-alpha numeric characters, not replace them with their similar counterparts. It's not relevant to the Database.

So either you have to manually edit the url\_title field each time or look at other options. But in looking elsewhere for solutions may give you an even better end result - of being able to use your language correctly in URLs (better for your users and better for SEO).

I touch briefly on it here, but you can utilise a custom field for the url but you can't then use the native and automatic method of channel:entries, so will need to use search:custom\_url="nước-ngập-mái-nhà-sau-cơn-bão" dynamic="no" parameters in the channel entries tag. Your URL would then look something like this:

```
www.mysite.com/content/nước-ngập-mái-nhà-sau-cơn-bão

```

With the 'content' group, index.php template catching this URL.

Alternatively (although I've not had the chance to use it), the Publisher add-on allows for multi-language URLs, so this should simplify the whole process if your budget can stretch.

---
Tags: url-title
---


# Question
Title: Is it possible to access entry revisions on the front end?
I am looking to create an entry revision site where I can allow users to access/view these on the front-end.

Is it possible to access these on the front end as it is in the control panel?

Thanks

# Answer
You might see this article http://www.sidd3.com/get-entry-revisions-in-expressionengine/. I hope, it would help you.
> 3 votes

---
Tags: channel-entries, safecracker, entries, saving
---


title: Wygwam, Assets, and Image Manipulations

text:
# Question
Title: Wygwam, Assets, and Image Manipulations
Is there a way to insert an image's "Image Manipulation" into a Wygwam field? I'm using Assets as the file manager in Wygwam.

# Answer
The CE Image 'Bulk' tag may help you. It'll output the images placed within WYSIWYG editors, like Wygwam.
> 2 votes

---
Tags: assets, wygwam, image
---


# Question
Title: My cart is empty if I logged out from control pannel
I am using ExpressionEngine 2.6.1 and Store 1.6.4

But I am unable to add the "Items" to the cart, when I logged out from Control Pannel(it is showing that "Your cart is Empty"). But If I logged into the Control Pannel then it is working.

Please help us.

Thanks in advance.

# Answer
In the Store settings is the following item:

> Empty cart on member logout

So when you logout, your cart will be cleared (be that the Control Panel or frontend). When you log back in, the cart will be remembered.
> 0 votes

---
Tags: expresso-store
---


title: Grid Conditionals

text:
# Question
Title: Grid Conditionals
I have a grid field set up for social links. The first column selects the network, the second field a link. I'd like to have a conditional working so it tests against the content and adds corresponding classes:

```
{exp:channel:entries channel="social" disable="category_fields|member_data|pagination" limit="1"}{social_links}
<li class="{if {social_links:network}=="Google"}google{/if}">Our <a href="{social_links:network_url}">{social_links:network}</a></li>
<li class="{if {social_links:network}=="Twitter"}google{/if}">Follow us on <a href="{social_links:network_url}">{social_links:network}</a></li>
<li class="{if {social_links:network}=="Facebook"}google{/if}">Join us on <a href="{social_links:network_url}">{social_links:network}</a></li>
{/social_links}{/exp:channel:entries}

```

I'd also like to be able to test if a grid field is empty like:

**{if social\_links!=""}Do something {if:else} or do this{/if}**

Any ideas?

# Answer
> 4 votes
I'd recommend trying class="{if '{social\_links:network}' == 'Google'}google{/if}"

Whatever you use for the conditional, if you match up the quotes usage (double versus single), it makes a big difference.

---
Tags: conditionals, grid
---


title: Limit Entries per Category

text:
# Question
Title: Limit Entries per Category
I am trying to build a listing page of entries broken down by parent category.

I originally used the category archive tag but there isn't option to limit the entries per category.

I've also tried using Stash and this method marked as the answer Listing entries, ordering by Category

It works by showing all entries under each parent category, but once I throw the limit parameter in the channel entries tag it doesnt work, just shows the categories. Also tried using MX Jumper, same result.

I found this method from Low http://gotolow.com/blog/nesting-tags-and-performance-in-ee It works the same, but again once limit parameter is in channel tag it breaks.

However I have found that placing the category\_group parameter in the channel tag that it works, sorta. It will show entries, but whatever the limit is instead of limit per category.

Below is my code for Stash:

```
{exp:channel:entries channel="publications" disable="pagination|member_data|category_fields" dynamic="no" limit="5"}
  {exp:stash:append name="publications_{categories limit='1'}{category_id}{/categories}" parse="inward"}
    <p>{title}</p>
  {/exp:stash:append}
{/exp:channel:entries}

{exp:channel:categories channel="publications" style="linear" disable="category_fields" show_empty="no" parent_only="yes"}
  <h3>{category_name}</h3>
  {exp:stash:get name="publications_{category_id}"}
{/exp:channel:categories}

```

Any thoughts on how to build out a entry list organized by category where you can set a limit of entries to show per category?

I do have Auto-Assign to Category Parents marked yes. I've disabled extensions one at a time to see if one was causing any issues, found nothing.

**UPDATE** I do realize that putting limit on channel tag would limit it to 5 entries no matter their categories. Looking to limit it to 5 entries per category.

Much thanks in advance!

# Answer
> 0 votes
Try flipping your code around like this.

```
{exp:channel:entries channel="publications" dynamic="no"  disable="category_fields|member_data|pagination"}
    {categories}
        {exp:stash:append_list name="publications_{category_id}"}
            {stash:title}{title}{/stash:title}
        {/exp:stash:append_list}
    {/categories}
{/exp:channel:entries}

```

and

```
{exp:channel:categories channel="publications" style="linear" disable="category_fields" show_empty="no" parent_only="yes"}
    <h2>{category_name}</h2>
    <ul>
        {exp:stash:get_list name="publications_{category_id}" limit="5"}
            <li>
                <h3>{title}</h3>
            </li>
        {/exp:stash:get_list}
    </ul>
{/exp:channel:categories}

```

---
Tags: categories, stash, mx-jumper
---


# Question
Title: Simple question... Can you display the latest revision author?
I need to track revisions for some docs and I am displaying the original creation author and date via:

```
<li>Created: {entry_date format="%m/%d/%Y"}</li>
<li>Author: {author}</li>

```

I need to display the latest edit date and author too. I am pretty certain this would be something like:

```
<li>Last Edit: {edit_date format="%m/%d/%Y"}</li>
<li>Author: {author}</li>

```

I just don't know of a last editing/revision author tag.

Is that available?

# Answer
> 2 votes
There isn't any tag available for entry revision. You can do it with following code example:

```
{exp:channel:entries channel="CHANNEL NAME" ...........}

    <li>Created: {entry_date format="%m/%d/%Y"}</li>
    <li>Author: {author}</li>

    {exp:query sql="SELECT exp_members.screen_name AS revision_author, exp_entry_versioning.version_date FROM exp_entry_versioning JOIN exp_members ON exp_entry_versioning.author_id=exp_members.member_id WHERE entry_id='{entry_id}' ORDER BY version_date DESC LIMIT 1"}

        <li>Last Edit: {version_date format="%m/%d/%Y"}</li>
        <li>Author: {revision_author}</li>

    {/exp:query}

{/exp:channel:entries}

```

---
Tags: ee2, author, edit-date
---


# Question
Title: Using Supersized.js & Channel Images in EE2.7 segment_3 problem
Im stuck - Ive got a simple portfolio site with a few channels, lists, search and so forth. Im using Supersized with Channel Images to run galleries. I made the first gallery (for the background full screen slides) using an entry in a dedicated channel, uploaded a bunch of images, and used the following code to run the script:

```
 {exp:channel:entries channel="gallery" entry_id="18" enable="custom_fields" parse="inward" limit="1"}

       jQuery(function($){

    /... all the supersized stuff before the slides list .../

    slides  :
       [
       {gallery_image}
       {image : '{image:url:full-size-op}', title : '{image:title}', thumb : '{image:url:thumbnail}'},
       {/gallery_image}

        ]
      });
          });

    {/exp:channel:entries}

```

This works fine\* in all sections of the site, except the (single) entry pages. Why is it breaking, has anyone come across anything similar? Even though it has a last trailing comma, that doesn't seem to be a problem. In other words, by segment\_3, it breaks, like this: www.mydomain.com/channel/entry/entry\_title (Im running the site without index.php.)

(\* - Caveat: in IE8 the script breaks as it returns an error to do with 'thumb\_links' being undefined, even though they are. My code isn't the cause of that break, but its a separate issue). UPDATE ON THIS: My code was the cause - removing the last comma sorted this issue out, using backspace="5".

# Answer
> 0 votes
Try adding **dynamic="no"** to your {exp:channel:entries} tag

```
{exp:channel:entries channel="gallery" entry_id="18" dynamic="no"}

```

HERE'S INFO FROM THE DOCS

> The ***channel display engine sets some parameters dynamically, based on what is in the URL***. There are times, however, where you do not want the parameters affected by what the URL contains. To override the dynamic nature of the channel tag, use dynamic="no".
>
> This is often useful if you want to list entries in a “sidebar” on your site and have them always be the same ones regardless of which page on your site you visit (main page, archives, comments, etc.). By setting dynamic="no" you will ensure that the list is not affected by anything passed in the URL.

---

Also, you do not need these parameters (enable="custom\_fields" parse="inward") on your channel:entries tag. They are not valid... here is a list of valid parameters for the channel:entries tag.

---
Tags: jquery, channel-images
---


# Question
Title: CE Image with Low Variables and Lazy Load: What im doing worng?
what im doing wrong? Im trying load a image via Assets, in a Low Variable field.

Nothing is rendered, but Low Variables field is with "early parsing" enabled. The Lazy Load JQuery plugin is active.

```
{exp:low_variables:pair var="myassetsimage"}
    {exp:ce_img:pair src="{myassetsimage}" width="640" height="400" class="img-polaroid" alt=""}
          <img data-original="{made_url}" src="{site_url}layout/img/pic-blank-1.gif">
    {/exp:ce_img:pair}
{/exp:low_variables:pair}

```

# Answer
Okay, first, **turn off** early parsing for the `myassetsimage` variable. Then try and use Asset's `{url}` variable (see docs) in CI Img's src-parameter instead of the Low Variables name. That means that your code would look like this:

```
{exp:low_variables:pair var="myassetsimage"}
  {exp:ce_img:pair src="{url}" width="640" height="400" class="img-polaroid" alt=""}
    <img data-original="{made_url}" src="{site_url}layout/img/pic-blank-1.gif">
  {/exp:ce_img:pair}
{/exp:low_variables:pair}

```
> 3 votes

# Answer
Sounds like either an issue with field names not being correct or a parsing issues.

To rule out incorrect names triple check everything or start with fresh code.

---

To check parsing, add `parse="inward"` first to the `{exp:low_variables:pair}` tag.

If that doesn't work, remove it and add to `{exp:ce_img:pair}` tag.

If that doesn't work, try adding to both.
> 0 votes

---
Tags: templates, low-variables, ce-image, parsing
---


title: Use categories for default FileManager

text:
# Question
Title: Use categories for default FileManager
Is it possible in ExpressionEngine 2.x to manage your uploaded files and images with categories? So when een customer add a new image in the default FileManager, they can select one categorie (like Products, News etc).

And when you want to select a uploaded image in the default FileManager to place in a wysiwyg editor, you want to see those categories at the left side in the default FileManager. Like this:

Images \- Category 1 \- Category 2 \- Category 2.1 Files \- Category 1 \- Category 2 \- Category 2.1

Is their a way to do this? I know the Assets addon from Pixel and tonic...

# Answer
> 1 votes
**EDIT: I've re-read your question and can see that my answer doesn't really apply since you're looking to display the categories in the Files Entries list. Something like Zenbu could do this - but Zenbu only works with the entries module**

Yes, it is possible to assign categories to uploaded files in this way.

You must assign a category group to the upload directory, then when you upload the file you can edit it and apply category and other meta information.

As for accessing the categories, you can access them via the Files module using {exp:files:entries} tag pair. I'm not sure if it is possible to access the category data if using another module or add-on.

I have used this technique here http://www.haigh.co.uk/resources

Each 'resource' is just a file upload. The template uses the {exp:files:entries} tag pair to output information about each file, including the category.

The categories are used to publish files on a number of microsites managed within the same MSM installation as that site.

---
Tags: file-manager
---


# Question
Title: Unable to remove Freeform fields from entries in control panel
I have a client that's using Freeform 3.0.6 with EE 2.5.2 with multiple forms on their site. The issue they're having is that when they login to thru the EE control panel to view the form submissions, certain fields are blank, and actually shouldn't even be in the current view.

What I'm wondering is, how do I remove these superfluous fields from the view? Please see the attachments to illustrate what I'm talking about.

Thank you!!

# Answer
In Freeform v3 you aren't able to hide unused fields from the view.

You can do this in **Freeform v4** though which has a completely different work flow for forms and data.

The upgrade from v3.x to v4.x can be involved. Here are **instructions from Solspace** to help with an upgrade if you go that route.

> **NOTE:** Backup files & DB before upgrading... This is a big upgrade.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: EE 1.7.0 and white screen on modules page
I recently moved my ee installation to another server and everything seems ok except for this issue

If i go on modules page i see white screen

Can somebody help me please? Thanks in advance

# Answer
Solved: was a fieldframe path issue
> 2 votes

---
Tags: blank-screen
---


# Question
Title: Is there a way for format the Solspace Calendar dates in UnixTimestamp?
I'm currently developing a multilingual site that uses Solspace Calendar as a calendering tool. Since it is multilingual, I will need to 'translate' the outputted days to either dutch, french or english.

Since the locale is english, it outputs this by default.

I tried using Hippo's Time/Date converter - and it's correctly called within the {occurrences} tags but the output within those tags are formatted in a way that the Hippo plugin doesn't understand them.

Is anyone aware of way to format the output of Caledar to a unixtimestamp?

# Answer
> 2 votes
Why not to use `format="%U"`?

From the documentation of Solspace Calendar:

> In addition to standard EE date formatting, Calendar supports\[...\]

From the documentation of EECMS:

> %U: seconds since the epoch

---
Tags: solspace, calendar
---


title: Authenticating against ExpressionEngine

text:
# Question
Title: Authenticating against ExpressionEngine
I'm working on the new CMS implementation project. We have ~4000 users in ExpressionEngine v 1.6.3 CMS.

The project requirement is, to let current EE members login to new CMS based on their encrypted credentials in EE.

Is the any way I can run an external php script utilizing Authentication Function from EE core $this-\>EE-\>auth-\>authenticate\_username($username, $password)?

Any help will be appreciated.

Pawel

# Answer
I would suggest building a simple API module within the EE installation.

You've found the Auth library which should do exactly what you need, it's just a matter of exposing it, because there really isn't an easy way to take EE's authentication scheme out of EE.

So once you create a module, it'd simply be a matter of setting up an action ID within the module and having it accept the username and password via POST. Then you can have it return in whatever format you like (JSON, XML, etc).

Your new CMS can then use CURL to connect to the API you've created.
> 5 votes

---
Tags: login, authentication
---


# Question
Title: Channel Form / Zoo Visitor Class & ID Problem
I've upgraded EE to 2.7.0 which comes with the new Channel From (Previously SafeCracker!)

When I did this all the class & ID's I had on the forms previously have stopped working - they don't show on the form output.

One in particular is the Zoo Visitor Register form, which I'm guessing is doing the same thing due to it running through Channel Form as well. My opening tag for this is:

```
{exp:zoo_visitor:registration_form return="{site_url}" id="form-account" class="form-register"}

```

But the output is:

```
<form id="zoo_visitor_form" method="post" action="http://website/index.php" enctype="multipart/form-data">

```

Huh?! No Class & the ID is incorrect.

Is there a fix for this?

# Answer
This might be part of a known issue: https://support.ellislab.com/bugs/detail/19707

See if the suggested solution for 2.7.0 works:

For a quick fix, open system/expressionengine/modules/channel/libraries/channel\_form/Channel\_form\_lib.php and find this code on line 754:

```
'class' => ee()->TMPL->form_class,

```

And REPLACE it with:

```
'class' => ee()->TMPL->fetch_param('class'),

```
> 0 votes

---
Tags: safecracker, zoo-visitor, channel-form
---


title: EE Multi Site Question

text:
# Question
Title: EE Multi Site Question
Thanks for your help. We are about to build a solution for a client and we will use the multi-site addon. These six sites will all be identical except that each will have unique content assets and be on their own domains. Assuming that all the sites will use the same templates and design, what is involved in adding a new site down the road? Is it pretty easy for a dev to knock out? Can the hours be roughed?

# Answer
There are lots of ways of building out an MSM site as you describe, but that's not really the point of SE. If you have troubles building this then post specific questions on the issues at hand here and we'll gladly help you out. If you share your templates across {embed="default\_site:\_inc/\_header"} that is where you'll want to start. Then when you create a new "site" with MSM then you'll need to copy over the templates over. Start with one and go from there and once you get that worked out then post additional questions from there.

Be sure to study the MSM documentation here:

http://ellislab.com/expressionengine/user-guide/cp/sites/

Also Boyink has a helpful tutorial here as well:

http://www.train-ee.com/courseware/free-tutorials/comments/splitting-a-site-out-of-an-ee-msm-installation

Hope that helps!
> 1 votes

---
Tags: multi-site-manager
---


# Question
Title: Include Form Title in Freeform Notification
I'm trying to make a single Notification template for a general auto-response to several forms and would like to include the form's title in the subject line and body. To be sure, this is not {form\_name}. I hoped {nonfield\_title} would do the trick, but it does not output the title as it does on the live page. Any tips?

# Answer
You were close, it's {form\_label}.

When you create a form, it says "Form Label: This is the full name of the Form." When you add "Title" in composer, this gets outputted as nonfield\_title.

You can use {form\_label} in notification's Subject as well as Email message. You could even make "{form\_label} - {name}" the subject, assuming you have a name field.
> 2 votes

# Answer
It's not clear from your question whether you are putting this information into the form or the notification template.

Create a hidden input field in your form containing the information you want. You can then include this custom field in your notification template.

You could pass that information to the form via an embed parameter, hardcode it or use the {form\_info} tag pair to output information that can be included in your notification.
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Additional parameters while using Freeform Pro Fieldtype
I'm trying to use the Freefrom Pro Fieldtype in a channel to select the correct form within an entry. I'd like to add `form:class="well"` and `inline_errors="yes"` for all the forms rendered with that Freeform fieldtype short name in the `channel:entries` tag.

How can I achieve this?

# Answer
Are you using composer? You could make a new composer template (which automatically starts you with the default composer template tag, etc, so you don't have to start from scratch) and you can add custom params there in the template area: http://cl.ly/image/3X3N2A2i3A0L

Then, in the upper left hand corner in composer itself, choose the new composer template and save.
> 2 votes

# Answer
Just to confirm: in your entry you select a form (Freeform fieldtype) that is then displayed in your template, and you want to pass some parameters to it?

You can just add these parameters to your field. Say your field is "event\_form" and you want to pass inline errors and form class to it: {event\_form inline\_errors="yes" form:class="registration\_form"}
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Freeform Pro check form submitted on same page return
Is it possible within Freeform Pro to set the return path of a form to the current page (ie. if the form is in the template "contact/index", set `return="contact/index"`) and then when it loads the page again and parses the Freeform tag, it runs a check to see if it was sent successfully and display a message and possibly prevent the form from being displayed.

Essentially, I'm looking for the same functionality as you would get with a normal PHP check such as `if($mail) { echo 'Success'; // hide form } else { echo 'Error'; // display form }`

Can I do this with native EE/Freeform tags or would I have to build something in PHP? If the case is the latter, how would I check it?

Using EE 2.5.2 with Freeform Pro 4.0.12.

# Answer
Not sure you can do it cleanly with the exact same URL - at least I've not tried it - but you can use the prevent\_duplicate\_on parameter to limit submission by member id, IP address or email address (as entered by user). Then use the if freeform:duplicate conditional to present the user with a message (and avoid presenting the form again). But that's potentially somewhat limiting if with a general contact form, the user may have a legitimate reason for submitting more than once, for example. But if you want to remove the form from the post-submission message, you can simply accomplish that with segments, as with this example:

```
{if segment_2 == thank-you}
    Display post-submission thank you message.
{if:else}
    {exp:freeform:form form_name="contact" return="{segment_1}/thank-you"}
        Insert my form fields here
    {/exp:freeform:form}
{/if}

```

Then is the user returns to the page that displays the form (at whatever segment 1 is, in this example), they are still presented with the form.

Hope that helps.
> 1 votes

# Answer
What I always do is use an extra segment for forms that have been submitted, but have Freebie ignore it. This way EE completely ignores the extra segment by default, but you have the control over things in your templates.

For example, in Freebie set "thanks" an ignored segment and then in your template:

```
{if freebie_last == "thanks"}
    Thank you message/variable/entry field
{if:else}
    {exp:freeform:form return="wherever/you-are/thanks"}
    {/exp:freeform:form}
{/if}

```

If you use Structure you could have return="{structure:page:url}thanks" (or I assume in Pages return="{page\_url}thanks"). This combined with the power of freebie\_last means the same code will work despite of its location.
> 1 votes

# Answer
You could use the duplicate checking functionality and show alternate content if they've already filled the form out:

http://www.solspace.com/docs/freeform/form/#freeform\_duplicate
> 0 votes

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


title: CP loads slow once in a while

text:
# Question
Title: CP loads slow once in a while
I have transfered a site to a new server and at the same time incorporated Focus Labs Master Config approach.

Now, since the site is running on the new server the CP loads really slow sometimes. It feels kinda like the URL is not being resolved correctly: link is being clicked, loading starts, it hangs, then new page "pops" up and loads normally. I hope you get the idea.

Until today I couldn't really find a pattern to this behaviour. Most of the time it works as expected but then once again I get this lag.

Also I am not saying that it must have anything to do with the new server or the Master Config. Those are just the two biggest changes I made.

However, I activated the EE Debug Toolbar 2 days ago and just got one of those lags after clicking on Template Manager. That's what it looks like:

After clicking on the 5th tab (with the 11.0590s) this is what's in there:

When I go back to Home and click Template Manager again I get a load time of 0.1978s.

I don't really know how to interpret the above values from the Debug Toolbar. Does somebody know or see what causes these lags?

Thanks and Cheers,

Marc

# Answer
Marc, we have/had been experiencing a similar issue. We first noticed after installing Memberr. On the hour, but not every hour during the day, we'd get a hang/freeze for 1-2 minutes.

So at 10:00 am any request to our ee site at two different office locations or any pc would simply stop/poll/loop call it what you want. Then at 10:02 am all requests simultaneous complete on all devices in both loctions. It got so bad, that if youd saved a template on one of the hours that it would poll ( yes there was a pattern) you cold go and get a coffee and be back before starting work again.

Thinking it was Memberr (because we noticed it first started after installing), we removed it and all cron jobs. We also suspected it was something to do with editing templates via cp.

The issue has now almost completely disappeared. We are on a shared server (and this could also be the cause). We still kept a log of incidents and have spoken to our host.
> 1 votes

---
Tags: control-panel, debugging, loading-time, toolbar
---


# Question
Title: Zoo Visitor with playa and shared entries
I have a Zoo Visitor (ZV) channel with different member groups (teachers, students). Within the channel, I have a playa field pulling in the ZV teacher entries. When students register they’ll select one teacher via the playa field.

On the individual teacher pages, I need to show all of the students who’ve selected that specific teacher. So, I'd need to pull all of the student entries that share the current logged in teacher member.

Would this be done with the coparents module? If not, what's the correct playa module to be used with zoo visitor?

# Answer
> 0 votes
Have you looked at this thread?

Sounds like you need to do a reverse-relationship lookup with the exp:playa:parents tag:

Getting reverse related entries via Playa

---
Tags: playa, zoo-visitor
---


# Question
Title: Assets UI fails (goes white) on local/dev, but works perfectly on prod
I've got an odd issue where essentially the same Assets on production works fine, but fails on local/dev.

* Asset's native file manager does not display any images and just spins
* Inline-file manager within an entry does pop-up the Assets window, but is completely blank

The local/dev DB is imported from prod, and we're using Erik's Multi-config setup.

Is there a setting I need to check?

Thanks!

# Answer
> 1 votes
Jae,

judging by your comment on the question it might be the Session settings.

Assets makes a lot of Ajax requests and due to the nature of EE, they can only be made via frontend, so User session is used there to determine the access privileges, and when making those requests, Assets could not determine that the user was a valid CP user, so it denied every request as a security precaution.

Can you try changing Administration / Security and Session Preferences settings to Admin: Session And Cookies; User: Cookies.

That should resolve your issue.

---
Tags: assets, pixelandtonic, file-manager
---


# Question
Title: How i can display article filter by age in expressionengine?
I have some article in expression engine now i want to display article filter by age range like (1-10 ,10-20 etc..) and cost wise like(low,medium,high) so please guide me how i can do filtration of article... thank you.

# Answer
You can use Low Search module for such type filtration. See this the reference from here: http://gotolow.com/addons/low-search/docs/tags#form-tag-ranges
> 1 votes

---
Tags: ee2
---