# Question
Title: Member Categories Check and "Stashing" the Results for Later
I’ve got a page where I’m posting links to the groups that a user has access to based on Member Categories. Before, I just used the {exp:member\_categories:categories} loop and it worked fine, but there was no organization to the way the list was displayed and it was just a long random list of links. So I’m trying something different and running a separate {exp:member\_categories:check} for each of the categories, broken down into logical groups. Not the most efficient, I know, but it’s only on one page (and I can technically cache it when it’s done).

Anyway, the only problem is that I can’t give a single “you do not belong to any groups” if they don’t belong to any groups. If I do a {if no\_results}, then I get that for each category that it checks. And I don’t really want that.

I was going to try to use Stash to set some sort of value to an append\_list, then check that at the end. However, it’s not working. I have tried both of the following, setting a value of “1” so that I could check for “is\_empty” later.

```
{exp:stash:append_list name="group_list" process="end"}
    {exp:member_categories:check category_id="113"}
        <p><a href="/members/groups/sample-group">Sample Group</a></p>
        {stash:item_link}1{/stash:item_link}
    {/exp:member_categories:check}
{/exp:stash:append_list}

```

and

```
{exp:member_categories:check category_id="113"}
    {exp:stash:append_list name="group_list" process="end"}
        <p><a href="/members/groups/sample-group">Sample Group</a></p>
        {stash:item_link}1{/stash:item_link}
    {/exp:stash:append_list}
{/exp:member_categories:check}

```

I’m not sure if this is even possible? Or are there any other options?

# Answer
Don't know much about member categories add-on, but seems you could do something like your first idea.

```
{!-- #1 Stash categories for member --}
{exp:member_categories:categories}
    {exp:stash:append_list
        name="mcats"
        context="{category_group}"
        parse_tags="yes"
    }
        {stash:cat_id}{category_id}{/stash:cat_id}
        {stash:cat_name}{category_name}{/stash:cat_name}
        {!--etc...--}
    {/exp:stash:append_list}
{/exp:member_categories:categories}

{!-- #2 Check if some cats exist for this member --}
{if {exp:stash:not_empty name="mcats"}}

    {!-- #3 Output Category ID 113 --}
    {exp:stash:get_list
        name="mcats"
        context="113"
        prefix="st"
    }
        {if st:no_results}<p>No Results for Category ID 113</p>{/if}
        <li>{st:test}</li>
    {/exp:stash:get_list}

{if:else}
    <p>No Results at all for this member</p>
{/if}

```

