title: Dead Man Switch

text:
# Question
Title: Dead Man Switch
Maybe a better name for an add-on would be good. But I was thinking recently after a near life ending medical condition. What would happen once I’m gone to my personal website and my journals?

I have since made sure I have a detailed manual for keeping my site up, and how to. But I was also thinking about my yet to be posted stuff. This was an easy fix just place entry date in future and do not use any future entries on public pages.

My journals and un-posted ideas could just end in a pile of recycling. But within this someone else may get inspiration. While alive I would not want these to be posted.

So this is what I would like to do.

• Able to set a whole channel as “off”, and still have listed in all my templates, just won’t render any thing

• Per entry set to single member (currently available add-on) for letters to friends and loved ones.

• Daily verification emails to see if I’m still around, if no reply a second level of verifications, then if no reply the hidden channel becomes active.

• A 3rd level could be emails to friends and family to verify

Sounds kind off sick, but I have way more art and ideas done up than what’s on my personal site, and I would hate to see that disappear. Just think of it as a Digital Will for EE, WillEE

So far my best solution I can do is a CRON job that would replace a few templates with ones that would also include the hidden channels to be rendered.

Thanks Mike

# Answer
OK, I'll kick this one off...

Firstly you will need a trigger to tell the site you're dead. How to do this is the hardest part! Possibly you have to log in once a week to verify, but ultimately you'll need some failsafe's in place otherwise you risk worrying friends and relatives with your premature news.

Either a Extension utilising a Session hook that runs upon each view of your site then does a check to see if you've been about, or a cron job that calls an ACTion URL (so triggering a module to do the pulse checks).

You could then have a database table, custom user field or update the config file to set a global variable. Obviously if you've gone down the custom database table route, you'll need an additional extension/module/plugin that either pulls that information or sets a global variable to be used in any template.

For your channel "off" scenario, you just have conditionals, whereby your normal news/blog would utilise channel="X", and then either via a parent embed passing it or a simple conditional utilising the global variable, you add the death channel to the parameter, e.g.

`channel="1{if dead}|2{/if}"` or `channel="{if dead}2{if:else}1{/if}"`

...or if passing via an embed:

```
{embed=blog/listing channelParam='channel="{if dead}2{if:else}1{/if}"'}

```

Regarding: "Per entry set to single member", I'm not sure which add-on you're referring to, but you could do this simply, by assigning the individual to receive the message as the author of the entry. Then when `{if dead}` display all entries by the current logged in member (if no message for that member, nothing is displayed).

If they already have access to the EE Control Panel, you can hide the entries or channels using this add-on http://devot-ee.com/add-ons/entry-access.

"Daily verification emails", touched on already above, but the easiest method would be to utilise the last visited status of your account and if you haven't been about for a couple of days, then raise the warning flag. As mentioned, either a cron triggering an ACT url and module, or an extension triggered by the session hook (only works if you have a popular site!). Your extension or module could then trigger an email to get you to login into the site. Or if you want to be lazy, you could have a hidden template URL that triggers the email for you: http://devot-ee.com/add-ons/email-from-template.

The 3rd tier of rigor mortis verification would be the same email trigger as above, possibly after the time check has triggered again but after a longer period of time. The difference being that you'd need to get the relative/friend to click on a link (ACTion URL again) that either confirmed you'd popped your clogs, or your heart was still beating.

Granted the 3rd level of checks may counter this, but the biggest problem would be false trigger due to prolonged time away from the internet, or what if there was a problem with your host going down for a period of time, coming back up, and all the triggers firing at once due to the time delay.

RIP.
> 1 votes

---
Tags: switch
---


title: Zoo Visitor Registration Error

text:
# Question
Title: Zoo Visitor Registration Error
I'm using Zoo Visitor and when a user tries to register, they get this error:

> You must be a logged-in member of this site in order to perform this action.

I'm not sure what is causing it...?

Here is my registration form...

```
{exp:zoo_visitor:registration_form class="form form-validate" return="account/register/success"}
<ul>
    <li class="required">
        <label>First Name</label>
        <input type="text" name="cf_member_first_name" value="">
    </li>
    <li class="required">
        <label>Surname</label>
        <input type="text" name="cf_member_surname" value="">
    </li>
    <li class="required">
        <label>Email</label>
        <input type="email" name="email" value="">
    </li>
    <li class="required">
        <label>Password</label>
        <input type="password" name="password" value="">
    </li>
    <li>
        By clicking Register, you agree to our Terms & Conditions and that you have read our Privacy Policy, including our Cookie Use.
        <input type="hidden" name="cf_member_terms" value="Yes">
        <input type="hidden" name="cf_member_emails_admin" value="Yes">
    </li>
    <li>
        <input type="submit" name="submit" value="Register →">
    </li>
</ul>
{/exp:zoo_visitor:registration_form}

```

# Answer
Go to Add-ons --\> Modules --\> Zoo Visitor --\> Troubleshooting, it should be there.

\[edit\]:

In Add-ons --\> Modules --\> SafeCracker, always check to see if anonymous registrations are allowed.
> 3 votes

# Answer
Are you sure that user is already logged into the CP when they try to register via the Zoo Visitor form on the front-end?

Make sure you are logged out of the CP, or better yet try another browser to complete the registration.
> 0 votes

---
Tags: members, error, zoo-visitor, register
---


title: Displaying Products By Category

text:
# Question
Title: Displaying Products By Category
On the Store index page it will show all products and then there is a simple category menu so you can filter down by the 5 categories.

What is the best way to do this?

I was initially just going to use Javascript and filter by the class/category name of each div/product while still on the index page, however using the actual category URL should provide SEO benefits so would prefer to go this route.

However I'm unsure how to get it working. The below code works in the sense that it lists the categories and beneath it lists all the products, however when you click to go to a '/store/index/category' URL, the page still shows all the products. I'm unsure where to go from here. Obviosuly I need to wrap the exp:store tags in the exp:channel:categories tags but when I do it starts listing out multiple products like crazy. Documentation on the Exp:resso Store site isn't that thorough.

```
{exp:channel:categories channel="store"}
   <a href="{path='store/index/{category_url_title}'}">{category_name}</a><br>
{/exp:channel:categories}

{exp:store:search orderby="title" sort="asc"}
 {exp:store:product entry_id="{entry_id}"}

   <div class="product-item {categories}{category_url_title}{/categories}">
     <a href="{url_title_path='store/product'}">
      {store_images limit="1"}
       <img src="{product_image}" alt="{title}">
      {/store_images}
      <h2>{title}</h2>
      {if on_sale}
       <s class="pre-sale-price">{regular_price}</s>
       <span class="price">{price}</span>
      {if:else}
       <span class="price">{price}</span>
      {/if}
    </a>
   </div>

 {/exp:store:product}
{/exp:store:search}

```

# Answer
Edit: Hopefully this matches what you describe more closely...

Low Seg2Cat will help you out. http://gotolow.com/addons/low-seg2cat/docs

Ditch the `{exp:store:search}` tag.

```
{if "{last_segment_category_id}" == ""}
    {!--   List categories   --}
    {exp:channel:categories channel="store"}
       <a href="/store/{category_url_title}">{category_name}</a><br>
    {/exp:channel:categories}
{/if}

{!--   List either all products or specified category   --}
{exp:channel:entries
                channel="store"
                dynamic="no"
                limit="30"
                paginate="both"
                disable="member_data"
                category="{last_segment_category_id}"}

{!--   Only show the category title on the first loop through (so it's at the top) - and only if a category is specified in the URL   --}
{if "{count}" == 1 && "{last_segment_category_id}" != ""}
  {categories limit="1"}<a href="/store/{category_url_title}">{category_name}</a><br>{/categories}
{/if}

  {exp:store:product entry_id="{entry_id}"}
   <div class="product-item {categories limit="1"}{category_url_title}{/categories}">
     <a href="/store/product/{url_title}">
      {store_images limit="1"}
       <img src="{product_image}" alt="{title}">
      {/store_images}
      <h2>{title}</h2>
      {if on_sale}
       <s class="pre-sale-price">{regular_price}</s>
       <span class="price">{price}</span>
      {if:else}
       <span class="price">{price}</span>
      {/if}
    </a>
   </div>
 {/exp:store:product}

{/exp:channel:entries}

```

Alternatively use this as the category parameter:

```
category="{segment_category_ids_piped}"

```

Remove the `{if "{last_segment_category_id}" == ""}` conditional around the categories listing if you want this to appear on every screen.

If you want pagination, make sure you look at the settings for low seg2cat as there's an option that will ensure that the pagination segment is ignored.

Also, assuming your template group is "store" and you're using the index template, you can just use this as your URL:

```
<a href="/store/{category_url_title}">

```

Instead of:

```
<a href="{path='store/index/{category_url_title}'}">{category_name}</a>

```

Which is a lot cleaner and simpler :)

Please note I've also changed your product URL to: `<a href="/store/product/{url_title}">`
> 2 votes

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


# Question
Title: Safecracker How to clone entry after update to EE2.6.1
Before updating to latest EE version 2.6.1, setting title and url-title to new values + setting hidden input field with name "entry\_id" to '' on a safecracker edit entry form would generate a clone. Now instead the new entry simply overwrites the original one. What else is needed?

Being able to clone entries is a huge time saver, so I would really appreciate an answer on where to look to get this working again.

# Answer
Here's my workaround answer for post EE 2.6.1, not ideal, but seems to be working:

Embed the info from the entry you want to duplicate as a form within the parent SafeCracker page. Something like:

```
-----
PARENT
-----

{exp:safecracker channel="my_channel"}

    {embed="my_tpl_group/my_form" copy_from_entry_id="123"}

    <p>
        <button id="form_submit" type="submit" class="">Duplicate Program</button>
    </p>

{/exp:safecracker}

-----
EMBED
-----

{exp:channel:entries channel="my_channel" entry_id="{embed:copy_from_entry_id}" }

    {!-- Output the pre-filled form of the entry you are wanting to duplicate --}
    <p>
        <label for="program_number">program_number</label>
        <input type="text" name="program_number" id="program_number" value="{if program_number}{program_number}{/if}">
    </p>

    <input type="hidden" name="program_start_date" id="program_start_date" value="{if program_start_date}{program_start_date format='%F %d, %Y'}{/if}">

    .....etc.....

{/exp:channel:entries}

```
> 1 votes

---
Tags: safecracker, upgrade
---


# Question
Title: Runaway memory usage on 2 of 3 servers - strange situation
I have a client site that was updated to ee2 (2.5.0) about 15 months ago. Its at http://www.smart-publications.com. The host both after and before that upgrade is yourhost.com. Everything worked fine. I updated them to 2.6.1, and updated all the add-ons that needed an update, about 10 days ago. Deployed the updates and within 15 minutes the server came down due to runaway memory usage. After working with the host and trying a few more times, no change.

