title: Solspace Tag - randomly not working

text:
# Question
Title: Solspace Tag - randomly not working
I have a rescue site where Solspace Tag is in use and seems to be randomly not working even though there are tags in entries.

EE 3.5.11 Tag 5.0.7

Most entries the exp:tag\_relate\_entries tag is working correctly. However on a couple of entries it is return no results despite there being results.

code:

```
      {exp:tag:related_entries channel="blog|self_help|books|music|bija-in-the-media|film_and_video|services|about_pages" orderby="relevance" limit="4" url_title="{embed:urltitle}"}

        {if tag_no_results}
            <div class="col-xs-6 .col-md-3">
                <p>No Related Entries</p>
            </div><!-- /.col-xs-6 -->
        {/if}

      <div class="col-xs-6 col-md-3">
        <a href="{if page_uri != ''}{page_url}{if:else}{comment_url_title_auto_path}{/if}">
          <div class="tile">
            <img class="img-responsive" src="{featured_image:ymal}" alt="" width="100%">
            <div class="description green-{switch="1|2|3|4"}">
              <h3>{title}</h3>
            </div>
          </div>
        </a>
      </div>
      {/exp:tag:related_entries}

```

I have also added a testing div where I have hard coded tags that are in the entry looking for related tags and it outputs dozens of tags

```
    {exp:tag:entries tag="breath|breathing|breathing into life|poem|poetry|practice"}
        title: {title},
    {/exp:tag:entries}

```

See attached screenshot

# Answer
Have you tried setting the tag group parameter? Never hurts. https://solspace.com/expressionengine/tag/docs/related\_entries/#tag\_group\_id

I would also try adding status=, some of the related entries not showing might have a weird status that is not "open".

Try looking at an entry whose related entries shows correctly and one that does not and look for any differences.
> 0 votes

# Answer
One other time I have seen this before was when another customer's site had dozens (or hundreds) of duplicate and/or malformed tags (including blank ones). Check to see if this site has any of those, and remove them to see if it resolves the issue. :)
> 0 votes

---
Tags: solspace, solspace-tag
---


# Question
Title: Zeal Smart Members - Reset Password form while logged in
We're using EE3 and Zeal Smart Members to handle the login, reset password etc.. functionality.

Is there a way to use the Reset Password form while logged in?

Currently the Reset password for seems to detect that your logged in and just displays the message "You are already logged in"

# Answer
> 0 votes
Under **mod.smart\_members.php** file go to **reset\_password** function and comment out first if condition. that will now allow you to reset password while logged\_in.

---
Tags: members, password
---


# Question
Title: Template Routing with extra segments, how to catch 404's?
I'm using the extra segment approach to direct requests to pages, as described here:

Template Routes and extra segments

This is working great and allows me to create a common wrapper for pages, but how do I deal with 404's?

It doesn't seem to matter what I set 'Template to be used as the 404 error page' to it still directs to the index/index template, which contains the following:

```
{embed='pages/{segment:extra}'}

```

and so always gets 'resolved'.

is there a way that I can test that this calls a valid page: {embed='pages/{segment:extra}'}

Or is there another approach I could use?

# Answer
> 0 votes
Seems like your index page not have any restriction to check weather the entry exists or not. You can do this with various ways. Best way is to put a condition under channel entry of that page that will redirect to 404 if no entry is match with it.

```
{exp:channel:entries
    channel="CHANNEL_NAME"
    disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks|relationships"

    {!--No parameters if your entries URL title is last segment--}
    {!--OR--}
    {!--If you have entry_id--}
    dynamic="no" entry_id="{ENTRY_ID}"

    {!--If you have URL title--}
    dynamic="no" url_title="{segment_2}"

    {!--If page is dynamic (Pages module redirct page or some way dynamic page) --}
    require_entry="yes"
}

    {!-- Syntax to call 404 is {redirect="404"} --}
    {if no_results}{redirect="404"}{/if}

    {!--My channel content etc.--}
{/exp:channel:entries}

```

---
Tags: 404, template-routes
---


title: Upgrade to EE3 breaks MSM

text:
# Question
Title: Upgrade to EE3 breaks MSM
I'm a little confused here and haven't found anything the clearly explains this. I recently upgraded our EE2 site to EE3. Previously we had purchased the MSM with 16 sites. After upgrading to EE3 none of my subsites work.. the screen is just blank. Do i now have to purchase a full $199 for each site or is something else going on here? Any info is appreciated. Thanks!

# Answer
> 1 votes
Yes, you do need to upgrade the MSM site licenses. The updates are $99 USD each.

https://expressionengine.com/blog/expressionengine-3-pricing-and-upgrades

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


title: Bypass/Allow Disallowed Key Characters

text:
# Question
Title: Bypass/Allow Disallowed Key Characters
I am working on a plugin for EE3/4 which relies on a very specific html input naming structure.

A search form input may have a name attribute which looks like the following:

```
<input name="xy:State|City|Zip(contains)">

```

This causes the `_clean_input_keys` method in the `EE_Input` class to throw the 'Disallowed Key Characters' error which shows up in several posts on stack exchange.

The plugin that our company is building has a core library which is designed to work on any PHP based CMS. For example, my company has the same plugin in works for Craft CMS and it works just fine on that platform. This core library handles converting the above mentioned input naming schema into a query DSL for our service.

Do we have any options open to us concerning how to bypass the regex check the `_clean_input_keys` method performs? We would like to avoid changing our naming convention as it works very well in Craft CMS.

Thanks!

# Answer
I had to modify one of my installations of EE3 to do exactly this. I needed to add pipe characters (|) and Japanese characters to URLS.

You should be able to find the \_clean\_input\_keys function in system/legacy/core/Input.php around line 997.

change the regex to add what you need. If you need to add the pipe character, you might try this:

```
[a-z0-9:_\/ -|]

```

hope that helps.
> 0 votes

---
Tags: forms, html, regex
---


# Question
Title: Template Routing, display both a specific channel entries and a couple of index pages on the root URL '/"
Using Expressionengine 3.5.11

I need to display the entries from a specific channel, thus '/entry-url', this is obviously not difficult, however I also need to display an index page for a couple of other channels at the same URL level, thus

'/news'

'/services'

which would then work thus:

'/news/{entry}'

'/services/{entry}'

I could use an 'if' statement to check for these two first, and if they are not part of the request, then direct the user to the specific channel page, but this would require a change to the if statement every time a new channel is added, I'd like a solution where new channels can be added with no need to update the if statement.

I'm pretty sure this isn't possible as specific filters are required to route to 'news' and 'services', or is there a way?

# Answer
If you have channels `dog` and `cat` that you want to be processed by (the same) different template to the default, you can add a template route for the different template you want to use that looks like this:

`/{big:regex[(dog|cat)]}`

