# Question
Title: Focuslab Master Config staging server not working
I'm 100% this is user error on my part.

I'm using the focuslab master config set up to run locally, staging and live. The site works correctly on live and locally but staging I keep getting a database error.

```
Unable to connect to your database server using the provided settings.

Filename: core/EE_Config.php

Line Number: 207

```

After looking at this thread I added `exit('here');` to config.stage.php but nothing happened. I've tested the database credentials in another script and the connections are working there. Am quite lost.

my config.env.php file has the following:

```
switch (strtolower($_SERVER['HTTP_HOST'])) {
    case 'domain.ca' :
        define('ENV', 'prod');
        define('ENV_FULL', 'Production');
        define('ENV_DEBUG', FALSE);
    break;

    case 'domaindev.com' :
        define('ENV', 'stage');
        define('ENV_FULL', 'Staging');
        define('ENV_DEBUG', FALSE);
    break;

    case 'localdomain.dev' :
        define('ENV', 'local');
        define('ENV_FULL', 'Local');
        define('ENV_DEBUG', TRUE);
    break;

    default :
        define('ENV', 'local');
        define('ENV_FULL', 'Local');
        define('ENV_DEBUG', TRUE);
    break;

```

The live site is at domain.com and staging is at subdomain.mysite.com

I can see the working site locally and on live (just deployed the master branch to live and to staging), but getting the database error on staging.

Please advise

# Answer
> 2 votes
I may just misunderstand your post but you have changed 'domaindev.com' to 'staging.mysite.com' haven't you?

Also try putting the staging db connection info in for the default/local environment (on your staging server) to see if it's just falling through to the default. Which would imply the domain isn't properly set.

# Answer
> 3 votes
1. Make sure the staging domain is correct in config.env.php
2. Make sure the staging config is in fact loaded (put a die("hello); at the top of your config.staging.php)
3. Verify that your site says "hello" on staging, which means it is actually loading the staging config.
4. Edit both index.php and admin.php and set $debug=1; in both.
5. Remove the die() you put in config.staging.php in step 2)
6. Load the website again, you should now get a PHP error (most likely in your config.staging.php file)

Fix the PHP error and you should be good to go :-)

(oh and you might want to set $debug=0; again in index/admin.php once everything is working)

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


# Question
Title: What is the best method for automating SEO META data on a site
Ok, I could be over complicating things, but here is what I am up against and what all I have tried...

I am working on rebuilding a site in which they do not want their users to have to worry about managing their SEO. (Keywords, description, images, etc...) But they want their site to be social media friendly for all of the social sites out there. I have narrowed the social sites to facebook, twitter, linked:in, google+, and pinterest. They also have specific "looks" that they want for each one. This means I have had to review the developer API's and find the templates that match what they are after and build towards those layouts. All this said, I need a way to gather all of this in a clean sweep. (If possible)

I was using SEO Lite in conjunction with Mark's IfElse. I liked it, but that didn't quite get them what all they were after. I switched to NSM Better Meta and tried to use embed templates to gather all of the information this way.

The problem was that each of these required someone to manually enter the data. I then decided to just use a snippet. The problem is that the snippet doesn't do anything for keywords. Automatic keyword generation is a real stumper. I have ideas on how to achieve it, but it would require something extra... plugin, extension, combination, etc... I am open to any and all ideas.

Here is the snippet. I have removed all of the customer info. The logic statements are because different channels use different fields. I could make three different ones, but this worked so I just left it.

```
    <!-- Geo Data -->
    <meta name="geo.position" content="my x,my y" />
    <meta name="geo.placename" content="City, ST" />
    <meta name="geo.region" content="US-ST" />

    <!-- Place this data between the <head> tags of your website -->
    <title>{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here</title>

    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <!-- Google Authorship and Publisher Markup -->
    <link rel="author" href="https://plus.google.com/member-id/posts"/>
    <link rel="publisher" href="https://plus.google.com/member-id"/>

    <!-- Schema.org markup for Google+ -->
    <a href="https://plus.google.com/member-id?rel=author" style="display:none;">Google+</a>
    <meta property="url" content="{current_url}" />
    <meta itemprop="name" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here">
    <meta itemprop="datePublished" content="{entry_date format='%Y-%m-%dT%H:%i:%s%Q'}">

    {if field_pair:total_rows > 0}
        <meta itemprop="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}">
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    <!-- Twitter Card data -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@username">
    <meta name="twitter:title" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here">

    {if field_pair:total_rows > 0}
        <meta name="twitter:description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}">
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <meta name="twitter:creator" content="@alamodeinc">

    <!-- Twitter summary card with large image must be at least 280x150px -->
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta name="twitter:image:src" content="{exp:low_replace find='/product_images/' replace='/product_images/_Twitter_Card_Image'}{field_pair:field}{/exp:low_replace}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta name="twitter:image:src" content="{exp:low_replace find='/product_images/' replace='/product_images/_Twitter_Card_Image'}{field_pair:field}{/exp:low_replace}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    <meta name="twitter:domain" content="domain.com">

    <!-- Open Graph data -->
    <!-- Used by Facebook and Linked:In -->
    <meta property="og:title" content="{title} - {if segment_1}{segment_1}{/if} - {if segment_2}{segment_2}{/if} - company name here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="{current_url}" />

    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
        {/field_pair}
    {/if}
    {if field_pair:total_rows > 0}
        {field_pair}
            {if field_pair:field}
                <meta itemprop="image" content="{field_pair:field}">
            {/if}
            {field_pair:field images_only="yes"}
                <meta itemprop="image" content="{field_pair:field}">
            {/field_pair:field}
        {/field_pair}
    {/if}

    {if field_pair:total_rows > 0}
        <meta property="og:description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}
    {if field_pair:total_rows > 0}
        <meta name="description" content="{exp:eehive_hacksaw chars = '150' append = '...'}{field_pair}{field_pair:field}{/field_pair}{/exp:eehive_hacksaw}" />
    {/if}

    <meta property="og:site_name" content="{site_label} - company name here" />
    <meta property="article:published_time" content="{entry_date format='%Y-%m-%dT%H:%i:%s%Q'}" />
    <meta property="article:modified_time" content="{edit_date format='%Y-%m-%dT%H:%i:%s%Q'}" />
    <meta property="article:section" content="Article Section" />
    <meta property="article:tag" content="Article Tag" />
    <meta property="fb:admins" content="admin-id" />

    <!-- Pinterest Article Pins - not picked up from earlier tags -->
    {exp:tagger:tags entry_id="{entry_id}"}
        <meta property="article:tag" content="{tagger:tag_name}" />
    {/exp:tagger:tags}

```

# Answer
there is an easier way to do this with SEO Lite, check out this gist which has an example:

https://gist.github.com/bjornbjorn/4039233
> 1 votes

---
Tags: ee2, seo, seo-lite, meta, metadata
---


# Question
Title: Expresso Store, using quantity with if/else
Simple question, but I can't seem to find the documentation to do this properly.

Currently using the following: `{order_qty} ITEMS IN BAG`

How would I go about replacing "ITEMS" with "ITEM" when the quantity equals 1?

# Answer
> 3 votes
You could save a bit of processing by using a simple conditional instead of an advanced conditional.

**EDIT** Show something different when the cart is empty

```
{exp:store:cart}
 {if no_items}
   Your cart is empty!
   {!-- this only shows when the cart is empty --}
 {/if}
  {order_qty} ITEM{if {order_qty} > 1}S{/if} IN BAG
  {!-- this will only show if there is actually something in the cart --}
{/exp:store:cart}

```

# Answer
> 1 votes
```
{if {order_qty} == 1}ITEM{if:else}ITEMS{/if}

```

---
Tags: expresso-store
---


title: Trying to choose a search engine

text:
# Question
Title: Trying to choose a search engine
I'm building a new site that will contain alot of news items and archived pdf publications. I'm wondering if anyone with experience using Solspace Super Search, Low Search, and Google Search would be willing to share their thoughts on the pros/cons and differences between these three options.

Basically, I would like a search engine that is a little more robust than the native EE option and Super Search and Low seem like they will do the trick. However, one question I have about using Google Search is the time it takes for Google to index the pages on my site. I'm assuming it may not be immediate. This would be important because the site will be new.

Any insight will be appreciated.

