# Question
Title: How to minify HTML, CSS & JS in ExpressionEngine 3?
With the increasing relevance of website performance on mobile (see Google's upcoming mobile-first index for example) I'm looking for a way to minify the HTML that EE outputs.

I know that there's various plugins available for EE2 (such as https://devot-ee.com/add-ons/minimee) but can't find any for EE3.

Any advice on how others have managed this would be appreciated.

If the solution also manages minification of CSS & JS files that would be a bonus.

Thanks in advance,

Tom

# Answer
There is a version of Minimee that will run in EE3 - you need to get it from Github rather than Devotee, and I'm not sure it is an official release, but I can confirm it works fine.

https://github.com/johndwells/Minimee/tree/version3

FWIW, it also appears to work OK in EE4

HTH
> 4 votes

# Answer
If you don't found any plugin for EE3, Why don't you just convert EE2 version minimee to EE3?

Do as given below:

1. Download EE2 version of minimee v2.1.13.
2. Create `addon.setup.php` in plugin folder and put this data inside it.

```
<?php
return array(
    'author' => 'John D Wells',
    'author_url' => 'http://johndwells.com/software/versions/minimee',
    'description' => 'Minimee: minimize & combine your CSS and JS files. Minify your HTML. For EE2 only.',
    'docs_url' => 'http://johndwells.github.com/Minimee',
    'name' => 'Minimee',
    'settings_exist' => true,
    'version' => '2.1.13',
    'namespace'   => 'EllisLab\Addons\Minimee',
);

```
3. **Important step if you are using PHP7** Open each and every PHP files of minimee plugin to remove: `$this->EE =& get_instance();` and replace all instance of it from `$this->EE` to just have `ee()` (This step is important for PHP7 because PHP7 not accept variable as references.)
4. Open your config file and add below code:

```
$base_path = rtrim($_SERVER['DOCUMENT_ROOT'], "/");
$base_url = "http://" . $_SERVER['SERVER_NAME'];
$config['minimee'] = array(
    /*Set path to your DOCUMENT_ROOT/cache directory*/
    'cache_path'        => $base_path .'/cache',
    'cache_url'         => $base_url .'/cache',
    'combine_css'       => 'yes',
    'combine_js'        => 'yes',
    // minify JS
    'minify_css'        => 'yes',
    // Minify HTML
    'minify_html'       => 'yes',
    // Minify JS
    'minify_js'         => 'yes',

    // Set this parameter to yes if you want to disable minimee (I use this for development purpose)
    'disable'           => 'no',
    'base_path'         => $base_path,
    'base_url'          => $base_url,
    'cachebust'         => '',
    'cleanup'           => 'yes',
    'css_library'       => 'minify',
    'css_prepend_mode'  => 'yes',
    'hash_method'       => 'sha1',
    'js_library'        => 'jsmin',
    'remote_mode'       => 'fgc'
);

```

5. Save all files after edits and Install plugin from backend.
    6. You are ready to use minimee now. You can use documentation from this Link

Note: When I try to use template css to minify, It was not working fo me. For an example:

If I use:

```
<link rel="stylesheet" type="text/css" media="all" href="{stylesheet=includes/style}">

```

This was not works for me. Then I copy the css under css directory and call it as normal css that works for me:

```
<link rel="stylesheet" type="text/css" media="all" href="/css/styles.css">

```
> 2 votes

---
Tags: css, html, js
---


# Question
Title: EE2: How to use the {template_group} variable or how to get value of template group in a template?
I am confused about the usage of the mentioned variable. It should be plain and simple... but for some reason, I can't get it to work.

Documentation link for EE3: https://docs.expressionengine.com/v3/templates/globals/single\_variables.html#template-group

**I want to use the template group name in my templates, is there any way to make this possible in EE2?**

# Answer
> 1 votes
I think you are mixing up versions of EE.

`{template_group}` is not a standard global variable in EE2, so not a surprise that it doesn't work.

For a full list of Global Variables that work in EE2 see here: https://docs.expressionengine.com/v2/templates/globals/single\_variables.html

HT

---
Tags: global-variables
---


# Question
Title: How to pull {category_url_title} from related content
Wondering how I can pull {category\_url\_title} back from a Matrix field `{recipes-related}` that uses PLAYA related entries for `{left}` and `{right}`. I have this but doesn't pull the Category URL Title back so that I can build up the url.

```
{exp:channel:entries channel="{recipes_channel}" category_group="1" url_title="{last_segment}" dynamic="no" limit="1"}
    {recipes-related}
        {left}
            <a href="{path="{channel_url}/{categories}{category_url_title}{/categories}/{url_title}"}">
        {/left}
        {right}
            <a href="{path="{channel_url}/{categories}{category_url_title}{/categories}/{url_title}"}">
        {/right}
    {/recipes-related}
{/exp:channel:entries}

```

# Answer
> 0 votes
`{category_url_title}` is only defined within the `{categories}{/categories}` tag pair variable (or within an `{exp:channel:categories}` tag pair).

In your left / right sample code you don't open the `{categories}` tag pair before trying to retrieve the `{category_url_title}`, and so it fails.

In your second bit of code you explicitly open a `{categories}` tag pair, which explains why you get the `{category_url_title}` returned.

Perhaps something like this is what you need:

```
{left}
    <a href="{path="{channel_url}/{categories}{category_url_title}{/categories}/{url_title}"}">
{/left}

```

HTH

---
Tags: categories, matrix, playa, category-group
---


title: File Download from File Manager

text:
# Question
Title: File Download from File Manager
I need to download all the files I have uploaded to my site. It will take forever for them to download through the file manager. What is the best way for me to get them downloaded and how?

# Answer
EE3+4 have an option to export all files in the file manager. If you run into memory issues you may want to just use the alternative below.

For EE2 it might work best to use FTP to archive the folders into a zip file.
> 0 votes

---
Tags: file-uploads, multi-site-manager, file-manager
---


# Question
Title: How to use an SQL query to display entries from last 45 days
I'm using the following SQL query to populate a filter form for a jobs site. The query displays all locations used in the jobs listed on the site.

I'm only displaying jobs up to 45 days old on the site BUT the query is showing locations for ALL jobs, even those over 45 days old.

Does anyone know how I could amend this query to only show job locations from jobs that are 45 days old or less?

```
{exp:query sql='
    SELECT DISTINCT field_id_19
    AS job_location
    FROM exp_channel_data
    WHERE field_id_19 <> ""
    ORDER BY job_location
'}
    <option value="{job_location}" {if super_search_job_location == "{job_location}"}selected="selected"{/if}>{job_location}</option>
{/exp:query}

```

Thanks in advance,

Tom

# Answer
> 3 votes
You can try below query to display entries of last 45 Days.

```
SELECT DISTINCT field_id_19 AS HomeTitle FROM exp_channel_data t1 INNER JOIN exp_channel_titles t2 ON t1.entry_id = t2.entry_id WHERE t1.field_id_19 <> "" AND ((UNIX_TIMESTAMP() - t2.entry_date) < 3888000)

```

---
Tags: query, sql, query-module
---


title: Change URL for MSM site

text:
# Question
Title: Change URL for MSM site
I have an MSM site setup but need to change the domain name. I have the new domain name setup and moved the site files to the new domain directory.

I also updated the URLs in the control panel & in the admin.php & index.php files but it does not work. When I visit the new URL, I get the following message: Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

But the path is correct. What am I missing?

Thanks for any help.

EDIT: Actually, the path was incorrect. I fixed it and now get the Site Error: Unable to Load Site Preferences; No Preferences Found message.

# Answer
Figured it out. Unbeknownst to me, the host was requiring a database user password update. Not sure why it only effected the new site since all other sites were able to communicate with the database.

Once I updated the password, everything worked fine.
> 0 votes

# Answer
To change the URL in MSM site you need to change in below variables in `index.php`.

```
$assign_to_config['site_name']  = 'domain2_short_name';
$assign_to_config['cp_url'] = 'http://domain2.com/admin.php';
$assign_to_config['site_url'] = 'http://domain2.com';

```

If you need to change domain name then you should change `$assign_to_config['site_url'] = 'http://new_domain2.com'` and `$assign_to_config['cp_url'] = 'http://new_domain2.com/admin.php'` according to your new Domain name.
> 0 votes

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


title: Change Logout Url

text:
# Question
Title: Change Logout Url
I have **EE 4.0.9** , when members logout from their accounts , the logout path redirect them to home page automatically ,how can i change the redirect link when members logout.

# Answer
> 0 votes
I think you should try after updating the `CP session type` to `Session ID only`. You can change it from `Settings >> Security & Privacy`.

---
Tags: logout, ee4
---


title: Google Maps plugin: API error

text:
# Question
Title: Google Maps plugin: API error
I've got a long running EE install that uses the old Google Map plugin.

Lately though, we've been seeing this error in the CP

```
you have exceeded your daily request quota for this API

```

I've seen one other dev see similar - wonder if anyone else has and has a fix?

# Answer
If seems like you have exceeding the free **(Free until exceeding 25,000 map loads per 24 hours)** usage limits, now you need to go for Premium Plan.
> 0 votes

---
Tags: google-maps-for-ee, google-maps, api
---


title: EE4 & Gmaps Plugin

text:
# Question
Title: EE4 & Gmaps Plugin
This is the error I am getting when trying to install Gmaps by Reinos on EE4.

I'm getting a similar error when trying to install the Gmaps Data Plugin on EE4 as well.

# Answer
You need to change a little in code at **line 230** in `upd.gmaps` of your plugin directory.

```
'constraint' => '255' to 'constraint' => '191'

```

This need to change from **255** to **191** because there is `INNODB utf8mb4`.
> 3 votes

---
Tags: error, google-maps-for-ee, ee4
---


# Question
Title: WYVERN not showing images due to relative paths (Multi Site Manager, EE2.11.7)
I've got a secondary site using WYVERN. Everything works fine, and when I insert an image, WYVERN puts

```
/files/imagePath/image.gif

```

In the code. So the code is correct, but since I am viewing the EE control panel from the primary site's URL, the image doesn't appear within WYVERN.

Is there some setting I can change in Assets or elsewhere that will prepend *secondary-domain.com* within WYVERN so the image appears?

\[EDIT\] Adding to the complexity - this site needs to run over SSL or non-SSL (allowing for visitors in China and other unfree places to access). So code output on the website needs to be relative, i.e., `/path/img.gif`

not

```
http://domain.com/path/img.gif

```

# Answer
> 1 votes
Here's a trick:

This allows the CMS to serve files over SSL or non-SSL, depending on whatever protocol is in use.

---
Tags: assets, multi-site-manager, wyvern
---


# Question
Title: Why is the OR not working in a conditional statement?
Running EE 3.5.15

I am trying to show content based on URL segment and the following is not working correctly:

```
 {if "{segment_2}" != "portfolio" || "{segment_2}" != "photos"}
  <p>Conditional content.</p>
 {/if}

```

If I use one of the conditionals by itself it works correctly, but when I introduce the OR into it, it fails.

I have tried the following:

```
{if "{segment_2}" != "portfolio" OR "{segment_2}" != "photos"}

```

and

```
{if segment_2 != "portfolio" || segment_2 != "photos"}

```

I have also tried it with single quotes.

Any suggestions on this elementary issue will be appreciated.

# Answer
Well here is the issue. You are trying to give OR condition for 2 strings. OR condition will return true if any one of the given statements are true.

If you want to execute the code when url\_title not equal to "portfolio" neither equal to "photos" use this condition:

```
{if segment_2 != "portfolio" && segment_2 != "photos"}
    <p>Conditional content.</p>
{/if}

```

Or as a simle way:

```
{if ! "portfolio|photos" *= segment_2}
    I am here
{/if}

```
> 4 votes

# Answer
You should try your code in below manner.

```
{if ! 'portfolio|photos' *= segment_2}
    <h1>Conditional content.</h1>
{/if}

```

You can also try in another way also.

```
{if segment_2 == 'portfolio' OR segment_2 == 'photos'}
{if:else}
    <h1>Conditional content.</h1>
{/if}

```
> 3 votes

# Answer
Try

```
 {if segment_2 != 'portfolio' OR segment_2 != 'photos'}
        <h1>Conditional content.</h1>
 {/if}

```

I've just tested, it works fine.
> 0 votes

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


# Question
Title: Output categories from a CatGroup, as 'group/list' of category related entries EEv2.9
New to EE overall but trying to output 'lists' of category specific entries within a specific category group. Essentially the logic I think I need is: 'for *unique* each category in categoryGroup output entries with associated category as a group/list of entries'

Low-reorder plugin sets can be created and are used elsewhere but this doesnt seem to get me where I want to go with regards to the output.

Any advice/code snippets would surely be appreciated.

\[Category Hierarchy\] -Category Group \- Cat 1 \- Cat 2

\[Ideal Output\] \- Cat 1 Name \- entry A \- entry B \- Cat 2 Name \- entry A \- entry C

Thanks in advance.

# Answer
> 0 votes
You want something like this:

```
{exp:channel:categories channel="xxx" show="x|y|z" style="linear"}
   <h1>{category_name}</h1>
   <ul>
   {exp:channel:entries channel="xxx" category="{category_id}" dynamic="no"}
      <li>{title}</li>
   {/exp:channel:entries}
   </ul>
{/exp:channel:categories}

```

Clearly you will need to add your own information - vis replace "xxx" with your channel name - and if you only want a limited number of categories put the category numbers you want in the 'show' parameter in place of x, y, z etc.

HTH

---
Tags: categories, low-reorder
---


# Question
Title: How to achieve desired URL structure: /category/entry/
I am trying to achieve the following URL structure:

* website.com/services/design/
* website.com/services/design/branding/
* website.com/services/development/
* website.com/services/development/front-end-development/

Where:

* /services/ is the channel index
* /services/category/ is a category for this channel
* /services/category/entry/ is a channel entry

And just to clarify, /services/entry/ would not work, the /category/ would be required to view an /entry/.

Has anyone used a similar setup before or know how to?

Thanks in advance.

# Answer
You need 3 templates`(index, .landing, .detail)` under `services` template group.

**index.html**

```
{if segment_3}
    {if segment_3 ~ "/^P\d+/"}
        {!-- Pagination state --}
        {embed="services/.landing"}
    {if:else}
        {embed="services/.detail"}
    {/if}
{if:else}
    {embed="services/.landing"}
{/if}

```

**.landing.html**

```
{exp:channel:entries channel="services"
    {if segment_2_category_id} category="{segment_2_category_id}" {/if}
    disable="category_fields|member_data|trackbacks|relationships" dynamic="no" limit="10" paginate="bottom"
}
    {categories}
        <a href="{category_url_title}/{url_title}"><h1>{title}</h1></a>
    {/categories}
{/exp:channel:entries}

```

**.detail.html**

```
{exp:channel:entries channel="services" category="{segment_2_category_id}" disable="category_fields|member_data|pagination|trackbacks|relationships" dynamic="no" url_title="{segment_3}"}
    {if no_results}{redirect="404"}{/if}
    <h1>{title}</h1>
{/exp:channel:entries}

```

You need Low Seg2Cat for getting the `segment_2_category_id` based on URL. First you should download from above link and install then go ahead with my suggested code.
> 1 votes

# Answer
I have something similar to what you describe running here \- the URL heavy lifting is done via these segments:

```
resources/case-studies/case-study-13-asian-financial-corporation

```

where `resources` is the channel, `case-studies` the category, and `case-study-xxx` is the post.

I've also set it up so that all categories / posts in the resources channel (there are 19 in use - so `resources/faqs` etc.) use the same shared template. To do this I use Template Routes, the Layouts system, and Low's very handy seg2cat add-on.

It works like this:

* I've created a template group for each channel / category combination - so for example there is one called `resources-casestudies.group` \- each with a single index.html and post.html template in.
* I've created two Template Routes for each channel / category combination that each point to the appropriate templates in the relevant template group. So there is a template route that points `/resources/case-studies` to the `resources-casestudies.group/index.html` template, and a second that points `/resources/case-studies/{post:alpha_dash}` to the \`resources-casestudies.group/post.html' template. For the second route you need to tick the 'segments required' flag.
* The two templates in each channel-category template group each simply contain a single layout variable pointing to one of two common / shared templates - vis `resources-casestudies.group/index.html` contains simply one line - `{layout="shared_templates/_resources-cat-index"}`, you can guess the one for the post template...

The shared templates work like this:

* The `index` template uses Low's seg2cat to get information about the category (i.e. so we can list all the relevant resources in the category). So most of the information comes from the category definition (I've added some fields to capture extra stuff) driven by this call: `{exp:channel:categories style="linear" show="{segment_2_category_id}"}` \- the seg2cat allows you to use the category `url_title` in the URL rather than a category number, but remember to do this you need to set the **Category URL** setting to **title** which you do in the "URL and Path Settings" area of the System Settings CP. I actually get the rest of the listing information (i.e. the list of posts in this category) via a Low Reorder call to a reorder set with the same name as the category url\_title (so `{exp:low_reorder:entries set="{segment_2}"}`, as this allows me to order the category entries in whatever sequence I want, but there are other ways to get this information too.
* The `post` template uses a simple channel:entries call to get the information relating to the relevant posting - vis: `{exp:channel:entries channel="resources" url_title="{segment_3}" dynamic="no"}` \- NB - `dynamic="no"` is important here as you don't want EE trying to work out what to show you from the URL...

**Caveat**

It should be possible to write a super-generic pair of **Template Route** entries that route all the index and post calls for any resource/category pair to the same two shared templates. Something like:

`/resources/{cat:alpha_dash}/` pointing to the shared index template

and

`/resources/{cat:alpha_dash}/{post:alpha_dash}` pointing to the shared post template

While this approach is consistent with the documentation, and worked at one time, turns out the **Template Routes** system got broken around about the time EE3 came out (so these generic routes don't work on late EE2 systems or EE3). I spent a long time (and burnt my 'free' Ellis support request) on trying to find a fix, only to be told by Ellis that fixing it would break something else in Template Routes, and so no fix was due in EE3 at least. To be honest I've not tried to EE4 to see if it works again now. It might do: in the interim the indirect fix of creating one template group for each channel / category pair works on my system (as there are only 19 categories, and these change rarely) but would be impracticable for any system with many categories, or categories that change frequently.

FWIW there are (or were) also issues to be mindful of with how Template Routes processes pagination terms in routes (again not following the documentation): if you have many entries in a category you might want to paginate the output on the template routes pointing to the index template. Again this once worked just find, but also broke around the time EE3 came out. After much discussion, Ellis Labs eventually suggested alternative template routes that look like this:

`/resources/{seg_2:regex[(balanced\-scorecard)]}/{page:pagination}`

For me, this does not work either, but maybe they do in Ellis Labs systems. If pagination is important to you and you have problems, try it. I never got it to work and in the end it was easier to simply disable pagination rather than fix it: again this may now work in EE4, but not had the time/motivation yet to try and find out.

HTH
> 0 votes

---
Tags: channel-entries, categories, url-title
---


title: Changing status on entry doesn't save

text:
# Question
Title: Changing status on entry doesn't save
We have an EE site running Visitor and Structure for our intra-net. When we try and "archive" a member by setting the status to "closed" or anything else for that matter, the status will not save and just reverts back to it's previous setting. Any thoughts on where to start debugging this issue?

* EE 3.5.15
* Wiki 3.0.2
* Structure 4.3.8
* Visitor 3.0.1
* Forms 4.0.0
* Low Events 2.0.1
* Polls 2.0
* SEO Lite 1.5.4
* Wygwam 4.1.8

# Answer
Per this: https://devot-ee.com/add-ons/support/zoo-visitor/viewthread/14366

I have updated my settings to "Show membergroup in channel entry status" to "no" and the initial finding is that I can now save entry statuses in my test site. I still need to test that nothing else is affected in my live site but I'm hopeful. :)
> 0 votes

---
Tags: add-on, ee3, structure, zoo-visitor
---


# Question
Title: Saving changes to user profile changes Structure Listing URL
We have an EE site running Visitor and Structure for our intra-net. It's set up so that members can edit their profile on the "front end" without logging into the EE dashboard. However, when someone edits their profile and saves, it resets their Structure Listing Url to "/" and thusly changes the home page for everyone else viewing the intranet. Any ideas on where I could start digging to figure this one out?

* EE 3.5.15
* Wiki 3.0.2
* Structure 4.3.8
* Visitor 3.0.1
* Forms 4.0.0
* Low Events 2.0.1
* Polls 2.0
* SEO Lite 1.5.4
* Wygwam 4.1.8

# Answer
After much digging I have added the following line to my visitor profile form:

```
<input type="hidden" name="structure_uri" value="{structure:page_slug_for:{entry_id}}" />

```

And this updates my structure listing url to be the appropriate url and not just a "/" upon save.
> 0 votes

---
Tags: add-on, ee3, structure, zoo-visitor
---


# Question
Title: Add-on Manager checkboxes select more than one
Is this a feature or a bug?

I have a fresh install of EE 3.5.15 (and have noticed this on other installs, thus my test on the fresh version). If I'm in the CMS on a page with checkboxes, such as the add-on manager. I click one checkbox in the middle of the row and several above it are also activated. It's not all above and it's not the same # of boxes above each time. And after you uncheck everything you are then able to check just a single box if it happened to be included in the initial auto selection.

# Answer
> 0 votes
The same happens here. Every list with checkboxes, like the list of a field set. Meanwhile I am used to press CTRL and then click the checkbox. That only checks that checkbox. I have no idea why this happens.

---
Tags: add-on, ee3
---


# Question
Title: Blog Pagination URL: Remove "P" from url and get correct page number
I want my URLs to be like the following: domain.com/blog/2

Currently they are: domain.com/blog/P6

RIght now if I show 6 articles per page, my pagination will jump by 6.

For instance, Page 1 will be /, page 2 will be /P6/, page 3 will be /P9/, ect.

# Answer
> 1 votes
I was able to accomplish this by doing the following:

* On `index` template, set `Allow PHP?` to `Yes`
* On `index` template, set `PHP Parsing Stage` to `Input`
* On `single` template, set `Template route override` to `/blog/{url_title:regex[(((?!(\d+|category\/)).)+?)]}` (make sure to swap blog for your index page url)

Inside `index` template, use the following:

```
<?php $entriesperpage = 6; ?>
      {if segment_2}
        <?php
        $entries = ee('Model')->get('ChannelEntry')
         ->filter('channel_id', 4) // or whatever you want/need to filter on
         ->filter('status', 'IN', array('open', 'other_status'))
         ->order('title', 'ASC')
         ->all();
         $totalentries = count($entries);
         if ( ($totalentries / (({segment_2} - 1) * $entriesperpage)) < 1 ) {
           $redirect = "TRUE";
         } else {
           $redirect = "FALSE";
         }
         $totalpages = ceil($totalentries / $entriesperpage);
         ?>
         {if <?php echo $redirect; ?>}
            {redirect='404'}
         {/if}
      {/if}
      {exp:channel:entries channel="articles" dynamic="no" {if segment_2} offset="<?php echo ({segment_2} - 1) * $entriesperpage; ?>" {/if} limit="<?php echo $entriesperpage; ?>" paginate="bottom"}
        <a class="post" href="{route='blog/single' url_title='{url_title}'}"></a>
      {/exp:channel:entries}
      <div class="pagination">
        {if segment_2}
          <?php $prevpage = {segment_2}-1; ?>
          <a href="{site_url}blog<?php if ($prevpage != 1) { echo '/' . $prevpage; } ?>" class="page-prev">Prev</a>
        {/if}
        <?php for ($i = 1; $i <= $totalpages; $i++) { ?>
          <a href="{site_url}blog<?php if ($i != 1) { echo '/' . $i; } ?>" class="{if (!segment_2 && (<?php echo $i; ?> == 1)) || (segment_2 == <?php echo $i; ?>)} active{/if}"><?php echo $i; ?></a>
        <?php } ?>
        {if !segment_2}
          <a href="{site_url}blog/2" class="page-next">Next</a>
        {if:else}
          {if segment_2 != <?php echo $totalpages; ?>}
          <a href="{site_url}blog/<?php echo ({segment_2} + 1); ?>" class="page-next">Next</a>
          {/if}
        {/if}
      </div>

```

This will produce the following urls:

* website.com/blog
* website.com/blog/2
* website.com/blog/3
* etc

Make sure to set `$entriesperpage` to your desired entries per page, `channel_id` to the correlating ID of channel you're displaying, and update `blog` to your index page url.

We are essentially using our own pagination logic, and I'm sure this could be cleaned up a bit.

Note that this will display all page links, so you may want to add custom logic if dealing with many pages.

---
Tags: url
---


title: EE 3.5.1 => Unable to upload file

text:
# Question
Title: EE 3.5.1 => Unable to upload file
When I try and upload an images (any kind), I getting this PHP error:

```
Fatal error: Uncaught Error: Call to undefined function EllisLab\ExpressionEngine\Library\Mime\finfo_open() in /path_to_ee/backend/ee/EllisLab/ExpressionEngine/Library/Mime/MimeType.php:117 Stack trace: #0 /path_to_ee/backend/ee/legacy/libraries/Mime_type.php(106): EllisLab\ExpressionEngine\Library\Mime\MimeType->ofFile('/tmp/phpfeusnS') #1 /path_to_ee/backend/ee/legacy/libraries/Upload.php(172): Mime_type->ofFile('/tmp/phpfeusnS') #2 /path_to_ee/backend/ee/legacy/libraries/Filemanager.php(2042): EE_Upload->do_upload('file') #3 /path_to_ee/backend/ee/legacy/libraries/Filemanager.php(1083): Filemanager->_upload_file(Array, 'file') #4 /path_to_ee/backend/ee/EllisLab/ExpressionEngine/Controller/Files/Files.php(200): Filemanager->upload_file('1', 'file') #5 [internal function]: EllisLab\ExpressionEngine\Controller\Files\Files->upload('1') #6 /home/jakecovert/wo in /path_to_ee/backend/ee/EllisLab/ExpressionEngine/Library/Mime/MimeType.php on line 117

```

I'm running EE version 3.5.1.

My PHP version is 7.0.27. Any thoughts on what I can check?

Really appreciate any thoughts.

# Answer
With Dreamhost, I just had to add "extension = fileinfo.so" to my phprc file:

```
~/.php/7.0/phprc

```

Not sure why it got changed when they upgraded my VPS OS from Ubuntu 12 to 14.

:-)
> 0 votes

---
Tags: ee3, file-uploads
---


# Question
Title: Has anybody used Structure Nav with Transcribe?
I've recently been using Transcribe and wanted to integrate Structure's Nav feature. I have used both separately without issue in the past. But now that I'm bringing them together, I'm having some problems.

I'm using Structure Nav to list some pages (displaying their titles with a custom text field and custom image field) and would like to show the Welsh alternative once the language has been switched. However I don’t seem to be able to do this

```
{exp:structure:nav_advanced start_from="/see-do"}
{exp:ce_img:single src="/assets/images/img.jpg"}
<h3>{root:title}</h3>
<p>{root:page_introduction}</p>
{/exp:structure:nav_advanced}

```

This is my code which works fine for the English side, but is there any way to display the Welsh alternatives once the language is switched?

In the Transcribe documentation, it mentions that there are some tags for Structure but I'm unsure whether this applies to Structure Nav too.

I'm using EE v3.4.4

Can anyone help with this? Has anybody successfully combined the two modules?

Thanks

# Answer
> 0 votes
Possibly it's because you are not starting from the root? I have it working and have hidden my root (homepage) from the nav (display:none). I'm actually using nav\_basic with ee 4.0.8, Structure 4.3.6 and transcribe 2.2.2

It is working for me. Here is my opening tag in case it helps you:

`{exp:structure:nav_basic start_from="/" strict_start_from="yes" show_depth="3"}`

Also, I would recommend double checking what your pages look like in the Welsh tab of structure. Make sure that they are appearing as they should and that every page has the English and Welsh versions set.

---
Tags: structure, transcribe, multi-language, navigation, eeharbor
---


# Question
Title: EE3 Transcribe url not updating after language switch
After language switch from news entry, url goes from `localhost/news/reach-and-read` to `localhost/es/news/alcance-y-lea`

I was expecting change to `localhost/es/noticias/alcance-y-lea`

But if I change from news page `localhost/news/` it changes to `localhost/es/noticias/` works fine any ideas whats wrong with the entry url update?

# Answer
> 1 votes
their latest update fixed 2.2.2

# Answer
> 0 votes
I have the same issue. Everything worked fine but now it doesn't work for me. According to example above, I translate "news" in Transcribe (Transcribe -\> Templates) but when change the language I can't see any changes in URL.

In my case even the first segment is not translated.

I updated Transcribe to 2.2.1 version but it doesn't help.

# Answer
> 0 votes
Make sure that you add the translations for all the relevant templates in both languages. I also found that I needed to translate the name for "index" for my templates.

I hope that helps.

---
Tags: transcribe
---


title: Structure First Child Redirect

text:
# Question
Title: Structure First Child Redirect
Anyone run into a navigation issue when using Structure's first child redirect?

I have a Blog page that redirects to the latest blog post when I just want it to go to /blog.

# Answer
You can add this script to your blog page then /blog url redirect to first child page.

```
{exp:structure:first_child_redirect}

```
> 3 votes

---
Tags: structure
---


title: CartThrob will be ported to EE4

text:
# Question
Title: CartThrob will be ported to EE4
Cartthrob is a fantastic cart framework!

at first I thought it was complex to use, but with the help of excellent documentation.

I'm wondering if CartThrob will be ported to EE4. Or if CartThrob 3 is compatible with EE4?

# Answer
> 1 votes
The EE3 version of CartThrob is not compatible with EE4.

Development of an EE4 version of CartThrob is apparently underway, but it not yet available.

HTH

---
Tags: cartthrob, ee4-upgrade
---


title: Structure urls sub directory

text:
# Question
Title: Structure urls sub directory
I'm using structure to build out a site. The site is in a sub folder for development. I can't get structure to write the correct paths. I have the menu showing the pages I've entered but the url just shows as

```
example.com/page/sub-page

```

when I want it to look like

```
example.com/sub-folder/index.php/page/sub-page.

```

If I go to

```
example.com/sub-folder/index.php/page/sub-page

```

It does show the correct page. Am I missing something obvious or is there something more complicated about having the site in a sub folder with structure?

Thanks!

# Answer
> 1 votes
You probably already figured this out, but I just went through this issue as well.

I added a **site\_url** tag to the structure tag and it fixed it:

`{exp:structure:nav max_depth="1" site_url="yes"}`

---
Tags: structure
---


# Question
Title: The right place to force SSL on entire domain
I'm not all that familiar with htaccess and in attempting to do this myself I'm getting a too many redirects error so I thought I would go to the experts. I'm just looking for the right place within my htaccess file to force SSL on the entire site, while still removing www, removing index.php, etc (the usual fare for an EE install). My htaccess file currently looks like this:

```
<IfModule mod_rewrite.c>

# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /

# Redirect www Requests
# ------------------------------
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/MySystemFolder/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

# Force SSL
# ------------------------------
# I'm guessing this is the position for the https rewrite rule
# but when I tried it, it resulted in a too many redirects error.

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

</IfModule>

#add Expires
# ------------------------------
FileETag MTime Size
<IfModule mod_expires.c>
  <filesmatch "\.(jpg|png|css|js|jpeg|woff|ttf|svg|eot|gif)$">
       ExpiresActive on
       ExpiresDefault "access plus 1 year"
   </filesmatch>
</IfModule>

```

I would greatly appreciate being pointed in the right direction.

# Answer
this worked for me:

```
Options -Indexes

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/YOURSYSTEMFOLDER/.* [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]

        # Force www
        Options +FollowSymlinks
        RewriteEngine on
        RewriteCond %{HTTP_HOST} ^YOURWEBSITE.com [NC]
        RewriteRule ^(.*)$ https://www.YOURWEBSITE.com/$1 [L,R=301,NC]
</IfModule>

```
> 1 votes

---
Tags: htaccess, ssl
---


# Question
Title: EE3 Email for member account activation: how to modify
Trying to modify text on the member account activation email on EE3. But it does not accept modification.

I modify `/system/ee/legacy/language/english/email_data.php`. Whatever I change there I always get the same old/standard text like:

> "Thank you for your new member registration."

But that sentence was changed in email\_data.php. I use **Smart Member Pro**. Does that on interfere.

I am confused. What should I do different?

# Answer
> 3 votes
I am developer of Smart members PRO.

There is maximum 2 emails trigger when new member registers with EE.

> 1) User – Account activation instructions
>
> 2) User – Account validation notification

