title: Fixed_order makes entry not display

text:
# Question
Title: Fixed_order makes entry not display
I found this question and answer that has helped me to get where I currently am. My setup is very very similar to the setup discussed in this thread.

**HUGE UPDATE / EDIT**

I deleted pretty much my entire first post just to let everyone know.

Now I have a fresh install of EE and the modules below, and am working locally on MAMP.

* EE - 2.6 ( had no install issues!)
* Matrix - 2.5.4
* Assets - 2.1.2
* Playa - 4.4.2
* Wygwam - 2.7.1
* Better Work Flow - 1.6 (not being used to manage these pages yet)
* MAMP PHP - 5.3.6
* MySQL: 5.5.9 Please note that I do not have Structure installed this time around. I also removed the Structure Tag related to this issue.

I have simplified my template as much as I could which is below.

```
{embed="includes/_html_header"} <!-- includes opening body tag -->
<div class="container">
    {exp:channel:entries channel="schedule" disable="categories|member_data|pagination"}
        <h1>{title}</h1>
        {schedule_rooms_day_1}
            {cell_1} - {cell_2} - {cell_3}
        {/schedule_rooms_day_1}
        <br/>
        <br/>
        {schedule_day_1}
            {cell_1}
                Session Name = {session_name}<br/>
                Session Speaker Child ID - {session_speaker:child_ids} (these are pulling in correct IDs, yippie!) <br/>
                Need to embed information below here about speaker of session<br/>
                {embed="includes/_speakers_import" entry_ids="{session_speaker:child_ids}"}<br/>
                <hr>
            {/cell_1}
        {/schedule_day_1}

    {/exp:channel:entries}
</div>

```

{embed="includes/\_js"} {embed="includes/\_close\_page"}

I have "{session\_speaker:child\_ids}" to help show me which entries should be pulled in. This is pulling in the correct information, same with my embed variable below.

Here is my embed template.

```
{exp:channel:entries channel="sessions" dynamic="no" fixed_order="{embed:entry_ids}"}
{session_speaker}
    Embed value from embed - {embed:entry_ids} (these are still displaying correct info) <br/>
    Speaker Name - {speaker_name}<br/>
{/session_speaker}

```

{/exp:channel:entries}

Please note my issue still remains the same as before, if I include the fixed\_order param no information shows up. If I try to do something like fixed\_order="2|3|6|4" nothing is displayed. Same with entry\_id. If I remove fixed\_order all my speakers show up, and my embed variable displays the correct entry id, which is a good thing.

On an other site I was trying to pull an embed variable into a param and was not able to get my information to display properly. I am wondering if there is a setting I have not turned on that might be effecting my templates.

With my clean install there were a few issues that showed up in my developers log which can be seen in the linked image. Please note there is an error with Structure and Playa.

For Lisa I hope that my updated information is more helpful, as well as the developers log!

Travis, I appreciate the help and with the removal of Structure from the mix feel free to move forward and help others with Structure related issues!

Again, I appreciate the help and hopefully we can figure this out together!

# Answer
I don't see where this fixed\_order parameter is. Does it work if it's not in an embed and straight in the page?
> 1 votes

---
Tags: matrix, playa
---


# Question
Title: What is the default interval time for batch emails?
We are using EE's built-in communication tool to send out an initial email to all of the site's members letting them know about the new site design and functionality updates. I would like to batch process these 6000 emails. I have "Use Batch Mode" set to yes, and the number of emails per batch is set to 300.

Does anyone know what the default interval time is for batch emails in EE and whether or not it is customizable? I haven't been able to find it anywhere in the documentation. Thanks!

Disclaimer: I tried to push a service such as MailChimp in lieu of the built-in communicate tool, but that's not an option for us at this point in time.

# Answer
> 1 votes
In short it isn't configurable via EE as far as I know. It will automatically handled depending on latency between your server and SendGrid but SendGrid will have very high send rates as they're a dedicated SMTP provider. They don't seem to specify the rate limits but they do make mention of the factors that will impact delivery rates:

> A local mail server, such as Postfix, is the most robust way to send email through SendGrid when configured to queue all email from your application and then relay the messages through SendGrid as a smart host. This has the least latency from your application’s perspective with the added benefit of handing your email off to a fault tolerant server. If internet connectivity between your servers and ours drops, a local mail server gracefully handles queuing and resending the email, as opposed to building that intelligence into your sending application.
>
> Local mail servers also have advantages at high volume as they can use some of the more complex parts of the SMTP protocol, such as connection reuse and pipelining. With these techniques a mail server sends significantly more traffic in a given time than if you have individual scripts connecting for each message.

---
Tags: email
---


# Question
Title: Safecracker frontend uploaded images not uploading to specified directory and not showing in backend entries
I have created a channel called user\_entries, and some channel fields for name, description and file! These fields are created to be populated by a safecracker frontend form. This would allow users to submit 8 entries to the site with status pending(already created). Also to allow free uploads for users in the frontend, I have created a user called anonymous and assigned it to the Guest group. I have allowed this group to post to the channel user\_entries from frontend using said safecracker form. The status needs to be pending so that the admin can change status to Open in backend, so as to filter out any entries that do not comply with the spirit of the website!

Now, everything works perfectly apart from the files. The images are being uploaded to the directory that I have created inside {site\_url}/images/uploads/entries. The folder is created and the correct path specified in the CP. Can anyone tell me what I'm doing wrong? Here is the code for the safecracker form:

```
   <!--============SAFECRACKER STUFF GOES RIGHT HERE=============-->
{exp:safecracker channel="user_entries" return="entries/confirmation"
include_jquery="no" error_handling="inline"
logged_out_member_id="2"//this is the ID for user anonymous
rules:your_name="required"
rules:choice_number_1="required"
rules:choice_number_2="required"
rules:choice_number_3="required"
rules:choice_number_4="required"
rules:choice_number_5="required"
rules:choice_number_6="required"
rules:choice_number_7="required"
rules:choice_number_8="required"
rules:title="required"
dynamic="no"
}
<br class="clearfix" />
            <hr />

<h5 class="feature">Some housekeeping!</h5>
<br class="clearfix" />
            <hr />
<h2 class="feature">
    <label><strong>First please tell us your name</strong></label>
    <input type="text" class="text" name="your_name" value="{your_name}"/>
    <label><strong>Give your post a memorable name</strong></label>
    <input type="text" class="text" name="title" value="{title}"/>
  </h2>
 <br class="clearfix" />
            <hr />
<h2 class="feature">
    Now make your choices!
  </h2>

<fieldset class="five columns alpha aside">

  <!--Choice one code-->
  <h5>
    <label><strong>Choice number 1</strong></label>
    <input type="text" class="text" name="choice_number_1"/>
  </h5>
  <p>
    <label>Choice 1 description</label>
    <input type="text" class="text" name="choice_1_description"/>
  </p>
<br />
    <label>Choice 1 image</label>
    <input type="file" class="" name="choice_1_image" value="{choice_1_image}"/>
</fieldset>

<!--====Choice twocode-->
<fieldset class="five columns omega aside">
  <h5>
    <label><strong>Choice number 2</strong></label>
    <input type="text" class="text" name="choice_number_2"/>
  </h5>
  <p>
    <label>Choice 2 description</label>
    <input type="text" class="text" name="choice_2_description"/>
  </p>
  <br />
    <label>Choice 2 image</label>
    <input type="file" class="" name="choice_2_image"/>

  </fieldset>

<!--===============Choice three code-->
<fieldset class="five columns alpha aside">

<h5>
    <label><strong>Choice number 3</strong></label>
    <input type="text" class="text" name="choice_number_3"/>
  </h5>
  <p>
    <label>Choice 3 description</label>
    <input type="text" class="text" name="choice_3_description"/>
  </p>
<br />
    <label>Choice 3 image</label>
    <input type="file" class="" name="choice_3_image"/>

</fieldset>

<!--====Choice four code-->
<fieldset class="five columns omega aside">
  <h5>
    <label><strong>Choice number 4</strong></label>
    <input type="text" class="text" name="choice_number_4"/>
  </h5>
  <p>
    <label>Choice 4 description</label>
    <input type="text" class="text" name="choice_4_description"/>
  </p>
<br />
    <label>Choice 4 image</label>
    <input type="file" class="" name="choice_4_image"/>
  </fieldset>

<!--===============Choice five code-->
<fieldset class="five columns alpha aside">

<h5>
    <label><strong>Choice number 5</strong></label>
    <input type="text" class="text" name="choice_number_5"/>
  </h5>
  <p>
    <label>Choice 5 description</label>
    <input type="text" class="text" name="choice_5_description"/>
  </p>
<br />
    <label>Choice 5 image</label>
    <input type="file" class="" name="choice_5_image"/>
</fieldset>

<!--====Choice six code-->
<fieldset class="five columns omega aside">
  <h5>
    <label><strong>Choice number 6</strong></label>
    <input type="text" class="text" name="choice_number_6"/>
  </h5>
  <p>
    <label>Choice 6 description</label>
    <input type="text" class="text" name="choice_6_description"/>
  </p>
<br />
    <label>Choice 6 image</label>
    <input type="file" class="" name="choice_6_image"/>
  </fieldset>

<!--===============Choice seven code-->
<fieldset class="five columns alpha aside">

<h5>
    <label><strong>Choice number 7</strong></label>
    <input type="text" class="text" name="choice_number_7"/>
  </h5>
  <p>
    <label>Choice 7 description</label>
    <input type="text" class="text" name="choice_7_description"/>
  </p>
<br />
    <label>Choice 7 image</label>
    <input type="file" class="" name="choice_7_image"/>
</fieldset>

<!--====Choice eight code-->
<fieldset class="five columns omega aside">
  <h5>
    <label><strong>Choice number 8</strong></label>
    <input type="text" class="text" name="choice_number_8"/>
  </h5>
  <p>
    <label>Choice 8 description</label>
    <input type="text" class="text" name="choice_8_description"/>
  </p>
<br />
    <label>Have an image for Choice 8 image?</label>
    <input type="file" class="" name="choice_8_image"/>
  </fieldset>
<!==============End the fieldsets here for the 8 choices-->
<br class="clearfix" />
            <hr />
  <p>
  <input type="submit" class="button yellow" value="Submit your choices now!" />
</p>
   <br class="clear" />
   <h2 class="feature">
    Your entries will be reviewed by either Luke or Scott and will then be published. Please keep the conversation clean. Crunch away me hardies!
  </h2>
{/exp:safecracker}

```

Your help in this is much appreciated.

# Answer
Instead of:

```
<label>Choice 1 image</label>
<input type="file" class="" name="choice_1_image" value="{choice_1_image}"/>

```

Try:

```
<label>Choice 1 image</label>
{field:choice_1_image}

```

