title: Expresso Store No tax option

text:
# Question
Title: Expresso Store No tax option
I am new to V2 of Store and wondering how to make a product tax free? I understand you may have to use categories not but I do not see anything in the docs or in the tax settings that shows how this is done. Any help?

# Answer
> 1 votes
When you create or edit a tax rate in the **Store → Settings** area, there is a **Match Categories** field.

So you either select all of your categories, minus the *Tax-free* category you've created; or, you create a single *Taxable* category, and use that as the way to assign tax to each product (the latter is amore flexible and future-proof option).

---
Tags: expresso-store
---


# Question
Title: Is there a way in Expression Engine to bulk close entries that contain a specific string?
I have old data that has been migrated into a new design. The old data contains multi-language data using 4 different languages and Transcribe.

The new site does not contain transcribe, nor does it need the articles in the other languages. But all other articles in english need to be included.

I need to close all entries that are written in these other languages. Removing Transcribe didn't close the entries. In the url\_title column in the exp\_channel\_titles row, the language prefix is included. So I can search for ru, ar, fa - etc in this row, filter them out, and set the status to closed if the strings ru, ar, fa, etc are found.

So I'd like to search for all entries that contain "ar" and bulk close them. I'd imagine there is a way to do this via sql query.

I was able to write:

```
UPDATE exp_channel_titles a
    ON a.url_title = '"-ru"'
SET a.status = "closed";
```
based on the response below, but that gave me a syntax error. I'm not sure that = will find a string, it seems like an exact search, I could be wrong.

# Answer
Here ya go, try this if the url\_title will **contain** -ru:

```
UPDATE exp_channel_titles a
SET a.status = "closed"
WHERE a.url_title LIKE '%-ru%';

```

but use this if it **ends** in -ru:

```
UPDATE exp_channel_titles a
SET a.status = "closed"
WHERE a.url_title LIKE '%-ru';

```
> 0 votes

# Answer
This should do it. It checks channel\_entry\_data in that field for

```
dir="rtl"

```

and matches up those entry\_ids to the exp\_channel\_title table and sets the status to closed. This is untested, but exactly what you want (or a quote misplacement or two away):

```
UPDATE exp_channel_title a
    JOIN exp_channel_data b
    ON a.entry_id = b.entry_id AND b.field_id_1 = 'dir="rtl"'
SET a.status = "closed";

```

Let me know how it goes, and as always, **back up those two tables** before running this query. Also, you'll probably have to prepend your table names with your database name, so

```
exp_channel_title

```

becomes

```
database_name.exp_channel_title

```

it depends on if you run the query yourself or in a template {exp:query} tag or via the Database Class ( ee()-\>db-\>update(this)-\>join(that)-\>etc... ).
> 0 votes

---
Tags: entries, query, transcribe, sql
---


title: Performance Issues with Matrix

text:
# Question
Title: Performance Issues with Matrix
Has there been any other updates to the performance issues?

I am running a site which has over 100 matrix rows per entry (with 4 columns per row) and saving times are abysmal (can be over 120 seconds).

I understand P&T is working full tilt on Craft, I just wish there was some love shown to EE Matrix :(

Similar and unanswered questions:

Any help would be welcomed :)

```
My specs

matrix 2.6.1
ExpressionEngine 2.9.2 Build 20141004
jQuery  1.7.2
MySQL   5.6.21-log
Server  Microsoft-IIS/8.0

PHP 5.6.3
register_globals    off
safe_mode   off
open_basedir
max_execution_time  300
upload_max_filesize 50M
max_input_time  900
memory_limit    128M
session_save_path   writable

```

# Answer
So as James commented above, this is not the best use of matrix. When the website was planned and developed, there was no set idea of how many galleries would be needed per artist entry. A rough estimate was 50, so in testing the performance was acceptable when using Matrix and Assets.

When the number of galleries per artist entry ballooned to the 150+, that is when performance really started hurting. It worked, but not well.

I ended up building a system similar to what James suggested: I build a separate channel to hold the galleries and used relationships to tie them to the artist entry.

Re-entering the images and categories for each gallery was out of the question, so I build a system to export the current galleries with needed info into a large xml template file and used the handy DataGrab add-on to bring the galleries back in as individual entries with all needed data intact. I also looked at solspace Importer, but I was unable to import multiple images into an assets field.
> 0 votes

---
Tags: matrix
---


# Question
Title: $_POST to EE template not working as expected
Using this form to post to itself is not working as expected.

But why?

```
    <form method='POST' action='gen_req'>
      <input id='input' name='uid' placeholder='uid' />
      <button class='btn'>Go</button>
    </form>

    {exp:member:custom_profile_data member_id="<? echo $_POST['uid']; ?>"}
      <p>{email}</p>
    {/exp:member:custom_profile_data}

```

**UPDATED**

I have corrected to add the XID line and use the ee() for the post. But still not returning any data.

This is what i have updated to:

```
<form method='POST' action='test2'>
  <input type="hidden" name="XID" value="{XID_HASH}" />
  <input id='input' name='uid' placeholder='uid' />
  <button class='btn'>Go</button>
</form>

{exp:member:custom_profile_data member_id="<? echo ee()->input->post('uid', TRUE); ?>"}
  <p>{email}</p>
{/exp:member:custom_profile_data}

```

# Answer
> 4 votes
Do you have PHP Parsing Stage on "Input"?

```
<form method='POST' action='gen_req'>
  <input id='input' name='uid' placeholder='uid' />
  <button class='btn'>Go</button>
</form>

{exp:member:custom_profile_data member_id="<? echo ee()->input->post('uid', TRUE); ?>"}
  <p>{email}</p>
{/exp:member:custom_profile_data}

```

---
Tags: templates, php
---


# Question
Title: "Comment Field Is Required Error" when Submitting Comment Form ExpressionEngine
A very quick question, I'm trying to make a comment form but I get an error on submit that the Comment field is required, even though its filled in.

No Idea why as I checked other questions etc code seems fine.

```
      <div class="comment-form">
            <h3> Leave a comment </h3>
            {exp:comment:form channel="blog_post"}
                <ol>
                    <li>
                        <label>YOUR NAME<span>*</span></label>
                        <input type="text" name="name" value="{name}" />
                    </li>
                    <li>
                        <label>YOUR EMAIL<span>*</span></label>
                        <input type="email" name="email" value="{email}" />
                    </li>
                    <li>
                        <label>YOUR WEBSITE</label>
                        <input type="text" name="url" value="{url}" />
                    </li>
                    <li>
                        <label>YOUR COMMENT<span>*</span></label>
                        <textarea name="comment">{comment}</textarea>

                    </li>
                    <li class="submit"><button type="submit">POST COMMENT</button></li>
                </ol>
            {/exp:comment:form}
        </div>

```

Can you spot an error? Or maybe direct me the right direction?

Thank you in advance

# Answer
So you need to either specify an entry URL title or an entry ID

```
{exp:comment:form channel="blog_post" url__title = "{segment_x}"}

```
> 0 votes

---
Tags: forms, comments
---


# Question
Title: How do i search for a specific username by id
i am trying to find out how to search the cms database for a specific users username based on their user id and not based on logged in.

Any documentation links or advice would be great, have tried using various ways but ultimately i think query is the way but i am unsure of how to find a specific users username.

i have tried this but i need to do this using the ee() classes in some way as i cannoe seem to define a php variable with the following :

```
{exp:query sql="SELECT screen_name FROM exp_members WHERE member_id = '1' "}
        {screen_name}
{/exp:query}

```

please advise and many thanks!

# Answer
> 1 votes
It would seem you want to do this with a php approach over using the exp:query because of some php variable you want to use with it? If so, check out the Database Class Docs over in the EE documentation.

Since we know that only one member will have an id of one, we can use a simple query like so:

```
$results = ee()->db->order_by('member_id')
 ->limit(1)
 ->get('exp_members');
 ->where(array('exp_members.memberr_id'=> '1'));

$first_member = $results->row('screen_name');

```

---
Tags: query
---


title: Field Value Count

text:
# Question
Title: Field Value Count
Iam having a dropdown field with fixed options.

Let’s say it is {fruits} with options Apple, Pineapple, Banana and Orange

I need to output how many channel entries are there corresponding to each option, next to it.

e.g. Apple (10) Pineapple (20) Banana (5) Orange (15)

As you have guessed there are a total of 50 rows for the field {fruits}

How can I do that?

Thanks

