title: .htaccess for nexcess shared hosting

text:
# Question
Title: .htaccess for nexcess shared hosting
I have 2 sites running on different shared hosting servers with nexcess.net both with similar setups (same version of EE 2.6.1 and same add-ons) and both experiencing different issues which I'm begining to think are .htaccess related.

I am using the EE recomended .htaccess rule to remove the index.php

```
<IfModule mod_rewrite.c>
        RewriteEngine On

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

```

The index.php is being removed on both sites.

The first site is having an issue with Assets (2.1.4) loading the sites home page in the assets modal window when I go to add file. It is causing the following error in the server log.

> Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I have double checked the file upload preferences (Standard file manager is working without issue). File upload folders have permissions 0f 777. EE Cache folder is 777. I've tried adding $config\['assets\_site\_url'\] = '/index.php'; to config file Php memory limit is set to 512mb in php.ini

On the second site Assets is running fine but the client is reporting that when editing channel entries EE is not saving the entry intermittently and just returning to the admin homepage. Not sure if this is related but could possibly be.

Any help is most welcome.

# Answer
> 0 votes
Turns out the main index.php file got renamed. As you could guess this would cause a multitude of problems. With there being no front end templates at this early stage I incorrectly suspected the .htaccess was causing the problem with the paths.

Thanks for the input Tyssen and Steven.

# Answer
> 0 votes
I've not tried on Nexcess but my goto htaccess is

```
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

<IfModule mod_rewrite.c>
RewriteEngine On

# Looks for files and directories that do not exist
# and provide the segments to the index.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

```

---
Tags: assets, pixelandtonic, .htaccess, hosting
---


# Question
Title: possible for custom module entries to show up in search results
I built a custom module that has its own group of tables that holds the data, it uses mcp.module\_name and mod.module\_name for the back/frontend

I want to know if there is a hook or some api that allows for EE's native search to display results from my custom module?

I know I can write my own search feature for my module.

If that is not possible, is there an add-on that allows for me to search for both channel entries and custom module entries?

I looked into low's search and solspace's, and their summary did not hint at that.

Any help is appreciated, thanks.

# Answer
> 4 votes
Short answer: Nope.

Slightly longer answer: native search, Super Search and Low Search all use the Channel module in some shape or form to display search results. Combining channel entries with other content types in a single tag is currently *very* cumbersome, if not impossible. Basically, EE's current API simply isn't built for that sort of thing.

You'd have to look at some other form of searching if you want to mix content types in a single stream of entries. For example, a more output-focussed search, like Google site search.

# Answer
> 3 votes
No, there's no hook, but depending on the amount of data you want included, you can get the data included in searches (be it native EE, Low Search or SolSpace search).

I had the same issue with Expresso Store that the modifiers (colour/size) didn't appear in the search results - only SKUs were included by default.

You'll need to have some sort of fieldtype for this to work, then you save the data in there. In the example of Store, it holds all it's data in it's own table, and although there is a new column in the channel\_data table (field\_id\_xx), it's not used by the module and doesn't appear when editing the entry. But what's key is that EE will use this column for searching purposes - so you can load whatever you like in there for the search results. So for Store, upon saving an entry in the backend, I parse through the store fields (price, modifier name, option name, etc), then include that raw data in the field. As mentioned, it's not used by Store on the frontend or backend, so no consequences.

In a fieldtype there's a method that can be added called "third\_party\_search\_index" which allows you to load additional search data (so it's not stored in the channel\_data table) for other search add-ons.

---
Tags: add-on-development, search, low-search, supersearch
---


# Question
Title: Control Panel locking me out after uploads and template changes - says no data
**Prolem:**

I am using ExpressionEngine Core 2.6.1. After I click around the control panel for a bit, sometimes updating templates and sometimes uploading images, I get kicked out. When I get kicked out, instead of just logging me out and showing the login screen, my browser tells me that there is no data available. This is the message that Chrome sends:

> Unable to load the webpage because the server sent no data. Error code: ERR\_EMPTY\_RESPONSE

---

**Solutions I've tried:**

I have tried in Chrome, Firefox, and Safari, and the same thing is happening everytime. It usually happens when I repeat the same action about 3 or 4 times (i.e. I upload 4 images, or I update a template 4 times in a row). I try to refresh my browser, clear browsing data, etc. and it keeps showing no data for about 1-2 minutes. After 1-2 minutes, I refresh and the login screen will show up again and I can log in. Throughout the whole process, the front end of my site loads images and displays perfectly fine.

My **Control Panel Session Type** is set to 'Cookies and Session ID', and my **User Session Type** is set to cookies only.

After doing some research and finding, not the exact but, a similar issue here Keep Getting Logged Out of Control Panel, I added the following sections of code to my config.pfp file:

```
$config['cookie_domain'] = "";
$config['cookie_path'] = "";
$config['cookie_prefix'] = "someprefix";
$config['require_ip_for_login'] = "n";
$config['require_ip_for_posting'] = "n";
$config['secure_forms'] = "n";

```

and

```
$config['cp_session_ttl'] = 14400;
$config['user_session_ttl'] = 3600;

```

In regards to the ERR\_EMPTY\_RESPONSE code, I found this help thread. http://ellislab.com/forums/viewthread/178569/ I tried putting php\_value memory\_limit 128M into my htaccess file, but that causes my site to have an error. Maybe I'm not adding it correctly? Should I be putting this within any tags in my htaccess file?

It seems that nothing is fixing the issue. This is happening very frequently and disrupting my work flow.

# Answer
After a couple of days I am having no more trouble. The issue resolved itself somehow, but I have a hunch that it had something to do with my hosting. If anyone else has this problem, contacting the host would be the next step I would take.
> 0 votes

---
Tags: database, config, cookies, logout
---


title: HTML/JS stripped from templates

text:
# Question
Title: HTML/JS stripped from templates
I'm trying to update template code on a EE site I inherited and whenever I save the template, after making my changes, the HTML formatting gets all screwed up and the JS is completely stripped out. For example, almost all of the HTML carrots are turned into:

```
< and >

```

And the JS is just:

```
[removed]

```