I think you also need to add `safecracker_head="yes"` to get the image thumbnails to work properly.

Also, is jQuery in `<head>` tags?
> 1 votes

---
Tags: safecracker-file
---


# Question
Title: How to migrate an existing site into an MSM install?
I have inherited a client project that involves a number of EE installs (6 in all, though some are MSMs themselves, so total number of sites is ~10) which I would like to merge into a single MSM install.

One of these installs is EE1, the rest are various versions of EE2. All use Matrix, Playa and Assets. The EE1 site could be migrated to EE2 though (the DB at least).

I'm trying to work out the best way of migrating the data (as far as I am aware there is no first party tool to import an existing site into an MSM install).

At the moment our approach is an increasing complex custom script that maps data from the columns of the old DB to the (manually created in the case of exp\_channel\_titles/exp\_channel\_data) columns in the new db. I'm concerned that this is actually such a complex task that we're going to miss something in the process though.

If you have accomplished this task in the past, how did you go about it? What approach/tools did you use etc.

# Answer
We not merged like this, but I would probably go about it like this:

* set up the main site
* set up the msm sites and don't import any channels.
* upgrade all EE1 sites (you can check license, but I'm pretty sure if you do this locally, you aren't breaking any rules)
* use field editor from mighty big root to export the channel fields and import them into the new set up.
* use datagrab to import all the entries etc.

It's probably the best way. Can think of unless someone else has a suggestion?
> 2 votes

---
Tags: multi-site-manager, database, migration
---


# Question
Title: {exp:assets:folders} not working with parent_folder parameter set
EE version: 2.5.2 Assets version: 2.1.2

I'm using the {exp:assets:folders} tag with the parent\_folder parameter set and it's not working when that parameter is set.

This is an MSM site and I'm working on the 2nd site. I can see everything just fine within the control panel.

I've setup a dedicated page to test this out so that there aren't conflicts with other add-ons. Here's my code:

```
<ul>
{exp:assets:folders parent_folder="{filedir_7}human-resources"}
    <li>
        <a href="{path=assets/view/{folder_id}}">{folder_name}</a>
        {if total_subfolders}
            <ul>
                {subfolders}
            </ul>
        {/if}
    </li>
{/exp:assets:folders}
</ul>

```

This code does work:

```
<ul>
{exp:assets:folders}
    <li>
        <a href="{path=assets/view/{folder_id}}">{folder_name}</a>
        {if total_subfolders}
            <ul>
                {subfolders}
            </ul>
        {/if}
    </li>
{/exp:assets:folders}
</ul>

```

What's strange is that using the parent\_folder parameter worked at one time. I've looked back at my check-ins and don't see anything that would conflict with the Assets code.

I tried some debugging by looking at the \_get\_folder\_id\_by\_tagpath function in mod.assets.php. I noticed that $tagpath is passed in as `http://intranet.compassoncology.com/uploads/human-resources` instead of `{filedir_7}human-resources`. The code appears to be expecting the latter. Is there something that could have happened to cause `{filedir_7}` to be replaced?

Thanks for any help or direction!

# Answer
> 1 votes
I can reproduce this, so I've submitted it as a bug. We'll update here with progress.

Thank you!

---
Tags: assets
---


# Question
Title: Problem converting {comment_date} from string to var
Hi we're using channel ratings module, and want to run a routine that basically closes a comment if its rank is 1 at 30 days of age, rank 2 at 60 days etc.

The {comment\_date} is yeilding a 0 whenever any method or php function is attempted on it. I have everything working except this piece and I can't figure out what the problem is.

Here's what I have:

```

    function GetComment_Interval($comment_date,$current_date)
{

      $intervalSeconds = $current_date - $comment_date;
       $intervalDays = round($intervalSeconds / 86400); // days since
       return $intervalDays;
}

{exp:switchee variable="{rating:overall:rating}" parse="inward"}
            // 1 star reviews" expire in 30 days,
            {case value="1"}
              EE->localize->string_to_timestamp($commD); // this throws error of 'invalid date format'
              $currD = $this->EE->localize->now;
              $interval = GetComment_Interval($commD2,$currD); // find days between
              echo $interval." days";
               if ($interval >= 30){

               ?>

            {/case}
            // 2 star reviews after 60 days
            {case value="2" default="Yes"}

               if ($interval >= 60){

               ?>

            {/case}
            // 3 star reviews after 120 days
            {case value="3"}

               if ($interval >= 120){

               ?>

            {/case}
           //It must be 4 or 5 start therefore always show it.
           {case default="Yes"}{/case}

        {/exp:switchee}

```

# Answer
\[Just a note to add here that the real solution was in achieving workable EE parse order, dealt with in the comments to this answer.\]

Thanks, Brandon, for putting this here from previous tweets.

From what you show, I would guess the problem is that you're trying to evaluate {comment\_date} outside the template code range where it can be valid. That would be only within the {exp:comment:entries} tag pair.

For a simple check, just put a non-php {comment\_date} in your template near your attempted use of it, surrounded by some text you'll recognize. You'll see a big integer number if it's in a valid place; blank otherwise. Something like,

```
<p>Here's my comment_date: |{comment_date}|.</p>

```

Once you have this working, I think you're also trying to access comment\_date in a way that won't work, within your php code as shown. You need to use a form like the following to do it, setting your own php var from the tag - I've included a proof echo as well.

```
<?php $mycdate = "{comment_date}"; echo 'php comment_date is |'.$mycdate."|"; ?>

```

If it helps to know, what I did as mentioned to work sensibly with a like situation was make a (very) simple plug-in, passing across the template variables to it. This allows you to do anything you want in PHP without having inline code, or permitting it.

I was chasing another issue which I thought you might have had, which was to have both {entry\_date} and {comment\_date} be valid to compare them (the ...minutes/days/months-later presentation). The EE exp:entries-exp:comment:entries tags work very strangely together, as we've long known, and the variables you want aren't ever both valid at any possible location.

To solve this, I used croxton's Stash. This gets complicated, though, to have the right combination of parse='inward' parameters so that you actually get the variables passed across. So let's not get into that unless you need it.

Does locating your code within the {exp:comment:entries} loop not solve your problem? You should certainly have {comment\_date} valid there, and can prove it simply with the tests and EE-php variable access mentioned above.
> 0 votes

---
Tags: comments
---


title: EE 2.6.0 Password Reset not working

text:
# Question
Title: EE 2.6.0 Password Reset not working
I've been locked out of a site I'm developing as my password is no longer accepted.

What I've done so far.

1. Reset the password 10+ times
2. copied password hash from database of site I know works into password hash of site I can't access
3. generated an md5 hash and pasted in to password field
4. reset password again via /admin.php hash changed in database,but I still can't access
5. tried all of the above after clearing cookies
6. tried again in 3 different browsers

There are no other registered users that I can use to login, member registration has been turned off in the CP so I can't create a new user either.

Have also checked the exp\_reset\_password table and all values appear to be empty.

Please advise.

# Answer
Do you have a php enabled template that's publicly accessible? (Or that can be made publicly accessible?)

If so the following code on the template *should* log you in as whatever member\_id you specify.

```
$member_id = 1; // Or whatever your member ID is
$this->EE =& get_instance();
$this->EE->session->create_new_session($member_id);

```
> 2 votes

---
Tags: ee2, login, password
---


title: Playa parent multiple entry_ids

text:
# Question
Title: Playa parent multiple entry_ids
Is there a way to select parents from multiple child entry ids? For example, I have a blog channel with a playa relationship,via a blog\_staff field, to a people channel (to identify authors of blog entries) and a team channel with a playa relationship, via a team\_members field, to people as well (to group them into teams). I tried to query for blog entries of multiple people but seem to be limited to only one.

I tried the playa field feeding the people entry\_ids through an embed to a parents field to grab the associated blog entries:

```
{team_members}
    {embed="includes/.bp_by_staff" entry_id="{entry_id}"}
{/team_members}

```

The .bp\_by\_staff template trying to use those people entry\_ids to look up their blog posts:

```
{exp:playa:parents channel="blog"  entry_id="{embed:people}"}
    {title}
{/exp:playa:parents}

```

Now, if {embed:people} is just one entry\_id, say "18", this works great, the blog posts get found. But if {embed:people} yields multiple entry ids (the team has more than one person), say "18|29", it doesn't work.

Looking through the profiler for the generated sql of the failing case, one can see why. It seems like including more than one entry\_id breaks the sql query which uses "=" rather than " in " for the where clause:

```
SELECT DISTINCT(rel.parent_entry_id) AS entry_id
FROM exp2_playa_relationships rel
WHERE rel.child_entry_id = 18|29

```

If the where clause were using "in" as in `WHERE rel.child_entry_id in (18, 29)` the query works correctly.

Anyone find a workaround for getting results for multiple entry\_ids ?

# Answer
Did you try the coparents tag? Isn't this what it's for?
> 1 votes

# Answer
**Revising my answer**, The multiple entry\_ids issue *was* addressed, in version 4.2. Upgrading Playa seems to resolve it. Templates used:

```
{embed="includes/.nested-entries" entry_ids="{team_members:child_ids}"}

```

and .nested\_entries embed would take the entry\_id and look up the blog written by that "people" entry:

```
{exp:playa:parents entry_id="{embed:entry_ids}"  channel="blog"  field="blog_staff"  orderby="date"
limit="10" disable="member_data|categories" paginate="bottom" }

    {title}

 {pagination_links}

{/exp:playa:parents}

```

Side point, needing paginagion links, i made sure they weren't disabled by explicitly specifying what to disable.
> 0 votes

---
Tags: playa, pixelandtonic
---


title: Module to sell entries?

text:
# Question
Title: Module to sell entries?
I have been looking for a way to sell EE entries.

I have come across Membrr, but I have seen quite a lot of negative feedback.

Does anyone know of any other modules that would allow this?

# Answer
As far as I know Membrr is the only way to do this - however, if you know PHP/CI, you could write a custom module to do this which ties in to any of the e-commerce platforms out there.

I did something similar a while ago which used Brilliant Retail and simply allowed for entries to be created and then 'paid' for which had the action of putting them live.

All I did was to add the 'entry\_id' being paid for into the cart data and then using the br\_order\_create\_after hook pulled this out and updated the status to 'live'.
> 2 votes

# Answer
You may have already seen this but there is an answer to another question (here: Recurring subscription for posting channel entries). They came to the conclusion that Simple Commerce, Membrr or Carthrob could work. That question is similar but not exactly the same.
> 0 votes

---
Tags: module, ecommerce, membrr
---


title: Displaying 5 digit entry_ids

text:
# Question
Title: Displaying 5 digit entry_ids
Want to display entry\_id's in a numeric list so they can be sorted with jquery plugins.