1) User – Account activation instructions:

This is an instruction email and will trigger only if you make users to self activate there account via email. You can change template of this email from backend: `Developer > Template Manager > Email > User – Account activation instructions`

2) User – Account validation notification:

You can change email template of new registrations from backend panel `Developer > Add-On Manager > Smart Members Pro` Settings.

Let me know if you have any queries for the same.

---
Tags: email, activation
---


# Question
Title: Subscriptions -- Credit Card Required? & OpenGateway Migration
1. Can a customer checkout without credit card information by using a voucher? We are using Stripe as the gateway, but certain customers are invoiced differently, (not through Stripe) thinking the vouchers would suffice?
2. How do you add an existing member in ExpressionEngine to a subscription from the EE Control Panel?
3. Have you seen any existing Membrr/Opengateway to Subscriber migrations? Any idea what this process entails while retaining existing subscriptions in OpenGateway using Stripe as the payment gateway?

# Answer
> 0 votes
1. No credit card is needed if someone redeems a voucher. Note: Their subscription is also set to "not" auto-renew.
2. That is currently not possible but will be added very soon. (June/July)
3. We have had several people ask but we never fully automated it, everybody used a mix of re-subscribe or silently subscribe them when they update their payment details. We do want to create an automated version if you want to go forward with it. Get in touch.