Even if I don't make any changes to the code and just save the template in the inline editor this happens - new to EE and trying to figure out what's causing this. EE version 2.2.1, Wygwam 2.3.2... no other obvious add-ons that might cause issues to me. I found the protect\_js config option and set it to 'y' (wasn't previously included) but it doesn't seem to make a difference. If I inspect the actual editor element I see a bunch of classes for markItUp - is that normal?

# Answer
This sounds very similar to another post, Characters are being re-encoded in control panel.

Check in your `system/expressionengine/config/config.php` file. Do you have `$config['global_xss_filtering']` set to TRUE?

It *should* look like this in your config file:

```
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
*/
$config['global_xss_filtering'] = FALSE;

```
> 2 votes

# Answer
From the source shot, it looks like MarkItUp may be the issue, trying to turn the template editor into a wysiwyg
> 0 votes

# Answer
You mention Wygwam which means an entry, not a template... can you confirm exactly where you are seeing this behavior?

If you're doing this via the Control Panel - then can you try making those template updates via FTP? I suspect that there is some server thing, similar to mod\_security (or mod\_security itself, though that is usually has different symptoms).

If you can make your template updates via FTP, then look at form submissions and server security for sure. You'll need to save templates as files before you can try this.
> 0 votes

---
Tags: templates, wygwam, wysiwyg
---


# Question
Title: Let customers remove items from CartThrob packages
I've got a setup on a site (currently running with CartThrob) where I need to select a Price Modifier (or Matrix) row via a Playa field, which I realise isn't possible with a hack.

There would be 100's of products (yarns and wools) and each would have several Price Modifier rows (colours). The colours are what I need to get to from the Playa field.

* Yarn 001 Red
* Yarn 001 Blue
* Yarn 001 Green
* Yarn 002 Red
* Yarn 002 Purple
* Yarn 003 Black

I need to create custom bundles of yarn colours.

I'm aware of the Packages field in CartThrob - but I need to be able to let the customer remove items from the bundle which doesn't look possible with CartThrob.

Could anyone tell me any different please? Or can Store do this sort of functionality?

# Answer
> -1 votes
I would suggest forgetting about CartThrob and going with Brilliantretail. I made few sites with ease! With color/size/style etc selection you can use sku number and so easy! Their new and improved filtering system can be compared to overstock or amazon. Response time on page load with tons of products under 1 sec.

---
Tags: expresso-store, matrix, playa, cartthrob
---


# Question
Title: CartThrob 'Gift Certificates Applied' Shows Wrong Amount
I'm running into an odd issue with CartThrob's gift certificates that doesn't seem to be turning up any google results, so I'm hoping someone can help point out what I'm doing wrong or share if they've run into the same issue.

In my shopping cart (and my checkout page, but they're both displaying the same chunk of code so we'll stick with this one) I have the following chunk of code showing order totals & associated information:

```
{exp:cartthrob:cart_info}
    <span class="label">Subtotal:</span>
    <span class="amount">{cart_subtotal}</span>
    {if "{cart_shipping}" != "$0.00"}
        <span class="label">Standard Shipping:</span>
        <span class="amount">{cart_shipping}</span>
    {/if}
    {if "{cart_discount}" != "$0.00"}
        <span class ="label">Discounts:</span>
        <span class="amount">-{cart_discount}</span>
    {/if}
    {if "{exp:cartthrob_gift_certificates:applied}" != "$0.00"}
        <span class="label">Gift Certificates:</span>
        <span class="amount">-{exp:cartthrob_gift_certificates:applied}</span>
    {/if}
    {if "{cart_tax}" != "$0.00"}
        <span class ="label">Estimated Tax:</span>
        <span class="amount">{cart_tax}</span>
    {/if}
    <span class ="label total">Total:</span>
    <span class="amount total">{exp:cartthrob_gift_certificates:cart_total_minus_gift_certificates}</span>
{/exp:cartthrob:cart_info}

```

For my example cart, which has no tax and no discounts, and for which I have not applied a gift certificate (No gift certificates have been applied in this session at all), I see the following:

http://cl.ly/image/060u1n182I2D

> Subtotal: $5.00 Standard Shipping: $6.00 Gift Certificates: -$2.00 Total: $11.00

Which shows the correct subtotal, shipping and total, but shows a phantom $2 discount that's not actually applied to the total.

Has anyone seen anything like this happen with CT gift certificates? Any thoughts about how to fix the issue? It seems like the total behavior is correct (no gift certificate applied) but the number output by cartthrob\_gift\_certificates:applied is incorrect.

# Answer
> 2 votes
I figured out the answer to this problem, and it's a ridiculous little bug.

When giving gift certificates in the control panel, you can leave off the member ID of the user you want to give the certificate to. If you do this, the certificate disappears into some void, and never shows up in the CP list of gift certificates. It does, however, remain in the database with a member ID of 0.

From there, apparently, the value of the earliest un-assigned gift certificate shows up when the {exp:cartthrob\_gift\_certificates:applied} tag is used. That value isn't applied to the cart total, but it does show up if you're showing users what their gift certificate value is.

Hopefully this helps if anyone else runs into it.

---
Tags: cartthrob
---


# Question
Title: Is this a parsing issue with advanced conditionals?
I have a header snippet that includes a "Made in USA" image on it. Well the client now wants the image removed on a couple product pages. I setup an advanced conditional to check for those pages using the third url segment. It worked if I kept the conditional simple, but as soon as I added an "OR" it stopped working. I thought it was probably a parse order issue, so I installed the Croxton If/Else plugin. Implemented that and I still have the same problem. Any ideas?

Doesn't Work...

```
{if segment_3!="product1" OR segment_3!="product2"}
<img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}

```

Doesn't Work...

```
{exp:ifelse parse="inward"}
{if segment_3!='product1' OR segment_3!='product2"}
<img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}
{/exp:ifelse}

```

Doesn't Work...

```
{exp:ifelse parse="inward"}
{if segment_3!="product1"}
<img src="/images/styles/madeinusa.png" class="madeinusa"/>
{if:elseif segment_3!="product2"}
<img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}
{/exp:ifelse}

```

Works...

```
    {if segment_3!="product1"}
<img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}

```

# Answer
> 2 votes
I saw you already find a solution, but I think you should know the reason your code wasn't working.

Your conditional will never work... Ooops! Please, forgive me. Your conditional will **always** work because `"product1" != "product2"`.

This code will always evaluate:

```
{if segment_3!="product1" OR segment_3!="product2"}
    <img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}

```

For this code to work, you'll need an "AND", not an "OR". So:

```
{if segment_3!="product1" AND segment_3!="product2"}
    <img src="/images/styles/madeinusa.png" class="madeinusa"/>
{/if}

```

But it's really better to split this into two conditionals if your code prevents some module parsing.

# Answer
> 1 votes
this ended up working...Not sure why the If:Else plugin wasn't working though.

```
{if segment_3!="product1"}
    {if segment_3!="product2"}
    <img src="/images/styles/madeinusa.png" class="madeinusa"/>
    {/if}
{/if}

```

---
Tags: conditionals, parse-order, ifelse, advanced-conditionals
---


# Question
Title: Google Maps for EE Different on Front End to Back End
Does anyone know if there has been changes to Google's Map API or some other things that would cause previously working Google Maps for EE plugin maps to being plotting/viewing correctly in the control panel (field type) but not on the front end.

No changes have been made to these installs since the beginning of the year.

**EXAMPLE ONE**
Maps now have multiple locations points (should only have one) and no longer centre
EE 2.5.3
GMforEE 3.1.0
http://bit.ly/13LJq9Z (click the 'view' icon to review details and map)

**EXAMPLE TWO**
Maps now have multiple locations points (should only have one)
EE 2.5.5
GMforEE 3.2.1
http://bit.ly/1d5ztHh

Any advice would be greatly appreciated

# Answer
> 1 votes
I can confirm that after following Justin's instructions in:

http://devot-ee.com/add-ons/support/google-maps/viewthread/10492

And adding geocode="false" to exp:gmap:marker the issue was resolved.

# Answer
> -1 votes
I think the answers can be found in your javascript - take a closer look, is there extra code on the front end you're loading in - or is it possible that the API is connecting to some default map you've got on Google?

You've got what seems to be extra js code regarding your map centering and zoom - and if you look closely at the code that draws the markers - it's loading the same locations on each site you linked to (see marker index 3 and 4). That seems to suggest you've either got some default/example code in there somewhere, or your maps are being tied to something else?

---
Tags: plugin, google-maps-for-ee
---


# Question
Title: WYGWAM "Read More" button has been replaced with "Remove Formatting" somehow
Not sure how this happened, but I was clicking the hell out the "read More" button to insert an excerpt break and nothing was happening. When I left the mouse pointer over the button to see what the tooltip said the text read "Remove Formatting" even though the icon is correct.

In addition, the "Remove Format" button is now missing entirely.

Any idea why this might be happening?

EE Version 2.6.1

WYGWAM Version 3.0.2

Full configuration screen (they're all displaying the same issue):

# Answer
Oddly enough this problem just disappeared after a day or so and hasn't come back. No idea what the source issue was.
> 0 votes

# Answer
Try updating to WYGWAM 3.1.2 as it is EE 2.6+ compatible.
> 2 votes

---
Tags: wygwam, pixelandtonic
---


# Question
Title: How can I filter entries via relationship field? Is Playa the answer?
Here's what I am trying to accomplish in EE 2.5.5. I have 2 channels; blog article and author. The author channel is pulled in via Relationship Field in the blog article channel. I then have the blog pages which correctly display the authors name and link out the the authors profile page, no issues. The issue is that I cannot figure out how to display *only* that author's blog posts on the authors profile page. In other words I cannot figure a way to filter the list of blog articles by the author relationship field per each authors bio page.

Is there a way to filter relationship fields by the channel entries search parameter? Can I do this with reverse related entries? Can I do this easily with the Playa addon?

Any help is appreciated, thanks!

Edit - here's the code I'm currently using, currently this displays "Some articles: John Doe":

`{exp:channel:entries channel="authors" limit="1" dynamic="no"}`

`{reverse_related_entries channel="blog" orderby="entry_date" sort="desc" limit="100"}

{if no_reverse_related_entries}
 No Articles
 {/if}

```
Some articles:

{article_title}
{article_header_image}
{article_content}
{title}

```

{/reverse_related_entries}`

`{/exp:channel:entries}`

# Answer
> 1 votes
Reverse Related entries from the Author channel back to the blog articles channel should work. But, since EE 2.6, the {reverse\_related\_entries} tag has been replaced with the *new* Relationships field -- so you'll need to download the older EE 2.5 documentation to see the official examples.

But, basically the reverse related entries syntax, which goes inside your {exp:channel:entries channel="author"} tag in the authors template, would look something like this:

```
{reverse_related_entries channel="blog_article" orderby="entry_date" sort="desc" limit="100"}
   {if no_reverse_related_entries}
     No Articles
   {/if}
   {title} {!-- this will be the blog article title; add other blog fields here --}
{/reverse_related_entries}

```

---
Tags: channel-entries, playa, filter, v2.5.5
---


title: Remove Template group from url

text:
# Question
Title: Remove Template group from url
I've setup a template group called 'landing' and i want to allow users to visit a clean url like the following:

http://domain.com/url\_title

At the moment it works if I include the template group (http://domain.com/landing/url\_title) so how can I remove the template group from the url?

Through a .htaccess file?

Appreciate any guidance.

N

# Answer
If you know the specific URLs you want to be redirected, and want to redirect only those, you'd add this (before the standard EE Rewrites):

```
RewriteRule ^url_title$ /index.php/landing/url_title [L]

```

e.g., for multiple:

```
RewriteRule ^url_title1$ /index.php/landing/url_title1 [L]
RewriteRule ^url_title2$ /index.php/landing/url_title2 [L]

```

And, finally, if there's a pattern, you could match on the pattern, like this:

```
RewriteRule ^url_title(.*)$ /index.php/landing/url_title$1 [L]

```

UPDATED: removed a really bad idea I suggested in my first version!
> 1 votes

---
Tags: templates, url-title
---


# Question
Title: Include category in keyword simple search
Is it possible to include category names in keyword simple search?

```
{exp:search:simple_form channel="products" result_page="search/results" no_result_page="search/no_results" search_in="everywhere"}
<input type="text" name="keywords" class="fl"  id="search" value="Search..."/>
<input type="submit" value="" class="fl"/>
{/exp:search:simple_form}

```

If my category name was Hats, if you searched for Hats you would get the results from the Hats category

# Answer
> 4 votes
By default, you cannot do this, however, there is a simple extension you can use called Categories to Text to save your categories into text fields automatically. If you set those text fields to be searchable, then essentially you are searching the categories. And you can choose to hide those text fields on the backend by modifying the the publish layout.

Categories to Text: http://devot-ee.com/add-ons/categories-to-text

# Answer
> 3 votes
Simple Search won't natively search categories. Luckily there's an add-on called Preparse from Solspace which will help make it work.

Low posted on his blog about using Preparse to add categories into a searchable text field. Though the post refers to using Preparse with Low Search, it would function the same with Simple Search as well.

---
Tags: categories, search
---


# Question
Title: Freeform - Errors - Can't Create New Fields or Submit Forms
I upgraded to EE v2.7 and am running into some issues with FreeForm. I am running the latest version of FreeForm v4.0.12

1. I can't add new fields in the CMS. Whenever I submit a new field form I am taken to the CMS home screen and the field isn't added.
2. I can't submit forms on the front-end website. I receive the error message 'You are not authorized to perform this action - Reason: Secure Forms Timeout'.

# Answer
> 2 votes
EE 2.7 shipped with changes that break existing code, and so most or all of the Solspace add-ons are currently incompatible with EE 2.7.

Solspace posted that they were working on updates "over the course of the next two weeks". That was two weeks ago, but I suspect we'll see new releases from Solspace, soon.

Like you, I'm stuck right now with things not working... and clients waiting...

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


title: Allow Guests to Upload to Directory?

text:
# Question
Title: Allow Guests to Upload to Directory?
We have a Freeform field for uploading files to an EE directory. However, it appears there’s no way in EE to allow for Guests to upload to a directory? Under File Upload Preferences we can see each of the Member Groups we’ve created but there is simply no option present for Guests.

Am I missing something? Is there any way to simply define an upload path manually for the field as opposed to being forced to select one of the directories created under File Upload Preferences?

# Answer
> 4 votes
Have you looked at Ben's fantastic LogMeIn add-on?

http://devot-ee.com/add-ons/logmein

It'll automatically login a member, after you've defined a custom member group & directory for the anonymous visitor.

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


title: Sort Members (authors) by activity

text:
# Question
Title: Sort Members (authors) by activity
I'm setting up four blogs within a large website and have multiple authors for each blog. I'm setting up these authors as members and would like to show the most active authors (members) with their member photo at the top of each blog. (so the most active authors get "rewarded" with their picture at the top of the blog. up to 6 authors)

what's the easiest way to achieve that?

# Answer
You'll need to either do 2 channel entries calls - once for the authors, then again for the posts, or use something like stash to limit it to only one loop (but probably not suitable in this instance as the authors list needs to be by edit date).

Although you don't define what "most active authors" is actually classed by, I've assumed latest post or edit date, rather than total posts.

```
{exp:channel:entries
    channel="blog"
    orderby="edit_date|date"
    dynamic="no"
    limit="6"}
    {if no_results}What no Authors?{/if}
    <p>{author}</p>
    <img src="{avatar_url}" width="{avatar_image_width}" height="{avatar_image_height}" alt="{author}'s avatar">
{/exp:channel:entries}

```

Then the blog listing...

```
{exp:channel:entries
    channel="blog"
    orderby="date"
    dynamic="no"
    limit="20"}
    {if no_results}Nothing to see here - move along{/if}

    ...blah...
{/exp:channel:entries}

```

Word of caution: this mechanism could easily be manipulated if authors simply edit a character in their post, they'll jump to the top of the author gallery. Might be better to either list by amount of posts (complex - probably only way is to use the query tag) or include the amount of posts they've made.

Within the first channel:entries loop:

```
{exp:member:custom_profile_data member_id="{author_id}"}
    {total_entries}
{/exp:member:custom_profile_data}

```
> 1 votes

---
Tags: members, author
---


title: Wygwam character limit?

text:
# Question
Title: Wygwam character limit?
Is there a character limit on Wygwam / CKEditor?

One of our clients just tried to add a very, very long entry (65k characters or so) and it spit the bit.

Perhaps PHPMemory running out as well?

# Answer
> 3 votes
65k characters is just the limit of a MySQL `TEXT` column. You will need to edit the appropriate `exp_channel_data` database column (using PhpMyAdmin or similar) and change the column type to `LONGTEXT`.

---
Tags: wygwam
---


title: Low Search - Relationships, Playa

text:
# Question
Title: Low Search - Relationships, Playa
I have a question about Low Search. I'd like to create a search field that searches throughout our blog.

Entries in our Blog channel, however, are like empty shells. The only field they have is a Playa field. The actual content is stored in other channels (e.g. Content-Origin channel) and pulled in with Playa.

In other words, when an editor wants to create a blog post they first add pieces of as entries in the Content-Origin channel. Then, they create a Blog entry and select all of those pieces with Playa. Our template serves up the Blog entry.

How would Low Search handle this situation? If a match is found, does Low Search serve the users the entry from Content-Origin? Or from Blog channel? Thank you!

# Answer
Low Search will always return the entries that actually contain the content, in your case the Content-Origin channel.

The keyword-searchable index for an entry consists of its fields. A Playa field contains the ID, url\_title and title of the selected entries (as designed by P&T), so in a limited way, an entry can contain some data from the related entries.

However, an entry's index never contains data from its child entries. I pondered over it once, but really, it's just a big Can o’ Worms™ you do not want to open. Keeping the index up to date if the parent or one of its children changes is a nightmare, what to do if the child entry also has a relationship field... It can get ugly quickly.

So, you'd have to make collections for your Content-Origin channels, and in the results, link back to the blog post by checking if the entry has a parent in the Blog channel.
> 1 votes

---
Tags: low-search
---


# Question
Title: Multiple Site Manager: how many subdomains?
According to addon description, there's a limit of 3 sites. Does sub.mainsite.com qualify as a separate "site"?

And if it does, is there a cheaper way to create unlimited subdomains of the same domain?

Thanks.

# Answer
A subdomain would be a different site.

There is only a limit of 3 sites (whether run on subdomains or totally different domains) in as much as you can run 3 EE powered sites with the MSM licence and 1 installation of EE.

You can run more sites if you purchase more MSM site licences as a lower rate than regular EE licences.

MSM just makes it simpler to share templates and content across different sites and since they all run from a single EE installation it makes updates a lot easier too.

EllisLab will issue you with a couple of files which contain the encrypted licence keys for the sites you have. When you add sites it's a simple matter of replacing the file you have with the new one they send you.
> 1 votes

# Answer
If you plan on running each subdomain as a separate site within the EE CP then yes each subdomain will be one site. If you need additional sites for your MSM license you can purchase these for $49 per additional site. This option becomes available once you have an MSM license in your account.
> 0 votes

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


title: Solspace Freeform Subject Line

text:
# Question
Title: Solspace Freeform Subject Line
I want to change the subject line so that instead of reading "Someone has filled out form: Form Name" I can use a shorter value like "Form Name." Where can I do this in Freeform?

---

I didn't know about the notifications template tab. It lets you specify a subject. Problem solved.

Godaddy requires short subject lines.

# Answer
> 1 votes
Probably the best thing is to set up a custom notification in the Freeform control panel and then in your form's settings assign that custom notification to your form.

But if you really want to edit the default notification's subject you'll have to edit Freeform's language file. Open up `third_party/freeform/language/english/freeform_lang.php` and search for `default_notification_subject` (it's around line 1338 in my copy of Freeform).

You'd edit it to look like

```
'default_notification_subject' =>
"{form_label}",

```

# Answer
> 1 votes
Edit the notification template for the particular form. This is available within the freeform module CP.

---
Tags: solspace
---


# Question
Title: Assets thumbs missing when moving EE to a new server
I've seen a few posts here around this issue but none are leading me to a solution. I'm using Assets with an S3 bucket and have moved EE to a new server. The front-end of the site loads right up just fine, but all thumbs in the CMS are missing. I've tried using "Update Indexes" and it seems to complete fine but when going back to the "Assets / File Manager" screen the thumbnails are still missing.

We intentionally didn't move the cache folder over to the new server because we're trying to keep images out our Git repo.

Suggestions on how I might fix this?

# Answer
> 1 votes
Wanted to update the original post here with the fix.

I had to manually copy over my original `cache/assets` directory from the original server to the new one to solve the problem. As soon as that was in place all thumbnails reappeared in EE. I hadn't expected that *anything* in the cache directory should be moved between servers as it may cause conflicts.

# Answer
> 0 votes
I'll take a look at the code and I'll try to walk through this scenario, but as far as I can remember, when you encounter an Assets image that has no thumbnail and resides on S3, the thumbnail still should be generated.

Is the cache folder set to 777 permissions? Empty or not, it still should be there and be writable as per EE's user guide (http://ellislab.com/expressionengine/user-guide/installation/installation.html).

---
Tags: assets, pixelandtonic, server-migration
---


# Question
Title: Getting the chosen option of a Relationships fieldtype field
I recently upgraded from 2.5.5 to 2.7 and I am doing a number of fixes to make my code up compatible with the new version.

I have a channel field called `foo` which is of the Relationships fieldtype.

When I tried outputting `{foo}` it outputs 0

```
{exp:channel:form
   channel="a_channel"
}
...
{foo} <-- outputs 0
{/exp:channel:form}

```

My problem is, how do I get the value/id of the currently chosen `foo` value?

I haven't seen any documentation about this. This is a generic, common to do so I thought they have something for it.

**UPDATE**:

I tried this as per documentation

```
 {exp:channel:form
       channel="a_channel"
    }
    ...
    {selected_option:foo}
 {/exp:channel:form}

```

But it did not work also

*It is also important to note that this is a custom field*

# Answer
> 1 votes
I believe based on the EE Relationship documentation (http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html) you would do the following:

```
{foo}
     {foo:entry_id}
{/foo}

```

---
Tags: relationships
---


# Question
Title: Categories variable pair not backspacing at all
I am using the following code to display an inline list of regions from a categories list for a product entry. The backspace isn't working at all, no matter how I change my code around. I will post a couple of the combinations I tried. Any ideas?

```
<ul>
    <li><p>Region:
    {categories show_group="9" style="linear" backspace="7"}
        <a href="{path=/products}">{category_name}</a>,
    {/categories}
    </p></li>
</ul>

```

as well as

```
<ul>
    <li><p>Region:
    {categories show_group="9" style="linear" backspace="7"}
        <a href="{path=/products}">{category_name}, </a>
    {/categories}
    </p></li>
</ul>

```

and this one with a , and regular space afterwards

```
<ul>
    <li><p>Region:
    {categories show_group="9" style="linear" backspace="2"}
        <a href="{path=/products}">{category_name}</a>,
    {/categories}
    </p></li>
</ul>

```

I've read a few posts on the ellislabs forums related to this...which is why I have a few combinations, but nothing is working. I am using EE 2.6.1.

# Answer
It turns out whitespace and placement of the closing categories tag was the issue. I moved the whole tag group onto 1 line in my template, and moved the , and closing categories tag outside of the closing `</a>` tag. Thanks Kevin and Nuno! I added a span so I could color the commas the same as the links.

```
<ul>
    <li><p>Region:
        <span>{categories show_group="9" backspace="2"}<a href="{path=/products}">{category_name}</a>, {/categories}</span>
    </p></li>
</ul>

```
> 1 votes

---
Tags: categories, list
---


title: Unable to publish entry to channel

text:
# Question
Title: Unable to publish entry to channel
I have a channel (media) that has various custom fields, one a matrix field where you can post images to a gallery, I have already published 20 images to this gallery and everything worked as it should, now when I try to publish any more images it just won't work, no error message is given it just redirects to the CP homepage. Anyone ever came across this before??

# Answer
> 1 votes
Go to "Members" -\> "Member Groups" -\> "Edit Group" and check if option "Include Members in PUBLISH page multi-author list?" is set to "Yes".

Make sure you have privileges (if you are not a Super Admin) to edit that channel.

While editing channel entry go to "Options" and check if you are on the dropdown list "Authors".

If not - go to your profile settings -\> Member Preferences and check option "Include user in PUBLISH page multi-author list?".

Go to entry you want to edit, change author to yourself and it should be working now.

---
Tags: matrix, pixelandtonic, publish-layout
---


# Question
Title: Help with sorting MATRIX values in Super Search results
I'm using matrix extension to get the lowest value of a column in a search. The problem that I have is to sort results:

this is my code:

```
{exp:super_search:results channel="my_channel"}

    {my_matrix_field:lowest col="column_name"}

{/exp:super_search:results}

```

I tried using `orderby="column_name"` but it doesn't work

Many thanks in advance…

# Answer
You can't order your Super Search results by a function of another fieldtype like that. But wehat you can do is write a custom extension and then use the super\_search\_prep\_order extension hook.

> The Rating module uses this hook to sniff for an order directive like `order=rating`. When it sees that, it runs its own routine to order the list of known entry ID's by Bayesian rating. The Rating module returns a forced order list of entry ID's as part of the order directive that Super Search will later use against the DB. Another extension could behave similarly and force the order of entries as it sees fit.
> 1 votes

---
Tags: matrix, supersearch, sort, orderby
---


# Question
Title: Focus Lab's EE Master Config under webroot
What Focus Lab’s EE Master Config modifications are required for `/config/config.master.php` to work within webroot (eg. `public_html` or `htdocs`), if I cannot place it *above* webroot?

The instructions provided on their github page are for placement above webroot. It has a link to a step-by-step article regarding placing it within webroot by Alex Ball, but the link does not resolve.

# Answer
> 8 votes
I hate to answer my own question, but in the interest of sharing…

I have discovered that the required modification to use Focus Lab’s EE Master Config under your webroot folder (eg. `public_html` or `htdocs` folder) is simply a path update within `/config/config.master.php` on line 234 (version 1.1).

This should be the relative path to your `config.{env}.php` files.

Note that the same path update is required under your modified `config.php` and `database.php` files.

---
Tags: focus-lab-master-config
---


# Question
Title: Is it possible to check if a Freeform Pro form has any kind of error?
In my template I have a Freeform Pro composer form with inline error handling turned on. I know that I can check if a certain field has an error by going:

```
{if freeform:error:{composer:field_name}}

```

And I can check for general errors with:

```
{if freeform:general_errors}

```

But, is there a way to check if the (whole) form had any kind of error? Something like:

```
{if freeform:has_errors} (doesn't work)

```

I want to output a general error message in addition to the field and general errors. The fields are dynamic, so checking every one of them is not an option.

# Answer
You could do this by using the `inline_error_return=""` parameter: http://www.solspace.com/docs/freeform/form/#inline\_error\_return

For example, you could craft a special URL when inline errors are encountered, eg:

```
return="template_group/template/errors_found"

```

Then, in your template, use a simple conditional to display your "has errors" message:

```
{if segment_3 == "errors_found"}Errors were found in your form{/if}

```
> 3 votes

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


# Question
Title: homepage.php Hack Doesn't Work on Media Temple (DV) Server
I'm using the Publish Prefixes extension, and I ran into this problem.

I applied the fix given in the issue tracker, and it works on my local WAMP server and Rackspace Cloud hosting. But it *doesn't* work on Media Temple (DV) servers - the PHP errors remain.

Is there some special PHP setting I need to have in place for this fix to work?

# Answer
> 1 votes
It seems like this change shouldn't fail on a different host, but check the obvious, first:

* double-check that you've uploaded the homepage.php file to MT
* does the homepage.php file have the correct permissions on MT
* are your EE versions the same in each case
* are the hosts PHP versions the same in each case

If it isn't something obvious, can you update your post with more info on what the problem is: what looks broken? what error messages are you seeing? what else seems wrong?

---
Tags: php, media-temple
---


# Question
Title: Entire site down - Seemingly random (and fatal) ExpressionEngine error
Every so often, my entire site goes down for an indefinite period of time. Restarting the MySQL service appears to temporarily fix the issue. I recently upgraded to EE 2.7 and about the same time my website started to experiencing a bit of a slow down. Just when this error occurred, I noticed a huge spike in response time (1 million ms) for PHP processing in New Relic!

Above image shows a 30 hour window for New Relic

This shows a 6 hour window for new relic

Any ideas on what could be happening? Any suggestions for diagnosing this? Remember, this error only occurs periodically and seemingly without warning.

# Answer
Fixed this recurring error which was caused by huge traffic spikes ourselves by doubling the RAM from 2GB to 4GB (which spiked to 400% during heavy memory pressure) allocated to the VM.
> 2 votes

# Answer
Could it be a backup or other cron process being run and this is overloading the database server?
> 0 votes

---
Tags: ee2, php, error, mysql, newrelic
---


# Question
Title: Cart Throb - Failed to connect error [SagePay]
I’m Struggling to get SagePay to play nicely. The error I’m getting is:

> Error
>
> Failed to connection 195.170.169.8: Permission Denied (7)

and it looks to me like it’s in and EE message box (See screenshot attached)

We’ve got everything in place such as HTTPS redirect, SSL, secure forms, IP addresses added to SagePay, in testing mode and using testing details but we keep hitting this error when we press “Pay” on the last step.

SagePay are saying it’s not on their end due to nothing even getting to their system (Transactions / Errors) and our host is saying it isn’t their fault and the firewall isn’t blocking anything!

*Sigh*

# Answer
Disabling "Selinux" on the server fixed this issue.
> 1 votes

---
Tags: cartthrob, error, ecommerce
---


# Question
Title: One category randomly outputting all articles
I'm currently developing a site and have run into a little bug, all but one category are working fine, the one that isn't working outputs all product entries from the whole site, any ideas why this would happen? My code is as follows:

```
{if segment_2 == "category"}

  {embed="site/_header" page_name="product_list"}

  {exp:channel:category_heading channel="products"}
      <h1>{category_name}</h1>
  {/exp:channel:category_heading}

  <div class="secondary-col">
    <ul class="categories">
    {exp:channel:categories show_empty="no" {if segment_1 == "cave"}category_group="3"{/if}{if segment_1 == "climb"}category_group="4"{/if}{if segment_1 == "camp"}category_group="5"{/if}{if segment_1 == "walk"}category_group="6"{/if}{if segment_1 == "clothing"}category_group="7"{/if}{if segment_1 == "accessories"}category_group="8"{/if}{if segment_1 == "brands"}category_group="2"{/if}}
        <a href="/{segment_1}/category/{category_url_title}">{category_name}</a>
    {/exp:channel:categories}
    </ul>
  </div>

  <div class="primary-col">

    {exp:channel:category_heading channel="products"}
        {if category_description}
            <div class="introduction"><p>{category_description}</p></div>
        {/if}
    {/exp:channel:category_heading}

    {exp:channel:entries channel="products" limit="50" paginate="bottom"}

    <ul class="product-list">
      {exp:store:product entry_id="{entry_id}"}
      <li>
        <article>
          <a href="{url_title_path='products'}">
            <h2>{title}</h2>
            <p>
              {if on_sale}
                <del>{regular_price}</del>
                {price}
                <span class="label label-success">Save {you_save} ({you_save_percent}%)</span>
              {if:else}
                {price}
              {/if}
            </p>
          </a>
        </article>
      </li>
      {/exp:store:product}

      {paginate}
        {pagination_links}
            <ul>
            {first_page}
              <li><a href="{pagination_url}" class="page-first">First Page</a></li>
            {/first_page}

            {previous_page}
              <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>
            {/previous_page}

            {page}
              <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
            {/page}

            {next_page}
              <li><a href="{pagination_url}" class="page-next">Next Page</a></li>
            {/next_page}

            {last_page}
              <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
            {/last_page}
          </ul>
        {/pagination_links}
      {/paginate}
    </ul>

    {/exp:channel:entries}

 </div> <!-- /primary-col-->
{/if}

```

You can view the problematic page here, it doesn't output the category title or anything, suggesting it can't find the category, but the category is being output from both the main navigational dropdowns and the secondary navigation on the left, there are 5 products assigned to this category too:

http://inglesport.rmdyapps.co.uk/cave/category/static-ropes

here's how a similar page looks:

http://inglesport.rmdyapps.co.uk/cave/category/rope-descenders

# Answer
I'm guessing you're using the category in url feature, with the identifier of "category". I'd expect the issue is occurring due to no products assigned to that category, or that the category url is incorrect.

This URL does the same: http://inglesport.rmdyapps.co.uk/cave/category/blah

I'm assuming it can't find a valid category URL in the current URL, so the channel:entries tag is then pulling back all products (because it has no restriction).

If it were me, I'd approach it using Low Seg2Cat and then use the category parameter in the channel:entries call. That way you have full control and can utilise the no\_results conditional and have `{if "{last_segment_category_id}" == ""}` to trap invalid category URLs.
> 2 votes

---
Tags: categories
---


# Question
Title: Cart Throb Sales price have an expiry date
Has anyone ever been able to have a product on sale in CartThrob for a set period of time? What I want is to have certain products on sale for a set period of time and then it automatically goes back to regular price after a set date.

# Answer
It should be possible to use Discounts (as opposed to Coupon Codes) to do this. Discounts are just regular entries so you can set an expiry date on them.

Discounts are applied at checkout without the need for the customer to enter any code. You can set up various types of discount based on products, prices, quantities etc. using the built in methods. It's also possible to create custom discount plugins if you have any specific requirements.
> 1 votes

---
Tags: cartthrob, ecommerce
---


title: Expiration date for a row

text:
# Question
Title: Expiration date for a row
I have a new problem that I can't resolve yet. I want to set an expiration date in the matrix for each row. I have a column "date" that I need to use as an expiration date. In search I don't want to display the row if is expired, and if its the only row, I want to ignore it in results.

It is posible to do?

Thanks.

# Answer
Inside your Matrix tag pair this will work:

```
{if expiration_date_column > current_time}
    {!-- not expired yet, put your row html here --}
{/if}

```

Or you can use the search parameter on the Matrix opening tag. This is probably better if you only want your result set to include unexpired rows:

```
{your_matrix_field search:expiration_date_column=">{current_time}"}
    {!-- this returns only unexpired rows --}
{/your_matrix_field}

```
> 4 votes

---
Tags: matrix, date, expire
---


# Question
Title: Generate a PIN per member to access specific area on site
I'm looking for ideas on how to implement this, even if it means building stuff custom. Basically, the flow goes like this:

* A visitor goes to the site and wants access to some downloadable content
* Visitor has to submit contact info (think lead-gen form) to get a 4-digit PIN
* 4-digit PIN should be auto-generated per visitor/form filled out
* 4-digit PIN is used by visitor to "login" to downloadable content area
* If visitor forgets their PIN, a "forgot PIN/password" function is needed.

Obviously, this sounds like member registration with custom fields (using Zoo Visitor most likely) would do the trick, but the gotcha is with the 4-digit PIN - it **must** be 4-digits/characters and it must be auto-generated for the visitor and subsequently emailed\*.

Also, when logging in to the protected area, all that should be entered is a PIN. No username. (Is that possible?)

Is there an add-on that will auto-generate the PIN and send the email upon successful sign-up? Any other ideas also welcome. :)

**I realize that sending PINs/passwords via email is a security no-no but it's needed in this case and there's no personal data accessed on the front-end of the site.*

# Answer
I once created something similar for an EE1 site where people submit their email address and get back a pin code--though they get the code on the sign-up thank-you web page, not via email.

I used this open source alphaID function for generating the pin codes.

I've used this specifically to generate 4 digit pin codes, and I'm pretty sure you can use the function to *always* generate 4 alphanumeric characters.

It should be a good starting place for your code generation, if it's isn't an exact match.

For emailing the code, I've never tried using a PHP function in a FreeForm notification template--that might work. But, I'd also look at MX Notify Control and Postmaster.
> 2 votes

# Answer
Although you could utilise native login/zoo visitor (although I'd recommend Freemember). I'm not sure how you'll cope with sending out the password and auto generating it, although you could look at trying to fire off the reset password (so a dummy random password is created initially then the user is requested to set the password which is really resetting your temp password), unless you ask them for a password initially. The username would be the PIN number. Then you have to handle tracking of the user (if they've downloaded it for example).

The tricky bit would be generating a unique PIN, but you could write an add-on that checked existing usernames and generated a new unique one.

Otherwise custom route, but you don't need to really utilise member management.

You'll need a module, that creates a table with the unique index as the 4 digit PIN and password - either encrypted or as if (if there's no security implications). You could extend to hold user info, access counts, etc.