# Answer
Try this? (Not going to be next to an EE install for a few days, can't test):

```
There are
{exp:query sql="SELECT field_id_X as fruit, COUNT(fruit) FROM exp_channel_data GROUP BY fruit" backspace="2"}
{count} {fruit}(s),
{/exp:query}

```

And you just have to replace field\_id\_X with the field name from your exp\_channel\_data table that corresponds to that field.
> 1 votes

---
Tags: ee2
---


title: EllisLab CRON plugin usage

text:
# Question
Title: EllisLab CRON plugin usage
The documentation on this plugin is lacking, and I was wondering how to utilize it:

Source: https://github.com/EllisLab/Cron/blob/master/cron/pi.cron.php

Devot-ee: http://devot-ee.com/add-ons/expressionengine-cron

My end goal:

* To check against the expiration\_date on certain entries and notify that a template is about to expire.

The CRON would ideally run only once per day. I have little idea as to how to make it work, but what I've been trying simply to ensure that it's working is a plugin with a function:

```
public function check()
{
    return 'test';
}

```

and then call this function in a template by:

```
{exp:cron minute="*" hour="*" day="*" month="*" plugin="<plugin name>:check"}{/exp:cron}

```

even something like this:

```
{exp:cron minute="*" hour="*" day="*" month="*" plugin="<plugin name>:check"}{<plugin name>:check}{/exp:cron}

```

fails to return the string.

# Answer
> 2 votes
I do not believe that the Cron will actually *return* the value from the plugin called via the `plugin` parameter.

So you can do *either*:

```
{exp:cron minute="*" hour="*" day="*" month="*" plugin="my_custom_plugin:check"}{/exp:cron}

```

This will run the `check` method of your `my_custom_plugin` plugin class every minute (provided the template is loaded by someone).

Or:

```
{exp:cron minute="*" hour="*" day="*" month="*"}{exp:my_custom_plugin:check}{/exp:cron}

```

This will *return* the `check` method of your `my_custom_plugin` plugin class every minute (provided the template is loaded by someone).

Two main things to remember:

1. Someone has to actually hit the template for it to run - so it's not 100% accurate (if someone loads the template at point 0, the method will run, but if you get no other visitors for another 2 hours, it won't run again until that visitor hits the template, despite the fact that it's set to run every minute).
2. If you're using any caching methods surrounding your call to the Cron plugin (either template-level caching, or something like CE Cache) it will mess with the faux cron scheduling.

# Answer
> 1 votes
I recently tinkered with the EE cron add-on and gave up on it; didn't work reliably for me.

Automatee might be worth looking at; it can trigger events on a plugin as you desire, I think.

Alternatively, you could pursue setting up an actual crontab; depending on the server admin tools available in your server environment, it's fairly straight forward.

# Answer
> 0 votes
As nick says, most reliable is a real crontab on the server that calls a (hidden) template on your site. You can use any plugin, sql-query or calls in that template.

***However***, your original question includes checking the expiration\_date for certain entries. There is a (free) extension and module called **Scheduled-trigger**. It adds the missing feature of triggering a hook when an entry is about to become live (entry\_date reached) or when it expires (expiration date reached).

Scheduled trigger will call the entry\_submission hook (or a customised hook) which your own extension can hang onto to do stuff.

I'm not affiliated with the add-on, however i did contribute to it ;-)
https://github.com/caddis/scheduled-trigger

---
Tags: plugin, cron
---


title: Adding to EE Publish/Edit Form

text:
# Question
Title: Adding to EE Publish/Edit Form
Can anyone give me some advice on how I can add some specific content to a publish/edit screen? I'm specifically wondering if this is possible using hooks and an extension.

Right now I'm hooking in to the `publish_form_entry_data` hook and running some actions based on certain parameters. I'd like to push a notice to the publish/edit form depending on conditions in my extension (which I've already got working.)

**Is it possible to push a notice to the publish/edit form from an extension?**

# Answer
> 2 votes
I've found that either using `ee()->cp->add_to_head('cssurlhere');` or `ee()->cp->add_to_foot('jsurlhere);` allows me to modify the form when used with the `publish_form_entry_data`hook.

---
Tags: control-panel
---


# Question
Title: Solspace User - Can registration form have group specified w/email activation?
I'm using exp:user:register, the group\_id parameter (https://www.solspace.com/docs/user/register/#group\_id), but it's being ignored. I see in the documentation that "This parameter respects native EE account activation settings," so does this mean I can't set group\_id as long as I have email activation set?

In EE Member Preferences, there's "Default Member Group Assigned to New Members" that is being used instead. But I'd like to override this using exp:user:register. Possible?

# Answer
> 2 votes
What is your `Require Member Account Activation?` Setting in `Members > Preferences` jphansen??

If it's self activation, the `group_id` parameter should override your `Default Member Group Assigned to New Members` *once the user activates* via the supplied link in their email.

If its No Activation required, then it should add the user to that user group on registration.

Otherwise (Manaul Admin activation), I'm not sure but I beleive the admin activation process is for the admin to move the user from the 'pending' group to the relivent (selected by admin) group, ergo no need for this field.

SolSpace (the user here) should chip in soon, so will be able to help if it's not going as above...

---
Tags: solspace, solspace-user
---


title: PHP Error with Channel Field Group

text:
# Question
Title: PHP Error with Channel Field Group
I am getting a PHP Error, when I go to publish \> Channel(name). I have this assigned to what I call the 'master' field group (master) it has 15 fields. I set up a test field group and assigned it to the channel and NO ERROR message. Can I fix this without rebuilding the master field group? I can not find out if there is a limited to the Number of field group I can have.

**Here are the 3 PHP Error I get:**

```
A PHP Error was encountered

Severity: Notice
Message: Undefined offset: 0
Filename: models/grid_model.php
Line Number: 496

A PHP Error was encountered

Severity: Warning
 Message: Cannot modify header information - headers already sent by (output    started at /home/jbreen/dev-sbco/sbco/codeigniter/system/core/Exceptions.php:170)
 Filename: core/Common.php
 Line Number: 475

A Database Error Occurred

Error Number: 1054
Unknown column 'col_id_' in 'order clause'
SELECT * FROM (`exp_channel_grid_field_15`) WHERE `entry_id` IN (0) ORDER BY `col_id_` asc
Filename: models/grid_model.php
Line Number: 413

```

# Answer
> 1 votes
From your question, it looks like the issue is in the channel field with the ID 15, and this field is in fact a grid type.

I've posed a few questions for you above, however as a "first answer" could you try going to your Channel fields, removing **just** field with ID of 15 (grid) and recreating please?

That's what the error is saying, field 15 has got issues in the DB. Another question, have you recently tried updating a server with your local copy? it could be (cant be sure, lack of info) that you created a grid field on your local/dev (which created the table and columns) and then migrated the data to a different server, and lost some of your field setups...

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


title: Conditional statement syntax

text:
# Question
Title: Conditional statement syntax
I am working on an Expressionengine site at the moment, the client would like the ability to choose if there's a custom phone number in the sidebar of the page and if non is entered it just shows the default GV phone number. I have added the channel fields to each page and written a conditional statement but can't get it to work. My statement looks like this;

```
  {if get_in_touch_jobs_phone}
    <p>{get_in_touch_jobs_phone}</p>

  {if:elseif get_in_touch_media_phone}
    <p>{get_in_touch_media_phone}</p>

  {if:elseif get_in_touch_pages_phone}
    <p>{get_in_touch_pages_phone}</p>

  {if:elseif get_in_touch_staff_phone}
    <p>{get_in_touch_staff_phone}</p>

  {if:elseif get_in_touch_volunteering_phone}
    <p>{get_in_touch_volunteering_phone}</p>

  {if:else}
    <p>{gv-global-telephone}</p>
  {/if}

```

I'm trying to make the statement go through each pages custom phone field and check if it is there, if not it should move to the next statement and check if anything's there until it reaches the 'catch-all' else of using the global phone number.

For some reason this code always outputs the global phone number even if the custom phone field has been filled out, so I presume my elseif's syntax is not quite right, could anybody give me some advice/pointers as what I can do to get this working?

EDIT: I have now got this code which is working much closer to what I am looking for.

Certain pages won't take the custom numbers entered and will just show the global number even if there is a custom number set on a page, here is the code at the moment;

```
  {exp:channel:entries limit="1"}

      {if get_in_touch_jobs_phone}
        <p>{get_in_touch_jobs_phone}<br />

      {if:elseif get_in_touch_media_phone}
        <p>{get_in_touch_media_phone}<br />

      {if:elseif get_in_touch_pages_phone}
        <p>{get_in_touch_pages_phone}<br />

      {if:elseif get_in_touch_staff_phone}
        <p>{get_in_touch_staff_phone}<br />

      {if:elseif get_in_touch_volunteering_phone}
        <p>{get_in_touch_volunteering_phone}<br />

      {if:else}
        <p>{gv-global-telephone}<br />
      {/if}

  {/exp:channel:entries}

```

# Answer
> 0 votes
Can yuo try this thought experiment, it's a bit of a 'shot in the dark' but before when I've fought with advanced conditionals this might get you out of jail...

```
  {if "{get_in_touch_jobs_phone}" != ""}
    <p>{get_in_touch_jobs_phone}<br />

  {if:elseif "{get_in_touch_media_phone}" != ""}
    <p>{get_in_touch_media_phone}<br />

  {if:elseif "{get_in_touch_pages_phone}" != ""}
    <p>{get_in_touch_pages_phone}<br />

  {if:elseif "{get_in_touch_staff_phone}" != ""}
    <p>{get_in_touch_staff_phone}<br />

  {if:elseif "{get_in_touch_volunteering_phone}" != ""}
    <p>{get_in_touch_volunteering_phone}<br />

  {if:else}
    <p>{gv-global-telephone}<br />
  {/if}

```

The theory being `{if fieldname}` could just be referrign to "If the field / value exists" kind of like `isset`, whereas adding the quotes and squiggly braces `{if "{fieldname}" != ""}` parses the value into a string, the advanced conditional is then a string match...

like I say, bit of a shot in the dark however you are on an older EE so this might still be relivent (from my memory EE2.10.1 had some jiggery pokery around advanced conditionals, EE2.9.3 bug (#20621) link)

# Answer
> 0 votes
AS the question has moved onto a display issue on the listing page, I've supplied another answer, firstly I'm guessing at the code, until the OP comes back to us.

Here we assume the channel is called "Jobs" (jobs)

```
{exp:channel:entries channel="jobs" dynamic="no"}

    <h1>Job Title : {title}</h1>

    <a href="/jobs/{url_title}" alt="more info...">more info...</a>

    <p>To enquire please phone :
      {if get_in_touch_jobs_phone}
        {get_in_touch_jobs_phone}
      {if:elseif get_in_touch_media_phone}
        {get_in_touch_media_phone}
      {if:elseif get_in_touch_pages_phone}
        {get_in_touch_pages_phone}
      {if:elseif get_in_touch_staff_phone}
        {get_in_touch_staff_phone}
      {if:elseif get_in_touch_volunteering_phone}
        {get_in_touch_volunteering_phone}
      {if:else}
        {gv-global-telephone}
      {/if}
    </p>

    <hr />

{/exp:channel:entries}

```

---
Tags: conditionals, variable, ifelse, syntax
---


title: Freeform Recipients not working

text:
# Question
Title: Freeform Recipients not working
EE 2.9.3 FF 4.2.2

I've got a Freeform form where I'm using recipients, but it's not sending emails to the recipients. However if I use notify\_admin and admin\_notify with the same notification template that email gets sent.

clearly emails are able to be sent but using recipients is not working. I've checked and checked and am unable to find any typos or obvious mistakes. Have also copied code to a blank template and it continues to behave incorrectly.

```
    {exp:freeform:form
      form_id="1"
      form:class="form-horizontal"
      required=""
      return="contact/thank-you"
      status="open"
      notify_admin="yes"
      admin_notify="fake@mydomain.com"
      admin_notification_template="contact_notification"
      recipient_template="contact_notification"
      recipients="yes"
      recipient1="John|none@domain.com"
      recipient2="Stacy|none1@domain.com"
      recipient3="Bill|none2@domain.com"
    }

      <fieldset>

        <!-- Select Basic -->
        <div class="form-group">

            <select id="province" name="province" class="form-control">

              <option required class="orange">Contact Person</option>

              {freeform:recipients}
                  <option
                      value="{freeform:recipient_value}"
                      {if freeform:recipient_selected}selected="selected"{/if}>
                      {freeform:recipient_name}
                  </option>
              {/freeform:recipients}
            </select>

        </div>

more fields here

      {/exp:freeform:form}

```

# Answer
Your opening select tag should be, I believe:

```
<select name="recipient_email">

```

And not what you have name="province", from https://www.solspace.com/docs/freeform/form/#recipient\_email

```
<label>Choose Recipients</label>
<select name="recipient_email">
{freeform:recipients}
    <option
        value="{freeform:recipient_value}"
        {if freeform:recipient_selected}selected="selected"{/if}>
        {freeform:recipient_name}
    </option>
{/freeform:recipients}
</select>

```
> 1 votes

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


# Question
Title: Issue with no results variable using Friends Module
I'm having a bit odd issue with channel:entry tag when using it inside friends:mine loop. Have tried both ways, using channel:entry tag within and embedded. When using entry tag within friends:mine it shoots entries if available but no\_results does not work. When I use it via embed, it then does not parse friends\_member\_id and all friends gets "no results".

Here is the code:

```
{exp:friends:mine reciprocal="y" orderby="screen_name" dynamic="no" sort="asc" limit="5" paginate="bottom"}

    ...some common html and friends single variables here...

    {exp:channel:entries channel="luontopalvelut" author_id="{friends_member_id}" status="closed|open|featured|premium" dynamic="no" limit="15" disable="pagination"}

        ....channel entry title and other stuff....

        {if no_results}blaa that does not parse when there is no entries for the this member{/if}
    {/exp:channel:entries}

    ...yet some html....

    {if friends_no_results}<li>No available contacts for this person yet.</li>{/if}

    {friends_paginate}<li>Page {friends_current_page} / {friends_total_pages} page{if friends_total_pages > "1"}s{/if}{if friends_pagination_links}   |   {friends_pagination_links}{/if}</li>{/friends_paginate}

{/exp:friends:mine}

```

Using the channel entry tag via embed gives no results to all (because the `author_id="friends_member_id` does not parse, and using the channel entry straight inside friends:mine stops no\_results variable from working.

Ideas? Thank you.

# Answer
> 0 votes
Solution was/is as simple as I thought it has to be. Got a reminder from Solspace about how I handle me embeds - wrong way of course because it was not working heh.

Anycase this will work just fine without any extra hassle(thanks Kelsey for pointing out my idiotism again hehe):

**Main template:**

`{exp:friends:mine reciprocal="y" orderby="screen_name" dynamic="no" sort="asc" limit="5" paginate="bottom"}
 ...Some common content....
 {embed="path_to/embed" author_id="{friends_member_id}"}
 ...some other content....
 {/exp:friends:mine}`

**Embedded template:**

`{exp:channel:entries channel="luontopalvelut" author_id="{embed:author_id}" status="closed|open|featured|premium" dynamic="no" limit="15" disable="pagination"}
...stuff here...
{/exp:channel:entries}`

# Answer
> 0 votes
You look to be having a parse order issue, try adding `parse="inward"` to your `{exp:friends:mine}` tag.

See this answer for more in depth about parse order : Using Plugin Tags Within Channel Tags

Also, try echoing out `{friends_member_id}` just to ensure you're getting at least one good member ID, and of course check you have a 'recipricated' friend!

**Edit 1 : Even Embedded Templates dont work?!?!**

I'm confused by your last comment, you seem to be implying that while member ID's are populated they are not droperly populated / parsed wayyyy later than they should be? Particularly the embeds, because embeds are parsed much later than most things they are useful for these cases, can you confirm the below example please:

```
{exp:friends:mine reciprocal="y" dynamic="no"}

<p>Inside the friends lop member ID is : {friends_member_id}</p>
{embed="test/template" passedId="{friends_member_id}"}

{/exp:friends:mine}

```

It's a much simplified version, inside the `test/template` template (put it where you will) :

Php ON : Input

```
<?php $passedStr = "{embed:passedId}"; ?>
<?php $passedStr = str_replace(array('{','}'), array("{","}"), $passedId);
<p>The ID passed to an embedded template is : <?php echo $passedStr; ?></p>

```

What we are doing here is testing the parse order, what we expect is (assuming the friend is ID of 11 & 12) :

```
Inside the friends lop member ID is : 11
The ID passed to an embedded template is : 11
Inside the friends lop member ID is : 12
The ID passed to an embedded template is : 12

```

if we are getting any sort of tags displayed on the output, please share what you get, it will indicate where the parse order much up is...

---
Tags: channel-entries, solspace-friends
---


title: Pagination not work

text:
# Question
Title: Pagination not work
I have read some of the other posts on pagination, but I have not been able to make the products page work with pagination.

Two things are not working for me: 1) paginate="bottom" 2) links point to a P16 that does not exist and the system does not recognize that it is the second portion of the pagination