We run a Rackspace cloud sites server for some client hosting, so I setup a site there and deployed the files. Using the testing URL that Rackspace provides, the site seemed fine. I opened the site in 8 tabs with auto reload on and the memory didn't go nuts. So I pointed the A record to this server for the time being and that is where the site is running now.

I figured that Yourhost may not have servers optimized for EE so I recommended to the client setting up a VPS on Liquidweb, which I used for years with EE1 and 2 sites before Rackspace. We did that, and I deployed the site there and, using a spare domain name I own, set the site up for that. Opening several tabs with the auto reload running sent the memory on the server out of control.

I thought maybe it was a 2.6.1 issue, or one of the add ons that I had updated, so I blew away the site and redeployed it using the original 2.5.0 version before I had done any of the upgrades. Same problem.

Can anyone help be figure out what the hell is going on? I've never seen anything like this.

# Answer
> 1 votes
After much rolling back, redeploying, branching, merging, and banging my head, looks like it was something to do with the FocusLab portable configuration setup. I set this up locally on the site after I FTP'd it down from the host but before I made my first GIT commit, so a full rollback and deploy didn't undo this part of the system.

Note, we use FocusLab portable configuration on many sites, and it works perfectly. I don't know how yet, but I screwed up its implementation when retrofitting it to the site as part the upgrade project. The site is currently running well with a standard EE config, and I'll find where my error was over the next few days and reimplement it correctly.

---
Tags: server, memory
---


# Question
Title: channel entries to include their respective categories in the title permalink
My channel entries do not include their respective categories in the title permalink.

How do I get each entries link to include the category in the url?

so my {title\_permalink='showroom'} would end up being: showroom/category/cat\_url\_title/entry\_title

```
{exp:channel:category_archive channel="portfolio" style="linear"}
<div id="glance">
    {categories}
          <div class="skim-me">
        <ul>
    {exp:channel:entries channel="portfolio" limit="99" sort="asc" status="not Closed" category="{category_id}"}
    {portfolio_images}
     <li><a href="{title_permalink='showroom'}">{exp:ce_img:pair src="{cell_2}" width="300" height="200" crop="yes"}<img src="{made}" alt="" width="{width}" height="{height}" alt="{title}"/>{/exp:ce_img:pair}</a></li>
    {/portfolio_images}
    {/exp:channel:entries}

        </ul>
    </div> <!--end skim-me-->
    <br style="clear:both;" /><br />
     <h2><a href="{path='showroom'}">{category_name}</a></h2>
    <br /><br /><br />
    {/categories}
      </div><!--end GLANCE-->

    {/exp:channel:category_archive}

```

# Answer
Yes you can do that, but have to drop the reliance on {title\_permalink} or {path}.

Your showroom/index template would catch both the listing and details pages, alternatively you can introduce additional elements to separate listing and details, for example:

`/showroom/{cat_url_title}` would use the index template

`/showroom/details/{cat_url_title}/{url_title}` would use a template called "details".

Your category URL would be:

```
<a href="/showroom/{cat_url_title}">{category_name}</a>

```

And your product URL would be:

```
<a href="/showroom/details/{cat_url_title}/{url_title}">

```

Your details page would use this channel:entries tag:

```
{exp:channel:entries channel="portfolio" status="not Closed"
    url_title="{segment_4}"
    dynamic="no"
    require_entry="yes"}
    {if no_results}...{/if}

```

http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#url-title

If you don't have the categories\_archive tag, you'll need to include the categories variable pair to render out {cat\_url\_title}.

For your listing page, utilise Low Seg2Cat is one of the easiest options. http://gotolow.com/addons/low-seg2cat/docs

And your channel:entries tag for a specific category listing page could look like this (no category\_archive tag):

```
{exp:channel:entries channel="portfolio" status="not Closed"
    category="{last_segment_category_id}"
    dynamic="no"
    limit="99"
    paginate="both" }
    {if no_results}...{/if}

```

Obviously if you want to use the category\_archive tag and list out all the categories and their entries, then that wouldn't require the category in the URL, but the above should give you enough to start you off or play with to create what you want.

This question touches on a similar listing structure: Displaying Products By Category
> 2 votes

# Answer
By default that's not the way that ExpressionEngine handles single entry pages or categories. It's an either/or. So if you had a single entry page then the URL would be:

```
http://domain.com/template_group/template/entry_title

```

For categories you can construct a category archive by using a category *trigger*. In this case 'category':

```
http://domain.com/template_group/template/category/category_name

```

This would list all the entries which are linked to that category.

By default there isn't a way to mix and match the two unless you use something like Freebie to tell EE to ignore certain segments in the URL. In your case you could tell it to ignore the category and category\_name so that it just displays the entry as normal but you'd still have those segments in the URL. It includes the option to "break on category URL indicator" which you'll find useful in this case.
> 0 votes

---
Tags: categories, links, category-archive
---


title: The EE upgrade bug

text:
# Question
Title: The EE upgrade bug
I noticed a bug in EE upgrade process. I upgraded two sites form EE1.6 to EE2.5 and found that when templates are rewritten, some of the templates were set completely BLANK, and some of were edited in a way that very important code i.e. if conditions were removed from the code. How can we resolve this kind of issues? Any ideas.

# Answer
> 0 votes
Probably best you contact Ellislab support with this one. Unless you can replicate the issue and have narrowed it down to some specific templates, there is very little anyone here can probably do to help.

---
Tags: upgrade
---


title: Exp:resso Store: Max Order Quantity

text:
# Question
Title: Exp:resso Store: Max Order Quantity
Is it possible to set a maximum order quantity with Exp:resso Store? The site I'm working on would like to offer free samples. Any help or direction would be greatly appreciated.

# Answer
There's no option to set a maximum quantity in the Store field itself but you could do a check for this in your templates with a little javascript to stop users from adding more than X items to their cart by checking for the quantity field

```
<input type="text" name="item_qty" size="3" value="1" />

```

If it applies to the order as a whole then you can use checking in your templates:

```
{if order_qty > '10'} You are only allowed a maximum of 10 items {/if}

```

I can see that it could be a common use case however.
> 3 votes

# Answer
I had the same situation on a site recently where client was offering samples on a SINGLE product. They needed to limit the samples to a maximum of 2 per order. Depending on how dynamic you need to make it you could do the following:

```
{if url_title == "your-product-name"}
  <label class="field_label">Qty
  <select name="item_qty">
        <option value="1">1</option>
        <option value="2">2</option>
  </select>
{if:else}
 <label class="field_label">Qty <input type="text" name="item_qty" size="3" value="1" class="input_sml" /></label>
{/if}

```
> 2 votes

# Answer
It's now on the feature request page, so feel free to vote this up!

https://exp-resso.com/store/support
> 2 votes

---
Tags: expresso-store
---


# Question
Title: How to display a product image on the checkout page for store
I would like to display an image from the products channel on the checkout page using STORE by Exp:resso.

If I use the normal channesl tag the image display's, but seems to show all products in the channel. If I use limit="1" it only shows the one image.

Many thanks

Graham

# Answer
You will want to have the channels entries loop inside of the cart tags. I am going to use the checkout tag but this would work with the cart and order tags too.

```
{exp:store:cart}
 {items}
  {exp:channel:entries entry_id="{entry_id}" limit="1"}
   {title}
   <img src="{images_custom_field_name_here}" />
  {/exp:channel:entries}
 {/items}
{/exp:store:cart}

```
> 2 votes

# Answer
Thank you for your reply. I also found the answer in the STORE docs and give it a test. I used the code below, which worked fine.

```
{exp:channel:entries entry_id="{entry_id}"}
 <a href="{path='store/detail'}/{url_title}"><img src="{product_image_one}" alt="{title}" height="100" width="100"></a>
{/exp:channel:entries}

```
> 1 votes

---
Tags: expresso-store
---


title: dd-mm-yyyy date format in Control Panel

text:
# Question
Title: dd-mm-yyyy date format in Control Panel
I want to show the date format in european style (dd-mm-yyyy). I changed and configured all settings to European. $config\['default\_site\_timezone'\] = Europe/Amsterdam doesn't solve the problem. Can anyone help me with this? I am running on EE 2.6.1.

# Answer
I posted this as a bug report to Ellis Lab and followed it up with this comment.

I think there is a misunderstanding on the meaning of “European” format.

By default the dates are shown as mm/dd/yy - which is a US centric format. Switching to “European” changes the format to yyyy-mm-dd - this is certainly more european but is actually ISO 8601 format

I think the expectation was for “European” to be simply dd/mm/yy (or dd-mm-yyyy).

The same basic idea as the US format but showing the day before the month.

**UPDATE**

You can set a custom date format for entry listings in the CP by using Zenbu
> 3 votes

# Answer
If it's on the front-end then you can use date variable formatting to output it however you want. To output the dd-mm-yy format you'd just use:

```
{current_time format="%d %m %Y"}

```

The full reference can be found here with some data formatting constants included too.

**EDIT**

For the Control panel go to Admin \> Localisation settings and set **Server Timezone** to your country and **Default Time Formatting** to European. In additon to this also make sure you go to your Member \> My Account \> Localization Settings and set this to European too.

That should see the date formatting change to a European format for your account as well as new accounts.
> 2 votes

---
Tags: date, date-format, datetime
---


# Question
Title: Use Freeform Pro and Safecracker together
Is it possible to construct a form using Freeform/Freeform Pro and submit it using Safecracker? I'm basically just trying to combine the ease of building a form with the ability for it to create a channel entry, with the intention of creating a booking using the rEEservtion add-n.

# Answer
Freeform saves submitted data in its own table, so it's not saved as a channel entry. Depending on how sophisticated you need your form to be, however, I have accomplished what you're looking for thanks to a great post by Low called User generated forms in EE. What Low explains in the article is that with a bit of planning, and ideally with his free Low Freeform Field add-on along with Matrix, you can create forms with channel entries. He only takes it so far in the post - but I can tell you that I have taken it further by hooking in jQuery validation, as well as used the Freeform Templates add-on to make the experience even simpler. If you plan it out and get a bit creative, it can be quite powerful. It will never be the easy drag and drop to create a form system that Freeform Pro, Forms or Proform are, nor can you easily do conditional field triggers, but for straight forward applications, it can put a lot of power in the editor's hands. I'd recommend you read through Low's post and see if you can come up with creative ways to extend his example to possible suit your purpose.