Heres current code to achieve this, basically adding appropriate amount of zeros before entry\_id so all are 5 digits:

```
 Entry ID {if entry_id < '10'}0000{/if}{if entry_id < '100'}000{/if}{if entry_id < '1000'}00{/if}{if entry_id < '10000'}0{/if}{entry_id}

```

There has to be a cleaner way!?

# Answer
You can use CE String native method of `str_pad` to pad the `{entry_id}` to a certain length:

```
{exp:ce_str:ing str_pad="5|0|:CONST:STR_PAD_LEFT"}{entry_id}{/exp:ce_str:ing}

```
> 2 votes

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


# Question
Title: Saving PayPal email address in CartThrob
Using CartThrob and PayPal Express, is it possible to save the PayPal email address that is used when an order is placed?

At the moment, I'm only saving the first name, last name, and email address that is entered on the checkout page of the website, but this email address may be different to the PayPal email address.

The only info that is currently being returned from PayPal is the transaction ID and error message, so just wondering if and how we can save the PayPal email address too, thanks.

# Answer
Looks like you would have to customise the paypal express payment file to do the following and then modify it to capture the e-mail IF given back.

```
Obtaining Buyer Consent to Receive Promotional Email
You can obtain the buyer’s consent to receive email promotions on PayPal pages. PayPal returns the email address in the response to GetExpressCheckoutDetails and DoExpressCheckoutPayment.

NOTE:Obtaining buyer consent to receive promotional email is available with API Version 61.0 or later.
To obtain the buyer’s email address, set the BUYEREMAILOPTINENABLE field to 1 in the call to SetExpressCheckout.

https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECCustomizing

```
> 1 votes

---
Tags: cartthrob, paypal
---


# Question
Title: Dynamic {site_name} inside channel:entries tag with site="" parameter
Anyone know if it's possible to get back the name of the site an entry is from dynamically? Simple code example below:

```
{exp:channel:entries channel="news" site="siteA|siteB"}
  <h2>{title}</h2>
  <p>Published: {entry_date format="%j %M %Y"} in {site_name}</p>
{/exp:channel:entries}

```

Tried using {site\_name} and {site\_label} but they just show the current site. Be nice to be able to get the site name and short name out.

Cheers, Ant

# Answer
For the name you could try a conditional with entry\_site\_id.

```
<p>Published: {entry_date format="%j %M %Y"} in {if entry_site_id == 1}Site name 1{/if}{if entry_site_id == 2}Site name 2{/if}</p>

```
> 1 votes

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


# Question
Title: How can I use Low Variables to store Freeform data, then call to page dynamically?
I have an existing site with a good number of forms that use Freeform, currently coded directly into the templates. I'd like to pull them out of the templates and into low variable fields, then call them to a page either via (a) using a segment or (b) via a field in a channel entry.

Setting up the variable works fine, and if I tick the parse early box and code it directly into the template the form displays great. However, when I try to use a segment variable or channel fieldtype to display it the form tags do not get parsed.

So for example, if I set up a variable called "form-my-page", and code it directly into my template as:

{form-my-page}

Works great.

If I try to do something like:

{form-{segment-2}}

Doesn't parse.

Or if I attempt to use a fieldtype to attach a form to a channel entry, I find I'm unable to use early-parsed variables, and otherwise the form data doesn't get parsed.

I realized that I could use Solspace's new composer and fieldtype, but I don't want to have to redo all my custom forms right now. Thanks for any insight!

# Answer
You can do this in two ways, both require that you turn *off* early parsing for the form variables, and assuming you're using regular Textarea LVs. Once turned off, use the **tag syntax** instead of the variable syntax, thus:

```
{exp:low_variables:single var="form-{segment_2}"}

```

The variables should now turn up in the LV Fieldtype as well, so you can use the fieldtype in combination with the tag syntax as well:

```
{exp:low_variables:single var="{my_low_variables_custom_field_name}"}

```
> 2 votes

---
Tags: solspace-freeform, low-variables
---


# Question
Title: Control panel (CP) top right link not redirecting
After upgrading to 2.5.5, the top right link that links & redirects to the client site is not working.

The link is there, and generates the correct URL, but redirect never happens and we're stuck with the blank page:

http://www.clientsite.com/?URL=http://www.clientsite.com/

What could be causing this issue?

Thanks everyone!

P.S. Unfortunately none of the solutions at the related Control Panel (CP) Link Button is not working issue worked.

# Answer
> 1 votes
Okay - it turned out to be the .htaccess after all. Replaced previous rewrite that another developer had with this:

```
RewriteEngine On
RewriteBase /

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

```

And the CP link now links correctly out to the main site.

# Answer
> 0 votes
I've had a similar issue on a windows server only. Might that be related? Not an answer but it might narrow the issue down if so.

---
Tags: control-panel
---


title: Unable to send e-mails using SMTP

text:
# Question
Title: Unable to send e-mails using SMTP
I am not being able to send e-mails through EE (I am using version 2.1.3 Build 20101220).

I just want my application to relay to an external SMTP server.

I am editing both these files: \expressionengine\libraries\EE\_Email.php \codeigniter\system\libraries\Email.php

Is there any other file to look at?

Best regards,

# Answer
> 4 votes
Why are you hacking core files? Why not just set the mail preferences to use SMTP?

Go to Admin-\>Email Configuration, select SMTP for your email protocol and enter any necessary authentication info in the fields provided.

---
Tags: smtp
---


# Question
Title: Channel entry title updated with member email
I had developed an extension (hooked with zoo\_visitor\_register\_end) using Channel Entry API which creates a new channel entry by setting the title of this entry with a custom field value of Zoo Visitors.

But faced a sudden strange problem. Now its updating the new channel entry's title with member's email.

Everything was working great since more than 5 months. The problem came after updating EE 2.5.5 (2 weeks ago). Site is MSM.

I am hitting my head since yesterday but couldn't find any pointer. I 'll highly appreciate your help.

**Edited ***** Below is the code I am using to create new entry via channel entry API:

```
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_entries');
$this->EE->api->instantiate('channel_fields');

$data = array(
        'title'         => $member_data['CUSTOM_FIELD'],
        'entry_date'    => $this->EE->localize->now,
        'author_id'     => $member_id,
        'status'    => 'new',
        'site_id'   => $this->EE->config->item('site_id'),
        'channel_id'    => 14
);

if ($this->EE->api_channel_entries->submit_new_entry(14, $data) === FALSE)
{
    $errors = $this->EE->api_channel_entries->errors ;
}
else
{
    $entry_id = $this->EE->api_channel_entries->entry_id;
}

```

# Answer
Be sure to pass the 'entry\_id' index in the data array. It seems redundant, but I have ran into the same issue. Report back and let me know if this fixes your issue.

```
$data['entry_id'] = $entry_id;

$this->EE->api_channel_entries->update_entry($entry_id, $data);

```

*It's important note, this is deprecated as of 2.6*

http://ellislab.com/expressionengine/user-guide/development/api/api\_channel\_entries.html#update-entry
> 1 votes

---
Tags: channel-entries
---


title: control members by API

text:
# Question
Title: control members by API
My client wants to control the member accounts (username/email/password etc) by their own API. So essentially when they update their own database the EE database would update automatically.

Any way this can be achieved? If so what does their API have to include?

# Answer
> 1 votes
It's certainly possible, but you would have to write your own API (in the form of an ExpressionEngine module) for their main system to access. EE doesn't have any built in web API to do this sort of thing (unless you already have access to the database directly, which might be easier).

# Answer
> 1 votes
Is EE in the same DB or an external one?

If they are both mySQL you could simply write a trigger on UPDATE or INSERT into their database that will then update or insert into the EE database. You can skip all the API stuff and let the DB handle it.

---
Tags: members
---


# Question
Title: Output Code Once if Conditional is True for One or More Entries in a Group
I'm displaying a list of categories, and I want to add a little "new" icon next to the category name if one or more entries in that category have been created in the last day. But I can't figure out how to display code just once if multiple entries return true. I got this far using GWCode Categories and MX Calculator:

```
{exp:gwcode_categories
    cat_id='4'
    depth='2'
    show_empty='no'
    style='linear'
    variable_prefix='gw:'
    parse='inward'
}
    <li>
        <a href="{path='topics/{gw:cat_url_title}'}">
            {gw:cat_name}
            <span aria-hidden="true" data-icon=""></span>
            {!-- If an entry in this category has been added in the last day, add the "new" icon --}
            {exp:channel:entries
                channel='{sp_channels}'
                dynamic='no'
                category='{gw:cat_id}'
                disable='categories|pagination|member_data|custom_fields'
            }
                {exp:mx_calc expression="{current_time} - 86400"}
                    {if {entry_date} > {calc_result}}
                         <b class="new">New</b>
                    {/if}
                {/exp:mx_calc}
            {/exp:channel:entries}
        </a>
    </li>
{/exp:gwcode_categories}

```

But that outputs the "new" tag once for *every entry* that passes the conditional.

How do I get the code to output *just once* if any entries return true?

# Answer
> 2 votes
If you just add a limit="1" parameter to the channel entries tag it will pull the most recent entry anyway - if you think about it, you only really need to see if that single entry was added in the last day, not the whole lot.

---
Tags: categories, conditionals, gwcode-categories, mx-calculator
---


# Question
Title: Porting a text input field to file field in Expression Engine
I have a site that has a lot of legacy images taken from the site they were on previously, these are stored in a field called legacy-images as a text input. This is basically the folder path from the domain root.

The problem is I need to harness the power of the file resizing options EE has built in and to do this I need to have all these images setup as a file field. Manually moving them isn't an option as there is around 1500 entries. Any idea how I can achieve this?

# Answer
You could try using the EE search and replace tool (Tools \> Data \> Search and Replace). Just replace the path with {filedir\_X}, where X is the ID of the upload destination that you've setup in the CP.
> 0 votes

# Answer
What I would look into doing is setting the directory where the images currently reside as an upload directory. Synchronize the directory so that EE knows where everything is located. At this point you'll need to take note of the file uploads id number and create a database query that will convert the field you need and set everything correctly. Be sure to back up the database before running the query just in case.

My SQL is very weak so am unable to write this out for you strait off here, but I'm sure that google or some other person in the community will help you write the query you need.

You might also try setting up the file upload location as I mentioned and then converting the field in question to a file field and see what happens. Be sure to backup the database before doing this just in case it doesn't work. - this second option is probably not the best approach.
> 0 votes

---
Tags: file-uploads, fields
---


title: conditionals using switchee

text:
# Question
Title: conditionals using switchee
I was wondering if someone can tell me how to approach this. I have some code that runs through all available entries within a channel and determine if its a match to the pre-determined variable. I can output the matches fine but I want to display a standard form if there is no match.