You can get clever than this, and I imagine write a template route definition that generalises the case you are working with so that if you added a new channel the route would automatically work out what to do - but a general heads-up, the code EE3 uses to process template routes is quite buggy and anything even vaguely complex seems to break: so it is quite possible that you would end up wasting a lot of time to end up where you started from... and against this conditionals in templates become an attractive option (I've been there...).

Fingers crossed that this is one of the areas that V4 will fix.

Anyhow, HTH
> 0 votes

---
Tags: 404, template-routes
---


# Question
Title: EE v2.9.2 admin login stops working after upgrade to Mac OS High Sierra
Last week I updated to High Sierra and now can no longer log into the EE admin interface on localhost.

Since High Sierra installs PHP 7, I added PHP 5.6 as my default, but no change. I enabled debugging in both index.php and my admin php, but no errors are shown. No errors in the Apache log either, the admin pages are served with a 200 return code.

The mystery bit is that the site itself is working (albeit very slow).

When running the EE Server Compatibility Wizard it works on and off, and if it does it reports my system to be compatible for an EE install.

I've run out of things to check. Do you have any advice?

Thank you.

Edit: It seems to be an issue with a timeout with calls of the PHP function 'set\_time\_limit'. If I comment them out (in Codeigniter.php line 108, Core.php line 64), the admin login works.

# Answer
Try clearing your browser cookies, and/or truncating the exp\_sessions table.
> 0 votes

---
Tags: upgrade, localhost
---


# Question
Title: EE Freeform {exp:email:contact_form} error
I downloaded Freeform from Solspace free version and with Expression Engine 3, when trying to submit the form I get this error. Email is not part of the form and I don't get why this is happening.

```
Error
The following tag has a syntax error:
{exp:email:contact_form}
Please correct the syntax in your template.

```

Form Code:

```
{exp:freeform:form collection="contact" return="contact/thanks"}
                <ul>
                    <li>
                        <input type="text" id="name" name="name" required placeholder="Your Full Name"/>
                    </li>
                    <li>
                        <input type="text" id="number" name="number" required placeholder="Phone Number"/>
                    </li>
                    <li>
                        <textarea id="user_message" name="user_message" required placeholder="Your Message"></textarea>
                    </li>
                    <li>
                        <input type="submit" class="btn" value="Send Message"/>
                    </li>
                </ul>
            {/exp:freeform:form}

```

Any ideas? The strange thing is that when I check EE CP I get the emails there but don't get notification via email.

# Answer
> 0 votes
The core version of EE3 does not include the email module. So the system doesn't recognize the tag and passes back an error.

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


# Question
Title: How do I output the full URL for an entry, including the category paths?
I'm try to output an Entry URL like this, which includes the Category URL Titles:

```
/products/category/sub-category/sub-sub-category/entry-url-title

```

But I can't work out how to achieve this. Any ideas anyone?

**EDIT**

This is the code I have so far, but I don't know how to inject the category URLs into the link:

```
{exp:channel:entries channel="products"}
    <a href="/products/*** category urls to go here ***/{url_title}">{title}</a>
{/exp:channel:entries}

```

# Answer
> 0 votes
What version of EE are you using? In EE2 there is nothing native out of the box that does this. But this will help you do it:

http://gwcode.com/add-ons/gwcode-categories/

Using GWCode Categories your template code should look something like this:

```
{exp:channel:entries channel="products"}

<a href="/products
   {exp:gwcode_categories channel="{channel_short_name}"
                          entry_id="{entry_id}"
                          max_depth="3"
                          style="linear"
   }
   /{cat_url_title}
   {/exp:gwcode_categories}

/{url_title}">{title}</a>

{/exp:channel:entries}

```

---
Tags: categories, url-title, child-categories
---


title: Date and Time formatting

text:
# Question
Title: Date and Time formatting
I have a date and time that works great

```
format=" %F %j, %Y; %g:%i %a" prints out > December 2, 2017; 7:30 pm

```

However, in some instances, I don't have the time, but I still want to show the date. I will come back in few weeks and put the time in when its confirmed. In the date picker if I leave the date out it prints 12:00 am Is there a workaround for this.

# Answer
You could try something like this:

```
{if '{my_date_field format="%g:%i %a"}' == "12:00 am"}
{my_date_field format=" %F %j, %Y"} {!-- date without time --}
{if:else}
{my_date_field format=" %F %j, %Y; %g:%i %a"} {!-- date with time --}
{/if}

```
> 3 votes

---
Tags: datetime
---


# Question
Title: Add item to main menu (nav-main-author) in CP
Using Expressionengine 3.5.11

I would like to add another item alongside:

* 'Create'
* 'Edit'
* 'Files'
* 'Members'

in the Admin control panel for for creating Pages.

I found instructions for adding a custom dropdown menu but that's not what I want. According to Ellis Labs docs Pages should have been added to the Create menu when I installed it, but it wasn't.

Will I have to do this by hacking the template?

# Answer
> 0 votes
You can add a link to that pages. Go in *Setting -\> Menu Manager -\> Manage* (a menu set of you choice) and *Add Menu Item -\> Single Link -\>* https://yourdomaine/yoursystemfolder/index.php?/cp/addons/settings/pages OR directly the channel where you want to create the page. The new item menu will appear below the main menu.

---
Tags: control-panel
---


# Question
Title: javascript error on tagger autocomplete EE3
After an upgrade to EE3 using Tagger 4 by DevDemon, I'm getting javascript errors in the console when Tagger is trying to autocomplete/suggest a tag to use. The error is:

```
https://domain.com/undefined&ajax_method=tag_search?term=paint

```

Any suggestions on how to fix this?

# Answer
The tagger uses Ajax to call the autocomplete function which was getting the wrong url in **tagger\_pbf.js** file on **/themes/user/tagger/** path.

> We have updated line 22 and 36 to set Tagger.ACT\_URL with Tagger.AJAX\_URL.

Autocomplete suggestions are working fine for me now.
> 2 votes

---
Tags: devdemon, devdemon-tagger, tagger
---


# Question
Title: Freeform Next - Questions About Dynamic Notification Recipients
I have a job application form set up that will need to alert a few people by default (owner and admin assistant). I have those set up in the form settings, under Notify -\> Admin Recipients. The job recruiter (which varies among the jobs) also needs to be notified. So I'd like to set this in the template using

```
dynamic_notification_recipients="{recruiter_email}"

```

and set my template

```
dynamic_notification_template="test.html"

```

My questions:

* Setting it up this way, will both the "Admin Recipients" (those to receive it by default) and the recruiter be notified?
* Is the template that I need to refer to one that I set up via the "Email Templates" settings (similar to the ones I did under Formatting Templates)?
* Does just the recruiter receive the email using the TEST template, while the "Admin Recipients" receive the default notification that is referenced in the form settings? Or does this override that setting, and everyone get an email using the TEST template?

# Answer
After doing some testing, the answers are as follows:

* Yes both the people in the "Admin Recipients" and the people listed via the overrides will receive notifications.
* Yes, the template will be set up via "Email Templates" in the general Form settings area.
* The people listed in the overrides will be notified via the template that is set via the overrides setting. The people listed in the "Admin Recipients" setting in the individual form will be notified via the form listed in that setting. This could be the same template.
> 0 votes

---
Tags: solspace-freeform-next
---


# Question
Title: nothing happens when i click upload files on channel files with channel form
Nothing happens when i click upload files on channel files with channel form

{exp:channel:form channel="news"} {field:floor\_plans} {/exp:channel:form}

# Answer
> 1 votes
I found that it's a jquery conflict, I just remove the jquery include from script tag and it works.

---
Tags: devdemon, channel-files
---


# Question
Title: Trying to get category name to show on category page
I have a template for categories and I am trying to get the catgeory name in the meta title of the page (or anywhere on the page).

I thought it was just as simple as

```
<title>{category_name} – {site_name}</title>

```

But it's not. I've tried trying to find my answer but to no avail.

# Answer
> 1 votes
There are different ways of create a category page.

If you're using the "default" way, the Channel Category Heading Tag can help you:

```
{exp:channel:category_heading}
    <title>{category_name} – {site_name}</title>
    {if category_description}
        <meta name="description" content="{category_description}" />
    {/if}
{/exp:channel:category_heading}

```

Remember to not put it inside a Channel Entries tag.

The Category ID needs to be in the URL. Or the Category URL Indicator and the category URL title.

# Answer
> 0 votes
If you are not using category ID's in the category page URL
example: www.websitename/blog/category/events

Code for category template:

```
{if segment_2 == 'category'}

{!-- code for showing category title on pages not using URL category ID's --}
  {exp:channel:categories channel='blog' style='linear'}
    {if category_url_title == segment_3}
      {category_name}
    {/if}
  {/exp:channel:categories}

{!-- fallback for pages using URL category ID's example: /blog/category/C4 --}
  {exp:channel:category_heading}
    {category_name}
  {/exp:channel:category_heading}

{/if}

```

---
Tags: categories, templates
---


title: Revisions not saving

text:
# Question
Title: Revisions not saving
All my channels are set to save revisions, but only some channels do and some do not. I cannot figure out the reason. I should admit that i updated the ee\_channels table to set the max\_revisions from 10 to 100 to save time, but i doubt that could have done anything.

Anyone have any idea what else could be causing this?

EE v2.9.3

# Answer
> 1 votes
Ok, i figured it out. I didn't realize at first but the data was migrated, and while the channel was a Y for revisions, the entries were not.

---
Tags: versioning, revisions
---


title: trying to display event recurrences

text:
# Question
Title: trying to display event recurrences
This is for an event detail page, I'd like to list all recurrences of an event. My current template code is displaying the start date and all recurrences, including the first date, so it's showing the start date twice. Any way to not get it to do that? I can't just remove the event\_start\_date tag as some events will only have one day and no recurrances.

```
      {event_dates}
                    {calendar:event_start_date format="%l, %F %j, %Y"}
                        {if calendar:event_all_day}
                        {if:else}
                            {calendar:event_start_date format="%g:%i%a"} -
                            {if calendar:event_multi_day}
                                <br />{calendar:event_end_date format="%l, %F %j, %Y at %g:%i%a"}
                            {if:else}
                                {calendar:event_end_date format="%g:%i%a"}
                            {/if}
                        {/if}

                    {if calendar:event_recurs}
                        <br />
                        {calendar:recurrences
                            date_range_start="today"
                            date_range_end="18 months"
                            limit="5"
                            backspace="6"
                        }
                            {calendar:recurrence_start_date format="%l, %F %j, %Y"}
                            {if calendar:event_all_day}
                            {if:else}
                                {calendar:recurrence_start_date format="%g:%i%a"} -
                                {if calendar:event_multi_day}
                                    <br />{calendar:recurrence_end_date format="%l, %F %j, %Y at %g:%i%a"}
                                {if:else}
                                    {calendar:recurrence_end_date format="%g:%i%a"}
                                {/if}
                            {/if}
                            <br />{/calendar:recurrences}
                    {/if}
       {/event_dates}

```

The code above is returning this on the front end...

And here are the event settings...

# Answer
> 1 votes
Calendar is doing exactly what is expected here. To achieve what you're after (if I understand correctly), something you could consider trying is code like this:

```
   {event_dates}
      {if calendar:event_recurs}
         {calendar:recurrences
            date_range_start="today"
            date_range_end="18 months"
            limit="5"
            backspace="6"
         }
            {calendar:recurrence_start_date format="%l, %F %j, %Y"}
            {if calendar:event_all_day}
            {if:else}
               {calendar:recurrence_start_date format="%g:%i%a"} -
               {if calendar:event_multi_day}
                  <br />{calendar:recurrence_end_date format="%l, %F %j, %Y at %g:%i%a"}
               {if:else}
                  {calendar:recurrence_end_date format="%g:%i%a"}
               {/if}
            {/if}
            <br />
         {/calendar:recurrences}
      {if:else}
         {calendar:event_start_date format="%l, %F %j, %Y"}
         {if calendar:event_all_day}
         {if:else}
            {calendar:event_start_date format="%g:%i%a"} -
            {if calendar:event_multi_day}
               <br />{calendar:event_end_date format="%l, %F %j, %Y at %g:%i%a"}
            {if:else}
               {calendar:event_end_date format="%g:%i%a"}
            {/if}
         {/if}
      {/if}
    {/event_dates}

```

If the event recurs, it'll display the upcoming recurrences. If it's a regular event without recurrences, then it should show the regular event info. I haven't tested this, but it should work. :)

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


# Question
Title: status= not working on mx google maps tag exp:mx_google_map:search
I want to only show entries with the status of open.

Currently closed entries are also showing when using the following tag

exp:mx\_google\_map:search

Any ideas if it's possible?

I thought of doing a search:status="open" but that didn't work either.

# Answer
Can you try:

{exp:mx\_google\_map:search channel="articles" ...}

{entries} **{if status == "open"}**

**{/if}** {/entries}

{/exp:mx\_google\_map:search}

http://www.eec.ms/user\_guide/mx-google-map/tags.html#lv27

> For result ({exp:mx\_google\_map:search}) addon used channel class , so you can used all Channel tags inside {entries}{/entries} tags.
> 0 votes

---
Tags: mx-google-map
---


title: Display Parent Category

text:
# Question
Title: Display Parent Category
EE3

Is it possible to display the parent category of the current entry?

```
    {exp:channel:entries
        channel="news"
        disable="member_data|pagination|trackbacks"
        dynamic="no"
        limit="7"
        category="24|26"}

    {categories}
            {parents}
                    {parents:title}
            {/parents}
    {/categories}

{/exp:channel:entries}

```

# Answer
> 3 votes
Yes of course, you should use GW Code Categories. After installing that plugin, please try below code. I think it will work to get parent category.

```
{exp:channel:entries channel="channel_name" disable="categories|category_fields|member_data|pagination|trackbacks|relationships" dynamic="no"}
    {exp:gwcode_categories entry_id="{entry_id}" style="linear" depth="1"}
        {cat_name}<br>
    {/exp:gwcode_categories}
{/exp:channel:entries}

```

# Answer
> -1 votes
You just need to specify which field from your news channel you want to do the looking up from. See this very clear example in the EE3 documentation.

```
{exp:channel:entries channel="childChannel"}
  {parents field="relationship_field"}
    {parents:title} - {parents:field1} - {parents:field2}
  {/parents}
{/exp:channel:entries}

```

---
Tags: categories
---


# Question
Title: Creating a button in module control panel to manually perform module action in EE 2
I have a module with an action that is in the actions table. I need to be able to click a button in the module control panel which will perform the action(which usually takes about 15 seconds to complete) and then show a success message on completion. I've been through the module tutorial and could not get it working. Some help and guidance would be GREATLY appreciated. Thanks.

# Answer
I suggest you to use below code in `mcp` file of your `module` folder.

```
url = BASE .'&'.'C=addons_modules'.'&'.'M=show_module_cp'.'&'.'module=MODULE_NAME'. '&' . 'method='.$method;
$this->EE->cp->set_right_nav(array('Button Title'  => $url));

```
> 1 votes

---
Tags: ee2, control-panel, module, action
---


# Question
Title: categories inside the Edit Entry publish tab?
It is possible to display categories inside the Edit Entry publish tab with EE3, to facilitate the use of publishing ?

Does an add-on exist to display the categories on this first tab ?

# Answer
Yes of course it is possible. For that you just have to go into `layouts` of respected Channel. And then drag and drop the categories under Publish tab.
> 2 votes

---
Tags: categories, entry, publish-layout
---


# Question
Title: Wygwam character limit for Cyrillic text
I'm finding that Cyrillic text entered into a Wygwam field is truncated. Is this because there is a limit for character rendered in unicode?

# Answer
It seems that there is a limit to the size of the table in the database. In my case the easiest solution was to add an extra text field.
> 0 votes

---
Tags: wygwam
---


title: Blank White Page in Control Panel

text:
# Question
Title: Blank White Page in Control Panel
Strange problem has just manifested out of nowhere (seemingly). Basically when trying to edit an existing or publish a new entry in the CP it redirects to a blank page and does not save.

No errors reported when debugging turned on and no errors in server log.

Not sure how to start troubleshooting this one. Any ideas?

# Answer
> 1 votes
I've found this to be helpful in resolving the "white screen of death", which is usually a fatal error in PHP.

https://gist.github.com/litzinger/5598641

Hope it helps!

---
Tags: control-panel, white-screen-of-death
---


title: ChannelImages Fatal Error PHP 7

text:
# Question
Title: ChannelImages Fatal Error PHP 7
I'm getting the following fatal error when trying to load EE 2.11.2 with ChannelImages 5.4.19 under PHP 7/7.1:

> Fatal error: 'continue' not in the 'loop' or 'switch' context in /home/omart/public\_html/system/expressionengine/third\_party/channel\_images/libraries/image\_helper.php on line 913

Here is the code snippet in question. Line is 913 is the last if statement:

```
//----------------------------------------
        // Channel?
        //----------------------------------------
        if (strpos($param_channel, '|') !== FALSE)
        {
            $channel_id = array();
            $temp = explode('|', $param_channel);

            foreach($temp as $item)
            {
                if (isset($channels[$item]) == FALSE) continue;
                $channel_id[] = $channels[$item];
            }

            return $channel_id;
        }
        else
        {
            if (isset($channels[$param_channel]) == FALSE) continue;
            else return $channels[$param_channel];
        }

```

# Answer
> 1 votes
Replace code `continue;` with `return false;` statement.

---
Tags: ee2, channel-images, php-errors
---


# Question
Title: Unable to pick a few elements after migrating
I have recently cloned my ExpressionEngine CMS (2.3) website to a new VPS with Plesk as its control panel.

For cloning, I copied all my files and imported the database from existing website into the new VPS.

When I preview the website or change my hosts file to view the website from my VPS, I see that a few elements are not getting picked (Screenshot attached).

So, I think it is just a matter of setting the correct relative/absolute paths in the preferences, but after trying many options, it doesn't seem to work. Does anyone know where to go from here? Thanks.

# Answer
Have you seen to it that the paths you're associating templates with are:

1. the correct path? Maybe templates have moved.
2. the path has the correct permissions? If files are there but not readable, this is the same result
> 0 votes

---
Tags: ee2, php, javascript
---


# Question
Title: {segment_category_ids_piped} only returning one cat id
EE3

first\_segment = /cycling

I've added the following to a template:

```
{segment_category_ids_piped}

```

But it only returns a single category, even though 'cycling' is present in 2 category groups, and twice in one group!

# Answer
If you have multiple categories with the same URL title, then this caveat applies:

> If there are multiple categories with the same url\_title, but in different groups, this extension will only return one of those. So best make sure your category url\_titles are unique, or you select the relevant Category Groups in the settings so they are.

The `piped` var is meant to be used if there are multiple categories in the URI, so something like `/foo/cat1/cat2` would return `1|2` for those two categories.
> 1 votes

---
Tags: low-seg2cat
---


# Question
Title: Is there any setting in Expression Engine that does not permit cross-origin framing?
Running EE 3.5.11

In the portfolio section of my website, I display websites that I have built using an iFrame. Most of them work and display properly, but there are a handful of ExpressionEngine sites that I built that do not show properly, but instead I get the following console error:

> does not permit cross-origin framing

One that works correctly: http://rouviere.com/our-work/project/se-wind-supply-chain-map

One that does not work correctly: http://rouviere.com/our-work/project/cameron-clinic

They all use the same code for the iFrame:

```
<iframe id="webview"  src="{website_url}"></iframe>

```

I contacted the host for the sites that do not display in the iFrame and they said that they do not have any server settings that would be blocking cross-origin framing.

Any suggestions for solving this would be appreciated.

# Answer
Le sigh... I always forget to RTFM.

https://docs.expressionengine.com/v3/general/system\_configuration\_overrides.html#x-frame-options

You can set it in your `config.php` to `NONE`.

**Edit** Just FFS, here's how I figured it out:

```
cd ~/ee3-path/
grep -nr X-Frame-Options

```

Results had this line:

```
ee()->output->set_header('X-Frame-Options: '.$frame_options);

```

Next up:

```
grep -nr \$frame_options

```

Results:

```
$frame_options = ee()->config->item('x_frame_options');

```

Hrmm config...damnit, config item.
> 3 votes

# Answer
They do. They are just not trying for you, or are not able to figure out where the header is being set. It is perhaps being set by a reverse-proxy like CloudFlare. Perhaps try adding the sandbox attribute to your iframe and see if setting `allow-same-origin` helps your issues.

Read up on the attribute here:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

Yes, to confirm, your iframe that isn't loading is at a url that is giving this response header:

```
X-Frame-Options:SAMEORIGIN

```

Outside of the frame. They are serving that X-Frame-Option some how. Having dealt with people like this...

One suggestions; learn to use `curl` to output response header. Then send the web host support your exact CLI `curl` command and output, so they can't say "Hurr durr it's not true". You often have to shove it in someones face to get them to understand and actually try for you.

**Edit** If you have access to these sites servers, look in the vhosts files, the htaccess files, and your index.php file. Header can be set in any of those files. Also looks like that site is fronted by nginx, so perhaps it is an nginx setting (don't know nginx well enough to direct you), or more commonly nginx is used as a reverse proxy (think CDN).
> 0 votes

---
Tags: security, browser
---


# Question
Title: display members list using zoo visitor default members group
I am trying to display a members list using zoo visitor.

I cannot display the default members group. It only displays new custome members group I have created. How can I get this members list to display the default members group #5

```
{exp:zoo_visitor:members group_id="5"}
{visitor:member_lastname} {visitor:member_firstname}
{/exp:zoo_visitor:members}

{exp:zoo_visitor:memberlist group_id="5"
{title} {visitor:member_lastname} {visitor:member_firstname}
{/exp:zoo_visitor:memberlist}

```

# Answer
I think you need to try below code for member list.

```
{!-- Limit as per your scenario --}
{exp:visitor:members member_group="5" limit="800"}
    {visitor:member_firstname} {visitor:member_lastname}
{/exp:visitor:members}

```
> 1 votes

# Answer
I agree with Romans-8---31-39

Although I am not sure about the Zoo Visitor parameter but I am looking at Visitor documentation (EE3) and the parameter is **member\_group** not group\_id. Why not try it?

{exp:zoo\_visitor:memberlist member\_group="5"} {title} {visitor:member\_lastname} {visitor:member\_firstname} {/exp:zoo\_visitor:memberlist}
> 0 votes

---
Tags: members, devdemon, zoo-visitor
---


title: Headlines in social media/metadata

text:
# Question
Title: Headlines in social media/metadata
all,

Just started a new job at a publication and inherited EE, as well as social media accounts.

When I post content to FB/Twitter, though, what would normally be the headline field simply pulls in the name of the publication. I assume there's a really easy fix to this, but just don't know what on the backend would solve the problem.

Let me know when you can and thanks. dave.

# Answer
> 0 votes
There's no such thing as an easy fix ;-) If you want control over what is shown on fb/twitter/G+ etc you are best off serving these sites data in a form they easily can understand. This means using the Open Graph protocol, twitter card data and general microdata formats. Google them for indepth explanations. Basically, if you set your browsertitle and meta description from the contents of an entry, you can use those same fields to power Open Graph/ twitter cards. Say you have

```
<title>{my_entry_title}</title>

```

You can easilly serve facebook an appropriate title for sharing by adding

```
<meta property=”og:title” content=”{my_entry_title}” />

```

Facebook will pick up that title.

Good starter for this kind of stuff is https://blog.kissmetrics.com/open-graph-meta-tags/

---
Tags: metadata
---


title: EE 2.5.2 upgrade to EE 3.5.12 - Error

text:
# Question
Title: EE 2.5.2 upgrade to EE 3.5.12 - Error
I'm getting this error message after a fresh install update. Any one have any ideas on how to fix it?

# Answer
> 0 votes
You can add column 'updated' in exp\_structure table or you can disable structure module extension during upgrade. Once upgrade will be done you can enable it and fix it's bugs.

---
Tags: ee2, ee3, structure
---


# Question
Title: Checking if date field variables exist in templates
I'm having a strange issue where I can't seem to determine whether a standard date field in EE2 contains data. For the date variable {birth\_date}:

{if birth\_date} Do stuff {/if}

In my code, this does the same thing (validates as true) regardless if the date field in an entry has data or not. I have swapped in other field types in place of this and they all behave as expected in the logic, but not the date field. Any idea if logic for date fields needs to be written differently? Seems like it shouldn't but I've spent several hours trying to figure this one out...

# Answer
> 1 votes
So, this is an old boat that doesn't always sail well (EE2 conditionals depending on field type \[sorry for the random metaphor\]).

Here is what you should start off by trying. First, make sure you have two entries with opposite testing criteria (one entry with `birth_date` filled in, one without). Then, in your template, add these tests and check both entries:

```
{!-- First test --}
{if birth_date}
    Test one win!
{/if}

{!-- Second test --}
{if {birth_date}}
    Test two win!
{/if}

{!-- Second test --}
{if "{birth_date}"}
    Test three win!
{/if}

```

There have always been some issues with field truthiness testing in EE2, depending on the version. One of these usually wins.

For a bonus round, do some self-discovery about how the field outputs, regardless of if it is null, false, a valid string, etc... Go ahead and set this template to enable PHP on output. Then, try this in your template with different entry values for `birth_date`:

```
<?php
echo "<br/>Start of dump $$";var_dump("{birth_date}");echo "$$ End of dump<br/>";
?>

```

---
Tags: conditionals, date
---


title: EE 4.0.4 - Save Templates as Files

text:
# Question
Title: EE 4.0.4 - Save Templates as Files
User guide states:

2. Set Template Preferences From the Control Panel, go to **Settings****Template Settings**.

Set Save Templates as Files to **Yes**.

but there is no such setting on the template settings page

whazup?

# Answer
> 2 votes
From **EE3**, it becomes smarter. They had **removed** this option to `Save Template as Files`. It is **automatically** saved all the templates as files **by default**. You just need to create any template group and then provide `Short name` in `General Settings`. It will **automatically** create the folder with your `Short name` and inside it you can find the template group and its files. No need to set `Save Template as Files` to `Yes`.

---
Tags: templates
---


# Question
Title: Can I add related data with a relationship or multiselect field
Simple Example: I have one Chanel "Walks" and another "Walk Variations". I know I can create walk variations and then have a relationship field in Walks to select the correct Walk Variations. What I would like to be able to do is create a walk and then on the same form add multiple walk variations.

Similarly, with a multi-select field is there a way to add an option from the current channel, rather than having to do that separately?

Is that possible? Thanks.

# Answer
Yes, Mufi is right.
For EE2 and EE3 use Grid and for EE4 use Fluid
> 0 votes

---
Tags: relationships
---


# Question
Title: Next / Prev Linking Of Entries in Relationship Field
I have a channel called "course\_content" that contains a relationship field which holds entries from a "lesson\_content" channel.

The user clicks on a course (course\_content) and all of the lessons related to that course are displayed. They then select the lesson that they want to view.

I'm trying to add "Previous" and "Next" links to the lesson entry pages to allow the user to navigate the lessons specific to that course. Currently, I'm using the following code:

```
{exp:channel:prev_entry channel="lesson_content"}

    <a class="older" href="{path=courses/lesson}"><span><i class="icon-left"></i> Previous</span></a>

{/exp:channel:prev_entry}

{exp:channel:next_entry channel="lesson_content"}

    <a class="newer" href="{path=courses/lesson}"><span>Next <i class="icon-right"></i></span></a>

{/exp:channel:next_entry}

```

The problem is that is is looping through the entire "lesson\_content" channel so when you get to the end of the lessons for that class, you continue to lessons from the next class.

I'm sure I need to use an embed, I just can't figure out how to specify just the entries that are found in the same relationship as the entry that is being viewed.

Any help would be appreciated.

# Answer
I ended up using an embed to accomplish this.

Embed Code - based on the EE Forum link: https://expressionengine.com/forums/topic/247219/siblings-tag-cant-handle-dynamic-parameters

```
{embed="courses/lesson-pagination" entry_id="{entry_id}" entry_date="{entry_date format='%Y-%m-%d %H:%i'}"}

```

Embed Template

```
{exp:channel:entries channel="lesson_content"}
              {siblings limit="1" orderby="entry_date" sort="desc" stop_before="{embed:entry_date}"}
                <span class="navigate previous"><a href="{siblings:url_title_path=courses/lesson}"><i class="icon-left"></i> Previous</a></span>
              {/siblings}

              {siblings limit="1" orderby="entry_date" sort="asc" start_on="{embed:entry_date}"}
                <span class="navigate next"><a href="{siblings:url_title_path=courses/lesson}">Next <i class="icon-right"></i></a></span>
              {/siblings}
            {/exp:channel:entries}

```
> 0 votes

# Answer
I don't think you need an embed - have you tried the `siblings` tags?

https://docs.expressionengine.com/latest/fieldtypes/relationships.html#accessing-siblings

Someone has posted a potential solution here: https://expressionengine.com/forums/topic/247219/siblings-tag-cant-handle-dynamic-parameters

To summarise here (untested):

```
{exp:channel:entries channel="lesson_content"}
  {siblings limit="1" orderby="entry_date" sort="desc" stop_before="{entry_date}"}
    <a href="{siblings:url_title_path=courses}">{siblings:title}</a>
  {/siblings}
  {siblings limit="1" orderby="entry_date" sort="asc" start_on="{entry_date}"}
    <a href="{siblings:url_title_path=courses}">{siblings:title}</a>
  {/siblings}
{/exp:channel:entries}

```
> 1 votes

---
Tags: relationships, embeds
---


# Question
Title: This form has expired. Please refresh and try again
I see this is a time-honored problem...

I am using **Freeform 4.1.3** on **EE 2.9.2**. This has been a stable solution for a long time. I have changed nothing with the system. I have been successfully collecting data as recently as last week. I have created a couple of new forms that are essentially clones of forms that still work. And yet I get the dreaded error.

Have tried two browsers, one with no related history. Source code shows hidden fields for both XID and crf\_token values. I have cleared the cache. I cannot turn off caching, getting the "Cannot connect to Dummy, using File driver instead" error message.

I see other threads with solutions that work some of the time for some of the people, but I hate to go twisting knobs when the current configuration has been working fine.

Any help? Simple code:

```
{exp:freeform:form
    form_name="council_nom"
    required="first_name|last_name|email"
    notify_user="yes"
    user_notification_template="default"
    user_email_field="email"
    notify_admin="yes"
    admin_notification_template="default_template"
    admin_notify="webmaster@4sonline.org"
    return="http://www.4sonline.org/prizes/carson/got_it"
}

    <h3>Nominated by</h3>
    <label>First name:  </label>
    {freeform:field:first_name}

    <label>Last name:    </label>
    {freeform:field:last_name}

    <label>Email:    </label>
    {freeform:field:email}

    <label>Institution:    </label>
    {freeform:field:institution}

    <h3>Nominee</h3>
    <label>First name</label>
    {freeform:field:nominee_first}

    <label>Last name:    </label>
    {freeform:field:nominee_last}

    <label>Email:    </label>
    {freeform:field:nominee_email}

    <label>Institution:    </label>
    {freeform:field:nominee_institution}

    <label>Rationale (limit 2,000 words)</label>
    {freeform:field:rationale}

    <p>Not so fast!<br/>
      {freeform:captcha} <br>
      If you are not a robot, please type the text above into this box:
      <input type="text" name="captcha" /> <br/>
    </p>

    <p><input type="submit" name="submit" value="Submit" /></p>

{/exp:freeform:form}

```

# Answer
> 0 votes
It looks like you are using ce\_cache module. You need to **escape** the cache for form so it can get fresh CSRF token and XID for each refresh.

Try:

```
{exp:ce_cache:escape}
    {exp:freeform:form
        form_name="council_nom"
        required="first_name|last_name|email"
        notify_user="yes"
        user_notification_template="default"
        user_email_field="email"
        notify_admin="yes"
        admin_notification_template="default_template"
        admin_notify="webmaster@4sonline.org"
        return="http://www.4sonline.org/prizes/carson/got_it"
    }

        <h3>Nominated by</h3>
        <label>First name:  </label>
        {freeform:field:first_name}

        <label>Last name:    </label>
        {freeform:field:last_name}

        <label>Email:    </label>
        {freeform:field:email}

        <label>Institution:    </label>
        {freeform:field:institution}

        <h3>Nominee</h3>
        <label>First name</label>
        {freeform:field:nominee_first}

        <label>Last name:    </label>
        {freeform:field:nominee_last}

        <label>Email:    </label>
        {freeform:field:nominee_email}

        <label>Institution:    </label>
        {freeform:field:nominee_institution}

        <label>Rationale (limit 2,000 words)</label>
        {freeform:field:rationale}

        <p>Not so fast!<br/>
          {freeform:captcha} <br>
          If you are not a robot, please type the text above into this box:
          <input type="text" name="captcha" /> <br/>
        </p>

        <p><input type="submit" name="submit" value="Submit" /></p>

    {/exp:freeform:form}
{/exp:ce_cache:escape}

```

# Answer
> 0 votes
It appears that you're using a version of Freeform that is not compatible with the version of ExpressionEngine you're using. Freeform 4.1.4 makes a compatibility update for EE 2.8+, which changed the way CSRF handling works (specifically, EE changed things from `XID_TOKEN` to `CSRF_TOKEN`).

The version of Freeform you're using is also over 4 years old. The latest version available for Freeform 4.x for EE2 is Freeform 4.2.5. I would recommend you update to this version to resolve this issue (and several other issues).

If you're using the Pro version of Freeform, you will have access to this update inside your Solspace account. If this is the free version of Freeform, you'll need to contact Solspace support for the updated version (select "Account" from the **Product** menu in support form).

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


# Question
Title: All Tags not working after FTP my website to the server
After I have FTP my website to the server, none of the tags is working, another word, there is no content pulled from the CMS to the template. My website is http://www.pwshare.co.uk/.

Please take a look and give some advice!

Thank you! Michael

# Answer
> 1 votes
ExpressionEngine required PHP V7+ which I used PHP 5.6. After updated the PHP version it all started to work.

# Answer
> 0 votes
Please check your channel entry Parameters that you have used in expression engine code like channel, disable etc.

If still it is not fixed, then paste your code here. So I can suggest in detail.

---
Tags: channel, tags
---


# Question
Title: ExpressionEngine V4 CMS Icons showed as squares, RichEditText box showed content as HTML and some Member Group setting showed as process bar
I am using ExpressionEngine Version 4, there are some issues with the CMS, please see the followings:

1. CMS icons are showing as squares.
2. RichEditText box doesn't show content as normal text, instead, it showed them as HTML code.
3. Some member group settings are not showing, only see a progress bar in there, and the bar doesn't seem to disappear.

I think this might be some issues with the path but I'm not able to find out why...

Please help.

Kind regards, Michael

# Answer
This is path issue as you think. You need to change path manually.

There is 2 ways to change the path in EE3 - EE4

1. Go to `Settings > URL and Path Settings` and change all necessary variables.
2. Install Deeploy Helper module and change path from settings of this module. (This module is paid.)
> 1 votes

---
Tags: path, richtext
---


# Question
Title: How To Call A Image Manipulation With Grid
I am trying to simply create a slider using Grid. The 'small' images would be the thumbs etc.

Have to say, I have worked on this for more then 2 hours trying to see what is up...but I am obviously hitting a block and missing something...maybe fresh eyes from someone else could help - thanks

Upload Directory: video\_images
Image Manipulation: small
Grid Field Name: project\_slideshow

Here is what I have but I cannot get this to load the 'small' image

```
                <div class="nomargin masonry-thumbs col-4" data-lightbox="gallery">
            {project_slideshow}
                <a href="{project_slideshow:slide_image}" data-lightbox="gallery-item">
                <img class="image_fade" src="{slide_image:small}">
                </a>
            {/project_slideshow}
            </div>

```

Here is the test page:

http://yourfishingbiz.com/index.php/main/video/this-is-a-test-video

# Answer
> 0 votes
For those in the future, if you're using Assets as your fieldtype, it has a different syntax to access image manipulations. Example code that works :

```
{home_slider}
<div class="hero__slide" style="background-image:url('{home_slider:background_image:url:large}')">
    <div class="hero__info">
        {home_slider:copy}
    </div>
</div>
{/home_slider}

```

The syntax for accessing is {thegridfield:theimagefield:url:manipulationName}. That will output the absolute URL to the manipulated file.

See docs here

---
Tags: grid, tags, image-manipulations
---


# Question
Title: General error when trying to access templates
Running EE 3.5.12

In the process of creating a number of new templates I suddenly got the following error:

> SQLSTATE\[HY000\]: General error: 1366 Incorrect string value: '\xD5ve fo...' for column 'template\_data' at row 1:
>
> ee/legacy/database/drivers/mysqli/mysqli\_connection.php:122

I checked the template\_data column contents of the most recent templates in exp\_templates and could not see anything amiss.

I would appreciate any guidance on what might be causing this and how to resolve it.

I've attached an image showing the encoding for the table:

# Answer
All efforts to locate the offending encoded entity failed. I therefore made another backup of the database and all template files and proceeded to systematically delete template files. It ended up being one of the most recent templates created but it is not obvious what was wrong with it. The system is up and running now and the error is gone.
> 1 votes

# Answer
I believe your issue is MySQL attempting to encode an invalid UTF-8 byte sequence. I checked (even though it is obvious if you work with encoding/decoding UTF-8 on string sequences) and `\xD5ve` is not a valid hex code for a UTF-8 character. I have no idea why that string is in one of your templates, but it is.

A partial guess is that upgrading to EE3 forced your encoding from Latin-1 (or something else) to UTF-8, and now it can't handle the invalid sequence. Or the new templates you are adding just plain have invalid UTF-8 sequences.

This is kind of a far out guess, but could be it. To test this, I would:

1. **Backup** your database. Preferably, don't run this on a production server, but only on a staging/local dev instance.
2. Attempt to find, and remove the violating byte sequence. I would do it in both your file template assets, as well as in their `template_data` column.

To find a code sequence, I would log on to a server and navigate to your template group. This command is really handy:

```
grep -nr search\-string

```

You may have to try a few different versions to match it exactly (escaping charcters for grep):

```
grep -nr \\xD5ve

```

For your database, just use a `LIKE` query on the `template_data` column. Should do the trick:

```
USE my_schema;
SELECT * FROM exp_templates WHERE template_data LIKE "%\xD5Ve%";

```

Hrm, did I get that right? Been a million years since I had to write a query. Anyways, that is my current suggestion; find and remove invalid UTF-8 sequences from all of your templates, but start with the one.
> 1 votes

---
Tags: templates, error, mysql
---


# Question
Title: Nesting visitor:update_form within visitor:details
Is there any reason why I shouldn't nest visitor:update\_form within visitor:details? The reason I want to do this is because visitor:update\_form doesn't seem to work with the native Relationships field (i.e. can't get details from it in the template) and I want to allow / disallow access based on whether a user is related to an entry. Nesting seems to work, but it would be good to know I'm following best practice.

```
{exp:visitor:details}
    {if '{client_event:url_title}' == '{segment_2}'}
        {exp:visitor:update_form preserve_checkboxes="no" return="{uri_string}"}
            ...allow access, updates etc.
        {/exp:visitor:update_form}
    {if:else}
        ...don't allow access
    {/if}
{/exp:visitor:details}

```

# Answer
> 0 votes
Please try your code with `embed`.

Create new template in your `template group` having proper name `.your_template_name`

Now, your main `template` having below code :-

```
{exp:visitor:details}
    {if '{client_event:url_title}' == '{segment_2}'}
        {embed="your_template_group/.your_template_name"}
    {if:else}
        ...don't allow access
    {/if}
{/exp:visitor:details}

```

And your `embed` having below code :-

```
{exp:visitor:update_form preserve_checkboxes="no" return="{uri_string}"}
    ...allow access, updates etc.
{/exp:visitor:update_form}

```

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


# Question
Title: ee3 install - Parse error: syntax error, unexpected ':' in admin.php on line 80
I feel like I'm taking crazy pills. Why would I be the only person with this error? Like 80 says:

```
$system_path = $system_path ?: __DIR__;

```

Looks weird, doesn't it?

# Answer
> 0 votes
Never mind. Requirements say PHP 5.3.10 or newer. Server is only 5.2.17.

# Answer
> 0 votes
I had same problem, Syntax error line 80 I asked my hoster to install latest version of PHP.

# Answer
> 0 votes
Have the same issue here, running PHP 5.4 with Expression Engine 3.5.14

Checked my error logs and found this:

\[05-Jan-2018 16:55:49\] PHP Parse error: syntax error, unexpected ':' in /my\_root/public\_html/admin.php on line 80

Anyone?

---
Tags: install
---


# Question
Title: How to send HTML email (in template) from extension?
I am using the Email Class in an extension to send an email when an entry is saved with a certain status. This all works great and the emails send when they are supposed to.

However, I am looking to enhance this: for the body of the email I would like to be able to pull a template that I have created. I previously had been pasting in my entire HTML email into the extension which works- but this seems impractical, especially when I need to make changes to the email.

Any ideas or pointing me in the right direction would be appreciated! Thanks in advance!

# Answer
**Yes Brianne**, you can pull the body of the template in your extension. To achieve this you need to create separate library for parsing the template into your extension. And by loading that library you can access the code of your template into your extension.
> 1 votes

---
Tags: email, extension, html-email
---


title: Solspace Freeform - Custom Errors

text:
# Question
Title: Solspace Freeform - Custom Errors
Is there a way of customizing the errors Solspace freeform displays as it currently just says "Required field missing input". I would like to make the error a bit more explanatory. Also, as the website is in Italian, I would also like the error displayed to also be in Italian and not English. Is there somewhere where I can edit/customise this?

Edit 1/12/2018

I have not been able to get the `{if freeform:errors}` to work properly. I have added the code for my form below in case it helps.

```
{exp:freeform:composer form:id="reportForm" form:class="report-form" form_name="report_issue"}
  {composer:page}
    <form class="report-form" id="reportForm">
      <fieldset>
      <div class="general_errors"></div>
        {composer:rows}
          {composer:columns}
            {composer:fields}
              {if composer:field_label}
                {if composer:field_type == 'nonfield_captcha'}
                  {if freeform:captcha}
                  <p>
                    <strong>{composer:field_label}</strong>
                  </p>
                  {/if}
                {if:else}
                  <label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
                    {composer:field_label}{if composer:field_required}<span class="required_item">*</span>{/if}
                  </label>
                {/if}
              {/if}
              {if composer:field_output}
                {if composer:field_type == 'nonfield_title'}
                  <legend>{composer:field_output}</legend>
                {if:elseif composer:field_type == 'nonfield_paragraph'}
                  {composer:field_output}
                {if:elseif composer:field_name == 'indirizzo_url'}
                  <input type="text" name="indirizzo_url" value="{current_url}" id="freeform_indirizzo_url" maxlength="150">
                {if:elseif composer:field_type == 'nonfield_captcha'}
                  {if freeform:captcha}
                      {freeform:captcha}<br />
                      <input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" />
                  {/if}
                {if:else}
                  {composer:field_output}
                {/if}
              {/if}
              {if freeform:field_errors}
                <ul>
                  {if freeform:error:indirizzo_url}
                      <li>L'indirizzo della pagina (URL) è obbligatorio. Per piacere inserisci l'indirizzo del gioco in questione.</li>
                  {if:else}
                      <li>Messaggio obbligatorio. Per cortesia, indica il problema presente nel gioco in questione.</li>
                  {/if}
                </ul>
              {/if}
            {/composer:fields}
          {/composer:columns}
        {/composer:rows}
      </fieldset>
    </form>
  {/composer:page}
{/exp:freeform:composer}

```

# Answer
Yes, you can customize the errors given by Solspace freeform. Please see below code to modify the errors. **freeform:field\_errors**

```
{if freeform:field_errors}
    <h2>There were some error(s) with your submission:</h2>
    <ul>
    {if freeform:error:first_name}
        <li><b>First Name</b> is required.</li>
    {/if}
    {if freeform:error:last_name}
        <li><b>Last Name</b> is required.</li>
    {/if}
    {if freeform:error:email}
        <li><b>Email</b> is required.</li>
    {/if}
    </ul>
{/if}

```

I think, directly you can not convert errors in Italian language.
> 4 votes

# Answer
To help with the 2nd part of your question I offer the following:

We have a form that we present in English and in Spanish but we want to have all the data be submitted into the same place.

So for the Spanish version we translate the FreeForm field labels on the client side using jQuery like so:

```
$(document).ready(function() {
      $("label[for='freeform_first_name']").text( "Nombre *" );
      $("label[for='freeform_last_name']").text( "Apellido *" );
});

```

I expect you could adapt this technique to error handling as well.

We are using FreeForm 4 (older). Syntax may be different depending on your version.
> 0 votes

---
Tags: solspace-freeform
---


title: EE4 - Channel Images exception caught

text:
# Question
Title: EE4 - Channel Images exception caught
Today I updated my website to ExpressionEngine 4 without much trouble. However, there's one thing I cannot get fixed.

Apparently the Channel Images plugin is giving errors, but I really don't know what to do or how to fix this.

The error message:

```
Exception Caught
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_group' in 'field list':
SELECT `field_group` FROM (`exp_channels`) WHERE `channel_id` = '2'

ee/legacy/database/drivers/mysqli/mysqli_connection.php:116
Stack Trace: Please include when reporting this error

```

I already tried to manually add the field\_group column, but if I do another exception pops up.

Any ideas on how to fix this?

# Answer
As Channel Image is not yet compatible for EE4, for the moment you have to come back to EE3, and restore the backup EE3 files and database, thus using EE3 no more error problems.

Now you have to wait the Channel Images to be compatible with EE4 to use them without problems.
> 0 votes

---
Tags: channel-images
---


# Question
Title: Making certain templates only show for certain authors
Want to know how to make sure a template only gets used when we want it

Our main article template for our columns runs ads

I need a template that has no ads for one of our authors. How do I ensure there is no bleeding of content onto the wrong template

# Answer
> 1 votes
You could just use a conditional to display, or not display the ads. So if the content author is anyone but the said author, show ads. If it is them, it won't show the ads:

`{if author_id != "xx"}
 < Ad Code Here >
{/if}`

Just put the author's id in place of the "xx".

---
Tags: templates
---


# Question
Title: How to add custom validation in expresssion engine validation
This is my current code.

```
$rules = array(
    'label'        => 'required',
    'short_name'   => 'required',
);

$result = ee('Validation')->make($rules)->validate($_POST);

```

Now I want it like this:

```
$rules = array(
   'label'        => 'required',
   'short_name'   => 'required|trim|check_name["test_name"]',
);

```

but I am getting error in trim rule.

> Unknown validation rule `trim`.

Please help.

# Answer
You are getting error because **trim** function is not defined in current validation library. You need to add your own function in EE3 before you run validation.

According to the documentation:

You first need to create an object of Validation class.

```
$validator = ee('Validation')->make();

```

Then you need to define your custom rule:

```
$validator->defineRule('trim', function($key, $value, $parameters)
{
  return ** Depends on result return TRUE or Error Message **;
});

```

Then you need to use that rule with setRules.

```
$validator->setRules(array(
   'age' => 'required|trim'
));

```

Final step is to validate your post data:

```
$result = $validator->validate($data);

```

$result will either contains TRUE or object of errors.
> 2 votes

---
Tags: ee3
---


title: Non Super Admin Cannot Edit Entries

text:
# Question
Title: Non Super Admin Cannot Edit Entries
i was recently informed that a user who has access to the CP cannot edit any entries that were created by a Super Admin past a certain date. The site is running EE 2.11.3.

In testing, they are able to create entries but any time they edit they get an error that "You are not authorized to access this page." If I move them to the Super Admin group, they are fine. I created a new group based on the Super Admin group (with all permissions selected and access to all modules) and moved the user to that group, and they get the error again. This happen on all channels.

Any thoughts?

\** EDIT \** Here is a screenshot of the settings for this group.

# Answer
What do you have set under "Channel Assignment" under the Member Group Settings? Please set it just like below image for reference.
> 0 votes

---
Tags: control-panel, super-admin
---


# Question
Title: Calculation {member_field} * {channel_field}
Is there a simple way to do this calculation on a page without using PHP on output? I have a member\_field with a value and a channel\_field with a value and want to output

```
{member_field} * {channel_field} =

```

# Answer
> 5 votes
There is no direct way. I suggest you to install this module

**Edit**

If incase you have values to pass with comma separated (i.e., 5,00,000.05), You need to edit `pi.math.php` file to add this code on line number 54.

```
// remove commas
$formula = str_replace("," , "" , $formula);

```

---
Tags: channel, entries
---


# Question
Title: Any concerns running ExpressionEngine on an IIS server?
I want to setup EE on an IIS server what should I be aware of before proceeding?

Never having developed a site running on a server using IIS I am hesitant. Based on initial searches I see that I can run Expression Engine 3 on an IIS server, and there seem to be some "gotchas" to have be aware of in the past. Considering the age of the articles I have found are no more recent than 2014 I wanted to pose this question again given updates to PHP etc...

**EDIT:**

* \[**Resolved**\] If anyone has any experience with upgrading PHP on IIS after deployment I would be interested to hear how that process went.
* Any tips or suggestions regarding config file setup

Thanks everyone

# Answer
Routing wouldn't work for me until...

1. Remove index.php from Settings \> URL and Path Settings \> Website index page
2. Then add the following to your webconfig file.

```

<system.webServer>
    <rewrite>
        <rules>
            <rule name="expressionengine" patternSyntax="Wildcard">
                <match url="*" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile"
                         negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory"
                         negate="true" />
                </conditions>
                <action type="Rewrite" url="index.php" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

```
> 0 votes

# Answer
You can upgrade PHP on IIS using the Web Platform Installer.

https://www.microsoft.com/web/downloads/platform.aspx
> 0 votes

---
Tags: ee3, php, server, install, iis
---


# Question
Title: Show recommended articles based on the current article being read
The title is pretty self-explanatory, but I have a website which has dozens of articles based on healthcare in the US, each sort of categorised by the type of insurance. At the moment I have a sidebar which shows the four "latest" articles.. however, this can be seen as pretty irrelevant for many readers.

How could I create a list of URLs to the most relevant articles? I.e. if a user is reading up on Medigap, a recommended article could be Medigap costs explained

Help is much appreciated!

# Answer
The most basic way would be the native related category mode within EE. https://docs.expressionengine.com/latest/channel/channel\_entries.html#related-categories-mode

But that depends on how granular you get with categories, or the matches may still be undesirable.

Beyond that a plugin allowing you to tag your content then output related entries based on the tag data, like eeHarbour's Tag addon, would work. https://eeharbor.com/tag

However, that will require you go back and tag existing content. But it is better than native categories for many uses IMO.
> 0 votes

---
Tags: channel, recommendation-request
---


# Question
Title: Member creation (backend) - doing anything but setting username first causes validation errors
When I create a user in the backend, the Member Group comes first, and is the obvious place to start. However, if I choose a Member Group before adding an Email (email is username in my case), the form throws an error - "The screen name you chose is not available".

Adding an Email is not enough to clear the error - I need to select a different Member Group (before re-selecting the Member Group I originally wanted). This seems like a bug to me, but is there anything I can do to alter the behaviour of the form? It's causing confusion among my users, and is not user friendly at all.

Visitor 3.0.1, EE 3.5.12

# Answer
Well it is a bug, You should contact Visitor to give you support regarding this.

For a quick fix, You can edit the Visitor module and comment this lines. It will solve your issue for now.

```
if (ee()->session->ban_check('screen_name', $data['screen_name']) OR trim(preg_replace("/ */", '', $data['screen_name'])) == '') {
    return lang('v:screen_name_taken');
}