```
            <div id="container" class="super-list variable-sizes clearfix">
            {exp:channel:entries channel="products" orderby="product_date" show_expired="yes" show_future_entries="yes" sort="asc" limit="16" paginate="bottom"}
            <div class="hover panel element {categories backspace="1"}{category_url_title} {/categories}">
                <div class="front">
                    <a href="{title_permalink="products"}"><img src="{product_image}" title="{title}" alt="{title}"/></a>
                </div>

                <div class="back" onClick="location.href='{title_permalink="products"}';" style="cursor: pointer; cursor: hand;">
                        <h2><a href="{title_permalink="products"}" style="text-decoration: none;">{title}</a></h2>
                        <p><a href="{title_permalink="products"}" style="text-decoration: none;">{product_short}</a></p>
                        <p><a href="{title_permalink="products"}" class="button-more">Learn More</a></p>
                </div>
            </div>
    {paginate}
    {if {total_pages} > 1}
    <nav class="centered" role="toolbar">
    <ul class="dots">
    {pagination_links page_padding="5"}
    {previous_page}<li><a href="{pagination_url}">«</a></li>{/previous_page}

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

    {next_page}<li><a href="{pagination_url}">»</a></li>{/next_page}
    {/pagination_links}
    </ul>
    </nav>
    {/if}
    {/paginate}
            {/exp:channel:entries}
        </div><!--END container-->

```

I know from reading other posts that P16 is coming from the parameter limit="16" and the links point to http://mydomain.com/products/P16 for both the previous and the next links???

They make it look so easy in the documentation, but I cannot get it to work.

Any help will be appreciated. I will check in tomorrow hoping that my day starts off with a new fresh set of ideas - thanks in advance

# Answer
> 1 votes
It looks like an issue with your conditional. Remove it. Everything inside `{paginate}` will only be output if you have pages.

Please try to do that.

```
{paginate}
    {pagination_links page_padding="5"}
    <nav class="centered" role="toolbar">
        <ul class="dots">
                {previous_page}<li><a href="{pagination_url}">«</a></li>{/previous_page}

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

                {next_page}<li><a href="{pagination_url}">»</a></li>{/next_page}
        </ul>
    </nav>
    {/pagination_links}
{/paginate}

```

# Answer
> 0 votes
How about this:

`{if total_pages != 1}`, I had some issues with pagination when using operator \> but changed that to != solved my case.

---
Tags: pagination
---


# Question
Title: How to make sitemap template accessible from root?
I have created a template that outputs my XML Sitemap dynamically (via Channel entry loop). Currently, it's in `commmon/sitemap.xml`. How do I tell EE that whenever `http://somedomain.com/sitemap.xml` is accessed, it should output `commmon/sitemap.xml`?

# Answer
> 1 votes
You need to ensure your index.php rewrite happens **after** the rewrite to the template group.

```
RewriteCond $1 ^(sitemap_index\.xml|sitemap\.xml|product-feed\.xml) [NC]
RewriteRule ^(.*)$ /common/$1 [L]
...
RewriteCond $1 !^(images|themes|robots\.txt|index\.php|admin\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

```

For certain builds with strict 404's and using Structure, I've had to create a page in Structure to keep it happy, but otherwise it should rewrite fine.

# Answer
> 0 votes
I've used resource router by Sanchez. I expect you could do something similar with EE template routes too.

Alternatively, you could look at modifying your htaccess rules.

---
Tags: templates
---


title: Expresso Store pagination

text:
# Question
Title: Expresso Store pagination
How do I enable pagination in the {store:orders} tag? I tried:

```
{exp:store:orders member_id='CURRENT_USER' order_by='order_date' sort='desc' pagination="bottom"}
.... snip ....
{paginate}
    <p>{pagination_links}</p>
{/paginate}
{/exp:store:orders}

```

But it just outputs the paginate tags as they appear in the template.

# Answer
> 1 votes
I had this issue also but managed to work around it using the query module. Query module does support paginate and I have also used an INNER JOIN to get our product titles. Here is my code:

```
{exp:query sql="SELECT * FROM exp_store_orders INNER JOIN exp_store_order_items ON exp_store_orders.id=exp_store_order_items.order_id WHERE member_id = {exp:stash:get name='member_id'} AND exp_store_orders.order_id IS NOT NULL ORDER BY order_date DESC" parse="inward" limit="7" paginate="bottom"}
    {if no_results}
        <tr>
            <td colspan="8">You haven't placed any orders yet!</td>
        </tr>
    {/if}
    <tr>
        <th><a href="/orders/{exp:zoo_visitor:details member_id='{member_id}'}{member:url_title}/{/exp:zoo_visitor:details}{id}" title="More Information">#{id}</a></th>
        <td>{title}</td>
        <td>{order_date {sn_date_default}}</td>
        <td><span class="payment-status {order_status_name}">{exp:heading_title:heading_case}{order_status_name}{/exp:heading_title:heading_case}</span></td>
        <td>{order_total}</td>
        <td>{exp:zoo_visitor:details member_id="{member_id}"}{visitor:member_title} {visitor:member_firstname} {visitor:member_lastname}{/exp:zoo_visitor:details}</td>
        <td><a href="/orders/{exp:zoo_visitor:details member_id='{member_id}'}{member:url_title}/{/exp:zoo_visitor:details}{id}" title="More Information" class="icon"><span class="icon-circle-right"></span><span class="visually-hidden">More Information</span></a></td>
    </tr>
    {paginate}
        <tr>
            <td>{pagination_links}</td>
        </tr>
    {/paginate}
{/exp:query}

```

I am using stash so that users can only see their own orders, but also the manager of the company they belong to taken from a relationship field can view the orders also. The rest are just standard variables that you would usually use from the {store\_orders} tag.

I hope this helps.

# Answer
> 3 votes
Looking at the code, it appears that the Store Orders tag doesn't support pagination at present.

---
Tags: expresso-store
---


title: EE 2.10.1 jQuery & jQuery UI update

text:
# Question
Title: EE 2.10.1 jQuery & jQuery UI update
Does anyone know how to update jQuery and jQuery UI that comes with EE 2.10.1? This question was asked once before but no answers (link)...

After doing some digging I found the assets at: /themes/javascript/compressed/jquery /themes/javascript/compressed/jquery/ui

The problem started with some javascript errors concerning zoo\_visitor and photo frame. The only way to use these plugins now is to use jQuery 1.7.1 but that conflicts with Bootstrap 3. After setting include\_assets="no" I tried to mimic the includes and that was the point the trouble started...

Actually I think that the developers of EE should find a fix for this. For a 299 dollar CMS this is one major fail.

# Answer
> 1 votes
Ok, To update the jquery reference globally you can do it by redefining the constant PATH\_JQUERY. This definition is defined in the file `/system/expressionengine/modules/jquery/mod.jquery.php`, lines 39 through 46 (on EE2.10.1).

This patch **assumes you have your jquery and its dependant libraries in the same folder structure as in `/themes/javascript`**.

And my usual notice : **This method involves modifying core files. Be aware that future upgrades and/or changes may invalidate your work!** Modifying core is usually not recommended however there's no other way thus far (apart from writing a module that overloads the Jquery class in EE, but I digress).

The easiest way to apply this patch is to first copy the jquery directory at `/themes/javascript/compressed/jquery` to the same parent folder. For this example lets assume I've copied the directory and renamed to `jquery_2`.

By copying the existing folder we can pick and choose the elements we upgrade, you can rebuild or refactor other or specific elements which I hint to at the end, but this method is by far the easiest to manage.

So now in my `jquery_2` folder I wish to just update jquery core, so I go and get my compressed file, and replace the jquery.js file in my new directory. Similarly if you wish to upgrade UI elements you'll need to replace the resourses in your new directory in the same fashion.

Lastly, we need to tell EE to look in our new directory, so referring to the file mentioned able I change line 45 (EE2.10.1) from