Here is my code so far

```
{exp:channel:entries channel="dynamic_activity" dynamic="no" author_id="CURRENT_USER"}

    {exp:switchee variable = "{related_activity_id}/{related_adventure_id}" parse="inward"}
        {case value="{embed:related_activity_id}/{embed:related_adventure_id}"}
            {exp:safecracker
                channel="dynamic_activity"
                return="/admin/story/"
                use_live_url="no"
                error_handling=“inline”
                preserve_checkboxes=“yes”
                include_jquery="no"
                author_id="CURRENT_USER"
                entry_id="{entry_id}"
            }
                <input type="text" name="title" id="title" value="{title}">
                <input type="text" name="related_adventure_id" id="related_adventure_id" value="{related_adventure_id}">
                <input type="text" name="related_activity_id" id="related_activity_id" value="{related_activity_id}">
                <input type="text" name="childs_name" id="childs_name" value="{childs_name}">
                <input type="submit" name="submit" value="Update" class="button small red">
            {/exp:safecracker}
        {/case}
    {/exp:switchee}

{/exp:channel:entries}

```

Here is the form that I want to display if no matches are found.

```
{exp:safecracker
            channel="dynamic_activity"
            return="/admin/story/"
            use_live_url="no"
            error_handling=“inline”
            preserve_checkboxes=“yes”
            include_jquery="no"
            author_id="CURRENT_USER"
            author_only="yes"
        }
            <input type="text" name="title" id="title" value="Dynamic Content for {embed:related_activity_id}">
            <input type="text" name="related_adventure_id" id="related_adventure_id" value="{embed:related_adventure_id}">
            <input type="text" name="related_activity_id" id="related_activity_id" value="{embed:related_activity_id}">
            <input type="text" name="childs_name" id="childs_name" value="Enter the Childs Name">
            <input type="submit" name="submit" value="Submit" class="button small red">
        {/exp:safecracker}

```

If I use limit="1" then it only displays the first entry if I check if there is no content that matches then I load the form multiple times for each non matched entry. Any ideas/Help is appreciated.

Thanks

UPDATED: I have also tried this ...

```
{exp:switchee variable = "{related_activity_id}/{related_adventure_id}" parse="inward"}

            {case value="{embed:related_activity_id}/{embed:related_adventure_id}"}
                {exp:safecracker
                    channel="dynamic_activity"
                    return="/admin/story/"
                    use_live_url="no"
                    error_handling=“inline”
                    preserve_checkboxes=“yes”
                    include_jquery="no"
                    author_id="CURRENT_USER"
                    entry_id="{entry_id}"
                }
                    <input type="text" name="title" id="title" value="{title}">
                    <input type="text" name="related_adventure_id" id="related_adventure_id" value="{related_adventure_id}">
                    <input type="text" name="related_activity_id" id="related_activity_id" value="{related_activity_id}">
                    <input type="text" name="childs_name" id="childs_name" value="{childs_name}">
                    <input type="submit" name="submit" value="Update" class="button small red">
                {/exp:safecracker}
            {/case}

            {case default="Yes"}
                {exp:safecracker
                    channel="dynamic_activity"
                    return="/admin/story/"
                    use_live_url="no"
                    error_handling=“inline”
                    preserve_checkboxes=“yes”
                    include_jquery="no"
                    author_id="CURRENT_USER"
                    author_only="yes"
                }
                    <input type="text" name="title" id="title" value="Dynamic Content for {embed:related_activity_id}">
                    <input type="text" name="related_adventure_id" id="related_adventure_id" value="{embed:related_adventure_id}">
                    <input type="text" name="related_activity_id" id="related_activity_id" value="{embed:related_activity_id}">
                    <input type="text" name="childs_name" id="childs_name" value="Enter the Childs Name">
                    <input type="submit" name="submit" value="Submit" class="button small red">
                {/exp:safecracker}
            {/case}
    {/exp:switchee}

```

# Answer
> 0 votes
I would stash the output in a variable so you can then show the form if that variable is empty. Something like this should probably work:

```
{!--  ============================================
FETCH CONTENT
================================================== --}

{exp:stash:set name="content" trim="yes" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="dynamic_activity" dynamic="no" author_id="CURRENT_USER"}

      {exp:switchee variable="{related_activity_id}/{related_adventure_id}" parse="inward"}
        {case value="{embed:related_activity_id}/{embed:related_adventure_id}"}
            {exp:safecracker
                channel="dynamic_activity"
                return="/admin/story/"
                use_live_url="no"
                error_handling=“inline”
                preserve_checkboxes=“yes”
                include_jquery="no"
                author_id="CURRENT_USER"
                entry_id="{entry_id}"
            }
                <input type="text" name="title" id="title" value="{title}">
                <input type="text" name="related_adventure_id" id="related_adventure_id" value="{related_adventure_id}">
                <input type="text" name="related_activity_id" id="related_activity_id" value="{related_activity_id}">
                <input type="text" name="childs_name" id="childs_name" value="{childs_name}">
                <input type="submit" name="submit" value="Update" class="button small red">
            {/exp:safecracker}
        {/case}
      {/exp:switchee}

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

{!--  ============================================
DISPLAY CONTENT
================================================== --}

{if {exp:stash:not_empty name="content"}}
   {exp:stash:get name="content"}
{if:else}
   Fallback content
{/if}

```

# Answer
> 0 votes
Add a case statement

```
{case default="Yes"}
    Content to show
{/case}

```

# Answer
> 0 votes
I'd recommend in this particular case you might consider using Croxton's equally impressive ifelse add-on in place of switchee, since it seems like the conditionals you are looking for may be a little outside a purely switch case need. You get all the same benefits of early parsing the outer conditional while only parsing the interior of the matching condition, but with the structure of a conventional if:else kind of approach. You may find it suits your purpose more closely here.

---
Tags: conditionals, switchee
---


title: Matrix & Zoo Visitor

text:
# Question
Title: Matrix & Zoo Visitor
I'm trying to get Matrix to work inside my Zoo Visitor Registration form... I have this:

```
{exp:zoo_visitor:registration_form return="{current_url}"}

    {embed="_functions/_course-list-matrix"}

{/exp:zoo_visitor:registration_form}

```

Then inside the embed I have:

```
{exp:channel:entries channel="course" dynamic="no"}
    <li>
        <label>{title}</label>
        <input type="checkbox" value="">

        {!-- Matrix Fields --}

        {!-- Create New Row --}
        <input type="hidden" name="member_courses[row_order][]" value="row_new_0">

        {!-- Course ID / Name --}
        <input type="hidden" name="member_courses[row_new_0][col_id_20]" value="[{entry_id}] [{url_title}] {title}">

    </li>
{/exp:channel:entries}

```

The registration form submits perfectly. But the Matrix field is just blank. I've double checked the field name and also the col ID numerous times and it's not doing anything...

# Answer
Are you using the embed in an attempt to submit data to two different channels with a single form? (Zoo Visitor, presumably, triggers a Safecracker submission to a defined members channel? - I've not used it before).

If this is the case it can't be done natively without some convoluted client-side ajax.

I built something similar using my Bankcracker add-on, which may help:

https://github.com/thisisjamessmith/Bankcracker

...However I've not tested it extensively, and not at all with Matrix... but in theory it should work since it just triggers multiple Safecracker submissions per channel.

## UPDATE

Ah right, based on comments below I think I understand better.

Try changing your hidden inputs for these:

```
<input type="hidden" name="member_courses[row_order][]" value="row_new_{count}">
<input type="hidden" name="member_courses[row_new_{count}][col_id_20][]" value="[{entry_id}] [{url_title}] {title}">

```

I've added the count variable so each row is not named the same, and also added \[\] at the end of the second name so that multiple courses can be ticked without overwriting each other. A possible problem here is that the count will be 1 ahead of where it should be, but that might not be an issue(?) If it is you could use one of the math plugins to minus one from the count.

Take a look at these two resources for further details:

http://bluefishdesignstudio.com/blog/article/breaking-up-a-matrix-field-for-use-in-a-safecracker-form http://themetaq.com/articles/bring-matrix-data-editing-to-the-front-end
> 1 votes

---
Tags: matrix, zoo
---


# Question
Title: Stash: get_list do not show some entries
So, have a `exp:stash:set_list` chock full of entries, I'm using them all over the site and on this one I need to show a limit of 3 (simple), random (simple) BUT we need to **not** show some entries.

This would be how I'd go about it if stash worked like EE *but I know it wont work*, wondering what sort of regex would be required.

```
//I know this will fail
{exp:stash:get_list name="prod_list" limit="3" orderby="random" scope="site" match="not 32|244|2|66" against="entry_ids"}
… show the stuff
{/exp:stash:get_list}

```

# Answer
For others and my future self, here's the regex solution:

```
{exp:stash:get_list name="prod_list"
    limit="3"
    match="#^((?!.*(32|244|2|66|etc)).*)$#"
    against="entryid"
    orderby="random"
    scope="site"}
        … spit out entries
{/exp:stash:get_list}

```
> 3 votes

---
Tags: stash, regex
---


# Question
Title: Need some help with GWCode Categories, url segments, and conditionals
I have a products section where I give each product group a main category. Initially I had it setup where each product had a main category and a sub category. GWCode generated a side nav from the catgories that looks like this...

* Shampoos ( /products/shampoos/ )
    + Brand1 ( /products/shampoos/brand1/ )
    + Brand2 ( /products/shampoos/brand2/ )
* Soaps ( /products/soaps/ )
    + Brand3 ( /products/soaps/brand3/ )
    + Brand4 ( /products/soaps/brand4/ )

URL setup...

/products/shampoos(category)/ = list of all shampoo products /products/shampoos(category)/brand1(subcategory)/ = list of all shampoo products with the Brand1 category /products/shampoos(category)/brand1(subcategory)/flowers(url\_title) = single entry displaying the "flowers" entry

In my template I use Switchee to show a list of products when segment\_3 is blank. If segment\_3 is not blank I use if statements to detect if segment 4 is blank or not. If it is I show a list of products. If it is not blank I show the single entry product details. This worked GREAT until the client informed me that the products won't always have a subcategory. Which means this url setup is possible as well...

/products/shavinggel(category)/ /products/shavinggel(category)/coolmint(url\_title)

So now the switchee and if statements I have setup won't work in this situation. I'm trying to figure out if there is a way to detect if segment\_3 is a url\_title or a category\_url\_title and display the appropriate code. Or if you have any other ideas.

Simplified template setup...

```
{exp:switchee variable = "{segment_3}" parse="inward"}

{case value="''"}
    {exp:channel:entries channel="products" category="{segment_category_ids}" disable="member_data|pagination" sort="asc" dynamic="no"}
        <!-- display list of entries from main category -->
    {/exp:channel:entries}
{/case}

{case value="" default="Yes"}
    {if segment_4 == ""}
        {exp:channel:entries channel="products" category="{segment_category_ids}" disable="member_data|pagination" sort="asc" dynamic="no"}
        <!-- display list of entries from sub category -->
        {/exp:channel:entries}
    {/if}
    {if segment_4 != ""}
        {exp:channel:entries channel="products" disable="member_data|pagination" sort="asc" url_title="{segment_4}" dynamic="no"}
        <!-- display single entry detail page -->
        {/exp:channel:entries}
    {/if}
{/case}

{/exp:switchee}

```

# Answer
> 3 votes
I always tend to identify the product details page as simply /details/ to avoid this problem, but to achieve what you're after, the following should work (in theory).

Note that your example doesn't take into consideration pagination which would change the last segment. Maybe the client doesn't want it, but may once they get bulk products in there. The approach below will be able to handle that.

Have the index template in the products template group handle the flow to delivery all pages within the products url structure...

Use this add-on: http://devot-ee.com/add-ons/bjorn-last-segment

In this index template get the last segment and test it for a valid entry:

```
{exp:channel:entries
    status="not Closed"
    channel="products"
    dynamic="no"
    url_title="{last_segment}"
    require_entry="yes"
    disable="member_data|pagination|trackbacks"}
    {if no_results}
            {embed=products/listing}
    {/if}

...Display your details page...

{/exp:channel:entries}

```

This will try to get the channel entry for the last segment, if it doesn't exist (i.e. it's not a product) it will ignore the product details page and load up the listing template. The only restriction here is that you can't have a category with the same URL as a product!