```
> 3 votes

---
Tags: visitor
---


# Question
Title: expression engine upgrade from 2 to 3 to 4
I've been working now for some years with EE2 but to upgrade to version 3 or 4 is not possible for me:

To many plugins are not working with v3 or 4 or they don't exist anymore. It's a mess, sorry.

To upgrade complex programming to the next level, means, you have to spend a lot of money/time, because you have to find other ways for deprecated plugins, extensions.

ExpressionEngine should think about how to make the upgrade of external plugins simple, otherwise it doesn't make sense to use third party plugings/extensions. The risk is to high to run into upgrade troubles ;-)

**If there are any ideas how to upgrade to the next version without having to rewrite many parts, would be of great help.**

# Answer
> 11 votes
The upgrade from EE2 to EE3 is a major step - from EE3 to EE4 not such a big one. So getting your site to EE3 is the thing to focus on. How hard this will be will very much depend upon how your EE2 site is set up, and in particular what add-ons you are using.

To be able to upgrade to EE3 you need to get your copy of EE2 up to a late version (I think 2.10.x) first - and this in turn may also break some add-ons / site functionality.

When you get to 2.10.x you then need to work out what add-ons you actually use on the site (rather than just have installed), and which of these you can update. If you use Playa / Matrix, you might also want to consider migrating these to EE2 Relationships / Grid fields (there is a converter available from Ellis) as this migration works well, and will save you an upgrade fee on Playa / Matrix. Once you have a list of add-ons with no EE3 version, you need to work out migration / mitigation strategies for each. If you post a list of these here, people might be able to offer guidance on how to go about it: typically either find a substitute or re-write your templates / code to avoid.

If your site uses custom / self-written add-ons then you will need to get these fixed before you can migrate too (it might not be a huge job - but without some work no EE2 add-on will work under EE3 - as EE3 needs additional files not present in EE2 add-ons).

When you get this done, you can try and migrate to EE3. This itself is not without problems (look elsewhere here for posts about this) - in theory it works pretty automagically, but if you have anything even slightly odd about your set up be prepared for a block of time to actually getting the migration to work - one red-flag seems to be use of "Master Config" - which seems to be a source of many migration issues.

For example, EE3 does not offer much help to the add-on migration issue - if there are incompatible add-ons present during the migration, most likely you'll simply get a 'white screen of death' from your site after the migration: EE3 does not attempt to 'spot' that an add-on is not compatible with EE3 and skip loading it (even though to do so would be easy enough, as EE3 could be written to look for the special EE3 add-on files before loading the add-on for example, and skip it if they are not found).

Once you get to EE3, congrats! Now all you need to do is migrate this to EE4. Unfortunately despite promises from Ellis Labs that EE3 to EE4 migration would not 'break' add-ons this appears not to be true in practice - and all those 'major' add-ons (e.g. Assets etc.) will need to be updated again to EE4 versions. Whether this costs you (again) depends on which vendor the add-on comes from, but it is without doubt a pain. More concerning is that since these 'major' EE3 add-ons do not work under EE4, it is hard to be confident that any other EE3 add-ons will work - almost certainly you'll have to spend time debugging the add-ons you use again to get the migration complete.

The original EE2-EE3 migration was worse (because EE3 was launched before anyone had updated any add-ons, and so for the first year or so migration was very difficult for most sites). So many seemed to have used this as a trigger to abandon EE2 and rewrite the site for a new CMS (either EE3, or something else with many similarities like Craft). It might make sense for you to include a 'stick or twist' decision in your thinking before you start work on the migration in anger. If you decide to go ahead it might also be sensible to get someone who has done the migrations before involved - there would doubtless be time and cost savings leveraging someone else's experience of this workflow.

HTH

---
Tags: plugin, upgrade
---


title: Exporting Channel Data to Excel (XLSX)

text:
# Question
Title: Exporting Channel Data to Excel (XLSX)
Good Afternoon,

For a long time I've used a PHP enabled template to export channel data to a Microsoft Excel spreadsheet and it's worked very well. Recently, I've discovered that since everyone has now upgraded their Excel and the default extension is now XLSX instead of XLS, an alert is displayed when opening the file. If you click proceed anyway you can still open the spreadsheet but if possible I'd like to now export to XLSX instead of XLS as to avoid this alert message. Please find an example of the alert I'm talking about below:

In my export template I have 'Allow PHP' set to 'Yes' and 'PHP Parsing Stage' set to 'Output'. The template contains a basic HTML table that is setup to output the channel data I want in my spreadsheet and below is the PHP I have at the top of this template that generates the Excel file:

```
<?php
    header("Content-type: application/vnd.ms-excel");
    header("Content-Disposition: attachment; filename=My-Channel-Data Spreadsheet.xls");
    header("Pragma: no-cache");
    header("Expires: 0");