In your form for the "request access" the module generates a unique (available) PIN and password, these are then submitted to an ACT url picked up by the module and saved to the database. Slight risk in case there's 2 random numbers chosen at the same time and it tries to save them - but there may be tweaks you can make to avoid that.

Then you create another form in your template that submits to another module ACT url that takes the info supplied by the user and compares to the DB info to either verify and allow access to the download, or deny.

Obviously you can extend or simplify for your needs.

This is a useful add-on for sending out emails from a template: Email from Template
> 1 votes

---
Tags: ee2, password
---


title: Paypal redirect is wrong after payment!

text:
# Question
Title: Paypal redirect is wrong after payment!
i have a very strange issue that the paypal redirect point to the wrong url in Safari and some versions of Chrome. The redirect url is correct and it work on some browsers. But on other the redirect seems to be a wrong act url and i didn't find out how i could handle this? Any suggestions to that issue?

Best Peter

# Answer
> 1 votes
Hmm, i didn't find a good solution for this. We hard coded the return url now to the store\_payments.php but i don't think that's a good solution ...

```
public function redirect_to_return_url($order)
{
    $return_url = $this->EE->store_orders_model->get_order_return_url($order);
    $return_url = "https://www.domain.com/shop/appreciate";
    $this->EE->functions->redirect($return_url);

}

```