Quick caveat - I haven't tried this approach in a little while so I don't know how recent a version of EE the approach would be compatible with. I don't have any reason to believe it wouldn't work with the latest version of either add-on and EE 2.5.5, but I've certainly never tried it with 2.6.1.
> 1 votes

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


title: Category Name not Updating

text:
# Question
Title: Category Name not Updating
I seem to be having an issue where EE 1.6.8 doesn't seem to like the changes I'm making to the site.

For example. I've changed a category name from 'Contact / Careers' to 'Contact' but on the site it still shows 'Contact / Careers'. I've cleared browser & server cache, as well as EE cache and it's still doing this.

Looking in the DB shows the category is 'Contact' - So i'm a bit stumped as to where this name is still being pulled from.

Another weird thing... Is if I specify what categories to show using the `category="2"` tag, it shows 'Contact'!!!!!

What is going on?!

UPDATE:

```
{assign_variable:weblog="section"}

{embed="includes/head"}

{embed="includes/header"}

{exp:weblog:category_archive weblog="{weblog}" style="linear" show_empty="yes"}

    {categories}

        <h3><span><a href="#" title="{category_name}">{category_name}</a></span></h3>

        <div>

            <div class="tabs{category_id}">
                <ul class="subNav">
                    {exp:weblog:entries weblog="{weblog}" category="{category_id}" sort="asc"}
                        <li><a href="#{url_title}" title="{title}">{title}</a></li>
                    {/exp:weblog:entries}
                </ul>

                {exp:weblog:entries weblog="{weblog}"  category="{category_id}"}
                    <div id="{url_title}" class="col-container">

                        <div class="col2 left">
                            {section-left}
                        </div>

                        <div class="col2 right end">
                            {section-right}
                        </div>

                    </div>

                {/exp:weblog:entries}

            </div>

        </div>
    {/categories}

{/exp:weblog:category_archive}

{embed="includes/footer"}

```

# Answer
> 1 votes
Take a look here... make sure "**Cache Dynamic Section Queries?** " is set to "NO"

You can find this setting here in the CP: **Admin › Section Administration › Global Section Preferences**

---

It's also possible that your EE cache isn't clearing for some reason so I'd suggest FTPing to the server and manually clearing the cache directories.

# Answer
> 0 votes
Jason - Have a look at any .htaccess within the path of your install. This could be re-writting the urls...

# Answer
> 0 votes
Make sure that the Category Name/Category URL Title has no duplicate. For example, if you have the same category name in two different category groups, that might freak it out perhaps?

e.g. if you have a recipe website, say you have a Category Group called Lunch and another called Dinner. Both could have categories called "Soup."

---
Tags: ee1, cache, categories
---


# Question
Title: How to keep paragraphs intact and not converted to line breaks when text pasting from Word in Wygwam
How can I keep paragraphs intact and not converted to line breaks when text pasted from Word in Wygwam?

I am copying and pasting from Word in Wygwam. The text in Word has paragraphs but when pasted into Wygwam field it's converted to line breaks (br tags).

Is there a setting or configuration to allow me keep the return carriages?

Thanks

# Answer
> 1 votes
You should add the icon Paste From Word into your WYGWAM settings it looks like this:

That'll keep basic formatting intact for you. Paste from plain text doesn't keep basic formatting. Paste from Word is handy when you are pasting content from other websites thave inline styles implemented as it removes all of that too!

---
Tags: wygwam, wysiwyg
---


# Question
Title: Modifier information in the Order Information Email template
Is it possible to access the modifier information in an email template?

I want to tell the costumer what they baught, i can tell them the product name but not the modifier

i can tell them this for example:

Hey you baught the cool t-shirt!

but i cannot tell them this:

Hey you baught the cool t-shirt in the color YELLOW!

please help

# Answer
In your email template you can do something along the lines of

```
{items}
Item - {title} - {modifiers}{modifier_value}{/modifiers},
Qty - {item_qty},
Item Total - {item_total}
{/items}

```

All of the variables available in the orders tag pair (link should be available to you in the email templates. The orders tag allows for all of the checkout variables plus the additional variables for the order details.
> 4 votes

# Answer
Yes, totally possible. The detail isn't held in the orders channel, usually just the purchased items channel.

So, if you open the a new channel entries tag and pass the search:purchased\_item\_order\_id="{order\_id}" - it will then give you access to the channel fields in that entries loop.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: 404 redirect with multiple segments not working
I have a page on my site: mysite.com/index.php/staff/staff-bio/john-smith

I'm using this 404 redirect:

```
{if no_results OR segment_2 != "staff-bio" OR segment_4 != ""}{redirect="404"}{/if}

```

On a related note, I'm using the require\_entry="yes" option in my staff-bio template.

This redirect statement catches the problem it staff-bio is not segment 2, and if extra segments are added to the end, but if I were to change "john-smith" to just "john" in the url, or enter some other invalid path, it doesn't redirect. It just goes to a blank template page.

What am I doing wrong here?

# Answer
This looks like a bug on the no\_results conditional, to me.

May I suggest you something? Let's change your approach to this. Look at the docs. You should take advantage of the parsing order and do not let your code run if you can avoid. So, use simple conditionals around the channel:entries variable pair.

This way, in the two first situations, the parsing process will pass right from the stage 13, **simple conditionals**, to the 20, **redirect variable**:

```
{if segment_4}{redirect="404"}{/if}
{if segment_2 != "staff-bio"}{redirect="404"}{/if}
{if segment_2 == "staff-bio"}
    {if segment_4 == ""}
        {exp:channel:entries [...] require_entry="yes"}
            {if no_results}{redirect="404"}{/if}
        {/exp:cahnnel:entries}
    {/if}
{/if}

```
> 4 votes

# Answer
Robson's suggestion is on the money. Another approach would be to use the awesome IfElse add-on so parsing is less of an issue.

Using your example, it would look something like this:

```
{exp:ifelse parse="inward"}
    {if segment_4 != "" || segment_2 != "staff-bio"}
        {redirect="404"}
    {if:elseif segment_2 == "staff_bio"}
        {if segment_4 == ""}
            {exp:channel:entries [...] require_entry="yes"}
                {no_results}{redirect="404"}{/no_results}
            {/exp:cahnnel:entries}
        {/if}
    {/if}
{/exp:ifelse}

```

I'm not 100% sure you even need that condition in the if:elseif part, but it's a place to start. :)
> 2 votes

---
Tags: conditionals, 404, no-results
---


# Question
Title: P&T Assets field "loses" image when editing from some machines
An image is stored in a P&T Assets field and has been working fine. An editor emailed me saying when she opens an entry to edit it, the image is gone. I tried to edit entries and it worked fine. I even logged in as her and used the same browser and it worked. I then watched her edit it on her computer (Win 7 with Firefox) and sure enough, the image is not there when she opens the edit page.

I made sure she was using the right url, https (and not http which caused problems), no domain mismatches, etc.

A strange problem to start with, the inconsistency makes it even more 'fun'.

# Answer
We figured it out. It was only happening on random people's machines. They were logging in at example.com/system/....and not example.com/admin.php (masked cp access). Once they log in at the right url (admin.php and not system) all was well.

So the domain (www/dev/secure/etc), http and https, and the segment after the tld (system folder path or masked cp access) can all cause these problems.
> 0 votes

---
Tags: assets, pixelandtonic, image
---


# Question
Title: Show categories in file module listing in Controlpanel
I'm looking to find a way to show associated categories when viewing lists of files within the file module in the control panel.

I know that Zenbu can show this information but it only works with Entries and not Files.

Does any know of a way to do this?

# Answer
There isn't any available hook or add-on for it. You will need to customize the EE's controller file Content\_files and associate view file for it.
> 0 votes

---
Tags: categories, control-panel, files, zenbu
---


# Question
Title: Can the discussion forum registration display custom fields?
I'm using the Forum Module on a client site. I want to add two custom member fields to the registration form. Does anyone know if this is possible?

The theme template has a tag for custom fields, but they don't seem to show up.

```
{custom_fields}
    <tr>
        <th scope="row">
            {required}<span class="fm-required">*</span>{/required} {field_name}
            {if field_description}
                <span class="fm-field-notes">{field_description}</span>
            {/if}
        </th>
        <td class="fm-content-wrapper">
            {field}
        </td>
    </tr>
    {/custom_fields}

```

Thanks

# Answer
> 0 votes
Go to the "Edit Field" area of that member field and check if "Is field visible in registration page?" selected as "Yes".

---
Tags: templates, custom-fields, forum, registration
---


# Question
Title: SafeCracker validate if custom field is not a duplicate
I have a safeCracker form that takes in users e-mail address. I would like to validate that a user that has already registered is not registering for a second time.

Anyway to accomplish this?

# Answer
The Safecracker supports some of the CodeIgnitor's validation rules (http://ellislab.com/expressionengine/user-guide/modules/safecracker/#rules-my-field-name) but it doesn't support the validation rule for "is\_unique".

I 'm still wondering this rule is available in CodeIgnitor but not in EE which uses CodeIgnitor.

There may be 2 ways to achieve it.

1) You can add new rule for "is\_unique" with form validation file "/system/codeigniter/system/libraries/Form\_validation.php". But I am not sure it would work for EE as never tried it.

2) An extension can be developed using the hook "safecracker\_submit\_entry\_start", in this extension, check for unique email address and throw the error if already registered. I am sure about this approach and it will work.

I hope, it would help you.
> 1 votes

---
Tags: safecracker
---


# Question
Title: Using embedded templates with plugin that doesn't parse them
We're using an EE (2.6.1) plug-in that doesn't process embedded templates, which we would like to use.

When we embed a template inside of the code below the embeded code displays exactly as is, non-parsed static text.

We've tried adjusting the PHP parsing order, since some of the embedded templates use PHP. We've tried parse="inward" on the channel tag, switching tag orders and even snippets to no avail.

Any help pointing me in the right direction would be greatly appreciated.

Code excerpt from top of template:

```
{exp:channel:entries channel="people" limit="1"}
{exp:shine_pdf:make
    format="letter"
    default_font_size="11"
    default_font="Helvetica"
    margin_left="0"
    margin_right="0"
    margin_top="0"
    margin_bottom="0"
    margin_header="0"
    margin_footer="0"
    orientation="p"
    margin_top_auto="no"
    margin_bottom_auto="no"

channel="people"

limit="1"
}

```

# Answer
Embed templates don't parse in the way you're expecting them to. And PHP will be irrelevant here to.

What's happening is EE parses the parent template first - completely, so in your example it will parse the exp:channel:entries tag, then the exp:shine\_pdf tag. These will be complete and fully parsed. Finished.

