# Question
Title: Restricting access to forum to logged-in members area
I have a client who's site has a password protected member section. There is also a forum built using the Forum Module.

The client wants the forum to be protected like the rest of the member area as it is only for members. They do not want anyone to be able to see the forum unless they are logged into the member area.

Since there is a login form on the forum itself and you can't see any posts unless you are logged in this seems a little unnecessary but the client has requested this.

Is there a way to do this?

# Answer
I actually ended up adding an {if logged\_out} to the main forum index template with a redirect to the member login page. Seems to do the trick.
> 3 votes

# Answer
you could also wrap the content of the forum template in a {if logged\_in} statement
> 1 votes

# Answer
If you are using Discussion Forum module then you should wrap the forum content into below condition.

```
{if logged_in}
    {!-- Your Forum Content --}
{/if}

```

You can also manage using {if logged\_out} condition.
> 1 votes

# Answer
If the link to the forum isn't made public, then no one can access it unless they're logged in, correct? Would this not suffice?

```
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
{if logged_in}<li><a href="/forum"></a></li>{/if}
</ul>

```
> 0 votes

# Answer
When you folks recommend inserting an "if logged\_out" or "if logged\_in" check in the forum index template, which template do you mean? The forum templates do not accept EE tags.

I'm also trying to accomplish the same thing — have the forum invisible to logged out members, even if they have the URL — so any guidance would be great. Thanks!
> 0 votes

---
Tags: forum
---


title: Block bad words in Discussion Forum

text:
# Question
Title: Block bad words in Discussion Forum
Is there any way if we can block bad words from submitting forum thread. I checked with EE's native module Blacklist/White but seems it works if any blacklisted URL (or its part) is being submitted. Could anyone suggest me a solution.

# Answer
> 2 votes
You will want to modify your Word Censoring preferences which will replace bad words with hash marks, e.g. ######.

# Answer
> 0 votes
By default the Discussion Forum plugin does not provide to block bad words. But if you need then, you should customize and add the Admin Approval of newly posted topics type of functionality in the existing discussion forum plugin. It will not shows the latest topics posted by user. The latest topics only shows when Admin approves it.

---
Tags: forum
---


title: Channel Images and Channel Form

text:
# Question
Title: Channel Images and Channel Form
Am using the following code for channel images field to be displayed on the frontend using channel form tag.

```
<label for="ad_uploads">Upload your images</label>
{field:ad_uploads}

```

However, it doesn't work!

Any suggestions?

Am using ee 2.11.3 and Channel images 6.0.2

# Answer
> 0 votes
If this is still actual, please choose the variant which is best matched to your needs:

1) switch on the Channel form (or Safecracker form) "include\_assets" and "include\_jquery" parameters:

```
{exp:channel:form
  channel="some_channel"
  ...
  include_assets="yes"
  include_jquery="yes"
  ...
}

```

2) in a case if you would like to use some custom version of jQuery, then switch off these parameters.

```
{exp:channel:form
  channel="some_channel"
  ...
  include_assets="no"
  include_jquery="no"
  ...
}

```

However, in the second variant you have to update your layout with:

1) jQuery loading script;

2) all the scripts needed to run Channel Images including jQuery-UI, handlebars etc.;

3) embed the EE {csrf\_token} tag to the scripts (see below).

It should look something like that:

```
  <script src="/bower_components/jquery/jquery.min.js"></script>
  <script src="/bower_components/jquery-ui/jquery-ui.min.js"></script>

  <!-- channel images functions-->
  <script type="text/javascript" charset="utf-8">
    if (typeof EE == "undefined" || ! EE) {
      var EE = {"publish":{"title_focus":false,"smileys":false,"url_title_prefix":"","default_entry_title":""},"user_id":"7","lang":{"confirm_exit":"When you leave, any data entered will be lost. Are you sure you want to leave?","add_new_html_button":"Add New HTML button"},"XID":"{csrf_token}","CSRF_TOKEN":"{csrf_token}"};
    }
    EE.grid_cache = [];

    window.Grid = {
      bind: function() {
        EE.grid_cache.push(arguments);
      }
    };
    mySettings = {
      "nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br \/>\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"<\/p>\n"},"markupSet":[{"name":"html_btn_bold","key":"B","openWith":"<strong>","closeWith":"<\/strong>","className":"html-bold"},{"name":"html_btn_italic","key":"I","openWith":"<em>","closeWith":"<\/em>","className":"html-italic"},{"name":"html_btn_blockquote","key":"Q","openWith":"<blockquote>","closeWith":"<\/blockquote>","className":"html-quote"},{"name":"html_btn_anchor","key":"A","openWith":"<a href=\"[![Link:!:http:\/\/]!]\"(!( title=\"[![Title]!]\")!)>","closeWith":"<\/a>","className":"html-link"},{"name":"html_btn_picture","key":"","openWith":"<img src=\"[![Link:!:http:\/\/]!]\" alt=\"[![Alternative text]!]\" \/>","closeWith":"","className":"html-upload"}]
    };
  </script>

  <script type="text/javascript"> var ChannelImages = ChannelImages ? ChannelImages : {};
    ChannelImages.AJAX_URL = '//your_site.com/?ACT=28&site_id=1';
    ChannelImages.THEME_URL = '//your_site.com/themes/user/channel_images/';
    ChannelImages.site_id = '1';
  </script>

  <script src="//your_site.com/themes/user/channel_images/js/handlebars.runtime-v4.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/hbs-templates.js?v=6.0.2" type="text/javascript"></script>

  <script src="//your_site.com/themes/user/channel_images/js/jquery.colorbox.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.editable.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.base64.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.liveurltitle.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.jcrop.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.queue.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.speed.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/addon_pbf.js?v=6.0.2" type="text/javascript"></script>

  <script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
    var SafeCracker = {}; SafeCracker.markItUpFields = EE.markItUpFields = {};
  });
  </script>

```

Best,

Ruslan

---
Tags: ee2, devdemon, channel-images
---


# Question
Title: Replacement for Content elements? (Migrating a site from EE2 to EE3)
I've been preparing the move to EE3 for quite some time. The official "push" has made me speed up the preparations. I'm using content elements and would really love to keep using it in EE3. It's currently not available for EE3, so I'm really looking for a replacement.

Anyone with a similar situation? Is there a fieldtype I can migrate to?

# Answer
> 1 votes
What you probably need is Bloqs \- the EE3 version of an EE2 addon called Blocks

It is a well supported, stable add-on doing the similar things to Content Elements. There is a migration path from Blocks EE2 to Bloqs EE3, but I don't know how easy it is to migrate from Content Elements to Blocks/Bloqs, so might be worth checking on that.

---
Tags: content-elements
---


title: Routes not working as expected

text:
# Question
Title: Routes not working as expected
I have a Template Group set up as follows:

```
ask_us.group/index.html
ask_us.group/post.html

```

As you can possibly tell this is for a Blog type of area on a website. The index.html is supposed to list the latest posts, with pagination. The post.html is for an individual post. Pretty simple.

It all works as expected when using default URL's which go off the Template Group name, e.g.

I want to use the Template Routes so that "ask\_us" is formatted "ask-us" (dash rather than underscore).

So I've taken a look at the documentation (which is awful, by the way) and can't for the life of me get this to work.

The routes I set up are as follows:

* Template: ask\_us/index.html
* Route: /ask-us/{page:pagination}
* Segments required: No

This gives a 404 error when going to http://domain.com/ask-us.

If I remove the `/{page:pagination}` bit so the route is just `/ask-us` it will load the index.html but break the pagination.

Why is this so damn complicated, and how can I fix it?

One solution you might say is just to rename "ask\_us.group" to "ask-us.group" but I really don't see why I should use hacks like that just because the documentation is so poor.

# Answer
You can give the template group a 'route override'. With this setting you can override the default group/template routing.

Go to the template manager -\> go to the template group you would like to change -\> click the gear icon -\> access -\> Template route override

Now you can edit the routing. So if you put 'ask-us' here it will probably fix your problems.
> 0 votes

---
Tags: ee3, template-routes
---


# Question
Title: Limit number of Expression Engine Channels
I have heard that some say that you should limit the number of expression engine channels you use to about three regardless if you use the free or paid version. Has anyone else experience EE giving problems after you create more than three channels?

# Answer
> 3 votes
No idea where you heard that tip as it's simply not true.

I've worked on sites with upwards of 15 channels without issue.

Granted, the more channels you have the more fields you will have which may bloat the db but performance isn't really affected.

Maybe their point was give good thought to your channel/field setups to avoid duplication of content storage.

# Answer
> 0 votes
I have worked with the websites having more than 30 channels without any issue. But according to your point you should take care while creating Channel fields. The channel field's name should not repetitive. Because that causes the duplication of content.

# Answer
> 0 votes
One of my websites currently has 26 channels. I needed to be able to use the same entry title for multiple entries so I made multiple channels to act as data containers. In this way, I can use channel entry tags or SQL queries to grab the channel quickly and do what I need to do with the data.

I also assign the same field group to several channels to keep the number of custom fields in use as low as possible. I believe that this is the more critical part as adding fields will quickly bloat your DB.

# Answer
> 0 votes
My average site has around 8 channels. Biggest site has 20.

Channels are generally analogous to database tables, if you're familiar with databases.

Best thing to do is familiarize yourself with channel preferences, categories, field groups, statuses, member access, and the channel:entries tag. After using those things in a few cases you'll get a better idea for good/bad use of channels.

---
Tags: channel-entries, ee3
---


# Question
Title: FreeForm Pro - How do I edit my confirmation screen?
How do I edit the confirmation screen that a user sees after selecting "Submit"?

Right now it says "Thank you for your submission!" and I'd like to add more engaging content.

# Answer
> 1 votes
If the "return" parameter doesn't meet your needs, if you use Composer, you can add the Composer fieldtype to your fieldgroup, which has two definitions: your form, and the thank you page.

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


title: Newly Installed Modules not updating

text:
# Question
Title: Newly Installed Modules not updating
I'm trying to install a new module into ExpressionEngine and no matter what I try, I can't get the new module to show up in the control panel under Add-Ons \> Modules. I suspect there is some kind of caching or permissions issue, but I've given 777 to all possibly related directories and cleared all the cache I know about. I've run "Run Module Updates" a few times as well.