?>

```

Does anyone know of a way to adjust the code above so that the spreadsheet is exported as a modern Excel file using the XLSX extension? Any tips or suggestions to achieve this would be greatly appreciated, Thanks!

# Answer
You should try to export data into XLSX format with PHP\_XLSXWriter. You can try below code which is example of `PHP_XLSXWriter`.

```
<?php
    include_once('xlsxwriter.class.php'); /*you can get xlsxwriter.class.php from given GitHub link*/
    $filename = "example.xlsx";
    header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"');
    header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    header('Content-Transfer-Encoding: binary');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');

    $header = array(
      'ID'=>'integer',
      'Subject'=>'string',
      'Content'=>'string',
    );

    $writer = new XLSXWriter();
    $writer->writeSheetHeader('Sheet1', $header);

    $array = array(
        '0' => array('1','Test Subject','Test Content'),
    );

    $writer->writeSheetRow('Sheet1', $array);
    $writer->writeSheet($array,'Sheet1', $header);
    $writer->writeToStdOut();
    exit(0);
?>

```
> 1 votes

# Answer
I just got the corrupted file error resolved and this is now working. The problem with the example above and also the one from the GitHub repo is that the Content-Type header needs to be using single quotes instead of double quotes.

So change this line:

```
    header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

```

To the following:

```
    header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');