# Answer
> 0 votes
I can recommend Charge as a replacement for Membrr/Opengateway... works great!

---
Tags: devdemon, subscriptions, devdemon-subscriptions
---


# Question
Title: SQL help to remove an imported text error
We recently migrated a site, and any line break imported as /n. This was not a huge deal for the templates, but it is for the entries.

This is for an EE3 site, and I just don't write SQL code that much. Can I get some assistance writing a query that will replace `/n` with `<br />` in field\_id\_1 for all entries whose channel id is 2?

# Answer
> 0 votes
Nevermind. I found the "Data Search and Replace" utility from within EE3. That works perfectly!

---
Tags: ee3, query, sql
---


# Question
Title: Can FreeForm Pro email a user-entered value?
I have a situation where somebody will submit a form, then somebody else will come back and edit that form. Upon submitting the edit, an email address defined in an open text field in the form will be emailed a notification. Is this possible with FreeForm Pro?

I'm using 4.2.5 with EE 2.7.3, but I'm open to upgrading if a newer release works.

# Answer
There's currently no support for this with Freeform Classic (aka Freeform Pro 4/5/6), nor is there for the new Freeform (aka Freeform Next) editions. However, sometime in the future we might add this type of functionality to Freeform Pro (Next) for EE3/EE4. :)
> 1 votes