```
define('PATH_JQUERY', PATH_THEMES.'javascript/compressed/jquery/');

```

to

```
define('PATH_JQUERY', PATH_THEMES.'javascript/compressed/jquery_2/');

```

And thats it, we're done. This patch works to update Jquery in the CP, SAEF, File Upload and the front end jquery tags too.

**Cherry Picking elements to upgrade**

Perhaps you don't want to copy the entire themes javascript folder, perhaps you just want to drop in a minor change to just the jquery core? In this case take a look at lines 80 through 106 of `/system/expressionengine/modules/jquery/mod.jquery.php`. Here what is happening is depending on what part of jquery is requested (file, plugin, ui, effect, or core) the sub path is appened to `PATH_JQUERY` (which we no from above is defined as `PATH_THEMES.'javascript/compressed/jquery/`), therefor just drop your new file(s) somewhere in the `PATH_JQUERY` folder, find the lines in the big if statement that relate to what you need and alter the sub-path.

**And finally** While this solution is more verbose, it is technichally the same as jChrono's comment, except we're not overriding the existing files, but a copy.

---
Tags: zoo-visitor, jquery, update
---


# Question
Title: JqueryUI appears to be very old version, how to update?
Been building a new form with Expression Engine 2.9.2, however when trying to use the datepicker, it seems to be using a very old version of JQuery UI, so old that it only actually functions at all in Chrome.

Both Firefox and IE (latest and older versions I've tested) don't actually get a working date-picker at all, they literally get no field. I've tried using it as a date field, a text field and several classes the datepicker is mean to pick up (datepicker, hasDatepicker).

Looking at it, this seems be a very old version of JQuery UI from several years ago which explains why it doesn't function, however when I download the latest version, the file layout and names are all completely different so its not just a simple matter of replacing the files with the more up to date versions.

So, is there a relatively simple way to update the version of JQuery UI that EE use or is it easier to just disable the EE built-in datepicker and use an external one to do the same job?

I'm also curious as to why EE would be using such an old version of JQuery UI?

# Answer
There's no easy way, but I've just answered a similar question here : EE 2.10.1 jQuery & jQuery UI update

Of course Brandon's answer seems alot more succinct!!!
> 0 votes

---
Tags: ee2, jquery, javascript
---


# Question
Title: Channel Entry sorting refuses to sort in the right order?
I have a Channel with a field called `{tour_starting_price}`. It's a text input field, with Type set as `Number`. It only ever stores integers.

I have created a simple template that looks like this:

```
<ul>
    {exp:channel:entries channel="tours" orderby="tour_starting_price" sort="desc" limit="100000"}
        <li>{tour_starting_price}</li>
    {/exp:channel:entries}
</ul>

```

But the bizarre thing is, the output is returned exactly in this order - which simply isn't ordered descending... Why on earth would this be?

```
4543
4516
3345
2265
2230
2104
2099
2089
1985
1423
1381
1375
995
698
0
24595
15895
15895
13595
10540
10195
9995
9995
9579
9495
6875
6795
6730
6670
6617
6445
6323
6290
5495
5449
5386
5367
5338
5335
5209
5190
5097
5095
4625
4577
4569
4550
4544
4538
4495
4472
3990
3982
3949
3929
3928
3926
3925
3835
3629
3325
3325
3195
3161
3145
3145
3130
3120
3084
3050
2739
2729
2505
2500
2498
2495
2249
2249
2245
2225
2224
2223
2199
2195
2195
2189
2185
2042
2029
2012
1999
1998
1995
1995
1995
1988
1974
1825
1806
1799
1799
1799
1790
1755
1754
1750
1749
1729
1725
1722
1722
1699
1697
1695
1689
1689
1649
1550
1489
1468
1449
1445
1442
1249
1237
1200
1200
1149
1149
1132
1132
1121
1103
1095
918
898
896
850
840
765
765
699
698
688
665
665
320
225
0
0
0
0
-1
-1

```

# Answer
It looks like you have some "sticky" entries, as per the Docs please try adding `sticky="no"` to you channel entries tag and see if that corrects things...

Otherwise please also supply details of if any of these entries have different statuses or future/past posting dates, as the debugging will get a bit more difficult!
> 1 votes

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


# Question
Title: Freeform Pro - AJAX response information not being returned
We have recently moved server to the AWS platform so this might be an issue on the infrastructure side of things rather than with Freeform Pro.

However I have a modal contact us form that is being submitted by AJAX. The data is being saved to Freeform but I'm not getting any kind of AJAX response data when I take a look in Chrome Dev Tools.

Could this be an issue with using a load balancer?

# Answer
> 0 votes
There's no easy answer here I'm afraid.

Becasue the freeform entry is created we can assume that the ACTion request is processed and a response is "trying" to be sent, it's just you're not recieving it. This in turn leads us to the question "Where is my response going?"

First step for me would be to run a test and check your server logs (apache? whats your hosting enviroment??), this will confirm that a response is being sent from the server at least...

If you can re-test without your load balancer / server cache that would be great.

However in lieu of this lets start by confirming if a plain old AJAX works...

One template, really simple for this example it'll be located at `test/is_it_safe`, the contents :

```
{"answer":"yes it is"}

```

Then on another page (lets say `test/ajax`) lets stick a simple Jquery script...

```
<script>
$(document).ready(function(e){
    $.ajax("index.php/test/is_it_safe", {
        dataType: 'JSON',
        success: function(data) {
            alert("Is it safe? " + data.answer);
        }}
    );
});
</script>

```

Load the page, does the answer get returned?? YOu can also expand on your test script (add an error: handler, add some console.logs ect) to see if the response is malformed/not coming/ect....

---
Tags: solspace-freeform, ajax, aws
---


title: Grid and Search Results

text:
# Question
Title: Grid and Search Results
I'm using a Grid field (ee2.7) for a FAQ channel. The Grid has 2 column and both are Searchable. How can I display in a Searchresult the row where the term is found. Right now it display the first row of mijn Grid field and not the one where the term is found.

Is it possible?

Francois

# Answer
You certainly can. take a look at the `search:column_name` parameter of the grid tags.

The idea is in your results loop, call the grid tags with the search parameters from the origional search, something like this (untested) :

```
{exp:search:search_results}

    {my_grid_field search:column1="{exp:search:keywords}" search:column2="{exp:search:keywords}"}

         <h2>{my_grid_field:column1}</h2>
         <p>
             {my_grid_field:column2}
             <img src="{my_grid_field:column3}" alt="{my_grid_field:column1}" style="float:left;" />
         </p>

    {/my_grid_field}

    <hr />

{/exp:search:search_results}

```

The idea is we're using the good old grid tag pair, and redoing the search by passing the search string back into the grid field. Simple really.

You can also use one of the myriad of string replacement modules to find and highlight your search terms in the grid columns...
> 1 votes

---
Tags: search, grid
---


# Question
Title: Member Group Tabs throws blank screen after EE upgrade to 2.10
After an update to EE 2.10.1 the module Member Group Tabs throws the following error:

Call to undefined method Cp::set\_variable() in /path/sh\_member\_group\_tabs/ext.sh\_member\_group\_tabs.php on line 277.

Does anyone have an idea how to resolve this?

Thanks in advance, Tom

# Answer
open file */system/expressionengine/third\_party/ext.sh\_member\_group\_tabs.php* and change line 270:

```
if (APP_VER >= '2.6.0')

```

to

```
if (version_compare(APP_VER, '2.6.0', '>='))

```

it is also needs to make search & replace for **APP\_VER \>= '2.6.0'** & **APP\_VER \>= '2.8'** and replace it with **version\_compare(APP\_VER, '2.6.0', '\>=')** & **version\_compare(APP\_VER, '2.8', '\>=')**
> 6 votes

# Answer
Thank you Rakesh and Tom. Member Group Tabs is now compatible with EE v2.10.1.
> 1 votes

---
Tags: ee2, extension
---


# Question
Title: Getting meaningful search results from a Grid field
I have a channel that is used for the creation of a glossary. Rather than creating numerous individual entries, I have chosen to build the glossary as a Grid field (called 'glossary'), with the channel itself set as a Single Entry channel (using the Single Entry add-on).

The field (and its columns) are searchable, and matches are being found by my Simple Search form correctly. However, displaying the search results is problematic. The Search results are seemingly unable to determine which row of the Grid field the match occurs in, and the result simply displays the first row.

I guess that what I need is for the {exp:search:search\_results} tag to return the {glossary:field\_row\_count} variable for the search match, so that I can make use of it in my results code.

Is there any way to do this? Or an alternative solution/workaround? (I'd prefer to stick with the native EE Search features if possible, rather than involve yet another third party add-on).

\[Using EE v2.9.2\]

# Answer
> 0 votes
Sorry I never answered this earlier, but we've had a duplicate question that I've posed an answer too here :

Grid and Search Results

Perhaps this might help if this quesion is not too stale??

---
Tags: search, grid, simple-search
---


# Question
Title: Expresso Store modifier select in checkout
I would like to add the option the change the product modifiers from inside the checkout. I've done some tried some things already but don't seem to be able to manage this. At the moment I'm using an embed function to display the modifiers select per product in my checkout which is working. Though the update seems to ignore this select.

My current code is like this:

```
{exp:store:checkout form_class="form-horizontal" return="{segment_1}/order_ok/ORDER_HASH/"}
   {items}
     {exp:channel:entries entry_id="{entry_id}" site="sales"  status="not closed"}
       <tr>
         <td>{title}</td>
         <td>
           {modifiers}
             {embed="us/_product-modifiers" entry_id="{entry_id}" key="{key}" option_id="{option_id}" modifier_id="{modifier_input_name}"}
           {/modifiers}
         </td>
         <td>
            <div class="input-group">
               <input type="text" name="items[{key}][item_qty]" value="{item_qty}" class="form-control qty" placeholder="1">
            </div>
       </tr>
     {/exp:channel:entries}
   {/items}
{/exp:store:checkout}