Then EE will parse the embedded templates in exactly the same way, until completely parsed.

EE will then insert the parsed child template into the position you requested in the already parsed parent template. Therefore the parent tags will never be able to utilise the content of the child.

So in your instance, the PDF is already created and done before EE begins to look at the embedded template.

The only way to solve the issue is to not have an embed, or that your shine\_pdf tag is in the embedded template (possibly passing any relevant variables from the channel:entries to the embed...?).

Here's an excellent reference to parsing order: http://loweblog.com/downloads/ee-parse-order.pdf
> 2 votes

---
Tags: add-on, channel-entries, templates, plugin, parse-order
---


# Question
Title: I'll get a databae error when updating a entry using the channel polls field type
Recently I've installed the Channel Polls module of Devdemon on my development environment. I addded the fieldtype to the channel and edited a existing entry, when I press submit the system will throw a database error.

> Unknown column 'site\_id' in 'field list'
>
> INSERT INTO `exp_developer_log` (`site_id`, `entry_id`, `channel_id`, `field_id`, `member_id`, `poll_status`, `allow_multiple`, `member_groups`, `result_order`, `show_results`, `chart_type`, `chart_width`, `chart_height`, `chart_bg`, `function`, `line`, `file`, `deprecated_since`, `use_instead`, `timestamp`) VALUES ('1', '4', '5', '68', 1, '1', '0', '1|5', 'answer\_order', 'after\_vote', 'google\_pie\_3d', '350', '300', 'FFFFFF', 'convert\_human\_date\_to\_gmt()', 478, 'C:\Projects\Website\Development\2.6.1\system\expressionengine\third\_party\channel\_polls\ft.channel\_polls.php', '2.6', 'Localize::string\_to\_timestamp', 1370352409)

When I lookup the table *exp\_developer\_log* I see a lot of fields but not the fields that a described in the query above.

# Answer
This is an issue with Channel Polls and ExpressionEngine 2.6.1. I have replied to your support ticket and we will get a new version out asap with support for 2.6.1.

Thanks!

Brad
> 1 votes

# Answer
This has been fixed in the latest Channel Polls release.
> 0 votes

# Answer
We have the latest version 2.7.4 together with EE 2.5.3 but get a similar error. Any idea what this can be?

> Fatal error: Call to undefined function ee() in /.../system/expressionengine/third\_party/channel\_polls/ft.channel\_polls.php on line 476
> 0 votes

---
Tags: database, error, developer-log, devdemon
---


# Question
Title: EE2.x Module development reference images in css and views
I'm building a a module and I am having trouble trying to load images for my css styles and views..

is there a way to do this?

file stucture: third\_party:

* module
    + javascript
    + css
    + views

I have tried '../images/file.png' but no go as obviously the path is incorrect on page render.

# Answer
> 2 votes
You'll need to use the `themes` folder to use assets like images. So use a file structure like this:

```
/system/expressionengine/system/third_party/my_addon/[your-addon-files]
/system/expressionengine/system/third_party/my_addon/views/[your-addon-view-files]
/themes/third_party/my_addon/css/[css-files]
/themes/third_party/my_addon/images/[your-images]
/themes/third_party/my_addon/javascript/[your-js]

```

Then you can use `../images/my-image.png` in your css files.

Use `ee()->cp->add_to_head()` to add the CSS to the CP's head-element.

Use `ee()->cp->add_to_foot()` to add any JS to the footer of the CP.

See also:

---
Tags: add-on-development, module, stylesheets
---


# Question
Title: How can I re-send member activation email
Is it possible to re-send activation emails? I am looking at a member profile in the back-end who is "pending". For some reason they haven't received the initial activation email and I would like to send it to them again.

Also, when they try to login, it tells them that they need to activate there account. I would like to have a link in there so they can re-send the activation email to themselves.

Thanks

# Answer
> 2 votes
Yes, you can resent the activation link from Member Administration area of that member. While going to that you can see "Resend Activation Email" link at left bottom.

> Also, when they try to login, it tells them that they need to activate there account. I would like to have a link in there so they can re-send the activation email to themselves.

Could you share more info about this point.

---
Tags: members, email, activation, member-management
---


# Question
Title: Zoo Visitor: Members unable to update profile on front end
I have a profile edit page where members should be able to update their content. The superadmin account has no problems only members. Unfortunately when they try to update the form is submitted and then they see the error in the attached screenshot. In my form I’ve explicitly set require\_password=“no” but this problem is persisting. Below is the code from my form.

```
  {exp:zoo_visitor:update_form return="/profile/success" require_password="no"}
  <fieldset>
    <legend>Your Info</legend>

      <label for="EE_email" class="form-label">Your login email:</label>
      <input type="text" name="username" id="username" class="form-text" value="{username}" />

      <div class="row">
        <div class="six columns">
          <label for="member_firstname">{label:member_firstname}</label>
          <input type="text" name="member_firstname" id="member_firstname" value="{if member_firstname}{member_firstname}{/if}"/>
        </div>
        <div class="six columns">
          <label for="member_lastname">{label:member_lastname}</label>
          <input type="text" name="member_lastname" id="member_lastname" value="{if member_lastname}{member_lastname}{/if}"/>
        </div>
      </div><!--row-->

        <div class="row">
          <div class="six columns">
            <label for="mbr_url">{label:mbr_url}: don't forget http://</label>
            <input type="text" name="mbr_url" id="mbr_url" value="{if mbr_url}{mbr_url}{/if}" placeholder="http://cayugahospitality.com"/>
          </div>

          <div class="six columns">
            <label for="mbr_location">{label:mbr_location}</label>
            <input type="text" name="mbr_location" id="mbr_location" value="{if mbr_location}{mbr_location}{/if}"/>
          </div>
        </div><!--row-->

        <div class="row">
          <div class="six columns">
            <label for="member_photo">Photo: Upload a square photo of your face. Make sure this is a .jpg or .png and no more than 2MB or 600px by 600px.</label>
            {field:member_photo}
          </div>

          <div class="six columns">
           <label for="member_linkedin">{label:member_linkedin}</label>
            {field:member_linkedin}
          </div>
        </div><!--row-->

        <label for="mbr_bio">{label:mbr_bio}</label>
        {field:mbr_bio}

  </fieldset>

  <fieldset id="bios">
        <legend>Cayuga Membership</legend>
        <label for="member_divisions">{label:member_divisions}</label>
        <p>Select the divisions you represent and drag them to the right side.</p>
        {field:member_divisions}

        <label for="member_clients">{label:member_clients}</label>
        {field:member_clients}

        <label for="member_projects">{label:member_projects}</label>
        {field:member_projects}

        <label for="member_testimonials">{label:member_testimonials}</label>
        {field:member_testimonials}

        <label for="member_speakers">{label:member_speakers}</label>
        {field:member_speakers}

        <div id="speakers-bio">
        <label for="member_divisions">{label:member_speakers_bio}</label>
        {field:member_speakers_bio}

        <label for="member_topics">{label:member_topics}</label>
        {field:member_topics}

        </div>

  </fieldset>

    <input type="hidden" name="title" value="{username}">
    <input type="submit" value="Submit" class="button"/>

  {/exp:zoo_visitor:update_form}

```

# Answer
"When updating username, screen\_name or password inside the update form providing the current password is always required except for super-admins and the parameter does not have to be specified." Source: http://ee-zoo.com/docs/visitor/tags/update.html

Even though the user may not explicitly be updating their username, for example, since the field appears in the form, the above will apply.

This is why I had to separate general profile information from username & password as follows:

http://cl.ly/image/2r3E123Q3o0J
> 4 votes

---
Tags: members, forms, zoo-visitor
---


# Question
Title: Clicking on folders in the Assets 2 file manager does not work on IE8
I'm using Expression Engine v2.5.5 and Assets v2.0.3 with mulitple upload folders.

When using the file manager in IE8 clicking on the folder links does not update the view to show contents of that folder.

Does Assets 2 support IE8?

# Answer
> 3 votes
The Garnish UI library used by Assets tests for a single left click using the mousedown and mouseup events.

Unfortunately IE 8 returns the value of 1 when the left mouse button is clicked, and the garnish library tests for 0, which is what the W3C says it should be.

Please see http://www.quirksmode.org/js/events\_properties.html#button

I've had to fix this for a client deadline, so it's a bit of a hack but not too bad as Pixel and Tonic provides un-minified js files.

First change the helper.php in system/expressionengine/third\_party/assets directory to load the un-minified js file, on line 157 change:

```
$filename = 'garnish-'.self::$_garnish_version.'.min.js';

```

to:

```
$filename = 'garnish-'.self::$_garnish_version.'.js';

```

Next change the garnish-0.1.js in the themes/third\_party/assets/lib folder. There are 4 occurrences of the string:

```
ev.button != Garnish.PRIMARY_CLICK

```

and replace it with:

```
ev.button === Garnish.SECONDARY_CLICK

```

I've not tested this thoroughly but it's sorted my problem out for now.

# Answer
> -1 votes
I'm still seeing this behaviour in Assets v2.1.3 - the client (using IE8 on Win7) has complained that the 'Add Files' button doesn't become active once a file has been selected via the Assets slidedown window. I can replicate this behaviour. They can double-click to select, fortunately, but we still seem to have compatibility problems.

Lisa: Did your bug get cleared?

I tried Kevin Lees's fix but it didn't work for me. There now seems to be a config setting $EE-\>config-\>item('assets\_use\_uncompressed\_js') - but I'm not clear on how to change this!

EDIT: I got in touch with Pixel & Tonic and they confirmed the existence of some IE8 incompatibilities which will be addressed in the next Assets release (2.1.4).

---
Tags: assets
---


# Question
Title: automatically linking to the first entry in a channel using a category tag
I have a template that displays the categories in a channel. I want the link to direct to the first entry in that category and the link should include the url\_title in the last segment as I will be needing it.

here is my code for the categories but how do I include the link to the first entry?

```
{exp:channel:categories channel="portfolio" show_empty="yes" style="linear"}
<a href="{path='showroom'}"><img src="{category_image}" border="0"/></a>
<a href="{path='showroom'}">{category_name}</a>
{/exp:channel:categories}

```

So rather than the first link going to: http://domain.com/showroom/category/category\_name

I would like it to go to: http://domain.com/showroom/category/category\_name/url\_title (this would be the first entry in the chosen category)

# Answer
> 1 votes
I believe Channel Categories only returns the category names, not the entries themselves. If you need to return a channel entry, you'll need to use the Channel Entries tag as well (or instead).

So you'll need something like