Looks like you could use entry\_id="{last\_segment\_id}" instead of url\_title based on the add-ons documentation, but doubt there's much difference.

Then in your listing template, do away with switchee:

```
{exp:channel:entries channel="products" category="{segment_category_ids}" disable="member_data|pagination" sort="asc" dynamic="no"}
    <!-- display list of entries from main category -->
{/exp:channel:entries}

```

Remember to put in another {if no\_results}{/if} conditional to display a 404 or some message that no products exist for the categories provided (let's say they make a URL up).

By this reference: {segment\_category\_ids}, I assume you're using Low Seg2cat add-on?

I notice from your category structure that you've opted to repeat the brands each time under each product type, you may want to consider giving greater flexibility and making the brands a separate category group so both product type and brand are selected for a product and impact on the listing URL in the same way. By keeping them as separate it will avoid duplication and allow for products listed by brand or by product type, or both. But that's another question ;)

---
Tags: categories, segments, url-title, gwcode-categories
---


# Question
Title: Can I do {exp:channel:entries channel="*wildcardsearch*"}?
I have multiple channels that I'd like to include, and it would be more convenient to use a wildcard search than piped list. Is there an easy way to do this? Currently I'm thinking of defining a global variable and doing:

{exp:channel:entries channel="{gbl\_channels}"}

Where gbl\_channels is my piped list since I'll be making this reference in multiple files.

Good way? Any better ways? Thanks for any tips.

# Answer
> 1 votes
You are probably best following James answer and use Stash in this case then. You could also probably get something together using the Query Module as well.

I presume you are just using '100' channels as an example, but if you are planning on using a lot of channels in one site, then it might be worth trying to consolidate them if you can. I'm not sure of your EE experience, but having a huge number of channels is probably not a good idea. Not only will it be a pain for you to manage, but also the content administrator will have a hard time working with it.

What kind of data are you planing on working with here? If there is a cross over, I'd suggest merging the channels together as much as possible. There is a great little addon in Devotee called 'Page Type Selector' - (I think) and you can select the type of page you want and only show certain fields. Doing things this way you can manage channels fields in one place and if you every need to modify it, you don't need to go through 100's of fields etc.

If you aren't familiar, take a look at:

Stash: https://github.com/croxton/Stash (this can be a bit of a mind f@\*K to start off with, the more you use it, the more powerful you become - A real game changer)

Query Module: http://ellislab.com/expressionengine/user-guide/modules/query/

Page Type Switcher - The one I mentioned above: http://devot-ee.com/add-ons/page-type-switcher

Hope it helps.

# Answer
> 2 votes
Use snippets instead of global variables so that you can use them in the parameter of the channel entries tag, as the snippet will get parsed early. It seems like a good strategy to do this like you said, preparing snippets like "abc1|abc2|abc3" for all the different channel groupings you'll need and then:

{exp:channel:entries channel="{snippet\_abc}"}

# Answer
> 1 votes
What are you trying to do with this? Have different templates that have the same code, but are different channel?

Not sure exactly what you need here, but you can specify multiple channels in your channel entries loop by using a pipe | like this:

{exp:channel:entries channel="channel\_1|channel\_2"}

Is that what ou need? If you have the same code on multiple templates, you could use the URL structure to help you. Create a template group, say, cars.

Our URL will then read http://domain.com/cars when you visit this template group. Then you could use this:

{exp:channel:entries channel="{segment\_1"} - with your channel called cars and your template group.

Hope it helps

# Answer
> 0 votes
```
{exp:stash:set name="channels" parse_tags="yes" type="snippet"}{exp:query sql="SELECT channel_name FROM exp_channels WHERE channel_name LIKE '%whatever%'" backspace="1"}{channel_name}|{/exp:query}{/exp:stash:set}

```

You can now use channel="{channels}" as a parameter of a channel entries tag.

I've deliberately put it all on one line to avoid potential issues with whitespace but you might find that it also works ok with whitespace using Stash's trim="yes" parameter.

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


title: File Manager / Assets problem

text:
# Question
Title: File Manager / Assets problem
I just moved a site from my dev hosting to my client's hosting. Every path has been updated correctly. However, all files on Assets or the File manager are not showing on the front end.

When I click "update indexes" on Assets, I get this message:

There are some entries in the database that are out of date - please select the ones that you want to delete below

In addition, I can't upload new files.

Any ideas? Thanks in advance,

Santiago

# Answer
> 0 votes
Definitely a permissions issue if your paths are correct. As Brian said, upload folders should be 777. Also the files inside should have group permissions so PHP can read/edit them.

Another issue I had recently was forgetting to set the cache folder to 777. I'm guessing Assets use this as a temp area to generate thumbs.

# Answer
> 0 votes
Does the folder have the right permissions 777?

# Answer
> 0 votes
Folder permissions were indeed wrong, but it wasn't the only problem. The server path provided by the hosting documentation - and the one detected by the Reelocate addon - were different than $\_SERVER\['DOCUMENT\_ROOT'\]. I used the latter and the file manager started to work.

I still have problems with Assets but I'm looking into it with P&T.

Thanks!

# Answer
> 0 votes
I've had this before - Select the ones to delete. I take it you are using v2.x?

The short of it is, it is safe to 'delete' images. It doesn't actually delete the images. Not 100% sure what it is doing to be honest. But you can rest assured that they are not being deleted.

There is big issue using Assets and dev/live sites. The index gets mixed up a fair bit. If you pull the site down to dev at a later stage, you'll probably run int o this again - Or on the dev site the images are missing. Its a real pain - Not 'Painless' file management as P&T claim. Good addon on though.

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


# Question
Title: Produce a list of entries that have no relationship parents
I've got an EE 2.6 site that has pages (no duh) as entries, and some of those pages have children (i.e. via a relationship field).

Now, what I'd like to do is generate a list of the pages that do not have parents. But I don't see any way to do this. I would prefer native related entries, but would be fine with using Playa... but it doesn't seem to offer this functionality either. Am I stuck with using a query?

Thanks!

# Answer
You can use query module also like:

```
{exp:query sql="SELECT exp_channel_titles.entry_id, exp_channel_titles.title FROM exp_channel_titles LEFT JOIN exp_relationships ON exp_channel_titles.entry_id=exp_relationships.rel_child_id WHERE exp_relationships.rel_child_id IS NULL AND exp_channel_titles.channel_id=1 AND exp_channel_titles.status='open'"}

{entry_id} :: {title}

{/exp:query}

```

Check the WHERE condition having "channel\_id" and "status", you can change according to your preference.
> 2 votes

# Answer
Travis -

Throw this into a blank template, replace the field name of course:

```
    <h2>pt_playa="IS_EMPTY"</h2>

{exp:channel:entries search:pt_playa="IS_EMPTY"}

{title}<br />

{/exp:channel:entries}

<hr />

<h2>pt_playa="not IS_EMPTY"</h2>

{exp:channel:entries search:pt_playa="not IS_EMPTY"}

{title}

{/exp:channel:entries}

```

You'll see that search can help you here, at least if I am understanding correctly :) But I think I may be reversed from what you want.

My testing was done with a Playa relationship field....

-Lisa P&T
> 0 votes

---
Tags: playa, relationships, parent, children
---


# Question
Title: Display Entries Assigned Exclusively to a Parent Category
I've got a list of categories:

* Category 1
    + Category 1.1
    + Category 1.2
    + Category 1.3
* Category 2
    + Category 2.1
    + Category 2.2

An entry can be assigned to any child category, OR it can be assigned to *just* a parent category. For example:

1. **Entry 1:** Category 1
2. **Entry 2:** Category 1, Category 1.2

I want to display entries that are assigned to *only* the parent category, with no child categories. So I want Entry 1, but *not* Entry 2. The child categories will change, so I can't hard-code specific categories to exclude.

Ideas?

---

## Update: Full Situation Description

I'm working on an online learning site. The class produces 4 types of study materials: study notes, videos, practice questions, and spreadsheets. Each of these types is a separate channel, since they require different custom fields.

The course is broken down into 3 tiers:

* Part
    + Topic
        - Reading

A study item can cover just a reading, it can be a review for an entire topic, or it can be a review for an entire part.

I need to be able to display a list of study items that cover a particular Reading, a list of study items that review an entire Topic, or a list of study items that review an entire Part.

In addition, I need to be able to display a "new" icon in each Topic heading if a new study item in that topic or in its child readings has been added recently.

So this is where my problem comes in. I originally thought I could assign these items to categories, then output them based on category. But doing it that way I'm not able to display the items that are *only* assigned to a Topic, or *only* assigned to a Part.

What would be the best & most client-friendly way to organize these study items?

# Answer
> 1 votes
Primary Category from Solspace would do the trick. Allows you to set the main category and tie everything together nice and neatly.

It doesn't currently have any tags to output entries assigned to a primary category, so you'll have to write a custom plugin for the job.

# Answer
> 2 votes
If it were me I would create the course hierarchy/ies with Taxonomy (pulling in entries from a new 'course components' channel or similar). Then I'd create relationships in those entries with course materials via Playa. My reasoning is in the question's comments section, though obviously I am somewhat guessing since I don't know your exact situation.

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

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