```

Once you make that adjustment the downloaded spreadsheet opens just fine, Thanks!
> 0 votes

---
Tags: export
---


# Question
Title: Showing categories in structure navigation
I have a site that has a parent channel as a main nav item. It has entries that are categorized.

Is it possible to have the parent channel in the main nav and it's categories as children using structure?

# Answer
Structure and categories work best when used with Zoo Triggers. for what i know, ZT has been aquired by eeharbor, and they are currently working ZT into Structure.What i normally do for the nav is something like

```
{if segment_1 == 'parent_channel'}
    {exp:channel:categories}<li><a href="/{segment_1}/{category_name}">{category_name}</a></li>
{if:else}
    {exp:structure:nav}
{/if}

```

I normally also set Freebie to have EE ignore all segments after my parent\_channel, so i don't need a category trigger word. In my Structure template i normally use Switchee to display the correct entries
> 0 votes

---
Tags: structure
---


# Question
Title: Grid field, type file, won't upload svgs using {exp:channel:form}
I have set the "File Upload Preferences" set to "all file types", on the grid field i have Allowed file type set to "All". I have the "Channel Form Settings" "Allow Guest Posts" set to yes for that channel.

In the CP i can upload an svg, but not when using exp:channel:form, i can not upload an svg. Using 2.9.3 and need to keep that version for now. I have tried updating the config.php with $config\['allowed\_types'\] = 'svg'; and add to the mimes.php, and nothing lets me upload .svg files from my form (i can upload pngs, jpgs, txt, etc. from that form). Seems to just be svg that gives me "There was a problem with one or more Grid fields".

# Answer
> 0 votes
After all of that, the answer is to go to Admin \>\> Security and Privacy \>\> Security and Sessions and set "Apply XSS Filtering to Uploaded Files" to no. I also had trouble uploading PDFs until i did this. Now i can upload both from the exp:channel:form

---
Tags: error
---


title: Feed social for multiple accounts

text:
# Question
Title: Feed social for multiple accounts
Someone can suggest about a social feed plugin for EE3/4 that allow to have feeds for multiple accounts? Thanks

# Answer
> 0 votes
I suggest you to use Smart Social Feed. This module is available in EE2, EE3 and EE4.

---
Tags: plugin, twitter, social, feed
---


title: Stash and database replication

text:
# Question
Title: Stash and database replication
We are running **EE 2** and **Stash**, 2 DB's: 1 master, 1 slave. The master-slave relationship keeps breaking with the following error:

> CRITICAL - Slave sql is not running. Last error: Could not execute Delete\_rows\_v1 event on table co\_site.exp\_stash: Can't find record in 'exp\_stash', Error\_code: 1032: handler error HA\_ERR\_KEY\_NOT\_FOUND: the event's master log mysql-master-db-binlog.000001, end\_log\_pos 55763226

My question is two-fold:
1. Should tables exp\_stash and exp\_stash\_bundles be replicated?
2. If they should, has this issue come up before and is there a fix that will allow our replication working without these errors?

Many Thanks,

Studio1057

# Answer
> 0 votes
I wouldn't think there's anything special about those two tables with regard to MySQL. If you are doing replication on the other tables then these should be replicated as well.

Is it possible that you are doing some delete operation on *the slave* without meaning to? (perhaps some kind of script to clear caches or something?)

# Answer
> 0 votes
Stash is a cache plugin for EE. The solution is to exclude it from replication:

replicate-ignore-table = \[your\_database\].exp\_stash

This will inhibit this table from replicating. It cannot be done on the binlog level on the master unless the stash has it's own database.

---
Tags: stash, database
---


title: EE4 Module Tab on Template Editor Page

text:
# Question
Title: EE4 Module Tab on Template Editor Page
Is there a way to add a tab on the publish form within the Template Manager like it is with the Channels?

For example, the Template Manager has the default Edit, Notes, Settings and Access form tabs. I wanted to add another from my custom module.

Is this currently possible within the core API?

# Answer
> 0 votes
You can create your own module to add a TAB in channel entries. You need to follow the documentation of creating a module.

This URL will help you to create a module. Your structure should be like given image below:

On your UPD file install function, remember to put `has_publish_fields` value as `y`. otherwise your data you want to display in tab will show on `publish` Tab.

---
Tags: templates, add-on, add-on-development, module, addons
---


title: Cannot login to CP importing db

text:
# Question
Title: Cannot login to CP importing db
I'm using **EE v .3.4.4** and have used a dump of the site's live database to keep my development machine in sync from time to time. This has not been a problem in this project until last week.

After importing the live DB last week, I was unable to login to the CP. I have the continual loop of the login page being redisplayed.

So I cleared the `exp_security_hashes` table and the `exp_sessions` table.

This did not fix the issue. Adding `$config['cookie_domain'] = "";` to master config works.

But I do not want to keep this as a fix as this is not the correct cookie domain.

What is the correct permanent solution for this?

Thanks in advance.

Dorothy

# Answer
A pretty simple solution is to set configurations based on environment. This is a hacky example, but totally works. For a single variable, you could do this in your config file:

```
if ($_SERVER['SERVER_NAME'] == 'mysite.local'){
    $config['cookie_domain'] = "";
} else {
    $config['cookie_domain'] = "mysite.com";
}