```
{exp:channel:categories channel="portfolio" show_empty="yes" style="linear"}
<a href="{embed='embeds/.getEntryForCategory' cat='{category_id}'}"><img src="{category_image}" border="0"/></a>
<!-- etc. -->
{/exp:channel:categories}

```

and then in the getEntryForCategory template:

```
{exp:channel:entries category='{embed:cat}' limit='1' dynamic='no'}{path='showroom'}/{url_title}{/exp:channel:entries}

```

I don't particularly like nesting templates, but I think this returns what you were after?

# Answer
> 0 votes
I adjusted your code @dave-forber a bit because your link did not include the category/category\_name/ segments. But I am not using the Cat ID so instead I am getting the cat id when I use {embed:cat} how can I instead get the proper categopry name in the segment?

```
{exp:channel:entries category='{embed:cat}' channel="portfolio" limit='1' dynamic='no'}{path='showroom'}/category/{embed:cat}/{url_title}{/exp:channel:entries}

```

ahh this seems to work:

```
{exp:channel:entries category='{embed:cat}' channel="portfolio" limit='1' dynamic='no'}{path='showroom'}/category/{categories}{category_name}{/categories}/{url_title}{/exp:channel:entries}

```

---
Tags: categories, links
---


# Question
Title: Where can I set the title of my module's layout tab(s)?
I've got a custom module, with a layout tab, with several fields in it, and that all works fine. The title of the tab, however, is the lower case module name, and I don't seem to be able to change that.

I've got a lang.\*.php file in my language/english directory, and a matching lower case module name field (as in the download module example \- which gets its tab title from the eponymous 'download' key in the lang file).

Any ideas?

# Answer
In the constructor for the tab.module\_name.php call your language file and that should look for the tab shortname/key in your lang file.

```
public function __construct()
{
    $this->EE =& get_instance();
    $this->EE->lang->loadfile('my_lang_file');
}

```

Take a look at how Bjørn Børresen allows for config overrides on the SEO Lite module so folks can rename the tab to whatever they want.
> 1 votes

---
Tags: module, publish-layout
---


title: Matrix slider bug

text:
# Question
Title: Matrix slider bug
I created a slider using Matrix, consisting of 3 slides (images and text). On load, the content for all 3 slides are shown, stacked. Then after a second the slider functions normally. Has anyone faced this problem, and how can this be fixed?

# Answer
This isn't a Matrix bug, this is the way most sliders work. It's actually caused by this bit of code:

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

```

What this says is, wait for the browser to be finished handling the page, then run the code in between the `{` and `}`. The reason for this is that starting to apply effects etc. on the document before your browser is done rendering it, could cause unexpected behavior (for example, most sliders interpret the height of slides, but if your fonts or images aren't fully loaded yet that'll be inaccurate).

Does that help?
> 1 votes

# Answer
What Steven said. Generally, the way I take care of this is that I "hide" the slider element (div) using css during page load. Then, when Javascript kicks in, it removes that class from the slider div, making it visible after everything is loaded on that page.

EDIT: as Jean said, you can also keep only the first slide visible or set the height of the container to avoid content "snap"

You can see this on one of the site I built. The script I used on there is called flexslider and it does it by default.
> 1 votes

---
Tags: matrix
---


# Question
Title: Reverse Related Entry Showing A Future Post
I have an issue I’ve never run into before. I’ve recently started scheduling posts for the future on a site and I have a reverse related entries tag (EE 2.5.5) that is showing these future entries and I can’t make it not do that. It’s pretty essential that this tag not show future entries and the reverse related entries tag (again, EE 2.5.5) does not seem to accept the show\_future\_entries parameter.

Any help would be appreciated.

# Answer
Reverse related entries does support six of the typical parameters "channel", "status", "sort", "orderby", "offset", "limit".

So parameter "show\_future\_entries" wouldn't be supported.

**\*****\**** EDITED *****\*****\*****

You can fulfill you need with SQL in Query module with the following code example:

```
{exp:channel:entries channel="channel_name1" limit="xx"}
    {exp:query sql="SELECT GROUP_CONCAT(CAST(rel_parent_id AS CHAR) SEPARATOR '|') AS parent_ids FROM exp_relationships WHERE rel_child_id='{entry_id}'"}
        {embed="temp_grp/tmp_name" parent_ids="{parent_ids}"}
    {/exp:query}
{/exp:channel:entries}

```

Now in template "temp\_grp/tmp\_name", put the channel entries tag like:

```
{exp:channel:entries channel="channel_name2" entry_id="{embed:parent_ids}" limit="xx" show_future_entries="no"}
    <p>{title}</p>
{/exp:channel:entries}

```

Now, you can pass all the parameter of channel entry tag including show\_future\_entries.

I hope, it would work for you.
> 3 votes

# Answer
Just to expand on Bhashkar's explanations, I see two other solutions on top of what he mentioned:

You could upgrade to EE 2.6.1 which will automagically convert your old relationship fields to the new (more powerful) one shipped with 2.6. That new one will let you deal with future entries or only past entries (albeit in the custom field settings rather than at the template level if I remember well).

Another option would be to use Playa by Pixel & Tonic and convert your relationship fields to that. Playa will give you fine grained control over your relationships, great flexibility and an awesome UI in the CP (in my opinion, a better one that the default relationship field I mentioned above).
> 1 votes

---
Tags: channel, reverse-related-entries, future-entries
---


title: Matrix & Simple Search

text:
# Question
Title: Matrix & Simple Search
I'm trying to search inside 'Matrix' cols with Simple Search module - but it's just not happening.

I've ensured that the field is 'Searchable' and that all columns in the Matrix are 'Searchable' also. The entries themselves are not closed & not in the future - but they still won't show up in the search results.

This is the code I have for the Simple Search form:

```
{exp:search:simple_form result_page="search/results" no_result_page="search/no-results" results="10" channel="shop_product" where="all" search_in="everywhere"}
        <ul>
            <li><input type="text" name="keywords" /></li>
            <li class="submit-btn"><input type="image" src="{site_url}assets/images/icon-search.png" width="32" height="32" name="search"/></li>
        </ul>
{/exp:search:simple_form}

```

Any ideas why this wouldn't work?

# Answer
> 0 votes
If you've enabled the searchable columns for the Matrix field while there were existing entries, you'll have to save each of those entries in order to make it work. Basically, the searchable content needs to be put in the `exp_channel_data` table, which Matrix does upon saving entries.

---
Tags: matrix, pixelandtonic, simple-search
---


# Question
Title: How can I return entries within a certain (non-date) range?
I'd like to make an improvement to how I'm displaying related products on a product detail page. Right now, the list of related products will...

* be limited to the same type and category (Playa relationships)
* be ordered by dollar value in descending order (numeric field)

Sometimes the price alone can make an item dissimilar; for example a $1.5M gum production machine isn't relevant on the detail page for a $0.75 pack of gum. What I'd like to do is limit my related entries to anything within ${x} of the current item.

Here's the (simplified) related products template, to which I pass the IDs of related category pages:

```
<h3>Related Products</h3>
<ul>
{exp:playa:parents entry_id="{embed:category_ids}" orderby="product_price" sort="desc"}
     <li><a href="{page_uri}">{title}</a>, ${product_price}</li>
{/exp:playa:parents}
</ul>

```

If I wanted to limit by date, I could use EE's `start_on` parameter. If I wanted to match a specific value, I know I could use the `search` paramater. In this case, I simply want to add `WHERE product_price <= x`, with `x` being a dollar amount I've already calculated in PHP to be reasonably close to the currently-viewed product. Is there a way to accomplish this without going straight for the query module?

# Answer
Have a look at Low Search -- it can be used as a replacement for the Channel Entries tag, and has a `range` parameter which might suit your needs.
> 1 votes

# Answer
Since I love answering my own questions, here's the template embed I ended up with thanks to Derek's suggestion of using Low Search:

```
<?php

$pad = 10; // dollar amount above the current price at which we'll cap results
$price_limit = intval('{embed:current_product_price}')+$pad;

?>

{exp:low_search:results child:product_categories="{embed:category_ids}" range:product_price=";<?php echo $price_limit; ?>" orderby="product_price" sort="desc" parse="inward"}
    <li><a href="{page_uri}">{title}</a>, ${product_price}</li>
{/exp:low_search:results}

```
> 1 votes

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


# Question
Title: Safecracker Handling Wygwam Style Attributes Poorly
EE 2.6.1 WYGWAM 2.7.1

I have a Wygwam field. Inline image tags are not being written properly when entered through a Safecracker form. Inline image tags ARE being written properly when entered through the EE CP.

From the control panel, an img tag is written thusly:

```
<img alt=”” data-cke-saved-src=“something.jpg” src=“something.jpg” style=“width: 110px; height: 150px;”>

```

And from Safecracker, it looks like this:

```
<img alt=”” data-cke-saved-src=“something.jpg” src=“something.jpg” 110px;=”” height:=”” 150px;”=”“>

```

The style attribute is not encoding properly.

Andris over at P&T points us to line 1302 in safecracker\_lib.php and suspects “the Security library is somehow deciding that style attribute is an XSS attack and is handling it rather poorly”

Is there something I can be doing to fix this?

I’ll gladly accept a patch if anyone can help. This is kind of a big deal. Thanks.

(I see a few answers that mention editing CKEditor config files. Ugh... really?)

# Answer
> 1 votes
In safecracker\_lib.php around line 2625, there's a blank array being defined called $this-\>skip\_xss\_fieldtypes. Add wygwam to that array.

```
$this->skip_xss_fieldtypes = array('wygwam');

```

---
Tags: safecracker, wygwam
---


title: Custom sorting of channel entries

text:
# Question
Title: Custom sorting of channel entries
I need to allow custom sorting of a channel entries loop, so I'm currently achieving this by using segments and URLs like this: mywebsite.com/products/sort/date/asc and mywebsite.com/products/sort/price/asc with the following code:

```
<ul>
  {exp:channel:entries channel="product" orderby="{segment_3}" sort="{segment_4}" pagination="bottom"}
    <li>{title}</li>
  {/exp:channel:entries}
</ul>