The reason I think this might be caching is that I've tried to add several other plugins to the `system/expressionengine/third_party` directory, and these will not show up either. A few days ago (before I found this new plugin that I want), I added one that did show up in the list. I then tried deleting it but it still shows up in the list...

The module I'm trying to add is CE Tweet, and I've followed these installation instructions to a T: http://docs.causingeffect.com/expressionengine/ce-tweet/installation.html

I have also checked that my system meets the module's requirements:http://docs.causingeffect.com/expressionengine/ce-tweet/requirements.html

I am running EE 2.8.1.

In case this has any relevance, my `system` directory is actually named `admin`. I've read that this is fine as long as your configs are set up to expect that, but maybe it has something to do with this.

Please help if anyone can point me in the right direction! I'm under a deadline but can't even start

# Answer
> 0 votes
Try turning on 'report errors' in the CP. It may give you some insight.

Also, sounds whacky, make sure you're site is configured to the correct locale. Often this can arise because the site is using another db or folder setup or someone has moved the third party location on server.

# Answer
> 0 votes
I finally figured this out, thanks to Peter Lewis's comment above. I went on a hunt to figure out what my `third_party_path` and discovered that it was set to a completely different directory (different than all the documentation I've read and the official instructions for the plugin). For future reference, I could easily see what it was in because of Health Check, which I believe is another add-on. I tried copying my downloaded module file to the directory my `third_party_path` was configured to and it worked!!! I inherited this site from a different developer, so it was probably something custom they set up.

This was a local build, to answer the question above.

---
Tags: add-on, module, install
---


title: carousel plugin / setup / code embed

text:
# Question
Title: carousel plugin / setup / code embed
I'd like to add in a carousel feature within the body of a webpage. I have successfully embedded generated code from sites where i've generated a small animation but i can't seem to find anything online for a carousel - there are older entries i've come across which mention doing this with native EE function but the posts are several years old. help?

# Answer
> 2 votes
You can easily do a gallery with the grid fieldtype and any number of jquery (or other) slider plugins.

# Answer
> 1 votes
If I'm understanding your question correctly, you need to find a carousel script and then have EE output the contents that the carousel will display.

There are many carousel plugins that typically run via jQuery. Personally, I use owlcarousel https://owlcarousel2.github.io/OwlCarousel2/

Once your carousel plugin is installed and is working on your page you can setup your EE tags to start displaying your content. Most carousels use a simple ul li structure where each li item is a photo or other info. For outputting these things via EE, you would simply use channel:entries and output your fields content - standard text with a link to an image, an image or file field or grid content. You could have an EE grid field that contains an image, a link, text description or whatever. Once you have an entry setup, you would just structure your tags to format that output to replace the html the carousel is expecting. Use the EE tags to randomize, limit, display by category, etc.

Hope this helps.

---
Tags: carousel
---


title: Uploading .rfa file

text:
# Question
Title: Uploading .rfa file
I'm trying to upload a .rfa to the file manager in EE2 but it's giving me the error "File not allowed.". I've added the mime type to config/mimes.php which is just application/octet-stream (I checked used chrome dev tools).

The allowed file type is "All" on both the File Upload Preferences and field type, it's under the servers file size limit and other file types such as .jpg and .zip work fine. I also disabled XSS security check. I've tried it on a different server and it's giving me the same problem. Anything else I can investigate?

# Answer
> 1 votes
I solved it myself. In the end I had to load the site up locally and step through the php files using a debugger to find out what it was.

Although the file was being uploaded as `application/octet-stream` it was coming through as `application/CDFV2-corrupt` in ExpressionEngine. So I added `application/CDFV2-corrupt` to the list of mime types and it works.

---
Tags: ee2, file-uploads
---


# Question
Title: Date field type - remove "Localised/Fixed"
How do you remove the localised/fixed dropdown on the date fieldtype?

# Answer
I don't think that's possible. Instead, use the FieldType DropDate instead. It's free and very well done.
> 6 votes

# Answer
If you want to stick with the EE date fieldtype and not display the localized/fixed select then you could use jQuery. To hide them across the board,

```
$('.hasDatepicker').next('select').hide();

```

will do the trick.

CP CSS & JS gives a quick way to add JS to the control panel.
> 4 votes

# Answer
Using CSS to hide the elements also works if you are using it in a SAEF form.

```
#cform .choice {display:none;}

```
> 0 votes

# Answer
\**Not advised to change core \** but you may comment out the below line at to hide it:

**system/fieldtypes/date/ft.date.php**

LINE 249

> $r .= form\_dropdown($date\_local, $localized\_opts, $localized, 'dir="'.$text\_direction.'"');

TO

> // $r .= form\_dropdown($date\_local, $localized\_opts, $localized, 'dir="'.$text\_direction.'"');
> -4 votes

---
Tags: custom-fields, date
---


title: Get checkout url of cartthrob

text:
# Question
Title: Get checkout url of cartthrob
guys.

I am developing an extension for the cartthrob addon.
I'd like to get the url of checkout page in ext.myaddon.php. How can I get this?

Thanks.

# Answer
There's no specific "checkout page" in CartThrob. A checkout form can be placed on any -- and as many -- templates as the developer would like. Therefore the best thing would be to determine what page the site owner wants to direct them to and let them set it in your extension settings or a tag parameter.
> 0 votes

---
Tags: cartthrob, url, extension, checkout
---


title: Launching in Expression Engine

text:
# Question
Title: Launching in Expression Engine
Usually with WordPress sites you have to run a find and replace in the Database to find the test site URL and replace with the live URL. Is this necessary to do that for sites using Expression Engine?

# Answer
> 3 votes
"usually" in Wordpress you don't hack about in the database replacing URL's, but use configuration variables in the config.php file:

```
define( 'WP_CONTENT_DIR', your_path );
define( 'WP_CONTENT_URL', your_url );

```

The same can be done in EE:

```
$config['site_url'] = your_url;

```

And might also include other URL settings...

```
$config['cp_url']   = your_url . "admin.php";
$config['path_third_themes'] = ....;
$config['url_third_themes'] = ....;
$config['upload_preferences'] = ...

```

Or via the CMS...

EE3: Click on the cog in the top right

or EE2: Admin-\>General Configuration

# Answer
> 0 votes
Generally, no. As long as you are using best practices, such as using the `{site_url}` variable in templates instead of hard-coding `href` and `src` attributes, you should not need to do any URL munging in your DB. You will either need to set the environment URL in your Control Panel or in your config file to your live URL. I prefer using the config file for CP overrides as it allows for versioning and deployment control of configurations:

EE3:

https://docs.expressionengine.com/latest/general/system\_configuration\_overrides.html

EE2:

https://docs.expressionengine.com/v2/general/system\_configuration\_overrides.html

You'll want to set your `site_url` variable per environment.

---
Tags: url
---


# Question
Title: convert segments from archive url to date variable and use in template
Trying to grab the month and year from URL on an archive page (i.e `/blog/2017/02`) and convert to a date variable and display as such in template "February, 2017." Using EE3.

Open to add-on or out of box code, but not interested in using php in template. Please advise.

# Answer
> 1 votes
If you want to keep php out of your template, but still be able to use php string manipulation you could use CE String to do so. http://docs.causingeffect.com/expressionengine/ce-string/index.html

This will allow you to use datetime conversion without directly writing out php code as well as any other php that you might need. Its pretty powerful.

I'm sure that there are other extensions and plugins that could handle datetime as well - perhaps Low Nice Date? http://gotolow.com/addons/low-nice-date

Otherwise, it would be easy enough to do in jquery on page load as well.

edit: after looking at a few other plugins, I think Low Nice Date is the way to go. Its simple, free, and works for EE2 and EE3.

---
Tags: templates, segments, category-archive
---


# Question
Title: DevDemon Forms - Entry Linked breaks publishing/editing entries
When using a Forms channel field, pressing submit after creating/editing an entry just kicks you to the main page. This was working for a while but a client just notified me that they can't edit/create content.

Versions: Forms: 3.5.2 ExpressionEngine: 2.7.2

# Answer
I was able to fix this by going to Admin -\> Security and Privacy -\> Security and Sessions and setting the User Session Type to Cookies only.
> 1 votes

---
Tags: forms, devdemon
---


# Question
Title: importing entry status via CSV - does uppercase or lowercase status matter
I typically add/edit/delete my entries via CSV (datagrab) and have been doing so for a while now. Recently I'm seeing some confusing things in the way that some of my entries were being ordered and displayed and I noticed that during one of my imports, I had updated statuses to 'Open' while some of the other entries are 'open'. Both statuses seem to display, but which is actually correct?

The site is on EE 3.4.5 and I'm pulling entries via a SELECT DISTINCT query

```
WHERE exp_channel_data.channel_id='2' AND status='open'

```

The query pulls the same number of results regardless of the case of the status.

Which one is actually correct per EE standards? open/Open closed/Closed For that matter what about all caps?

Note that on EE2 if you check the default status it shows Open/Closed as status names, but if you open the status it shows open/closed.

# Answer
While firing a query in DB, No matter you pass "Open" or "open". Both are same.

Your first question's answer is: **As per EE Standards, It should be "open".**

EE save "open/closed" in database, it shows in list page after making "first letter" capitalized.
> 4 votes

---
Tags: status, datagrab, import, query-module
---


title: Can't access Members page

text:
# Question
Title: Can't access Members page
I have an ExpressionEngine site, using **v2.7.3**.

I appear to have lost access to the Members page in the back-end - no longer finding it in Control Panel or through Admin menu.

I have a purchased license, arranged by my then-developer in 2013 (would have been in September or October of that year).

But the module seems to have vanished. How do I access or regain access?

Thanks,
Andy

# Answer
Has the module been uninstalled? or has your user permissions/group permissions for member related admin been revoked?

If the module still exists and is enabled, you should be able to see it via the CP link yoursite.url/admin.php?/cp/members/view\_all\_members
> 0 votes

---
Tags: members
---


# Question
Title: Can templates be filtered for text content?
One of our templates requires the word 'update' in the text copy, but whenever we edit it to add the word, on save we get "Error. The page you requested was not found."

The same error happens when the word is joined to another, for instance 'updatefor'.

We have tested and get the same error regardless of whether the word is added as text copy or even a class name.

The same error is not found when we edit page or channel content with the same word.