I think the problem is with the return\_url. As paremeter i set the return url to something like this in my checkout template:

```
{exp:store:checkout
    form_id="register-form"
    register_member=""
    error_handling="inline"
    error_delimiters='<div class="help-box">|</div>'
    require="name|order_email|address1|address3|postcode|country"
    return="https://www.domain.com/shop/appreciate"
}

```

I used it with and without https://domain.com/shop/appreciate and the behavior was always the same. In the output of my developer log i saw that the return url is set sometimes twice like http://www.domain.com/http://www.domain.com in Google Chrome. I thought that this is the error and Safari can't handle a doubled url, but as i had a look into the developer log again, the return url was always my checkout template although i set the correct return\_url as described above??? I don't know what's wrong or where this url come from.

Maybe you can give me a hint where the return url is set, or why safari and chrome handle this in a different way?

Any help would be really good.

Thanks

Peter

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


title: 2.7.0 Update Error

text:
# Question
Title: 2.7.0 Update Error
I'm trying to update to 2.7.0 from 2.6.1.

I've done this on one website we have, but the other just isn't playing...

I'm doing the exact same thing (And also tried this 3 times and still getting the same issue) It gets to the point where I agree to the terms & conditions, then goes to this URL:

http://website.com/admin.php?C=wizard&M=do\_update&language=english&ajax\_progress=yes