```

This works fine for ordering by date and other custom fields, but the downside is that the URLs can get a bit ugly as I need to add the custom field short name to the URL, e.g. mywebsite.com/products/sort/cf\_product\_ugly\_custom\_field/asc

My workaround has been to name the custom fields I wish to sort by from my usual format of {cf\_product\_price} to {price}, but this doesn't feel like an elegant solution.

Can anyone think of a more elegant way of doing custom sorting, without having to have the custom field in display in the URL like this? Thanks for any advice.

# Answer
> 2 votes
Stephen, simple conditionals are parsed before modules tags. Because of this, you can put them inside your opening channel:entries variables.

I put more custom fields on this example to make it more clear.

```
<ul>
  {exp:channel:entries channel="product"
    {if segment_3 == "price"}
    orderby="{cf_product_price}"
    {/if}
    {if segment_3 == "brand"}
    orderby="{cf_product_brand}"
    {/if}
    {if segment_3 == "foo"}
    orderby="{cf_product_foo}"
    {/if}
    {if segment_3 != "price"}{if segment_3 != "brand"}{if segment_3 != "foo"}
    orderby="{segment_3}"
    {/if}{/if}{/if}
    sort="{segment_4}"
    pagination="bottom"
  }
    <li>{title}</li>
  {/exp:channel:entries}
</ul>

```

---
Tags: channel-entries, orderby, sort
---


# Question
Title: expresso store - adding more items than in stock
Is there a way to allow say 10 items to be added to a cart when there are are only 6 in stock and in the database the value of items is -4, therefore out of stock items can be added to the cart. Would like to keep inventory exact rather than unlimited but at the same time allow for orders that exceed the stock quantity

Additionally, providing user feedback stating that some items are out of stock when the shopping cart page is loaded?

Is this possible?

# Answer
This is not possible in Store, if you are limiting the Stock level of an item you will only be able to add the in stock amount of items to the cart.
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Workflow: A post in one channel automatically creates a post in another
I have a customer requirement where they're asking that EE automatically generate a blog post when a post in another channel is created (e.g., we post a product and there's a blog post about it).

Aside from doing it in some funky way where I combine the channel but separate out the posts via category, I can't think of a really streamlined way to do it.

I'm guessing it could be done using ACT or something, but I'm not sure the best way to approach this. Any tips to get me headed in the right direction would be helpful!

# Answer
> 2 votes
Sure - use an extension which fires on the entry\_submission\_end hook.

Check that `$meta['channel_id']` matches your Product channel, then take the data from `$meta` and `$data` to create a new entry (just an array of data) for your Blog channel.

Lastly, pass that array to the Channel Entries API and you should be good.

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


# Question
Title: Stripe with Expresso Store returning XML not valid error
I'm attempting to integrate the Strip payment gateway with Exp:resso Store and I'm getting this error after removing the error\_handling=”inline” per the Checkout Tag documentation:

> The form you submitted contained the following errors
>
> * The XML document is well formed but the document is not valid

I have tried numerous variations to the Checkout tag contents in the Store\_example/checkout3 template based on Exp:resso and Store documentation, but nothing has moved me past this error. I'm not sure what to look for.

Here's the code I pasted into the header. I replaced YOUR\_PUBLISHABLE\_KEY with the publishable test key from Stripe.

```
<script type="text/javascript">
$(document).ready(function() {
  $.getScript('https://js.stripe.com/v1/', function() {
    Stripe.setPublishableKey('pk_test_QcxvwbfdYTdR3z5vUD1Tq27k');
  });

  /* Ensure your checkout submit button has id="checkout_submit" */
  $("#checkout_submit").click(function() {

    /* Only handle requests for Stripe gateway */
    if (this.form.elements["payment_method"].value == "stripe") {

      /* Temporarily disable the checkout submit button */
      $("#checkout_submit").attr('disabled', true);

      /* Create a Stripe card token */
      Stripe.createToken({
        name: $("#payment_name").val(),
        number: $("#payment_card_no").val(),
        cvc: $("#payment_card_csc").val(),
        exp_month: $("#payment_exp_month").val(),
        exp_year: $("#payment_exp_year").val()
      }, stripeResponseHandler);

      /* We don't want to submit the form yet */
      return false;
    }
  });

  /* This function is triggered once Stripe has generated the token */
  function stripeResponseHandler(status, response) {
    /* Re-enable the checkout submit button */
    $("#checkout_submit").attr('disabled', false);

    /* Check whether we have a valid credit card */
    if (response.error) {
      alert(response.error.message);
    } else {
      /* Set the card token and submit the checkout form */
      $("#payment_token").val(response['id']);
      $("#checkout_submit").unbind("click").click();
    }
  }
});
</script>

```

Below is the relevant body code. Some of it is from the Exp:resso Store documentation, some of it is from the Stripe documentation.

```
{exp:store:checkout
    payment_method="stripe"
    form_class="form-horizontal"
    return="store_example/order/ORDER_HASH"
    error_delimiters='<span class="help-inline">|</span>'}

    {if no_items}
        {redirect="store_example/checkout"}
    {/if}
    <div class="row">
        <div class="span8">
            <!-- Billing and Shipping degails removed from pasted code -->
            <fieldset>
                <legend>Payment</legend>
                {if error:payment_method}
                    <div class="control-group">
                        <div class="alert alert-error">{error:payment_method}</div>
                    </div>
                {/if}
                <form action="" method="POST" id="payment-form">
                    <span class="payment-errors"></span>
                    <div class="form-row">
                        <label>
                        <span>Card Number</span>
                        <input type="text" id="payment_card_no" value="" />
                        </label>
                    </div>
                    <div class="form-row">
                        <label>
                        <span>Name on Card</span>
                        <input type="text" id="payment_name" value="" />
                        </label>
                    </div>
                    <div class="form-row">
                        <label>
                        <span>CVC</span>
                        <input type="text" id="payment_card_csc" size="4" value="" />
                        </label>
                    </div>
                    <div class="form-row">
                        <label>
                        <span>Expiration (MM/YYYY)</span>
                        <select id="payment_exp_month">
                        <option value=""></option>
                        {exp_month_options}
                        </select>
                        </label>
                        <span> / </span>
                        <select id="payment_exp_year" name="payment[exp_year]">
                        <option value=""></option>
                        {exp_year_options}
                        </select>
                    </div>
                    <div class="form-actions">
                        <a href="{path='store_example/checkout2'}" class="btn">Back</a>
                        <input type="submit" name="submit" value="Place Order" id="checkout_submit" class="btn btn-success" />
                        <input type="hidden" id="payment_token" name="payment[token]" value="" />
                    </div>
                </form>
            </fieldset>
        </div>
        <!-- Order Summary removed from pasted code -->
    </div>
{/exp:store:checkout}

```

# Answer
While this error looks somewhat generic, in this case the cause appears to have been a lack of secure connection (HTTPS) or/and some limitation from running on a local environment.

Now that I've got the site on a staging server with an SSL certificate, this error no longer appears.

---

Days later this error appeared again after I added shipping options. Apparently, because I had not yet entered the API to connect to UPS and generate a price, the form was incomplete and EE/Store generated the XML not valid error.
> 1 votes

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


# Question
Title: "Invalid API Key provided" error with Store and Stripe
I've checked the API several times and I'm sure the API code is correct, so I assume the problem is in the code on this page. I installed the Store plugin and I'm trying to set up a Stripe payment gateway using the Store checkout3 template as a starting point.

In reviewing the docs, I see differences between the Store documentation regarding Stripe and the Stripe documentation itself. Since the Store docs suggestions checking the Stripe docs, I'm not sure which code to use when there is a discrepancy between the two sets of documentation. I don't know javascript yet so I have been testing parts of the Stripe code in place of the Store code, attempting to find a solution through trial and error. So far, nothing has worked. It's possible I just made an basic mistake. Help would be much appreciated.

I'm using the latest version of both EE and Store.

# Answer
Stripe has API keys for both Test Mode and Live Mode. Make sure the mode of the public API key used in your Store template matches the mode of the private key pasted into your Store settings for Stripe.
> 1 votes

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


title: Automatically populate Matrix Rows

text:
# Question
Title: Automatically populate Matrix Rows
Is there a way to automatically populate Matrix rows with channel entries with a custom status?

# Answer
Playa (and EE relationships) work in that they *link* to an entry rather than *pull in from* that entry. Obviously you don't want to have duplicate data in your system and a relationship prevents that whilst keeping context. What you describe should be possible but using Playa to establish the relationship and then creating a new column in your Matrix field entitled 'Status' and using a select box field (I'd recommend P&T Field Pack) to provide your own status options per entry.
> 1 votes

---
Tags: matrix
---


# Question
Title: Assets 2 Upgrade - No Images in Manager and No Uploading
I am running EE 2.6.1 and recently updated to Assets 2.1.3.

In the EE file manager, all my files are visible and I can upload new ones. But the Assets file manager is blank and gives me an error when I try to upload: "Could not upload the file - server returned an unexpected response. Please check the server settings."

I have tried updating the indexes with no success of resolving the issue.

# Answer
> 1 votes
Make sure your file upload directory paths are correct and run 'update indexes' from within the Assets module page.

---
Tags: assets
---


title: Logging custom data to the DB

text:
# Question
Title: Logging custom data to the DB
I'm working on a film site and need to log some custom information about a user's activity. On the site you can click a play button to start watching a film. (This link just takes you to Amazon Instant.) When a logged-in user clicks to start watching the film, I need to:

1. Set a "watching" flag in their account denoting that they started watching `film_id` at `2:57PM`;
2. Next time they load a page on the site I need to check to see if they're "watching" any films;
3. If they are "watching" a film I need to display a modal that asks them to rate the film.

I know EE allows you to run queries as you see fit. Wondering if there is a recommended way to log and retrieve data that doesn't necessarily exist in the EE interface?

# Answer
> 0 votes
I would suggest you to create an extension/module hooked with "sessions\_start". With the extension installation create a database table having following columns: \- film\_id (integer) \- Member ID (integer) \- start\_time (datetime: UNIX timestamp) \- film\_length (in seconds)

Now you need to do following process: \- When member started watching that film (i.e clicked on play button), insert new record in this database table \- On page refresh, check the current time \> start\_time + film\_length. remove that record accordingly. This would be checked if page is refreshed by any other member.

There may be case if your member has watched the film but still didn't refresh the page. In this case, this comparison will process.

* Now with the SQL you can fetch which member watching which film. For it, you can create module tags also.

I hope, this would help you.

# Answer
> 1 votes
You might save yourself quite a bit of trouble by adding the watching flag as a custom field in their member account and retrieving it through the appropriate tag. On the other hand, there's nothing inherently wrong with doing it the way you have specced.

Membership Tags (EE Docs): http://ellislab.com/expressionengine/user-guide/modules/member/#custom-profile-data-tag

---
Tags: database, mysql
---


title: Assets Uploads Failing

text:
# Question
Title: Assets Uploads Failing
```
EE 2.5.5, Assets 2.1.3

```

I'm having an issue in the CP uploading images. My EE install uses the Focus Lab config system if that makes a difference.

When I try to do an upload via the Assets Module view (file manager) I get an error message:

```
Could not upload the file - server returned an unexpected response. Please check the server settings.