Any ideas?

# Answer
> 0 votes
Resolved: was being caused by an overeager ModSec Apache module.

---
Tags: templates, filter
---


title: Assistance query change membergroup

text:
# Question
Title: Assistance query change membergroup
I am unfamiliair with the Query module and I hope someone here could guide me.

In a Template I want to change the group\_id of a chosen member (member\_id in stash snippet) from 13 to 14. The template is only accessable for super-admins.

Reason for that is that I want an editor of that site to be able to do this, but I do not want them to access the full member-section in the CP. (Too complicated)

Is this possible?

Really thank you for helping me out!

# Answer
The query module can only be used for data lookups, not for modifying the DB. You either have to use PHP in your template or, much better, write a small add on - this can probably best be done with a plug-in.
> 0 votes

---
Tags: control-panel, member-management, query-module
---


title: How to create a views of channel

text:
# Question
Title: How to create a views of channel
In about us, i added different data and I want to display it in view. How to create a view of our about us channel. I newbie in expression.can we use the template in it

# Answer
> 2 votes
Expression Engine is a powerful CMS that has gives you great flexibility when it comes to displaying content on a web page. However one consequence of this flexibility is that you need to define how any / all information is presented - there are no 'default views' to work with.

The mechanism for defining these views of your content is through the creation of page 'templates' which combine instructions for how / what data to be retrieved from the CMS with HMTL information that defines the web page(s) that will be used to display it.

The way in which these templates work, and how you build a site with them is beyond what can be done in an StackExchange answer... however the EE Documentation contains two resources that might help.

First there is a description of how the EE system 'works' which is helpful background.

Second there are some worked examples of how you go about creating a simple EE site - which covers much of what you need to know to get started.

HTH

---
Tags: channel
---


title: Duplicate OrderIDs

text:
# Question
Title: Duplicate OrderIDs
I’m running a few sites using Expresso Store (2.5.1) and the traffic and volume of sales of one of them has increased dramatically in the past month.

Unfortunately we’ve had two instances where the two orders have shared an OrderID which is playing havoc with our warehouse system. In both cases the orders have obviously come in at a very similar (but not identical) time. In the most recent instance the orders (according to the store order summary screen came in at:

2/2/2017 10:46 AM and 2/2/2017 10:45 AM

Any advice you have on how to prevent this or a patch available would be much appreciated.

# Answer
(I've with Vector; we acquired Exp-resso Store a few weeks ago.)

Have you checked what your database load was like at this time? This kind of thing can happen if database load is high and so queries get blocked and end up seeing some stale data about the most recent order #.

There are potentially some patches to try to avoid this, but I'd definitely start with making sure database capacity is high enough that it doesn't get into a backed up state with queries getting stalled. Did you see high database load and slow queries during this time?
> 0 votes

---
Tags: expresso-store, devdemon
---


# Question
Title: How do I make content conditional on domain name?
I am wrapping up an MSM build that has one domain and three subdomains. Each site has unique Analytics code.

Conditional code based on segment is very useful but I am not sure how to display conditional code based on domain name. It would be handy to use a segment\_0, but that obviously does not work.

Is there some other conditional code that would enable display of the analytics code based on the domain name?

# Answer
> 1 votes
You can use a conditional with `{site_id}` or `{site_short_name}`.

If you still want to set the condition based upon on the domain, you can use `{site_url}`.

---
Tags: conditionals, advanced-conditionals
---


# Question
Title: Make a new live copy of EE 2.9.2 website to a new server with a new license
I am new to EE. I have a client who has existing **EE 2.9.2** website up and running developed by another developer.

The client wants to make a copy of this site to another server and point a new domain to the new instance. The client is not sure if the site uses core or licensed version of EE, but I cannot see in the header or footer of the site any Core labels so I assume it is a paid version.

I understand that 2 live sites cannot use the same license. The client is ready to buy another license. My questions are:

1. When the client buy the new license is it a problem that we need license for an old version of EE 2.9.2?
2. I can copy the site but how to change the license with the new one?
3. While I update the new copy with the new license, will this affect the original instance in any way?
4. Will the developer/company get some notification that this license is used twice?

# Answer
You can copy the site easily to one server to another server. As you are new to EE I suggest you to use Deeploy Helper plugin. (For all absolute and relative paths changes, so new site not take URLs and server path of Old site.)

Answer of your questions are as follows:

1. Your new licence, that would be I think `EE 3.5 +` can use as licence key in your `EE V2.9` site. (Although EE 2.x is no longer available and will expired officially in May 2017. Blog Here) You can still use EE2.9.x version.
2. Licence Key is Hard coded in config file. Go to `system > expressionengine > config > config.php`. Find the variable `$config['license_number']` and replace your new licence with old one.
3. No. Your OLD site and Licence will not affected. Don't worry. :)
4. No. No notifications will come out. (You also authorized to make a copy site in developer server with same licence so you can develop the site or make a site to development use. It is written in Terms and conditions of EE)

**I hope you get all your answers :)**
> 1 votes

---
Tags: license, ee2.9.2
---


# Question
Title: EE3 Extension not showing up - what am I missing?
I've read this:

https://docs.expressionengine.com/latest/development/conversion/index.html

and this:

https://docs.expressionengine.com/latest/development/extensions.html

I have a folder called:

`ee/system/user/addons/ldap_plugin`

in this folder I have:

```
addon.setup.php
ext.ldap_plugin.php
language/

```

`addon.setup.php` looks like:

```
<?php

return array(
  'author'      => 'Me',
  'author_url'  => 'http://example.com/',
  'name'        => 'Ldap Plugin',
  'description' => 'Handles LDAP login / account creation',
  'version'     => '1.0.0',
  'namespace'   => 'Ldap_plugin\Ldap_plugin',
  'settings_exist' => TRUE
);

```

`ext.ldap_plugin.php` contains:

```
class Ldap_plugin_ext {
    var $settings       = array();
    var $name           = 'LDAP Plugin';
    var $version        = '1.0.0';
    var $description    = 'Handles LDAP login / account creation';
    var $settings_exist = 'y';
    var $docs_url       = '';
    var $debug          = TRUE;

    function __construct($settings='')
    {
        $this->EE =& get_instance();
        $this->settings = $settings;
    }

    function activate_extension ()
    {
        /*.....*/
    }

    function update_extension($current = '')
    {
        /*.....*/
    }

    function disable_extension()
    {
        /*.....*/
    }

    function settings()
    {
        /*.....*/
    }

    /* various hooks here*/
}

```

and yet, it will *not* show up in `Developer / Add-On Manager` for installation. I have other 3rd party add-ons that show up. I've removed them and renamed them and they properly respond, so I know the folder is being seen in the right place. I've checked file permissions on the above folders and they match the other add-ons.

I'm not seeing the issue here. Do Extensions get managed elsewhere? Is there something critical I'm missing that's required?

Thanks for the help.

# Answer
> 2 votes
Turned out that two things were wrong:

1. In the `config.master.php` file, `$env_config['allow_extensions']` was set to `n` and should be set to `y`
2. This is a migration and had some old entries in `exp_extensions` table in the database for extensions we no longer had installed. Once I turned on `allow_extensions` I had to clear those out in that table. It showed right up then!

---
Tags: extension
---


# Question
Title: Simple conditional on embed variable in exp:channel:entries
Trying to do this:

{exp:channel:entries channel="main{if embed:inttest=="yes"}\_inttest{/if}" limit="1" disable="member\_data|pagination" status="{tv\_status}"}

Am I misunderstanding the channel entries tag parse order? I've stuck to simple conditionals testing only a Stage 1 embed var (right?) so I thought this would work, but nope. Thanks in advance for setting me straight.

# Answer
Aha. This works:

{exp:channel:entries channel="main{if "{embed:inttest}"=="yes"}\_inttest{/if}" limit="1" disable="member\_data|pagination" status="{tv\_status}"}

¯\\\_(ツ)\_/¯
> 0 votes

---
Tags: channel-entries, parse-order
---


# Question
Title: Set Freeform notification email dynamically
I have a modal box that pops up with a form anytime a person from a staff list is selected so that they can be contacted via the form without giving out their email address.

However, I'm having trouble figuring out how I can pass the staff members email address (which is in a field) to the freeform tag inside the modal without exposing their email address to the public.

I looked at the recipient parameter, but that wouldn't work since I don't want the user to have to select the recipient from a list in the modal again once they've selected a staff member to email.

# Answer
You can add the notify paramater to your {exp:freeform:form} opening tag. Make sure the freeform tag is inside your staff fields loop and execute it like this:

{exp:freeform:form notify="{staff\_email\_field}" ...other parameters... }
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: Freeform Pro: List form values for lists
So I want to be able to display a Freeform Field's value of the picklist on a freeform entries list. I created a field with a list using the "Value/Label Pair list" choice. I can show the label, the field response chosen but not the value I assigned that choice.

These 2 attempts just output the label for the item being selected, not the numerical value I assigned.

```
{freeform:value:will_this_request_be_useful_to_other_hmis_users}
{freeform:field:will_this_request_be_useful_to_other_hmis_users default_value=""}

```

I want to be able to see: LABEL Of Choice: Value Chosen (number). Not the Label of the question, the choice chosen and not the numerical value.

# Answer
I think this is what your after:

```
{freeform:field:FIELD_NAME}
    {freeform:data:value} - {freeform:data:label}
{/freeform:field:FIELD_NAME}

```

ref: https://solspace.com/expressionengine/freeform/docs/default-fieldtypes/#multi\_select
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: Remove and Direct all traffic through index.php from .htaccess to web.config in IIS10
Could someone please help me convert the following .htaccess file to web.config?

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

```

I tried to use Rewrite Module to translate it but it fails for the following:

1. `RewriteBase /` This is not supported in IIS
2. `RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]` IIS also fails to translate this.

# Answer
> 0 votes
I found this one on Microsoft website. It works. Mufi's answer run URLs without index.php and with index.php too. This code below rewrite and remove index.php from URL.

```
<system.webServer>
  <rewrite>
    <rules>
      <rule name="Redirect index.php" stopProcessing="true">
        <match url="index\.php/(.*)" />
        <action type="Redirect" url="{R:1}" appendQueryString="false" />
      </rule>
      <rule name="Rewrite index.php">
        <match url="(.*)" />
        <conditions>
          <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <action type="Rewrite" url="index.php/{R:1}" />
      </rule>
    </rules>
  </rewrite>