And displays a Google Chrome error:

Server error

I normally see these errors when there is a missing DB file, or an error with the DB. But I've restored it back, ensured the CMS worked, then tried again and it still doesn't do it.

Console isn't showing anything neither.

What could be causing this?

---

Edit (After Disabling JS)

http://website.com/admin.php?C=wizard&M=do\_update&language=english

---

Edit (PHP Error)

\[04-Sep-2013 12:13:21 Europe/Dublin\] PHP Fatal error: Class PT\_Fieldtype contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EE\_Fieldtype::display\_field) in /Users/shape2/repositories/website.com/system/expressionengine/third\_party/pt\_field\_pack/pt\_fieldtype.php on line 148

# Answer
I was having this same error going from 2.6.1 to 2.7.0. Here's how I got around it.

Don't upload your system -\> third party folders until after you run the installer.

I followed all the steps here: http://ellislab.com/expressionengine/user-guide/installation/update.html except for uploading the add-ons to third party at the end of #3, ran the update and everything was fine. Then afterwards I uploaded the add-ons and everything was still okay.

It looks like conflict for you is on the add-on with the folder 'pt\_field\_pack'. For me it was a plugin called Safecracker Registration. You could optionally just take out the 'pt\_field\_pack' folder before running the install too.

Also, if afterwards in case you get an error in your control panel that says '*Your ExpressionEngine installation’s version (2.6.1) is not consistent with the reported version (2.7.0). Please update your installation of ExpressionEngine again.*' refer to this thread: http://ellislab.com/forums/viewthread/237540/ and open system/installer/updates/ud\_270.php and ADD this code ABOVE line 1050:

```
    if (empty($data))
{
    return;
}

```
> 1 votes

# Answer
> \[04-Sep-2013 12:13:21 Europe/Dublin\] PHP Fatal error: Class PT\_Fieldtype contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EE\_Fieldtype::display\_field) in /Users/shape2/repositories/website.com/system/expressionengine/third\_party/pt\_field\_pack/pt\_fieldtype.php on line 148

Have you updated "pt field pack" with new "Field Pack" as well?

http://devot-ee.com/add-ons/field-pack
> 0 votes

---
Tags: updating, update
---


# Question
Title: EE 2.7.0: Saving a new channel entry brings error "undefined index"
Whenever I save new entry I get the following error message. But the entry is saved. I can open the entry and etdit it. When I save the edited version no error occurs. What does this error message mean and what can I do to fix it? I started with uninstalling the checkbox fieldtype, since I don´t need it, but this didn´t help. This error is not channel or custom fieldgroup specific. It comes up for all 3 channels that I have.

```
A PHP Error was encountered

Severity: Notice

Message: Undefined index: field_id_sitemap__ping_sitemap

Filename: checkboxes/ft.checkboxes.php

Line Number: 80
A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: checkboxes/ft.checkboxes.php

Line Number: 80
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/www/deleted_my_path-here/codeigniter/system/core/Exceptions.php:170)

Filename: libraries/Functions.php

Line Number: 809

```

# Answer
> 5 votes
I use the Sitemap-Module V 2.6 from PutYourLightsOn. This caused the error. When I disable the module all is fine. The most recent version of this module is 2.6.2. I installed it, but the problem persisted. The message

```
Message: Undefined index: field_id_sitemap__ping_sitemap

```

gave me the hint to try to disable the sitemap module. I will ask the programmer for support. We sorted it out, it was a bug in EE 2.7.0. I got Sitemap 2.6.3 and this update fixed it.

# Answer
> 0 votes
This looks to be a bug related to EE version 2.7. I would suggest reporting it to EllisLab on their **Bug Tracker** (you must be logged in to see it).

---

Also, Pixel & Tonic offers an alternative EE field for Check Boxes in the **Field Pack addon**.

---
Tags: ee2, error, entry, saving
---


title: Freeform broke my layout