---
Tags: solspace-freeform
---


title: Linking a low variable to an entry

text:
# Question
Title: Linking a low variable to an entry
How can we link a low variable to an existing channel entry?

Let's say a matrix low variable needs to be displayed only on a certain channel entry.

# Answer
> 0 votes
You can use the Low Variables fieldtype, see https://gotolow.com/addons/low-variables/docs/fieldtype

Add a field of the LV type to the channel, so you can select a variable for any given entry in that channel.

---
Tags: matrix, low-variables
---


title: Conditional Not Working as Expected.

text:
# Question
Title: Conditional Not Working as Expected.
I have a series of performance dates; let's say 5.

```
 {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}

```

However, after a date has passed, I want to gray the date out and remove the link, but I want to keep it on screen until all five performance are finished.

This code doesn't work. It prints two dates one grayed out the original date.

```
  {if performance_date_one}
  {if "{expiration_date format='%U'}" < "{current_time format='%U'}"}
 <h5><i aria-hidden="true" class="fa fa-calendar"></i>
 {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}</h5>{/if}

 <h5 class="color-gray-aaa"><i aria-hidden="true" class="fa fa-calendar">
 </i>  {performance_date_one format="%l, %F %j, %Y; %g:%i %a"} <span class="label
 label-default small">PAST</span></h5>{/if}

```

I am stuck, any thoughts?

# Answer
> 0 votes
You simply need to change the inner IF statement into one that has an ELSE clause. So you get either the first or the second - your logic currently gives two lines if the inner-if statement fires. I think you want something like this...

`{if performance_date_one}
{if "{expiration_date format='%U'}" < "{current_time format='%U'}"}

   {performance_date_one format="%l, %F %j, %Y; %g:%i %a"}

 {if:else}

  {performance_date_one format="%l, %F %j, %Y; %g:%i %a"} PAST

 {/if}
{/if}`

HTH

---
Tags: conditionals
---


title: Add related entry data via channel form

text:
# Question
Title: Add related entry data via channel form
I have a form that has 2 stages each stage creates a new entry Stage one makes an event and stage 2 makes a client

The part I'm having trouble with is making the event relate to the client

first part of the form directs the user to the next page and includes the newly created url title

```
{exp:channel:form return="make-an-event/URL_TITLE"}

```

In part 2 I want to make the client and add that created event to the clients related entry field

```
{exp:channel:form require_entry="no" channel="clients" return="thank-you"}

 <input type="text" name="cli_events:url_title[data][]" value="{segment_2}">

```

but I'm not having much luck

Thanks

# Answer
> 0 votes
I was nearly there... '{segment\_2}' was url\_title but it needed to be entry\_id

```
{exp:channel:form return="make-an-event/ENTRY_ID"}

```

and

```
 <input type="text" name="cli_events:url_title[data][]" value="{segment_2}">

```

# Answer
> 0 votes
I've just managed to achieve this using the following code, to relate a Job Note entry to a main Job entry:

```
{exp:channel:form channel="jobnotes" unique_url_title="yes" return="jobs/edit"}
    <input type="hidden" name="title" value="Job Note" />
    <input type="hidden" name="jobnote-job[data][]" id="jobnote-job" value="entry_id_of_job" />
    {field:jobnote-main}
    <button type="submit">Add Note</button>
{/exp:channel:form}

```

---
Tags: safecracker, relationships
---


# Question
Title: Simple Search form action is set to main site page
I'm trying to implement simple search on our blog. Previously we'd used the Google Custom Search Engine, but since they removed the pay as you go option to remove ads, competitor ads are showing up in the search results. So, I haven't been able to get simple search to work.

I've previously posted here (Simple search form action is main \_site page) and wasn't able to resolve it. The one reply to that post didn't work. I'm coming back to this ~~at the turn of the tide~~ to try and get it actually working.

We use Transcribe since we have bilingual website, because Canada. I've tried the solution found here: Search refer to homepage, which hasn't worked. I also tried disabling Transcribe, and seeing if that would resolve it, but no.

I would reply to this issue (Simple Search: search form redirects to home page), to get more details as to what exactly was wrong with their server setup, but I don't have enough reputation to reply.

Here is my search form code, which appears on the main listing of blog entries.

```
{exp:search:simple_form channel="blog" name="blog_search"
        result_page="blog/search" no_result_page="blog/no-results" results="10"
        search_in="everywhere" show_expired="yes" status="open" where="all"
        form_id="blog_search" form_class="blog_search" transcribe_add_lang="en"}
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100">
    <input type="submit" value="submit" class="c_btn--s v_bg--green-grad">
{/exp:search:simple_form}

```

I've tried changing result\_page to "/blog/search", "/en/blog/search", and "{transcribe:language\_abbreviation}/blog/search", and no\_result\_page was changed to the same. I can browse to both blog/search (the default no search results EE message is displayed) and blog/no-results ("NO RESULTS" it screams at me). I've gone to the EE Slack channel and variations on the above suggestions have been passed my way.

Changing the form action to /blog/search in Chrome's Developer Tools will make the search work, but I don't know how to get it to do that programatically.

Could there possibly be a server set up error somewhere that is causing this to happen? Or could there be something in PHP that was incorrectly set up, or should be added? The .htaccess file is rather ... lengthy (mostly redirects from our old website to this due to change in structure), but I don't believe there's anything there that would cause it.

Running EEv2.10.3 - Build Date: 20160129.

# Answer
> 0 votes
Okay, I figured it out, after smashing my head against my desk for most of the day, and having Derek talk me through it in the #eecms Slack channel.

It looks like my issue was I had something in my .htaccess file that caused the redirect. We are/were using NSM .htaccess Generator, and there was a line like this in the file:

```
# Directs all EE Web requests through the site index file
    RewriteCond %{REQUEST_URI} ^/({all template channels pipe delimited here}|P[0-9]{2,8}) [NC]

```

Removing/Commenting out that line fixed the issue.

---
Tags: ee2, forms, htaccess, simple-search
---


# Question
Title: How to deploy from localhost development server to live server?
When working on localhost the URLs have begun with `http://localhost/~macuser/example.com/` and the file paths have begun with a local file path.

What is the best way to deploy a site once it is finished?

# Answer
IMHO, I suggest you start with a config file that will work irrespective of where your current environment is - there's a good gist here: https://gist.github.com/1329538

There's also a version of it here, but I haven't tested this one: http://ee-garage.com/nsm-config-bootstrap

After that, you'll want to get a good deploy workflow going. I suggest using GiT for your version control and Capistrano for the deploy phase. There is a really good guide on hive logic that should get you started: http://hivelogic.com/articles/deploying-expressionengine-github-capistrano

Finally, if you're migrating a db over, I suggest you look into REElocate plugin: http://devot-ee.com/add-ons/reelocate which is good for changing path variable in the database. This is a good way of uploading your database to the live server and then changing the values.

This is probably the best deploy setup I've come across so far for ExpressionEngine - most of the things that can usually get screwed up if you do them by hand are automated, and you can even roll back if something gets messed up during deploy.

It's a lot to learn if you've not used these technologies before, but well worth it! I heartily recommend learning as much as you can about both GiT and Capistrano! Good luck!
> 4 votes

# Answer
If you're not currently using version control or config overrides to manage your paths... then I highly recommend, Deploy Helper by Hop Studios. It places almost all the configuration parameters you want or need to change on a single screen. Which makes transition from one server to the next, much easier. This works, when you just need to move the site to a new location, regardless if its an official deploy or you just changed development servers.

REElocate by Esp:resso is also a deployment helper. It works similar to Deploy Helper and was done by the same company that produces Store.