</system.webServer>

```

Visit the following link for more info

# Answer
> 0 votes
In web.config rewrite and remove index.php will work like this:

```
<rewrite>
    <rules>
        <rule name="Rule" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
        </rule>
    </rules>
</rewrite>

```

Visit this URL for more information.

---
Tags: .htaccess
---


title: Relationship field for navigation menu

text:
# Question
Title: Relationship field for navigation menu
I need to create a 'megamenu' with a page title and a summary for each menu item. The only way I can think of doing this is to create a channel entry for the menu and use a relationship field for each item. Is this a good/bad idea? Or is there a better way of doing it?

# Answer
> 1 votes
Many URLs with summaries in `<UL> <LI>` structure, No doubt channel entry is needed. You can use both Relationships and GRID to accomplish the megamenu needs.

(As there are several plugins available in devote ee But I don't think they will match megamenu criteria so no other options except channel with GRID and Relationships)

---
Tags: relationships, navigation
---


title: load entries by batches

text:
# Question
Title: load entries by batches
I have a channel entries tag that has to load (sometimes) more than 3000 entries and I'm running into memory issues.

I'm looking for a way to build the page by batches (with javascript?) and display some kind of animated icon while the wait.

Waiting is not a problem, as long as the page does not crash...

# Answer
You can use here LAZY LOAD or INFINITE SCROLL (Just like automatic pagination)

https://www.sitepoint.com/jquery-infinite-scrolling-demos/
> 1 votes

---
Tags: channel-entries, javascript, memory-limit, memory
---


title: CP down, 504 error

text:
# Question
Title: CP down, 504 error
I have a huge problem with performance of CP (EE 3.3.4). Sometimes I can see the 504 error (at the same time PHP works like crazy!). New Relic says that I use all php sources and probably that's why CP is down.

Did you have similar problems? If so, what shoud I'm looking for?

Thanks!

# Answer
> 0 votes
First, in your config.php file, set this `$config['allow_extensions'] = 'n';` If your cpu load drops off, you have an issue with an addon extension.

Second, you should be able to dial in on what is causing the issue using New Relics APM. Highlight the area where the load ramps up, then view the transactions and see what is taking the most time, or if there is a query that is taking a long time or running like 200 times in a row. New Relic is a very powerful tool and has helped me trace many different issues, which often lead to something weird happening in an addon.

---
Tags: control-panel, ee3
---


# Question
Title: Use onClick to update the status of an entry
I have a simple page that is displaying entries and statuses from the database. I would like to be able to click a link (i.e. remove entry) and have that onClick event set the entry status to removed.

```
<h4>{entry:title}</h4>
<p class="meta">
    Entry Status:
    {if entry:status == "open"}
        <span class="green">Paid</span>
    {if:else}
        <span class="red">{entry:status}</span>
    {/if}

    <a>{NEED ON CLICK ACTION/SYNTAX HERE}Remove Entry</a>
</p>

```

# Answer
> 0 votes
The simplest way that I can think of is to use a standard channel form. You would pass the entry\_id to the form and the form would have a status field with the value that you wish to use to set the entry status.

I have done this on several of my sites and in some cases I completely hide the form and then set a status and trigger the form send via jquery. for example:

```
<button id="sendmyform">Set the status</button>

{exp:channel:entries channel="yourchannel" ...params }
    {exp:channel:form channel="yourchannel" entry_id="{entry_id}" return="templatename" id="statusform"}
        <input type="hidden" id="myformstatus" name="status" value="mystatus" />
    {/exp:channel:form}
{/exp:channel:entries}

```

and then jquery:

```
$('#sendmyform').on('click',function(){
    $('#statusform').submit();
});

```

which would send your hidden form on clicking the button or link. If you need to set the status at the same time as the button is clicked, just set the field status value prior to sending.

```
$('#sendmyform').on('click',function(){
    $('#myformstatus').val('mystatus');
    $('#statusform').submit();
});

```

The above method works great for single entry pages, but you'll run into complications if you are trying to use this on a page where you have multiple entries and are outputting the form for each entry as well.

If you are working with multiple entries on the page, you'll probably need to append a `{count}` or an `{entry_id}` for each form/field/button to determine which button was clicked and it would be better to use class instead of id to set the selectors. It also may be useful to use a data attribute on the button so that you can easily parse which form to submit.

---
Tags: status, entry
---


# Question
Title: Bug when using conditional on Assets field value, followed by regular Grid tag
I am using EE 2.10.1, with Assets 2.6.

I'm getting a very strange bug in my template. I have an assets image field, and a grid field that contains an Assets column.

```
A PHP Error was encountered

Severity: Notice

Message: Undefined index: grid_field_id

Filename: assets/ft.assets.php

Line Number: 1484

```

and

```
A PHP Error was encountered

Severity: Notice

Message: Undefined index: col_id

Filename: assets/ft.assets.php

Line Number: 1485

```

and

```
A PHP Error was encountered

Severity: Notice

Message: Undefined index: grid_row_id

Filename: assets/ft.assets.php

Line Number: 1486

```

Here is my template code. I have reduced it to be as simple as possible and still throw the error.

```
{exp:channel:entries
    channel="products"
    status="not closed"
    require_entry="yes"
    disable="member_data|category_fields|pagination|categories"
    limit="1"
    }

    <img
        src="{product_display_image:url}"
        alt="{if product_display_image:alt_text}{product_display_image:alt_text}{if:else}{title} image{/if}"
        class="img-responsive"
        itemprop="image" />

    {product_downloads}
        {product_downloads:file:title}
    {/product_downloads}

{/exp:channel:entries}

```

If I remove either the `{if product_display_image:alt_text}{product_display_image:alt_text}` conditional, or the `{product_downloads}` loop, the errors go away.

What's going on! How can I fix this?!

Here are the settings on the two fields:

# Answer
I'm seeing this error too. No conditional involved, but an Assets image field followed by a Grid field with an Assets image in one column. Same version of EE and Assets. I put the Grid field into an embed to get it to work. Not ideal but working.
> 0 votes

---
Tags: assets, grid, bug
---


# Question
Title: How can I display Low Search form based on selected parameter?
I'm quite new to ee3/Low Search and I'm wondering if someone would mind helping?

I'm attempting to give a site a simple property search.

On my site index page I have a select with property type options(categories)like House, Apartment, Land etc. inside the Low form tag.

If the "House" category is selected and posted to the results page I would like a form containing *only* House-specific fields to be displayed and if the "Land" category is posted I would like to display a form containing only Land-specific fields.

What would be the best way for me to do this?

Thanks

# Answer
> 4 votes
To identify the categories selected in low search, we use low search variable **low\_search\_category**

1. In low search form, You need to select your query `{exp:low_search:form query="{segment_3}"}`
2. Use **low\_search\_category** to identify category you searched.

```
<select name="category[]" id="type" class="form-control selectpicker show-tick" title="Choose One" data-live-search="true" data-style="btn-primary">
    <option value="">Choose Type</option>
    {exp:channel:categories channel="channel_name" disable="category_fields" category_group="1" parent_only="yes" style="linear"}
    <option value="{category_id}" {if low_search_category ~ '/\b'.category_id.'\b/'}selected{/if}>{category_name}</option>
    {/exp:channel:categories}
</select>

```

In above example, I have use **low\_search\_category** to make the selection field selected. In the same manner, you can use this variable to identify your category in **{if}** or can pass in categories loop.

---
Tags: search
---


# Question
Title: How can I call a method from my add-on via a JS file?
I'm working on updating a fieldtype add-on to work with EE3. This add-on calls one of its own functions from a javascript file to make some DB updates without reloading the page.

In EE2, the javascript called the function using $.get and a URL formatted like this:

http://www.mysite.com/admin.php?S=0&D=cp&S=0&C=addons\_modules&M=show\_module\_cp&module=module\_name&method=method\_name&param1=param1value&param2=param2value

This style of URL is not working for me in EE3 - I am getting a 404 not found error in the console when the $.get runs.

What format do I need to use for the URL in EE3 to access a function of my module (and pass in parameters)?

I thought I might be able to use an ACT to accomplish this, but I need the module to work on multiple installations so I can't hardcode the ACT id into my javascript file (and I'm not aware of any way to pull the ACT id from the database via javascript).

I really appreciate your help!

# Answer
> 0 votes
Did you ever figure this out? I'm running into the same thing in updating a module. Thanks!

---
Tags: control-panel, add-on-development, url
---


# Question
Title: How to fix EE 500 error, cannot use 'Bool' in Lexer.php?
One of our websites http://mooseheadlakeedc.com is down, here's what our server technicians said about it:

> It appears that there is an issue with Expression Engine that is causing a 500 error when loading the page. The error is:
>
> PHP Fatal error: Cannot use EllisLab\ExpressionEngine\Library\Parser\Conditional\Token\Bool as Bool because 'Bool' is a special class name in /home/mooseheadlakeedc/public\_html/system/EllisLab/ExpressionEngine/Library/Parser/Conditional/Lexer.php on line 9
>
> Based on some Googling of the issue, it appears that this issue has been resolved in newer versions of Expression Engine and updating it should resolve the problem.

I'm new to expression engine and haven't developed on it before, and due to the error am unable to log into the back-end to perform the update. I also couldn't find the info on google he appears to have found. Does anyone have any idea how to fix this issue?

Thanks for your help.

# Answer
> 0 votes
first step would be to disable extentions via the config file. this file is typically located at/system/expressionengine/config/config.php change this line:

```
$config['allow_extensions'] = 'y';

```

to

```
$config['allow_extensions'] = 'n';