text:
# Question
Title: Freeform broke my layout
I've a problem on this page in a website i'm currently developing. As you can see , the form layout is broke (i'm using gumby2 css framework). I'm sure the cause is the div with class hiddenfFields, because if i remove it with firebug, the layout is ok:

```
<div class="hiddenFields">
...
</div>

```

inside the form with id "freeform"

Anyone have an idea how can ia resolve this issue? What properties i need to override? Thanks in advance

# Answer
> 1 votes
I just needed to put the ul inside a div with class "row"

# Answer
> 2 votes
Nothing to do with Freeform or ExpressionEngine, just your CSS.

2 solutions...

change

```
<ul class="six columns">

```

to

```
<ul class="twelve columns">

```

Or add a new CSS style:

```
form#freeform .columns {
    float:none;
}

```

---
Tags: solspace-freeform, forms, css
---


# Question
Title: EE1 to EE2 upgrade error SELECT field_id FROM exp_weblog_fields WHERE field_type = 'date'
getting this error during an EE1 - EE2 upgrade:

```
A Database Error Occurred
Error Number: 1146

Table 'dbname_ee.exp_weblog_fields' doesn't exist

SELECT field_id FROM exp_weblog_fields WHERE field_type = 'date'

Filename: updates/ud_200.php

Line Number: 1930

```

NEW ERROR::

```
{"error":"
Error Number: 1064<\/p>\n\n

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`wm_name` varchar(80),\n\t`wm_type` varchar(10) DEFAULT 'text',\n\t`wm_image_path` v' at line 3<\/p>\n\n

ALTER TABLE `exp_member_groups` ADD \n\t`wm_id` int(4) UNSIGNED AUTO_INCREMENT,\n\t`wm_name` varchar(80),\n\t`wm_type` varchar(10) DEFAULT 'text',\n\t`wm_image_path` varchar(100),\n\t`wm_test_image_path` varchar(100),\n\t`wm_use_font` char(1) DEFAULT 'y',\n\t`wm_font` varchar(30),\n\t`wm_font_size` int(3) UNSIGNED,\n\t`wm_text` varchar(100),\n\t`wm_vrt_alignment` varchar(10) DEFAULT 'top',\n\t`wm_hor_alignment` varchar(10) DEFAULT 'left',\n\t`wm_padding` int(3) UNSIGNED,\n\t`wm_opacity` int(3) UNSIGNED,\n\t`wm_x_offset` int(4) UNSIGNED,\n\t`wm_y_offset` int(4) UNSIGNED,\n\t`wm_x_transp` int(4),\n\t`wm_y_transp` int(4),\n\t`wm_font_color` varchar(7),\n\t`wm_use_drop_shadow` char(1) DEFAULT 'y',\n\t`wm_shadow_distance` int(3) UNSIGNED,\n\t`wm_shadow_color` varchar(7),\n\t`id` int(10) UNSIGNED AUTO_INCREMENT,\n\t`upload_location_id` int(4) UNSIGNED DEFAULT '0',\n\t`title` varchar(255),\n\t`short_name` varchar(255) DEFAULT '',\n\t`resize_type` varchar(50) DEFAULT '',\n\t`width` int(10) DEFAULT '0',\n\t`height` int(10) DEFAULT '0',\n\t`watermark_id` int(4) UNSIGNED,\n\t`file_id` int(10) UNSIGNED AUTO_INCREMENT,\n\t`cat_id` int(10) UNSIGNED,\n\t`sort` int(10) UNSIGNED DEFAULT '0',\n\t`is_cover` char(1) DEFAULT 'n',\n\t`site_id` int(4) UNSIGNED DEFAULT '1',\n\t`rel_path` varchar(255),\n\t`status` char(1) DEFAULT 'o',\n\t`mime_type` varchar(255),\n\t`file_name` varchar(255),\n\t`file_size` int(10) DEFAULT '0',\n\t`field_1` text,\n\t`field_1_fmt` tinytext,\n\t`field_2` text,\n\t`field_2_fmt` tinytext,\n\t`field_3` text,\n\t`field_3_fmt` tinytext,\n\t`field_4` text,\n\t`field_4_fmt` tinytext,\n\t`field_5` text,\n\t`field_5_fmt` tinytext,\n\t`field_6` text,\n\t`field_6_fmt` tinytext,\n\t`metadata` mediumtext NULL,\n\t`uploaded_by_member_id` int(10) UNSIGNED DEFAULT '0',\n\t`upload_date` int(10),\n\t`modified_by_member_id` int(10) UNSIGNED DEFAULT '0',\n\t`modified_date` int(10),\n\t`file_hw_original` varchar(20),\n\t`can_admin_upload_prefs` CHAR(1) DEFAULT 'n' NOT NULL AFTER `can_admin_channels`<\/p>\n\n

Filename: \/home\/user\/admin\/expressionengine\/libraries\/Smartforge.php<\/p>\n\n

Line Number: 122<\/p>"}

```

this is line 122:

```
if (ee()->dbforge->add_column($table, array($k => $field[$k]), $after_field))

```

# Answer
> 1 votes
ended up going back to an old server backup to restore the old site. WIll try again from scratch

# Answer
> 0 votes
You might want to try restoring the original directory for the field types. Not sure if this idea is transferable, but we had an issue upgrading from 2.55 to 2.7 where our "Relationship" channel fields broke.

Uploading the old `rel` folder into the `fieldtypes` folder then allowed us to change those fields in the control panel into the new "Relationships" field type.

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


# Question
Title: How does channel entries tag work when no channel name is specified?
I have seen a lot of implementations where the exp channel tag is used without specifying any channel or url, etc.

e.g.

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

```

I have not built anything significant with EE yet and from all the material I have read so far, I have always been specifying the channel(s) that I wish to request information from.

So, how does this work exactly when no channel is in the tag - does it just take the last\_segment or something?

Thanks for clearing up!!

# Answer
> 5 votes
The channel entries tag is a bit special in that, by default, it looks at your URL to determine how and whether to filter the entries that it returns. You can switch off this dynamic behaviour with the `dynamic="no"` parameter.

Primarily, the tag will filter itself down to entries matching a url\_title contained in segment\_2 or segment\_3 (bear in mind that url\_titles *are* allowed to be duplicated if the entries are in different channels, so using limit="1" is a good safety net if you're displaying a single entry).

Secondly, the tag will filter itself further based on three extra factors that it looks for in the URL:

* categories
* dates
* pagination

For a full explanation, take a look here:

http://www.jamessmith.co.uk/articles/expressionengine\_url\_schematic

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


# Question
Title: How can I determine Assets' internal folder_id for use in the {exp:assets:files} tag?
The subject says it all, really... Assets apparently uses an internal ID for folders that is different from EE's folder ID. Disregarding the reasoning WHY Assets had to have different folder IDs... how can I see which folder ID Assets uses? The only place I've been able to see it is by inspecting the underlying HTML that makes up the folder list on the left in Assets -\> File Manager.

Am I missing something obvious?

# Answer
Well, the short answer is "managing files and folders when only way of grouping them is by the files relative path is an absolute nightmare." :)

You should not be using that folder id explicitly, anyway, as folders are subject to change.

You should be using http://docs.pixelandtonic.com/assets/templating/module/folders.html to get the folder ids that you need.
> 1 votes

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


# Question
Title: Unknown column 'parent_var_id' in 'exp_playa_relationships'
I get the following error when updating Playa to V4.4.5

Unknown column 'parent\_var\_id' in 'exp\_playa\_relationships'

ALTER TABLE exp\_playa\_relationships ADD parent\_is\_draft INT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER parent\_var\_id

Filename: third\_party/playa/ft.playa.php

Environment is MAMP, EE2.7.0.

This happens when clicking the playa link in the fieldtypes CP display. Oddly, the version is already at 4.4.5 when I do that, but maybe because I ran the module updates before - I was updating two other P&T addons at the same time - Matrix and Assets.

# Answer
> 4 votes
After updating Playa and it failing to run it's update forDB schema, here's what you can try:

Take a look at the columns in exp\_playa\_relationships table in the database.

* Does it have a field parent\_var\_id? If no, then the version you should set is 4.1.
* If yes, does it have a field parent\_is\_draft? If no, then the version you should set is 4.3
* If yes, then the version you should set is 4.4.5

Now, set the version number we determined in the previous three steps for the Playa field in the exp\_fieldtypes table and go visit the Add-ons -\> Fieldtypes -\> Playa page and hit submit.

Everything should be all working now.

---
Tags: playa, pixelandtonic
---


# Question
Title: Why doesn't the content of the page load again after postback?
**I'm using the form\_declaration() function in a module**, and I fire a method when the form is submitted. I set the form's action to loop back to the sender so I can do some form validation serverside.

When I submit the form, the desired function fires, but the page content doesn't load. I can retrieve the POST data and call other functions to do checks on the data. Unfortunately the original page content doesn't load. I have nowhere to write where the user went wrong.

Of course I could echo out where the user went wrong, but I want the messages to appear next to the erring fields.

Below is my code and example output:

EE Form

```
{exp:database_add:form}
    <input class="text_box" type="text" name="username" id="username" />
    <input class="text_box" type="password" name="password" id="password" />
    <input type="submit" name="submit_button" value="Register" />
{/exp:database_add:form}

```

The form function to make the above code make sense in ExpressionEngine

```
function form(){
    $form_details = array(
        'action'        => '/expression_engine_practice/index.php/home/registration/',
        'hidden_fields' => array(
            'ACT' => ee()->functions->fetch_action_id('Database_add', 'register')
        )
    );

    $return_data = ee()->functions->form_declaration($form_details);
    $return_data .= ee()->TMPL->tagdata;
    $return_data .= '</form>';
    return $return_data;
}

```

The function that I want to fire (it does as is demonstrated by the example output to follow)

```
function register(){
    $username = $_POST['username'];
    $password = $_POST['password'];

    echo "Username: $username<br />";
    echo "Password: $password<br />";

    $data = array(
        'User_ID'       =>null,
        'User_Name'     =>$username,
        'User_Passhash' =>$password
    );
    $query = ee()->db->insert('exp_user', $data);

    //Prints out the contents of the table.
    $query = ee()->db->get('exp_user');
    foreach($query->result() as $row){
        echo "ID: $row->User_ID -- $row->User_Name -- $row->User_Passhash<br/>";
    }
}

```

Output generated from register() - I entered "happy" and "gilmore"

```
Username: gilmore
Password: happy
ID: 45 -- pizza -- icecream
ID: 46 -- napkins -- paper towels
ID: 47 -- google -- facebook
ID: 48 -- lafferty -- daniel
ID: 49 -- gilmore -- happy

```

I checked the form action after it renders. The action is "/expression\_engine\_practice/index.php/home/registration" which is exactly the name of the page the form is sent from. The desired function fires and tasks are completed.

**Why doesn't the content of the 'registration' page load again after postback?**

Secondary question that will also help me close this issue.

**How do I do form validation through a module? I want the text of any errors found in the form to be displayed in the form page after a postback.**

# Answer
> 4 votes
This is far from obvious how to achieve in EE, and it's not really documented at all. A long while ago I wrote up on Stack Overflow how we (used to) do this in Store, and this was in turn based on how SafeCracker (now Channel Form) did it. However, I've since figured out an even cleaner way to achieve it (Channel Form, FreeMember, and many other add-ons use this new pattern).

Without writing a 3 page answer it's hard to describe it completely. I suggest reading through the FreeMember module source code to get an idea for how this works.

The basic concept is to handle the form submission using an action (as usual), and if there are any errors then make a note of them in a static variable (so you can access them later in the page load). Finally, call `ee()->core->generate_page();`, which will let EE resume the page load. When EE's parser gets down to your template tag, you can check for the existence of inline errors, and output them as variables to display in your template.

You must also be sure that your original form simply posts to the current page, not a `index.php?ACT=123` style URL. As long as an `ACT` parameter is part of the POST array, your action will still be called (EE allows the ACT parameter to passed via either POST or GET, it doesn't matter). This allows EE to continue rendering the correct page when you call `ee()->core->generate_page();`. In Store we achieve this by simply leaving the HTML form `action=""` parameter out entirely, as this is valid HTML5 and all browsers treat it as "post to the current page".

This method is a little convoluted, but it gives the designer maximum flexibility over how to display your module's error messages.

---
Tags: module, forms, validation
---


title: Solspace's Tags & Conditionals

text:
# Question
Title: Solspace's Tags & Conditionals
In this template I display information about characters from a TV show. This includes a season-by-season summary of significant events for a character. I am trying to work out a way where adding each new season is more streamlined. Each character is tagged for each season it appears in, with S1, S2, etc. This is what I've currently got:

```
{exp:tag:tags entry_id="{entry_id}"}

{if tag == "S1" OR tag == "S2" OR tag == "S3"}
{if segment_4 == ""}

<h3>Spoilers</h3>

<ul>
{if tag == "S1"}<li><a href="{comment_url_title_auto_path}/Season_One/">Season One</a></li>{/if}
{if tag == "S2"}<li><a href="{comment_url_title_auto_path}/Season_Two/">Season Two</a></li>{/if}
{if tag == "S3"}<li><a href="{comment_url_title_auto_path}/Season_Three/">Season Three</a></li>{/if}
</ul>

{/if}

{if segment_4 == "Season_One" OR segment_4 == "Season_Two" OR segment_4 == "Season_Three"}

<h3>Spoilers</h3>

{if tag == "S1"}
<h4>Season One</h4>

{{current_channel_id}_season_one}
{/if}

{if tag == "S2"}
<h4>Season Two</h4>

{{current_channel_id}_season_two}
{/if}

{if tag == "S3"}
<h4>Season Three</h4>

{{current_channel_id}_season_three}
{/if}

{/if}

{/if}
{/exp:tag:tags}

```

At the moment, the default entry page for a character ends up looking like this:

```
Spoilers

    Season One

Spoilers

    Season Two

Spoilers

    Season Three

```

I am not sure why the "Spoilers" heading gets repeated for each link.

Additionally, if I click through on the "Season One" link it ends up displaying season one, season two and season three in one go.

Any suggestions for how I'd need to tweak this template to get the desired result and, preferably, a setup with less duplication of tags needed each time another season is added?

# Answer
> 1 votes
Wow that's a lot of conditionals. This loop runs for every tag. So in this case 3 times. If you only want Spoilers to display once, try `{if count == '1'}Spoilers</if}` Here: `{if tag == "S1"}<li><a href="{comment_url_title_auto_path}/Season_One/">Season One</a></li>{/if}`

you could try

```
<li><a href="{comment_url_title_auto_path}/{websafe_tag}/">{tag}</a></li>{/if}

```

changing the tags to Season 1, Season 2 etc instead of s1, s2. Then things will be dynamic as seasons are added as well.

---
Tags: conditionals, solspace, solspace-tag
---


title: Database error number 5

text:
# Question
Title: Database error number 5
I had a problem with my Expression Engine. Today login for my system and i have a error off database number 5.

can someone help me?

# Answer
> 1 votes
Looks like an out of memory error. This is happening when you just login?

How much memory do you have allocated for this account?

For now, try to repair and optimize your database tables and see if that helps to alleviate this.

Also, it can be more helpful to copy and paste the error as text. For one thing, then it is readable (your screenshot is quite small), and also, it's easier to grab for searching. :)

---
Tags: ee2, error, database
---


# Question
Title: TMPL->parse_variables_row() not available in model?
I have a model (core\_model.php) with lots of functions in there, however having an issue with the following one in specific :

```
 Class core_model {
    function __construct(){
        $this->EE =& get_instance();
        $this->EE->load->library('api');
        $this->EE->load->library('email');
        $this->EE->load->library('template');

        $settings = $this->_get_settings();
    }

        .....

    function parse_user_template($data)
    {
     $td = $this->EE->db->select("template_data")
                            ->from("templates")
                            ->where("template_name","user_notification")
                            ->get()->row()->template_data;

     $parsed_data = $this->EE->TMPL->parse_variables_row($td,$data);
    }
}