```

There are way more robust ways to do this. Look into setting environment variables via your environment.
> 0 votes

---
Tags: control-panel, login, security, cookies
---


title: Creating a permanent roadblock

text:
# Question
Title: Creating a permanent roadblock
I am currently in the process of trying to create a roadblock that will always run, with the exception of when we have a sponsored roadblock.

We have run into the issue of having a black square pop up when a sponsored roadblock stops serving, we are trying to prevent the black square from popping up when say for instance, someone forgets to delete the roadblock setting in expression engine. Is there a way to have a house roadblock constantly run, but stop running when we have a sponsored roadblock and then have the house roadblock start automatically running again, when the sponsorship roadblock ends?

Any insight is appreciated.

Thanks!

# Answer
you could set up a channel where you put the roadblocks into. also handy cause you can expire them automatically. then in your template do something like

```
{exp:channel:entries channel="roadblocks" dynamic="no" disable="categories|pagination|member_data|relationships"}
{if no_results}Do your default roadblock stuff{/if}
do the sponsored roadblock stuff
{/exp:channel:entries}

```
> 0 votes

---
Tags: modal
---


# Question
Title: Stop Solspace freeform injecting a validation script
I'd like to use Bootstrap validation with my Solspace Freeform, but I can't figure how to stop Freeform from adding it's default validation script to the page.

I've tried using a custom form template but it still injects the script, I don't want javascript injected into the middle of a page, and it conflicts with the Bootstrap script that is used throughout the site.

Is this possible?

# Answer
I'm curious which scripts you're specifically referring to? There's possibly a few different things that Freeform might insert, but it sounds to me like the one that would be most likely to interfere would be the "Disable Submit Button on Form Submit" feature.

This can actually be disabled by going to EE CP -\> Add-ons -\> Freeform -\> Settings -\> General And then disabling the **Disable Submit Button on Form Submit** setting.

Let me know if you're referring to something else though. :)
> 1 votes

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


# Question
Title: PHP filtering not working consistently with stash
```
{exp:tag:related_entries
    entry_id="{embed:entry_id}"
    orderby="relevance" sort="desc"
    limit="10"
    {if '{embed:channel}' != ''}channel="{embed:channel}"{/if}
}