I like this most because it gives you all the power of channel entries and room to grow (maybe things like: commenting on course components; creating RSS feeds limited to single topics; limiting access to materials based on group permissions; selling course subscriptions via eCommerce, not to mention some of the Solspace stuff like tagging, ratings, favourites...)

Your client could create new dynamic courses from existing components without any repetition. Hell, your end users could even create their own bespoke courses by sticking together topics from diverse parts of a course (or multiple courses).

Let me see you do that with categories ;-)

# Answer
> 1 votes
I think the only way to do this would be to **turn off** Auto-Assign Category Parents in your Global Channel Preferences. That way Entry 2 is only assigned to Category 1.2. Like this instead:

1. **Entry 1:** Category 1
2. **Entry 2:** Category 1.2

That may be a deal breaker for you, but it's hard to say since I'm not sure how you intend to use these categories on your site.

Then it depends on what you want your output to look like. If you want to get entries listed by parent category, you could use `{exp:channel:category_archive}` tag if you only need entry titles.

```
{exp:channel:category_archive channel="topic_pages" style="linear"}
  {categories}
    {if parent_id == 0}
      <h3>{category_name}</h3>
      {entry_titles}
        <p>{title}</p>
      {/entry_titles}
    {/if}
  {/categories}
{/exp:channel:category_archive}

```

Or you can try nesting the `{exp:channel:entries}` tag inside `{exp:channel:categories}` tag if you need more information like custom fields.

```
{exp:channel:categories category_group="1" style="linear" parent_only="yes"}
  <h3>{category_name}</h3>
  {exp:channel:entries category="{category_id}"}
    <p>{title}</p>
  {/exp:channel:entries}
{/exp:channel:categories}

```

This will give you...

**Category 1**
Entry 1

**Category 1**
Entry 4
Entry 6

etc.

I haven't tried this yet, but it may be possible to get the same thing more simply with the NSM Categories add-on.

---
Tags: categories
---


# Question
Title: Safecracker submitting form before finished
I have a relatively simple multipage safecracker form where users can upload an image on the first page, approve the image and add a description on the second, then add tags on the third.

All three fields are set as required in channel fields.

However today I noticed that from the moment the user uploads an image and presses 'submit' to proceed to adding the description the entry is already displaying on the website. No required field errors at all.

I'm a bit confused, any ideas how I can prevent this from happening?

# Answer
> 0 votes
A multi-page form will create the entry after the first step. I'd recommend adding status="closed" to the first page's form, and status="open" to the last page's form. This way, when the entry is first created, it won't be visible on the front-end until the last page is completed.

---
Tags: safecracker, validation
---


title: Allow query strings in EE1?

text:
# Question
Title: Allow query strings in EE1?
Here's an oldie but goodie. Links from social sharing sites are coming back like this:

http://reliabilityweb.com/index.php/articles/start\_executing\_success\_doesnt\_stop\_at\_training/?utm\_source=feedburner&utm\_medium=feed&utm\_campaign=Feed%3A+Reliabilityweb+%28Reliabilityweb.com%29#When:15:03:50Z

The ? and everything that follows confuses EE1 and yields 'Invalid GET data'. I see there is a solution for EE2, but what about EE1? Nothing in the docs.

Thx.

# Answer
> 1 votes
I believe it is due to %28 and %29 which stand for `(` and `)`.

You could hack EE to allow these characters but they are blocked as a precaution against code injection.

`utm` query values look like google analytics. You probably don't care whether your campaign name as it appears in Google Analytics includes `(` and `)` -- so long as they are consistently reported. So it would seem you could simply strip them out with a Rewrite Rule in Apache Server.

---
Tags: ee1, querystring
---


# Question
Title: Why can I not import a list of emails into a mailing list? SOLVED
I am trying to batch import a list of emails and I get the error: The following emails could not be imported: then a long list of all my emails.

What stops EE from importing these emails? They all appear to be correct.

Strange thing is emails can be batch entered individually but not as a batch.

Emails that failed to import in a batch can be imported individually

I think there were some hidden tabs or something. Finally got it to work

# Answer
> 1 votes
I think there were some hidden tabs or something. Finally got it to work

---
Tags: mailinglist
---


# Question
Title: mx notifier email link/path to image broken
when my email notification is sent when I create and entry using mx\_notifier any images that are from an entry's text area field do not have the full path.

ie: they display as src="/images/uploads/pic.jpg"

instead of http://www.domain.com/images/uploads/pic.jpg

any way to change the src link to an image easily?

# Answer
> 1 votes
The notify templates just take regular EE tags, don't they? Assuming they also support other add-on tags, could you use Low Replace to search for src="/ and replace with src="{site\_url}/ ?

It supports regex too if you need to get a bit fancier with what you need replaced, especially given the likelihood that you'd need to include quotes in what's found/replaced.

# Answer
> 0 votes
BAM!

```
{exp:low_replace find="src=QUOTE/" replace="src=QUOTEhttp://domain.com/"} {exp:ez_image_resize:run max_width="500" quality="100"} {content} {/exp:ez_image_resize:run} {/exp:low_replace}

```

---
Tags: email, notification
---


title: Extract Cart information

text:
# Question
Title: Extract Cart information
Im working on building a product comparison to add into a Cartthrob Ecommerce site. I would like to be able to extract item option information from an existing cart entry to transfer to a page in order to compare against other products. Does anyone know if this is possible and how I would do it?

Any advise would be appreciated

# Answer
You should be able to get any info from items in the cart using the following CartThrob template tags.

**cart\_items\_info** Outputs information about items in the cart, including item subtotals and prices with tax

**item\_options** Outputs selectable and selected options for items in the cart, or stored items

**cart\_entry\_ids** lists entry ids of items in the cart separated by a pipe | character

**customer\_info** Outputs customer information. Generally you can use cart items info instead, as long as there is at least one item in the cart

If you find that you cannot get particular custom field data from your products then you can use the CT tags to get the entry\_id of the product and pass this to an embed or snippet which can be a normal exp:channel:entries tag pair.

So yes. What you describe should certainly be possible.
> 1 votes

---
Tags: ee2, cartthrob
---


title: Sharing session with ASP.NET site

text:
# Question
Title: Sharing session with ASP.NET site
My organization has a site built on ASP.NET. It uses ASP.NET to manage the users (students, class coordinators, and finances). However there is a small 'content' component of the site: about the class, about the organization, and some other content that will need to change and grow over time. However that part of the site is currently managed by Kintera which is $$. We want to get everything out of Kintera and into a CMS. ExpressionEngine is one being considered.

The site uses some iFrame's to pull content from the ASP.NET site into the Kintera managed content. This will likely be needed in an ExpressionEngine managed site.

These iFrames use content that is dynamically created from the ASP.NET site. The user's session will then need to be shared between ExpressionEngine and ASP.NET.

I am not involved in the ASP.NET site so can't say too much more than this. I will see if the developer of that site can provide any additional information or respond to your comments/answers.

# Answer
However much I love ExpressionEngine would this not be a good case for using a .NET based CMS which could more easily integrate with your existing applications?

Something like Umbraco perhaps? Other Open Source .NET based CMS are available and if you are happy to pay a small licence fee similar to EE then I'm sure there will be even more options.

Sometimes you've got to take a step back and look at what is going to be easiest in the long-run. In this case, since you have an existing system built with .NET it makes little sense, to me, to shoehorn a completely different platform into the mix. If it's easy then fair enough but will there be further complications down the line when someone suggests integrating feature X or system Y?
> 1 votes

# Answer
Take a look at this -- the answer provides a few solutions.

https://stackoverflow.com/questions/2544389/how-to-share-sessions-between-php-and-asp-net-application
> 1 votes

---
Tags: sessions
---


title: Remove index.php on a windows server

text:
# Question
Title: Remove index.php on a windows server
I have EE installed on a clients windows server but I'm having problems removing index.php from the URL

This is the first time I've worked on a windows server (all precious jobs have been in apache and used .htaccess)

The hosting company is being incredibly difficult - can anyone please point me in the right direction.

Thanks

James

# Answer
Which hosting provider do you use? What version of IIS/Windows do they use?

You can try to add a web.config file to your root

```
<configuration>
<system.web>
    <customErrors mode="Off" />
    <compilation debug="true" />
</system.web>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="Imported Rule 1" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                <conditions logicalGrouping="MatchAll">
                    <add input="{R:1}" pattern="\.(gif|jpe?g|png)$" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                </conditions>
                <action type="Rewrite" url="/index.php/{R:1}" />
            </rule>
        </rules>
    </rewrite>
<security>
        <requestFiltering allowDoubleEscaping="true" />
 </security>
</system.webServer>

```
> 1 votes

# Answer
ISAPI Rewrite might be helpful, I've seen it used on a few windows hosts.

> The hosting company is being incredibly difficult

Maybe recommend your client moves to a new host?
> 0 votes

---
Tags: htaccess, server, windows
---


title: Stash, template partials and CE_image

text:
# Question
Title: Stash, template partials and CE_image
So I have my content that I put on my template article.html via the EE-publishform where I also get to choose wether to use layouts 'normal' or ' wide'. The size of the images varies depending on wich layout I use. CE\_image is what I use to resize images.

## problem

What I cant figure out is how to let CE\_image do its work on the layout-template instead of on the article-template. Or if I could put the CE\_image-tags on the article-template and then let the layout-templates insert apropriate values to size, crop and quality variables.

## disclaimer

I realize Stash is a genuinly complex and competent addon and the solution to my problem is probably right there in the Stash documentation. I have read it over and over and tried things over and over but I never seem to hit the keys in the right order. So I am very ready for some advice on this matter.

Thanks /David

### content

* title
* body
* images (matrix-field)
    + img-1
    + img-2
    + img-3

### Templates

### Article

> {exp:channel:entries channel="archive" limit="1" url\_title="{segment\_2}"}
>
> {embed="\_layouts/{f-archive-layout}"}
>
> {exp:stash:set name="title"} {title} {/exp:stash:set}
>
> {exp:stash:set name="content"} {f-body} {/exp:stash:set}
>
> {exp:stash:set name="images"} {f-archive-images} {exp:ce\_img:pair src="{f-archive-images-image}" width="400" crop="yes" quality="80"} {/exp:ce\_img:pair} {/f-archive-images} {/exp:stash:set}
>
> {/exp:channel:entries}

### Layouts

### normal

### wide

# Answer
You'd be better off just 'stashing' the image urls and using the CE Image tag from within the layout.

Article

```
{f-archive-images}
  {exp:stash:set_list name="images"}
    {stash:url}{f-archive-images-image}{/stash:url}
  {/exp:stash:set_list}
{/f-archive-images}

```

Layout