```

Basically, I'm calling the $this-\>EE-\>core\_model-\>parse\_user\_template($data) function passing in a $data array of values which I want it to parse against the specific template file for me to do something with once parsed (namely to use it as an email body).

For some reason, I'm getting the following error:

> Message: Undefined property: EE::$TMPL
>
> Filename: models/core\_model.php
>
> Line Number: 69

Anyone have any ideas why this is the case and I can't parse it?

# Answer
The loading of the template needs to be done as follows:

```
$this->EE->load->library('template',null,'TMPL');

```

Now it works.
> 4 votes

---
Tags: templates, add-on-development, parsing
---


# Question
Title: {email} and {url} returning admins info, not comment authors info
**I’m trying to use these two template systems (xml templates, php enabled) to export EE (EE core version 2.7) blog entries into WordPress .wxr import format:**

These two templates are in a template group called export. One template is called index, and the other is called comments. I open index in a new window and view source to see the .wxr data.

The one template directly below (I was using this before a two template system was suggested) outputs the four blog posts with the `status="Home Featured"` and all the comments, but the comments don't have the original author or URL but has the admins info, as noted in the original question title.

```
<rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.1/"
>

<channel>
    <title>{site_name}</title>
    <link>{site_url}</link>

    <pubDate></pubDate>
    <language>en</language>
    <wp:wxr_version>1.1</wp:wxr_version>
    <wp:base_site_url>http://domain.com/demo1/</wp:base_site_url>
    <wp:base_blog_url>http://domain.com/demo1</wp:base_blog_url>

    <generator>http://wordpress.org/?v=3.1.2</generator>