Untested. (You might need to wrap #1 or #2, both separately, or the whole thing with stash:parse if you don't get expected parsing results).
> 0 votes

---
Tags: stash, member-categories
---


# Question
Title: Doubt about a Stash Embed parameter : name"my_var1"
I have a doubt about a Stash Embed parameter. In the Stash documentation page, there is this example:

```
{stash:embed name"my_var1" file_name="foo:bar" stash:my_var="value 1"}
{stash:embed name"my_var2" file_name="foo:bar" stash:my_var="value 2"}

```

I understood how it works, but I have a doubt about the **name"my\_var1"** parameter. I do not understand the usefulness of this **name"my\_var1"**

What is its function ? How to use it? What can I do with the **my\_var1** variable?

# Answer
The example you have highlighted is intended to illustrate how you can take advantage of the stash caching system to create multiple cached versions of the same template code based on with different embed variable values. From the same documentation page that you clipped your example:

> They can be nested, but unlike standard ExpressionEngine embeds you can use pre-parsing to assemble a single compiled cache of the rendered templates - which gives you all the benefits of encapsulation without the overhead

The idea behind this is that retrieving / inserting these cached embeds later / elsewhere in your template system as required will result in more rapid / less processor intense construction of the page, and so a more responsive site.

The **names** used (my\_var1, my\_var2) are generic values intended to illustrate the point, the names themselves have no specific meaning in this context.

The '**file\_name**' variable refers to the location of the template you want to use relative to the origin of your stash-templates directory - with the ':' symbol substituting for the '/' character.

The **stash:my\_var** value refers to a value you want to pass to the embedded template - it is this difference that makes one cached version of the embed different from the other. Presumably you could have many variables listed if you prefer.

The documentation does not make clear how you would retrieve the stashed embed, but a good place to start would be using the standard syntax - i.e. `{stash:embed name="my_var1"}` \- the documentation implying that the second time you call this the cached version will be retrieved.

HTH
> 1 votes

---
Tags: stash, embeds, parameters
---


title: Channel Videos Error

text:
# Question
Title: Channel Videos Error
I'm getting the following errors when I use the Channel Videos module: A PHP Error was encountered Severity: Warning

Message: Declaration of Video\_Service\_youtube::search($search) should be compatible with Video\_Service::search()

Filename: youtube/youtube.php

Line Number: 219

A PHP Error was encountered Severity: Warning

Message: Declaration of Video\_Service\_vimeo::search($search) should be compatible with Video\_Service::search()

Filename: vimeo/vimeo.php

Line Number: 244

I'm using this tutorial (http://www.train-ee.com/courseware/free-tutorials/comments/09-implementing-the-blog-part-1) to create the site and all I've done is copy and paste the text files. I'm using EE 2.11.3 if that matters, and the site is hosted locally on my Mac using MAMP.

# Answer
> 1 votes
A fix for this will be in the next release of Channel Videos for EE3/EE4, but until that comes out you can fix it by opening `services/video_service.php`, finding this on line 29:

```
public function search()

```

And changing it to this:

```
public function search($search = array())

```

---
Tags: channel-videos
---


# Question
Title: Insert Selected Channel into the Template
We are creating a template that our client would use on many pages of their website, for example 'Accordion Layout Template'.

So we create a page 'Bikes', assign the 'Accordion Layout Template', then create and select the channel named 'Bikes'

Is there a way to get the selected channel for the page, so we do not have to hard code the channel into the template like below:

{exp:channel:entries channel="bikes"

but ideally it would be

{exp:channel:entries channel="*Get\_Selected\_Channel*"

Thank you.

# Answer
> 1 votes
If you are planning to develop a 'generic' block of template code and then reuse it multiple times within your site, you necessarily need a mechanism for specifying what data you want to display through the template.

As you point out, a common way to provide this data to a template is via the `channel:entries` tag pair. If I understand your question correctly, you are looking for a way to specify the channel to use in such a call using a variable rather than hard-coding a specific channel.

There would appear to be at least four different ways you could go about this.

One option is to use one of the URL segments to identify the channel to use - so for example something like this:

`{exp:channel:entries channel='{segment_2}' dynamic='no' ... etc. }`

A second option is to use a layout variable set in (one of) the template(s) linking through to the block of reusable code - so for example something like this:

`{exp:channel:entries channel='{layout:channel_name}' dynamic ='no' ... etc.}`

A third option would be to use an embed variable set in the call to the embeded template - something like this:

`{exp:channel:entries channel='{embed:channel_name}' dynamic ='no' ... etc.}`

A fourth option would be to store the channel information in a stash variable elsewhere and retrieve it when required - something like this:

`{exp:channel:entries channel="{exp:stash:get name='channel_name'}" dynamic ="no" ... etc.}`

What you choose will be determined by how your site is designed and what you are hoping to achieve through re-using the code block.

HTH

---
Tags: templates, channel, entries, variable, global-variables
---


# Question
Title: Cartthrob extload.php Fatal Parse error on checkout confirmation page
My extload.php keeps throwing this error on the checkout confirmation page, ee 2.11.9 & Carthrob 2.6. Any ideas why it would do this, the ParserFactory file is in the correct location. If I refresh the page the order goes through okay.

```
Fatal error: Class 'EllisLab\ExpressionEngine\Library\Parser\ParserFactory' not found in /usr/www/users/dvbedgxbkf/system/expressionengine/libraries/Functions.php on line 2394

```

# Answer
> 0 votes
Updated CT to 2.71 and works now.

---
Tags: cartthrob
---


# Question
Title: What is the best way to delete every entry in a channel?
What is the best way to delete every entry in a particular channel?

I'm talking thousands of entries, so checking each entry and clicking delete isn't going to work.
I also know you can't just delete rows from exp\_channel\_data.

# Answer
> 11 votes
Why not just delete the Channel?

# Answer
> 4 votes
Best bet might be to go through the database tables and look for any `entry_id` fields. Those tables have foreign keys on `entry_id` (or just dependencies) and are where you need to track down loose ends.

For example, if you have comments enabled, you'll need to delete from `exp_comments` first:

```
Delete from exp_comments where entry_id in (Select entry_id from exp_channel_titles where channel_id = 22)

```

You can use that subselect in all your cleanup queries to make sure you match that original list. It's a bit more intuitive too.

`exp_channel_data` is the other half of your channel entries, so that should be cleaned up before `exp_channel_titles`.

Last step will be to clean up `exp_channel_titles`. That's where entries are established. You could have entries there without really having any `exp_channel_data`, if no channel field group was assigned.

# Answer
> 1 votes
So you want to delete all entries, but keep the channel itself, correct?

@Mark J. Reeves' solution is good if you feel comfortable running raw SQL commands, either through the control panel or from something like phpMySQL. Alas, I am not so adventurous/confident in my geek-fu levels. I would go to the Edit screen, select the channel you want to clean out, select "150 results" to see 150 results from that channel, per screen.

Then I'd select the checkbox in the top of the rightmost column (to select all 150), scroll down to the bottom of the Edit listing, select "Delete Selected", and hit the Submit button. Then repeat that process 10 times, to wipe out 1500 posts.

Note, however, that that is still not instant. You have to do that over and over until the channel is emptied - and if you've got 4K entries in the channel, that's a LOT of repeats. But it's much faster than selecting each one individually, and you don't need to worry about typing in the correct SQL command.

Edit: I guess you could call Mark's answer best-practices/fastest results, and mine the "training wheels" approach. :)

# Answer
> 1 votes
To delete all channel items but keep the channel itself (e.g. channel id may be hardcoded in some custom code or whatever), do from the admin panel:

The usual way is to select items page by page, click "delete", repeat for all pages. Works, but quite tedious especially for a lot of items.

To make it less tedious, in the chrome inspector tool, replace the value (not text) of "Show N results" select box to a bigger number, then select the item you just edited. Voila - more items are now displayed at once. Select them all and click "Delete" at the bottom of the page.

Processing will be slow but will work eventually, give it some time.

With a lot of items, it is possible to hit server's script execution time limits, or memory limits, reduce the entered number in this case. Reasonable amount is around 1000, but really depends on the server.

---
Tags: entries, delete, bulk
---


# Question
Title: Show future entries / parent relationship
I have a channels "Show" and "Event". The Event channel has a relationship field (rel\_show) to link to a Show

In the Show detail page.. i want to show all the Event related to that Show (event the upcoming events)

```
{exp:channel:entries channel="show" url_title="{last_segment}"}
LOTS OF CODE...
{parents field="rel_show" orderby="entry_date" sort="desc" show_futures_entries="yes"}
MORE CODE ...
{/parents}
{/exp:channel:entries}

```

2 questions..

1. The show\_future\_entries doesn't work is there a way to bypass or make it work
2. I need to group the event by Year.. but i think relationship doesn't allow that right?!.. I can use php to "group" or put and Header when the loop dectect a new Year..

I also may close the "show" exp:channel:entries.. to open a new one with channel="event" and then use a if statement to check if related entries is the good show.. But i have a looootttt of event..

Any ideas?

# Answer
> 0 votes
My bad!

```
show_future_entries="yes" show_expired="yes"

```

works.. i miss typed futures -\> future.. I'll figure it out about the "heading"

---
Tags: relationships, related-entries, reverse-related-entries
---


# Question
Title: {order_total} conditional {if order_total > 100}
I want to offer manual payment option only if cart total amount is above 100,00 but {if order\_total \> 100} doesnt seem to work.

Any sugestions anyone?

# Answer
> 0 votes
I ended up using streeng plugin, final code syntax that worked for me:

{if "{exp:streeng find='€' replace=''}{order\_total}{/exp:streeng}" \> 100}

---
Tags: expresso-store, conditionals
---


# Question
Title: How to stop form submissions being saved to database
I'm using Freeform Lite and my client has asked if there's a way they can stop form submissions being saved to database as this causes a headache with the new GDPR regulations. Submissions are emailed to them anyway so they have a record there.

Anyone know if this is possible?

Thanks in advance,

Tom

# Answer
Freeform includes an option inside of Composer interface to disable the storing of data. In Composer view for the form, click on the Form Settings button in Property Editor, then uncheck the checkbox that's labeled *Store Submitted Data*.

That would seem to resolve the question you're asking specifically. However, I would argue that your understanding of the GDPR implications here might not be complete. We actually made a GDPR compliance guide. I would check that out first and let us know if you have any further questions:

https://solspace.com/expressionengine/freeform/docs/gdpr-compliance/
> 1 votes

# Answer
You could accomplish this with a simple custom extension.

You could just do some cleanup post-submission that deletes the record. It would still be written to the database briefly, but it would not be stored. Or you could just save the record with sensitive data removed.

Freeform has lots of hooks: https://solspace.com/expressionengine/freeform/docs/extension-hooks/

What version of EE and Freeform are you using?
> 0 votes

---
Tags: solspace-freeform
---


title: Freeform "Secure Forms timeout"

text:
# Question
Title: Freeform "Secure Forms timeout"
We're getting the following error: "You are not authorized to perform this action - Reason: Secure Forms Timeout"

Every time we submit step 1 of a multi-page form. It was working fine yesterday. We get the same error if we try to go back from step 2 to step 1, for example.

I'm attaching the form template in an html file.

Can you please help? The form is published and it should be heavily used on a trade show during this weekend! Thanks in advance!

# Answer
Are you using www.SITE.com but your configs site url is set to 'site.com' or vice versa while also using a www redirect? This is a common error as 'www' is a subdomain and posting to non-www will fire the redirect, which loses all post vars.

Also, are you caching the form? You shouldn't cache forms as they use unique XID hashes for security and once they are used from a single POST, they have to be regenerated.
> 5 votes

# Answer
That feature uses EE's check\_xid() method to generate/test a request token. Those tokens are tied to an IP address and a time stamp. They're only good for 120 minutes.

A couple things could go wrong here:

* The form is being cached; so an XID for another visitor is being cached on the form and will never be valid.
* The visitor let the token expire. Pressing the back button will take the person back to the same form with the same expired id and it will fail again if submitted.
* The vistor is coming from Tor or a corporate firewall/proxy where the IP address is changing between requests.

Go have a look at check\_xid() in expressionengine/core/EE\_Security.php
> 0 votes

---
Tags: solspace-freeform
---


title: Simple commerce text input own price

text:
# Question
Title: Simple commerce text input own price
Simple commerce permit to define fixed prices.

```
{item_regular_price}
{item_sale_price}

```

But no have options, like a form text input, where the user could digit this own price, for a donation.

It possible to achieve this ?

I'm using EE4, it could be achieve with the great Cartthrob,but is not yet EE4 compatible.

# Answer
> 0 votes
It seems no have options to insert form text input, where the own valor could be entered.

As a temporary solution, a simple Paypal button was inserted.

---
Tags: simple-commerce, price-modifier
---


# Question
Title: How to send the url of the page the form is located
Using the freeform field type to display the form. Is it possible to send the url of the page the form is located.

I've tried using a hidden form and prepopulating with {segment\_data}.

Thanks

# Answer
> 0 votes
I normally do something like this:

```
<input type="hidden" name="my_form_field_name" value="{site_url}/{if segment_1}{segment_1}/{/if}{if segment_2}{segment_2}/{/if}">

```

---
Tags: solspace-freeform
---


# Question
Title: Low Search 6.1.0 Throws "No such method getAllCustomFields" Error
I've recently installed Low Search 6.1.0 on an EE 3.5.16 install and when I try to create a collection, I get the following error:

> **Exception Caught**
>
> **No such method getAllCustomFields.**
>
> ee/EllisLab/ExpressionEngine/Library/Mixin/Manager.php:143

Anyone else encounter this?

# Answer
V6 of Low Search is compatible with EE4, see https://c.getsatisfaction.com/low/topics/low-search-6-1-0-throws-no-such-method-getallcustomfields-error
> 0 votes

---
Tags: ee3, low-search, php-errors
---


title: Store shipping plugin …

text:
# Question
Title: Store shipping plugin …
Does anybody have a sample shipping plugin for Store 2? The only one I have is for 1.5 and the documentation isn't very helpful.

Thanks in advance,

Cole

# Answer
> 1 votes
(I'm with Vector, the people behind Expresso Store, but this is just something I made quickly and shouldn't be considered "official advice")

Here's a sample to get you started:

```
<?php

/*
** The below is pseudo-code just meant to show how to write a
** shipping extension for Expresso Store 2, 3, or 4. It shouldn't
** be used as-is in a production environment.
*/

if (defined('PATH_THIRD')) {
    require PATH_THIRD.'store/autoload.php';
}

use Store\Exception\ShippingException;
use Store\Model\Order;
use Store\Model\OrderShippingMethod;

class Store_sample_shipping_ext
{

    public $hooks = array('store_order_shipping_methods');
    public $settings = array();

    public function __construct($settings = array())
    {
        $this->settings = $settings;
    }

    public function store_order_shipping_methods(Order $order, array $methods)
    {

        if (ee()->extensions->last_call !== false) {
            $methods = ee()->extensions->last_call;
        }

        // If you have logic that decides if your method should be used or not,
        // you can always just return the existing $methods

        if (!$this->should_be_active()) {
            return $methods;
        }

        // You'd do logic here to calculate your actual shipping methods and costs.
        // Once you've determined that, add them to the $methods array. You can add
        // more than one. The format for each one is this:

        $option = new OrderShippingMethod;
        $option->id = __CLASS__.':'.'some identifier, if you add more than one';
        $option->name = $this->clean_str('A friendly name');
        $option->class = __CLASS__;
        $option->amount = '12.34';

        $methods[$option->id] = $option;

        // If you want to sort, for example by cheapest first
        uasort($methods, function($a, $b) {
            return $a->amount - $b->amount;
        });

        return $methods;
    }

    protected function clean_str($str)
    {
        return strip_tags(str_replace('®', '', html_entity_decode($str)));
    }

    public function activate_extension()
    {
        foreach ($this->hooks as $hook) {
             $data = array( 'class'     =>  __CLASS__,
                            'method'    =>  $hook,
                            'hook'      =>  $hook,
                            'settings'  =>  serialize($this->settings),
                            'priority'  =>  10,
                            'version'   =>  $this->version,
                            'enabled'   =>  'y'
                );

            // insert in database
            ee()->db->insert('exp_extensions', $data);
        }
    }

    public function disable_extension()
    {
        ee()->db->where('class', __CLASS__);
        ee()->db->delete('exp_extensions');
    }

}

```

---
Tags: expresso-store, add-on-development, plugin
---


# Question
Title: Can EE be installed on my PC for learning
I'd like to be able to install EE on my PC so I can experiment and learn. Can this be done?

thank you!!

# Answer
IDownload and nstall the WampServer

http://www.wampserver.com/en/download-wampserver-32bits/

You can read this tutorial about Wamp: https://www.c-sharpcorner.com/article/working-with-wampserver/

So read the install ExpressionEngine documentation: https://docs.expressionengine.com/latest/installation/index.html

Good luck
> 0 votes

---
Tags: install
---


# Question
Title: Youtube Thumbnail not pulling through correctly
We pull through youtube images using CE Image like this: {exp:ce\_img:pair src="https://img.youtube.com/vi/{id}/0.jpg" width="333" height="192" quality="84" interlace="yes" crop="yes"}

This has worked in the past, but now no longer works. It just pulls through the grey youtube default image.

Can anyone help?

# Answer
> 0 votes
Might not be a universal fix, but it looks like you might have the wrong URL (or more likely YouTube has changed it). Just grabbed an image from YouTube site and the URL looked like this:

```
https://i.ytimg.com/vi/{id}/0.jpg

```

i.e. the FQDN has changed from the one you are using in your code snip.

HTH.

---
Tags: channel-videos, video
---


title: Basic EE file upload hangs

text:
# Question
Title: Basic EE file upload hangs
So I am having trouble with a simple feature. I am running 2.8.1 and I have a channel file field that uploads an image. The image is only 200k.

I pick the image, click upload and the upload window just hangs. If I cancel and relaod the page, the file I was trying to upload is listed in the available images list so it made it to the server, the upload page just never closed. Happens on all images.

Any ideas what I can check?

Thx!

# Answer
> 1 votes
Check that your file upload directory settings are correct (Content \> Files \> File Upload Preferences \> "Edit" link) and the folders on the server have their permissions set to 777. You can even try manually (via FTP) adding an image to the folder and then sync in EE to see if it's reading that directory properly.

# Answer
> 0 votes
I was having the same problem with Expression Engine 2.9.11. The upload process would hang but the image would still upload successfully. It's just the little upload window wouldn't close. Refreshing the admin page would show the image was uploaded.

While troubleshooting a different issue (on IIS) I increased the values for these 4 items and that introduced the EE upload problem. Reverting these 4 values back to what we had before fixed the EE upload problem.

I'm pretty sure it has something to do with one of these php.ini settings. This is what I have now for these 4 values and it's working.

```
upload_max_filesize = 200M
post_max_size = 200M
max_input_time = 60
max_execution_time=300

```

# Answer
> 0 votes
I had that problem with Channel Images. The problem was the filename.. i used french character like é è or any other french characters. Renaming the file on the local computer before the upload was the solution.

---
Tags: file-uploads
---


title: Fluid fields - How to

text:
# Question
Title: Fluid fields - How to
I have a question for the best way to display multiple fluid fields.

* channel: `{houses}`
* fluid field: `{occupant}`
* fluid sub-field: `{name}`
* fluid sub-field: `{phone}`

When I only try and display the names, it displays just fine:

```
    {exp:channel:entries channel="houses" status="open"}
       {title}
            <ul>
                {occupant}{occupant:name}<li>{content}</li>{/occupant:name}{/occupant}
            </ul>
    {/exp:channel:entries}

```

But I cannot figure out who to display each person's phone...

Thoughts anyone?

:-)

# Answer
> 3 votes
Each entry in the fluid field stores the content of whatever fields are defined for that entry from the set of fields assigned to the fluid field. So for each entry in your channel you might have a different set of fields defined - unlike regular fields in EE, what fields appear within a fluid field for an entry are defined when the entry is created rather than being determined by the assignment of fields to the channel.

So the only way to show the content of fluid fields is for the template to loop through the fields defined for a fluid field in an entry and on each pass through try to display what is found. So you need to put into the template code to display every possible field - the fluid field will then display the content on your page, in the order that the fluid field components have been chosen for that entry.

As a result, the template code you need display a fluid field will look a bit like this...

```
{fluid_field}
   {subfield_1}
      <html and ee template code for subfield_1>
        {content}
      </html and ee template code for subfield_1>
   {/subfield_1}
   {subfield_2}
      <html and ee template code for subfield_2>
        {content}
      </html and ee template code for subfield_2>
   {/subfield_2}
   {subfield_3}
      <html and ee template code for subfield_3>
        {content}
      </html and ee template code for subfield_3>
   {/subfield_3}
... etc
{/fluid_field}

```

Each loop will fire one of the subfield entries, and the number of loops for an entry will equal the number of subfields defined for that entry.

For your case, one thing to be mindful of is that if you put phone number in as a possible fluid field, there is a chance that for some entries the value will not be defined (as it relies upon the phone field being selected when the entry is created) - if you are sure that all entries will have a phone number (i.e. "display each person's phone number" in your question) it might be better to use a regular field for the phone number rather than put it in the set available to a fluid field...

Hope that makes sense... :)

---
Tags: fields
---


title: Freeform and Google Recaptcha

text:
# Question
Title: Freeform and Google Recaptcha
We are looking to integrate FreeForm with the new Google Recaptcha (https://www.google.com/recaptcha), but are unsure where to begin. I was wondering whether anyone had any experience of doing this and can kindly point us in the right direction.

Any help greatly appreciated

Jonathan

# Answer
> 2 votes
You'll need to write an extension that uses freeform\_module\_validate\_begin hook. Inside if your extension method you can look for `ee()->input->post('g-recaptcha-response')`, and if present, validate it via the reCAPTCHA API.

If it fails, you can add an error to the `$errors` array, e.g.:

```
$errors[] = 'Sorry, but you failed the test. Are you sure you're human?';
return $errors;

```

Otherwise, you can just return the `$errors` array is-is.

# Answer
> 0 votes
There is a ready to use plugin

---
Tags: solspace-freeform
---


title: Changing paths to directories in EE4

text:
# Question
Title: Changing paths to directories in EE4
Specifically the Templates directory and Add-ons. How do I do it? Doesn't seem to be working in the config file like in Version 2. Cheers!

# Answer
You can't. Sorry. It was a bit of an annoyance all around when I started upgrading clients from `EE2` to `EE3`. There is no config override for the `addons` (aka `third_party`) and no way to set the template folder path for sites.

Do you want to hack it? Well...

**DO NOT DO THIS**

In `/system/ee/legacy/libraries/Core.php`

`EE 3.5.16`: Line 76 and 78
`EE 4.3.0`: Line 63 and 65

```
    define('PATH_THIRD',  SYSPATH . 'user/addons/');
    ...
    define('PATH_TMPL',   SYSPATH . 'user/templates/');

```

Please don't edit that core file. Seriously, I just did some folder greping. There is a very low chance changing those lines will work, and even if they do, you've hacked the EE core. Literally, the worst practice in coding. It isn't broke. Don't try to fix it.

Seriously don't do this. Even if it does work, in the long run, you'll run into problems somewhere else because of it. I would quit working for you if you did, and fire you if you were my employee (/rant over, sorry for being dramatic :) ). The new folder structure is fine, you'll get used to it.

**Edit**

If you *really* have to, just set up your deployment system to use symlinks from those core folder to where you want to store them. Make sure you allow symlinks in your server architecture (Apache `Options FollowSymLinks` in vhosts, nginx ... somewhere, somehow. You'll have to Google it).
> 1 votes

---
Tags: templates, ee4
---


# Question
Title: Native relationship field and zoo visitor
I have channel that is called jobs which contains information about job opportunities, within that channel i would like to use the native relationship field for contacting a certain person who is a zoo\_visitor member. In the cp i can asign a person using the relationship field. Only when tempting i get no results.

I’m using this code: I tried an other, a non zoo\_visitor channel, which did work. What am i doing wrong?

```
{exp:channel:entries channel="jobs" entry_id="89"  status="not closed"}

{job}

 {contact_person}
     {contact_person:member_firstname}
{/contact_person}
 {/exp:channel:entries}

```

Thanks for your time Dave

# Answer
Set the status of what you are looking for in the opening relationship tag. For example:

```
{relationship_field status="status_name"}
...
{/relationship_field}

```

This is has been tested in EE. 4.3. Hopefully this will help with earlier versions as well.
> 0 votes

---
Tags: relationships, zoo-visitor
---


# Question
Title: EE3 Channel Forms: Save as Draft & Publish Buttons
I would like to give users the option to "Save as Draft" or "Publish" at the end of a Channel Forms entry.

Is there a way to attach a status to a button? Has anyone done something like this?

# Answer
Submit buttons can have a name and value, too. And if you use actual `<button>` elements, the value can be different from what's displayed on the button (unlike using `<input type="button" />`).

Take this simplified example (just using a regular old form):

```
<form action="" method="post">
    <input type="text" name="title" />
    <button type="submit" name="status" value="draft">Save as draft</button>
    <button type="submit" name="status" value="open">Publish</button>
</form>

```

If you click the 'Save as draft' button, the form will send along `status=draft`. If you click the 'Publish' button, the form will send `status=open` instead. If you hit return in the text field (submitting the form), the value of the first submit-button will be posted.

This is true for any web form (or at least apache/php), so it should work for EE's Channel Form, too.

Alternatively, you could just use a single save-button and add a checkbox to the form to enable 'save as draft', and apply the status to that field, ie.

```
<label>
    <input type="checkbox" name="status" value="draft">
    save as draft
</label>

```

...and `status=draft` will be posted if the checkbox is ticked.
> 0 votes

---
Tags: safecracker, status
---


title: base_url is not being parsed by EE

text:
# Question
Title: base_url is not being parsed by EE
Is there a reason {base\_url} is not being parsed at all in any of my templates?

First I thought it was only my css but it also seems not to be working with any other template either like image roots?

# Answer
You can try using {site\_url} instead.
> 0 votes

---
Tags: template-partials
---


title: Disable EE2 cookies

text:
# Question
Title: Disable EE2 cookies
I've like to disable as many cookies as I can for the default EE2 install. The following cookies are being set but with the new GDPR laws I don't want to have to list this in the cookies page so I would just rather turn them off for everyone.

These are the default cookies set. I can't see a way to disable them.

\__csrf\_token

\__last\_activity

\__last\_visit

\__tracker

# Answer
> 0 votes
**It is possible if you put your admin.php file in a subfolder and use a cookie path that is equal to the name of the subfolder.**

Cookies will then only be set for the CP and you still will be able to login.

--

Let's say you name the cp-folder "maskedcp" and you put your admin.php file in that folder. Then you have to edit the index.php and admin.php.

After that navigate to Admin -\> Security & Privacy -\> Cookie Settings

Set the cookie path field to "/maskedcp" (without the quotes)

# Answer
> 0 votes
From my understanding cookies that are essential to website operation are NOT covered under the GDPR. It's only if you are using it for analytics is there an issue.

The 'exp\_tracker' cookie for example is needed to return a user to the previous page (or 2) by EE in some instances. As long as you have all the tracking items turned off in EE even that cookie is considered essential.

EE cookies aren't really your issue under the GDPR, analytics, media embeds, adverts... (3rd party stuff) are the issues to deal with.

---
Tags: ee2, cookies
---


title: How to display entries in a table?

text:
# Question
Title: How to display entries in a table?
Suppose I have a 3 column table and 9 channel entries A to I. I'd like to display the entries in the three columns in three rows:

row 1: A D G
row 2: B E H
row 3: C F I

I see a channel {count} variable which will give me the number of entries selected from the channel.

I'm using css and div tags to display data in a table format.

# Answer
> 0 votes
It looks like all you want to do is to transpose the table (so rows appear as columns).

There are ways you could do this within EE, but they would require knowing for sure the likely structure of the table that you plan to transpose.

However an easier solution might be to restructure the table in the browser. There are a few solutions - here is one from elsewhere within stackexchange \- https://stackoverflow.com/questions/16918094/html-table-with-vertical-rows#16919439

HTH.

# Answer
> 0 votes
Maybe you should use flexbox (css) flex-direction:column. I will try to make you a example soon.. do you want a limited number of entries in each columns? Same height on columns?

Take a look a this codepen : https://codepen.io/anon/pen/Pabxdg

---
Tags: channel-entries
---


title: Need Help with Older Version of EE

text:
# Question
Title: Need Help with Older Version of EE
I have a client that has an old version of EE running on their site (v 2.1.3) and we just migrated their site to a new server with MySQL 5.7. This broke several pages of their site, and we are aware of the issue. We are not the developers of the site, and the original developers are MIA.

Problem is, client wants us to fix this as quickly as and inexpensively as possible, and it looks like the MySQL bug was fixed in 2.11.0, but I see no way to get ahold of that build since it's very old, no longer supported. Willing to pay for it, but just don' know how to download it.

Upgrading to 3 or higher will be problematic with add ons, so we just need to correct this issue asap.

Any advice or help would be appreciated.

Thank you

Tom

# Answer
> 2 votes
If you upgrade your EE2 license to EE3 you'll get access to the final version of EE2 (you need this, as you cannot upgrade directly from anything less than EE2.10 if I remember rightly). It will appear alongside your EE3 download.

HTH

---
Tags: ee2
---


# Question
Title: Automatically registering a member upon new channel entry form submission (from front-end)
I want to be able to put an enquiry form on my website which, upon submission, will store those details in an Enquiries channel in EE4. No problem.

I would also like to register a new member at the same time, as I already have their name (Screen Name) and email address (Username) from the enquiry as they are compulsory fields and there'll be validation. A random string of characters can be created when the enquiry form page loads to be used as a temporary password. The user will receive an email when the enquiry form submits (from the return template) which will contain their temp password and they will be asked/forced to change the password before continuing when they next log in to the site (I'll probably use a custom member field to identify if they're still using a temp password).

I can't work out how to register a member without them submitting a second form (a Member registration form). There doesn't seem to be an EE tag that can process this if supplied with required variables.

Why? I want the enquirer to receive one email upon submission, thanking them for their enquiry and giving them login details so they can log in to the site and monitor the status/progress of their enquiry in a member area. I don't want to have to register them myself manually, or have them complete a second form.

I can think of other scenarios where this might have cropped up before ... a purchase form which allows the customer to select a checkbox to create an account at point of checkout for ease of future purchases? So this must be possible, somehow.

Any ideas?

Thanks in advance!

# Answer
> 0 votes
Have you tried looking for an addon that might work? Browse https://devot-ee.com/ and see if there is something that works for you.

I do have an idea. Honestly, it depends on you being a capable developer or being able to employ one to do to the work.

Create an Extension that hooks on to the form submission using a hook:

https://docs.expressionengine.com/latest/development/extension\_hooks/module/channel\_form/index.html

In your extension, make sure you only look for your Enquiry channel's form submissions.

Then, in your extension, pull in the `Member_register` class from `system/ee/EllisLab/Addons/member/mod.member_register.php`. You'll have to make sure the channel form you are submitting has all the required `$_POST` variables the `register_member()` function is looking for, or you fake them in the extension before calling that function. Then call the `register_member()` function and hope for the best?

The only other option I see would be to make that extension, and then manually create database rows for your member. I reaallllly don't recommend this, as EE3 and EE4 don't play well at all if a member record isn't complete (all the required rows in all the required tables).

---
Tags: members, registration
---


# Question
Title: How to duplicate entries in ExpressionEngine 4?
Usual options like MX\_Cloner seem to have no v4 option. Anyone know of one? Tbh this should are basic functionality by the 4th version now.

# Answer
> 0 votes
Sigh, me too. I found this github cloning tool for EE3, the developer isn't using EE anymore. Maybe it works, maybe it is easy to fix up?

https://github.com/ThorntonStuart/SimpleCloner/issues/18

# Answer
> 0 votes
Have you considered using MX Cloner anyways? The upgrade path for EE3 addons to EE4 addons is pretty easy.

Have you tried installing MX Cloner for EE3 on an EE4 copy of the site? There really is a chance it will work out of the box or require little developer time to make compatible.

No guarantee, but worth a shot.

---
Tags: duplicate, mx-cloner
---


title: Suggested Form Addon

text:
# Question
Title: Suggested Form Addon
I have used the DevDemon form addon since EE2 but its basically dead at this point. I reported more than one bug to the developer over a year and they don't bother to fix anything. I don't think it will be upgraded to EE4 either and the last update was over a 1.5 years ago.

I would just buy the one from Solspace but it has something missing that I really need and most forms have today.

The form logic that is based on JavaScript. For example, hide field X if user fills out data on field A or show field B if email field is completed. This allows you to show or hide and change the form based on what the user is filling out. I also need regex checks.

The DevDemon form has this but its extremely buggy and at this point not even working with EE3 anymore correctly. Neither is the multiform feature and I don't think there is future for it with EE4 either. I only use the module for more advanced forms as the build in form functions from EE work fine for basic things.

Is there any alternative for more complex forms today? Pricing is not a problem.

# Answer
> 1 votes
Solspace Freefom is a powerful form add-on. EE4 compatible, great support and updated frequently

https://solspace.com/expressionengine/freeform/

---
Tags: forms, devdemon-forms
---


title: Pagination not showing up

text:
# Question
Title: Pagination not showing up
I have included pagination on a series of pages. From within the CP when I click the View Rendor button from within the template, all looks great. However, when I link to a page with the pagination control from some place else in my site, the pagination control does not show. Any ideas as to why? Here is a image showing my template code:

Thank you for any help - Kim

# Answer
> 1 votes
Pagination only shows if you need it, and works by limiting the number of entries displayed by an EE tag. Your channel entries tag limits the output to a single entry (`limit="1"`), so for this page pagination will never be needed - and so will never show. I'm guessing that the Template render button simply constructs the page without processing the content (and so ignores the limit="1" parameter - and so shows the pagination content there.

So, try changing the limit to a higher number...

HTH

---
Tags: pagination
---


# Question
Title: Multi-site manager, EE 4: where / how much?
I haven't used EE since version 2, and am looking to integrate it with a current project, using the MSM to control several subdomains. I'm almost embarrassed to ask this question because this is so ridiculous, but where am I supposed to purchase/download MSM from??! I'm reading the docs:

> Pull up the manage purchases page in your account on EllisLab.com. (Make sure you’re logged into the same EllisLab account used to purchase the Multiple Site Manager license.) Next to the MSM license in question, you’ll see the option to Add Sites. Follow the checkout process in the store.

Well, I'm logged into my Ellislab account, I can see my prior purchases, and I can see "the store", and there is not a whiff nor a hint of where to purchase a new copy of MSM.

Nor is it listed on Devot:ee. Nor does Google provide any relevant results. Nor does a search of their site provide any clues.

Goodness me, I'd sure love to give Ellislab some dollars... if only they'd tell me how many they'd like and where I deposit them. Help me out, someone.

# Answer
> 0 votes
When you're log in.. in your purchase you see your license... There you can Add Site to your existing licenses. When you Add a site you can download only the license, upload it in the server and that's it! You don't really buy a MSM license. You just add a site to an existing license.

# Answer
> 0 votes
I understand now since writing this that MSM is bundled as part of the EE4 package ($299)... but you only get one site. Each additional site is $199.

I can find absolutely nowhere in the docs, or anywhere, where this is explicitly stated so I hope this helps someone.

Also, when I first purchased EE 2.10 and MSM, it cost 299 and 199 respectively ($498), and you got 3 sites for that. Now they are wanting a grand total of $697 to run 3 websites with Expression Engine. That's too much in my book, so I am looking for other solutions.

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


# Question
Title: Different content, different pages in global template
I am absolutely confused on what to do here

I have a footer that is meant to be different on each page I setup, I want to edit the link, the image, the paragraph and the header tags to what I choose, the current setup is as follows

```
<a id="contact"  href="{call_link}">
<footer class="footer">
  <div class="container">

  </div>
  <a href="/">
   <div class="zoom">
    <span class="footertextlarge zoom-image overlay" data-image-src="{footer_image}" ></span>
   </div>
  <footer class="footer container" >
  <h4>{footer_h4}</h4>
  <p>{footer_p}</p>

  </footer>
  </a>

```

Short of repeating this template and changing the variables etc every time I want to make a new template, how can I make this included template post the different content on different pages?

For example Homepage might have a link to {services page} and an image of {services image} services page might have a link to {contact form} with an image of {contact image}

but I want to be able to use the same template, and principle of changing the footer will go across hundreds of pages hundreds of pages eventually, I can't create a new template each time.

Thanks

# Answer
> 0 votes
Expressionengine separates what information displayed on a page from the design of the page.

* You code up the information to be displayed in one or more channels, with each entry in a channel representing a set of tagged data that you can choose to call up and display on a page.
* You separately create one or more templates that includes instructions within to tell expressionengine which channel entries you want to display on that page.

The tags in your code snippet (e.g. `{footer_h4}`) describe fields that you defined to be part of an entry in one or more of your channels. In each entry you can put (within reason) whatever content you like - and so as each entry gets loaded up into the template, the actual information displayed in a browser changes - so it is really easy to have

> a link to {services page} and an image of {services image} services page might have a link to {contact form} with an image of {contact image}

all you need to do is define one channel entry with the service image and link, and a second with the contact image an link - then a single template can be used to display them as two different looking pages.

Your question is not clear, but this may be all you are trying to do - in which case you only need to define one template and all of your hundreds of different channel entries can be set up to display different information using just one (i.e. the same) template: no need to create lots of templates.

In most sites the designers want more than one page design, and it is common (at least in EE sites, where it is super-easy to do) to blend information from multiple channels on the same page (so for example a blog entry pulled from one channel, author contact information pulled from another). So you most likely will have to design several templates, but the total number of templates will be much lower than the total number of pages on the site.

EE lets you get much more complicated, and has powerful tools for building really intricate dynamic sites (including for example, defining the footer of the page in a different template from the body, and using things like conditional rules to combine them in neat ways) (which is what Jelle's link points to), but until you've got a handle on simple channel / template mechanism I'd steer clear, you'll only get more confused.

HTH

# Answer
> 0 votes
Let's do this by example. Let's suppose we have a simple EE channel called "blog" with just five fields in:

* Headline `{headline}`
* Body Text `{body}`
* Blog Image `{blog_image}`
* Footer Text `{footer_text}`
* Footer Image `{footer_image}`

If we define a two entries:

* Entry\_1 - `{url_title}` entry\_1, `{headline}` "Entry 1", `{body}` "Blah blah", `{blog_image}` cats.jpg, `{footer_text}` "Do more with cats", `{footer_image}` cat\_toy.jpg
* Entry\_2 - `{url_title}` entry\_2, `{headline}` "Entry 2", `{body}` "Rhubarb", `{blog_image}` angry\_cat.jpg, `{footer_text}` "Avoid angry cats", `{footer_image}` cat\_spray.jpg

Then a simple template like this will display each entry and the footer will be different in each case (assume URL is of form `/{url_title}`):

```
{exp:channel:entries channel="blog" url_title="{segment_1}" dynamic="no"}
<h4>{headline}</h4>
<p>{body}</p>
<img src="{blog_image}">
<hr>
<h2>Footer</h2>
<p>{footer_text}</p>
<img src="{footer_image}">
{/exp:channel:entries}

```

Feed this template with the URL `/entry_1` and you'll get something like this...

> **Entry 1**
> Blah Blah
> \[cat picture\]
>
> ---
>
> **Footer**
> Do more with Cats
> \[cat toy picture\]

Feed this template with the URL `/entry_2` and you'll get something like this...

> **Entry 2**
> Rhubarb
> \[angry cat picture\]
>
> ---
>
> **Footer**
> Avoid angry cats
> \[cat spray picture\]

This appears to be all that you are trying to achieve - in your example links the page templates appear to be identical in material terms - so you could have used the same template for both there.

If you want to get bonus marks, you could put the template code for the footer into a **template partial** entry - let's suppose we move the footer code to a template partial called 'footer' thusly

```
Template Partial Name - footer
Template Partial Code -
    <hr>
    <h2>Footer</h2>
    <p>{footer_text}</p>
    <img src="{footer_image}">

```

We could then modify the template generating our page to be a bit simpler - like this:

```
{exp:channel:entries channel="blog" url_title="{segment_1}" dynamic="no"}
<h4>{headline}</h4>
<p>{body}</p>
<img src="{blog_image}">
{footer}
{/exp:channel:entries}

```

This would give identical output, but you've moved the footer code elsewhere (and so could include it on other templates simply by adding `{footer}` to them).

Separately it is straightforward to access more than one entry in a single template, but explaining that is certainly outside scope of this question...

HTH

---
Tags: templates, advanced-conditionals, content-elements
---


title: Forum Language Text

text:
# Question
Title: Forum Language Text
With EE if you install more than language pack, once you are logged in as user it will use the text messages from your specific language preference. But does someone know how to force EE to use a specific language on a template or url and not by forcing someone to log in first?

For example, if you set up 2 forums. The default EE language is English but since each forum has its own URL, it makes no sense to display both in English.

If example.com/forum is using English but example.com/forum-fr should use French. In that example if a user that has set French on his control panel as language logs in, he will see the forum in French but the problem is that normal visitors that go to example.com/forum-fr will not. There must be a way to tell EE to load a different language without having to log in.

# Answer
> 0 votes
Di you tried setting variable and/or using config.. in my index.php i use

```
$assign_to_config['deft_lang'] = 'french';
$assign_to_config['global_vars']['base_url'] = "https://your-domain.com/fr";
$assign_to_config['global_vars'] = array(// This array must be associative
    "lang" => "fr",
    "language" => "fr",
);

```

My whole is more complicated than that because i use htaccess to redirect to the right folders based on the browser language....
If you need my whole setup, let me know..

---
Tags: forum, language
---


# Question
Title: Update process freezes from 2.11.8 to 2.11.9, what do I do now?
This is an urgent issue, because it concerns a MSM site with three live sites. I try to update to the latest 2.xx version but the installer freezes in the process, to be exactly from 2.11.8 to 2.11.9 .

What do I do now? Who can possibly help me out here?

thanks a lot!

# Answer
If you are getting a 'white screen of death' then most likely it is an add-on that is causing problems.

One solution is to un-install all the add-ons, do the upgrade and then add them back. (simply move all the third-party add-ons from the directory they are in to a different one, do the upgrade, and move them back one at a time until you work out which one is causing the problem).

But make sure you have a good back up of the EE2.11.8 version of the site (or even better do the upgrade on a duplicate of the site on a development server).
> 1 votes

---
Tags: ee2-upgrades, update, updating, ee2.11
---


# Question
Title: Filter event lists by today AND current time
Can the exp:cal tag filter events by date AND time? Example: I want to show upcoming events for the week but I want to exclude those that have already passed today.

```
{exp:calendar:cal date_range_start="today" show_weeks="3" event_limit="6" pad_short_weeks="n"}

```

Should I be using exp:cal? This is Calendar 1.8.14 on EE 2.11.9 (I know it's old but that's what the client has).

I can use a conditional like `{if {event_start_date format="%U"} > {current_time format="%U"}}` but then my event\_limit parameter gets limited even more. I need the same future total amount each time.

# Answer
> 0 votes
`date_range_start="today @ {current_time format="%g:%i %A"}"` did the trick, it wasn't recognizing epoch time in the loop. Thanks @jrothafer for the suggestion to re-look at the date formatting variables.

# Answer
> 0 votes
You should try below code to hide **Past events** and only shows the events for next **1 week**.

```
{exp:calendar:cal pad_short_weeks="n" date_range_start="today" date_range_end="+1 week"}

```

If some weeks/days are missing then you can also try with the **{current\_time}** variable available in **EE** to hide the **Past events**.

```
{if '{event_start_date format="%U"}' > '{current_time format="%U"}'}
    {!--Your event data--}
{/if}

```

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


# Question
Title: Call a variable from a module that was created in an extension
Is there any way to pass a value from an extension to a module or a plugin in ExpressionEngine?

I created this very useful extension to take advantage of the expresso store module:

```
<?php

use Store\Model\Order;
use Store\Model\OrderShippingMethod;

class Credit_tracker_ext
{

    protected $ee;
    public $name        = 'Credit tracker extention';
    public $settings_exist = 'n';
    public $hooks          = array('store_checkout_form_validation', 'store_order_shipping_methods');

    public function __construct($settings = '')
    {
        $this->ee       = ee();
        $this->settings = $settings;
    }

    public function activate_extension()
    {
        foreach ($this->hooks as $hook) {
            $data = array(
                'class'    => __CLASS__,
                'method'   => $hook,
                'hook'     => $hook,
                'settings' => serialize($this->settings),
                'priority' => 10,
                'version'  => $this->version,
                'enabled'  => 'y',
            );
            ee()->db->insert('extensions', $data);
        }
    }

    public function disable_extension()
    {
        ee()->db->where('class', __CLASS__);
        ee()->db->delete('extensions');
    }
    public function settings()
    {

    }

    public function store_checkout_form_validation($str, $obj)
    {

    }

    public function store_order_shipping_methods(Order $order, array $obj)
    {
        if (ee()->extensions->last_call !== false) {
            $methods = ee()->extensions->last_call;
        }

        $option = [];
        foreach ($order->items as $value) {

            $option = new OrderShippingMethod;
            $option->id = $value->entry_id;
        }

        $methods[$option->id] = $option;

        var_dump($methods);

        return $methods;
    }
}

```

I'd like to set up the object $method as a global array, to access it from another file, in another moment.

To clarify this point, the extension in this system is called at a certain point of the code, and the function that fires the extension is called hook, like in WordPress.

So essentially, I'd like to call the variable that I returned within another file (for example mod.credit\_traker.php), where I can simply call the variable $methods.

Anyone who had this problem before?

# Answer
> 0 votes
Well, unless you have a process chain between your extension and your module and your plugin (one calls all the others, creates accessible in memory objects, something like that), nope, not in a single process. **This is not a real thing you can do.**

This is where you use the database. If you have a module, you can setup database tables that are created when you install the module and removed when you uninstall the module. This would be where you create your data-store model for your entire add-on package. Then you just access the database from your different add-on components.

In this case, you install the entire add-on as a package and create your database tables. Then, when your extension is fired, it can store data in your database tables as needed, which can be recalled by the plugin or the module.

You might want to consider employing an actual Model element that can be accessed by your add-on components instead of actually querying the database and inserting to the database for each add-on component. Think like, MVC style Model, a reusable class that interacts with your data-store for you.

---
Tags: expresso-store, module, extension, hook, variable
---


title: Add 2fa to front end login EE2

text:
# Question
Title: Add 2fa to front end login EE2
I have an EE2 site with a front end user login for front end 'admin' users and I need to add 2fa to this, there are no plugins available that offer this functionality, they only either; deal with the CP login, or are for a different version of EE.

What would be the best way to do this?

# Answer
I would highly recommend considering upgrading this CMS install before investing in what it would take to add 2FA to an EE2 installation. It will take a decent amount of developer time to create an add-on package that integrates with a third-party 2FA service, and then you'd have to own this add-on for future upgrades of the CMS.

I recommend upgrading, and then considering new add-on development or purchasing of an add-on that handles 2FA. Brewing your own add-on for EE2 would be ludicrous at this point.
> 0 votes

---
Tags: ee2, login
---


# Question
Title: EE2 upgrade to EE3, how to upgrade addons?
I am a newbie to expressionengine and I am working on upgrading EEv2.8.1 to EE3.5.16 for my company. On EE2 we use a lot of addons. I want to upgrade the addons during the EE upgrade process.

I learned that I have to remove the addons that are no longer support EE3. However, I am not sure where to put the new version of EE3 compatible addons. My goal is to keep as many old addon's data as possible. Any sugguesion is welcome...

Thanks!

Update - Following is the list of EE2 addons that I want to move to EE3, they all have EE3 compatiable version...any comments are welcome!

1. Modules: Export Entries, Freeform Pro, Mailing List(eeharbor), Playa, Tagger
2. Accessories: Freeform Pro
3. Extensions: Matrix,Playa
4. Fieldtypes: Field Pack, Matrix, Tagger, Multi Select(eeharbor), Playa

# Answer
There are some thoughts on how to go about the upgrading process in the expressionengine documentation \- and elsewhere in stackexchange. Start with these sources, and if you have problems beyond what is covered through such information, post specific questions back here and I am sure there are many who can help.

Based on the list of add-ons you have provided, you should be able to upgrade fairly easily.

* **Export Entries, Freeform Pro, Field Pack and Tagger** all have EE3 support, so simply a case of paying for the upgrades as required.
* **Matrix and Playa** have an upgrade path to EE3, but Grid and Relationships now offer these functions from within EE, and there is a good / free upgrade utility available from EllisLabs. Worth making the effort to swap over to native EE function here I think.
* **Mailing List(eeharbor)** \- not sure what this is (doesn't appear to be discussed on eeharbor site anyhow) - so maybe something extra will be needed to do for this one

As noted in the two linked posts to upgrade to EE3 you first have to update the EE2 version of site to a late version of EE2 (at least 2.10). Worth updating all your add-ons to final versions for EE2 at same time, and would make sense to do the Playa / Matrix migration to native EE before moving to EE3 too. Only once you have a strong updated EE2 platform in place should you start the EE3 upgrade process.

You didn't say why you are only looking to upgrade to EE3 - the upgrade from EE3 to EE4 is really much less complex than the one from EE2 to EE3, and brings with it some really useful new features - such as the just launched GDPR toolkit which makes building and operating a GDPR compliant site very much easier. Might be worth thinking about going the extra few yards to get EE4 in place since you are doing an upgrade anyway.

HTH
> 2 votes

---
Tags: add-on, ee2-upgrades
---


title: Show entries by author

text:
# Question
Title: Show entries by author
is there a simple out of the box approach to showing entries created by their author? EG: after an article I want to list a credit like so:

**"article by AUTHOR"**

and allow a *click through* from the *AUTHOR link* to a template featuring just that author's entries…

Thanks.

# Answer
> 11 votes
You can include the author's name and a link using the `author` and `author_id` variables. For example:

```
{exp:channel:entries channel="blog"}
    <h2>{title}</h2>
    {body}
    <p>Posted by <a href="/blog/author/{author_id}">{author}</a></p>
{/exp:channel:entries}

```

Then, at its most basic, create a template to display posts filtered by author (the template used in the example above is `blog.group/author.html`). In that template, filter the Channel entries with the `author_id` parameter.

```
{exp:channel:entries channel="blog" author_id="{segment_3}"}
    {if count == "1"}
        <h1>All Posts by {author}</h1>
        <ul>
    {/if}

    <li>{title}</li>

    {if count == total_results}
        </ul>
    {/if}
{/exp:channel:entries}

```

# Answer
> 0 votes
BTW at least with EE2 it's important to include the parameter dynamic="off" to make this work. Example:

```
{exp:channel:entries channel="features" author_id="{segment_3}" dynamic="off" }

```

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


# Question
Title: Parsing issue with Low Variable - Playa field (EE 2.11.9)
Obscure issue for you here.

I have a Low Variable (using Playa) that contains several entries. I need to pass the entry\_id for each entry to an embedded file. When I do this, the embed loads, but the {exp:channel:entries...} tag does not work.

```
  {exp:low_variables:pair var="newsletter_sidebars"}
    {embed="inc/get-sidebars-by-entry_id" the_entry_id="{entry_id}"}
  {/exp:low_variables:pair}

```

If I pass a number directly to my embed:

```
{embed="inc/get-sidebars-by-entry_id" the_entry_id="12"}

```

It works fine.

I can even see my embed is receiving the value of the Playa field.

Something to do with the dreaded parse order?

# Answer
Have you tried using the var param in the variable you are trying to output?

```
{exp:low_variables:pair var="newsletter_sidebars"}
    {embed="inc/get-sidebars-by-entry_id" the_entry_id="{newsletter_sidebars:entry_id}"}
{/exp:low_variables:pair}

```
> 0 votes

# Answer
You can achieve the same embed effect but with greater control over parse order by using the embed function of `{stash}`.
> 0 votes

---
Tags: playa, low-variables, parse-order, embeds
---


# Question
Title: Where can I find the cookie_consent_module
Where can I find the cookie\_consent\_module. If I google it and follow the link, it get a 404.

# Answer
You might want to try this link:
https://github.com/yashiel/Cookie-Consent

In `mcp.cookie_consent.php`, line 63 will have to be changed from…

```
$this->EE->cp->set_variable('cp_page_title', $this->EE->lang->line('cookie_consent_module_name'));

```

…to…

```
$this->EE->view->cp_page_title = $this->EE->lang->line('cookie_consent_module_name');

```

As well as in both `upd.cookie_consent.php`, line 67,
and `ext.cookie_consent.php`, line 363, change from…

```
// $this->EE->functions->set_cookie('cookies_allowed', 'y', $expires);

```

…to…

```
$this->input->set_cookie('cookies_allowed', 'y', $expires);

```
> 1 votes

# Answer
I'm pretty sure the cookie\_consent module from Ellis has been EOL'd with EE2. If you want to do this a better solution is to use one of the many GDPR compliant solutions around. Here is a link to a free one that works nicely and might be what you need: https://cookie-bar.eu/

HTH
> 0 votes

---
Tags: cookies
---


title: Override Default Postfix in SEO Lite

text:
# Question
Title: Override Default Postfix in SEO Lite
Is there a way to set up SEO Lite so the default title postfix can be overridden on a per entry basis?

I am using the default title setup like so: `<title>{title}{site_name}</title>`

And am using the default for the Default Title Postfix: `| `

Basically, I do not want `| Site Name Here` on every page.

Thank for any help.

# Answer
There's a `title_postfix` parameter that might do what you want:

http://wedoaddons.com/seo-lite/tags#parameters

// Edit; Ah I see you want {site\_name} on some pages but not all.

You can try removing {site\_name} from the SEO Lite template and then adding it using `title_postfix` on the pages where you want it.
> 0 votes

# Answer
To remove **postfix** in SEO Lite you need to do below changes in **SEO Lite \>\> Settings** page. You need to remove `{site_name}` from **Template** field and also need to remove ` | ` from **Default title postfix** field in **Settings** page of SEO Lite module. So, above steps will remove **Default Postfix**. Also see screenshot for more reference.

After making above settings, if you need **title\_postfix** in **title tag** then just pass **title\_postfix** in `{exp:seo_lite}`.
> 1 votes

---
Tags: seo-lite
---


title: Member Login API

text:
# Question
Title: Member Login API
Please excuse me because I am extremely new to ExpressionEngine, and I don't quite understand how to achieve this...

I have been searching for a RESTful API plugin, or an example on how to develop one for a few days.

I think that this is the closest of a piece what I am trying to do.

I would like to use the Member database table to be able to validate credentials and respond with a token or some sort.

Does anyone have an example or something that will point me in the right direction?

Again I'm sorry for the novice question, I'm just lost at where to begin.

Thank you!

# Answer
> 0 votes
I found a great blog to help me in this and was able to get it to work fairly well.

His Github was helpful too.

Needed to follow the add-on development guide also to bring it up to date, because this one was older. Mainly it was just the addon.setup.php file

# Answer
> 0 votes
I don't think EE has any API.

You can do this by tapping directly into the SQL database with custom code I guess to match the user password hash and if yes, give the token.

If you want an API while I didn't tested it, there is this addon I found: https://docs.reinos.nl/webservice/

---
Tags: api, rest
---


# Question
Title: Expresso Store SSL Error with Authorize.net
I have had an ExpressionEngine site with Store running well for a while now, then out of the blue customers started getting errors when trying to complete checkout and pay.

I looked into it and found the following error:

```
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 60: SSL certificate problem: self signed certificate in certificate chain [url] https://secure.authorize.net/gateway/transact.dll' in /home/content/93/10773693/html/engine/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php:338 Stack trace: #0 /home/content/93/10773693/html/engine/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(279): Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #1 /home/content/93/10773693/html/engine/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(244): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #2 /home/content/93/10773693/html/engine/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(22 in /home/content/93/10773693/html/engine/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php on line 338

```

EE version 2.11.3 with Store version 2.5.1. And I am using Authorize.net as the payment gateway.

I contacted Authorize.net and they said it may be due to a recent change they made and said "the website might not be automatically validating our current SSL certificate. Here is a link that will help you, or your developer make sure your using the most up to date certifications. https://community.developer.authorize.net/t5/News-and-Announcements/SSL-Certificate-Updates-for-Legacy-SDKs/m-p/62935".

How can I fix this and get Store working again? Thanks.

# Answer
> 0 votes
I just dealt with the same error. So annoying. Just make sure your `vendor/guzzle/guzzle/src/Guzzle/Http/Resources/cacert.pem` certificates are updated to use the one in the Auth.net PHP SDK:

https://raw.githubusercontent.com/AuthorizeNet/sdk-php/master/lib/ssl/cert.pem

Sometimes there's more than one depending on how the dev set up composer dependencies. Just grep for any `vendor/guzzle` folders throughout or ask the plugin dev to update the packages.

---
Tags: expresso-store, ssl, authorize.net
---


# Question
Title: Using CartThrob Subscriptions with Stripe checkout - Content Restrictions
Will I be able to use CartThrob Subscriptions with Stripe checkout in Europe?

And in general:

Do CT-subscriptions have a method of preventing access to content created by members, whose subscription expires? More specifically, I need to hide member profiles (zoo\_visitor entries) once their plan is no longer paid for.

Thank you!

PS: I have already purchased Membrr and - while the addon is okay - their support is actually non-existant, so please don't suggest this! :)

# Answer
> 3 votes
(I'm with Vector, the people who are now behind CartThrob. I know this is an old question but it still pops up on Google sometimes for some of our customers, so I'm answering it).

CartThrob Subscriptions fully supports Stripe in Europe (and any geography Stripe supports).

And, Subscriptions allows you to gate access to content or pages based on a user's membership status; for example, only allowing access to content while a Subscription is active.

# Answer
> 1 votes
I would highly suggest staying away from CartThrob in general, and Subscriptions in particular. I had to fix a half dozen bugs in their Subscriptions code myself before my client's site was half functional, and there are still issues with the product.

Basic things like subscriptions rebilling, ending on expiration dates, etc. were all broken.

MightyRobot has actually pulled Subscriptions (and everything else except for CartThrob and CartThrob Manager) from sale, due to bugs and their inability to support the products.

Sadly, that leaves a vacuum in the subscription market for EE... but perhaps a custom solution along with something like Charge isn't a bad idea.

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

---
Tags: cartthrob, subscriptions, stripe
---


title: File uploader error: File Not Found

text:
# Question
Title: File uploader error: File Not Found
When I try and upload images to my EE site (either from my file manager or from a file field in the channel entry form on the CP), I get a "Error: File Not Found" message. The file gets uploaded to my server, but the database doesn't have an entry for the upload.

Any thoughts on what is going on and/or how to debug the issue?

# Answer
Had the same issues here. I'm setting my url and directory paths in a config file but was missing the trailing slash as mentioned above on my path. I should note, my issue was happening on a IIS server.

Didn't Work:

```
http://www.website.com/images/uploads/blog/
C:\inetpub\wwwroot\images\uploads\blog

```

Worked: (notice unix style trailing slash on path)

```
http://www.website.com/images/uploads/blog/
C:\inetpub\wwwroot\images\uploads\blog/

```
> 1 votes

---
Tags: control-panel, file-uploads
---


# Question
Title: Expresso Store and PayPal TLS 1.2 Upgrade
I have a site running EE 2.8.1 with Expresso Store 2.3.1. The recent TLS 1.2 PayPal upgrade has caused PayPal Express payments to fail - giving the error - *Sorry, there was an unexpected error communicating with the payment gateway.*

Is this being caused by the Store code? I need to determine if the issue is software or server related. Any help will be much appreciated.

# Answer
The majority of the time, this is a server issue. Your host will need to upgrade your server to support later versions of PHP/cURL/etc that allow TLS 1.2.

In general I'd also recommend upgrading Expresso Store to the latest version for EE2 but it shouldn't technically be necessary for this issue to be fixed.
> 0 votes

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


# Question
Title: Having problems with EE mail library code
I'm new to Expression Engine, I'm hoping someone can help me out with an issue? I'm sure I'm missing something obvious. What I'm trying to do is send an email.

My template code looks like this:

```
{embed="main/header1"}
<meta name="Description" content="whatever">
<meta name="Keywords" content="stuff">
{embed="main/header2"}
{embed="main/navbar"}

{exp:channel:entries channel="subscription" limit="1"}
<div id="content2">
<div id="Image">
    <img src="{page_image}" alt="alt text" /></div>
<div id="Content">
    <?php
    echo $_GET['email_address'];
    ?>

$email_msg = "email address: $email_val";
$email_to = "email@address.com"

ee()->load->library('email');
ee()->load->helper('text');

ee()->email->wordwrap = true;
ee()->email->mailtype = 'text';
ee()->email->from("Expression Engine");
ee()->email->to($email_to);

ee()->email->subject(Test);
ee()->email->message(entities_to_ascii($email_msg));
ee()->email->Send();
</div>
</div>
{/exp:channel:entries}
{embed="main/footer"}

```

All of the EE library code is outputting to the screen as text, rather than being executed. What am I missing? Thanks for your help. PHP is enabled. \- James.

# Answer
You need to put your php code inside php tags.

```
{embed="main/header1"}
{embed="main/header2"}
{embed="main/navbar"}
{exp:channel:entries channel="subscription" limit="1"}
<?php
   $email_msg = "email address: $email_val";
   $email_to = "email@address.com" ee()->load->library('email');
   ee()->load->helper('text');
   ee()->email->wordwrap = true;
   ee()->email->mailtype = 'text';
   ee()->email->from("Expression Engine");
   ee()->email->to($email_to);
   ee()->email->subject(Test);
   ee()->email->message(entities_to_ascii($email_msg));
   ee()->email->Send();
?>
{/exp:channel:entries} {embed="main/footer"}

```

More in the EE documentation.
> 0 votes

# Answer
You have just closed `PHP` end tag in wrong place. You just need to put a `PHP` end tag after your `PHP Mail` code. So, try my suggested code as below. I hope it will work for you.

```
{embed="main/header1"}
<meta name="Description" content="whatever">
<meta name="Keywords" content="stuff">
{embed="main/header2"}
{embed="main/navbar"}

{exp:channel:entries channel="subscription" limit="1"}
<div id="content2">
    <div id="Image">
        <img src="{page_image}" alt="alt text" />
    </div>
    <div id="Content">
    <?php
        echo $_GET['email_address'];

        $email_msg = "email address: $email_val";
        $email_to = "email@address.com"

        ee()->load->library('email');
        ee()->load->helper('text');

        ee()->email->wordwrap = true;
        ee()->email->mailtype = 'text';
        ee()->email->from("Expression Engine");
        ee()->email->to($email_to);

        ee()->email->subject(Test);
        ee()->email->message(entities_to_ascii($email_msg));
        ee()->email->Send();
    ?>
    </div>
</div>
{/exp:channel:entries}
{embed="main/footer"}

```
> 0 votes

---
Tags: ee
---


# Question
Title: Migrate multiple custom fields to just one Fluid Field
Grown with the years, one of my projects consists of *several* Channels with *several* Field Groups and dozens of custom fields. Now with ExpressionEngine 4 and the new fluid field we want to consolidate most of the custom fields so we're not longer depending on so many custom fields … whats the easiest and safest way to migrate from «multiple custom fields to one fluid field»?

For example – right now we have Channel1, Channel2, Channel3 etc. each with field groups with custom fields like channel1-bodytext, channel2-bodytext, channel3-bodytext and of course many, many more.

How can I migrate/export/import those into just one text-field inside one fluid field used by all channels?

# Answer
> 2 votes
I am not aware of any add-on that will do this kind of transformation, but if you are comfortable working on your EE4 database directly using SQL it is certainly possible to do that way.

I had to do this recently sorting out an EE2 site being migrated to EE4. For that work I was pulling entries from channels and writing them to fluid fields (including grid fields). Worked OK. Didn't try and migrate relationship fields - but imagine that they are doable too.

A detailed description of what to do is beyond scope of this kind of space, but simplistically:

* Use EE to create the fluid fields you need
* Put one unique fake entry information in each field
* Use something like Sequel Pro to find the definition information for each field created (e.g. the channel field / grid number, and the position of the field in the fluid field register)
* For each field, generate a list of the entry\_id's of the entries that you want to migrate and that have a value in the field
* Construct a custom SQL query to copy the content of the migrating fields to the new fluid field entry - you will need to make sure you increment some counters in the fluid field register to do this correctly
* (side note - I wrote a set of EE templates to automatically generate the required SQL queries - saved a lot of time)
* test / delete the old fields.

This is a non-trivial activity for you by sound of it, but once you get hang of how it works it should be manageable.

Usual words of caution - back everything up, and do this work on a development server... it is easy to break things.

Of course if you want someone else to do it for you... drop me a line via my website :)

---
Tags: channel-entries, fluid-field
---


title: Assets: Clean up Upload-Directories

text:
# Question
Title: Assets: Clean up Upload-Directories
I'm using Assets almost since day one. And 7 years ago was, well, a whole other time. ;-) Many things changed, but the Assets-Configuration on one quite large project stayed the same since. Those days we configured many individual Upload-Folders. Nowadays, we actually only need a few of them. So we want to «clean up» our assets and upload-dirs.

Is there a easy way to do that? There are 9 different upload-dirs we do use with Assets. We now would like to merge 8 of them to one, so we would have only two dirs left.

What's the easiest way to do that? I guess I have to move the files on the server and re-index everything in the controlpanel, and somehow update all the filedirs in the DB … right? But how? :see\_no\_evil: :-)

# Answer
Do you plan to continue using Assets? If you do you probably can achieve all this simply by dragging / dropping images within the Assets UI.

If you plan to eliminate Assets, you cannot simply change the field type from Assets to File to migrate. Assets does not store information about where an image is in the Asset field for an entry (it stores that in a separate assets table) - just the name of the image / file. But EE does (it puts `{FileDir_X}` ahead of the filename, where X is the ID of the upload directory). So if you are moving from one field type to the other you need to add this information to the image names from Assets.

Doing this requires some excursion that lets you mess directly with the EE database (either php or direct SQL would work). Probably SQL is easiest for a one-off migration.

So you end up with something like this:

* Consolidate all the images in the 'top-level' folder of the filedirs you want to keep, and keep a record of which of the upload directories each image has ended up in (if you leave them in sub-folders, EE won't be able to see them via the file field type).
* Create the new image fields in your EE channels for the images
* Generate some SQL that copies the name of the image file from the Assets field to the appropriate new EE Image field and prefixes with the appropriate filedir ID tag. Suggest you do this on a field by field basis.
* Test the results.

As ever, make sure you back up everything, and do this work on a development server to be sure you have got it down before you work on the live one.
> 1 votes

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


title: Relationships and channel images

text:
# Question
Title: Relationships and channel images
I'm trying to get channel images to show within a ee relationship. All the title and links show correctly, but the images are not showing at all.

Running EE 3.5.7 and channel images 6.0.3

I'm using the following code:

```
<aside class="widget latest-post-widget">
<h4>Editors Picks</h4>
<ul>
{exp:channel:entries channel="cria_picks" limit="3"}
{cria_editors_picks}
<li class="media">
<div class="media-left">
<a href="{cria_editors_picks:url_title_path='criaviews/article'}" class="popular-img">
{exp:channel_images:images entry_id="{cria_editors_picks:entry_id}"}
<img src="{image:url:medium}" style="width: 103px; height:76px;" alt="">
{/exp:channel_images:images}
</a>
</div>
<div class="latest-post-content">
<h2><a href="{cria_editors_picks:url_title_path='criaviews/article/'}">
{cria_editors_picks:title}
</a></h2>
<p><time datetime="{cria_editors_picks:entry_date format="%Y-%m-%dT%H:%i"}" pubdate class="updated">{date_heading}{cria_editors_picks:entry_date format="%d %F %Y"}{/date_heading}</time></p>
</div>
</li>
{/cria_editors_picks}
{/exp:channel:entries}
</ul>
</aside>

```

Not sure what I'm missing. I'm using this code as an embed.

# Answer
> 0 votes
Did you check that {cria\_editors\_picks:entry\_id} is a valid ID? You can also try `{cria_editors_picks} YOUR CODE
 {embed"YOUR-FILE" entry_id="{cria_editors_picks:entry_id}"}
 MORE CODE
{/cria_editors_picks}`

Then in YOUR-FILE

```
JUST TO TEST -> THE ID IS : {embed:entry_id} <br>
{exp:channel_images:images entry_id="{embed:entry_id}"}
    <img src="{image:url:medium}" style="width: 103px; height:76px;" alt="">
{/exp:channel_images:images}

```

---
Tags: relationships, channel-images
---


# Question
Title: "URL Segment Support" configs on Apache mod-PHP 7.2 server
I'm moving a site from Nexcess to Google Cloud hosting, and it appears the server doesn't support URL segments by default.

What do I need to have my web hosting do in order to enable this? They said they need the info from EE on what to do to configure this, but it's not anywhere in the docs (that I can find)?

The requirements are here: https://docs.expressionengine.com/v3/installation/requirements.html and the URL Segments section is at the very bottom.

# Answer
The web server just needs to pass environmental variables on to PHP. For segment support, this means that PHP needs the ability to access the portion of the URI after the script name, e.g. the `foo/bar` bit of `index.php/foo/bar`. Typically this is passed to PHP by Apache as `PATH_INFO` or `ORIG_PATH_INFO`.

Try creating new file on the server named `pathtest.php` with the following:

```
<?php
echo '<pre>';
var_dump($_SERVER);
echo '</pre>';

```

And access it at `https://example.com/pathtest.php/foo/bar`. You should see an environment variable available such as one of the two mentioned that has the value of `/foo/bar`.
> 1 votes

---
Tags: url, segments, server-migration
---


title: PHP inside ce-img

text:
# Question
Title: PHP inside ce-img
Why can’t I place this in ce-img? is there a way around that or plugin that can do that?

‘$kentekenM’ comes from another database

```
{exp:ce_img:single
        src="/images/uploads/kentekenplaat.gif"
        text=" <?php echo "$kentekenM";?>|0,0|36|36|#000|system/expressionengine/third_party/ce_img/fonts/kenteken.ttf|left||left,top|52,18|100||||"
        alt="kenteken {last_segment}” title=”{last_segment}” }

```

# Answer
> 0 votes
For php tags to work within a template you need to turn on php processing via a system setting. Your tag should work once you have done this.

Enabling php processing in a template is not always a good idea (it is turned off by default for a reason). Depending what else your template is doing there might be more appropriate ways of pulling in the value from the other database.

More information on this in the EE documentation.

# Answer
> 0 votes
I think, instead of **Enabling PHP** within a template, you should go for creating a small plugin (which have `pi.plugin_name.php` file inside `plugin_name` folder).

It is advice-able to create `pi` file because you can fire database query from this file. While you can also give more than one database connection in `database.php` (for `EE2`) and `config.php` (for `EE3`).

You just need to connect another database and fetch appropriate data from the `pi` file. And you can easily populate data into front-end by `{exp:plugin_name}`.

---
Tags: ce-image
---


# Question
Title: ExpressionEngine website not caching on Cloudflare
I am having problems getting my ExpressionEngine website to cache on Cloudflare.

I am running: \- ExpressionEngine 2.11.7 \- PHP 5.4 / MySQL 5.5 \- IIS 7.0.

Let me run through steps I am taking:

* On Cloudflare, I have the rule *.domain.com/* to be cached i.e. everything is being cached.
* After doing curl -I on https://www.domain.com/ I noticed the response was coming back with cf-cache-status: MISS. I then tried https://www.domain.com/page/ and I got the same response. /page/ is a template created inside ExpressionEngine.
    + If I create a test page https://www.domain.com/cachetest.php i.e. not ExpressionEngine, it caches that page absolutely fine. So it isn't an IIS configuration, and it isn't the web server, or otherwise I would expect that page not to cache.
    + my web.config file strips out index.php, which I thought might have caused the issue, but I have tried with and without that rule but still not working.
    + I have checked over my output caching in IIS and although caching is enabled, there are no rules. As a 'to be sure', I disabled caching to test again.

Am I missing something? Is there a setting that could be preventing Cloudflare to cache the website for some reason? I have no issues with Wordpress sites using Cloudflares cache, using the same settings.

Thanks in advance,

EDIT I've just found this on the Cloudflares support page (https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache-):

> or if there is a cookie in the response, then Cloudflare will not cache the resource.

If I look at the response in Curl, well we see the exp\_last\_visit, exp\_last\_activity, exp\_tracker, exp\_csrf\_token cookies in the response headers.

So does this mean we cannot use ExpressionEngine with Cloudflare?

# Answer
> 0 votes
I figured it - in Cloudflare, you need to also enable Edge Cache TTL on the same rule. But be sure to disable for your admin pages!

# Answer
> 0 votes
A solution might be to switch to feeding cloudflare with a static cache version of EE: the static pages won't hit your EE server at all, and so you shouldn't have a problem with cookies for those pages.

An easy way to get this working is to use the static cache features of Stash, Mustache for automatic cache clearing rules, and the free Cloudflare module for Stash.

HTH

---
Tags: ee2
---


title: Archive Site pages

text:
# Question
Title: Archive Site pages
I'm really new to expression engine. I mostly just do basic updates and some minor basic coding (html/css). Nothing with the templates, but I do have access. We have the website hosted through an agency that costs a lot of money to make an changes or updates, so my supervisor wants us to archive web pages ourselves.

Currently we have over 10,000 pages. We host blogs for 15 different parts of the company. Is there a way that we can archive these without deleting them? I saw there was a plugin to get, but I think that would involve the agency we use. Our supervisor suggested copying and pasting all the old blogs into a word doc then just deleting them, but I feel like that's really time consuming.

Any suggestions on how to archive the web pages?

# Answer
Two options.

* First you set up your own archive the site - if you have FTP access to the site you could simply copy off all the template and asset files and grab a copy of the SQL database file (the config.php for the site - which you can see if you can FTP to get the templates - contains login and location information for the SQL database being used). Then you can create your own version of the site on a server you control (if you are not worried about speed, then any mac or linux computer can do this out of the box). You should be doing something like this anyway just as part of best-practice (your own offline backup). If you do this you'll end up with a fully dynamic copy of the site.
* Second, and maybe more easily, you could simply crawly the existing sites / pages and build a static archive of every page. This is something you can do using command-line mac/linux tools but very much easier if you use an app such as sitesucker \- which makes it straightforward to set the options to get you what you want. It's simple, works well, and generates a heap of files in folders that you can them simply browse as a static version of your site directly using a browser.

Personally - I'd do both.

HTH.
> 0 votes

---
Tags: category-archive
---


# Question
Title: Visitor (from DevDemon) - How to logout upon conditionals?
I'm using Visitor (for EE v3) and would like to know if there is a way to use the `{exp:visitor:logout return="/mytemplategroup/mytemplate"}` within conditionals?

Because the tag is triggered as soon as the template is parsed, it does not take into account the consitionals I've surrounded it with.

Thank you in advance for your help.

# Answer
> 0 votes
Answer from DevDemon Team : with an embed.

It depends a little on the conditionals because EE parses them at different times in some cases but using a conditional to load an embedded template that contains the Visitor logout tag is working for me.

---
Tags: conditionals, devdemon, zoo-visitor, visitor
---


# Question
Title: ExpressionEngine File Caching being cleared before scheduling
We are experiencing some performance issues with our website and on investigation it appears that the our caching mechanism doesn't seem to be working.

For example, Template A loads Template B as an embed (embed=""). Template B is not directly accessible via the website, ie its just meant to be an embed file not a full web page.

Template B has been set to **Enable Cache** with a **Refresh Interval of 525600** (1 year). When I clear the cache and load Template B via the browser it takes 60+ seconds to load (which is why I have it cached). On a new page load it's down to 0.1 seconds. Perfect.

However I come back the next day and the page is loading at 60+ seconds again. This would suggest that the cache is being cleared for some reason even though it's not set to expire for 1 year and no one has been in to the control panel to edit any content, which would bust the cache.

Has anyone experienced this issue, or can suggest any solutions.

Thanks.

# Answer
Given that you don't want to update Template B dynamically (i.e. one year cache life) it might be easier to use a static cache for the Template B output. Stash provides simple static caching which you can control on a per-template basis (i.e. set only your Template B to static cache) and coexists nicely with other forms of caching (e.g. EE native).
> 0 votes

---
Tags: cache, caching, cache-breaking
---


# Question
Title: How can I add an ampersand (or similar) following all but the final entry in a Matrix loop?
I have a series of entries coming from a Matrix field on a page. If there is more than one entry I would like a "+" to follow each entry, except for the final entry. I've tried using backspace, but that removes the "+" from all entries.

```
<h2>
{artists}
{if performance_type == "Performance"}
{artist}<a href="{title_permalink="artists/view"}">{title}</a>
{if total_results >= "1"} + {/if}
{/artist}
{/if}
{/artists}
</h2>

```

Any ideas at all would be greatly appreciated. Thank you!

# Answer
if you change this

```
{if total_results >= "1"} + {/if}

```

to this

```
{if count != total_results} + {/if}

```

Then you will get the "+" if there are multiple and it will not put the "+" at the end.
> 1 votes

# Answer
I think the best way achieve this is to do by adding `CSS`. For that you just need to create one class `pipe` containing the `+` sign (either with an image or with color). Then put that `pipe` class on respected rows in `Matrix`. This way you can manage it very easily.

```
span.pipe:before {content:" + ";}
span.pipe:first-child:before {display: none;}

```
> 3 votes

---
Tags: channel-entries, matrix, pixelandtonic, loop
---


# Question
Title: How do handle menu organization (taxonomy) in EE4?
I've been using EE2 + Taxonomy for years. Great combo. But Taxonomy might not be available for EE4. I've been spoiled for so many years, I've never thought of how to organize my menus without it.

How do you guys handle menu organization?

For example, I have channel Cars. In Cars I have entries Civic, Versa, Versa (Sedan), Mustang. I want a Cars local menu with items: Mustang, Civic, Versa, and Versa (Sedan) as a child under Versa.

Sorry if ignorant, but I've done this so many years with Taxonomy, and now I'm not sure of EE4's ideal native solutions, or whether there are other good addon solutions.

# Answer
There are several options, but three you might like to consider are:

HTH
> 2 votes

---
Tags: ee4, taxonomy
---


title: Cart Thob update shipping via ajax

text:
# Question
Title: Cart Thob update shipping via ajax
I am using EE3 with Cartthrob and am trying to get the shipping to update via ajax. Basically a new customer is checking out and when they are creating their account and they select their state the shipping charge should update based on the shipping table I have created. I have the ajax setup on the page but the shipping charged are not being updated unless I manually reload the page.

How can I troubleshoot to see why ajax isn't working. `{!-- ///////// SAMPLE TEMPLATE //////////////// --}
 {!-- CT ajax uses jQuery. Include your own or EE's included version --}
 link to --> jquery-1.12.0.min.js
 {!-- CT uses jQuery form for ajax form submissions --}
 link to --> jquery.form.js
 {!-- CT sample templates form for ajax form submissions --}
 link to --> store/cart.js`

`jQuery(document).ready(function($){
 // this will set JSON as the return data type, and identify update_cart as a callback function
 var cart_form_options = {
 success: update_cart, // post-submit callback
 dataType: 'json'
 };

```
// this is the callback script. whenever a form is updated, this script will be called
function update_cart(data, statusText, xhr, $form)  {
    // "data" is the returned data in json format
    // you can access each of these using data.item_name as shown in the example below
    if (data.success) {
        // update the XID hash in the form so we don't run afoul of EE's secure forms
        $("input[name=XID]").val(data.XID);
        // using the json data object's data to update various totals. in this case
        $('.cart_tax')          .html( data.cart_tax );
        $('.cart_total')        .html( data.cart_total );
        $('.cart_shipping')     .html( data.cart_shipping );
        $('.cart_subtotal')     .html( data.cart_subtotal );
        $('.cart_discount')     .html( data.cart_discount );
    }
    return true;
}

// if any input is changed, the form is sent via ajax. you probably wanna be more selective.
$("input[type=text], select").live('change', function(){
    // finding the form that contains this input
    var form = $(this).closest("form");
    // initialize the form
    $(form).ajaxForm(cart_form_options);
    // submit the form.
    $(form).submit();
});

```

});`

when I do n inspect I am seeing this error:

`Uncaught TypeError: $(...).live is not a function
 at HTMLDocument. (checkout:79)
 at i (jquery-1.12.0.min.js:2)
 at Object.fireWith [as resolveWith] (jquery-1.12.0.min.js:2)
 at Function.ready (jquery-1.12.0.min.js:2)
 at HTMLDocument.K (jquery-1.12.0.min.js:2)`

# Answer
The error is because the `.live` method in jQuery has been deprecated since jQuery 1.7. You need to modify the line

```
$("input[type=text], select").live('change', function()

```

to use the `.on()` method.

More at jQuery .live method documentation page.
> 1 votes

---
Tags: cartthrob, ajax, ecommerce, shipping, checkout
---