```
First image:
{exp:stash:get_list name="images" limit="1"}
  {exp:ce_img:single src="{url}" width="400" crop="yes"}
{/exp:stash:get_list}

Second and third images:
{exp:stash:get_list name="images" offset="1" limit="2"}
  {exp:ce_img:single src="{url}" width="400" crop="yes"}
{/exp:stash:get_list}

```

The point is that you are trying to keep your presentation separate. The CE Image tag, to me, is a presentational tag. You just need to get the image url to the layout. The above is one way to do it.

You could also use three separate `{exp:stash:set name="image_x"}{/exp:stash:set}` tags. Whatever you find that works.
> 4 votes

---
Tags: stash, ce-image, template-partials
---


# Question
Title: Question - Wordpress Better SEO integratedd than EE?
There exist a local webdesign company that they say, that with wordpress ,every site they build with it , or passed from something else to wordpress, it worked much better as the traffic income was suddenly increasing and they are saying that this is due tot wordpress and that other CMS would not do that,

What do you believe about this ?

# Answer
No. The CMS itself has nothing to do an increase in site traffic. However, if a developer doesn't know a lot about EE, it's likely to be perceived that Wordpress caters to SEO better than EE, but this just isn't true. Credible people from both platforms have great success with each (including SEO). The CMS is just a tool people choose for one reason or another, but any good CMS will not dictate results in a search engine or how the site appears.
> 4 votes

---
Tags: seo, google
---


# Question
Title: Seeking thoughts on best way to create a "Document Repository"
I'm just moving in to the next phase of a large project and trying to work out the best way to tackle it, or indeed if any add-ons exist that might help.

This part of the project is basically a document repository. A collection of various types of files that will be arranged, and displayed, in what are essentially folders and sub-folders. The user will be able to drill down through the folders to locate the files they want (or use a search facility).

The functionality is being driven largely by the client's existing set up and I'm wondering is there might be a better way. I'm normally against rigid organisation of assets like this and prefer a tagging solution though in this case perhaps that would be a step too far.

My first thought is to simply use categories (either on entries or using the files module) - it could be that simple - but I'm wondering if there are any add-ons that might assist in building this or indeed, if anyone else has built something like this and come across any "gotchas" that I haven't yet thought of.

EDIT: Reading that back I realised I had used the word "assets". Maybe that's a subconscious hint to myself! I haven't used the add-on Assets in this way before - is this something that Assets would be suited to?

# Answer
I've used P&T's Assets to create something similar to this. They wanted to display their current document repository on their website using the same folder structure.

With the latest version of Assets, you can upload everything to the server via FTP, then use Assets to sync it with EE; you just create the file upload location as the parent folder of the repository.

On the front end I created links that mirrored the folder structure, i.e. you'd click on links to move down through folders. If any files existed in the folder, they'd display below the links to folders.

This is the template code I used:

```
{exp:assets:folders folder="{filedir_3}{if segment_2}{segment_2}/{/if}{if segment_3}{segment_3}/{/if}{if segment_4}{segment_4}/{/if}{if segment_5}{segment_5}/{/if}"}
{if folder_name}<h3 class="folder"><a href="/{segment_1}/{if segment_2}{segment_2}/{/if}{if segment_3}{segment_3}/{/if}{if segment_4}{segment_4}/{/if}{folder_name}/">{folder_name}</a></h3>{/if}
<ul>
    {exp:assets:files folder="{filedir_3}{if segment_2}{segment_2}/{/if}{if segment_3}{segment_3}/{/if}{if segment_4}{segment_4}/{/if}{if segment_5}{segment_5}/{/if}"}
    <li><a href="{exp:protected_links:generate url='{url}' ip_lock='yes' only_link='yes' storage='local'}" class="file {extension}">{exp:low_replace find="_" replace="SPACE"}{filename}{/exp:low_replace}</a></li>
    {/exp:assets:files}
</ul>

```

It looks a bit untidy because I had to hard code the number of levels. I did this when Assets 2 was still in beta which was a while ago and was a bit pressed for time, so not sure if there's a way more native to Assets available now.
> 1 votes

---
Tags: categories, assets, bestpractice, files
---


title: Mail template send to distributor

text:
# Question
Title: Mail template send to distributor
My client uses Store for an online shop. Once the products are ordered online and paid for she wants an email to be sent to the distributor who is taking care of order picking, packaging and shipping. That mail should than contain the necessary order and shipping info. But should not be sent to the customer.

Will that be possible within Store?

# Answer
You can create as many different email templates as you like when orders are placed. So you could create separate ones for admin, customer and distributor.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: General question regarding installed modules and performance
I probably have a few modules installed on some of my sites that aren't being used. Simple question: will uninstalling them improve general memory usage and performance?

One module in particular that definitely isn't being used is the Comments module.

Cheers

Jim

# Answer
Will un-installing modules increase performance? yes. Will it increase *noticeable* performance? Almost certainly not. The overhead of unused modules is tiny compared to what else EE loads:

Having a quick look with debugging on shows one SQL query to retrive available modules.

```
SELECT `module_version`, `module_name`
FROM (`exp_modules`)

```

Looking at later queries, only modules that are actually used show any other SQL queries.

Given that exp\_modules is a pretty small table (10 or so entries) in comparison to a channel table (10K+), it's one of the cheapest queries performed. Without digging into the source and seeing what file systems operations are performed I can't say for sure, but as a general rule it's always the database queries that hurt performance rather than file loads.

So perhaps another question is; are there any other reasons you should uninstall unused modules? YES! Every module increases your attack surface size, if you have un-installed a module, logically a vulnerability in that module can not be used against you. This should be part of your vertical system hardening from the operating system-\>web server-\>PHP-\>EE where you disable unused components from every part of your system. See the canonical serverfault question for more tips.
> 1 votes

# Answer
Also better saving pages just into ee and not as files will bring you huge improvements on the performance side !
> 0 votes

---
Tags: performance, addons
---


title: More pagination number links

text:
# Question
Title: More pagination number links
As default EE seems to limit the page number links in pagination to 2 either side of the current page.

I normally change this in /system/codeigniter/libaries/paginatation.php in the $num\_links variable.

I have just updated to EE 2.6 and gone to do this as I noticed the numbered links were back to default, and found that this variable is set as 10, yet only 2 either side are being displayed.

Does anyone know how to get more links in 2.6?

# Answer
I don't think this is possible with the default pagination, however you can specify the number of links to show w/AB Pagination, see parameters for the {abp\_pages} tag in the docs here: http://wedoaddons.com/addon/ab-pagination/documentation

If you still prefer to hack the default pagination, you'll need to edit the file system/expressionengine/libraries/EE\_Pagination.php

Disclaimer: I wrote AB Pagination
> 1 votes

---
Tags: pagination
---


# Question
Title: Avoiding syntax errors with PHP and strings with quotation marks
What is the best practice for manipulating strings with PHP (output mode) that might contain straight quote marks (single or double)? I'm not totally clear how EE stores and outputs these normally, and so I've run into PHP parse errors in certain situations.

Is the only reliable method to use `{exp:xml_encode}`? For example:

`$excerpt = '{exp:xml_encode}{post_excerpt}{/exp:xml_encode}';`

...and are those single quotes above around the EE code better than using double quotes?

EE's implementation of `{exp:xml_encode}` incorporates the PHP strip\_tags() function, so this is not always ideal (e.g the excerpt above might have a phrase wrapped in `<strong>` tags. But at the same time, it seems there's no other way to store and manipulate the field content in PHP if it contains single or double quotes.

# Answer
Try using the php function addslashes:

```
<?php
$str = "Is your name O'reilly?";

// Outputs: Is your name O\'reilly?
echo addslashes($str);
?>

```

So for EE you could have something like:

(UPDATE 1: the following **does not work**:)

```
<p>This is the title and excerpt of this entry: "
    <?php
        $str = "<strong>". addslashes({title}) . "</strong> : ";
        $str .= addslashes({post_excerpt}); // combine title and post_excerpt
        echo  stripslashes($str); // remove the slashes.
    ?>
"</p>

```

UPDATE 1 the following **does work**:

Following the suggestion of th3mus1cman above, this does work in a plugin without needing addslashes:

```
On your template:
<p>This is the excerpt of this entry: "

    {exp:test_php}{post_excerpt}{/exp:test_php}

"</p>

In your test_php plugin:
public function __construct()
{
    $ee_str = ee()->TMPL->tagdata;
    $new_str = "<strong>". $ee_str . "</strong>";

    $this->return_data = $new_str;
}

```
> 1 votes

---
Tags: php, parse-order
---


# Question
Title: Assets problem uploading large files to Amazon S3
I am having an issue with Assets when trying to upload large-ish .mp3 files to an Amazon S3 bucket.

Here is my setup:

* ExpressionEngine v2.5.5
* Assets v2.1.2
* PHP v5.4.10 (via MAMP)
* Dedicated Amazon bucket (tested with smaller image files and is confirmed to be working and accepting uploads)

I have adjusted my php.ini settings to the following values:

* `post_max_size = 500M`
* `upload_max_filesize = 500M`
* `max_execution_time = 600`
* `max_input_time = 600`
* `memory_limit = 128M`

While trying to upload a .mp3 file that is 120MB in size (it's a podcast), I get the following error in Assets:

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

Checking the PHP error log, this is the message I see:

> \[05-May-2013 14:19:33 America/New\_York\] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 80987568 bytes) in Unknown on line 0

That's a lot of memory Assets is trying to use. I'm not sure how Assets deals with big files – does it try to load the entire contents in memory and then upload? Any other settings I could try?

A quick note – I did try uploading a 15MB .mp3 and that worked without problem.

# Answer
> 1 votes
You may want to attempt to use CORS -- http://aws.typepad.com/aws/2012/08/amazon-s3-cross-origin-resource-sharing.html

This will upload from the end user right to S3 -- it will perform faster.

Example code here: http://www.ioncannon.net/programming/1539/

---
Tags: assets
---


title: Save var in loop

text:
# Question
Title: Save var in loop
I am generating a url in a switchee statement, I want to be able to save that url for use in multiple places in a loop. This should be simple but nothing ever seems to be as easy as it should be in EE templates. How do I do this?

```
{exp:low_search:results query="{segment_2}" limit="10" }
  {if count ==  1}<ol>{/if}
    <li>
        {exp:switchee variable = "{channel_short_name}" }
            {case value="bikes"}
               {exp:stash:set name="url"} {embed="bikes/_bike_url" url_title="{url_title}" entry_id="{entry_id}"}{/exp:stash:set}
            {/case}

            {case default="Yes"}
                {exp:stash:set name="url"}{exp:transcribe:uri path='{comment_url_title_auto_path}'}{/exp:stash:set}
            {/case}
        {/exp:switchee}
        <span class="image">
            {embed="embeds/image" entry_id="{entry_id}" width="200"}
        </span>

        <a href="{exp:stash:get name="url"}">{title}</a>
    </li>
  {if count == total_results}</ol>{/if}
  {if no_results}No search results{/if}
{/exp:low_search:results}

```