```

The embed I'm using:

```
{exp:store:product entry_id="{embed:entry_id}" disable_form="yes" disable_javascript="yes"}

  {modifiers}
    {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
        <select name="items[{embed:key}][{embed:modifier_id}]">
            {modifier_options}
                <option value="{option_id}" {if "{embed:option_id}" == "{option_id}"}selected="selected"{/if}>
                    {option_name}
                </option>
            {/modifier_options}
        </select>
    {/if}
  {/modifiers}

{/exp:store:product}

```

I'm not entirely sure if it's even possible without modifying the store code itself as there isn't really anything about it in the documentation from what I can see. Has someone encountered the same problem already or might know a solution to this problem?

# Answer
Looks like the answer you need is in one of the 2 answers given here mate : Store module: How to update product modifier from the cart page?
> 1 votes

# Answer
As Adrian mentioned in the previously mentioned link this is not a normal behavior for Store as it see items with different modifiers/skus as separate line items in the cart.

> The underlying issue you are running into here is that Store treats any products with different modifiers as separate line items in your cart (for example if you add a Red Shirt and Blue Shirt to your cart, it would not make sense to merge them into a single line item on the invoice). That is why when you try to update the "modifier", it adds a new line item to the cart.

So in Store v2 you are still really faced with the same two options:

1.)

> Write an extension with a custom form action URL, which edits the cart directly in the database (this is easier than it sounds, you can use our cart library to recalculate everything once you change the modifiers)

This is what Brian did when he tapped into the `store_cart_update_start` hook in Store v1. You could create the same functionality in Store v2 by using one of the order\_update hooks

OR

2.)

> Remove the existing product and add a new product. This would require some javascript to make two sequential form submissions seem like a single step to the customer, because the checkout form and product form have different action URLs.

If you are not comfortable with php this would be your best best, you could open a modal that allows the customer to add a new product to the cart with the correct modifiers and then deletes the product with the different modifiers from the cart.
> 0 votes

---
Tags: expresso-store, checkout, modifiers, product
---


# Question
Title: Freeform Pro issue with Stash and CE Cache
I have an event template that pulls in a Freeform Pro field, via the Freeform Pro fieldtype, which relates a form to an entry. I'm having problems with a reoccurring error that says "Invalid form id(s)":

```
{exp:ce_cache:it id="events-{segment_2}-mobile_{gv_device_is_mobile}" tags="event"}

    {exp:stash:set_list
        name="event-{segment_2}"
        parse_tags="yes"
        parse_depth="3"
        parse_conditionals="yes"
        save="yes"
        refresh="60"
        scope="site"
        replace="yes"
    }
        {exp:channel:entries
            channel="event"
            cache="yes"
            refresh="60"
            disable="member_data|pagination|trackbacks"
            show_expired="no"
            status="open"
            require_entry="yes"
        }

            {stash:event_title}{title}{/stash:event_title}
            {stash:event_id}{entry_id}{/stash:event_id}

            {!-- This is my Freeform Pro Fieldtype https://www.solspace.com/docs/freeform/channel_entry_fieldtype/ --}
            {stash:event_form}{event_form}{/stash:event_form}

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

    {exp:stash:set name="content"}
        {exp:stash:get_list
            name="event-{segment_2}"
        }
            <h1>{event_title}</h1>

            {exp:ce_cache:escape}
                {if event_form}
                <div class="wb bt">
                    <div class="inner">
                        {event_form}
                    </div>
                </div>
                {/if}
            {/exp:ce_cache:escape}

        {/exp:stash:get_list}
    {/exp:stash:set}

{/exp:ce_cache:it}

```

As you can see, I'm using Stash to set all of the data related to the entry and `{stash:event_form}` captures the Freeform Pro fieldtype. I'm also using CE Cache on the page, but i'm using CE Cache Escape tags `{exp:ce_cache:escape}` around the actual form.

I was wondering if someone can tell me if I need to be doing anything else to prevent this error? I can fix it temporarily by deleting the page from CE Cache, but eventually it reoccurs - presumably after someone completes a form on another entry.

# Answer
> 1 votes
We never recommend caching a form because it has a unique identifier from ExpressionEngine for CSRF protection that's generated per page as well as a unique identifier from Freeform used to prevent spamming, malicious form manipulation, and to assist in multipage forms.

You are getting the invalid form ID error because the cached form isn't able to regenerate the params ID Freeform needs to function properly.

---
Tags: solspace-freeform, stash, cache, ce-cache, caching
---


title: FreeForm Entries Pagination Not Working

text:
# Question
Title: FreeForm Entries Pagination Not Working
FreeForm pagination only works if the entry results of the form is MORE than the limit. If the results are not greater than the limit i get a loop of code.

For example: I have a total of only 5 entries in the form.. however in due time there will be more...

When i limit to 10... I would expect to see no pagination links until my results exceeds 10. At the moment though i get a continuous loop of the following code.

```
{freeform:paginate}
Page {freeform:current_page}
of {freeform:total_pages}
pages
{freeform:pagination_links}
{/freeform:paginate}

```

If i set my limit to for example.. "2" the paginaiton works perfectly (because i have more entries than "2").

Can anyone shed some light on this, thanks.

# Answer
> 0 votes
We can confirm this issue on our end as well. It's a bug and we'll get a fix out for it soon. In the meantime, the workaround suggested above will resolve the issue for now (wrapping conditional around pagination code):

```
{if freeform:paginate}{/if}

```

# Answer
> 1 votes
You should wrap the pagination tag in a conditional.

```
{if freeform:paginate}
    {freeform:paginate}
        Page {freeform:current_page} of {freeform:total_pages} pages   {freeform:pagination_links}
    {/freeform:paginate}
{/if}

```

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


# Question
Title: Templates not being processed - tags are displayed
I've recently moved several ExpressionEngine sites from one server to another. Most are fine but one is now displaying template tags on the site itself. I don't really know where to start with this as I don't often work with EE. I've tried clearing the cache and making sure the file paths are correct. There are no errors in the server's error log.

I am looking for some help to diagnose this problem and find out what might need to be changed.

# Answer
> 1 votes
Common problems rendering a template include:

Malformed tags:

```
{exp:channel:entwies channel="blog_posts"} ...

```

PHP intermingled where it doesn't work or has syntax errors:

```
{exp:channel:entries channel=<?php echo "\"" . $channel_name . "\""?>} ...

```

Tags embedded in tags embedded in tags eventually causing a parse order issue, or a tag space error:

```
{exp:channel:entries channel="{exp:channel:category_heading}{if "{category_name}" == 'category 1'}-{category_name}{if:else}|{category_name}{/exp:channel:category_heading}{/if}"} ...

```

I hope some of this helps.

# Answer
> 1 votes
One other thing to check for would be to make sure that the template hasn't somehow been set to be a static template.

# Answer
> 0 votes
Old post which the OP seems to have dropped, but for anyone stumbling on this for their own purposes…

To build on what Mark mentioned, and since OP noted that he's not overly familiar with ExpressionEngine, the location of the 'static' template setting is as pictured below (note the Breadcrumb trail at the top of the image to get to the template's settings).

The two suggestions, that a) the template is set to static or b) there's a simple typo causing EE's tags to not parse, are two excellent places to start.

---
Tags: templates
---


title: Channel Polls not showing answer

text:
# Question
Title: Channel Polls not showing answer
I've just installed Channel Polls to test, but find that the answers do not display in the poll. Radio buttons are visible but not the label. when submitting a form this error message displays: No Answer form field found!

Thanks for your help in advance.

Edit:

I set up a clean local install of EE to test, using the same version as the client site: 2.7.3. And used the following template code:

```
            {exp:channel:entries channel="poll"}
            {exp:channel_polls:new_vote entry_id="1"}
            <ul>
            {poll:answers}
            <li><input type="radio" name="{poll:form_name}" value="{poll:form_value}">   {poll:answer}</li>
            {/poll:answers}
            </ul>
            {if poll:closed}<h4>POLL CLOSED</h4>{/if}
            {if poll:no_access}<h4>YOU HAVE NO ACCESS</h4>{/if}
            {if poll:already_voted}<h4>ALREADY VOTED</h4>{/if}
            {if poll:not_voted}<h4>NOT VOTED YET</h4>{/if}
            <input name="submit" value="VOTE" type="submit">
            {/exp:channel_polls:new_vote}
            {/exp:channel:entries}

```

CP is version 2.7.5a. Thanks again!

# Answer
> 1 votes
I know this is an old thread, but I ran into this issue recently. In my case, I had a field named "poll" which was causing a variable collision.

---
Tags: channel-polls
---


title: PHP Errors When Enabling MSM

text:
# Question
Title: PHP Errors When Enabling MSM
I am trying to get an existing EE site working with MSM. I upgraded the site earlier from 2.1.2 to 2.9.3. Once that was working, I then installed MSM 2.1.7. When I enable MSM in the CP I get several PHP errors:

Message: apc\_delete\_file() \[function.apc-delete-file\]: Could not stat file /nfs/c10/h04/mnt/123456/domains/domain.com/html/system/expressionengine/config/config.php, unable to delete from cache. Filename: core/EE\_Config.php Line Number: 1222

Message: Cannot modify header information - headers already sent by (output started at /nfs/c10/h04/mnt/123456/domains/domain.com/html/system/codeigniter/system/core/Exceptions.php:170) Filename: core/EE\_Input.php Line Number: 213

Message: Cannot modify header information - headers already sent by (output started at /nfs/c10/h04/mnt/123456/domains/domain.com/html/system/codeigniter/system/core/Exceptions.php:170) Filename: libraries/Functions.php Line Number: 446

Once this happens, trying to access any page on the site gives "Site Error: Unable to Load Site Preferences; No Preferences Found" messages. Disabling MSM in the config.php gets the site working again, but how do I complete this so that MSM is working?

# Answer
It turns out that there was a bug in EE. It took several weeks to get it resolved, but this fixed it:

https://support.ellislab.com/bugs/detail/20959/php-error-after-upgrade-from-2.9.2-2.10.1-in-admin-section
> 0 votes

# Answer
The first message would kind of cause the following 2. The first error also implicates APC (Advanced PHP Cache).

I would disable APC for the time being to see if you can bring the MSM site back up. If this works then I would guess there's some sort of EE Config / Cache conflict.

I couldn't hazard an exact resolution as I haven't worked with MSM for quite an while, and while I have used APC and MSM, never together (a quick search for MSM & APC doesn't yield much). But I hope this at least helps you test and narrow down the issue!

Also, MSM is an EllisLabs product, perhaps they'll give you a bit of support on this?
> 0 votes

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


# Question
Title: CSV upload in Google Maps for ExpressionEngine - PHP error: Filename cannot be empty
I'm trying to upload a csv file in Google Maps for ExpressionEngine (Objective HTML) and get the output below. On my local installation it imports fine but on the live server I get this error. I can otherwise upload csv files within EE, e.g. within the Assets module. What could prevent the upload within the Google Maps module? I'm testing with a small file with 2 entries and a header row.

---

A PHP Error was encountered

Severity: Warning

Message: file\_get\_contents(): Filename cannot be empty

Filename: libraries/Gmap\_import.php

Line Number: 634

A PHP Error was encountered

Severity: Warning

Message: file\_put\_contents(): Filename cannot be empty

Filename: libraries/Gmap\_import.php

Line Number: 636

can not load csv file

---

I'm using Google Maps for EE 3.3.8 on EE 2.10.1

# Answer
> 0 votes
I discovered in the php error logs it was looking for a /tmp folder above web root so I created that and the upload now works.

---
Tags: google-maps-for-ee, csv, objective-html
---


title: freeform entries not listing

text:
# Question
Title: freeform entries not listing
I've got a basic freeform form that posts to /forms/success/%%entry\_id%%

In that /forms/success template, I have the following code:

```
        {exp:freeform:entries entry_id="{segment_3}" status=""}
        {if no_results}No results?{/if}
            <p>We have received the following data and will process it shortly.</p>
            <fieldset class="bg-white">
                {freeform:all_form_fields}
                <p>
                    <label>{freeform:field_label}</label>
                    {freeform:field_output}
                </p>
                {/freeform:all_form_fields}
            </fieldset>
        {/exp:freeform:entries}

```

Every time I post a form, I get redirected to the success template fine (with an entry\_id as segment 3) but get the no results block every time. Data is being collected fine. I've tried setting status="open|pending" (as all new submissions are pending). I've also tried with and without dynamic="no" but that makes no difference. I can't see what I'm doing wrong (it may be obvious!)

This is freeform 4.2.2 on EE 2.10.1.

# Answer
> 2 votes
You need a form\_id= in addition to an entry\_id= because entry ids are per form, not globally unique.

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


# Question
Title: MX Title Control not working with Channel Form entries
I've been using the excellent MX Title Control CE to append the epoch seconds to the end of my URL string so that they end up:

mysite.com/jobs/this-is-a-new-job-1528549

It works great through the back end, but when I use Channel Form the url\_title is always set to 0.

Does anyone have any experience of getting these two to play nicely together?

I've included a field for the url\_title in my Channel Form which is (I think) all I need to do, though the instructions are a little sparse...

Thanks

# Answer
> 0 votes
In case anyone else experiences it, I've added a pull request that resolves this issue:

https://github.com/joeczucha/mx-title-control/commit/9b0851146e3edc55442879affd3a6e4e9ff3df63

# Answer
> 1 votes
I see from your MX Title Control GitHub Issue that you've fixed your issue. Nice job mate!

For any other readers the solution, which is a patch Joe submitted is listed here : https://github.com/joeczucha/mx-title-control/commit/9b0851146e3edc55442879affd3a6e4e9ff3df63

---
Tags: safecracker, url-title, mx-title-control
---


# Question
Title: Solspace Importer not importing members in their member group
Using EE 2.7.0 and Importer 2.2.3 and trying to set up a members import. The csv has been saved out of open office as a utf-8 " enclosed and comma-delimited.

I have 3 lines to test this with, using the first lines as headings.

On import, it recognizes my file, then does the import 'successfully'. However, nothing gets entered into the members group I have designated. I have checked to make sure the group is unlocked, and that my file is formatted correctly. It tells me it runs correctly, but nothing happens to the fields.

2013-10-14 18:50 Start Time: Run Time: 0.024 seconds Import Location: Control Panel Number of Queries: 10 Member Inserted: 0 Members Updated: 0 Total Members Processed: 0 Member IDs: End Time: 6134-10-15 18:50 * Press the ESC key to close window.

Incidentally, I ran this on the full sheet of 700+, and it noticed I had batche processing and said it did the amount on my sheet, but again, nothing went in.

Any ideas?

# Answer
It turns out from looking it over with Solspace that if you tick that the first row is your field names, and leave one blank, the import wont work. You have to keep this field with some text in it.
> 0 votes

# Answer
I ran into this same issue. For me it was a new custom member field that was set to be Required. In other words this field wasn't being used on the old site so wasn't part of the import data. Since it was required Importer silently rejected every record.

Definitely operator error but something to check if you get tripped up like I did!
> 0 votes

---
Tags: members, import, solspace-importer
---


# Question
Title: Low Search + Matrix field data = display search term
I've got the search working great, as solved here: Low Search + Matrix field data

But now I'd like to display the query on the results page. Technically I am displaying it by using this:

Searched for **{low\_search\_query\_string}**

but it looks like a string -- of course. Is there a way to make it pretty and just show the search term?

Thanks!

:osa

# Answer
As per how parameters work in Low Search, you can output any parameter with a variable formatted like this:

```
{low_search_parameter_name}

```

As per the question/answer you linked to, that would be:

```
{low_search_search:tags:arranger}

```
> 1 votes

---
Tags: low-search
---


title: Reassign uncategorised entries

text:
# Question
Title: Reassign uncategorised entries
I need to reassign all uncategorised entries into a certain category, I've managed to create an SQL query which selects all the entries for that channel which aren't assigned to any categories, but I'm getting a bit stuck when it comes to updating the `exp_category_posts` table. SQL isn't my strongest area so help would be appreciated.

This is my SQL for selecting the entries:

`SELECT exp_channel_data.entry_id FROM exp_channel_data LEFT JOIN exp_category_posts ON exp_channel_data.entry_id = exp_category_posts.entry_id WHERE exp_category_posts.entry_id IS NULL AND channel_id = 5;`

So the `exp_category_posts` has two columns, `entry_id` and `cat_id`, I need to pull in the `entry_id` from the `exp_channel_data` table and hardcode the `cat_id` column to a certain value.

# Answer
```
UPDATE exp_category_posts
    LEFT JOIN exp_channel_data
    ON exp_channel_data.entry_id = exp_category_posts.entry_id
    AND exp_category_posts.entry_id IS NULL
    AND exp_channel_data.channel_id = 5
SET exp_category_posts.cat_id = 123;

```

Please *backup* those two tables before running any update queries, just in case. Also make sure you know how to restore said backups before proceeding.

Replace 123 with the category id you want to set the uncategorized entries to.

**EDIT**

Here are some queries for you.

This one will *insert* rows that don't exist in your exp\_category\_posts table and should not error out:

```
INSERT INTO exp_category_posts (entry_id, cat_id)
    SELECT exp_channel_data.entry_id, @cat_id := 88
    FROM exp_channel_data
    LEFT JOIN exp_category_posts
    ON exp_channel_data.entry_id = exp_category_posts.entry_id
    WHERE exp_category_posts.entry_id IS NULL AND exp_channel_data.channel_id = 5
    AND exp_channel_data.entry_id NOT IN (select entry_id from exp_category_posts);

```

and this one will *update* rows that already exists (but have cat\_id = 0, which is null for this table) to have your cat\_id = 88:

```
UPDATE exp_category_posts
SET exp_category_posts.cat_id = 88
WHERE exp_category_posts.cat_id = 0;

```
> 2 votes

---
Tags: categories, mysql
---


# Question
Title: stripe_test_public_key and stripe_live_public_key tags are not parsing
I've installed the DevDemon Subscriptions add-on with EE 2.10.1 and I'm using the Stripe payment gateway.

I'm currently just testing with the default templates that come with the add-on. In the subs/subscribe\_stripe template, the publishable API key is included in the form as a hidden field using the {stripe\_test\_public\_key} or {stripe\_live\_public\_key} tag. However, the tag is not being parsed.

I can't even find anywhere in the add-on's files where that tag is being defined.

Is this a bug or am I missing something?

# Answer
From the docs, it implies you have to 'hard-code' your keys in your template : http://www.devdemon.com/documentation/subscriptions/#subs-payment-gateway-stripe

I realise your reading the default templates however I would guess that if you use a default template via a `subs` tag it'll inject these values into globals, that or they are placeholders with squiggly brackets just to confuse you!
> 1 votes

---
Tags: subscriptions, stripe
---


# Question
Title: Adding class to a field within a channel form
{label:skills}: {field:skills}

I am trying to add a class to the field skills. Cant find any documentation on adding a class to this field. Im sure its a simple fix, anyone got the solution?

Thanks

# Answer
Via the Channel Entries form, you'll have to go by the docs, I thought you could add attributes however I was thinking of a freeform field(`{freeform:field:my field attr:class="testClass"}`, not a SAEF/Channel Entries field unfortunatly.

The examples show you how to make your form, with complete markup autonomously here : https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/examples.html#entry-form-without-using-the-custom-fields-loop.

Assuming its a basic text field :

```
    <label for="my_field_name">{label:skills}</label>
    <input type="text" class="testClass" name="my_field_name" id="my_field_name" value="{skills}">

```

If you look through the examples, the label:field syntax can be useful for the complex types like grid or relationship (see here also : https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/#including-assets) but it sounds like you'd be better suited by leveraging your power HTML skillz.
> 1 votes

---
Tags: safecracker, channel, channel-fields
---


# Question
Title: DevDemon Subscriptions - bug caused by the way prices are stored
It appears as though the Subscriptions add-on stores the subscription amount as an integer in the database rather than a decimal. For example, a subscription amount of £120.00 is stored in the database as '12,000'.

This is causing a problem for, I think, any amount over 1000. For example, if I create a subscription with an amount of £1250, which gets stored in the database as '125,000', the customer actually only gets billed £1. Also, on the Subscriptions page within the module's settings, it displays the value of the subscription as £1.00.

Also, I don't think the payment gateway makes a difference but just in case, I'm using Stripe.

I'm not sure if this way of storing amounts in the database was deliberate, but it seems very odd.

# Answer
It's quite common for DB's to store monitary amounts as pence in integers. I beleive this is for DB optimisation as it's easier to format a number with pretty currency formatting than store the formatted number.

floats are another possability but take up more memory.

Also many systems like this are not region locked, in that they could be used with any currency in any country. By using a DB that is not necessarily locale aware it's probably better to stich with lowest denomination as an integer. makes it easy to store $231.45 dollars or £12.06 GBP or Y0.12 yen. no need for DB locale operations, PHP can parse the number into the correct denomination on display.

I realise we have currency and money typess in things like SQL Server, but in my experiance this causes problems (or at least conversions) specially when dealing with multi-currency sites.

For example, suppose we're living in the past and making a website to support 'old money' (pounds, shillings and pence) and 'new money' (just pounds and pence). For New money it's simple, £6 6p = (6 * 100) + 6 = 606, thats an integer. For old money the value is £2 10s and 6p, to represent this as an integer all we need to do is (2 * 240) + (10 * 12) + 6 = 480 + 120 + 6 = 606, there's our integer.

Now, that's a nice discussion point however (and here comes the disappointment) I can't answer the OP Question, but it certainly sounds like you've got a bug (In stripe??) there.
> 0 votes

---
Tags: subscriptions
---


# Question
Title: Simple PHP Substring not Working in Template
This should be straightforward. I just need to take my event summary from the Solspace Calendar plugin and truncate it to say 280 characters. I have PHP set to "Yes", and "Output" parsing stage. It is breaking and not rendering the template. I'm assuming it's because I'm using it in a variable pair. Below is the template:

```
{exp:calendar:cal calendar_id="214" date_range_start="-2 weeks" date_range_end="+5 weeks"}
{events}

    <div class="eventPopup" data-date="{event_start_date format="%Y-%m-%d"}">
        <div class="eventPopupHeader">
            {event_start_date format="%F %j, %Y"}
        </div>
        <div class="closeButton"><a href="javascript:void(0)"><img src="{siteroot}images/uploads/main/closeButton.png" width="30" height="30" alt="close button"></a></div>
        <div style="clear:both"></div>
        <div class="subnavContent">
            {if event_pic != ""}<img src="{event_pic}" width="246" height="166" alt="menu pic"><div style="clear:both"></div>{/if}
            <h3><a href="/haa/event/{entry_id}">{event_title}</a></h3><p>{event_location} - <?php echo substr("{event_summary}", 0, 280); ?></p>
        </div>
    </div>
{/events}
{/exp:calendar:cal}

```

# Answer
Why aren't you just using https://devot-ee.com/add-ons/character-limiter ??

Also, if PHP is set on output, what happens when

```
{event_summary}

```

has a value like this?

```
And the event was great, he said "Everything is healing nicely!"

```
> 4 votes

# Answer
There are many plugins for this already.

Here are a few:

http://www.causingeffect.com/software/expressionengine/ce-string

https://devot-ee.com/search/results?keywords=string+length&addon\_version\_support=ee2

Or you could roll your own...
> 0 votes

---
Tags: php, solspace-calendar
---


# Question
Title: 502 bad gateway with large amount of channel images images
Im having some server issues with large uploads on channel images. I have some users who have as many as 150 images and when they try and edit their profile they are getting 502 errors

looking at the logs Im getting this error

```
2015/01/28 19:26:52 [error] 2880#0: *14 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 69.203.104.186, server: www.visualaids.org, request: "POST /liza/index.php?/cp/content_publish/entry_form&channel_id=9&entry_id=6475&filter=YTozOntzOjEwOiJjaGFubmVsX2lkIjtzOjE6IjkiO3M6ODoia2V5d29yZHMiO3M6MTY6Ikpvc2UgTHVpcyBDb3J0ZXMiO3M6OToic2VhcmNoX2luIjtzOjU6InRpdGxlIjt9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.visualaids.org", referrer: "https://www.visualaids.org/liza/index.php?S=0&D=cp&C=content_publish&M=entry_form&channel_id=9&entry_id=6475&&filter=YTozOntzOjEwOiJjaGFubmVsX2lkIjtzOjE6IjkiO3M6ODoia2V5d29yZHMiO3M6MTY6Ikpvc2UgTHVpcyBDb3J0ZXMiO3M6OToic2VhcmNoX2luIjtzOjU6InRpdGxlIjt9"

```

There was more specific errors about exceeding max\_input\_vars and i raised that in the php.ini but still no dice.

I also adjusted nginx settings for

fastcgi\_read\_timeout 300; fastcgi\_buffer\_size 1024k; fastcgi\_buffers 4 1024k; fastcgi\_busy\_buffers\_size 1024k;

and still no luck? anything else I should try?

# Answer
Try next settings for nginx:

```
client_max_body_size 10m;
client_body_buffer_size 128k;
fastcgi_connect_timeout 90;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 1024K;
fastcgi_buffers 8 512k;
fastcgi_busy_buffers_size 1024k;
fastcgi_temp_file_write_size 1024k;

```

It can be also error with php - not enough child processes. Check logs and try to increase it in php-fpm settings:

```
pm = static
pm.max_children = 60

```

if it's helps - you need to play with pm.max\_children \ pm.max\_spare\_servers to make it work for pm = dynamic.

p.s. and (just for sure) don't forget to restart nginx/php-fpm after changes
> 1 votes

# Answer
I had a similar problem with 502 Bad Gateways, but in my case it was for AJAX requests. The following nginx directives worked for me;

proxy\_buffer\_size 128k; proxy\_buffers 4 256k; proxy\_busy\_buffers\_size 256k;
> 1 votes

---
Tags: channel-images, error-502
---


# Question
Title: How to use dropdown to populate link tag
My page is shown in the image below. Users must select the city they are in using the dropdown. Then they click one of the images. The link is currently `<a href="{path=type/{title}/}">`. I'd like it to be automatically populated like `<a href="{path=type/{title}/Portland/}">`, based on whatever is selected in the dropdown.

I don't want the dropdown to load a new page - that would be way too slow. So I am looking for an alternative solution (CSS3 or JavaScript?), something that is lightweight and quick.

```
{exp:channel:entries channel="type" search:primary-category="not --" search:secondary-category="" dynamic="no"}
    <a href="{path=type/{title}/Portland/}">
       <div id="secondary-images">
           {exp:ce_img:single src="{type-image}" max="100" crop="yes" }
           <p>{title}</p>
       </div>
    </a>
{/exp:channel:entries}

```

# Answer
> 1 votes
Assuming your dropdown is named and id's as `city_select` and has the vlaues set to the URI that you wisdh to add, like this :

```
<select id="city_select" name="city_select">
    <option value="Portland">Portland, Oregon</option>
    <option value="USA">USA, Earth</option>
</select>

```

The below is pure jquery :

```
<script>

    //get the common part of the URI
    var targetSegment = 3;

    //wait for the page to load
    $(document).ready(function(e){

        //on change event
        $('#city_select').change(function(e){

            //iterate the links (add a valid selector here)
            $('#container a').each(function(){

                //get the new 'part'
                var extraUri = $('#city_select option:selected').eq(0).attr('value');

                //explode the current URI of the link
                var uriParts = $(this).attr('href').split('/');

                //build new URI
                var myUri = "";
                for ( var c = 1 ; c < targetSegment ; c++ ) {
                    myUri += uriParts[c] + "/";
                }
                myUri += extraUri;

                //apply the URI
                $(this).attr('href', myUri);

            });

        });

    });

</script>

```

Or at least something like that, you'll have to debug the script yourself as I've written this straight to notepad (my test sandbox site is no available atm) so it can also probably be hightly optimised, but I beleive this will give you the idea...

# Answer
> 1 votes
Blatants response was very helpful in figuring out how to proceed. I hired someone to get this working exactly as needed, and here is the code that I am using:

```
var changed = 0;
function myFunction() {
    var re = /type/;
    a = document.getElementsByTagName('a');
    for (index = 0; index < a.length; ++index) {
        if (changed==1) {
            a[index].href = a[index].href.replace(oldvalue, '');
        }
        if (a[index].href.match(re)) {
            a[index].href = a[index] + '/' + document.getElementById("topic").value;
        }
    }
    changed=1;
    oldvalue='/' + document.getElementById("topic").value;
}

```

---
Tags: links, drop-down
---


# Question
Title: How do I check for an empty field in a child entry?
I have an Event entry which can has one child Location entry. The Location entry has two fields: Title and Floor. Sometimes floor is empty so I'm doing this in my template to see if there's a floor entered:

```
<h2>
  {event_location:title}
  {if event_location:floor}
    , {event_location:floor}
  {/if}
</h2>

```

...and it's not working. Title always shows up and Floor never does unless I take off the conditional, which I don't want to do because I don't want a comma followed by nothing when there's no floor. Any ideas?

# Answer
I've found the right syntax to use from looking at this question: Conditionally display a field from a related entry if it's not empty (native relationships field). Basically, the field needs to be compared against an empty string as so:

```
<h2>
  {event_location:title}
  {if '{event_location:floor}' != ""}
    , {event_location:floor}
  {/if}
</h2>

```

Not remotely elegant, but this did the trick.
> 0 votes

# Answer
What version are you using? We fixed this problem in 2.9.3, though you can apply the solution if you'd rather not update.

---

Open `system/expressionengine/libraries/channel_entries_parser/Preparser.php` and find the `_find_modified_conditionals()` method around line 374, and **replace** it with this:

```
public function _find_modified_conditionals()
{
    $prefix = $this->_prefix;
    $unfiltered_all_field_names = array();
    $all_field_names = array();

    if (strpos($this->_tagdata, LD.'if') === FALSE)
    {
        return array();
    }

    foreach($this->_channel->cfields as $site_id => $fields)
    {
        $unfiltered_all_field_names = array_unique(array_merge($unfiltered_all_field_names, $fields));
    }

    // Do a rough cut to slim down the number of fields
    // else the string can be too long for the preg_match_all
    foreach (array_keys($unfiltered_all_field_names) as $name)
    {
        if (strpos($this->_tagdata, $name) !== FALSE)
        {
            $all_field_names[] = $name;
        }
    }

    $modified_field_options = $prefix.implode('|'.$prefix, $all_field_names);
    $modified_conditionals = array();

    if (preg_match_all("/".preg_quote(LD)."((if:(else))*if)\s+(($modified_field_options):(\w+))(.*?)".preg_quote(RD)."/s", $this->_tagdata, $matches))
    {
        foreach($matches[5] as $match_key => $field_name)
        {
            $modified_conditionals[$field_name][] = $matches[6][$match_key];
        }
    }

    return array_map('array_unique', $modified_conditionals);
}

```
> 3 votes

---
Tags: conditionals, related-entries
---


# Question
Title: Unable to load the following extension file: ext.detour_pro.php
A friend ask me to do some changes on his site made from EE. I never done any work in EE in my life so my first instinct is to copy all the files and database to my localhost. so that I can play it first in my local server before applying the changes on the live site. I'm using xammp 1.8.1 (PHP version is 5.2.9).

So basically what i did is put all the files in c:\xammp\htdocs\thesite and the database in "dbee" then apply changes in config.php and database.php under expressionengine folder.

in config.php

```
$config['app_version'] = "272";
$config['install_lock'] = "";
$config['license_number'] = "";
$config['debug'] = "1";
$config['cp_url'] = 'http://localhost/thesite/admin.php';
$config['doc_url'] = "http://ellislab.com/expressionengine/user-guide/";
$config['is_system_on'] = "y";
$config['allow_extensions'] = "y";
$config['site_label'] = 'sitel label';
$config['cookie_prefix'] = '';
$config['tmpl_file_basepath'] = 'c:\xammp\htdocs\thesite\assets\templates';

// Third Party Prefs
$config['third_party_path'] = 'c:\xammp\htdocs\thesite\assets\add-ons\third_party';
$config['url_third_themes'] = 'http://localhost/thesite/assets/add-ons/themes/';
$config['enable_online_user_tracking'] = "n";
$config['enable_hit_tracking'] = "n";
$config['enable_entry_view_tracking'] = "n";
$config['dynamic_tracking_disabling'] = "";

// END EE config items

```

in database.php

```
$db['expressionengine']['hostname'] = 'localhost';
$db['expressionengine']['username'] = 'root';
$db['expressionengine']['password'] = 'pwd';
$db['expressionengine']['database'] = 'dbee';
$db['expressionengine']['dbdriver'] = 'mysql';
$db['expressionengine']['pconnect'] = FALSE;
$db['expressionengine']['dbprefix'] = 'exp_';
$db['expressionengine']['swap_pre'] = 'exp_';
$db['expressionengine']['db_debug'] = TRUE;
$db['expressionengine']['cache_on'] = FALSE;
$db['expressionengine']['autoinit'] = FALSE;
$db['expressionengine']['char_set'] = 'utf8';
$db['expressionengine']['dbcollat'] = 'utf8_general_ci';
$db['expressionengine']['cachedir'] = 'c:/xammp/htdocs/thesite/app/expressionengine/cache/db_cache/';

```

and the results are;

from index.php and admin.php

from index.php from admin.php I already look in google can't find a solution.

I am hoping I could get answer from you guys.

Thank you so much in advance!

# Answer
It looks as though the Detour Pro extension is installed, but the package is missing from **thesite\assets\add-ons\third\_party**.

If the package is indeed there, then EE is having trouble finding and loading files from that directory (which is where third party add-ons are stored).
> 1 votes

---
Tags: ee2
---


title: Relating Members to each other

text:
# Question
Title: Relating Members to each other
I'm trying to figure out how (if possible) to relate members to each other. I have teachers registering with Zoo Visitor and are added as Teacher Member Group. They need to be able to then assign Assistants to their account so that they are tied into each other.

So Teacher John would have Assistant Bob and Assistant Jane. Teacher Elvis would have Assistant Bob and Assistant Mary and Assistant Trevor.

Any thoughts on how this would be possible, if at all in EE?

# Answer
Are the assistants members too? If not, Install PT Field Pack. You can use PT checkboxes as a field in your Zoo Member Profile. Then populate it with assistants. Then when teachers register, they can check off their assistants and you can display them through a members details page.

If they are members, you could do the same thing, but just write an import script that grabs assistants from the members database and populates new ones in that field type.

Blatant and I worked out a solution to a somewhat similar problem here:

Complex Member permissions

Not sure if it fits your needs, but it worked for me!
> 0 votes

---
Tags: members, zoo-visitor, member-management
---


# Question
Title: Save images from folder location to entry
I want my users to upload and crop images, when creating a new entry using Channel Form.

I'd love to use Channel Images for all of my photo management, but since I'm not happy with it's crop tool - which is way too cumbersome for my clients - I want to integrate an external cropping solution.

Now, I'm able to save cropped images to a folder on the server, but how can I assign those images to the entry being created?

Currently I'm thinking about grabbing the URL of the saved image and putting it in a hidden field during the entry creation process, but I'm not quite sure, how to do this in practice.

I've also purchased Photo Frame, but it's not a real replacement for Channel Images and it doesn't seem to be in active development any longer.

# Answer
Instead of using external tool, consider using Channel Images with CE Image.

Channel Images is perfect tool for image gallery tied to channel entry, and CE Image will give you extended editing possibilities.
> 0 votes

---
Tags: safecracker, channel-images, crop
---


# Question
Title: No results for a child relationship tag after upgrading to 2.7.3
I have a relationship field in a page with the name `pro_related_program`. Before the update from 2.5.5 to 2.7.3 this code snippet (as part of a larger template that loads a single channel entry):

```
{related_entries id="pro_related_program"}
 <div id="midLeftInset">
<p>This session is part of a larger series.  For more information see <a href="{title_permalink="programs/catalogue"}" title="TDLC: {title}">{title}</a></p>
</div>{/related_entries}

```

would result in this html for a specific page on my website:

```
<div id="midLeftInset">
<p>This session is part of a larger series.  For more information see <a href="https://www.jointokyo.org/en/programs/catalogue/DRM2011" title="TDLC: Disaster Risk Management in East Asia and the Pacific - 2011 Series">Disaster Risk Management in East Asia and the Pacific - 2011 Series</a></p>
</div>

```

the upgrade modified the code template snippet to:

```
{pro_related_program}
 <div id="midLeftInset">
<p>This session is part of a larger series.  For more information see <a href="{pro_related_program:title_permalink="programs/catalogue"}" title="TDLC: {pro_related_program:title}">{pro_related_program:title}</a></p>
</div>{/pro_related_program}

```

which gives me back nothing. If I add a `no_results` clause in there it gives me the contents of the `no_results` clause.

Does anyone have any ideas as to what might be causing this? What I coulddo to debug it?

# Answer
As Derek Hogue has suggested and from my own experience, I think this is likely an issue of a missed status parameter in the relationship tag pair. Also it also bears mentioning that the status parameter in relationship tag pairs at least up until the current EE version of 2.8.1 **is case sensitive**, which is different from the channel:entries status parameter behavior which is **not** case sensitive.

To test this, you could try something like:

```
{exp:channel:entries channel="your_channel" status="not closed"}

{pro_related_program status="not closed"}
{pro_related_program:title}
{/pro_related_program}

{/exp:channel:entries}

```
> 1 votes

# Answer
I just ran into this issue and I've discovered a strange behavior. Having the relationship fields without the wrapping is working.

This seemingly proper code provides nothing:

```
{brief channel="projects" status="Open|Closed"}
    {brief:title}
    {brief:entry_id}
{/brief}

```

While this one without the wrapping tag pair gives me what I need:

```
{brief:title}
{brief:entry_id}

```

Was this a bug?
> 0 votes

---
Tags: ee2, relationships, 2.7.3
---


title: perfect forward secrecy

text:
# Question
Title: perfect forward secrecy
I am trying to do perfect forward secrecy in an ExpressionEngine site. I have forced https to be used on all the pages using rewrite rules but the elements on the pages - images, js links, stylesheets etc - are coded using http and thus newer browsers give a message "Some unencrypted elements on this in the page have been blocked". The elements should be encoded with relative paths or with https absolute paths and are not. My developers tell me that they are encoded by ExpressionEngine and they can't change them. Is there any way to force ExpressionEngine to encode this in a more secure way.

# Answer
> 1 votes
? This is a confusing question, simply because HTTPS is very easy to achieve with ExpressionEngine. You can absolutely run EE through HTTPS; find your site config under

```
Admin -> General Configuration

```

in your backend, and make sure this setting

```
URL to the root directory of your site

```

is set to an HTTPS address. If you are still having issues, it's most likely because of third party scripts being loaded via HTTP, or seriously incompetent/lazy developers you are employing. If it's third party scripts, you need to contact those vendors for information on how to access their content via HTTPS. If it's lazy developers, you need to tell them to stop hard coding URLS and use the

```
{site_url}

```

variable, which should be set to an HTTPS address. To be honest it sounds like incompetent/lazy developers.

# Answer
> 0 votes
Change your file upload locations urls to https:// Make sure that your base site url is also set to https:// (admin / general config) along with the control panel url If you are loading anything external, think jquery, make the call be src= " //cdn.jquery......." any on server assets (style sheets, scripts, etc) use {site\_url}/path/to/asset (you already set the site url to be https) That should cover most of it. If you view source of the page, and search for http:, that will tell you what is not being loaded under https. Your developers are lazy.

---
Tags: ee2
---


# Question
Title: Expresso store refresh on product removal
I'm using Expresso Store as a webshop. In this webshop I'm able to remove an item from my cart. This is my remove button:

```
<input type="submit" name="remove_items[{key}]" class="remove" value="" />

```

The problem is that I'm using ExpressionEngines Freebie for the URL. Because of this, when I click the remove button, the page refreshes to the URL that doesn't contain the Freebie segments. A small example:

When I am on this page: http://colourindisplay.portalserver.nl/nl/webshop/category/ral-boeken/checkout and remove an item on this page, it'll refresh to this page: http://colourindisplay.portalserver.nl/nl/webshop

I'm trying to find a way to avoid the refreshing or at least refresh it to the right URL (http://colourindisplay.portalserver.nl/nl/webshop/category/ral-boeken/checkout).

Does anybody have an idea on how to do this?

# Answer
> 0 votes
If this form goes along the lines of any other EE form, you should be able to set the hidden "RET" input to influence this. Otherwise to avoid redirects you'll need to develop some AJAX methods.

Can you supply the full source of your remove product form? This will reviea the state of the hidden elements and also where the form submits too (may not be relivent but best to check this too), I suspect it submits to an ACTion if the above holds true and its a standard EE from...

Edit: Fortunatly, as you've supplied working links (+1) I was able to confirm the above myself. It does hold the RET parameter, so you should be able to influence this using the `return` parameter detailed here : https://www.exp-resso.com/docs/checkout\_tag.html#return\_path

If you share your complete form creation / opening tag I can post a working example too...

---
Tags: expresso-store, jquery, javascript, ajax, freebie
---


title: Update Playa field using Charge action

text:
# Question
Title: Update Playa field using Charge action
I am using the Charge add-on to connect a website to Stripe payments. I have an action setup whereby a channel entry is created. There are five fields in the channel, four of the fields are text inputs and the last one is a Playa field. The four text inputs are being populated correctly but not the Playa field.

In the code block below, the Playa field is "recipe\_purchases\_recipe". I am using hidden fields as I only want the form to show the credit card information (removed here for brevity).

This form is embedded in the template as a Stash embed so that I can pass entry variables through. Looking at the code in web inspector I see that the correct variables are coming through, but I can't figure out how to get the Playa field to populate with the entry. I tried {entry\_id}, {url\_title} and {title} but no luck so far.

**How do I populate a Playa field in an entry using the Charge action?**

```
{exp:charge:form
 form_id="charge-form"
 on_success="create_recipe_purchase_entry"
 on_success:recipe_purchases_order_number="{id}"
 on_success:recipe_purchases_customer_name="{customer_name}"
 on_success:recipe_purchases_amount="{plan_amount}"
 on_success:recipe_purchases_recipe="{stash:entry_id}"
 return="/recipes/{segment_2}/thanks"
 return_error="/recipes/{segment_2}/buy"
}
 <input type="hidden" id="customer_name" name="customer_name" value="{exp:zoo_visitor:details}{visitor:member_firstname} {visitor:member_lastname}{/exp:zoo_visitor:details}" />
 <input type="hidden" id="customer_email" name="customer_email" value="{email}" />
 <input type="hidden" id="plan_amount" name="plan_amount" value="{recipe_price}" />
 <input type="hidden" id="recipe_purchases_recipe" name="recipe_purchases_recipe[]" value="{stash:entry_id}" />
   ...
{/exp:charge:form}

```

# Answer
> 0 votes
I would say that this is not as easy as using the params for Charge, the problem is Playa is a complex field with its own tables, so it doesn't store the raw value in the `exp_channel_data` table, but rather stores a reference to the `exp_relationships` table.

What I would do is develop a small extension that hooks into the charge event `action-update-entry-end`, set up an action to update your entry as normal (perhaps update a simple field) and use the hook to catch the data you need, from here you can use the Channel Entries API to populate your playa with PHP.

---
Tags: playa, charge
---


# Question
Title: Showing parents of parents of parents, using Playa to build a pedigree chart
I am afraid that this is rocketscience for me, I do not understand the principle. I must show related entrees, and their related entrees, and their etcetera. In a grid, like a pedigree chart Let me explain.

The site is about horses, and bloodlines. Two channels, horses\_father and horses\_ mother, with horses\_fieldgroup containing two Playa fields: 1)rel\_hors\_mother and 2)rel\_hors\_father. When creating a new horse entry the editor can relate to father and mother. I can show these relations in the HTML.

But I do not know how to relate (in principle) infinitive levels deep. Let say we have horse X-1 with father X and mother Y. I can easy show father and mother of X-1, but I must also show the father of X, the mother of X, the father of Y, mother of Y AND their parents as well. I do not know how many levels deep they want it, but the system should not be limited to amount of levels.

Is this possible with Playa? Or is it better to look for other solutions?

Thanks for looking at this.

# Answer
> 0 votes
This sounds a bit more complex than Playa.

These relationships sound similar to `cladograms` or `phylogenetic trees` in Biology, but in reverse. And similar to parent-child syntax trees, but in reverse.

Take a look at phpSyntaxTree.

That is a PHP library to create images on-the-fly based on parent-child relationships of syntax. Example syntax and image output below:

`[Horse-0 [Horse-1][Horse-2 [Horse-3][Horse-4 [Horse5][Horse6]]]]`

I could see you dynamically generating this string based on your parent-child relationships, and outputting an image based on a call to this library. It does assume you have some inner working of PHP and calling PHP libraries under the EE hood.

Good luck!

# Answer
> 0 votes
I Think you need to embed template for parents if you are retrieving more then 1 level parents. by passing entry id inside a playa tag. example

```
{exp:playa:parents ........}
{embed="template-group/template" child_id="{entry_id"}
{/exp:playa:parents}

```

---
Tags: playa, stash, relationships, related-entries
---