# Answer
I'm not sure any of the options you mentioned other than Google will actually index the content of PDFs. You may have to create an entry for each one with the text content. Maybe there's an add-on that will grab the text out for you (I know it's possible).

I've used Low Search and Super Search. Both are excellent but I'd probably go with Low.
> 4 votes

# Answer
I'm using Low Search, it's really more powerful than the native EE search, very well documented, nice user interface. You can parameter the weight of each field, categories of the each collection of search. Easy to integrate in a project.

You can parameter complex search. And the Low support is very good and efficient.
> 4 votes

---
Tags: search, low-search, supersearch
---


title: EE External Site API

text:
# Question
Title: EE External Site API
First I am not a programmer so much may go over my head that you say.

I have been working on trying to come up with a solution to this...

Have an external site's form(Site B) post to my site(Site A) to a specific Channel.

I want to use an API of some sort that can post via REST/Javascript or CURL and do a postback if the insert was successful. Does anyone know of an add-on that can do all this? I know this exists in Wordpress but I am trying my best to hold onto EE, this is for a personal site of mine. Really could use someones help, please and I will return the favor.

# Answer
> 1 votes
The Import module from Solspace works well for getting data INTO your site from another service or API. If you want to provide an API interface for OTHER sites to post data into your site then you might look at "Entry API" (http://devot-ee.com/add-ons/entry-api). I've not tried the "Entry API" myself but came across it so I can't provide any info on how well it works.

---
Tags: open-api
---


title: No Update indexes option in Assets

text:
# Question
Title: No Update indexes option in Assets
I have a member group called Admin and it's not seeing the menu options of Update Indexes, External Sources or Settings. Admin screenshot at the top, SuperAdmin below They have access to the Add-Ons, Modules section, and Assets, what am I missing?

# Answer
> 2 votes
Paul, that's available only to superadmins at the moment (Assets 2.2.4), due to security concerns of exposing 3rd party API keys. You can re-index the current folder in Assets by clicking the circular arrow on the top right corner, however that won't index any new folders.

I'll add a config setting to the next version of Assets for this. Meanwhile, if you need a custom fix, hit us up (support@pixelandtonic.com) and we'll see what we can do.

---
Tags: assets, pixelandtonic
---


title: Changing error messages

text:
# Question
Title: Changing error messages
( v2.7.3 )

Hi, I'm using the Simple Registration addon and allowing the form to use the email address as user and screen name. However, if an email address is not valid it triggers an error for both user and screen name as well as email, which is confusing for the user.

> · The username you chose is not available
> · The screen name you chose is not available
> · The email you chose is not available

Is there a way to change this?

# Answer
This was solved by a software update from the addon vendor.
> 0 votes

---
Tags: registration, error-pages
---


# Question
Title: Stash: set and replace inside exp:search_fields and exp:channel:entries not working
I'm trying to set (and change) a Stash var within a search loop. I tried process='end', parse='inward' and similar, but i can't set/update/replace the var inside the loop and get the proper value back:

```
{exp:search_fields search:chapter_keywords='{embed:search}' search:chapter_text='{embed:search}' operator="OR" channel="chapter" parse="inward"}
    {exp:channel:entries entry_id="{search_results}" orderby="chapter_name" sort="asc" limit="50" dynamic="no" disable="categories|category_fields|member_data|pagination"}

        {exp:stash:set name="chapterType" parse="inward" parse_tags="yes" trim="yes"}unknown{/exp:stash:set}
        {chapter_videos limit="1"}
            {if chapter_videos:count > 0}
                {exp:stash:set name="chapterType" parse="inward" parse_tags="yes" trim="yes" replace="yes"}video{/exp:stash:set}
            {/if}
        {/chapter_videos}

        {chapter_images limit="1"}
            {if chapter_images:count > 0}
                    {exp:stash:set name="chapterType" parse="inward" parse_tags="yes" trim="yes" replace="yes"}image{/exp:stash:set}
            {/if}
        {/chapter_images}

          {embed="_chapters/index" entryId="{entry_id}" chapterType="{exp:stash:get name='chapterType' process='end'}{/exp:stash:get}"}

```

*Not closing exp: here, but they are closed for real.*

{exp:stash:get name='chapterType' process='end'}{/exp:stash:get}

always returns 'image'

{exp:stash:get name='chapterType'}{/exp:stash:get}

always returns 'video'

When i output the chapterType within the loop without try to set it with Stash it'll print the correct vars (image, video, unknown) depending on the search results/loop entries.

# Answer
Looks like you've got a bit going on there. It's a parse order issue, the way EE parses content takes some time to get your head around.

First up, your testing results for up to 50 items, so using a simple stash:set will only ever list the last result.You'll need to use the stash:set\_list instead. I'd avoid using the embed where you can as in this situation with the code it will bog the system down as it will embed 50 times (if 50 results).

I'm not 100% sure of this code, but hopefully will help you on your journey :)

```
{!-- Set a stash_list of results, parse_depth is 3 to drill down through the various tags/modules --}
{exp:stash:set_list name="results" parse_tags="yes" parse_conditionals="yes" trim="yes" parse_depth="3"}

    {exp:search_fields search:chapter_keywords='{embed:search}' search:chapter_text='{embed:search}' operator="OR" channel="chapter" parse="inward"}

        {exp:channel:entries entry_id="{search_results}" orderby="chapter_name" sort="asc" limit="50" dynamic="no" disable="categories|category_fields|member_data|pagination"}
            {!-- Capture the entry id to a stash and use in get_list below --}
            {stash:entryid}{entry_id}{/stash:entryid}
            {!-- Set stash to wrap the results, which ever tests true will be recorded (if both are true, image will overwrite video --}
            {stash:chapterType}
                {chapter_videos limit="1"}
                    {if chapter_videos:count > 0}video{/if}
                {/chapter_videos}

                {chapter_images limit="1"}
                    {if chapter_images:count > 0}image{/if}
                {/chapter_images}
            {/stash:chapterType}

        {/exp:channel:entries}

    {/exp:search_fields}

{/exp:stash:set}

{exp:stash:get_list name="results"}
{!-- Pass the stash list to the embed below (avoid embed if possible) --}
{embed="_chapters/index" entryId="{stash:entryid}" chapterType="{stash:chapterType}"}
{/exp:stash:get_list}

```
> 0 votes

# Answer
That seems to do the job! Thanks. Few notes:

1. No need to use {stash: within the {exp:stash:get\_list
2. {exp:stash:set\_list needs to be closed with {/exp:stash:set} not just {/exp:stash:set}

With this corrections your code works perfectly.
> 0 votes

---
Tags: stash
---


# Question
Title: Why can't I get the total row count for my grid field?
I have a Grid field (called 'beneficiaries') that I'm using to hold a list of first names and last names of beneficiaries, but I'm struggling to get a template to output the total number of rows my Grid field's currently holding. I'm able to output the entire field with the currently submitted data, using:

```
{exp:channel:form channel="beneficiary" return="/next_page" entry_id="8"}
    {beneficiaries}
{/exp:channel:form}

```

And that works great.

Now I just want to print to the screen the total number of rows, much like:

```
{exp:channel:form channel="beneficiary" return="/next_page" entry_id="8"}
    Total: {beneficiaries:total_rows}<br />
    Total: {beneficiaries:field_total_rows}<br />
    Total: {field:beneficiaries:total_rows}<br />
    Total: {field:beneficiaries:field_total_rows}<br />
{/exp:channel:form}

```

Which only returns the following:

```
Total: {beneficiaries:total_rows}
Total: {beneficiaries:field_total_rows}
Total:
Total:

```

Am I doing something painfully obviously wrong? I've read and re-read the documentation to no avail, and I have no idea what I could be doing wrong. Any help as to why I can't seem to display the row count would be greatly appreciated.

# Answer
The grid field is a looping field, so if the field is in fact called beneficiaries, you should have:

```
{beneficiaries}
  {beneficiaries:total_rows}
  {beneficiaries:field_total_rows}
{/beneficiaries}

```
> 6 votes

---
Tags: ee2, grid, 2.8
---


# Question
Title: Very basic addon method not outputting anything
The following code is a small part of a module I've written for a client project. Can anyone see why in some templates it outputs the newrelic code but in others it doesn't?

```
function newrelic_stop()
{
// Set defaults
$output = "";

if (extension_loaded('newrelic'))
{
    $output = newrelic_get_browser_timing_footer();
}

// Show the output
return $output;
}

```

# Answer
> 0 votes
So it turns out that if I use an embed to output my opening newrelic code (method called newrelic\_start in my addon), that outputs fine but stops the newrelic\_stop tag from returning anything at all.

**The fix:** Use a stash embed instead! Doing this is not only a performance benefit over a traditional embed, but also gets my closing newrelic tag returning what it should.

Note that in the stash embed, you need to use process="inline"

---
Tags: module, addons, newrelic
---


title: Nested URI's with multiple categories

text:
# Question
Title: Nested URI's with multiple categories
Was looking for some insight/recommendations on a URI structure for a ecommerce site. The site has thousands of entries & hundreds of categories. A entry can have multiple categories assigned across different category groups. What is the best way to format single entry pages? Do I just have a clean break that all products have a `product/view` template or do I try and nest them under each category:

> http://domain.com/category\_group\_a/category\_a/example\_product

which could also be:

> http://domain.com/category\_group\_b/category\_b/example\_product

If I go the category route, then there is the potential of having duplicate pages under each category the entry is assigned to. Also, this makes it difficult generating URL structures from say a search result page. Ideally, the nested route would be best for SEO, but structuring URI's so they are consistent is going to be a challenge.

# Answer
> 2 votes
With my limited understanding of how your site is configured:

I would use the URI structure of url.com/products/cat\_group/cat/product\_url\_title

That way you can do this with a single template and control the view from the index.html in the products.group using the Low Seg2Cat plugin with the following if statement:

```
{if segment_3 == "" && segment_2 == ""}

This could return all products code given the cat group id by passing in the {segment_2_category_group_id} into the category_group param in the ee entries tag.

{if:elseif segment_3 == "" && segment_2 != ""}

This could return all products code given the cat id with passing in the {segment_3_category_id} into the category_group param in the ee entries tag.

{if:else}

```

This would be the code for a products

```
{/if}

```

seg2cat - http://gotolow.com/addons/low-seg2cat/docs

# Answer
> 1 votes
It's always going to be subjective but I'd go with the simple approach of never having category information in the URL for anything other than a filtered listing page. It's the kind of thing that seems like a good idea at the time, but every decision you make, every new development that happens, every redesign of the site that happens, it will probably come back to haunt you.

---
Tags: url, routing
---


# Question
Title: Worldpay giving callback failure alerts from purchases made using Expresso Store
I launched a store yesterday after thorough (successful) testing, and once live purchases were made, the client received Callback Failure Alerts from Worldpay. The orders didn't make it through to the dashboard, and the client has had to contact the buyers to find out what they ordered. Understandably the clients are stressed about this. I'm using Store 1.6.1 and EE 2.5.2. I'm desperate for a solution asap. Thanks!

**The content of the email from Worldpay is this:**

> Our systems have detected that your callback has failed.
>
> This callback failure means we were unable to pass information to your server about the following transaction:
>
> Transaction ID: 2479208752 Cart ID: 8 Installation ID: 269411
>
> Error reported: Callback to http://www.fabulousflowers.biz/index.php?ACT=37&H=5dfcb904f16e766dcd96781647d779f3: NOT OK, recevied HTTP status: 302 Server Reference: mm2imsps4p:callbackFailureEmail-21277:MerchReq-752-82
>
> Also, if you usually return a response page for us to display to the Shopper within the time allowed (1 minute), this will not have been displayed.
>
> WorldPay will have displayed to the Shopper the response page file (resultY.html or resultC.html) held for your installation on the WorldPay server. This will be your own custom version, if you have supplied one, or, if not, the WorldPay default version.

Then there are two attachments:

**response.txt:**

HTTP/1.1 302 Moved Temporarily Date: Thu, 29 Nov 2012 16:09:02 GMT Server: Apache X-Powered-By: PHP/5.2.17 Set-Cookie: exp\_last\_visit=1038845343; expires=Fri, 29-Nov-2013 16:09:03 GMT; path=/ Set-Cookie: exp\_last\_activity=1354205343; expires=Fri, 29-Nov-2013 16:09:03 GMT; path=/ Set-Cookie: exp\_flash=a%3A1%3A%7Bs%3A24%3A%22%3Anew%3Astore\_payment\_error%22%3Bs%3A38%3A%22Invalid+response+from+payment+gateway.%22%3B%7D2fb730b5f1ab336c121b6a75eb8b6a8f; expires=Fri, 30-Nov-2012 16:10:43 GMT; path=/ Location: http://www.fabulousflowers.biz/index.php/store/checkout3 Content-Length: 0 Connection: close Content-Type: text/html

and **request.txt:**

POST /index.php?installation=269411&ACT=37&msgType=authResult&H=5dfcb904f16e766dcd96781647d779f3 HTTP/1.0 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Host: www.fabulousflowers.biz Content-Length: 1062 User-Agent: WJHRO/1.0 (WorldPay Java HTTP Request Object)

*deleting personal details of buyer which appears here*

Any ideas why I'm getting these errors and the orders aren't showing in the main dashboard?

Thanks.

# Answer
> 1 votes
I cant speak for the Worldpay errors but you should be able to see orders even if they weren't successful. In the Control Panel click on Store then scroll down to Orders. The click on the dropdown for "Filter by Order Status" and set it to "Incomplete" which should refresh the Orders page and show you the customers orders.

# Answer
> 1 votes
I think almost certainly this is an issue with IIS request validation. This is a different cart, but similar issue and the solution should be similar:

http://www.kartris.com/Knowledgebase/Worldpay-callback-issues---302-redirect-Not-OK\__k-48.aspx

---
Tags: expresso-store, ecommerce, payment-gateway, worldpay
---


title: Updated Version Wygwam for EE 1

text:
# Question
Title: Updated Version Wygwam for EE 1
I'm working on a site on EE 1, and need to update an old (2.0.4) version to a newer version, b/c theres some problem in IE. Is there anyway I can access EE 1 versions of Wygwam?

# Answer
> 1 votes
I would recommend you contact Pixel and Tonic directly. They have a reputation for being responsive.

---
Tags: pixelandtonic, wygwam, ee1
---


# Question
Title: Solspace TAG - How to get an URL to tagged entry
I'm running EE 2.7.3 and Tag 4.2.5, and I have tagged entries (products in my case). My stack is how to get URL to “product details” page of tagged product?

For an example I will tag Product#1 from category#1 and subcategory#1, then I will tag Product#2 from category#1 and subcategory#2 and next Product#3 from category#2 and sunbcategory#3. As return URL I suspect to get something like:

```
 Product#1: http://www.domain.com/category#1/subcategory#1/product#1
 Product#2: http://www.domain.com/category#1/subcategory#2/product#2
 Product#3: http://www.domain.com/category#2/subcategory#3/product#3

```

I have currently one channel for products and appropriate template groups for each category/subcategory.

Any clue how to get URLs to work? Should I use in that case Low Seg2Cat or GWcode Categories to get proper URLs based on {url\_title} of tagged product?

Thanks

# Answer
I have got my problem resolved by using GWCode Categories add-on.

Final code:

```
{exp:tag:entries channel="products" tag="{segment_2}" status="open" dynamic="no"}
  <a href="{site_url}{exp:gwcode_categories entry_id="{entry_id}" last_only="yes" style="linear"}{complete_path}{/exp:gwcode_categories}/{url_title}">
     <h3>{title}</h3>
  </a>
{/exp:tag:entries}

```

where `{segment_2}` is a tag name with which product was tagged.
> 0 votes

---
Tags: solspace, url, entries, url-title, solspace-tag
---


title: Why do I get a Captcha Error?

text:
# Question
Title: Why do I get a Captcha Error?
I recently upgraded a client site from 2.5.5 to 2.6.1 and upgraded Freeform to version 4.0.12 in the process the Captcha on all the freeform contact forms generates an error even after careful entry:

> You must submit the word that appears in the image

I contacted Solspace and they could not replicate the problem or help me fix it, so I am looking for something I may have overlooked.

Here is the code I am using:

```
<p>For security, please enter in the word you see.</p>
<p>{freeform:captcha}</p>
<p><input style="border-color:#ccc;" type="text" name="captcha" size="18" class="text_input" /></p>

```

I checked the path to the Captcha images and the folder permissions are set to 777. It is required of logged in members.

Is there anything else I may have overlooked in this?

Thanks!

P.S. Here is the link to the Solspace forum on this topic: http://www.solspace.com/forums/viewthread/17083/. It is marked as resolved, but the problem still exists. They just ran out of ideas.

# Answer
> 1 votes
Did you update Freeform to latest version aswell? Current is 4.0.12.

# Answer
> 1 votes
I found this problem with composer created forms with "Require CAPTCHA with logged-in members?" set to "No". When I attempt to fill in the form when logged in creates this error. EE 2.7.3 Freeform Pro 4.1.3

# Answer
> 0 votes
perhaps over your allowed diskspace on the account?

we had this with a site recently and it turned out the automated backups were maxing out the server space and caused the generated captcha not to work.

# Answer
> 0 votes
Can you share the Solspace forum link where you asked them the question, so we can see what steps have already been taken?

Can you update your original post with the Freefom version you're using.

# Answer
> 0 votes
It looks like this was addressed in version 4.1.4 update. See: http://www.solspace.com/docs/freeform/change\_log/#v4.1.4

"Updated documentation regarding 'require\_captcha' parameter and logged in members. Freeform cannot override the EE 'Require Member Captcha' preference when set to 'No'."

... and ...

"Fixed a bug where Captcha was being required for logged in members even with the EE 'Require Member Captcha' preference set to 'No'."

---
Tags: solspace-freeform
---


title: nested if statements - a better way

text:
# Question
Title: nested if statements - a better way
I have nested if statement for template selection - seems a bit cumbersome is there a better way?

```
{if member_group == 5 }
            {if last_segment == "edit" }
              {embed="mypassport/personal-profile-edit}
              {if:else}
               {embed="mypassport/personal-profile-view}
            {/if}

          {if:elseif member_group ==  6}
          {if last_segment == "edit" }
              {embed="mypassport/business-profile-edit}
              {if:else}
              {embed="mypassport/businessprofileview}
            {/if}
      {/if}

```

# Answer
You're trying to use variables parsed at two different parsing stages on your code.

If there wasn't need to check `member_group`, you could use this:

```
{embed='mypassport/{if last_segment == "edit" }personal-profile-edit{if:else}personal-profile-view{/if}'}

```

But you can't because, while `last_segment` is parsed at stage 5, `member_group`is parsed at stage 26, even after the embed templates. So all the embeds are being parsed all the times and then being discarded.

Let's try to improve it a little bit. **Be aware that you can't to enable page caching on this or members of different groups will see each others info.**

```
{exp:switchee variable = "global:member_group" parse="inward"}
    {case value="5"}
        {embed='mypassport/{if last_segment == "edit" }personal-profile-edit{if:else}personal-profile-view{/if}'}
    {/case}
    {case value="6"}
        {embed='mypassport/{if last_segment == "edit" }business-profile-edit{if:else}business-profile-view{/if}'}
    {/case}
{/exp:switchee}

```

If `member_group` wasn't a global variable, which needs the `global` prefix to be parsed early, we could test for both variables at once.

---

This is an interesting idea. I gonna suggest it to the developer of switchee, Mark Croxton.
> 0 votes

# Answer
It's certainly going to be more resource heavy that way, to be sure. One thing that could definitely help would be to use the early parsing conditional add-ons, switchee and ifelse to evaluate the conditionals. Your outer condition is a good spot for switch case logic, while your interior could use ifelse:

```
{exp:switchee variable="{member_group}" parse="inward"}
  {case value="5"}
     {exp:ifelse parse="inward"}
       {if last_segment == "edit" }
          {embed="mypassport/personal-profile-edit}
       {if:else}
          {embed="mypassport/personal-profile-view}
       {/if}
     {/exp:ifelse}
  {/case}
  {case value="6"}
       {if last_segment == "edit" }
          {embed="mypassport/business-profile-edit}
       {if:else}
          {embed="mypassport/businessprofileview}
       {/if}
  {/case}
{/exp:switchee}

```

Another alternative would be to combine some of your conditionals. Rather than evaluate the member group as a wrapper and then have conditionals inside them - since they appear to exist in exclusion of one another - you could do something like:

```
  {if member_group == "5" AND last_segment == "edit"}
      {embed="mypassport/personal-profile-edit}
  {if:elseif member_group == "5" and last_segment != "edit"}
      {embed="mypassport/personal-profile-view}
  {if:elseif member_group == "6" AND last_segment == "edit"}
      {embed="mypassport/business-profile-edit}
  {if:elseif member_group == "6" AND last_segment != "edit"}
      {embed="mypassport/businessprofileview}
  {if:else}
  {/if}

```

But I might still recommend using the ifelse add-on to ensure the conditional parses as early and efficiently as possible. Also, if you can get away without an embed and use a snippet instead, I'd recommend doing so - another efficiency gain to be realized if that's an option for you.

Hope that helps.
> 1 votes

# Answer
I'll demonstrate the Resource Router way of handling this.

```
$config['resource_router'] = array(
    'mypassport' => function ($router) {
        switch(ee()->session->userdata('group_id'))
        {
            case 5:
                $router->setTemplate('mypassport/personal-profile-view');
                break;
            case 6:
                $router->setTemplate('mypassport/business-profile-view');
                break;
            default:
                $router->redirect('login');
        }
    },
    'mypassport/edit' => function ($router) {
        switch(ee()->session->userdata('group_id'))
        {
            case 5:
                $router->setTemplate('mypassport/personal-profile-edit');
                break;
            case 6:
                $router->setTemplate('mypassport/business-profile-edit');
                break;
            default:
                $router->redirect('login');
        }
    },
);

```
> 0 votes

# Answer
If your last segment is either "edit" or "view" it would be best to do this:

```
  {if member_group == "5"}
      {embed="mypassport/personal-profile-{last_segment}"}
  {if:elseif member_group == "6"}
      {embed="mypassport/business-profile-{last_segment}"}
  {if:else}
      No results template
  {/if}

```
> 0 votes

---
Tags: templates, ifelse, nesting
---


title: How to Hack the Core for Longer Titles?

text:
# Question
Title: How to Hack the Core for Longer Titles?
My client needs longer titles/URL titles/Structure url titles, but there is no add-on available with this specific functionality. I already know about these add-ons, but they don't do what I need. A support request with Title Master is already filed, it extends titles in Structure, but the `url_title` is still cut-off at the shorter length, all three components needed to be extended.

So I need to hack the core, but I'm not sure which files I need to modify. So far, I've found these 2 files:

* /system/expressionengine/controllers/cp/content\_publish.php, lines 2279 & 2291
* /system/expressionengine/third-party/structure/tab.structure.php, line 156

Those files seem to update the "maxlength" parameter on the HTML for the 3 title input fields.

And I've found these database tables:

* exp\_channel\_titles \> title
* exp\_channel\_titles \> url\_title
* exp\_structure\_listings \> uri

So I think I just need to change a few more files, but I don't know where they are:

* Javascript file that controls the URL Title auto-fill on the publish page.
* Javascript file that controls the *Structure* URL Title auto-fill on the publish page.
* Structure Page URL database column.

Does anybody know where these are, and possibly what line number I need to edit? Am I forgetting anything? Thanks.

# Answer
*Note: The Title Master add-on should take care of all of this, but if you can't use that for whatever reason, here is the procedure for the hack:*

*Update 10/10/14: Title Master appears to be abandonware at this point.*

This works as of EE 2.9

**Always back up your files and database before hacking the core!**

## Native EE Titles & URL Titles

* `/system/expressionengine/controllers/cp/content_publish.php`:

```
$deft_fields = array(
    'title'         => array(
        /* ... */
        'field_maxl'            => 100 // update to desired max title length
    ),
    'url_title'     => array(
        /* ... */
        'field_maxl'            => 75 // update to desired max url title length
    ),

    /* ... */

```

This updates the `maxlength` attribute on the input fields so you can type longer titles/URL titles.
* `/system/expressionengine/libraries/Api.php`:

```
$url_title = substr($url_title, 0, 75); // update to desired max url title length

/* ... */

if (strlen($url_title) > 70) // update to desired max url title length minus 5
{
    $url_title = substr($url_title, 0, 70); // update to desired max url title length minus 5

/* ... */

if (strlen($url_title.$url_title_suffix) > 75) // update to desired max url title length

```

This updates the function that actually publishes the entry to the database to allow a longer URL title.
* `/themes/javascript/compressed/jquery/plugins/ee_url_title.js`:

Near the end of the code, find `.val(a.substring(0,75))` and update "75" to your desired URL title length. This allows the URL title to autofill to the correct length.
* Go into the database and update the length of the following columns:

+ `exp_channel_titles.title`
    + `exp_channel_titles.url_title`

This will allow your longer titles to be stored correctly in the database columns.

## Structure URL Titles

* `/system/expressionengine/third_party/structure/tab.structure.php`, inside the `publish_tabs()` method, in the "Field: Page URI/Slug" section:

```
$settings[] = array(
    /* ... */
    'field_maxl'            => 100, // update to your desired max url title length

    /* ... */

```

This updates the `maxlength` attribute in the input field.
* Update the length of this database column:

+ `exp_structure_listings.uri`

This allows for longer URL titles on Structure listing-type entries. Page-type entry URL titles are encrypted and stored in the `exp_sites` table, and I do not believe you need to make any modifications there for longer URL titles to work.

## Document, Document, Document!

Be sure to document the changes you made so they don't get overwritten when you update EE. It's also just the professional thing to do. If you leave the project and another developer has to take your place and figure out what you did, good documentation will keep them from cursing your black soul. I recommend Focus Lab's Dev Docs module.
> 11 votes

# Answer
I've had the need to do this a number of times, particularly on sites that have press releases. For some reason, press release titles can be insanely long. This is all we ever have to do:

In **system/expressionengine/controllers/cp/content\_publish.php**, appx line 2279, change this to what you desire:

```
'title' => array(
  ...
  'field_maxl' => 255
),

```

If you need to alter the URL title too, look for the same thing in the url\_title array below it, around line 2292:

```
'url_title' => array(
  ...
  'field_maxl' => 75
),

```

The only other thing we do is alter the database column in exp\_channel\_titles accordingly.

Unless I'm missing something, that's all we've ever needed to do. As for updating this to work on Structure titles, I'm sure the method is similar, but I don't use Structure very often so I can't really speak to it. Sounds like you're on the right path with where you're looking. I'm not sure why you would need to alter any of the JavaScript around the title fields.

As always, you should document your core hacks, no matter how simple they are.
> 11 votes

# Answer
I'm not certain why Title Master would be insufficient for your needs. It handles increasing title length, url\_title length, and works with Structure. Maybe if you state what it doesn't do that you need, that could help in identifying an alternative.

Otherwise, if you're going to hack, I think you've hit all the main spots, obviously making sure the database will handle the new size is also necessary, but it looks like you've got that covered. We hacked once for a client, in EE1, but the areas were similar, except no Structure.
> 5 votes

# Answer
I ran into the need for longer titles (eg. scientific paper titles), and (shameless plug) Zenbu Studio's Kyara module did the trick. Structure url titles are not supported as of this writing, however.
> 1 votes

# Answer
This plugin doesn't support Structure i don't think, but it still works for making titles longer. http://devot-ee.com/add-ons/mx-title-control. The Title Master plugin looks to be no longer supported.

Just adding this info for future searchers.
> 1 votes

---
Tags: database, structure, url-title, title, core-hacks
---


# Question
Title: Solspace Tag - display entries from particular tag
I have a snippet which displays all entries within a channel and I want to have displayed entries only from a particular tag, but I'm not able to display tagged entries. Then I have decided to display all tagged entries without limitation (code below) but this is not working either.

```
{exp:channel:entries channel="products" orderby="title" sort="asc" limit="8" status="open" paginate="bottom" dynamic="no"}
{exp:tag:related_entries}
    {if switchee_no_results}
            <div class="no-entries"><p>No entries yet.</p></div>
        {/if}

        <div class="col-md-3 col-sm-6 category-item">
            <a href="{site_url}{segment_1}/{segment_2}/{url_title}">
    {product_image limit="1"}
            <img src="{product_image:image}" alt="{product_image:title}" class="img-responsive">
    {/product_image}
            <h3>{title}</h3>
            </a>
        </div>

{switch='|||</div><div class="row row-category">'}

    {paginate}
    {exp:stash:set}

      {stash:pagination_links}{pagination_links}{/stash:pagination_links}

    {/exp:stash:set}
    {/paginate}

{/exp:tag:related_entries}
{/exp:channel:entries}

```

Even switching code to

```
{exp:tag:related_entries channel="products" orderby="title" sort="asc" limit="8" paginate="bottom"}
<h3>{title}</h3>
{tag_paginate}
    <p>Page {tag_current_page} of {tag_total_pages}. {tag_pagination_links}</p>
{/tag_paginate}
{/exp:tag:related_entries}

```

doesn't do anything.

Another simple test - template below

```
   1.
        {exp:tag:entries tag="test"}
    2.
        {if switchee_no_results}
            <div class="no-entries"><p>No entries yet.</p></div>
            {/if}

        <h3>{title}</h3>
    3.
    {/exp:tag:entries}

```

is displaying only 1. for me, so it looks like `tag` tag is not working withing templates.

Any clue why is not working? I'm running EE 2.7.3 and Tag 4.2.5

Thanks

# Answer
The solution was to use `{exp:tag:entries}` to display entries associated with a tag, but also make sure the status of those entries are set to "open", and if they aren't use the `status="some_other_status"` parameter.
> 1 votes

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


# Question
Title: Is there a non backend/control-panel solution to changing email or password?
Does ExpressionEngine have a native way to change the email or password of the current user using a form in a template?

I am aware that you can do it in the EE Control Panel Backend but I am looking for a solution that will work in a frontend template.

NOTE: About the password, I am not talking about the password lost/reset feature. I am aware of that solution. I am looking specifically to be able to change passwords on the spot rather than relying on that feature.

# Answer
> 1 votes
There's a boat load of options:

FreeMember: http://devot-ee.com/add-ons/freemember

Stand Alone Member Edit: http://devot-ee.com/add-ons/stand-alone-member-edit

OR find some paid for modules: http://devot-ee.com/search/results?keywords=member&addon\_version\_support=ee2

# Answer
> 0 votes
I don't *think* that you **need** to use add-ons. Just take the markup of the password reset form and rework it to fit in with what you need.

Creating the initial form is simple enough. For instance (markup straight from the form with the {XID\_HASH} tag used.

```
<form action="admin.php?S=0&D=cp&C=login&M=send_reset_token" method="post">

    <input type="hidden" name="XID" value="{XID_HASH}" />

    <dl>
        <dt>Submit your email address:</dt>
        <dd><input type="text" name="email" value="" style="width:100%" size="35" dir="ltr" id="email" maxlength="80" autocomplete="off"  /></dd>
    </dl>

    <p><input type="submit" name="submit" value="Submit" class="submit" /> <span><a href="admin.php?S=0&D=cp&C=login">Return to login</a></span></p>

</form>

```

I'm not sure if you can specify a redirect to display a custom page once this form is submitted. I'm sure I've done it in the past and had the full login/password reset system as custom templates.

However, as mentioned, there are a few add-ons to handle all this anyway and, at least in the case of Freemember (and possibly others), they're free and easy to use so why reinvent the wheel?

---
Tags: email, password
---


# Question
Title: Show entries that are parents of two specific children
I'm trying to generate a list of entries that share two specific, common children. I have the entry\_id's of the children, but Playa's template tags don't seem to have a way to display parents that share the same children. I found the plugin "Multiplaya" (https://github.com/croxton/Multiplaya) that seemed to fit the bill but it did not work for me.

The following gives me a list of parents of entry\_id "26" **OR** "39", whereas I need parents of entry\_ids "26" **AND** "39":

```
{exp:playa:parents entry_id="26|39" orderby="title" sort="asc"}
...
{/exp:playa:parents}

```

# Answer
You're looking for the co-parent tag. Here's the code for your specific case:

```
{exp:playa:coparents child_id="26|39" orderby="title" sort="asc"}
    ...
{/exp:playa:coparents}

```
> 1 votes

---
Tags: playa
---


# Question
Title: Expressionengine Custom forms fails with Jquery Validate plugin
I have two forms that are almost exact that I’m validating with jquery validate plugin. One form works https://www.anticipateinvitations.com/index.php/contact while the other https://www.anticipateinvitations.com/index.php/how doesn’t work. Both forms are using the same validate method

```
$('.contact-form').each(function() {  // attach to all form elements on page
        $(this).validate({       // initialize plugin on each form
            // global options for plugin

        rules: {
            fname: "required",
            ptime: "required",
            email: {
                required: true,
                email: true
            },
            captcha: {
                        required: true,
                        captcha: true
                    }
        },
        messages: {
            fname: "Please enter your name",
            ptime: "Select a preferred time",
            email: {
                required: "Please provide an email address",
                email: "Please enter a valid email address"
            },
            captcha: {
                required: "Give an answer to the sum"
            }
        }

        });
    });

```

Initially I was getting invalid input error on the form that doesn’t work until I added `<input type="hidden" name="XID" value="{XID_HASH}">` after searching around for a solution. Now the form just reloads the page after submission and the validation plugin does not fire.

The forms have different IDs so that I can handle submission differently. All custom JS is in one file. I had tried separating the validate using the IDs which didn't work. Jquery is present on page since on firebug I can play around with the DOM elements but it feels like there is no javascript on the second form since even the calendar on that page does not working which works on the form that is ok, Im running EE 2.7.2 secure forms submission is on.

Any help please?

# Answer
> 1 votes
Works now after some clean up, I guess there were some other JS codes conflicting, all validate code still remains the same.

# Answer
> 0 votes
Normally this line...

```
$('.contact-form').each(function()

```

would be specific to the ID of the form that will be validated. I'm assuming that both of these forms have a class of 'contact-form'? If they're both on separate web pages then I guess that would work. But I prefer to have a specific ID for each form and then call the validation on that specific ID. Does that present any solutions?

# Answer
> 0 votes
I had this issue too. Can't tell you what I did, but mine works!

Here is my JS:

http://codepen.io/anon/pen/GFhDC/

---
Tags: jquery
---


# Question
Title: Why does Channel Images cache directory create itself as owner/group 99/99
I have just installed a new EE site and the cache directory Channel Images creates is being set to Owner/Group 99/99. (/public\_html/system/expressionengine/cache/channel\_images)

When I try to upload a pic it gives me the error "**The Local Temp dir is either not writable or does not exist**".
When I try to import the image it will create the entry directory (/public\_html/pictures/articles/1) but the image will not be created.

Also have Updater and Monitor from Devotee installed on same site and it works fine. This is not happening on any another site I created on the same server just to test this out.

**Details:**
Server -- VPS running WHM/cPanel (CENTOS 6.5 x86\_64 / WHM 11.42.0 (build 22), 77GB free disk space)
Cache dir permission -- 755 (this is normal for a cPanel server and works for all other sites)
EE -- 2.8.1
Channel Images -- 5.4.15
Field test output --
PHP Safe Mode (OFF): Passed
Is Dir: Passed
Is Readable: Passed
Is Writable: Passed
Create Test File: Passed
Delete Test File: Passed
Create Test DIR: Passed
Rename Test DIR: Passed
Delete Test DIR: Passed

I have tried all options in other topics (except manually changing owner/group using ssh as root) and nothing works. Re-installed Channel Images and it still creates the cache directory as Owner/Group 99/99.

Screenshots:

Note: This is also posted in DevDemon forum as topic https://www.devdemon.com/forums/viewthread/2692/

# Answer
> 0 votes
RESOLVED: **It was a bug in the Channel Images 5.4.15 build** in relation to cache directory creation and EE 2.8.
I got a new version of the build from DevDemon and all was fine.

---
Tags: channel-images
---


# Question
Title: Redirect from URL containing member_id to username
Just wondering if there is a way to redirect vistors from a URL that contains member ids to a url that contains the username.

I originally had member pages set up like so... `members/profile/{member_id}/` for a range of profile pages. I have since changed this to `members/profile/{username}/` and I was wondering if there is a way to redirect a visors to the new URL if they were to attempt to visit a url with a member id still in it.

I tried

```
{if segment_3 != username}
  {redirect="members/profile/{username}/"}
{/if}

```

and

```
{if segment_3 == member_id}
  {redirect="members/profile/{username}/"}
{/if}

```

but neither has an effect. (The 'profile' pages are running within Switchee, so I'm not sure if thats having an effect at all?)

# Answer
Shorn I have tested this and it works great. However because of the way the {redirect} variable works you cant use {username} in the redirect variable because it will blow up the URL so I have accomplished what you are needing with a little bit of php:

1.) In the CPanel go to Design\>Template Preferences and click on the desired template group and template you are needing this functionality on on the top left of the screen. Then allow PHP yes, and let the PHP parse on the input stage.

2.) Add this code to your template.

```
<?php
    $uname = ee()->session->userdata('username');
?>
{if username != "{segment_3}"}
    {redirect='members/profile/<?php echo $uname; ?>'}
{/if}

```
> 1 votes

# Answer
Hmm, that seems like it should work. Have you tried either of the following?

```
{if '{segment_3}' == '{member_id}'}
   {redirect="members/profile/{username}/"}
{/if}

```

or

```
{if '{segment_3}' == '{logged_in_member_id}'}
   {redirect="members/profile/{logged_in_username}/"}
{/if}

```
> 0 votes

# Answer
If you're using switchee, it might just be a matter of setting up a case specifically to check for member ID's, rather than using an if-check.

Member IDs are only numberic, where usernames have regular letters (and generally not numbers)

Try something along these lines:

```
{exp:switchee variable="{segment_3}" parse="inward"}
{case value="#^\d{1,99}$#"}
  {exp:member:custom_profile_data member_id="{segment_3}"}
  {redirect="members/profile/{username}/"}
  {/exp:member:custom_profile_data}
{/case}

{case value="" default="Yes"}
  Your regular template goes here.
{/case}
{/exp:switchee}

```

You're going to want to check my case value's regex - that's meant to check that the value is a number (and only a number).
> 0 votes

---
Tags: members, redirects, username
---


# Question
Title: Zoo Visitor / Not Functioning Properly /
I've used Zoo Visitor 1.3.30 without problems on a EE 2.5.5 build but I'm having all kinds of problems with "nothing happening" when using any of the forms. I'm assuming I'm just missing something simple (at least that's what I'm hoping for!) but for the life of me I can't figure it out :(

All of the troubleshooting checks out fine:

As well as the Installation part of things:

I tried using Structure to setup my templates (that's what I did with the 2.5.5 build) and forms wouldn't submit so I copied over the entire Zoo Visitor Example templates (to it's own template group) and those wouldn't update either.

You can see them both in action here:

http://acs.planetmediaserver.com/profile http://acs.planetmediaserver.com/zoo\_visitor\_example

I even turned off everything that I could in the Member Preferences section:

What else could I try to check?

**UPDATE**

Here's what my registration form looks like and again it's just a copy of what Zoo gives you:

```
{exp:zoo_visitor:registration_form return='profile/register/success'}

<h3>Register</h3>
<fieldset>
    <h4>Extra fields</h4>

    <p>
        <label for="member_firstname">{label:member_firstname}:</label>
        <input type="text" name="member_firstname" id="member_firstname" value="{if member_firstname}{member_firstname}{/if}"/>
    </p>

    <p>
        <label for="member_lastname">{label:member_lastname}:</label>
        <input type="text" name="member_lastname" id="member_lastname" value="{if member_lastname}{member_lastname}{/if}"/>
    </p>

    <p>
        <label for="member_gender">{label:member_gender}</label>
        {options:member_gender}
        <input type="radio" id="member_gender" name="member_gender" value="{option_value}" {checked} />{option_value}
        {/options:member_gender}
    </p>

    <p>
        <label for="member_address">{label:member_birthday}</label>
        <input type="text" name="member_birthday" id="member_birthday" value="{member_birthday}" maxlength="23" size="25"/>
    </p>
</fieldset>
<br/>
<fieldset>
    <legend>Native member field</legend>
    <p>Mative member fields like location, url, signature, etc... can be handled by creating a channel field with the same name prefixed with "_member"
        For example member_signature will sync to the signature field. Custom member fields can be handled in the same way. Just create a channel field prefixed with "member_" and the value
        will also be saved to the profile.</p>

    <p>
        <label for="member_signature">Native member signature</label>
        <input type="text" name="member_signature" id="member_signature" value="{if member_signature}{member_signature}{/if}"/>
    </p>

</fieldset>

<fieldset>
    <h4>Login details</h4>

    <p>
        <label for="username">Email*:</label>
        <input type="text" name="email" id="email" value="{if email}{email}{/if}"/>
        <br/>(this will be your login/username if 'use email as username' has been set)
    </p>

    <p>
        <label for="password">Password*:</label>
        <input type="password" name="password" id="password" value="{if password}{password}{/if}"/>
    </p>

    <p>
        <label for="password_confirm">Confirm password*:</label>
        <input type="password" name="password_confirm" id="password_confirm" value="{if password_confirm}{password_confirm}{/if}"/>
    </p>

    <p>
        <label for="terms_of_service">Terms of service:</label>
        <textarea name='terms' rows='4' readonly>All messages posted at this site express the views of the author, and do not necessarily reflect the views of the owners and administrators
            of this site.By registering at this site you agree not to post any messages that are obscene, vulgar, slanderous, hateful, threatening, or that violate any laws. We will
            permanently ban all users who do so.We reserve the right to remove, edit, or move any messages for any reason.</textarea>
    </p>

    <p>
        <label for="accept_terms">Accept terms of service?*</label>
        <input type='checkbox' name='accept_terms' value='y' {if accept_terms == "y"}checked="checked"{/if} />
    </p>

    {if captcha}
    <p>
        <label for="captcha">{lang:captcha}*</label>
        {captcha}<br/>
        <input type="text" id="captcha" name="captcha" value="" size="20" maxlength="20" style="width:140px;"/>
    </p>
    {/if}
</fieldset>
<p>
    <input type="submit" value="Register" class="form-submit"/>
</p>
<p>* Required fields</p>

{/exp:zoo_visitor:registration_form}

```

Thanks again for all of the help recently!

# Answer
It turns out it was an .htaccess problem. Which is strange to me because I have the same .htaccess for other sites. But I suppose this thing happens from time to time. Time to re-evaluate what I'm doing in my htaccess file :)

Nico at EE Zoo is amazing! Great way to start the day :D
> 1 votes

# Answer
It would be good to see the template code you are using.

Whilst the Addon may appear to be working for you on the site, it is highly likely that it is incompatible with that version.

Read upwards of the improvements and in particular to File upload, authorisation methods and Safecracker changes:

http://ellislab.com/expressionengine/user-guide/about/changelog.html#version-2-5-5

The updates made for Zoo Visitor accomodate some serious changes, in particular the past few major point releases of EE. These notes explain the updates but are not dated for release:

http://ee-zoo.com/docs/visitor/release\_notes.html

I would suggest you try an earlier version of Zoo Visitor and see if the issue is replicated. You may need to call out on Twitter for assistance in getting an outdated version as there is no repository available publicly.
> 2 votes

---
Tags: zoo-visitor
---


# Question
Title: WYSIWYG editor/upload functionality strange behaviour (after changing host)
I am running EE 2.1.4 and I needed to make a copy of the website on a new domain (my localhost) for some development. A strange thing happens with the wyvern editor. If I leave (from general configuration) the themes folder and path from the live site, the WYSIWYG editor works ok. If i add my local themes path/folder, the editor gets visibiliy:hidden from a \*.js file ckeditor and I can see the editor and the toolbar.

Also the upload functionality for a new entry is not doing anything. No upload popup appears except this error in console "Cannot call method 'dialog' of undefined" in some EE js file.

Did you had this problem before ? I saw that in ckeditor.js line 160 it’s a condition if (!a.editor). That is affecting my editor… Don’t know how to fix this.

Thanks

# Answer
First thing you need to do is upgrade EE, Wyvern, and CKeditor. Sounds like you're using really old versions, which I don't support.
> 1 votes

---
Tags: wysiwyg, hosting, textarea, wyvern
---


title: Relationships Not Displaying in Grid

text:
# Question
Title: Relationships Not Displaying in Grid
I've got a project where I need to display several sales reps dependent upon their location. I've decided to display that data with relationships within a grid. The entire set up is like this:

**Channel** \- Rep Locator {rep\_locator}

**Grid** \- Rep Grid {rep\_grid}

**Grid Fields**

*Text Input* \- Location {location} | *Relationship* \- Sales Rep {sales\_rep}

**Relationship Channel**

Has a title {title}, Office Number {office\_number}, and Email {email\_address}.

---

I can get the Location just fine, it also loops out the correct amount of relationship entries, but it does not display the title, office number or anything else.

My code is set up as

```
{exp:channel:entries channel="rep_locator" dynamic="no" disable="members|categories|pagination"}
{rep_grid}
     <div class="region" data-query="{rep_grid:location}">
        <h2>{rep_grid:location}</h2>
        {rep_grid:sales_rep}
            <span class="individual-rep">
             <h3>{rep_grid:sales_rep:title}</h3>
        </span>
        {rep_grid:sales_rep}
     </div>
{/rep_grid}
{/exp:channel:entries}

```

# Answer
From they code that you posed, you are not closing your {rep\_grid:sales\_rep} tag:

```
    {rep_grid:sales_rep}
        <span class="individual-rep">
            <h3>{rep_grid:sales_rep:title}</h3>
        </span>
    {/rep_grid:sales_rep}

```
> 1 votes

---
Tags: relationships, grid
---


# Question
Title: datagrab moving from one site to another
I am trying to move the data from one site to another, I can import from datagrab but what is the best (quickest) way to get the data out of the site? CSV or feed - is there a way to auto generate these?

# Answer
> 0 votes
There are a couple of addons that may help, http://devot-ee.com/add-ons/ajw-export and http://devot-ee.com/add-ons/export-it

I sometimes create a template to output data in CSV format, load up the template page then save the page as .csv ready for importing with Datagrab. This works fine for simpler data sets.

---
Tags: datagrab, export, csv
---


# Question
Title: Create Forms Dynamically on Channel Entry
So basically I am creating an RSVP for a site. I would like to allow the client to just make a simple entry for an event (Name, Date, Description). I would then like to have each entry page have a version of the same RSVP form which is tailored for that event.

I was thinking of making hidden fields that would pass the name and date to the form, but if possible I would like to have Freeform track the entries separately by event. Is it possible for Freeforms to create a new 'Form' to track this data in upon the creation of an entry in a Channel?

# Answer
You can use a form inside a channel entries tag, and pass entry variables into the form as hidden fields, eg, if you have a Freeform field called "event\_name":

```
{exp:channel:entries channel="events}
<h1>{title}</h1>
{description}

  <form>
  <input type="hidden" name="event_name" value="{title}">
  ...
  </form>

{/exp:channel:entries}

```

Freeform will then store the event's entry Title in it's event\_name field so you can track and filter submissions.
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: How to upload photo, edit it with Aviary and then submit through a front-end form?
I'm not an experienced user and would like to make something complicated: I'd like to use aviary editor to edit photo's on form submit. I need a form where user's can upload their image, edit it with aviary and submit it. Aviary provides a temporary link to the new edited image, I want this edited image to not be sent to the server until the whole form is submitted. How should i go about doing this?

I had hoped to pass the url into the input file path.

How can i do it?

should be something similar to http://freeonlinephotoeditor.org with submit instead download

Thanks

# Answer
Have a look at @objectivehtml's extremely powerful Photo Frame add-on. There is also a demo of it running on the front end. To get the same number of editing options, you may also need his companion Photo Frame Button Pack. There are several other packs for the add-on, for things like focus, text, filters, etc.
> 2 votes

# Answer
Unless you'd like to roll your own module, try this module $25 which uses avairy: http://devot-ee.com/add-ons/image-editor
> 1 votes

---
Tags: file-uploads, custom-fields, forms, image, image-path
---


title: what does it means: {embed:entry_id}?

text:
# Question
Title: what does it means: {embed:entry_id}?
I would like to know about the usage of `{embed:entry_id}`.

It is used in case an `entry_id` is inside an embedded template?

There are other usages?

# Answer
Example 1:

In some cases {embed:entry\_id} would be most useful by passing an entry\_id from the parent template into the embeded one's entries tag pair entry\_id parameter to just return the results of the given entry\_id.

```
{exp:channel:entries channel="your_channel" entry_id="{embed:entry_id}"}
     Just the entry that was passed from the parent template.
{/exp:channel:entries}

```

Example 2:

In some cases you might want to pass multiple entry\_ids into the entry\_id parameter. Some might use an channel loop to output #|#|#|#|# into the the {embed:entry\_id} variable. That would display multiple entries in the child template.

```
{exp:channel:entries channel="your_channel" entry_id="#|#|#|#|#"}
     Just the entry that was passed from the parent template.
{/exp:channel:entries}

```
> 2 votes

# Answer
In simple terms, that is how you call up the value of a variable declared within an embed tag. So for example, if in your "main" template, you insert an embedded template called sidebar:

```
{embed="embeds/sidebar" the_passed_value="hello"}

```

Then in the embedded template itself, you could have:

```
I would like to say {embed:the_passed_value}.

```

Which would render as:

```
I would like to say hello.

```

And so as you see, it is a way to declare a variable within the embed code, passing its value to the embedded template for use there.
> 2 votes

---
Tags: embeds, entryid
---


title: Prevent Duplicates From The CP

text:
# Question
Title: Prevent Duplicates From The CP
Is it possible to prevent duplicate entries from being entered in? Ttrying to see how to prevent a duplicate from the CP. Any idea?

# Answer
The only thing I know of in the CPanel is as follows is located at: Admin ‣ Security and Privacy ‣ Security and Sessions \> denial of duplicate data

However this is mainly for comments and spam protection. I don't believe there is a CPanel setting that denies duplicate channels to be submitted.
> 1 votes

---
Tags: channel-entries
---


title: Ajax commenting solution

text:
# Question
Title: Ajax commenting solution
Has anyone successfully wrote any scripts for ajax commenting in expression engine? I can't find any documentation that supports it for this style of commenting. Ellis Lab seem to have documentation for AJAX editing comments. Below you can see my basic tags. Any Ideas guys?

```
{exp:comment:form channel="thischannel" entry_id="{entry_id}" dynamic="no" }
                                                                        <form id="review_submit">
                                                                        <div id="name_it">
                                                                            <label>Name</label>
                                                                            <input type="text" name="myname" id="myname" placeholder="myname"/>
                                                                        </div>

                                                                </div>
                                                                <div class="review_text">
                                                                    <label>Review</label>
                                                                    <textarea id="mycomment" name="comment" cols="70" rows="2"></textarea>
                                                                    <input type="submit" value="Submit Review" class="back_button" id="tryme">
                                                                </div>
                                                            </form>
                                                            {/exp:comment:form}

```

# Answer
I usually do all of my AJAX form submissions with the jquery ajax form plugin. This allows you to customize the experience for your users here is the link to the plugin its very simple to implement.

http://malsup.com/jquery/form/

Hope this helps!
> 2 votes

---
Tags: channel-entries, ajax, comments, dynamic, comment-form
---


# Question
Title: How automatically be logged in to both the Control Panel and front-end at the same time?
If user logged in to front-end, is it possible to auto logged in to Control Panel ?

How automatically be logged in to both the Control Panel and front-end at the same time ?

Thanks

# Answer
> 2 votes
This is what happens anyway (at least with Super Admin accounts). Maybe the more recent versions of EE introduce an extra level of security but I just tested this on a site running 2.6.1 and logging in on the front end also allowed me to access the CP without having to log in again.

# Answer
> 0 votes
If you don't appear to be check that your base URLs match - IE you aren't logged in at a "www." URL and viewing at a non-www url. Or vice-versa.

---
Tags: members, control-panel, login, users
---


title: XID issues with back button and reload

text:
# Question
Title: XID issues with back button and reload
Running 2.7.3 with secure forms, everything works fine passing the xid\_hash etc... until somebody clicks the back button or tries to reload after submitting a form.

It's the usual issue of it trying to reuse the same xid, but I can't refresh the xid as they're just clicking back.

I notice in the 2.8 changelog developers section it's deprecated a load of xid functions, do we know if this somehow fixes this?

# Answer
We have an add-on for this that is very simple to use and will allow you to put a plugin tag under your form {exp:formrefresher} and if that template is loaded via the back button it will refresh the page, and will refresh your form with a new XID to remove the users frustration on repeated form submissions with errors do to expired XID.

Form Refresher -\> https://devot-ee.com/add-ons/form-refresher
> 1 votes

---
Tags: xid
---


title: Relationship in expression engine?

text:
# Question
Title: Relationship in expression engine?
I have one channel called E. I have another channel called B.

I am trying to get my head around relationship in ee.

fields in channel E

1. title
2. url\_title
3. e\_name
4. e\_description

fields in channel B

1. title
2. url\_title
3. e\_tag\_b(relate to event e\_name or title)
4. b\_url

What I am getting in my last\_segment is a url\_title of channel E.Only this as my resource I want to get all the entries for channel B.

I read this doc,but i found it too confusing.

What I am doing :

```
{exp:channel:entries channel="B" }

    <h3>{e_tag_b:title}</h3>
    <p>{e_tag_b:b_url}</p>

{/exp:channel:entries}

```

I get consfused about what to loop when and which tag is to be related where.Any help?

# Answer
It looks like you've forgotten to include your relationship field tag. Try this?

```
{exp:channel:entries channel="B" }

    {e_tag_b}
        <h3>{e_tag_b:title}</h3>
        <p>{e_tag_b:b_url}</p>
    {/e_tag_b}

{/exp:channel:entries}

```
> 1 votes

# Answer
Not sure I understand the question well but here is my take on it:

* Start with a `url_title` in your last segment
* Find the entry in channel E corresponding to that `url_title`
* Several entries in channel B are potentially related to that entry using the `e_tag_b` field. Following EE terminology, those entries are the "parents" of the entry in channel B
* Get the titles of those "parents" entries.

Let's try this

```
{exp:channel:entries channel="E" url_title="{last_segment}" limit="1" require_entry="yes"}

    <h1>{title}</h1>

    <p>Related (parents) entries:</p>

    {parents channel="B" field="e_tag_b"}
        {if parents:count == 1}<ul>{/if}
            <li>{parents:title}</a></li>
        {if parents:count == parents:total_results}</ul>{/if}
    {/parents}

{/exp:channel:entries}

```
> 1 votes

---
Tags: ee2, relationships, related-entries
---


# Question
Title: If {there is no image} OR {if there is no expert} then use a certain image
Here in this code I am finding a feed expert and then producing his avatar. Conditions are needed to control the conditions of this avatar output. So this is what must happen:

* firstly if there is a expert in the channel entry then use his avatar BUT (here is where the if statement comes in)
* if you choose an expert *who does not have an image in the images channel* then show this default image OR if you DO NOT choose an expert then also show the default image.

How do I do this? See code:

```
    {if "{feed_expert:total_children}" > 0}
    {exp:playa:children field="feed_expert" entry_id="{entry_id}"}
    <div class="col-sm-4 col-xs-7">
    <div class="feed-expert">
    {exp:channel_images:images entry_id="{entry_id}" field_id="185" limit="1"}
    {if image:no_images}<img src="/httpdocs/static/img/sihlouette.jpg" class="img-responsive">{/if}
<img src="{image:url}" class="img-responsive"/>
{/exp:channel_images:images}                                                </div>
 </div>
{/exp:playa:children}
{/if}

```

# Answer
> 0 votes
Sounds like you just need an else statement

```
{if "{feed_expert:total_children}" > 0} {!-- If expert is selected --}
   {exp:playa:children field="feed_expert" entry_id="{entry_id}"}
     <div class="col-sm-4 col-xs-7">
        <div class="feed-expert">
        {exp:channel_images:images entry_id="{entry_id}" field_id="185" limit="1"}
           {if image:no_images} {!-- Output default image --}
              <img src="/httpdocs/static/img/sihlouette.jpg" class="img-responsive">
           {/if}
           <img src="{image:url}" class="img-responsive"/>
        {/exp:channel_images:images}
        </div>
     </div>
   {/exp:playa:children}
{if:else} {!-- If no experts are selected output default image--}
   <div class="col-sm-4 col-xs-7">
     <div class="feed-expert">
        <img src="/httpdocs/static/img/sihlouette.jpg" class="img-responsive">
     </div>
   </div>
{/if}

```

---
Tags: playa, conditionals, channel-images
---


# Question
Title: Solspace Freeform email notifications coming from "unknown sender"
I'm using Freeform 4.1.4 (the free version) w/ EE 2.8.1.

I have a form with a first name field ({name\_first}), a last name field ({name\_last}), and an email field ({email}) field, all of which are required. When I created the form's notification, I configured the "From Name" field to use "{name\_first} {name\_last}" and "From Email" to use "{email}".

In the past, this has always worked: the email notifications used the user-submitted values for the sender info.

However, on this site, the email notifications arrive *but* they come from "unknown sender" (according to Gmail). Everything else about the notifications is fine -- e.g., the message comes through intact -- but the sender info is missing.

On a whim, I tried hardcoding the notification's "From Name" and "From Email" fields so they weren't using user-submitted values, but that didn't fix anything. And I've checked the EE installation's email settings, which are the defaults (AFAIK). Nothing seems out of the ordinary there.

Am I missing something? Did something change in notifications with the new version of Freeform?

# Answer
This is a bug in Freeform 4.1.4 and 4.1.5. This will be fixed in Freeform 4.1.6 which we are working on now.

If you'd like to patch it yourself in the meantime, in:

```
./system/expressionengine/third_party/freeform/libraries/Freeform_notifications.php

```

around line 484, change:

```
$this->variables['from_email']      = $from_name;

```

to:

```
$this->variables['from_email']      = $from_email;

```
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Switchable display order for playa field items
I'm trying to arrange it so that the output order of a Playa field can be controlled by a global variable or radio button channel field (to make it able to be toggled from the listed order to random) but having no success.

When I try using a global variable (**carousel-order**) with the value set to "random" like this:

```
{exp:playa:children field="home_carousel" orderby="{carousel-order}"}
```

It doesn't seem to recognize the global variable. I've also tried using radio buttons to make the switch, like so:

```
{if carousel_order && carousel_order == "Random"}
    {exp:playa:children field="home_carousel" orderby="random"}
{if:else}
    {exp:playa:children field="home_carousel"}
{/if}

```

Which actually gives me a parse/syntax error:
**Parse error: syntax error, unexpected T\_ENDIF in /data/home/rsitka/projects/rsdevwww/system/expressionengine/libraries/Functions.php(679) : eval()'d code on line 241**

I've read things like there may be an issue with the order things are parsed but surely someone has needed to do this at some point and run into this issue? Anyone found any workarounds or maybe I'm just missing something obvious?

Thanks!

# Answer
> 0 votes
Have you tried using a snippet instead? Snippets parse before global variables.

You might also want to download this PDF from Low about the parsing order as I always find it handy when dealing with those issues:

http://loweblog.com/downloads/ee-parse-order.pdf

---
Tags: playa, variable, orderby
---


# Question
Title: EE Members Group + Expresso Store and CP "Store" button issue
I have created new Members Group with following privileges:

```
- Can access the control panel
- Can access CONTENT section
- Can access CONTENT: Publish
- Can access CONTENT: Edit
- Can access CONTENT: File Manager
- Can access ADD-ONS: Modules
- Can post and edit entries in: Products
- Can access module: Store

```

but I'm not able to see "Store" button in the control panel

I'm running EE 2.7.3 and Store 2.2

Thanks

# Answer
> 1 votes
It looks like I forgot to enable `Can access ADD-ONS section`

Mea culpa

---
Tags: expresso-store
---


# Question
Title: Insert Low Variables Between Channel Entries
On the home page of a site I am displaying a series of articles. In between each of these articles I wish to display a banner ad controlled via Low Variables.

At the moment it repeats the first ad between each channel entry instead of correctly looping through the banner ads.

Here is what I have so far:

```
{exp:channel:entries channel="articles" limit="14" disable="categories|category-fields|member-data"}

<article>
<p>{article_subtitle}</p>
<h1><a href="{title_permalink='articles/view'}">{title}</a></h1>
<figure><a href="{title_permalink='articles/view'}">
{article_images cover_only="yes"}
<img src="{image:url:large}" alt="{image:title}" />
{/article_images}
</a></figure>
<p>Lorem Ipsum</p>
<a href="{title_permalink='articles/view'}">Further reading +</a>
</article>

{exp:low_variables:parse var="banner_ads" multiple="yes" limit="1"}
<div class="banner-ad">
<a href="{banner_ads_link}"><img src="{banner_ads_image_desktop}" /></a>
</div>
{/exp:low_variables:parse}

{/exp:channel:entries}

```

Any thoughts?

# Answer
You might be able to do this with the help of Math:

```
{exp:low_variables:parse
    var="banner_ads"
    offset="{exp:math formula='{count}-1'}"
    limit="1"
    parse="inward"
}

```
> 2 votes

---
Tags: channel-entries, low-variables
---


# Question
Title: Member of the group and managing categories
I have create new members group (EE 2.7.3) and have enabled there

* Can edit and add new categories
* Can delete categories

but when member of that group is trying to add/edit category it says `You are not authorized to access this page`

Any clue?

Thanks

# Answer
I have found that useful:

http://ellislab.com/forums/viewthread/216317/#999955

> In the Category group settings Admin\>Channel admin\>Categories does the member group have permissions there?
> 1 votes

---
Tags: categories, members
---


# Question
Title: After updating EE from 1.6.8 to 2.7.3 Playa won't update the exp_playa_relationships table
I've successfully updated ExpressionEngine to 2.7.3 but after I try to install the updated version of Playa (4.4.5) I continually get this error:

> Fatal error: Maximum execution time of 30 seconds exceeded in /system/third\_party/playa/ft.playa.php on line 314

I've tried increasing the max\_execution\_time to a longer duration of time, reimporting the database and running again but same error.

It looks like all of my entries are still intact in the exp\_relationships table, they just aren't getting moved into the exp\_playa\_relationships table.

The exp\_relationships table has 93,553 rows in the table.

# Answer
There was a line set\_time\_limit(30) in /system/third\_party/playa/ft.playa.php that was overriding the set\_time\_limit I had set in MAMPs PHP settings. The line was:

> set\_time\_limit(30)

After increasing the default from (30) Playa was able to update the old table to the new exp\_playa\_relationships table.
> 0 votes

---
Tags: playa, pixelandtonic, ee2-upgrades, updating
---


# Question
Title: How to change 200 ok status of 404 error page in expressionengine?
I have my custom 404 page in expression-engine but is display 200 ok status so i want to set 404 status on console can you please help me

Thank you.

# Answer
> 1 votes
I'm using the HTTP Header add-on for this: http://devot-ee.com/add-ons/http-header

---
Tags: ee
---


# Question
Title: custom field not blank conditional issue
I've created the following conditional which is displaying 0 content:

```
{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if oldnotes != "" }
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

```

I know there are a couple hundred entries with this field so I'm wondering what is wrong. It is just a text area field.

# Answer
> 1 votes
```
{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if "{oldnotes}" != "" }
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

```

That should give you the results you need, or you could use this method.

```
{exp:channel:entries channel="patterns" orderby="title" status="pending|camera-ready|closed|open"}
{if oldnotes}
{if:else}
    <ul>
    <li>{title}</li>
    </ul>
{/if}
{/exp:channel:entries}

```

I would also suggest you try to use

```
{if no_results}
   <p>Hello World</p>
{/if}

```

To test your entries tag is returning results.

---
Tags: conditionals, textarea
---


# Question
Title: P&T Field Pack and Matrix with EE version 2.8.1 errors
I upgraded a site to EE 2.8.1 and updated to the latest Field Pack and noticed the EE Control Panel really buggy and slow and have found errors in the log files from the server:

PHP Fatal error: require() \[function.require\]: Failed opening required '/home/.../public\_html/sys/expressionengine/third\_party/pt\_field\_pack/pt\_fieldtype.php' (include\_path='.:/opt/alt/php53/usr/share/pear:/opt/alt/php53/usr/share/php') in /home/abwac1/public\_html/systm/expressionengine/third\_party/\_pt\_dropdown/ft.pt\_dropdown.php on line 6

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 Unknown on line 0

PHP Fatal error: require\_once() \[function.require\]: Failed opening required '/home/.../public\_html/sys/expressionengine/third\_party/pt\_switch/config.php' (include\_path='.:/opt/alt/php53/usr/share/pear:/opt/alt/php53/usr/share/php') in /home/.../public\_html/sys/expressionengine/third\_party/\_pt\_switch/ft.pt\_switch.php on line 4

PHP Fatal error: Class 'Matrix\_ft' not found in /home/.../public\_html/sys/expressionengine/libraries/api/Api\_channel\_fields.php on line 365

Anyone else getting something similar? would love to know of a fix or if this has been reported and ready for updating.

# Answer
You'll want to upgrade Fieldpack to 2.1.1 (make sure to read installation notes!)
> 1 votes

# Answer
I removed the associated files from the MySQL database manually and deleted files from the server completely. Reinstalled Fieldpack fresh and it worked again.

Be sure to remove both System and Themes files beforehand.
> 0 votes

---
Tags: matrix, pixelandtonic, switch, pt-dropdown
---


title: Grid not displaying all the rows

text:
# Question
Title: Grid not displaying all the rows
Anybody knows why Grid only displays the first 100 rows. I have a grid with 267 rows in control panel, but when I pulled the grid in my templates, it only shows 100 rows. Does anybody knows why?

# Answer
> 3 votes
I don't have enough Grid data to test this BUT it sounds very much like you are running into the 100 record limit that EE adds automatically to channel entries if you don't specifiy a limit.

Try setting a high value for the limit="" parameter, like 500 or so and see if that fixes it. It could be that without that parameter EE limits it to 100 automatically.

---
Tags: grid
---


title: Playa Just Stopped Working

text:
# Question
Title: Playa Just Stopped Working
A client has just emailed and none of the playa fields are working on the front end templates. No changes have been made to the EE or plugin setup to cause the issue. The site has been up and running for 12 months.

EE is 2.5.5 Playa 4.3.3

For example

```
<ul class="quicklinks">
 {exp:playa:children field="page_quicklinks" limit="7"}
<li><a href="{exp:structure:entries}{quicklink_url}{/exp:structure:entries}">{title}</a></li>
 {/exp:playa:children}
</ul>

```

Outputs

```
<ul class="quicklinks">
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
<li><a href="">Express Orthodontics</a></li>
</ul>

```

"Express Orthodontics" is the current page title not the playa item title

Any advice would be greatly appreciated.

# Answer
> 2 votes
Sounds like the var\_prefix parameter is your friend in this case!

---
Tags: playa
---


# Question
Title: Showing Channel Image gallery IF there's more than 1 images?
How to show a channel image gallery if there is more than 1 images inside?

```
{exp:channel:entries channel="journal" limit="1" url_title="{segment_3}" disable="categories|member_data|pagination|trackbacks" cache="yes" refresh="512640"}

{if image:total > 1}

<div class="mini-page-wrapper responsive-image bg-accent-darkest offset-parent">
{exp:channel_images:images entry_id="{entry_id}" limit="1" field="journal_images"}
    <!-- ..code for my image gallery.. -->
{/exp:channel_images:images}
</div>

{/if}

{/exp:channel:entries}

```

the conditional global variable {if image:total \> 1} should be placed after {exp:channel\_images} but i need to hide the parent div class too.. so..

# Answer
dear Jessica D'Amico, thank you for your reply but I got it working just with embedding template technique:

```
{exp:channel:entries channel="journal" limit="1" url_title="{segment_3}" disable="categories|member_data|pagination|trackbacks" cache="yes" refresh="512640"}
{exp:channel_images:images entry_id="{entry_id}" field="journal_images"}
    {if "{image:total}" > 1}
        {if "{image:total}" == "{image:count}"}
                {embed="moyseion:journal/_slideshow-em" entry_id="{entry_id}"}
        {/if}
    {/if}
{/exp:channel_images:images}
{/exp:channel:entries}

```

and this is my embed template:

```
<!--altre foto-->
<div class="mini-page-wrapper" data-role="story-part" id="part-2">
  <section class="mini-page mini-page-semicompact">
    <header class="block-stack">
      <p class="block-right buttons-compact mobile-sm-1col mobile-sm-stack-compact">
    <a data-role="prev-section" href="#part-intro" class="button-like button-icon button-up bg-accent-darker">
      Previous</a>
    <a data-role="next-section" href="#comments" class="button-like button-icon button-down bg-accent-darker">
      Next</a>
      </p>
      <h1 class="three-fourths-page h2-like mobile-sm-1col mobile-sm-stack-compact">Altre foto:</h1>
    </header>
  </section>
  <div data-role="slideshow-em" class="slideshow-em offset-parent margin-bottom-1x">

<nav data-role="slideshow-em-prev" class="slideshow-em-nav corner-top-left fit-container-left high hidden">
  <button class="slideshow-em-button button-icon button-prev bg-accent-darker">Previous</button>
</nav>
<nav data-role="slideshow-em-next" class="slideshow-em-nav corner-top-right fit-container-right high hidden">
  <button class="slideshow-em-button button-icon button-next bg-accent-darker">Next</button>
</nav>

<ul data-role="slideshow-em-tray slideshow-lazy" data-set-url="" class="slideshow-em-tray reset-list offset-parent clearfix">
{exp:channel_images:images entry_id="{embed:entry_id}" field="journal_images"}

    <li data-role="slideshow-em-slide" class="slideshow-em-slide">
      <figure>

      <div data-role="open-lightbox-image"
            data-title="{title}"
            data-src="{pre_proxy}{image:url:journal}{post_proxy}"
            class="{image:switch='media-wrapper link-like bg-placeholder bg-loader|link-like media-wrapper moblg-col moblg-1-2 mobl-sm-hide bg-loader|link-like media-wrapper moblg-col moblg-1-2 mobl-sm-hide bg-loader'}">

{exp:ce_img:pair src="{image:url:journal}" width="220" height="220" crop="yes" cache_dir="/WebStatic/s3/Blog/" hide_relative_path="yes" hash_filename="yes"}
     <img class="full-width responsive-image bg-placeholder"
     data-role="lazy-image"
     data-lazy-image-animate="true"
     src="data:image/gif;base64,R0lGODlhCgAKAIAAAP///wAAACH5BAEAAAAALAAAAAAKAAoAAAIIhI+py+0PYysAOw=="
     alt="{if image:description}{image:description}{if:else}{title}{/if}"
     data-lazy-image-url="{aws_url}"
 />
{/exp:ce_img:pair}
      </div>
        {if image:description}
        <figcaption class="slideshow-em-caption">
          <a data-role="open-lightbox-image" data-src="{pre_proxy}{image:url:journal}{post_proxy}">{image:description}</a>
        </figcaption>
        {/if}
      </figure>
    </li>
{/exp:channel_images:images}
</ul>

  </div>
</div>
<!--altre foto fine-->

```
> 0 votes

# Answer
I have a solution below for you so what I have done is test 3 things

1.) If there is more than 1 image do the gallery code only displaying the div html if the gallery exists so the first time it outputs the opening div the last image in the loop outputs the closing div.

2.) If there is only 1 image I have you a space to do other code.

3.) If there aren't any images i gave you a space for code.

Hope this helps!

```
       {exp:channel:entries channel="journal" limit="1" url_title="{segment_3}" disable="categories|member_data|pagination|trackbacks" cache="yes" refresh="512640"}
            {exp:channel_images:images entry_id="{entry_id}" limit="1" field="journal_images"}
                {if "{image:total}" > 1}
                   {if "{image:count}¶" == "1"}
                     <div class="mini-page-wrapper responsive-image bg-accent-darkest offset-parent">
                  {/if}
                       <!-- ..code for my image gallery.. -->
                  {if "{image:total}" == "{image:count}"}
                     </div>
                  {/if}
               {if:elseif "{image:total}" == "1"}
                     <!-- Code displayed for only a single image -- >
               {/if}
               {if image:no_images}
                    <!-- Code displayed for no image results
               {/if}
           {/exp:channel_images:images}
        {/exp:channel:entries}

```
> 1 votes

# Answer
Are you saying you want to conditionally hide the parent div based on the total count, in addition to showing specific gallery code if count \> 1?

If so, can you move the div within the channel images tag and use the conditional twice - first to add a class to hide said div and second to show specific gallery code? Not entirely sure what you're after here.
> 0 votes

---
Tags: conditionals, channel-images, advanced-conditionals
---


title: GRID template syntac

text:
# Question
Title: GRID template syntac
having some problems with a GRID field type in my templates. I have an entrie setup with the grid field type containing three records.

```
{exp:channel:entries limit="1"}
    {body_image}
        COUNT1 | {body_image:count}
        COUNT2 | {count}
        FILE1 | {body_image:file}
        FILE2 | {file}
    {/body_image}
{/exp:channel:entries}

```

As expected the {count} outputs 1 since this is the channel:entries count. The weird thing is i'd expect the {body\_image:count} would output 1,2 and 3. But it's output is empty. This is also the case for {body\_image:file}. The {file} tag does output the link to the images I added.

Could someone explain this since this is the exact syntax used in the documentation?

# Answer
> 1 votes
Might help to check if your really using the GRID field\_type and not the MATRIX by accident.

Stupid mistake, but it solved my issue.

---
Tags: templates, grid, syntax
---


# Question
Title: Expresso Store and Drag and drop upload form during checkout
I need to allow users to upload their own files during a checkout process.

I think Freform Pro should be fine but I don't know how to integrate it inside the checkout page. Should be nice to associate this file as custom order field for Expresso Store.

my goal is to handle the upload process in ajax and render the uploaded image file in the same page.. the scenario should be something similar to:

User chose the t-shirt model and size \> add to cart \> upload own image \> preview the image stamp on the t-shirt \> purchase it!.

someone have any idea?

Thank you!

# Answer
> 2 votes
You will need to upload the images separately from the checkout. I suggest using a channel entry form or as you mentioned, solspace freeform.

After you get your customer to upload an image, you need to remember which image they wanted printed on their tshirt (for example customer may have more than one image uploaded). The easiest way to do this is to get the ID (or URL) of the uploaded image and store it with an order.

To store the image with an order, you can either use an order custom field (e.g. order\_custom1), or you can use a product modifier (just use a text modifier, and a hidden field to set it). If you use the order custom field, you can only have one per order (so customer can not order two tshirts in the same order), but this might not be an issue if customers can only order one tshirt at a time anyway.

---
Tags: expresso-store, solspace-freeform, file-uploads, custom-fields, checkout
---