```

When looking at the request (?folder=2&ACT=39...) I get this error in the Chrome Inspector preview: A PHP Error was encountered

```
Severity: 4096

Message: Argument 1 passed to Assets_base_source::update_file_info() must be an instance of Assets_base_file, boolean given, called in /Volumes/Macintosh HD/Users/iso100/Sites/gde/third_party/assets/sources/base_source.php on line 642 and defined

Filename: sources/base_source.php

Line Number: 672

Fatal error: Call to a member function kind() on a non-object in /Volumes/Macintosh HD/Users/iso100/Sites/gde/third_party/assets/sources/base_source.php on line 681

```

Any ideas?

# Answer
> 3 votes
I just came across this issue too and it turns out while the EE filemanager doesn't mind a missing trailing slash on the server path, Assets does.

Make sure your upload directory server path *has* a trailing slash.

Resolved the issue for me.

# Answer
> 0 votes
It turns out my server path was incorrect in my config.master.php configuration. Sorry to burn your time on this but I just resolved the issue.

I tested uploading using Assets and it works perfectly.

Thanks!

---
Tags: assets, pixelandtonic, error, php-errors, uploads
---


title: How should I code this?

text:
# Question
Title: How should I code this?
I'm building a church site, and I want to create a "media" channel with a list of all the messages. On the media index page there would be a list of images, some associated with a sermon series, others with just an individual message. When you click on one of the images for a sermon series, it would go to a list page of all the sermons within that series. I'm unsure of how to code the template and the channel entry fields to make this happen?

My initial thought was just put a field in the entry where they would enter the sermon series name, but that means they'd have to enter it in the same way each time for that series, otherwise the sermon wouldn't show up under the list of sermons. Then I thought maybe there could be a drop down menu with the sermon series name in it, and the admin would just select that. Then I imagined 5 years down the road when there are hundreds of items in a drop-down menu...that's obviously not ideal.

Does anyone have any ideas on an effective way to do this? Any input you can provide would be greatly appreciated.

# Answer
> 2 votes
One solution would be to use a relationship field for the sermon series, and then set "Allow multiple relations?" to "Yes" (Channel Fields \> your field group \> Field Type "Relationships").

If you leave it at a single choice then it will be a drop down list like you want to avoid, but multiple choices gives you a search box in the field. You could then either train or notate to only pick one, and you might find that having the ability to relate a sermon entry to more than one series becomes useful at some point.

\[for EE versions 2.6.0+ I think\]

# Answer
> 2 votes
I've done this sort of thing before myself using two channels - one for the media postings and one for series (the series itself being an entry can be extremely useful, since you can describe it, have its own custom fields, etc.) and then use a relationship to tie the media messages to a series if applicable. Whether you need the relationship to be one to one or one to many is something you would have to decide - one to many (or even many to many) can give you a fair bit more flexibility over time, potentially. I haven't tried this with the new relationship field in 2.6+ - I have instead done this in the past with earlier versions of EE with Playa. The benefit there is not only the many to many fieldtype but the filtering options that are available within the field type - keyword within the title, category or status are useful for the admin to filter to the right media entries. So you would place the Playa field within the custom field group for the media messages. You would just need to ensure that the series to which the media message belongs is already an entry. Then a media message, when being entered, simply gets assigned to one or more series if applicable.

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


title: Comment form json?

text:
# Question
Title: Comment form json?
Just out of curiosity, is it possible to have a native comment-form return json instead of redirecting?

Thanks!

* Steven

# Answer
With a custom extension, you could. Just use the `insert_comment_end` hook, then do something like this:

```
if(ee()->input->is_ajax_request())
{
    ee()->extensions->end_script = TRUE;
    $data['comment_id'] = $comment_id;
    $data['moderated'] = $comment_moderate;
    echo json_encode($data);
}

```
> 2 votes

---
Tags: jquery, ajax, comments, json
---


# Question
Title: EE1 -> EE2 Upgrade; Playa template tag conversion looks like it failed
Where before (in EE1) I had this in a template:

```
{assign_variable:current_weblog="news"}
...
{exp:weblog:entries ... }
    {reverse_related_entries weblog="{current_weblog}"}
    ...
    {/reverse_related_entries}
{/exp:weblog:entries}

```

After upgrading to EE 2.6.1 and installing Playa 4.4.3, I now have this (note the opening `{parents}` tag):

```
{preload_replace:current_channel="news"}
...
{exp:channel:entries ... }
    {parents }"}
    ...
    {/parents}
{/exp:channel:entries}

```

I haven't actually tested the template yet, but something tells me it's not gonna work... ;) I'm guessing that having the `weblog="{current_weblog}"` use an assigned variable (i.e. a curly-brace tag) rather than plain text is what tripped the converter up. In another template where the weblog was specified in plain text, this issue did not happen.

Any ideas, P&T? Thankfully, this is a trial upgrade on a *copy* of a live site, so it's not critically urgent. :)

# Answer
> 1 votes
Playa doesn’t actually convert your template code – the EE 2.6 upgrade does. Back before Playa 4, Playa just piggybacked on EE’s relationships system, and thus, used the same `{reverse_related_entries}` tag.

If you had just upgraded to Playa 4 but not upgraded EE, your templates would not have been messed with, and you would have had to go in and manually changed any `{reverse_related_entries}` tags to `{exp:playa:parents}`.

When you upgraded to EE 2.6, EE assumed that your `{reverse_related_entries}` tags were for Relationship fields, so it converted them to `{parents}` (or tried to, anyway). Changing those to `{exp:playa:parents}` tags should get your site back up and running.

---
Tags: ee2, playa, ee1, upgrade
---


# Question
Title: Problem with P&T Field Pack variables inside Safecracker
Using EE v2.6.1 Safecracker and P&T Field Pack v2.0.2

P&T Field Pack dropdown variables with value or label tags don't work inside Safecracker form tag pairs.

This code:

```
{exp:safecracker channel="channel_name" entry_id="{entry_id}"}
    1: {field:my_field}
    2: {my_field}
    3: {my_field:value}
    4: {my_field:label}
{/exp:safecracker}