There is also Master Config by Focus Labs. Master config works a bit differently. It gives you a process to set-up and deploy to multiple environments. It's worth having in your toolkit, and can be used for a completed project, but probably works best when you are starting a project. At least that's my opinion, others may disagree.

There are a growing number of articles around using `version control` with ExpressionEngine, especially around Git. That's not something you want to get into in the middle of a deploy, but definitely something to look into. We're going to be using our first GitHub, ExpressionEngine deploy and management for a project that will launch in January.

If that is of interest to you (and it should be), then here are some recommended starting points:

(!)This one is my favorite reference point, just because its very close to how I want my set-up to be— local MAMP, Git, BeanStalk and Mountee.

I've been keeping a list of resources on the topic that I've found beneficial, you can access it here on Kippt. Hope this is helpful.
> 13 votes

# Answer
I like to add this System Config Override variable to my config.php file...

```
$config['site_url'] = "http://localhost:8000/";

```

...then change it depending on your environment. This way at least I have one less thing to update in the database between environments. I prefer that type of configuration to be in PHP anyway.

Perhaps using more of the Config Overrides can remove the need for any configured URLs in the database.

EE 3 reference:

https://docs.expressionengine.com/v3/general/system\_configuration\_overrides.html
> 1 votes

---
Tags: url, settings, deployment, path, localhost
---


# Question
Title: Bypassing login system messages using Solspace User on EE3
I know that this has been asked a few times in the past but the solutions provided all worked for ExpressionEngine2. Now that I'm working on v3, I have a problem that I hope somebody could help me with.

I am using a standard login form using Solspace's User module. When you login or logout you are presented with a system message page explaining that you have logged in/out. I know these system message pages are customizable to an extent but what I'd really like is to bypass them completely.

Has anyone found a way to do this? It just adds an unnecessary step that I'd like to get rid of if possible.

Thanks

# Answer
> 2 votes
I've created a really basic extension to bypass the default message. It redirects to an account page on login and the home page on logout but this could be modified to point to any URL (i.e. a custom message landing page)

I've included a link to the download but should that expire you'll need to copy/save these two files into `system/user/addons/loginbypass/`

**ext.loginbypass.php**

```
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Loginbypass_ext
{
    var $name = 'Login Bypass';
    var $version = '1.0.0';
    var $description = 'Bypasses default ExpressionEngine login/logout messages';

    public function activate_extension()
    {
        /**
         * As far as I understand, these two hooks take place after authentication
         * so you don't need to worry about any of that
         **/
        $this->add_hook('member_member_login_single');
        $this->add_hook('member_member_logout');
    }

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

    public function update_extension($current = '')
    {
        if ($current == '' || (version_compare($current, $this->version) === 0))
        {
            return false;
        }
    }

    public function member_member_login_single()
    {
        ee()->load->helper('url');

        // Change $url to wherever you need to redirect on login
        $url = site_url() . 'account';
        // Side note: this should be site_url('account') but it isn't working for my install

        redirect($url);
        return FALSE;
    }

    public function member_member_logout()
    {
        ee()->load->helper('url');

        // Change $url to wherever you need to redirect on logout
        $url = site_url();
        redirect($url);
        return FALSE;
    }

    private function add_hook($name, $priority = 10)
    {
        ee()->db->insert('extensions',
            array(
                'class'    => __CLASS__,
                'method'   => $name,
                'hook'     => $name,
                'settings' => '',
                'priority' => $priority,
                'version'  => $this->version,
                'enabled'  => 'y'
            )
        );
    }
}

```

**addon.setup.php**

```
<?php
return array(
    'author'         => 'Kieran McClung',
    'author_url'     => 'https://github.com/kieranmcclung',
    'docs_url'       => 'https://github.com/kieranmcclung/ee-loginbypass',
    'name'           => 'Login Bypass',
    'description'    => 'Bypasses default ExpressionEngine login/logout messages',
    'version'        => '1.0.0',
    'namespace'      => 'Loginbypass',
    'settings_exist' => FALSE
);

```

Download link for extension

---
Tags: login, solspace-user, logout, system-messages
---


# Question
Title: Live Preview when editing - not loading entries data
Channel live preview set as:

```
site/index/{entry_id}

```

EE entries tag set as:

```
{exp:channel:entries channel="pages" limit="1" require_entry="yes" cache="yes" refresh="60" disable="categories|member_data|pagination"}

```

http://www.example.com/site/index/1234 This works without issue from the front end of the website. From the live preview when editing an entry, the page does not display the entries tag contents.

Any ideas?

# Answer
> 0 votes
Try setting up a separate template for your live look. Remove `refresh="60"` and add `dynamic="no"` to it.

---
Tags: editor
---


title: Display Random Grid Row

text:
# Question
Title: Display Random Grid Row
I have a channel setup called Testimonials. With each testimonial, the client wants to show one of two supporting accolades (e.g. "Focused, cohesive strategies" or "We listen"). I put these supporting accolades into a grid thinking that I could display them randomly, one per row; however, that is turning out to either not be possible or I can't figure out how to do it.

The problem I see is that there isn't a way to target a row within an entry. There are only two rows per entry, so I assumed I'd be able to setup a conditional to show one or the other, but I don't see a way to target row 1 or row 2. The row\_id parameter provides the IDs for all rows in the table (currently 12), not just the rows within the entry. Same for fixed\_order.

This is the code I tried, implementing the low\_random plugin to set the row variable to either 1 or 2:

```
{exp:channel:entries channel="homepage_testimonials" disable="categories|member_data|category_fields|pagination" status="open" dynamic="no"}
    <div class="slide">
        {if {random_row} == 1}
            <div class="animate-text">{home_accolades row_id="1"}<span>{home_accolades:accolade}</span>{/home_accolades}</div>
        {if:else}
            <div class="animate-text">{home_accolades row_id="2"}<span>{home_accolades:accolade}</span>{/home_accolades}</div>
        {/if}
    </div>
{/exp:channel:entries}

```

So my question is, is it possible to display a random grid row?

# Answer
> 0 votes
Not sure what you are doing to generate `{random_row}`.

If you have Low Random installed you could try something like this...

HTH

```
{exp:channel:entries channel="homepage_testimonials" disable="categories|member_data|category_fields|pagination" status="open" dynamic="no"}
    <div class="slide">
        {if {exp:low_random:item items="cat|dog"} == "cat"}
            <div class="animate-text">{home_accolades row_id="1"}<span>{home_accolades:accolade}</span>{/home_accolades}</div>
        {if:else}
            <div class="animate-text">{home_accolades row_id="2"}<span>{home_accolades:accolade}</span>{/home_accolades}</div>
        {/if}
    </div>
{/exp:channel:entries}

```

# Answer
> 0 votes
Did you tried {home\_accolades orderby="random"} instead of {home\_accolades row\_id="1"}?

---
Tags: grid
---


# Question
Title: How to build HTML navigation breadcrumbs without using an add-on?
There exist some add-ons that permit to build navigation breadcrumbs, such as NavEE, Construct and Structure.

What could the best way to create HTML navigation breadcrumbs without using an add-on?

Is using multiple conditionals a good choice?

# Answer
> 4 votes
Depending on how your pages are constructed, have you looked at this Tutorial yet?

https://expressionengine.com/learn/smarter-breadcrumbs-with-layout-lists

Russ

---
Tags: navigation
---


title: ExpressionEngine 3 Date Range

text:
# Question
Title: ExpressionEngine 3 Date Range
I am trying to load entries based on a date range that is selected by the user. On the front end of the site I have two input fields, the start day and end day of the date range. In the control panel, I have a custom date field (shipping\_date), which is the field that will be compared to the inputted range.

What I would like is to pass those two dates inputted by the user into the channel entries tag in order to limit the entries to only ones where the shipping\_date field is between the inputted date range. There are hundreds (if not thousands) of entries so I do not want to load all of them and then do the sorting on the front end.

So I guess my question is two fold:

1. Can ExpressionEngine out of the box limit entries by a date range based on a custom date field? So far my research says this is not possible without an add-on (Low Search seems to be able to handle custom field date ranges)
2. How do I pass inputted data from the user into either the channel entries tag or a plugin's tag?

Thank you in advance for any help!

# Answer
I'd suggest attempting to see if the `start_on` and `stop_before` parameters work for with Dynamic Parameters. Run a couple tests to see if this does not suit your needs or work first.

**Dynamic Parameters Documentation**

https://docs.expressionengine.com/v3/channel/dynamic\_parameters.html

**start\_on documentation** https://docs.expressionengine.com/v3/channel/channel\_entries.html#start-on

**stop\_before documentation** https://docs.expressionengine.com/v3/channel/channel\_entries.html#stop-before

The next steps would be, if this does not suit your needs is to see if there is any module/add-on out their currently to handle more complex filtering like this. A site like https://devot-ee.com/

Out of the box, the EE channel entries tag is fairly linear and basic.

I typically write me own modules and use the Model service to query and filter front-end form submission input and return a custom tag pair. But this depends on your programming capabilities as well.

**UPDATE**

Sorry, I just remembered you said you're using a custom\_field for the date, so out of the box the Dynamic Parameters will likely not work for you.

Please see if this post is helpful to you at all:

Show all entries from a given custom date field
> 1 votes

# Answer
For anyone who comes across this answer now, there is an update to search:numeric\_field='' parameter to now include a range in EE4. So you can use this parameter with a custom date field to search by range if you're using EE4.

Here's an article discussing the update: https://expressionengine.com/blog/three-new-content-filters-in-expressionengine-4
> 0 votes

---
Tags: channel-entries, low-search, date
---


# Question
Title: Capturing Attendee Information using Cartthrob 2.5 and EE 2.9
Has anyone had any luck adding the ability to capture attendee information, (i.e. name, company) as part of the Cartthrob 2.5 checkout with EE 2.9?

We're stuck and can't upgrade and would appreciate any suggestions.

# Answer
CT allows adding custom data to orders via this method:

https://www.cartthrob.com/docs/tutorials/adding\_custom\_data\_to\_purchased\_items\_and\_orders/index.html

That should work with CT 2.5, but if not, you can go to the latest CT for EE2 (2.71) and it definitely works there!
> 0 votes

---
Tags: cartthrob, ee2.9.2
---


title: Only display one entry per day?

text:
# Question
Title: Only display one entry per day?
I'm trying to make a very simple date based entry page. But I'm just wondering if there's a way to only display one entry per date. So if there's 5 entries for one day and 10 for another, the page should only show the first entry per day?

Any help is appreciated, thanks!

# Answer
> 0 votes
You can try starting with `display_by="day"` . Note that the `limit` parameter will constrain the number of days i guess.. You can add php and/or "if" conditional to check if previous entry was the same day.. maybe using `{entry_date format="%d"}` You can read the doc -\> https://docs.expressionengine.com/latest/channel/channel\_entries.html#display-by