Thanks,

Cory

# Answer
I cant guarantee this code will work as is but the approach is more valid. Separate content from layout, capture and stash the results then lay it out.

```
//Capture results & store results in a USER scoped list
{exp:stash:set_list name="results" scope="user" parse_tags="yes" prefix="myvar"}
    {exp:low_search:results query="{segment_2}" limit="10"}
        {stash:entryid}{entry_id}{/stash:entryid}
        {stash:urltitle}{url_title}{/stash:urltitle}
        {stash:channel}{channel}{/stash:channel}
        {if myvar:no_results}No search results{/if}
    {/exp:low_search:results}
{/exp:stash:set_list}

//Get the list - lay it out
{exp:stash:get_list name="results" scope="user" prefix="myvar" process="end"}
    {if myvar:count=="1"}<ol>{/if}
    <li>
    {exp:switchee variable = "{channel}" parse="inward"}
    {case value="bikes"}
        <span class="image">
            {embed="embeds/image" entry_id="{entryid}" width="200"}
        </span>
        //This could be problematic, parsing and embed inside a case inside a stash
        <a href="{embed='bikes/_bike_url' url_title='{urltitle}' entry_id='{entryid}'}">{url title}</a>
    {/case}

    {case default="yes"}
        <span class="image">
            {embed="embeds/image" entry_id="{entryid}" width="200"}
        </span>
        //This could be problematic, parsing and embed inside a case inside a stash
        <a href="{exp:transcribe:uri path='{comment_url_title_auto_path}'}>{url title}</a>
    {/case}
    {/exp:switchee}
    </li>
    {if my_var:count == my_var:total_results}</ol>{/if}
    {if my_var:no_results}No Results{/if}
{/exp:stash:get_list}

```
> 1 votes

# Answer
Try adding process="end" to your exp:stash:get call, it's likely getting called prior to the switchee tag, rendering blank because it technically hasn't been set yet.
> 0 votes

---
Tags: stash, low-search
---


title: Why Are Hidden Field Values Converted?

text:
# Question
Title: Why Are Hidden Field Values Converted?
I'm trying to pass some information from one page to the next, in a hidden field. And I need to be able to tweak it with jQuery; so I can't just use a pure Stash solution. But for some reason the value of my hidden field is converted from my simple flags (product or blog) to a long string of alphanumerics.

Here's the full template:

```
{exp:stash:get name="search_type" output="yes" dynamic="yes"}<br/>
{if '{exp:stash:search_type}' != 'product' && '{exp:stash:search_type}' != 'blog'}
{exp:stash:set_value name="search_type" value="product" replace="yes"}
{/if}
{!-- exp:stash:set_value name="search_type" value="product" replace="yes" --}
-{exp:stash:search_type}-<br>
<h1 class="searchTitle"><span class="icon"></span>search</h1>
 <h4 class="links">
 <a id="prodsearch" {if '{exp:stash:search_type}' == 'product'}class="selected"{/if} href="ourtoys/search_results">product</a> |
 <a id="blogsearch" {if '{exp:stash:search_type}' == 'blog'}class="selected"{/if} href="ourtoys/search_results">blog</a>
 </h4>
-{exp:stash:search_type}-<br>

{exp:search:simple_form channel="products" form_class="form-wrapper cf"
result_page="ourtoys/search_results" no_result_page="ourtoys/no_search_results" where="any"}
{exp:stash:search_type}<br>
<input type="hidden" name="search_type" id="search_type" value="{exp:stash:search_type}" />
<input type="text" name="keywords" class="keywords" placeholder="Search here..." required value="{exp:search:keywords}">
<button type="submit" id="search_button">go</button>
{/exp:search:simple_form}

```

Interestingly, when I display the Stashed var inside the (search) form it's converted. But when I display it outside, it's the straight goods.

So my questions are:

* why is this being converted?
* how do I "read" or unconvert it?
* is there some way to prevent them from being converted in the first place?
* is there a mechanism for accessing stashed variables from JavaScript?
* is there some other way to get JS-modified data from one page to the next?

I seriously doubt there'd be a JS access to Stash vars. But thought I'd ask just the same.

Thanks for your help.

# Answer
Parse order is in play but one thing you could try is to add `type="snippet" scope="user" save="yes"` this will save it as traditional snippet, save to the current users session and save it across page loads. Maybe also after the get, decalre a new stash var to hold the result to rule out any gremlins.

Setting var to snippet : Then in your template you'd simple refer to the variable as {name\_of\_var} as a traditional snippet.

Then around your output (search form) try adding `{exp:stash:parse process="end"} {/exp:stash:parse}` to make sure all the stash stuff before completes before calling the results.

This all assumption based, your code is a little confusing to me at first glance, var is holding initially one value then HTML, opening stash without closing tags.
> 1 votes

# Answer
Could you show more of your code from that template?

The mix of alphanumeric characters have to do with ExpressionEngine parsing. Something is messed up, so it shows that.

Something, most likely Stash, or another plugin isn't being parsed correctly.

**Edit:** Have you tried to add parse="inward" to the exp:search:simple\_form opening tag?
> 0 votes

---
Tags: stash, forms, search
---


# Question
Title: upgrading vanilla EE from 2.5.3 to 2.6.0 Fatal error: Call to undefined function function_usable()
Help!

I upgraded to 2.6, with no issues during the upgrade process. I can see my site fine. When I try to login to the control panel, I am able to see and use the authentication (username and password), but then see this error:

Fatal error: Call to undefined function function\_usable() in (path here)/system/codeigniter/system/libraries/Email.php on line 1761

Any ideas or suggestions to fix?

Warmly,

Bill

# Answer
> 1 votes
looks like this is a known bug that is due to be fixed in next release.

https://support.ellislab.com/bugs/detail/19326

---
Tags: email
---


title: Related Category Issue

text:
# Question
Title: Related Category Issue
I have this code. All seems fine but the categories info won't output between my H4 tags. Not sure what I am missing here but I think it has something to do with the 'related categories mode' parameter. Any help would be appreciated.

```
{exp:channel:entries channel="work" limit="20" status="New|Open" related_categories_mode="yes" custom_fields="yes"}
        {if no_results}
            <p class="alert">There are no related projects.</p>
        {/if}
        <li>
            <a href="{title_permalink="work/view"}" title="{title}"><img src="{project_th}" alt="{title}" />{if status == "New"}<img src="/_/img/new-work.png" class="new" alt="NEW Project - {title}" />{/if}</a>
            <h3><a href="{title_permalink="work/view"}" title="">{title}</a></h3>
            <h4>{categories backspace="2"}<a href="{path="work"}" title="">{category_name}</a> / {/categories}</h4>
            <p>{project_excerpt}</p>
        </li>
        {/exp:channel:entries}

```

# Answer
> 1 votes
According to the User Guide :

> "Relationships, Reverse Relationships, Pagination, and Categories are not available when Related Category Mode is enabled."

# Answer
> 0 votes
It's quite yucky and requires *a lot* of parsing, but you may be able to do this by nesting an embedded template with a second channel entries loop inside the first:

```
{exp:channel:entries
    channel='work'
    limit='20'
    status='New|Open'
    related_categories_mode='yes'
    disable='pagination|member_data|custom_fields'
}
    {if no_results}
        <p class="alert">There are no related projects.</p>
    {/if}

    {embed='work/related_entries' entry_id='{entry_id}'}
{/exp:channel:entries}

```

And the embedded template (`work/related_entries`):

```
{exp:channel:entries
    channel='work'
    entry_id='{embed:entry_id}'
    status='New|Open'
    disable='pagination|member_data'
}
    <li>
        <a href="{title_permalink='work/view'}" title="{title}">
            <img src="{project_th}" alt="{title}" />
            {if status == "New"}
                <img src="/_/img/new-work.png" class="new" alt="NEW Project - {title}" />
            {/if}
        </a>
        <h3><a href="{title_permalink='work/view'}" title="">{title}</a></h3>
        <h4>{categories backspace='2'}<a href="{path='work'}" title="">{category_name}</a> / {/categories}</h4>
        <p>{project_excerpt}</p>
    </li>
{/exp:channel:entries}

```

The key here is the `entry_id` variable which is passed from the first channel entries loop to the second.

I haven't tested this, but I think it should work.

---
Tags: categories
---


# Question
Title: After Upgrade, Matrix Not Displaying Content
I have a fairly simple site set-up for a client and we're using Matrix to display images like a photo gallery. It's always been fine, but after upgrading her to EE 2.6.0, and Matrix 2.5.4, as well as CE Image 1.4.3 (all the latest versions), the content is no longer displaying. It just shows... nothing. Well, it shows the body field and the title, but it doesn't display the Matrix portion.

To troubleshoot, I've reinstalled the add-ons more than once, I've checked the code (it's been unchanged), I've checked the post that calls the images, everything is just as it has always been. I've gone into the Fieldtype to activate the upgrade, I've checked the channel field to ensure everything is kosher. All seems to be just as it should be. But still... nothing.

Here is the code:

```
{exp:channel:entries channel="photos" rdf="off" disable="paginate|trackbacks|member_data"}
<h2>{title}</h2>
{body}
<ul class="gallery">
    {gallery}
      <li>
{exp:ce_img:pair src="{photo}" max="500" height="100" width="100" crop="yes|top,center|0,0" allow_scale_larger="yes"}
<a class="tip7 group" href="{photo}" rel="lightbox[{entry_id}]" title="{caption}"><img src="{made}" alt="{caption}" title="{caption}" width="{width}" height="{height}" /></a>
{/exp:ce_img:pair}
      </li>
    {/gallery}
</ul>
{/exp:channel:entries}

```

I'm not sure what else to check? Any thoughts? Thank you in advance!

**UPDATE!** So, the trouble seems to be with the image, specifically. I was able to get other fields in the matrix to display, just not the "file", which is how the image is added. All the folders are set to 777 and they have a folder assigned to it in the channel fields settings.

# Answer
> 1 votes
Try outputting the following to make sure that CE Image is receiving the right content:

```
{gallery}
    {photo}<br/>
{/gallery}

```

If the URLs are output, make sure that your CE Image cache directory is writeable

# Answer
> 1 votes
Ok! I think I've figured things out here. I tried adding a new row and uploaded a new photo and now all seems to be fine. I just have to re-upload those images, for some reason. Fortunately, it's not many.

Thank you all for your help troubleshooting, I really appreciate it! :)

---
Tags: ee2, matrix, ce-image, ee2-upgrades
---