```

Returns:

1: a select input conatining all options of my\_field with current value selected

2: field's current value

3: NOTHING

4: NOTHING

It used to be working on EE v2.5.5

Any help?

# Answer
Would using {field:my\_field\_name} work in your case?
> 1 votes

---
Tags: safecracker, field-pack
---


title: How do insert channel entry via SQL?

text:
# Question
Title: How do insert channel entry via SQL?
I'm trying to port a table to a channel. Can anyone tell me the basics of what's involved? So far what I think is:

1) Insert record into exp\_channel\_titles 2) Get entry\_id that was just generated for 1) 3) Insert record into exp\_channel\_data with entry\_id from 2)

Is that it? I'm not sure if any more relationships exist. Thanks for your time.

# Answer
> 1 votes
Yes, that is it for a basic channel entry. If your channel has categories or relationship fields, or any advanced third-party fieldtypes (such as Matrix or Playa), there will be more inserts required.

---
Tags: channel, entry, entryid
---


# Question
Title: Need to programatically register users, and validate a code they enter
This one is a doozy for me, and I really need some input / advice.

Basically, I have a client who runs an independent magazine, and they use a system that can output a list of subscribers, and their account numbers in a CSV file.

I'm doing the online version of their magazine using expression engine. When each reader is sent their magazine, attached will be an account number. The client wants them to be able to register on the site, and input their print subscription account number at registration. At this time, they want the system to compare the account number they enter, to the active list of account numbers. If they've entered a valid print account number, then they'll be granted access to the special members-only content.

I'm trying to figure out the best way to approach this, because I'm trying to marry two unrelated systems, and it's not negotiable - this is how they want to do it. The subscriber list must come in from their subscription system, and the reader must have their print magazine before they can validly login and create an account.

They also want it so that if a user's print account number becomes non-active (aka, they no longer subscribe to the magazine), then their account should also be demoted to a lower level.

I've had a few thoughts and approaches - all of them have an issue or big challenge of some sort:

1) Somehow, import all the current account numbers from the CSV, and save them as channel entries. Then, upon registration, user enters their account number into a custom field, which then somehow "checks", and if it's a valid registration, change their member group. If an account number is removed from the "valid" list, then the member will need to be downgraded.

or

2) Every day, the administrator will use the CSV file to "import" members. As in, accounts will be automatically created and the subscription account number itself will be used AS the username, with a standard password. They like this idea, but they say that in this case they'd want the user to be able to change their username to a friendly name, rather than existing as numbers like the Borg.

In the above case, I'd have to write some sort of script that creates user accounts, and, if necessary, looks for the CHANGE in active subscriptions. Meaning, if you are user 323423, and then one day the admin import shows that account number as missing (no longer active), then downgrade the account.

Fundamentally, I think, I understand the process flow, but I have no idea how to code any of this.. user creation.. validation... cross referencing from a channel data source (magazine subscription account numbers)

It's a frustrating cross of a few different sets of technology. I'm wondering if, perhaps, I'm missing something really straightforward? Or, if my above options are truly the directions I have to go, then HOW do I program this? (as in, example code?? - adding a member programatically? Or at registration time, adding in the subscription field validation? :)

I've looked at the DB structure to see if I can "hack" this together, but the user (member) table really looks like it's very specifically managed by EE.

Help!

Thanks, Glen

# Answer
> 1 votes
Without thinking about it too much I would just create a totally separate database table that contained all the valid subscription codes.

Then when a user wants to validate you can do a lookup from that table to find a matching ID. If you need to take it further you can then have that ID either stored in a custom member field or else store their member ID against the code within the separate table.

Maybe then run a cron job every day/week/month to perform a check and demote any accounts that no longer have active subscription IDs.

Like I said, I didn't think on it too much but I would probably avoid any tampering in the EE tables and keep the subscription stuff outside of EE then build some PHP scripts around the system (or get the publisher's systems to update the table as and when needed).

EDIT: Looks like I missed the bit about registering the users. There was an API style add-on announced recently that might help. When I recall the name of it I will update this post.

UPDATE: The API add-on I was thinking of is Open API http://www.putyourlightson.net/open-api It may be of use to you for creating Members etc.

# Answer
> 1 votes
I'd suggest using one of the two add-ons available for adding registration code functionality.

There is two commercial add-ons for this purpose out there that I can see: Invitations and Registration Codes

I haven't tried out either of them, and you'll still have to work on the import side, which shouldn't be too difficult. But at least these add-ons should handle the validation portion for you.

---
Tags: members, registration, validation, users
---


title: Cartthrob - Read Only Note in the Cart

text:
# Question
Title: Cartthrob - Read Only Note in the Cart
Good evening.

I want to be able to add a note to each item in the cart that is not editable by the customer.

I can get a note to appear in the form of a text box, however they are always writable.

I wondered if there is a way to disable the input on the View/Update cart page.

I am providing the note to the item via a little bit of PHP.

# Answer
> 0 votes
Its not foolproof but adding a hidden input would achieve what you seek. \< input type=hidden name=note id=note value=yourPHPcode \>

Then inject your php code into the value. Or just wrap whatever you like in a hidden div.

PS. You'll need to have a custom field in your orders channel that matches the hidden inputs name.

---
Tags: ee2, cartthrob
---


title: Low Variables with Matrix and Assets

text:
# Question
Title: Low Variables with Matrix and Assets
We've setup LV with a Matrix field, inside of which is an Assets field. When we submit the changes, these are written to the DB but when the page reloads, the Asset field is blank.

It appears this problem has happened before but the fix from back then seems to have become inaffective: https://getsatisfaction.com/low/topics/assets\_field\_used\_in\_matrix\_as\_a\_low\_variable\_doesnt\_pull\_information\_from\_db

Is anyone able to help with this one? Our setup is:

* EE 2.6.1
* LV 2.3.5
* Matrix 2.5.5
* Assets 2.1.3

Sam

# Answer
> 2 votes
try setting the `is_draft` column in `exp_matrix_data` table to NOT NULL with the default of 0. This will be fixed in the next Matrix version.

---
Tags: matrix, assets, low-variables, bug
---


# Question
Title: Registering/Logging into multiple sites at a time with MSM
I've been through the docs, and found this thread (http://ellislab.com/forums/viewthread/58566/), which makes it appears as if a user can login to site A, and also login to site B at the same time on an MSM setup. The idea being they login once, and get access to both sites and appear logged into both sites. I need this to happen on the front-end of the site, not the control panel. I followed the thread, and the docs and made the necessary configuration updates, but nothing works. I even added a hook and tried to create the cookie manually for the other domains, but I suppose thats not possible b/c its a potential XSS issue (the sites are all on different domains).

Site A, the main site, houses the registration form. If a user is on site B, they are sent to site A, register (and auto logged in), and then return to site B, however, they are not logged into site B at this point, only site A. I need them to be logged into both.

I suppose the only course of action is to create some sort of handshaking via ?ACT requests with a token to validate the login, thus each domain would receive an ?ACT request to set the cookie on that domain.

Is there any other way to approach this? Why do the native config values have no affect?

# Answer
> 1 votes
Turns outs I was right. Since each site is on a different domain name a custom add-on to do an authorized handshake is required. If the sites were on the same domain, but in different sub-domains it would work out of the box.

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


# Question
Title: How can I use a captcha in a form that is not an add-on?
I'm using a form in a web page that is standard html and css, NOT any kind of Exp Eng add-on tag set. Is there a way to use Exp Eng's captcha system directly in a webpage form like a typical Exp Eng tag? I've been using reCAPTCHA from Brandon Jones and like it a lot but it is an extension that automatically replaces the Exp Eng captcha. Can a simple add-on be written that uses the extension and embeds a captcha in the page?

# Answer
you could use Snaptcha's {exp:snaptcha:field} template tag but you would need to run the field validation yourself. there are instructions on how to do this in the docs but some php knowledge is required.
> 1 votes

---
Tags: forms, extension, captcha
---


# Question
Title: How can I convert special chars into html entities
One of my matrix cells for the caption/description is set to NONE formatting. Sometimes, editors will put in quote marks which confuses my html code. How do I convert any special chars like the qoute mark to html entities? A bit like PHP's htmlspecialchars or htmlentities.

Thanks

# Answer
I always do this with a simple plugin which runs unformatted text through EE/CodeIgniter's `format_characters()` method (though rather than use the plugin tag in my template, I usually select it as the formatting method for that field or Matrix column).

I've thrown it up on GitHub just now.
> 2 votes

---
Tags: matrix, text-formatting, html-entities
---


# Question
Title: When using Structure, how do I use a different template for category pages?
I'm using Structure in a new EE site and I'm wondering, what's the best way to use a different template when on a category page? For example, I have a section called "Watch" located here:

`/watch/`

When clicking on a category (film genre) you land here:

`/watch/genre/comedy`

Then when clicking on a film you land here:

`/watch/film/superman`

All three of these pages have different templates. I have the `/watch/` index template worked out, as well as the detail template for `/watch/film/superman`. It's the category template for `/watch/genre/comedy` that I'm unclear about.

Will I need to tackle this with conditional `{if …}{/if}` statements in a single template, or is there a smarter way?

# Answer
Right now, you'd need to have a placeholder page to show categories because adding random segments to Structure URLs will result in a 404. Or, you can use conditionals in one main template like you mentioned and use Freebie to allow random segments: http://devot-ee.com/add-ons/freebie. Option #2 is more flexible.
> 1 votes

---
Tags: templates, categories, structure
---


title: auto_replace-### in Wygwam field

text:
# Question
Title: auto_replace-### in Wygwam field
My client has created a link to an entry within a Wygwam field, and we also have a link to the same entry as a Playa/relationship link.

The Playa/relationship link is working fine. In the Wygwam field, we see:

```
http://staging.domain.com/reference-item/auto_replace-100

```

I suspect I know what's going on, that something changed with this entry and the Wygwam field wasn't updated. I've looked in the Source view, and that's the value stored there as well.

What's the best way to correct this? Just update such links in the Wygwam field? Or is there a better way to cover this?

We're also using Title Master to generate URL Titles from a few different fields in the entry being referenced. An update may have broken something on that end. I'm aware of a few issues on that front that we need to work through as well.

(May be related to MX Title Control + Structure)

Thanks!

# Answer
I've been having a similar issue for several months with Title Master and haven't been able to get any assistance from the developer. I eventually had to abandon using a "url title" that was composed of multiple components and do something a little more old fashioned.
> 1 votes

---
Tags: wygwam, structure, links, title-master
---


title: sort by category

text:
# Question
Title: sort by category
I am outputting a list of channel entries. Each entry has 2 category assignments but I need to sort the list alphabetically by one of the categories.

Here is my current code that sorts alphabetically by entry title:

```
{exp:channel:entries
                    channel="properties"
                    orderby="title"
                    sort="asc"
                    dynamic="no"
                    disable="category_fields|member_data|pagination"
                }
                <tr>
                    <td>{title}</td>
                    <td>{categories show_group="4"}{category_name}{/categories}</td>
                    <td>{categories show_group="5"}{category_name}{/categories}</td>
                    <td>{property_sqft}</td>
                    <td><a href="{url_title_path='our-properties/detail'}" class="pluslink">View Property</a></td>
                </tr>
                {/exp:channel:entries}

```

So I basically need to sort the entries by {category\_name} of category group 5.

How can I achieve this?

Thanks for any help.

# Answer
I would think this would be a good time to use Stash add-on. You could wrap your channel entries tags with Stash set\_list, which would save the properties as a Stash variable, and then output the list and orderby/sort by the category 5 field. Overall you would end up with more options for ordering and sorting your list. See the Stash docs for set\_list and get\_list for info and examples. Basically it would look like:

```
{exp:stash:set_list name="my_list"}
    {exp:channel:entries
        channel="properties"
        orderby="title"
        sort="asc"
        dynamic="no"
        disable="category_fields|member_data|pagination"
    }
        {stash:item_title}{title}{/stash:item_title}
        {stash:item_cat_4}{categories show_group="4"}{category_name}{/categories}{/stash:item_cat_4}

        etc....

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

{exp:stash:get_list name="my_list" orderby="item_cat_5" sort="asc"}
    <tr>
        <td>{item_title}</td>
        <td>{item_cat_4}</td>

        etc...

{/exp:stash:get_list}

```
> 0 votes

---
Tags: categories, sort
---


# Question
Title: Database error when upgrading to Assets 2.1.3
I've been trying to upgrade from Assets 1.2.1 to 2.1.3 but I get this error when I click "run module updates" as the docs explain to do. The error I receive is:

> A Database Error Occurred Error Number: 1054
>
> Unknown column 'file\_path' in 'exp\_assets'
>
> ALTER TABLE exp\_assets MODIFY COLUMN file\_path VARCHAR(255) NOT NULL
>
> Filename: /path/to/html/third\_party/assets/upd.assets.php
>
> Line Number: 403

ExpressionEngine is version 2.5.3

# Answer
The update stalled and left a few tables in the database that needed deleted. I deleted the tables and reran the install. Working fine now.

Thanks to P&T for all their support!
> 1 votes

---
Tags: assets
---


# Question
Title: Need shipping help for EE Exp:resso Store
To keep a long story short. I'm running EE2.5.5 CMS and Exp:resso Store for the e-commerce bit.

My client sells a few items from his website, but has a warehouse do the shipping for him and they bill him once a month.

I want to use the UPS Shipping plugin that comes with Store, however I cannot get the Access Key, Username, Password required to calculate shipment costs... because that info does not belong to my client, it belongs to the warehouse who uses that same account to ship a variety of packages for other customers such as my client. When contacted, they mentioned something about a Generic UPS quoting account. is there such a thing? If not, how would you recommend me getting around this issue?

The original idea was to use the Default Shipping Plugin, but there's just too many variations for the client to keep track of and not lose money on when shipping.

Thanks!

# Answer
> 3 votes
You should be fine creating your own account with UPS and using that as the API that is used only gets the live rates and does not actually create a shipping ticket in UPS so your account shouldn't be charged anything.

# Answer
> 2 votes
Sure. Just call UPS and ask to set up an account. They will need a credit card, but as Justin mentioned Store doesn't request any shipments, so unless you do there won't be any charges.

This is what we did to develop the shipping integration for Store, so I know it's possible :) The UPS site and processes are a bit of a nightmare, but once you figure that out it's all downhill. If you're stuck, it's usually easier to call them rather than fighting with their website.

# Answer
> 2 votes
Thanks Adrian! We're in exactly the same situation in that we're working with a company who uses a local fulfillment center / warehouse with its own UPS account. So I did exactly as you describe.

I had to go through 3 or 4 "call levels" before I got to "specialty products" but I created a free account and successfully requested an API access key and I didn't have to use a credit card, either. Incidentally, the direct line as of 18 June 2013 for this UPS department in the US is 1 800 247 9035.

As for the Store settings, I added the username, password, and API access key into the UPS plugin. Is there anything else I need to do? About to begin testing.

Thanks! Keep up the work on a great software product -- Exp:resso Store is by far the best I've ever developed with.

---
Tags: expresso-store
---