---
Tags: date, entry
---


# Question
Title: Is it possible to use an extension in a template like a plugin?
I built an extension which works fine and I'm trying to make it work in my template but I don't know how to do and actually, I don't even know if it could work.

My code looks like:

```
class Easypost_extension_ext

{

    public $name        = 'Easypost extensions';
    public $version     = '1.0.0';
    public $description = 'Display shipment only if there is a product to send';
    public $docs_url    = 'https://ellislab.com/expressionengine/user-guide/';
    public $settings_exist = 'n';
    public $settings    = array();
    private $EE;
    private $apikey;

```

My function is called check\_shipping and I'm trying to call it in my template in this way:

```
<select class="form-control" id="easypost" name="easypost">
    {exp:easypost_extention:check_shipping}
    <option value="">
        {service}
        {days}
        {rate}
        {currency}
        {rateid}
    </option>
    {/exp:easypost_extention:check_shipping}
</select>

```

But I receive an error in my template. Is there any way to fix my problem?

# Answer
> 2 votes
You cannot use ext to call in template as plugin. You must have to create `mod.easypost_extention.php` file for that. Use this code inside that file.

```
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Easypost_extension
{
    public function __construct()
    {

    }

    function check_shipping()
    {

        $tagdata    = ee()->TMPL->tagdata;
        $tagparams  = ee()->TMPL->tagparams;

        // Some code

        return ee()->TMPL->parse_variables_row($tagdata, $myArrayToParse);
    }
}

```

You can gain more information from here. https://docs.expressionengine.com/latest/development/plugins.html

---
Tags: templates, php, extension
---


# Question
Title: Automagically or force logout after 60 seconds
I have an EE3x site that is running User, Cartthrob, Transcribe, CE Cache (there is a lot going on) and I need a way to be able to automagically log-out users after 60 seconds of inactivity.

The issue is, this company uses tablets in their offices to allow (and assist) their patients to shop (like a kiosk, but it is not an app). And we have a security issue if the customer does not remember to log out.

Any ideas on how we can achieve this? I've looked at trying to force logout either with User or Cartthrob, but neither of those seem to have that feature either.

I've tried using sessions, but I have another issue there - the user gets logged out after visiting more than 1 other URL (does not seem to store sessions, or maybe a CE Cache conflict?).

This really is exactly what I'm looking for, but it is only for up to EE2x :/ https://www.putyourlightson.net/logmein/docs has a simple `{exp:logmein:logout}` tag to place in a template.

# Answer
> 0 votes
I have a thought. Really, security of session lives server side. Assuming you are allowed to have JavaScript functioning in your browser, why not let it handle timing and let the backend handle session validation?

For example, say you have an authed user, but you need them to be authed out after 60 seconds of inactivity. You could use a solution like this:

https://stackoverflow.com/questions/667555/detecting-idle-time-in-javascript-elegantly

to detect inactivity. When the inactivity is triggered, AJAX the logout ACTion url (the ACT id for logging out can be different on each install, look it up in your `exp_actions` table):

```
$.ajax({
    url: "domain.com/index.php?ACT=3",
}).done(function() {
    window.location = "domain.com/you-have-been-logged-out-due-to-inactivity";
});

```

This would handle inactivity on the front-end, session invalidation after 60 seconds, and allow a user to resume session on the front-end if they don't change pages but resume their activity before 60 seconds is up (`I finally found my insurance card with my insurance number! Now I can continue filling out my form`). It effectively gives the user 60 seconds of inactivity per authed page before being kicked.

Now... don't jump on this without expanding. How security conscious is this application? For example, I could find a way around this to not auth me out after 60 seconds if I needed to, but I'm an experienced developer. And I wouldn't be able to do it on an iPad. I'd need a full desktop browser.

As for CE Cache.. this solution is all async, so as long as you deploy this and refresh all cache, all cached pages will deliver the async code that hits the never-cached ACT url. No problems there.

**Disclaimer** Don't use that code example. It doesn't handle error or success functions so not actually checking status return, etc.... just a good starting place.

**Edit** Also, I took a peak at that PYLO add-on... it is just a plugin. If the API for those functions haven't changed, upgrading a plugin from EE2.x to EE3 is really easy. Consider that as an option too. But first review the plugin code and make sure the endpoint methods for log(in-out)/sessions are the same for EE3.

---
Tags: cartthrob, solspace-user, sessions, cookies, logout
---


# Question
Title: Does Assets fields work in Calendar (solspace)
I have an assets field being used inside a {exp:calendar:events entry and the field is not parsing.

```
<img src="{calendar:event_photo:url:thumb}" title="listing image">

```

is notparsed at all

```
<img src="{calendar:event_photo}" title="listing image">

```

is parsed as

```
<img src="imagefilename.jpg" title="listing image">

```

but is missing the full path.

Is there somethign within Calendar that is not allowing me to use :url:thumb??

# Answer
While the *Calendar:Events* template tag may work similarly to the EE *Channel:Entries* tag, it is much more limited. This is because Calendar looks at event recurrence rules and populates the additional occurrences that way (rather than the recurrences actually existing in database). This inflates the counts and can take a huge hit on performance. In Calendar 1.x we had a large number of customers complain about performance issues, so in Calendar 2.x we sacrificed some extra *Channel:Entries* functionality in favor of huge performance gains. We did this by rewriting our own version of the *Channel:Entries* functionality and just included what we believed to be the more commonly used features. Unfortunately some features such as search parameter and third party field types are limited or not built in at this time.

In the particular case of images, there is limited support for EE file fields, and you can read more about that here: https://solspace.com/expressionengine/calendar/docs/events/#your\_custom\_field

In some cases it works to embed a template with *Channel:Entries* tag to parse extra variables or conditionals, but in the case of filling the gaps for excluded parameters, I don't believe there is an easy way around it unfortunately.
> 1 votes

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


# Question
Title: total_results of plugin nested within exp:query
I'm using the exp:query module along with a nested custom plugin that I've created. I need to get the count and total\_results of the nested plugin but it's returning the count and total\_results of the exp:query, which wraps around the plugin tags. If I move the custom plugin outside of the exp:query (for testing), it returns the plugin's count.

Is it possible to return the count and total\_results of a plugin nested within an exp:query? Any help is appreciated. Thank you.

# Answer
> 0 votes
There is 2 ways you can do that.

1) Use `parse="inward"` parameter on your custom plugin code. (There is very few possibility of this to working.)

2) Move your nested custom plugin code into any other file and call it via `{embed='template_group/template'}` under your query loop.

---
Tags: plugin, query, count
---


# Question
Title: Blog posts have 2 urls... /site and /blog. How can I remove /site and redirect to /blog
Google is indexing 2 different urls for the same blog posts, one has /site the other correctly has /blog. Example... www.domain.com/site/blog-post-title www.domain.com/blog/blog-post-title

How can I get rid of /site and redirect to the respective url containing /blog?

# Answer
Can you share a link to the URL? Also, I'm assuming that you probably have links to these blog posts on your homepage?
> 0 votes

---
Tags: redirects
---


# Question
Title: MySQL ERROR: Error Number: 1364 Description: Field 'whatever' doesn't have a default value
Firstable, I´m designer, hence my ignorance. It´s been awhile since I didn´t updated a site. The client asked me to make a new member in EE. I´ve been able always to do that on the spot, but this time I always get the SQL error of the email subject (1364). After some researching, I tried to publish some entry and I got the same SQL error.

Then i found this post here Database Error 1364 in Solspace Calendar

The point is that i´m not sure if I have to adding a default value (0) to all the tables or there is a way to do that for the whole site.

Thank you in advance

# Answer
Hmm, I had this error on a site recently and I fixed it by removing strict mode from MySQL.

https://stackoverflow.com/questions/37964325/how-to-find-and-disable-mysql-strict-mode

^ That has some information on the matter. I'm not sure what your current setup is but the update is fairly standard. Find the cnf file, remove "STRICT\_TRANS\_TABLES" from the string and save, then restart MySQL.
> 0 votes

---
Tags: error, mysql, default
---


# Question
Title: Channel Videos - Removing Video When Saving
I have used DevDemon's channel videos on numerous occasions and always found it very useful. I have just installed the plugin on a EE 3.5.7 install, searched and browsed for the required video and all looks as expected. However, hit save and the video os removed and quotes "No Videos have been added."

Has anyone else came across this or is it a bug? Really hoping that this is a simple fix as the end user loves the feature and is keen to get it working for the site.

Any help would be appreciated.

Thank you Scott