```

And try to log into the cp again

# Answer
> 0 votes
As it turns out, this was a bit of a mess, and the error I described above may not have been relevant to the environment of the site. That error came about after upgrading php/mysql/apache on the server, and since this site was down because of that, we reverted the entire server back to a Server Image Backup. So that error may not have been relevant to the state before the upgrades.

The original developer checked out the site and found that the .htaccess file and config were wrong, still not sure how, but that was where the issue ultimately was coming from.

---
Tags: php-errors
---


# Question
Title: Complete website duplication with EE v2.9.2 and MSM v2.1.7?
Am I able to **safely** duplicate an **entire** website (ie; with entries) with the above versions of EE & MSM?

The documentation seems to say ‘yes’! But I’ve read that there were problems and so the functionality was discontinued in v3.0.

I’m a bit nervous for 2 reasons:

1.) Due to the crazy timeline, we’re thinking of doing it directly on the production/live server (eeek).

2.) It’s a reasonably large website (30+pages, 100’s of videos). So my cost estimate would be wildly different if I had to copy all the content entries manually.

Has anyone had any experience with this? Any advice would be welcome.

Cheers,

CJ

# Answer
> 0 votes
It works OK, but doesn't include all your core plugins, like matrix, playa, taxonomy etc.

So your going to be doing a fair bit of manual labour

---
Tags: ee2, multi-site-manager
---


# Question
Title: Conditional statement using two different channels
I have two channels setup, one "blog" and one "authors". The blog channel has all of the blog post entries and the Authors channel has a list of the different post authors.

I am looking on a specific entry (blog post) to show the blog information (body, author, author description and pic). I want to have it so that I just put in the entry the authors name then have a conditional statement that cross checks the authors name in the blog entry with the different authors in the Authors channel, then pulls the information from the authors channel (bio, picture, social media links, etc...) but am having trouble finding anything about doing conditional statements between two channels.

Here is the code to pull everything in which works for the Blogs portion but not the Authors:

```
{exp:channel:entries channel="blog|authors" text_only="yes"}
<div class="fancy-title title-bottom-border">
    <h2>{title}</h2>
</div>
<ul class="entry-meta clearfix">
    <li><i class="icon-calendar3"></i> {entry_date format="%m-%d-%Y"}</li>
    <li><i class="icon-user"></i> {entry_author}</li>
    <li><i class="icon-folder-open"></i> {exp:channel:entries channel="blog" limit="1"}{categories limit="1"}{category_name}{/categories}{/exp:channel:entries}</li>
</ul>
<br />
<p>{entry_body}</p>

<p><b>Keywords:</b> {entry_keywords}</p>

<div class="panel panel-default">
{if blog/entry_author == authors/author_name}

    <div class="panel-heading">
        <h3 class="panel-title">
        Posted by {author_name}
        </h3>
    </div>
    <div class="panel-body">
        <div class="author-image">
            <img src="{cdn_url}/images/blogs/{author_photo}" alt class="img-circle" />
        </div>
        {author_description}

        </div>
    </div>

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

```

Any help would be much appreciated.

Thanks

# Answer
> 1 votes
You could do this with an embed by setting your embed with the author\_id or author\_name as a variable.

```
{embed="templategroup/templatename" authorName="{author_name}"}