{exp:channel:entries channel="blog" status="Home Featured" orderby="date" sort="desc" limit="100" offset="0" rdf="off" dynamic="no"}

    <item>
        <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
        <link></link>
        <pubDate>{entry_date format="%r"}</pubDate>
        <dc:creator><![CDATA[{author}]]></dc:creator>
        <guid isPermaLink="false">http://domain.com/demo1/?p={entry_id}</guid>
        <description></description>
        <content:encoded><![CDATA[{if blog-body}{blog-body}{if:elseif cc_content}{cc_content}{if:else}{article_content}{/if}]]></content:encoded>
        <excerpt:encoded><![CDATA[{if blog_short}{blog_short}{if:elseif cc_teaser}{cc_teaser}{if:else}{teaser}{/if}]]></excerpt:encoded>
        <wp:post_id></wp:post_id>
        <wp:post_date>{entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date>
        <wp:post_date_gmt>{gmt_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date_gmt>
        <wp:comment_status>open</wp:comment_status>
        <wp:ping_status>open</wp:ping_status>
        <wp:post_name>{url_title}</wp:post_name>
        <wp:status>{if status == "open"}publish{if:elseif status == "review"}pending{if:elseif status == "closed"}private{if:elseif status == "draft"}draft{if:else}publish{/if}</wp:status>
        <wp:post_parent>0</wp:post_parent>
        <wp:menu_order>0</wp:menu_order>
        <wp:post_type>post</wp:post_type>
        <wp:post_password></wp:post_password>
        <wp:is_sticky>0</wp:is_sticky>
{categories}
        <category domain="category" nicename="{if category_url_title == "uncategorized"}media{if:else}{category_url_title}{/if}"><![CDATA[{if category_name == "Uncategorized"}Media{if:else}{category_name}{/if}]]></category>
{/categories}
        <wp:postmeta>
            <wp:meta_key>_edit_last</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
{if article_links}
        <wp:postmeta>
            <wp:meta_key>Associated Links</wp:meta_key>
            <wp:meta_value><![CDATA[{article_links}]]></wp:meta_value>
        </wp:postmeta>
{/if}
        <wp:postmeta>
            <wp:meta_key>_su_rich_snippet_type</wp:meta_key>
            <wp:meta_value><![CDATA[none]]></wp:meta_value>
        </wp:postmeta>
        <wp:postmeta>
            <wp:meta_key>_encloseme</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>

{/exp:channel:entries}
{exp:comment:entries sort="desc" entry_id="{embed:entry_id}"}

        <wp:comment>
            <wp:comment_id>{comment_id}</wp:comment_id>
            <wp:comment_author><![CDATA[{name}]]></wp:comment_author>
            <wp:comment_author_email>{email}</wp:comment_author_email>
            <wp:comment_author_url>{url}</wp:comment_author_url>
            <wp:comment_author_IP>{ip_address}</wp:comment_author_IP>
            <wp:comment_date>{comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date>
            <wp:comment_date_gmt>{gmt_comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date_gmt>
            <wp:comment_content><![CDATA[{comment}]]></wp:comment_content>
            <wp:comment_approved>1</wp:comment_approved>
            <wp:comment_type></wp:comment_type>
            <wp:comment_parent>0</wp:comment_parent>
            <wp:comment_user_id>0</wp:comment_user_id>
        </wp:comment>
{/exp:comment:entries}
    </item>
</channel>
</rss>

```

**9/12/13 edit:** **This two template system breaks:** index only outputs one blog post and I don't think it correctly passes the blog post info to the comments template (so that the comments are linked by post ID to the blog post) because upon WP import, WP says the author doesn't exist and doesn't import any comments.

**"index" template:**

```
     <rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.1/"
>

<channel>
    <title>{site_name}</title>
    <link>{site_url}</link>

    <pubDate></pubDate>
    <language>en</language>
    <wp:wxr_version>1.1</wp:wxr_version>
    <wp:base_site_url>http://domain.com/demo1/</wp:base_site_url>
    <wp:base_blog_url>http://domain.com/demo1</wp:base_blog_url>

    <generator>http://wordpress.org/?v=3.1.2</generator>

{exp:channel:entries channel="blog" status="Home Featured" orderby="date" sort="desc" limit="10" offset="0" rdf="off" dynamic="no"}

    <item>
        <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
        <link></link>
        <pubDate>{entry_date format="%r"}</pubDate>
        <dc:creator><![CDATA[{author}]]></dc:creator>
        <guid isPermaLink="false">http://domain.com/demo1/?p={entry_id}</guid>
        <description></description>
        <content:encoded><![CDATA[{if blog-body}{blog-body}{if:elseif cc_content}{cc_content}{if:else}{article_content}{/if}]]></content:encoded>
        <excerpt:encoded><![CDATA[{if blog_short}{blog_short}{if:elseif cc_teaser}{cc_teaser}{if:else}{teaser}{/if}]]></excerpt:encoded>
        <wp:post_id></wp:post_id>
        <wp:post_date>{entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date>
        <wp:post_date_gmt>{gmt_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date_gmt>
        <wp:comment_status>open</wp:comment_status>
        <wp:ping_status>open</wp:ping_status>
        <wp:post_name>{url_title}</wp:post_name>
        <wp:status>{if status == "open"}publish{if:elseif status == "review"}pending{if:elseif status == "closed"}private{if:elseif status == "draft"}draft{if:else}publish{/if}</wp:status>
        <wp:post_parent>0</wp:post_parent>
        <wp:menu_order>0</wp:menu_order>
        <wp:post_type>post</wp:post_type>
        <wp:post_password></wp:post_password>
        <wp:is_sticky>0</wp:is_sticky>
{categories}
        <category domain="category" nicename="{if category_url_title == "uncategorized"}media{if:else}{category_url_title}{/if}"><![CDATA[{if category_name == "Uncategorized"}Media{if:else}{category_name}{/if}]]></category>
{/categories}
        <wp:postmeta>
            <wp:meta_key>_edit_last</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
{if article_links}
        <wp:postmeta>
            <wp:meta_key>Associated Links</wp:meta_key>
            <wp:meta_value><![CDATA[{article_links}]]></wp:meta_value>
        </wp:postmeta>
{/if}
        <wp:postmeta>
            <wp:meta_key>_su_rich_snippet_type</wp:meta_key>
            <wp:meta_value><![CDATA[none]]></wp:meta_value>
        </wp:postmeta>
        <wp:postmeta>
            <wp:meta_key>_encloseme</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>

    {embed="blog/comments" entry_id="{entry_id}"}

{/exp:channel:entries}

    </item>
</channel>
</rss>

```

**"comments" template**

```
<rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.1/"
>

<channel>
    <title>{site_name}</title>
    <link>{site_url}</link>

    <pubDate></pubDate>
    <language>en</language>
    <wp:wxr_version>1.1</wp:wxr_version>
    <wp:base_site_url>http://domain.com/demo1/</wp:base_site_url>
    <wp:base_blog_url>http://domain.com/demo1</wp:base_blog_url>

    <generator>http://wordpress.org/?v=3.1.2</generator>

{exp:comment:entries sort="desc" entry_id="{embed:entry_id}"}

<item>
        <wp:comment>
            <wp:comment_id>{comment_id}</wp:comment_id>
            <wp:comment_author><![CDATA[{name}]]></wp:comment_author>
            <wp:comment_author_email>{email}</wp:comment_author_email>
            <wp:comment_author_url>{url}</wp:comment_author_url>
            <wp:comment_author_IP>{ip_address}</wp:comment_author_IP>
            <wp:comment_date>{comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date>
            <wp:comment_date_gmt>{gmt_comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date_gmt>
            <wp:comment_content><![CDATA[{comment}]]></wp:comment_content>
            <wp:comment_approved>1</wp:comment_approved>
            <wp:comment_type></wp:comment_type>
            <wp:comment_parent>0</wp:comment_parent>
            <wp:comment_user_id>0</wp:comment_user_id>
        </wp:comment>
</item>
{/exp:comment:entries}
</rss>

```

# Answer
> 3 votes
Saw your post in meta - maybe a new answer which distills the entire thread you and Anna have created will be of help?

You do need two templates. The first will begin your document, and then list each channel entry, and then close the document. Within that template's `channel:entries` loop, you will embed your "comments" template, which will run once for every entry, and will list all comments for that particular entry, based on the `entry_id` you pass it via the embed.

So, using your code, the first template looks like this:

```
<rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/1.1/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/1.1/"
>
<channel>
    <title>{site_name}</title>
    <link>{site_url}</link>
    <pubDate></pubDate>
    <language>en</language>
    <wp:wxr_version>1.1</wp:wxr_version>
    <wp:base_site_url>http://domain.com/demo1/</wp:base_site_url>
    <wp:base_blog_url>http://domain.com/demo1</wp:base_blog_url>
    <generator>http://wordpress.org/?v=3.1.2</generator>

{exp:channel:entries channel="blog" status="Home Featured" orderby="date" sort="desc" limit="100" offset="0" rdf="off" dynamic="no"}
    <item>
        <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
        <link></link>
        <pubDate>{entry_date format="%r"}</pubDate>
        <dc:creator><![CDATA[{author}]]></dc:creator>
        <guid isPermaLink="false">http://domain.com/demo1/?p={entry_id}</guid>
        <description></description>
        <content:encoded><![CDATA[{if blog-body}{blog-body}{if:elseif cc_content}{cc_content}{if:else}{article_content}{/if}]]></content:encoded>
        <excerpt:encoded><![CDATA[{if blog_short}{blog_short}{if:elseif cc_teaser}{cc_teaser}{if:else}{teaser}{/if}]]></excerpt:encoded>
        <wp:post_id></wp:post_id>
        <wp:post_date>{entry_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date>
        <wp:post_date_gmt>{gmt_date format="%Y-%m-%d %H:%i:%s"}</wp:post_date_gmt>
        <wp:comment_status>open</wp:comment_status>
        <wp:ping_status>open</wp:ping_status>
        <wp:post_name>{url_title}</wp:post_name>
        <wp:status>{if status == "open"}publish{if:elseif status == "review"}pending{if:elseif status == "closed"}private{if:elseif status == "draft"}draft{if:else}publish{/if}</wp:status>
        <wp:post_parent>0</wp:post_parent>
        <wp:menu_order>0</wp:menu_order>
        <wp:post_type>post</wp:post_type>
        <wp:post_password></wp:post_password>
        <wp:is_sticky>0</wp:is_sticky>
{categories}
        <category domain="category" nicename="{if category_url_title == "uncategorized"}media{if:else}{category_url_title}{/if}"><![CDATA[{if category_name == "Uncategorized"}Media{if:else}{category_name}{/if}]]></category>
{/categories}
        <wp:postmeta>
            <wp:meta_key>_edit_last</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
{if article_links}
        <wp:postmeta>
            <wp:meta_key>Associated Links</wp:meta_key>
            <wp:meta_value><![CDATA[{article_links}]]></wp:meta_value>
        </wp:postmeta>
{/if}
        <wp:postmeta>
            <wp:meta_key>_su_rich_snippet_type</wp:meta_key>
            <wp:meta_value><![CDATA[none]]></wp:meta_value>
        </wp:postmeta>
        <wp:postmeta>
            <wp:meta_key>_encloseme</wp:meta_key>
            <wp:meta_value><![CDATA[1]]></wp:meta_value>
        </wp:postmeta>
        {embed="blog/comments" entry_id="{entry_id}"}
    </item>
{/exp:channel:entries}
</channel>
</rss>

```

Then, inside of **blog/comments**:

```
{exp:comment:entries sort="desc" entry_id="{embed:entry_id}"}
        <wp:comment>
            <wp:comment_id>{comment_id}</wp:comment_id>
            <wp:comment_author><![CDATA[{name}]]></wp:comment_author>
            <wp:comment_author_email>{email}</wp:comment_author_email>
            <wp:comment_author_url>{url}</wp:comment_author_url>
            <wp:comment_author_IP>{ip_address}</wp:comment_author_IP>
            <wp:comment_date>{comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date>
            <wp:comment_date_gmt>{gmt_comment_date format="%Y-%m-%d %h:%i:%s"}</wp:comment_date_gmt>
            <wp:comment_content><![CDATA[{comment}]]></wp:comment_content>
            <wp:comment_approved>1</wp:comment_approved>
            <wp:comment_type></wp:comment_type>
            <wp:comment_parent>0</wp:comment_parent>
            <wp:comment_user_id>0</wp:comment_user_id>
        </wp:comment>
{/exp:comment:entries}

```

(The reason the comments chunk needs to be embedded is because there can be variable collisions between the `channel:entries` tag and the `comment:entries` tag.)

# Answer
> 1 votes
Try adding dynamic="no" to your `exp:comment:entries` tag. I would also add the channel="" parameter to the tag:

```
{exp:comment:entries sort="desc" entry_id="{embed:entry_id}" dynamic="no" channel="XXXX"}

```

Also, confirm that {embed:entry\_id} is printing out the correct ID in your embed.

---

If that doesn't work, make sure your `exp:comment:entries` is NOT inside a `exp:channel:entries` tag.

---

**EDIT (September 10, 2013)**
Your templates must be setup correctly to get the data you are wanting. From what I think you're trying to do, you need to setup this way with two templates. My code sample below is really dumbed down.

In your first template add the channel:entries tag and add an {embed} tag to a second template to which you pass the entry's {entry\_id}.

```
{exp:channel:entries channel="blog"}
    {embed="blog/comments" entry_id="{entry_id}"}
{/exp:channel:entries}

```

In the second template, you call the entry\_id using {embed:entry\_id} in the comment:entries tag.

```
{exp:comment:entries entry_id="{embed:entry_id}"}
{/exp:comment:entries}

```

NOTE: This will be resource intensive if you are printing out lots and lots of data. I wouldn't only use this to do a one off export of entries and comments which seems to be what you're doing. If you get a white screen, you will need to increase PHP memory or limit the number of entries that you are calling.

---
Tags: templates, comments, export
---


# Question
Title: Showing all categories on the same level as current entry
I'm trying to create a navigation with my categories, current the categories look like this:

Products

– Accessories

– Backpacks

– Clothing

– – Mens

– – Womans

When on the main products page I want to display all of these items, when on the clothing page I want to display Clothing as the title, then Womens and Mens, when on Mens, I want to display Mens and Womens with Clothing as the title. Currently have the following code:

```
{exp:gwcode_categories cat_url_title="{segment_3}" show_trail="yes" class="categories"}
      <a href="/cave/category/{cat_url_title}">{cat_name}</a>
    {/exp:gwcode_categories}

```

This is outputting the current item you're on and any parents items above, I just need to display the siblings as well (women if you're on men).

Is this possible? and if so, how, thanks!

# Answer
Embeds...

Primary Template:

```
{exp:gwcode_categories cat_url_title="{segment_3}" limit="1"}
    {embed=Xgroup/Ytemplate parent="{parent_id}"}
{/exp:gwcode_categories}

```

Secondary Template (group Xgroup, template Ytemplate):

```
{exp:gwcode_categories cat_id="{embed:parent_id}" incl_self="no" show_trail="yes" class="categories"}
    <a href="/cave/category/{cat_url_title}">{cat_name}</a>
{/exp:gwcode_categories}

```

You could output the current category in the primary template, then pass through to the embed the cat\_id which could then excluded in the secondary template.

The primary could also be used to display the parent category details (if exists).

The alternative would be to use something like Stash to avoid the embed and save the parent and utilise it in a second gwcode\_categories call after the first.
> 1 votes

---
Tags: categories, gwcode-categories
---


# Question
Title: Page breaking at random - content disappearing
Here's a conundrum. A basic site, in EE2.4. This page has links in the left col, with content loading in the right col via a simple AJAX call. The code generate by EE is correct.

http://www.thresholdinteriorsnyc.com/press/

Some users report it working fine, while other report it broken. This doesn't seem to be browser-related. The problem of it not working is intermittent.

Hosted on on Rackspace.

Any ideas?

# Answer
> 4 votes
Your page content isn't loading/linking properly without www in the url. So http://www.thresholdinteriorsnyc.com/press/ works, but http://thresholdinteriorsnyc.com/press doesn't.

Check your htaccess for the proper redirects and watch out for absolute paths in your code.

# Answer
> 1 votes
Just browsing through the site, there are random javascript errors being triggered. I would start by attacking these one-by-one. Simply writing exceptions for the pages that don't need the functionality looks as thought it would help to begin. If you are triggering an error early on, a dependent function may randomly run or not run. This all depends on the browser, browser version, and how each handle the void variables being called.

As for anything else, it's hard to get a grip on it unless you could let us know what plug-ins, scripts you are using, and your template code to see how things are being handled.

---
Tags: ee2
---


title: Save Channel Entry as Draft

text:
# Question
Title: Save Channel Entry as Draft
I want to update a channel entry and save it as a draft. I am the admin but I need someone else to review the changes before it is published. This would be either a new channel entry or an updated one. Much like it's done in WordPress. Is there an adon or can I do it natively in EE.

# Answer
You can use the native entry statuses to accomplish a draft status. If you review the documentation on statuses, you'll see how you can edit the status group and add `draft` alongside `open` and `closed`.

Then, you'll just have to make sure your status group is assigned to the channels you're using to publish the content.

By default, the `{exp:channel:entries}` tag will only show entries with the status of `open`, so none of the content set to `draft` will be visible on the site.
> 2 votes

# Answer
I use Better Workflow for this. It makes life much easier when handling scenarios like what you have here. Another approach I have used, while not as pretty, was to establish statuses, and build a exception to block all but local traffic through a firewall (in this case, using Big IP from f5) and building multiple templates. One of the templates will be prefixed with the exception rule, so if you block all outside traffic but allow internal traffic with say 'internal\_', your templates could be 'article' and 'internal\_article' where 'article' only displays 'open' status and 'internal\_article' displays 'open|draft'.

It's messy and complicated though. That's why I just fold and use Better Workflow. ;)
> 2 votes

---
Tags: channel-entries, status, workflow
---


title: P&T Assets Url Path

text:
# Question
Title: P&T Assets Url Path
Is there a way in P&T Assets to output just the file's relative url path without the filename?

For instance, I'm trying to call a file's retina image.

This is the normal file output:

```
   {image_blog}
          {url}
   {/image_blog}

```

Which results in:

```
   /path/to/file/filename.jpg

```

But I'm looking to obtain this output instead:

```
   /path/to/file/filename@2x.jpg

```

I thought this could be accomplished with...

```
   {image_blog}
          {subfolder}{filename}@2x.{extension}
   {/image_blog}

```

... but this results in ...

```
   filename@2x.jpg

```

What is subfolder supposed to output if not /path/to/file/? Is there another way to grab the relative path?

# Answer
> 2 votes
Have you tried `{url}` or `{server_path}`? I suspect that `{subfolder}` (confusingly) refers subfolders of existing EE File Upload paths (i.e. subfolders that Assets recognizes, but EE does not).

# Answer
> 0 votes
Ended up using php to grab the relative path by subtracting {filename} from {url}.

```
<?php
    $url       = "{image_blog}{url}{/image_blog}";
    $filename  = "{image_blog}{filename}{/image_blog}";
    $extension = "{image_blog}.{extension}{/image_blog}";
    $needle    = $filename . $extension;
    $relative  = str_replace($needle,"",$url);
    $retina    = $relative . $filename . "@2x" . $extension;
    echo $retina;
?>

```

---
Tags: assets, pixelandtonic
---