# Answer
(I'm with DevDemon)

A cause of this issue we've seen in the past is a user's cache folder not being writeable. Make sure your cache folder is writeable and it should fix this problem.
> 0 votes

---
Tags: ee3, devdemon, channel-videos
---


title: Channel Entry Form not found

text:
# Question
Title: Channel Entry Form not found
I've picked up some work on a site (EEv2.8.1) which requires a channel entry form so users can publish their own channel entries. It's been a long, long time since I have worked with this area of a site so my first stop was to look at the Safecracker module. I learned that the module is now integrated into EE as of V2.

So my next step was to use the built in `{exp:channel:entry_form}`. I popped the tags into my template and then on reload I reveieved an error saying that the tags could not be processed and to '*Please check that the ‘channel’ module is installed and that ‘entry\_form’ is an available method of the module*'. The channel module was indeed installed.

On checking the channel module files, it was missing the 'mod.channel\_standalone.php file. I managed to track this file down from another EE install. But I'm still getting the error that the `{exp:channel:entry_form}` is not being recognised.

Am I missing something? Can anyone help me out with this? Like I said, it's been a while since I dealt with something like this so I may have overlooked something. Thanks

# Answer
Typical that as soon as I post a question I find, what I think is, the solution. It seems the tags are not `{exp:channel:entry_form}` but `{exp:channel:form}` instead.
> 1 votes

---
Tags: ee2, safecracker, forms, entry
---


# Question
Title: ee4 Save and close redirecting to /admin.php?/cp/addons/settings/structure/index
Just one of my channels is misbehaving. When editing a channel entry and clicking on "Save & Close" it redirects me to /admin.php?/cp/addons/settings/structure/index

1. I do not have an admin.php on the site, I renamed it.
2. What is causing this one channel to behave like this? Is there anywhere I should look to check the settings or the like?

# Answer
Seems like you've set this as a setting in structure. it says something like redirect to structure after save. Might also be that your admin page is still defined as admin.php in either your renamed admin.php or the config.php or the config settings in the cp
> 1 votes

---
Tags: structure, ee4
---


title: How to access the EE control panel

text:
# Question
Title: How to access the EE control panel
I know this is a lame question but I have not updated any content for 6 years. My site is hosted by EngineHosting and I can FTP to the files. How do you access the ExpressionEngine control panel. The URL I use to use no longer works. Thank you.

# Answer
> 1 votes
You could acces using :

www.mysite.com/admin.php

Add /admin.php after your domain site name to access to the EE Control Panel.

---
Tags: control-panel
---


# Question
Title: How can I pass the category ID of the current entry into the exp:calendar:cal tag?
I have an entry assigned to a specific category. I want events from exp:calendar:cal that share the same category to be displayed on the same page. When I hard code the category ID it works like a charm, but I want to know how I can pass the category ID dynamically. I've tried embeds, snippets and Stash embeds and I can't get anything to work.

Here's the calendar code...

```
<ul>
{exp:calendar:cal channel="calendar_events" date_range_start="today" date_range_end="12 months" event_limit="4" enable="categories|custom_fields" related_categories_mode="yes" custom_fields="yes" category="[SNIPPET? EMBED? STASH?]"}
<li>{event_start_date format="%M %j"}<a href="{path='calendar/event'}/{if event_recurs}{event_start_date format="%Y/%m/%d"}/{/if}{event_id}" title="{title}">{title}</a></li>{/exp:calendar:cal}
</ul>

```

And here's what I'm using to grab the category ID of the current page...

```
{exp:channel:entries channel="cool_stuff" disable="{gv_disable}"}
{categories}{category_id}{/categories}
{/exp:channel:entries}

```

Thanks in advance to anyone who can help at all!

# Answer
It depends on how you are locating the channel entry you want to use to give you the category ID.

If the category is included in the URL you can use something like Low's Seg2Cat to get the Category ID from the relevant slug in the URL - perhaps like this (if the category info is in segment 2 of the URL):

`{exp:calendar:cal ... category="{segment_2_category_id}"}`

If that is not possible, you could use Stash to capture the entry\_id and insert it into the calendar tag - though often it can be tricky to get stash to work, as parse order can sometimes mean that stash doesn't find the value until after you need it etc.

Or you could use a standard EE embed.

Deciding which is best really depends what else is going on on the site.

The other thing to think about though is what happens if the Entry you are focused on is assigned to more than one category... which one will you want the calendar call to use?

HTH
> 0 votes

# Answer
I found a partial solution to this problem. Perhaps it will help someone.

I put the calendar code in an embed with an embed variable called entry-category:

```
<ul>
{exp:calendar:cal channel="calendar_events" date_range_start="today" date_range_end="12 months" event_limit="4" enable="categories|custom_fields" related_categories_mode="yes" custom_fields="yes" category="{embed:entry-category}"}
<li>{event_start_date format="%M %j"}<a href="{path='calendar/event'}/{if event_recurs}{event_start_date format="%Y/%m/%d"}/{/if}{event_id}" title="{title}">{title}</a></li>{/exp:calendar:cal}
</ul>

```

Then used a snippet to grab the category ID of the current page and passed that into the embed:

```
{embed="includes/category-cal" entry-category="{sn_event-category}"}

```

I added a pipe into the snippet to account for multiple categories. If there's more than one category if results in a stray pipe at the end, but it works!

```
{exp:channel:entries channel="cool_stuff" disable="{gv_disable}"}
{categories}{category_id}|{/categories}
{/exp:channel:entries}

```

The only remaining problem is accounting for instances where there are no events that match the category ID or IDs of the page.
> 0 votes

---
Tags: categories, solspace-calendar, parse-order, embeds, snippets
---


title: EE3: Polls or surveys?

text:
# Question
Title: EE3: Polls or surveys?
Does anyone know of any poll or survey modules that work with EE3? The ones I've checked out say - on the companies' sites - that they currently work with EE2, and not yet EE3.

# Answer
As I'm also researching such add-on possibilities so far I found:

1. DevDaemon Channel PollsChannel Polls
2. EE Harbour Polls (acquired from Solspace I think) Polls accuired : http://www.devdemon.com/expressionengine-addons/channel-polls
3. VWM Polls \- a free one from depot:ee

I found these, but I think for my purpose I need also a custom development as they are giving you pretty basic and standard options as most of the polls on the market
> 0 votes

---
Tags: add-on, ee3
---


# Question
Title: nginx how to remove index.php from URL for an MSM site?
I have an existing Expressionengine MSM site that I've moved to nginx on my local machine, consisting of 2 sites in subdirectories:

```
/en
    /system
    /index.php
    /admin.php
/de
    /index.php
    /admin.php
/themes

```

Sites are accessed through https://mydomain.test/en and https://mydomain.test/de

I can view pages using 'index.php' : https://mydomain.test/en/index.php?/pagename

But I can't seem to get the site working without 'index.php?', my nginx.conf is included below (https://www.nginx.com/resources/wiki/start/topics/recipes/expressionengine/)

```
user username staff;
worker_processes auto;

events {
    worker_connections  1024;
}

worker_rlimit_nofile 1024;

http {
    include mime.types;
    default_type  application/octet-stream;

    sendfile on;
    keepalive_timeout  65;
    client_max_body_size 128M;

    gzip  on;
    gzip_comp_level 5;
    gzip_min_length 256;
    gzip_proxied any;
    gzip_vary on;

    gzip_types
    application/atom+xml
    application/javascript
    application/json
    application/rss+xml
    application/vnd.ms-fontobject
    application/x-font-ttf
    application/x-web-app-manifest+json
    application/xhtml+xml
    application/xml
    font/opentype
    image/svg+xml
    image/x-icon
    text/css
    text/plain
    text/x-component;

    include /Users/username/.valet/Nginx/*;
    include servers/*;
    include valet/valet.conf;

    server {
        listen 80;
        server_name mydomain;
        root /Users/username/nginx/mydomain/;
        index index.php;

        access_log /usr/local/var/log/nginx/access.log;
        error_log  /usr/local/var/log/nginx/error.log info;

        location /en {
           try_files /en/$uri /en/$uri/ /en/index.php?$query_string;
           disable_symlinks off;
        }

        location /de {
           try_files /de/$uri /de/$uri/ /de/index.php?$query_string;
           disable_symlinks off;
        }

        location @ee {
            rewrite ^(.*) /index.php$1 last;
        }

        location ~ \.php$ {
            include fastcgi_params;
            fastcgi_pass unix:/tmp/php-fastcgi.socket;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME
            $document_root$fastcgi_script_name;
        }

        # This location is for our EE index.php gateway
        location /index.php {
            include /usr/local/etc/nginx/fastcgi_params;
            set $script     $uri;
            set $path_info  $uri;
            # this will set the path_info when it exists as query string: /index.php?/something/here
            if ($args ~* "^(/.+)$") {
                set $path_info  $1;
            }
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME
            $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $path_info;
        }
    }

}

```

# Answer
> 0 votes
Please try using `RewriteRule ^(.*)$ /index.php?/$1 [L]` to remove `index.php?` from website URL for `Apache`.

You can also try below code for `Ngnix`.

`if ($request_uri ~* "^(.*/)index\.(html?|php)\/?(.*)$") { return 301 $1$3; }`

---
Tags: multi-site-manager, nginx
---


title: Cannot access sql manager

text:
# Question
Title: Cannot access sql manager
I cannot access sql manager on a site which is running EE v 4.0.8 I've checked the file permissions and they look fine. This is the error message. Any suggestions of what to check next?

```
View file not found: utilities/sql/manager
ee/EllisLab/ExpressionEngine/Service/View/View.php:331

Stack Trace: Please include when reporting this error
#0 ee/EllisLab/ExpressionEngine/Service/View/View.php(83): EllisLab\ExpressionEngine\Service\View\View->getPath()
#1 ee/legacy/libraries/View.php(39): EllisLab\ExpressionEngine\Service\View\View->render(Array)
#2 ee/legacy/libraries/Cp.php(252): View->render('utilities/sql/m...', Array, false)
#3 ee/EllisLab/ExpressionEngine/Controller/Utilities/Sql.php(117): Cp->render('utilities/sql/m...', Array)
#4 [internal function]: EllisLab\ExpressionEngine\Controller\Utilities\Sql->index()
#5 ee/EllisLab/ExpressionEngine/Core/Core.php(240): call_user_func_array(Array, Array)
#6 ee/EllisLab/ExpressionEngine/Core/Core.php(109): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#7 ee/EllisLab/ExpressionEngine/Boot/boot.php(146): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#8 htdocs/cmssystem.php(147): require_once('...')
#8 htdocs/cmssystem.php(147): require_once('...')

```

# Answer
One of my system files did not get deployed correctly to the remote server. Unsurprisingly this was the result!
> 0 votes

---
Tags: database, sql
---


title: Add multiple images at once

text:
# Question
Title: Add multiple images at once
I am using Channel Images v 7.0.0 with EE 4.2

The capability to add multiple images at once - that is intended for just **one** channel entry, correct?

For example, I have a page showing a company's Staff Members - the HTML mock-up is here.

I thought I could upload all the staff images at once into a designated file directory and then select the image assigned to each member/channel entry.

But that does not seem to be the case, am I right - ?

# Answer
Channel Images is not made to select pre uploaded images. Basically it does not even have any proper destination to store images. When you create an entry, EE generates Entry ID for that entry and channel images creates new directory for that entry to store those images. Thus it is not possible to just select photos.

You can't even use Assets as an alternative as I show your HTML mockup, It has title, job designation and description with each image.

You now need to use channel images like that or you can switch to normal file field with GRID (You can upload all images at once via FTP in your upload directory and sync it from EE file manager)
> 1 votes

---
Tags: channel-images, ee4
---


# Question
Title: Cartthrob quantities based on quantity textfield
I'm displaying a single add\_to\_cart\_form and would like to have my select field for the quantity to reflect a number that I have in an "quantity" custom textfield. Currently, I have the following within my add\_to\_cart\_form tags:

```
<select class="w-select" name="quantity">
    <option {selected} value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">9</option>
    <option value="10">10</option>
 </select>
{if '{quantity}' == '' OR '{quantity}' == '1'}<input class="add btn w-button" type="submit" value="Add to Cart">{/if}
{if '{quantity}' == '0'}<p class="gray btn w-button">Sold Out!</p>{/if}

```

But, I would rather have the options reflect the amount of items available in the inventory. For example, for this item, I most commonly will have 5 available, but sometimes 3, sometimes 20. No matter how many there are, the price will be the same for each item, so using the multiple quantity option does not make sense.

It is entirely possible that this is super simple and I'm overthinking it, but thought I would ask.

Thanks in advance for your time!

# Answer
> 0 votes
I don't think there is any native solution for this. Only possible solution I can suggest is to enable PHP and run for loop for options:

```
<select class="w-select" name="quantity">
<?php for ( $i = 1; $i <= count({quantity}); $i++ ) { ?>
    <option value="<?= $i;?>" <?php if($i == 1) {echo 'selected';}?> ><?= $i;?></option>
    {!-- You can also break loop on maximum number you want for a sinlge item to be sold --}
    <?php if( $i == 20 ){ break; }?>
<?php } ?>
</select>

```

If you not want to enable PHP in template, You can create a small Plugin file too for handle this.

---
Tags: cartthrob
---


# Question
Title: How do I delete users without deleting their content?
I need to delete users from an ExpressionEngine site, version 2.7.2. How do I do it without deleting their respective entries and content?

This question might be a duplicate - What happens if I delete a member, does it delete their entries? \- but I don't have the reassign option. I only get a warning:

```
Are you sure you want to delete these members?

guest_user
THIS ACTION CANNOT BE UNDONE

```

# Answer
I believe it only gives you the option to reassign if they actually have content. At least thats what I thought? Maybe it just looks at the users channel posting priviledges before offering the re-assign option...

Has guest\_user actually posted anything yet??

Another option is to create another member group based on "banned" or "guest" and instead of deleting a user move them in to your new sand-boxed group...
> 1 votes

# Answer
You could just change their member information to whatever you wish. If one of the goals of deleting their account is to remove access to the EE CMS, changing them to a lower-level member could do it. Also, you could create a new member group and assign them to it -- something like "legacy authors" and then you can change the permissions for the group. The benefit of this method is that it would allow you to keep them in the author dropdown in the CMS -- and the next time you need to do this, that group is already set up.
> 1 votes

---
Tags: delete
---


# Question
Title: Implement custom content on channel entries like Wordpress Shortcodes
We would like to add blocks of HTML that we have styled in channels. Similar to the functionality of a Wordpress shortcode. So if we need for example a stylized quote that has predefined html and styles, we could insert that anywhere into our channel entry.

In Wordpress if you do \[my\_shortcode\], it can potentially spit out

```
<div class="example">hello</div>

```

Or a more robust example

\[quote variable="test" img="something.jpg"\]

which could spit out

```
<div class="quote">
 <img src="something.jpg" />
 <p>test</p>
</div>

```

So we need to be able to have a number of different types of these and use them in any order on **channel entries**

Also I'm talking about the editor screen on admin when making entries for stuff like blog. So i need to input this php code or html on the rich text editor or somewhere on the editor screen.

# Answer
Sounds like you are wanting either EE's Template Variables or Template Partials.

In either case you define some content and associate it with a custom tag - then whenever EE encounters the tag in your templates, it replaces the tag with whatever content you have associated with it.

From the look of your examples, you probably want to use Template Partials to do what you are trying to do.

From the EE documentation:

> In both cases, ExpressionEngine is simply swapping out a tag with the contents of that tag. However, there is a big difference in when that swap takes place,
>
> Template variables are one of the last tags on the template that are parsed, so they are great for static content, meaning content that does not contain other tags.
>
> Template partials are one of the first tags parsed, so if you want to put other tags in a Template partial, those tags will still be seen and parsed just fine.

HTH
> 0 votes

# Answer
Well, I found a third-party plugin that helped me achieve exactly what I wanted, however, it wasn't a free solution. ($100 price tag).

https://eebloqs.com/

You can have your predefined HTML and use the fields from this addon to populate your HTML. You can rearrange in any order on the channel entry page. Use all or none of your fields.

Basically a GUI shortcode. Ideal for clients that don't want to touch HTML
> 0 votes

# Answer
If you use WYGWAM and set up "content templates" you can accomplish "short codes" in a WYSIWYG environment. It's actually something better than short codes.

https://www.youtube.com/watch?v=a7zZ7MXX7EM

Have a look at this Youtube video (skip ahead to 3:00 minute mark) to see an example of what it would look like for an editor/content creator to work with.

I have an EE4 site in which I migrated content from Wordpress and had to "expand" all those short codes during import. I used this method.
> 0 votes

---
Tags: entry, dynamic, shortcode
---


title: SEO Lite: "extra" tags in EE 4

text:
# Question
Title: SEO Lite: "extra" tags in EE 4
I am trying to get the {extra:...} tags to work (per the docs) in EE4 but am having no luck.

In my config.php file, I have the following:

```
$config['seolite_tab_title'] = 'SEO';
// Pull additional info for SEO Lite
// channel_id => array(field_id => tag_name)
$config['seolite_extra'] = array(
  // home channel:
  '5' => array(
    'robots' => array(
      'field_id' => 62,
      'field_type' => 'text'
    )
  ),
);

```

The SEO Lite template (in the CP) is as follows:

```
<title>{title}</title>
<meta name='description' content='{meta_description}'>
<link rel='canonical' href='{canonical_url}'>
<meta name="robots" content="{extra:robots}">

```

The output is fine for the first three lines, but the robots tag outputs like so:

```
<meta name="robots" content="">

```

On the Devot:ee site, someone noted that the extra tags don't work in EE4. Is this correct? If so, does anyone have a workaround/fix (besides just using the field natively with EE code/syntax)?

# Answer
In case anyone else is looking for the answer to this - it has been fixed in v1.5.5 which can be downloaded here: https://github.com/bjornbjorn/SEO-Lite/releases

Changelog: http://wedoaddons.com/seo-lite/changelog
> 0 votes

---
Tags: seo, seo-lite, ee4
---


# Question
Title: How to detect an AJAX request in a EE4 template?
What's the best practive to detect an AJAX request in EE4 without activating PHP in the template?

With the previous version of EE, I used the Ajax Detect Conditional ({if ajax}, {if not\_ajax}) from Mo'Variables, but the add-on is not EE4 compatible.

Thank you

# Answer
Use the native `{is_ajax_request}` variable.
> 1 votes

---
Tags: templates, conditionals, ajax, ee4
---


# Question
Title: Parse some data with a plugin before sending as a email (plain text)
I'm trying to create a plugin to greet depends on the time of a day with a different phrase.

The plugin works correctly on the ExpressionEngine environment but at the moment is not able to send any data parsed, rather than plain text in my email.

My email works with a plugin (user) which use the default email for expressionengine to send an email like so:

```
        ee()->email->wordwrap = true;
        ee()->email->from(
            ee()->config->item('webmaster_email'),
            ee()->config->item('webmaster_name')
        );
        ee()->email->to($email_data['to']);
        ee()->email->subject($email_subject);
        ee()->email->message($email_template);
        ee()->email->send();

```

My plugin instead looks like that:

```
class Time_greeting {

    public $greetings = "";

    public function greeting()
    {

        $ee = $this->EE =& get_instance();

        $tagdata = $ee->TMPL->tagdata;

        $time = date("H");
        $timezone = date("e");
        if ($time < "12") {
            $greetings = "Good morning";
        } else
        if ($time >= "12" && $time < "17") {
            $greetings = "Good afternoon";
        } else
        if ($time >= "17" && $time < "19") {
            $greetings = "Good evening";
        } else
        if ($time >= "22") {
            $greetings = "Good night";
        }
        return $greetings;
    }
}

```

And I'm calling it in a template like that:

```
{exp:time_greeting:greeting} {name},

To reset your password, please go to the following page:

{reset_url}

```

As you can expect, it works fine inside ExpressionEngine in any template.

Is there any way to parse the plugin before sending the email so I can get a phrase like I explained?

# Answer
You can use template text to send email, And you can put your variables within Curley braces. And you can replace those with your dynamic values inside your plugin.
> 0 votes

---
Tags: php, email, plugin, users
---


# Question
Title: Stored images limit per entry - Channel Images
I have an entry with 125 images in a channel images field.

Since the website is multi-linugal, a related entry needs to have the same number of images.

However, the limit of stored images seem to be 50.

How can we have all the stored images for a related entry.

And also it would be great if there was an add all images and remove all images button.

Am using EE 2.11.9 and Channel Images 5.4.19

# Answer
For the channel images field where you're hitting the limit, go to the field settings:

Channel Fields \> Your\_field \> Fieldtype Settings (tab) \> Image Limit

and set as blank for unlimited images.
> 1 votes

# Answer
By default Channel Image show first 30 images. If you want to display all of them you need to set a limit higher than your total number of images.

See Doc - limit

> limit - This parameter limits the number of images on any given page. The limit will default to 30 entries if a value is not specified. If you are using pagination then this will determine the number of entries shown per page.

Example:

```
{exp:channel_images:images limit="100"}
{image:title}
{/exp:channel_images:images}

```
> 1 votes

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


# Question
Title: How to set adaptive web design in ExpressionEngine
I am new in web development. and I wants to use the adaptive web designs in expression engine. can any help me that how we will use multiple screen sizes (Desktop, Mobile, Tablet) templates in expression engine. for example if we are saying home page template then i wanna create 3 different templates for home page. 1 for mobile 1 for tablet and 1 for desktop. system will automatically detect the device. my question is how to use multiple templates for home page.

**Adaptive Web Design:**

Adaptive web design is different from responsive design in that there isn’t one layout that always changes. Instead, there are several distinct layouts for multiple screen sizes. And the layout used depends on the screen size used. For example, there could be a specific layout for mobile phones, tablets, and desktop computers – each of which are made in advance. These three designs wait on standby until someone visits the site. The site detects the type of device used, and delivers the pre-set layout for that device. So instead of a single ball going through several different-sized hoops, you’d have several different balls to use depending on the hoop size.

Thanks in advance.

# Answer
> 2 votes
ExpressionEngine was made to be a blank slate, is a design- and content-agnostic CMS. What does this mean?

Unlike WordPress and some other CMS, ExpressionEngine adapts to your design rather than the reverse.

It is template-drive, not theme-driven, and your templates may contain any code you want, including JavaScript, HTML, XML, JSON, etc.

It is a powerful tool for developing customized websites without compromising on layout or features.

---
Tags: php, ee
---


# Question
Title: In Expression Engine 4, live look preview is displaying A HREF links
Instead of a normal blue link, LIVE LOOK renders the link like this:
\[url="http://www.geomagic.com" target="\_blank"\]Geomagic\[/url\]

I am using EE 4.1.3.

How can I prevent the live look preview from rendering the URL links within an article? I would like the links to display as normal "a href" links. I have WYGWAM installed and the {body} field is set to use the WYGWAM add-on. This display issue above also happens on non-WYGWAM fields in live look, too. I would like the links to just render as normal links.

Are there settings or defaults for live look?

Can we update the default CSS/JS live look uses to alter the URLs? I have used a method similar to this for "printer friendly" pages.

# Answer
> 0 votes
I found a solution to my own question.

After figuring out that I needed to identify the WYGWAM field as an XHTML-formatted field, I used a simple add-on -- Typography-ee.

https://buzzingpixel.com/software/typographee

This worked:

```
{exp:typographee:parse text_format="xhtml"}
   {body}
{/exp:typographee:parse}

```

I use this just for my preview template.

---
Tags: ee4, livelook
---