```

embed:

```
{exp:channel:entries channel="authors" search:author_name="={embed:authorName}"

```

However, if the blog post and the author channel info have the same author, it would be much simpler to set the channel entries tags to pull based on `{author_id}`. That would eliminate the need to use a custom field search.

Also, it may just be a formatting issue, but your code above looks like its going to output two extra `</div>` tags per each loop.

---
Tags: conditionals, advanced-conditionals, multiple-channels
---


# Question
Title: Database error 1054 after upgrade to ee 2.11.6
A Database Error Occurred Error Number: 1054

Unknown column 'fingerprint' in 'field list'

SELECT `member_id`, `admin_sess`, `fingerprint`, `sess_start`, `login_state`, `last_activity` FROM (`exp_sessions`) WHERE `session_id` = '61d62d6d1f526c3ea67c9561cbef791a470a7101' AND `fingerprint` = ''

Filename: libraries/Session.php

Line Number: 731

**Does anyone know how I can fix this issue? Please? Thank you!**

# Answer
> 2 votes
The "Fingerprint field" is missing in DB.

Go to Database to trigger this query.

```
ALTER TABLE  `exp_sessions` ADD  `fingerprint` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER  `user_agent`

```

---
Tags: ee2, error, database, upgrade, sessions
---


# Question
Title: Channel Form, make Captcha field required
I'm using EE 2.9 and have the form below, can you make the Captcha field required?

```
{exp:channel:form channel="test" return="test/thank-you" logged_out_member_id="1" dynamic_title="[question]" status="pending" rules:captcha="required" rules:my_email="required" rules:first_name="required" rules:last_name="required"}
    {label:first_name}
    {field:first_name}

    {label:last_name}
    {field:last_name}

    {label:my_email}
    {field:my_email}

    {label:question}
    {field:question}

    {label:my_nearest_branch}
    {field:my_nearest_branch}

    <label for="captcha">Please enter the word you see in the image below:</label>
    {captcha}
    <input type="text" name="captcha" id="captcha" value="{captcha_word}" maxlength="20">

    <input type="submit" value="Ask Question" class="button">
{/exp:channel:form}

```

# Answer
Well, There are two ways to do so.

**Server side:**

In your `{exp:channel:form}` tag, Add parameter `rules:captcha="required"`

**Client side:**

Use jquery.validate.js to make field required.

1. Include this js library: `http://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.js`
2. Put the class `required` in input field.
3. Use jquery to run the code before form submits:

```
<script type="text/javascript">
    $(document).ready(function() {
        $(document).on('submit', 'form#myForm', function(event) {
            if($(this).valid()){
                return true;
            }else{
                return false;
            }
        });
    });
</script>

```

Here is some classes you can use to validate the form input fields.
> 4 votes

---
Tags: safecracker, captcha
---


# Question
Title: Getting second item from a tag-pair list
Have tag-pair (generated as part of output from external call to Amazon AWS Ecommerce API) that returns a list of languages - vis:

```
{Item_ItemAttributes_Languages}
   {Language_Name}
{/Item_ItemAttributes_Languages}

```

How do I get just the second item in the list?

Hopefully not too difficult to do - just baffled currently about how to do so...

# Answer
> 2 votes
Typically in EE you can use the offset parameter.

`offset="1"` would start the output on the second item in the loop and setting a limit parameter `limit="1"` would return only the second item.

However, I am unsure if it works with your tags above as they are tag pairs within the AWS products module.

If offset is unavailable as a parameter, you may need to look into setting a php array and then outputting the second item of the array.

---
Tags: tags, filtering
---


# Question
Title: Does anyone know any details on the recent security release notifications?
All our EE2 sites are displaying:

"An ExpressionEngine version 2.11.6, build 20170207 has been released as a security release"

Does anyone have any details about what security vulnerabilities are being addressed? Are they specific to version 2.11 or a general security vulnerability in all EE2 sites?

# Answer
> 2 votes
You'll discover all patch notes here in the changelog.

Security patches are a combination of both EE & underlying frameworks. EE is pretty resilient and a lot of security issues are more server side orientated.

# Answer
> 1 votes
I found out from Robin Sowell with Ellis Lab that the latest security release fixes a previously unknown issue in CodeIgnitor, which is at the core of version 2.

So this definitely affects all installs of EE2.

---
Tags: security
---


# Question
Title: How to display HTML in an EE field, onto an EE template?
I'm running an older version of EE (v2.6.1) and I need to create a template to export some of the content. I need to display entry fields as their HTML, so that when I view this template, I can see the HTML tags and then copy that HTML into my shiny new instance of EE.

(Please don't suggest importing; I don't have the SQL knowledge to do that. this method is slower, but I know what the frick I'm doing and I know that it won't kill anything. The entries have been created in the new version of EE, so the entry IDs won't align between the two instances anyway. Manual copying is going to have to be what happens.)

# Answer
Probably your best bet is to use a migration utility - such utilities allow you to export channel entries in various formats and then reimport them somewhere else (either a different CMS, or another instance of EE etc.).

A good one is Datagrab
> 0 votes

# Answer
Talked to the EE support folks, found that there is no real way to do this in EE because the browser will still render the HTML. Instead, what I did is a global search-and-replace to change all instances of the left bracket to <. This meant that all of the HTML in the fields that I did a search-and-replace, displayed as HTML code in the EE templates. Note for folks reading this: yes, this is reversible, BUT be careful when doing it, that you really want to do this.
> 0 votes

---
Tags: ee2
---


title: Using Playa passing values

text:
# Question
Title: Using Playa passing values
I am trying the following with no luck

```
<?php $category = "{exp:cat2:id category_url_title='{segment_4}'}"; ?>
{exp:playa:parents channel="article|blogs|calendar_events|contests|podcasts|videos" category="<?= $category ?>" field="show" limit="24"}

    // Do something here

{/exp:playa:parents}

```

This is wrapped by `{exp:channel:entries}` tag. Now If I provide the value of `category` hard coded it returns the results but not if I pass it in like the above. Even if I assign the value of $category = '2' it wont return any results. Any ideas ?

# Answer
I have resolved this by adding the option `parse="inward"` to the `{exp:playa:parents}` tag. So my code looks like below

```
{exp:playa:parents  channel="article|blogs|calendar_events|contests|podcasts|videos" category="YOUR_DYNAMIC VALUE FROM PHP OR ANOTHER TAG" field="show" limit="24" parse="inward"}

    // Do something here

{/exp:playa:parents}

```

The above code worked as long as there is no pagination required inside the `playa:parents` block. For pagination to work you need to provide `var_prefix="your_prefix"` option but then it will have to modify the code to reference your variables based on the prefix set. I avoided that by using embed. So basically you can put the whole Playa code inside another file and embed them where you want to use it. So the playa code will look something like below

```
{exp:playa:parents  channel="article|blogs|calendar_events|contests|podcasts|videos" category="YOUR_DYNAMIC VALUE FROM PHP OR ANOTHER TAG" field="show" limit="24" entry_id="{embed:entry_id}"}

    // Do something here

{/exp:playa:parents}

```

Note I have removed the parse option and added entry\_id option which should be same as the parent entry ID you are trying to find the parents for.

Hope that helps!
> 3 votes

---
Tags: ee2, categories, templates, playa
---


# Question
Title: Fatal error: Call to undefined method ChannelImagesUpdate_50400::update()
Fatal error: Call to undefined method ChannelImagesUpdate\_50400::update() in /var/www/vhosts/site/sysdata/user/addons/channel\_images/upd.channel\_images.php on line 215

I recently upgraded a site that was previously running EE 2.11 with the following add-ons: Structure 3.3.14.5, Channel Images 5.2.2 and Expresso 3.3.2. The upgrade went well and the site is now on EE 3.5.2, Structure 4.0.3, and Expresso 4.2.3. I cannot update the Channel Images add-on through the Add-on Manager. It gives the above failure every time I try to run the update. New files have been downloaded from DevDemon and re-uploaded to the correct locations with the same results each time.

A support email to DevDemon has gone unanswered for over a week. Help!

# Answer
Go to line number 215 in UPD file and change the code `$UPD->update();` to `$UPD->do_update();` and run update the module again. :)
> 2 votes

---
Tags: devdemon, channel-images
---


# Question
Title: Moved to new server - Expresso editor - denied file access?
I've just moved an **EE v2.7.2** site to a new server, following the EE-docs thoroughly. Verified all paths and file/folder permissions.

Everything works well until i try to edit or publish an entry, getting the error message below.

To get a WYSIWYG editor i'm using Expresso field types for my 'summary' and 'body' fields, and as soon I write or edit in one of these fields it is not possible to submit without the error. If I use only the other non-Expresso fields there is no error message.

Everything was working perfectly on the previous server.

Any suggestions?

# Answer
> 2 votes
This may be a **mod\_security** issue. Please check if your host is running it.

You can turn off mod\_security by adding below code to `.htaccess` :

```
<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

```

---
Tags: migration, server-migration, expresso-toolbar
---


# Question
Title: Updating ExpressionEngine 2.6 add-on variable PHP code for 2.11.6 compatibility
I'm having a little trouble updating a new client's pre-existing website from EE2.6 to 2.11.6. A now defunct add-on needs a few updates to work correctly with post 2.6 code formatting.

After some Googling I have replaced lines such as this one...

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

```

with a 2.11.6 compatible equivalent, i.e.

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

```

However, as a non add-on developer this particular part of the code has thrown me. Can you provide a suggestion as how I should format the following lines please.

```
$this->EE->cp->set_variable('cp_page_title', $data['event']['title']);
return $this->EE->load->view('event_details', $data, TRUE);

```

The "$data" part in the first line has thrown me, so I don't know how to format this correctly, and presumably it's being called in the second line.

Help greatly appreciated!

# Answer
You can create a function to set variable for backward compatibility like below :

```
function set_var($key, $val)
{
    if (version_compare(APP_VER, '2.6.0', '<'))
    {
        ee()->cp->set_variable($key, $val);
    }
    else
    {
        ee()->view->$key = $val;
    }
}

```

You can then use this function as below :

```
$this->set_var('cp_page_title', lang('rsvp_email_attendees'));

```

or

```
$this->set_var('cp_page_title', $data['event']['title']);

```

Check here for more information.
> 3 votes

---
Tags: ee2, add-on-development
---


# Question
Title: Freeform: pass variable to confirmation page
I have a freeform form with a text field with a value. Users of this form are not logged in and I need to pass the value of that field to a second confirmation page where I am building a paypal form. The passed value represents the amount to pay in the paypal form.

So on the Freeform:

```
<input name="amount" type="text" id="Amount" size="8" placeholder="$ amount"/>

```

and on the confirm page in a paypal form

```
    <input type="hidden" name="amount" value="{amount}" />

```

# Answer
I would pass the entry\_id in your return parameter.

```
return="group/template/%%entry_id%%

```

then use the freeform entries tag and specify entry\_id="{segment\_3}" with that you can then pull any data that was submitted.

```
{exp:freeform:entries entry_id="{segment_3}"}
<input type="hidden" name="amount" value="{amount}" />
...anything else you want to display from the submission
{/exp:freeform:entries}

```
> 0 votes

---
Tags: solspace-freeform, php, forms, variable
---


# Question
Title: Mulit Site Mananager for development sites
Is is possible to make use of EE MSM for development sites? So one site in the installation would be the live site, and the other the development site.

# Answer
It is possible but not recommended. As you know MSM site share same database, same tables only differ by site id. Now if you use same database for development site and do something strange and it causes DB effects, All effects can possibly affect the main site too as it share the same DB.

Instead of this, I suggest you to create exact copy of LIVE site with a sub-domain or under a new folder on main sites root folder to not list the DEV site in GOOGLE listing you can use robots.txt. **(Copy the LIVE site to make a same site DEV version will not violate EE licence terms.)**

All I want to say, Database of LIVE site and DEV site must not share the same database.
> 3 votes

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


title: Temaplate Routes Not Working

text:
# Question
Title: Temaplate Routes Not Working
According to EE3 documentation:

```
/name/{first_name}/{last_name}

```

with Require All Segments set to no should match

```
/name/Enrico/Fermi

/name/Enrico

/name/III

/name

```

I am trying to use a template route to find a segment\_1 parameter (such as a n language site /es/), so that my normal template is loaded at url:

```
/group/template_variable

```

and my language version is:

```
/es/group/template_variable

```

I created the route as follows:

```
/es/group/{template_variable}

```

and i have "reuaire all segments" set to NO.

currently, /es/group/example will match that route, and find the template correctly, but /es/group/ loads nothing (which it should still match per the EE documentation)

Am I doing something wrong here?

# Answer
The documentation for Template Routes is pretty lamentable, so not a surprise you are having difficulties.

Each template can have only one route to it, and equally each route definition can only link to a single specific template.

It is not clear from your question whether you plan to link all routes of form `/es/group/something` to the same template. If you do, you need to generalise the route definition to accept 'anything' in the third segment. Something like:

```
/es/group/{alpha_dash}

```

`{alpha_dash}` is one of the constructs you can use in a route to tell EE what to accept in a segment (in this case `alphabetic characters, 0 through 9, underscore, and dash`).

With this rule anything routing to `/group/template_variable` would be unaffected, but the `/es/` prefixed routes would only go to the template you put the route next to in the CP.

If you want a route to go to a specific (different) template depending on what is in segment 3 you'd need a different route instruction for each template - one for each template. So something like

route `/es/group/dogs` -\> to the spanish dogs template

route `/es/group/cats` -\> to the spanish cats template

As before, the /group/cats template etc. should continue to work fine with this route in place.

If you have multiple languages you can generalise these rules by replacing the `/es/` with a more general rule for that segment. If all of the language flags are two letter, and you have no two-letter template groups something like this might work:

`/{max_length[2]}/dogs` -\> routes all URLs of form /xx/dogs to /dogs

HTH
> 0 votes

---
Tags: ee3, template-routes
---


# Question
Title: can I put markup inside an iframe tag in a rich text field?
I need to support embedded tweets in Facebook Instant Articles. Oob the way to do that is to wrap Twitter's embed code `blockquote.twitter-tweet` in `figure.op-interactive iframe` (here's a link to Facebook's documentation, for reference) —

```
<figure class="op-interactive">
  <iframe>
    <blockquote class="twitter-tweet"...</blockquote>
  </iframe>
</figure>

```

I planned to add those wrapping elements via the "source" view of the rich text field, but when I save EE escapes the `<` and `>` inside the `iframe` as `<` and `>`

```
<figure class="op-interactive">
  <iframe>
    <blockquote class="twitter-tweet"...</blockquote>
  </iframe>
</figure>

```

Is there a way to include markup inside an iframe in the rich text editor?

Or does anyone have a favorite workaround? Or a plugin that could be added to this large existing site without adding tooo much migration overhead and without significantly changing the client's content entry experience?

This site is on EE 2.9 if that makes a difference.

# Answer
I solved something simulair with https://devot-ee.com/add-ons/low-replace, an addon from LOW. I wanted special markup for any `<a href` in the RTF field. It works like a charm!

In my case like this:

```
{exp:low_replace find="<a "
                 replace="<a class='lightview'
                            data-lightview-type='iframe'"
}
  {My_RTFText_Field}
{/exp:low_replace}

```
> 2 votes

# Answer
You shouldn't use rich text editor for this as it will convert the HTML tags for sure. Try using TextArea field instead.
> 0 votes

---
Tags: ee2, embeds, richtext, twitter
---


# Question
Title: Strange issue causing JS errors in Structure in EE Control Panel
Very weird issue this - never seen it before. When I access Structure in the control panel I'm getting javascript errors because something is cutting off the end of the Structure js files that the CP is accessing via the following type of URLS:

`/admin.php?S=0&D=cp&C=javascript&M=load&package=structure&file=structure-collapse`

Basically the end of the JS file is being shown as:

`})(jQuery`

rather than:

`})(jQuery);`

which is what the actual file has. So it isn't an issue with the Structure files not having been uploaded properly.

I've even tried reinstalling on another server, but same issue. I've also upgraded EE to the latest 2.10.3 version and installed the most up to date Structure version (3.3.19). Same issue.

I'm running on Ubuntu 14.4 with Nginx and PHP-FPM.

Anybody any ideas?

**Update:** I've been able to fix this... in the weirdest way. By adding a couple of line breaks at the end of the following Structure javascript files:

* jquery.ui.nestedsortable.js
* structure-collapse.js

That's it!

# Answer
I've been able to fix this... in the weirdest way. By adding a couple of line breaks at the end of the following Structure javascript files:

* jquery.ui.nestedsortable.js
* structure-collapse.js
> 0 votes

---
Tags: ee2, structure
---


# Question
Title: EE2 Structure and structure list closes prematurely
We are cleaning up an old client site, and I see that structure closes the tag halfway down our list of articles. The end result is that half of the page looks like this: https://dl.dropboxusercontent.com/spa/auu99oc6z1dn54z/8c2bknqf.png

When I inspect the code, I see that Structure, after a certain amount of entries, just closes the ul tag. https://dl.dropboxusercontent.com/spa/auu99oc6z1dn54z/nvto40\_h.png

Has anyone encountered this previously?

# Answer
> 2 votes
Something isn't right in your structure database. Deleting members and choosing the "delete all entries" option seems to leave the structure database in an inconsistent state. The structure folks include a tool for fixing this sort of thing.

First back up your database.

Then edit your\_ee\_root/expressionengine/third\_party/structure/mcp.structure.php And change

```
var $debug = FALSE;

```

to

```
var $debug = TRUE;

```

This will add a debug button in structure which can fix this issue. click debug and follow the instructions.

Don't forget to turn debug off when your done.

I found the solution in structure's support channel.

https://structure.tenderapp.com/discussions/problems/2339-structure-admin-page-not-working-correctly

# Answer
> 1 votes
For future reference, we would recommend upgrading to Structure 4. Structure 4 has the ability to fix this, where in Structure 3.x it would just drop the problem causing pages out of Structure. (Please note, upgrading to Structure 4 when this problem is present will give you the ability to fix the existing broken pages from an older installed version of Structure)

There also hasn't been a known case of this happening in Structure 4.

---
Tags: ee2, structure, admin
---


# Question
Title: Cannot convert exp_channel_data to INNODB
I’m currently coming against an issue with a large EE2 site that I’ve recently moved to EC2/RDS. To take advantage of the RDS snapshots and not risk data-integrity issues (as per Amazon Recommendation) with the DB Snapshot/Backups, we need to convert all tables to INNODB.

The problem is that my exp\_channel\_data table is baulking with an error `Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.`.

All other tables converted fine. We have around 215+ custom fields across the entire site, so that means we've got around 430(ish) columns in the `exp_channel_data` table.

Anyone come across this or does anyone have advice on how to fix? Google suggests doing some my.cnf changes etc - but RDS doesn’t give me this (or console access), so I'm at a bit of a loss as to how I can sort this.

Looking at the datatypes of all the columns, none of them are particularly large - EE mostly creates fields with datatype of `TEXT` and `TINYTEXT` \- but I have some in there with Decimals and/or INT.

# Answer
> 1 votes
After spending some months on this exact problem (we have 360 or so custom fields), here's what I've learned:

* RDS snapshots are only consistent for InnoDB tables.
* Converting `exp_channel_data` to InnoDB is possible, but only if innodb\_page\_size is large enough (in my case 32k or 64k), but this parameter is not available in RDS because it needs to be set before the database is created, not after. (I tested this using Docker.) A feature request has been made to AWS.
* You cannot split the table into smaller chunks (a vertical partition) and combine them with a view because you cannot add columns or rows to such a view.
* Designing the table as row based, rather than column based is in my opinion the best option (minimal space, simple to add a row, no schema changes anymore), but the source-code impact inside EE is prohibitive since every developer accesses this table differently. Ellislab are aware of the issue and there appears to be some interest in solving this since it was first raised in March 2011.
* At present my work-around^, subject to issues^^ outside the scope of this question, is to create a mysqldump of `exp_channel_data` every hour and if the need arises, restore the RDS snapshot and then the mysqldump.

^ I'm also looking at `FLUSH TABLES WITH READ LOCK` and then doing an RDS snapshot manually instead of using mysqldump, but this depends on Meta Data - see below. That way I'll get the whole database in one go and I'll know what it's called.

^^ The issues relate to Elastic Beanstalk deploying RDS and being able to determine which snapshots belong to the RDS instance that is currently running. In essence getting Meta Data from Elastic Beanstalk.

---
Tags: ee2, database
---


# Question
Title: Is it Possible to Host Forum Avatars and Uploads on S3
**Does anybody know of a method to override/alter EE's native avatar uploading functionality (without hacking core) to upload to S3?**

I've got a client site running on AWS' Elastic Beanstalk service, utilizing RDS for the DB storage, S3 and Cloudfront for all of the site's image content.

The client is wanting to launch forums as a new feature on the site, and while our existing infrastructure is well-suited for this, my main concern is user-uploaded images, like avatars or even custom image uploads.

Ideally I'd like to find some way to store these within an S3 bucket, since our EC2 instances only contain the site code, and anything uploaded to one server in the cluster won't be visible to the others, and will disappear when that instance gets terminated in the future for whatever reason.

*Side note: I've heard it suggested that I instead create an independent EBS volume, and update my default AMI to mount that volume at startup so that all my instances will have access to the file store. I'd prefer to go the S3 route instead for performance reasons.*

# Answer
> 1 votes
You can set file upload paths and preferences in your EE config.php file which *should* support a remote location like S3. You also have control over paths for avatars and user uploads here too. I set them by standard in my config:

```
// Member paths and URLs
$config['avatar_path']                  = $base_path . "/images/avatars/";
$config['avatar_url']                   = $base_url . "/images/avatars/";
$config['photo_path']                   = $base_path . "/images/member_photos/";
$config['photo_url']                    = $base_url . "/images/member_photos/";
$config['sig_img_path']                 = $base_path . "/images/signature_attachments/";
$config['sig_img_url']                  = $base_url . "/images/signature_attachments/";
$config['prv_msg_upload_path']          = $base_path . "/images/pm_attachments/";

// Image paths and URLs
$config['captcha_path']                 = $base_path . "/images/captchas/";
$config['captcha_url']                  = $base_url . "/images/captchas/";
$config['emoticon_path']                = $base_url . "/images/smileys/";

```

I don't see any reason why you couldn't set a remote location to your S3 drive.

# Answer
> 1 votes
Two ways:

1. You could mount s3 using `s3fs-fuse`^ onto your structure, so EE would experience it as a local file-system and the URL could be the s3 bucket URL.
2. Another way is to use `aws s3 sync`^^ to synchronise the upload/media folder with s3, that way EE just uses the local file-system and your visitors use s3.

^ https://github.com/s3fs-fuse/s3fs-fuse

^^ http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

---
Tags: ee2, forum, s3
---


# Question
Title: EE3 CP Overview page and removing the "ExpressionEngine News" block
How does one remove certain blocks from the CP overview page particularly the "ExpressionEngine News" block.

# Answer
it's in the member group settings:Show news on CP homepage
> 0 votes

---
Tags: control-panel, ee3, cpanel
---


title: External Website Post to EE Entries

text:
# Question
Title: External Website Post to EE Entries
I have never worked with another Third Party System before that prefers to push data to me than provide an API to just pull that data down as needed - but they have their reasons they say!

On that basis they say they typically use a basic method of the client providing a form to which they post the data each time. Now this means they post direct to the form submission URL - so my initial thought was channel forms - but then i remembered XSS and how this will prevent it. So is there a way to disable XSS token checks specifically for a single form, or just site wide (which i would prefer to avoid).

If not - i will use addon to create a REST api on the EE end and get them to submit to that. Does anyone have any experience with such a addon as: http://docs.reinos.nl/webservice/#introduction

Thanks, N

# Answer
In this case, the POST submission would be rejected not due to XSS, but CSRF. It's not an appropriate API to use for continuous submission from an external source.

I haven't used Reinos' add-on, but depending on the third-party's flexibility, their aptitude, and your custom field requirements, it's possible that your needs would be covered by the native Metaweblog API. You would install it and configure a specific endpoint for them to use. They would send a Metaweblog API compatible request to that URL, which would be exempted from CSRF protection, and use its own authentication.
> 3 votes

---
Tags: safecracker, api, rest
---


# Question
Title: Solspace User welcome email no longer being sent after upgrade to EE3/User 4.0.8/PHP 5.6.21
Our webhost upgraded PHP, so we had to upgrade our EE install from 2.7.3 to 3.5.2. With that process we also upgraded the Solspace User module from 3.4.5 to 4.0.8. PHP is now at 5.6.21 CGI(Stable).

New registrants must be manually approved by the admin. In the older version of EE, when you approved a member, there was a "send member activation email" box we had to uncheck because it would send both the User welcome email AND the default EE activation email, which we didn't need.

Now that box/option is gone, and approving the member does not kick off the User welcome email. The user receives nothing. I verified that "Notify Members When Approved" is set to yes. \[EDIT: previously I posted that the default EE activation email didn't arrive either, but it finally did. So the normal EE function is working.\]

Is there something about the new PHP that could be tripping things up, or does EE3/User4 expect PHP 7 (which we can upgrade to if needed) ?

# Answer
I can duplicate this issue on my end as well. It seems that the Welcome Email feature only works on "No Activation" and "Self Activation" methods, but not on "Manual Activation".

A "workaround" for now would be that you can just use the EE notification option to send the user a confirmation email instead. The template (to adjust what it says) for it is here:

Template Manager -\> Email -\> User – Account validation notification
> 3 votes

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


# Question
Title: Auto add Images to entry after ftp to server
I have a potential client (car dealership) where in their existing 12 year old site they daily upload an Excel file to add/update/delete vehicles in stock. One file for new vehicles and one for used.

However the excel file does not have a column for images and they are unwilling/unable to add one. Instead they want images to be added in the same way they currently are.

All images are ftp'd up to the server and are named ##\_stocknumber so 01\_12345, 02\_12345, 03\_12345 would be attached to the same entry but 01\_4455, 02\_4455, 03\_4455, 04\_4455 would be attached to a different entry. After upload the go to a link that processes the images and then emails any stock numbers that are missing images.

Is there some way that this can be achieved in ExpressionEngine?

# Answer
> 0 votes
As the number of files (IMG) will never be known you are always going to be fighting a losing battle.

However, if you are aware of the max number of img per entry and you have the unique identifier already in the entry you could just do a hardcoded list like

```
<img src="01-{field-with-id}>
<img src="02-{field-with-id}">
<img src="03-{field-with-id}">

```

This may produce unwanted results but with no way of knowing how many images to expect in the parent entry you're going to have, your hands are tied.

Even if you were able to sync the images into EE, it would be for naught as your entries have NFI that they exist.

Your client has to be willing to tweak the source info, even if it's just a total number of images - this is not a limit of the CMS it's a limit of info supplied.

---
Tags: image, how-to
---


# Question
Title: Multiple low search fields that work together
I have 2 input fields that users can use to search.

The first field is for searching job application titles.

The second field is for searching the job application's field of expertise.

If the first field is filled in the outcome should be based on the first field only. If the second field is filled in the outcome should be based on the second field only.

When both are filled in they should work together in filtering the search words that are entered in the fields.

```
<div class="zoekvelden">
        {exp:low_search:form
          result_page="zoek/vac-resultaten"
          collection="vacatures"
          exact="vacature|vakgebied"
        }
        <div class="zvacature">
            <h2>Zoek op vacature</h2>
            {!-- <input type="hidden" name="collection" value="5"> --}
            <input type="search" name="vac:vacature" placeholder="bijv. {vacatures_functie_titel}">
        </div>
        <div class="zvakgebied">
            <h2>Zoek op vakgebied</h2>
            {!-- <input type="hidden" name="collection" value="6"> --}
            <input type="search" name="vac:vakgebied" placeholder="bijv. {vacatures_vakgebied}">
        </div>
        <button type="submit">Gaan!</button>
        {/exp:low_search:form }
    </div>

```

This is what I have so far on the input side. I actually made 2 collections that I wanted to use: 'vacatures' and 'vacatures\_vakgebied' but I haven't made it that far because I can't even get 1 collection to work.

I also found this question and I tried the same method as he was using and what was suggest he should do.

Still no luck.

```
{exp:low_search:results query="{segment_3}" alias:keywords="vac"}
                {if count ==  1}

                <p>U zocht naar: <i>{exp:low_search:param get="vac" query="{segment_2}"}</i> ({total_results} resultaten)</p>
                <br/><br />
                <div class="vac">{/if}
                  <div class="icon">
                      <i class="fa {vacatures_font_awesome}"></i>
                  </div>
                  <div class="info">
                      <h2>{vacatures_functie_titel}</h2>
                      <p class="blauw"><span class="blauw">Plaats: </span>{vacatures_plaats}</p>
                      <p><span class="oranje">Niveau: </span>{vacatures_niveau}</p>
                      <p class="blauw"><span class="blauw">Uren p/w: </span>{vacatures_uren_p_w}</p>
                      <p><span class="oranje">Vakgebied: </span>{vacatures_vakgebied}</p>
                      <div class="margin_bottom5">
                          {exp:eehive_hacksaw words="32" allow = "<br>"}
                          {vacatures_functie_omschrijving}
                          {/exp:eehive_hacksaw}...
                      </div>
                      <a href="{url_title}" class="button">Lees verder</a>
                  </div>
                {if count == total_results}
                </div>{/if}
                <div class="divider_line8 nomargin"></div>

                {if no_results}
                <div class="whoops">
                  <h2>Excuses</h2>
                  We hebben helaas geen resultaten gevonden voor uw zoekopdracht. Probeer het nog eens met een andere zoekopdracht.
                  {exp:low_search:suggestions keywords="{low_search_keywords}" keywords:lang="nl" limit="2"}
                    {if suggestion_count == 1}Bedoelt u:{/if}
                    <a href="{low_search:url keywords="{suggestion}"}">{suggestion}</a>{if suggestion_count != total_suggestions} of {if:else}?{/if}
                    {if no_suggestions}Controleer de spelling of probeer een nieuwe zoekopdracht.{/if}
                  {/exp:low_search:suggestions}

                  {/if}
                </div>
              {/exp:low_search:results}

```

This is the output. It should retrieve the entries that have the mentioned search words in the title or in the entry description. But instead it gives me all the search results as if it doesn't look at the collection it should be using.

Thank you for taking the time reading my question any help is much appreciated!

# Answer
> 3 votes
First of all, the general setup of your search form could be better to work correctly with Low Search. You’re targeting 2 different collections using two different fields. Instead of that, I’d opt for a single input field and a drop down to select the collection. Something like this:

```
{exp:low_search:form result_page="zoek/vac-resultaten"}
    <input type="search" name="keywords">
    <select name="collection">
        <option value="5">Vacatures</option>
        <option value="6">Vakgebieden</option>
        <option value="5|6">Beide</option>
    </select>
    <button type="submit">Zoeken</button>
{/exp:low_search:form}

```

Note that you *do not define any filter parameters in the Form tag* (read this carefully). In your case, that means the `collection` parameter (moved to an input field in the form) and the `exact` parameter (part of the Field Search filter and not relevant here, since you're using the Keywords filter instead).

Also note that you should use `name="keywords"` to trigger the Keywords filter. You could also use an alias, but the way you've implemented it is wrong. You could use `name="vac"` for your keywords, and then use `alias:keywords="vac"` -- where the value of both parameters *are exactly the same*.

Then, your Results tag. You're pointing to `query="{segment_3}"`, which makes sense when you're using `result_page="zoek/vac-resultaten"` in the Form tag. However, in the first conditional, you want to output the keywords using the Params tag, which points to `{segment_2}`. That won't work, and isn't necessary either. You could just use `{low_search_keywords}` to output the given keywords. Like you're using in the Suggestions tag.

Finally, make sure your collections have at least one field with weight \>= 1.

---

---
Tags: low-search
---


# Question
Title: What is causing this cartthrob orders edit date formatting issue
Version Info: EE 3.4.5 Cartthrob Pro 3.0.2

While looking at my admin CP today, I noticed that all cartthrob placed orders have some really strange edit dates. While the exact cause is unknown to me, I can clearly see that the problem is being caused by how the edit date is being added to the DB.

For example, for a newly created order, the entry date in the DB is a standard 10 digit Unix timestamp. i.e., 1487232589. However, the edit date is added to the DB as YYYYMMDDHHMMSS. i.e., 20170216171049

Please note that this happens for all new entries. Upon actually opening and editing an entry via the CP, the edit date is corrected to a Unix timestamp.

# Answer
> 2 votes
I have spoken with Vector media about this issue and it has been determined to be a bug that resulted due to changes in the date functions from EE2 to EE3. This issue should be addressed in future releases of Cartthrob.

The actual cause of the difference in dates is below:

/cartthrob/models/cartthrob\_entries\_model.php has a public function (starting LINE 212) for create\_entry.

LINE 235 and LINE 236 are the date fields. entry\_date is localized time but edit\_date is (YmdHis).

---
Tags: cartthrob, entry-date, orders, edit-date
---


# Question
Title: Conditional for empty relationships field
I’ve run into an issue where I need to conditionally show content if an EE relationship field is empty. However the {if relationship-field} conditional is not working. Nor is any variation of that such as {if relationship-field == ""} or {if "{relationship-field}" == ""} or {if "{relationship-field}" != ""}. No dice on any of these.

# Answer
> 17 votes
The solution turns out to be fairly simple and the logic can pretty much work the same. EE relationship fields let you pull the count separately from the tag pair like this:

```
{relationship-field:count}

```

So, the solution is to use that in our conditional logic:

```
{if "{relationship-field:count}" == ""}
    do stuff
{if:else}
    do relationship stuff
{/if}

```

# Answer
> 10 votes
Long time to add to this but...

```
{relationship-field}
  do relationship stuff
  {if relationship-field:no_results}
    Empty stuuf
  {/if}
{/relationship-field}

```

# Answer
> 0 votes
I would like to add the following also works:

```
{if "{relationship_field:count}" == 1}
Do relationship stuff
{/if}

```

In my case, I only want to display formatted content if there is relationship data:

```
{if "{bk_author:count}"=="1"}
<h5 class="small">by {bk_author backspace="2"}<a href="/author/{bk_author:url_title}">{bk_author:title}</a>, {/bk_author}
</h5>{/if}

```

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


title: Display Content Based on Time of Day

text:
# Question
Title: Display Content Based on Time of Day
I'm trying to show content based on the day *and* time of day. Specifically, the site I'm working on offers a live-stream every Sunday from 9:45 - 1:45 and we want to feature the live-stream on the homepage while it is live.

I have created a channel called "featured" which has an entry called Sunday. Using the following code, I can show the Sunday entry on Sunday.

To display the entry at a particular time, I created a Start Time and End Time field. Using that, I can display what I need to during the specified time.

The problem is that the entry has to be updated weekly to have the correct date. Is there a way to use start\_time and end\_time without a date? Or, every Sunday? Or, only Sunday?

```
    {exp:channel:entries channel="featured" url_title='{current_time format="%l"}'}
    {if current_time > start_time && current_time < end_time}
      <img src="{live-stream-image}">
    {if:else}
    <img src="{standard-image">
    {/if}{/exp:channel:entries}

```

As I said, this works but I'd like to not have to touch the entry each week to update the date. I'm not opposed to some other workflow, PHP, etc.

Thanks for any advice.

# Answer
> 3 votes
Thanks to @Nevsie-Modeten, I reworked the query to the following:

```
{if {current_time format='%w'} == 0 &&
    {current_time format='%G%i'} >= 930 &&
    {current_time format='%G%i'} <= 1230
}
    Content to be displayed during this time.
{if:else}
    Content to be displayed during other times.
{/if}

```

This checks the day and time and displays content appropriately. Using this method, I was able to eliminate the `start_time` and `end_time` channel fields that I created.

Thanks for taking the time to look and providing input!

---
Tags: channel, date
---


title: htaccess rule for url with dot

text:
# Question
Title: htaccess rule for url with dot
A development installation has been set up for me that has cloned an existing site. However, the `.htaccess` file no longer works to remove `index.php`.

Could this be because there is a dot in the URL? If so how can I fix it?

So the URL is formatted like this http://www-dev.domian.com/

And the htaccess file like this:

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{HTTP_HOST} !www-dev\.domian\.com/$ [NC]
    RewriteRule ^(.*)$ http://www-dev\.domian\.com/$1 [L,R=301]

    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

```

# Answer
This cannot because the dots in the URL. First need you should check is `mod_rewrite.c` module is enable to your server or not. If yes, You need to alter your `.htaccess`. Try the following last line of your code from

```
RewriteRule ^(.*)$ /index.php?/$1 [L]

```

To

```
RewriteRule ^(.*)$ /index.php?/$1 [L, QSA]

```
> 1 votes

---
Tags: htaccess, index.php
---


# Question
Title: Grid field not saving any data regardless of what I put in it
Fresh install of EE 3.4.4

Created a channel and channel fields. Grid field has two subfields: one text input and one text area. When I publish a channel entry in this channel, all the other fields save just fine but this Grid field clears out and goes back to no rows when I save the channel entry. No errors, no nothing. It just doesn't save anything.

# Answer
> 1 votes
So, the answer here was exactly what Zenbuman noted: it was the version of PHP. We upgraded to PHP5.4.5 on the server and no more problems.

Yay!

---
Tags: grid, ee3
---


title: Retrieve #anchor in url

text:
# Question
Title: Retrieve #anchor in url
Is it possible to get the #id anchor in the URL?

EG: https:www.domain.co.uk/page#anchor

I see url helper has something called {fragment} but It doesnt output anything?

Any help greatly appreciated.

# Answer
I know this is possible with JavaScript location.hash but I don't think EE segment tags or php can do it easily if at all.

Please reference the location hash documentation here. https://www.w3schools.com/jsref/prop\_loc\_hash.asp
> 0 votes

---
Tags: url
---