<?php if (!in_array('{entry_id}', $filtered_ids)) { ?>

    {exp:stash:append_list name="my_list" parse_tags="yes"}
        {stash:id}{entry_id}{/stash:id}
        {stash:item_title}{title}{/stash:item_title}
        {stash:item_category}{categories}{category_name}{/categories}{/stash:item_category}
        {stash:item_category_url}{categories}{category_url_title}{/categories}{/stash:item_category_url}
        {stash:item_channel_name}{channel_name}{/stash:item_channel_name}
        {stash:item_channel_name}{channel_name}{/stash:item_channel_name}
        {stash:item_hero}{hero}{/stash:item_hero}
    {/exp:stash:append_list}

<?php } ?>

{/exp:tag:related_entries}

```

Why is the above not filtering entries, when the code below works as expected:

```
{exp:tag:related_entries
    entry_id="{embed:entry_id}"
    orderby="relevance" sort="desc"
    limit="10"
    {if '{embed:channel}' != ''}channel="{embed:channel}"{/if}
}

    <?php if (!in_array('{entry_id}', $filtered_ids)) { ?>

    do display - {entry_id}

    <?php } else { ?>
    do not display - {entry_id}
    <?php } ?>

{/exp:tag:related_entries}

```

I'm trying to filter entries, I have a list of entries that I dont want to display, which I've converted to an array, but when I add the stash append\_list code it contains all the entires, even those that will get printed as 'entry\_id do - not display' when I run the first code.

# Answer
If anyone else is interested, I solved this by hacking the Tag module (which is very nicely written) and added an 'exclude\_ids' parameter to the 'related\_entries' tag, which when set, filters out the provided ids from the results.

```
    if (ee()->TMPL->fetch_param('exclude_ids'))
    {
        $exclude_ids = ee()->TMPL->fetch_param('exclude_ids');

        $filtered_list = rtrim($exclude_ids, '|');
        $filtered_ids = str_replace("|", ",", $filtered_list);

        $sql .= " AND te1.entry_id NOT IN ($filtered_ids) ";
    }

```
> 1 votes

---
Tags: stash, solspace-tag
---


# Question
Title: Unable to change URL to the root directory of my site in global configuration?
Using Expression Engine 2 the going to Admin\>General configuration

I am trying to change both "URL to the root directory of your site" and "URL to your "themes" folder"

I can type the changes in no problem but when I come to save it, the setting remains as the original urls

The config file is writable. What else could I be looking at? Cheers

# Answer
> 0 votes
Update: Found the solution. I had delete the cache. Not from the CMS but from the actual server folders for cache. Updated no problem

---
Tags: url, config
---


title: Segment Variables & Case Sensitivity

text:
# Question
Title: Segment Variables & Case Sensitivity
I'm having an issue with case sensitivity in URL's. I have a template that includes a channel entries tag that loads a structure entry, a structure nav that starts from segment\_1, and a {segment\_1\_category\_id} tag. The entry for the page has a structure URI of /foo.

Loading site.com/foo produces the following result -

```
channel entries - correct entry
structure nav - correct nav
segment_1_category_id - correct cat id

```

Loading site.com/Foo produces the following result -

```
channel entries - correct entry
structure nav - loads the full top level structure nav, so {segment_1} doesn't match an entry
segment_1_category_id - no cateogry id

```

I tried using mod\_speling to tell Apache to ignore case in URL's, but that doesn't seem to have worked.

Other solutions seem to be using php strtolower to clean up the URL's, but I'd have to hack a few places to do that or turn on php on templates, neither is desirable.

I could also use a .htaccess redirect to force all the URL's to be lowercase, but I don't love using a redirect, and I might run into issues with the redirect in other cases.

What am I missing here as a better solution? I haven't run into this before and as far as I can tell from google, it's not a common problem.

# Answer
> 0 votes
This looks like a bug in structure. Have a look at the nav function: ./structure/mod.structure.php around line 109

exp:structure:nav uses php's array\_search() to locate your "start\_from" value in structure's list of urls. ( $site\_pages\['uris'\] )

A successful search sets $branch\_entry\_id to something other than 0 and structure builds your menu starting on that branch.

If search fails, the starting branch is 0 or / which loads everything.

We wanted /FOO, /Foo, /FoO and /foo to be the same entry so I added an additional check which looks again for an all lowercase version of start\_from.

```
if($found_key === false)
    $found_key = array_search(strtolower($start_from), $site_pages['uris']);

```

---
Tags: structure, segments
---


# Question
Title: Need query that filters entries by category
I need to display entries from Channel 1 and entries from (Channel 2, Category 1).

I'm guessing the meat of the query would be something like this:

```
WHERE channel_id = 1 OR (channel_id = 2 AND cat_id = 175)

```

And this is the full query I'm trying to use, which isn't working:

```
{exp:query sql='SELECT t.entry_id FROM exp_channel_titles left join exp_category_posts p on p.entry_id = t.entry_id WHERE channel_id = 88 OR (channel_id = 11 AND cat_id = 192) LIMIT 8'}{entry_id}{/exp:query}

```

This is the error I'm getting: "Unknown column 't.entry\_id' in 'field list'"

# Answer
You have defined p as alias for the posts table but you have not defined t as alias for the titles table.

```
FROM exp_channel_titles t

```

You'll also probably want to limit by status and by date (not expired, not future-posted).
> 1 votes

---
Tags: channel-entries, categories, query
---


# Question
Title: expression engine giving error - config file not formatted
I am new to expression engine. I have installed expression engine using my own created theme.

But when I am trying to install, it is giving error as "**Your config file does not appear to be formatted correctly.**" http://bit.ly/1mtOlTC

What I did :-

I have installed fresh copy of expression engine at local and then created theme after that on server, I have again installed expression engine but copied the theme to site\_themes folder ad then installed using the server host, db and username. But it is giving the error stated above.

Any help is really appreciated.

# Answer
> 3 votes
I had a look at the link you posted. The error appears to be a different one. **"No database connection settings were found in the database config file."**

Did you follow the official instructions: http://goo.gl/wX84vq ?

Usually you get the error you've mentioned if ExpressionEngine has not been installed yet. This appears to be the case. Please visit http://creativescripters.com/expressionengine/admin.php and complete the installation.

# Answer
> 3 votes
Firstly, when you say "theme" I am assuming you mean a set of templates.

There are a few ways to approach this.

### Copy your entire local installation to the remote server

If you have the site working on your local machine and simply want to now put it on a remote server then you do not need to run the installer on the server. You can copy the files to your server via FTP then create a backup of your local database and use this to recreate a database that your remote site can connect to.

The problem then, however, is that you will need to update any paths used to make them work on the remote server. This can be done manually but is a bit fiddly or you can look at something like Deeploy Helper or Reelocate which will let you update all the paths used in one place.

***My preferred option is to use Focus Labs Config which will allow you to create different configs to be used in different environments.***

### or, Install a fresh copy of EE and update parts of it

This is the approach you are partly taking already. Basically create a completely clean installation of EE on your remote server, complete with a fresh database, then replace some of the files and upload a copy of your database.

Once you have a fresh installation on the remote server:

1. Back up your local database to an SQL file and use that file to overwrite the freshly installed remote database.
2. Then copy your templates directory to overwrite the one on the server
3. If you have any third party add-ons installed then you should also copy the /system/expressionengine/third-party and /themes directories to your remote server.
4. Copy your local images directory to the remote server as well as any upload directories you have created.
5. Update the config file on the remote server to reflect the new environment
6. You will also need to update paths and set permissions for config files, templates, cache, and file upload directories to reflect the new environment

# Answer
> 1 votes
Have you set permissions to 666 on config and database php files?

# Answer
> 0 votes
I've just experienced this when moving my EE3 site to another server, to be used with a different domain name. I found that were "installer" directories in the /system/ee/ directory. Deleting these has removed the error and I can now access the Control Panel. :-)

---
Tags: install
---


title: License file doesnt work

text:
# Question
Title: License file doesnt work
I have EE 3.5.12 installation set up on Production server. I uploaded license key file but it seems system doesnt take this license into consideration.

It still says "The Core version of ExpressionEngine is feature limited. Upgrade today."

Any ideas appreaciated.

# Answer
It seems that you've installed the core version of Expression Engine. In this case, download the commercial version and update your EE version.

The update docs link: https://docs.expressionengine.com/latest/installation/upgrade\_from\_core.html
> 1 votes

---
Tags: license, licensing
---


# Question
Title: Duplicating existing site to create a testing environment
Probably this question already answered somewhere, but i was unable to find it out. I have a Expression Engine v2.1.0 and i want to duplicate site on another hosting.

1. Can i simply move it to another hosting through FTP, copy a database, replace path and start working on it?
2. The main question would license key be lost on original site (or whatever license EE have)? Is there are any problems with license when creating duplicate on another hosting?

# Answer
Well for your first question, Yes you can just copy the site through FTP, upload database, change path and start working. (Only thing you should care about is your PHP version for new server. Make sure you have PHP 5 instead of PHP 7. Reason behind this is EE2 is not compatible with PHP7)

For your second question, Yes you can have as many test environment server as you want. You not need to buy any extra license for that.

You will find more information about this at:

https://expressionengine.com/forums/archive/topic/223922 https://expressionengine.com/forums/archive/topic/106247/test-site-environment#558093
> 5 votes

---
Tags: ee2
---


title: stash parsing sequence

text:
# Question
Title: stash parsing sequence
Reading through James Smith's stash tutorial and would like a little extra info on the following example, '{stash:title}' is getting set after the embed template is added (in the page sequence at least), but it works, how?

```
{embed="site/head"}
{exp:stash:set name="extra-head-data"}
    <link href="special-css-just-for-this-view.css">
{/exp:stash:set}

{exp:stash:set name="extra-foot-data"}
    <script src="special-javascript-for-single-product-views.js"></script>
{/exp:stash:set}

{exp:channel:entries limit="1" channel="products"}
    {exp:stash:set parse_conditionals="yes"}
        {stash:title}{title}{/stash:title}
        {stash:meta-desc}
            {if summary}
                {summary}
            {if:else}
                {exp:eehive_hacksaw words="20"}{body}{/exp:eehive_hacksaw}
            {/if}
        {/stash:meta-desc}
    {/exp:stash:set}
    <h1>{title}</h1>
    {body}
{/exp:channel:entries}
{embed="site/foot"}

```

# Answer
If you want to understand parse order better, you could have a look at this handy cheat-sheet: originally created by Low, the copy on his site appears to have disappeared, but here is a version of it from another site.

https://www.cheatography.com/adrienne/cheat-sheets/ee-parse-order/

HTH
> 3 votes

---
Tags: stash
---