title: Parameter and Dynamic Variables

text:
# Question
Title: Parameter and Dynamic Variables
Being an EE novice, I'm struggling to understand Parameter and Dynamic Variables. Yes...I gone over the documentation..MANY times. I'm still fuzzy on it.

For example, if I want to make a webpage using these layout variables (correct me if I'm using the wrong terms please) it could look like this?

```
<!-- header data here, etc --->

{layout:navigation}

<!-- my channel tags, etc --->

{layout:footer }

```

how do I tell expression engine what my footer is. Do I simply build a template within a related-named template group? Why don't I simply do this

```
{layout='layouts/_generic_layout'}
<!-- header data here, etc --->

        {layout="generic/.navigation"}

        <!-- my channel tags, etc --->

        {layout="generic/.footer"}

```

What am I not understanding? Secondly (let me know if I have to make another question for this one), when you go to create your dynamic layout set tag as shown above, it could look something like this correct?

```
{layout:set name="navigation"}
<!-- navigation content here -->
{/layout:navigation}

```

Could you **please** provide an example with your responses. Thank you!

# Answer
> 3 votes
Layouts are a bit hard to get your brain around to begin with. There are two things you need to know, and I think you'll be on top of it.

Layout templates work by letting you drop the content from one template within another. The places that the content appears are defined by the position of the {layout:variable} tags that you put within the layout template.

At their simplest, if a regular template includes a {layout="some/path"} tag, when that template is fired within EE all the content generated by the template is inserted into the specified layout template - the content is inserted at the point indicated by the tag {layout:contents}.

In a way that's it for the basic use case.

There are two advanced features to consider also. First, you can break up the output of the calling template into smaller parts, so rather than having all the content dumped in to replace the {layout:contents} tag, you can separate out the content into smaller chunks. You do this by bracketing the content by a layout tag pair - for example:

```
{layout:set name="more_content"}
<!-- some content here -->
{/layout:set}

```

If you do this in the calling template, when you create your layout template, you can include the content captured between the pair of tags wherever you like simply by including the tag {layout:more\_content}. You can (if you want) include duplicates of this tag - in which case you get the content twice in your final output etc.

The second advanced feature is that you can 'nest' layout templates. So one layout template can link to a second (and that can link to a third and so on). This lets you build up pages from reusable bits of layout. Crudely, the output of the first layout template is simply inserted into the layout template it calls in the same way that the is discussed above for the single use example. One thing to bear in mind if you are using this second advanced feature is that {layout:variable} elements, while they are being unpacked into a final template to send to a browser, behave like global variables - so once you have defined {layout:some\_content} in one place, it is available to any other layout templates called within the chain - so you don't have to explicitly hand such values on between templates.

So to look at your initial example, that won't work because each template can include just one {layout='path/name'} tag - if you put in more than one EE won't know where to put the content output by the template. But you could achieve that effect by chaining the three templates together - (so first template calls layout "footer", footer calls layout "header" and header calls layout "main page"). But whether this is the best plan depends a lot on what else is happening in your design.

HTH

====

Here is a simple example to address your supplementary question.

Let's suppose you have some content in a channel called "pets". In a regular template you might construct something like this...

```
<!DOCTYPE html>
{exp:channel:entries channel="pets" dynamic="no" limit="1"}
<html>
<head>
    <title>Pets FTW</title>
</head>

<body>
    <h1>{title}</h1>
    <p class="lead">{summary}</p>
    <p>{body}</p>
<ul>
    {pet_data_grid}
    <li>{pet_data_grid:name} is a {pet_data_grid:type} and has {pet_data_grid:number_of_legs} legs</li>
    {/pet_data_grid}
</ul>
</body>
</html>
{/exp:channel:entries}

```

We could split this into two bits - a layout template and a data template, like this:

```
{layout='_layouts/mylayout'}
{exp:channel:entries channel="pets" dynamic="no" limit="1"}
    <h1>{title}</h1>
    <p class="lead">{summary}</p>
    <p>{body}</p>
<ul>
    {pet_data_grid}
    <li>{pet_data_grid:name} is a {pet_data_grid:type} and has {pet_data_grid:number_of_legs} legs</li>
    {/pet_data_grid}
</ul>
{/exp:channel:entries}

```

where layouts/mylayout looks like this:

```
<!DOCTYPE html>
<html>
<head>
    <title>Pets FTW</title>
</head>
<body>
    {layout:contents}
</body>
</html>

```

These would give the same output as the original template.

*NB. It is important to note that the HTML mark-up in the data template is carried over along with everything else to the layout template...*

But we can be more adventurous. Let's suppose we want to put the heading and summary into a sidebar. We could do this like this...

```
{exp:channel:entries channel="pets" dynamic="no" limit="1"}

{layout:set name="some_name" value="{title}"}
{layout:set name="another_name" value="{summary}"}

    <p>{body}</p>
<ul>
    {pet_data_grid}
    <li>{pet_data_grid:name} is a {pet_data_grid:type} and has {pet_data_grid:number_of_legs} legs</li>
    {/pet_data_grid}
</ul>
{/exp:channel:entries}

```

and the layout template becomes...

```
<!DOCTYPE html>
<html>
<head>
    <title>Pets FTW</title>
</head>
<body>
    <aside>
        <h1>{layout:some_name}</h1>
        <p>{layout:another_name}</p>
    </aside>
    {layout:contents}
</body>
</html>

```

*Note that the stuff we've marked out using layout variable tags is removed from the {layout:contents} tag - but anything in our calling template that hasn't been tagged as a {layout:variable} gets shipped over in the {layout:contents} tag.*

The natural end-point of this type of approach is to separate out the preparation of data to display in a template from the HTML to display it - you just populate all the layout:variables in one template and put them into an HTML layout in another (layout)template.

HTH

---
Tags: templates, ee3, tags
---


# Question
Title: HTTP ERROR 500 when editing entry with image in EE2
Updated from EE 2.7.3 to 2.11.3. Entries with a fieldtype of file for images that have a image in place can now not be opened to edit them. They give a HTTP ERROR 500.

Entries without an image in that field are fine to open for edit.

The file manager still shows all 3 directories that are configured. They also show the images. But when I try to sync a folder or want to download an image I get HTTP ERROR 500 as well.

I can't find any place for further help of that problem for the moment. So I try here.

# Answer
First: The PHP options on our server 'Display errors' and 'log\_errors' were 'Off'. Switched them to 'On'.

Then I set $debug = 1; in index.php in folder expressionengine.

Now I could see

```
Fatal error: Call to undefined function EllisLab\ExpressionEngine\Library\Mime\finfo_open() in /home/foo/bar/EllisLab/ExpressionEngine/Library/Mime/MimeType.php on line 117

```

Second: on the server with PHP 5.5 the 'fileinfo' was disabled. Enabled it. Bingo! Problem solved.
> 1 votes

---
Tags: file-manager, error-500
---


# Question
Title: Synchronising dev and live ExpressionEngine 3.x websites
I'm working for a company who have an ExpressionEngine 3.x website. They have 2 copies: a dev version (on a development server), and their live website.

Periodically I will pull down a full copy of the live website (file structure + database) on to the dev domain.

Staff at the company will be making different changes to both websites. For example the live website has a 'news' channel which is constantly updated - whilst it will remain fixed on the dev site from whatever point the copy was taken. On the dev copy we may be adding new channels, channel fields, changing templates etc.

I was wondering what the best way to manage keeping things in sync is, particularly from the ExpressionEngine database perspective? If we're changing channel fields in the dev database, we cannot simply replace the live database with the dev one when we want to update the live site with our changes. Because this will remove content that's been added to the live site (news in the example given above).

What strategies do people use in this situation? I noticed there is a feature in the EE Admin panel to export channel fields. But this doesn't seem to do what's needed. For example if I've changed channel fields on the dev site and export them, I can't import them on the live site as it will complain of duplicate fields. If I delete the channel, I lose the content.

We are not using any version control systems like git for this site, and I don't actually think that will help with database related things anyway?

# Answer
> 4 votes
My strategy is this: when building new features, plan out what new fields, channels, etc you'll need to use first. Then, add those to the production site. Populate them with any initial content if you have it.

(You can easily keep new, yet-to-be-implemented channels hidden from site admins by not assigning them to their member group.)

After that you can take an export of your site and import into your dev environment. Use those new channels and fields to build/change your templates, then simply push your template changes live when you're ready.

You should never be pushing a dev database to production, expect for in very rare cases when you've run a big upgrade or done a larger site revamp (and have had a content freeze on the production site in the interim).

---
Tags: ee3, versioning
---


title: No Results Tag Isn't Working

text:
# Question
Title: No Results Tag Isn't Working
I can't seem to figure out why the no\_results tag isn't working for the Who's Attending page I'm working on. I have one page that lists all of the current events. You can click on any of the event titles to bring up a page that lists all attendees (entries with approved status). This is working very well but whenever you click on an event that doesn't contain entries with an approved status the no\_results tag doesn't work. Below is the code I'm using:

```
 <p>You have selected <strong>{last_segment}</strong></p><hr/>
 <p>Please find below the list of attendees for this event:</p><br>
  <ul>
   {exp:channel:entries channel="event_registration" status="Approved"
    limit="300" search:event="{last_segment}"}
   <li>{registrant}</li>
   {if no_results}<p>No one has registered for this event yet.</p>{/if}
   {/exp:channel:entries}
  </ul>

```

I have tried the adding 'require\_entry="yes"', adding dynamic="yes" and dynamic="no" to no avail. I've also tried using the three methods below:

```
{if total_results == "0"}No one has registered for this event yet.{/if}
{if count < 1}<p>No one has registered for this event yet.</p>{/if}
{if count == 0}<p>No one has registered for this event yet.</p>{/if}

```

I'm still unable to get the no results message to display. It should also be noted that if I add a {count} tag to my template it will output the total number of entries if there is at least one entry. The {count} tag doesn't output 0 or anything at all if there aren't any entries. Any tips or suggestions for getting this working would be greatly appreciated, Thanks!

# Answer
Removing the custom profile data tag around my channel entries tag resolved the issue.
> 2 votes

---
Tags: no-results
---


title: Expresso Store PHP 7

text:
# Question
Title: Expresso Store PHP 7
I have a site that has failed PCI compliance due to an older version of PHP. I need to upgrade the PHP install but need to know if Expresso Store v2.5.1 is compatible with PHP 7?

Thanks for any help.

# Answer
There's no mention of PHP 7 in Expresso Store's release notes and no specific mention of it in their installation guide, so one would have to take the assumption that they have not specifically tested on PHP 7 yet.

In fact, v2.5.1 was released in May 2015, 6 months before the public release of PHP 7, so it's very unlikely it has been specifically tested or updated to ensure PHP 7 compatibility.

Having said that, it's likely everything should still *just work*. PHP have specifically gone to lengths to 'make migration as painless as possible' - see the migration guide here for more details.

I would probably feel comfortable upgrading the version of PHP, however of course you must do this on a test server rather than to your live site. Make sure error reporting is on so you can see notice of any newly deprecated functions (there's not a lot) that are being used, and test your site thoroughly. Contact Expresso or one of their listed professionals if you have any major issues that need resolution.
> 1 votes

---
Tags: expresso-store, php
---


# Question
Title: Template pulling mixed data onto page -- {channel:entries} issue?
I'm having an issue with a template pulling data onto a page when it loads. For example, I have 2 sites (a desktop and mobile version). I'm attempting to pull content from the desktop site pages onto the mobile sites page. So from one template group to another.

However, the problem I'm having is that the URL is being pulled correctly, BUT the content is from the most recent post. The only way I'm able to get more than the most recent post to display is if I set the limit to be greater than 1.

This is the main listing template:

```
    {if '{segment_3}' != ''}

    {embed="mobile__site/post"}

{if:else}

{embed="_embeds/_mobile_head" entry_id="{entry_id}" page_title="Blog {if segment_3 != 'category'}{exp:channel:category_heading channel='blog'}- {category_name}{/exp:channel:category_heading}{if:else}{exp:channel:month_links channel='blog'}- {month} {year}{/exp:channel:month_links}{/if}"}

                {exp:channel:entries channel="blog" dynamic="yes" orderby="date" sort="desc" limit="4" paginate="bottom"}
                        <h3><a href="{url_title_path='blog/post'}">{title}</a></h3>
                        {summary}
                        {if full_entry !=""}
                            <p>
                                <a href="{url_title_path='blog/post'}">Read More...</a>
                            </p>
                        {/if}

                        <div class="posted">
                            Posted by {author} on {entry_date format='%m/%d'} at {entry_date format='%h:%i %A'} in {categories}<a href="{path='blog'}">{category_name} </a> • {/categories}

                            <a href="{url_title_path='blog/post'}">Permalink</a>
                        </div>

                        {paginate}
                            Page {current_page} of {total_pages} pages {pagination_links}
                        {/paginate}
                    </div>
                {/exp:channel:entries}

            </div>

        </div>
    </div>
</div>
{embed="_embeds/_mobile_footer"}
{/if}

```

And this is the post template:

```
{exp:channel:entries channel="blog" dynamic="yes" disable="categories|member_data|pagination" limit="1"}
{embed="_embeds/_mobile_head"}

                        <h3>{title}</h3>
                        {!--{summary}--}
                        {full_entry}

                            <a href="{url_title_path='blog/post'}">Permalink</a>

                        </div>
                    </div>

                </div>
            </div>

    </div>
</div>
{embed="_embeds/_mobile_footer"}
{/exp:channel:entries}

```

EDIT: I make an exact copy of the desktop version in the "mobile" version of the template. It still loads incorrectly. I'm wondering if it's a plugin issue. When I attempted to visit the developers site, it looks like the last time they answered a question was 2012. Can anyone recommend a mobile site plugin that is currently being supported?

# Answer
EE doesn't care about your template groups. All content in the channels is available in whatever templte you want. Let's say your url is this: yoursite.com/blog The index template of the blog template group would have this in it:

```
{exp:channel:entries channel="blog" dynamic="no" orderby="date" sort="desc" limit="4" paginate="bottom"}
<h3><a href="{url_title_path='blog/post'}">{title}</a></h3>
    {summary}
    {if full_entry !=""}
         <p>
             <a href="{url_title_path='blog/post'}">Read More...</a>
         </p>
    {/if}
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:channel:entries}
{/if}

```

So this would be your blog/post template:

```
{exp:channel:entries channel="blog" dynamic="no" url_title="{segment_3}" disable="categories|member_data|pagination" limit="1"}
                        <h3>{title}</h3>
                        {full_entry}
{/exp:channel:entries}

```

First see if you get this to work before putting in addons and conditionals
> 0 votes

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


# Question
Title: Custom add-on not appearing in Add-On Manager
I've created a barebones add-on directory structure, but ExpressionEngine will not list it. The only file that I've included, addon.setup.php, is defined as follows:

```
return array(
      'author' => 'h',
      'author_url' => 'j',
      'name' => 'name',
      'description' => 'desc',
      'version' => 'version',
      'namespace' => 'ns',
      'settings_exist' => false
);

```

While that is obviously junk, that is a well-formed array, providing EE with all the fields it is expecting. It is in the directory **system/user/addons/wmd\_cp**. I have enabled debugging in **admin.php**, but no issues are being displayed.

At this point, I don't understand why EE will not acknowledge this add-on's existence. For what it is worth, I have other add-ons in the directory (some third party, some I have written myself) and they display correctly. I have also matched this folder's permissions and ownership with that of the working add-ons. EE's path settings are pointing at the correct directories.

I would appreciate any insight. What have I missed? Thanks.

# Answer
> 2 votes
You need to also have a pi.wmd\_cp.php, ext.wmd\_cp.php or mod.wmd\_cp.php files with a class that matches your folder name. Otherwise, EE has no way of knowing what the addon is.

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


# Question
Title: How to update Expresso Store 2.5.1 to use Stripe TLS v1.2?
As Stripe is upgrading TLS to v1.2 soon, how do we update Store to use the later version?

https://stripe.com/blog/upgrading-tls

Is it as simple as updating the Omnipay Stripe gateway code to a later version such as the one below I just found?

https://github.com/thephpleague/omnipay-stripe/releases/tag/v2.4.0

Thanks

# Answer
When it comes to supporting TLS 1.2, generally this is a server-side change, not a script-based change. So there's no action needed on DevDemon's part. Simply ask your host if they support TLS 1.2.

(Also, Store does not use Stripe's PHP library - they make more "bare-metal" calls to the API.)

You can test it yourself by following Stripe's notes here.
> 3 votes

---
Tags: expresso-store, payment-gateway, stripe
---


# Question
Title: Upgrading from EE2 to EE3 at end of 2016 - is it worth the effort?
we are running a bigger site with EE2. We did not upgrade to EE3 because there have been missing important addons. Now we are relaunching the frontend and we are considering the upgrade.

The upgrade will be a lot of work, because still some addons are missing (like CE-Cache) or will have to be replaced.

We fear that the effort is senseless because maybe faster than expected the next major version appears (let it be EE4 or whatever) and we are facing the same problems, running a legacy version.

I would appreciate your opinion about this very much. Thanks!

# Answer
> 2 votes
The factor to focus on is what your plans are for the site itself into the future. If you plan (or think you will need to) develop the content or operation of the site in the future (e.g. adding new things / services not currently provided) then it is worth considering upgrading to EE3, otherwise the best course is to stay with EE2.

Why? Well it is clear that EllisLabs and the EE hard-core development community are moving on to EE3 - although EE2's EOL has been delayed (due to just the problems with upgrading you outline) EllisLabs will stop maintaining EE2 soon, and there is little or no development going on for EE2 add-ons, which are either being abandoned or migrated to EE3 versions.

The EE2 system you have now, while it will continue to work 'as-is', will get harder to develop: you'll be stuck with your current version of php, and with the set of Add-ons you have now. You will be able to re-skin the front end of the site and keep that up to date, but the underlying data model will be limited to being something similar to what you have today.

Upgrading to EE3 is non-trivial (outside of the "no add-ons used" edge case), but would appear to be essential for a site that will need back-end development in years to come.

There are now EE3 alternatives to most of the widely used EE2 add-ons that haven't got EE3 versions - though replacing them is not always easy. Others are still in the pipeline (e.g. Assets has just released an EE3 beta..., Publisher is '2-4 weeks' away from releasing a beta). So while it was almost impossible to migrate some sites a few months ago, it would seem that by early 2017 most of the obstacles will have been removed. There will be some add-ons that will regrettably remain absent- CE\_Cache being one of them, though (if you can get your brain around it) it looks like you can get a similar result using the caching features of `{stash}`.

Tough call though. Hope these thoughts useful etc.

# Answer
> 0 votes
If your site relies on CE-Cache I wouldn't bother updating while EE2 is still receiving updates as sites that rely on that aren't going to get anything better on EE3 at the moment.

There is very little difference from a templating point of view between EE2 and EE3, so personally in your situation I would refresh my frontend in EE2 then at a later date make the minor frontend adjustments to move to EE3.

# Answer
> 0 votes
Just depends on functionality. There are limited EE3 plugins at this point, but the market seems to be growing. We've had challenges with the few third party fieldtypes in EE3 allowing users to have more flexibility in editing contents (mainly Content Elements, which doesn't exist on EE3...used for table data allowing users to modify columns/rows).

We also were using Structure and Blueprints pretty consistently on every EE2 site, but now that Structure is compatible with EE3 that's definitely a plus. Without Blueprints or something similar, I am having to create more channels, which is kind of a pain, because I find myself duplicating some of the same fields for each channel which requires twice the templates.

Hope that helps!

---
Tags: ee2, ee3
---


# Question
Title: display the latest entry only that meets criteria
How do i display the latest entry only that meets the criteria?

Overview:

I have a channel called new. Within that channel there are two fields. File\_upload = where you can upload a file. Pull down menu field with an option called "Hero Image"

Desired:

I would like to go through the entire channel and display only the first item that meets the criteria of having a file uploaded and pull down menu selected as "Hero Image"

```
{exp:channel:entries channel="new"}
    {if file_upload != '' && newType == 'Hero Image'}
        <a href="{new_external_link}"><img src="{file_upload}" alt="{title}" title="{title}" border="0" width=980px></a><br>
    {/if}
{/exp:channel:entries}

```

# Answer
> 1 votes
Two things I suggest you might do:

1. Simplify the {if} loop by using the Channel Entries 'search' parameter
2. Use the Channel Entries 'limit' parameter to only return the first entry that matches your search conditions.

The resulting code will look something like this:

```
{exp:channel:entries
    channel="new"
    limit="1"
    search:file_upload="not IS_EMPTY"
    search:newType='Hero Image'}
        <a href="{new_external_link}">
            <img src="{file_upload}" alt="{title}" title="{title}" border="0" width=980px>
        </a>
        <br>
{/exp:channel:entries}

```

The only thing I'm not sure about is whether having a space in the newType field will cause problems. It's probably OK, but if you do have problems I suggest you try again after changing the value to be single-words only.

More on channel entries search terms here

HTH

---
Tags: entry
---


# Question
Title: Use Free Member as a way for Administrators to Register Members
I am creating a little front end admin area for a client.

I am setting it up so they can administrate users on the front end.

One feature I would like is for the Administrator to be able to Register Members using the FreeMember Register Form on the front end.

I have it all setup although obviously since the Administrator is Logged in they can not register a member because the module is picking up they are logged in and giving the following message "You are already registered and logged in."

Is there a way we can override this?

# Answer
Unfortunately FreeMember (or even other Member modules) wont be able to help with what you're trying to achieve there. When a member is logged it they are given a unique session ID which is stored in the database in the exp\_sessions table. This may be with session alone, cookies alone, or with both.

So if the user is logged in as Admin or anyone else then they wont be able to create a new member from the front-end templates.

Unfortunately most of EE's native CRUD functionality is locked in the CP so it's not that simple to work with much other than regular channel entries using Safecracker from the front-end templates. Even EE's own API mainly just provides a way to retrieve channel and category information and is only available to the back-end.

Thankfully there is now some light at the end of the tunnel thanks to Ben Croker and Open API. It's an open source API to provide CRUD functionality outside of the CP and includes Member functionality. It's nicely documented but you'd really need to take a look through and look to integrate that into your site to enable the functionality you're after. FreeMember alone wont help you to build a member management interface in your front-end templates.
> 2 votes

# Answer
In EE 2, you can modify can\_register() function, of freemember\_lib.php, to check that current user belongs to editors or admins group, instead of just checking that user is not loged in, as follows (between START and END):

```
—-
public function can_register()
{
// do we allow new member registrations?
if (ee()->config->item(‘allow_member_registration’) == ‘n’) {
return lang(‘mbr_registration_not_allowed’);
}
// is user already logged in?
/* START */
$eh_auth = new ehampstead_Auth;
if (!$eh_auth->isEditUsersAllowed() && (ee()->session->userdata(‘member_id’) != 0)) {
/* END */
return lang(‘mbr_you_are_registered’);
}
}
—–

```

Everything else works seamlessly, except that you’ll need to disable email validation e-mail, if you require user e-mail validation.
> 0 votes

---
Tags: freemember, expresso, member-management
---


# Question
Title: Obtain first paragraph of channel entry text field
Is there an easy way to get the first paragraph of a wysiwyg. In this instance I want to add it without the enclosing `<p>` tags into a Facebook `og:description` tag.

# Answer
I used the hacksaw plugin:

`{exp:eehive_hacksaw cutoff="</p>"}{copy}{/exp:eehive_hacksaw}`
> 2 votes

---
Tags: wysiwyg
---


# Question
Title: Displaying Channel Form based on member group, number of entries/channel within a date range
I am trying to run a conditional which displays a "can't post" message if the member of a group\_id 1 had previously posted 2 entries in a channel. Otherwise, it displays a channel form to post an entry.

If the member belongs to group\_id 2, he/she can't post more than 5 entries. Less than 5 entries, displays the channel form.

```
{if logged_in}
{exp:member:custom_profile_data member_id="{logged_in_member_id}"}

{exp:channel:entries
    channel="news"
    author_id="CURRENT_USER"
    dynamic="no"
    start_on="-1 months"
    stop_before="now"
    disable="pagination"
    status="not closed"
    parse="inward"
}
{if logged_in_group_id == 1}
    {if absolute_count < 2 }
{if:else}
    {if absolute_count < 5 }
{/if}
        Display the channel form
    {if:else}
        Throw an error message!
    {/if}

{/exp:channel:entries}
{/exp:member:custom_profile_data}
{/if}

```

Any pointers?

# Answer
> 1 votes
Looks like your conditional logic is awry. Try something like:

```
{if logged_in}
{exp:member:custom_profile_data member_id="{logged_in_member_id}"}

    {exp:channel:entries
        channel="news"
        author_id="CURRENT_USER"
        dynamic="no"
        start_on="-1 months"
        stop_before="now"
        disable="pagination"
        status="not closed"
        parse="inward"
    }
    {if
        (logged_in_group_id == 1 && absolute_count < 2) ||
        (logged_in_group_id == 2 && absolute_count < 5) ||
        no_results
    }
            Display the channel form
    {if:else}
            Throw an error message!
    {/if}

    {/exp:channel:entries}
    {/exp:member:custom_profile_data}
    {/if}

```

HTH

---
Tags: safecracker, members, conditionals
---


# Question
Title: Possible to template without access to the server?
Is it possible (or even ideal) to template or even make a file manager within Expression Engine without access to the server? I was given the challenge to this recently with no success (and ALOT of frustration). Not sure if I need to insist that I need access to the server or whether I'm just making this more complex than I need too.

# Answer
> 0 votes
you can edit your templates with the template manager. Css and js templates can also be available (but not recommended). For files you are restricted to the upload directories that exist. You'll need access to ftp to create new ones. But i would never do a job without proper ftp and DB access.

---
Tags: ee3, file-manager, template-scripting
---


title: EE3 best option for multilangual site

text:
# Question
Title: EE3 best option for multilangual site
Which one is best for multilangial site? Using expressionengine 3 multi site manager or transcribe?

# Answer
> 0 votes
I have been using Transcribe for a while and it is simple and elegant. The support is a bit slow but most of it is self-explanatory. LTR and RTL languages play well with Transcribe.

NavEE goes hand-in with Transcribe, to solve the menus related obstacles.

# Answer
> 0 votes
Although it is (apparently) a few weeks away from being released for EE3, Publisher is an awesome multi-language plus workflow system. So unless you are in a rush, it might be worth waiting... More at Boldminded website.

# Answer
> 0 votes
I have used Transcribe a lot, and i really like it. Publisher is ok too, but if you don't need the workflow features i'd choose Transcribe.

# Answer
> 0 votes
I'm using Republic Variables or Low Variables.. if your site is simple.. i should be enough.. I'm out of the office but if you need more infos i can explain more..

---
Tags: multi-site-manager, ee3, transcribe
---


# Question
Title: When viewing entries in CP, can I view custom fields?
I'd like to show custom fields--more than just defaults (ID/Title/Date/Status). Anyone know of a way to do this? Using EE 3.4.0

# Answer
> 2 votes
Yes you can use Zenbu. really nice addon suite https://devot-ee.com/add-ons/zenbu

---
Tags: control-panel, custom-fields, ee3
---


# Question
Title: Using CartThrob and Worldpay pre-authorization?
I want to essentially defer a payment with Worldpay, apparently this is possible using something called 'authorization'/'pre-authorization' which is detailed in their documentation:

https://developer.worldpay.com/jsonapi/docs/authorize-payment

We're using EE2 and Carthrob 2.x with a Worldpay integration, and I'm trying to figure out if this is possible. I can't seem to find any documentation on this, and going through the code is proving a bit frustrating.

Does anyone know if this is possible using CartThrob and the default Worldpay integration? Or would this require modification to the payment Gateay?

# Answer
(I'm with Vector; we make CartThrob)

There are two scenarios:

* You do the authorization with CartThrob, but do the capture later in the Worldpay admin interface. This would require a change to the payment gateway but it's very quick; it would just need the addition of a line or two to the plugin.
* You do the authorization with CartThrob but then also want to do the capture inside CartThrob. This would take more work because that new and separate capture function would need to be made along with an interface for it.

Also I assume you're using the Worldpay redirect gateway, not an on-site Worldpay gateway. If so, please note that that uses a different API than the one you linked to. It uses http://support.worldpay.com/support/kb/bg/htmlredirect/htmlredirect.htm#Common/TitlePage.htm.

Feel free to contact us at support@cartthrob.com if you have any questions!
> 1 votes

---
Tags: ee2, cartthrob, ecommerce, payment-gateway, worldpay
---


# Question
Title: Is there an ExpressionEngine current gold price plugin/module?
Client is looking to have a current gold price on their website, looking to see if there is a EE plugin or would anyone recommend a third party plugin?

Something just like on this websites header: http://polyus.com/en/

# Answer
> 0 votes
Guess you could display an rss feed with the current gold price. Something like this: http://www.24hgold.com/english/rss.aspx

---
Tags: module, plugin
---


# Question
Title: ExpressionEngine CMS 3.4.4 - Why am I unable to edit from the structure page?
Our digital agency said that we need some special plug in...I'm not sure I believe that. Any thoughts why I wouldn't be able to edit the site from here?

# Answer
Might be you haven't got sufficient rights in the member group you are in
> 0 votes

---
Tags: structure
---


title: I need help finding a page

text:
# Question
Title: I need help finding a page
Alright, I will start by saying that I'm very new to this and will not be using the most technical terminology....

I am helping with a project that someone else left. She created a web page, and I'm trying to edit a few things.

There is one page full of links that redirects to other parts of the website. I can edit the redirected pages, but cannot find a way to edit the linking page.

It's frustrating because the linking page is named the same as the page it's redirected to. It's like they should all be in the same template folder, but they're not.

Do you guys have any ideas on how to fix this???

# Answer
> 2 votes
You could try to turn on template debugging. That will tell you which template is shown. From there on you can investigate further

---
Tags: templates
---


# Question
Title: Comparisons on formatted Solspace calendar dates?
I can't seem to be able to do any comparisons on the formatted event dates within the Solspace calendar. For example, in the following piece of code I'm trying to modify the mini-calendar example from the calendar docs (https://solspace.com/expressionengine/calendar/docs/month/) not to show links to any Mondays (because the company I work for is closed on Mondays):

```
<div>
    {if calendar:day_in_current_month} {!-- Only show day number for current month --}

        {if calendar:day_total_events && ('{calendar:day_date format="%D"}' != 'Mon')} {!-- Link to the day if there's events for it, if it's not a Monday --}
            <a href="{path='/visit/calendar/day'}/{calendar:day_date format='%Y/%m/%d'}/" id="day-link-{calendar:day_date format='%Y-%m-%d'}">
        {/if}

            {calendar:day_date format="%j"}

        {if calendar:day_total_events && ('{calendar:day_date format="%D"}' != 'Mon')}
            </a>
        {/if}

    {if:else} {!-- Don't show day number if day is not in current month --}
        <strong> </strong>
    {/if}
</div>

```

The != 'Mon' comparison fails on all entries, including the ones occurring on Mondays.

Similarly, on another page I need to not show any events within a specific category during the winter months, as follows:

```
{if !( ( ('{category_name}' == 'X') || ('{category_name}' == 'Y') ) && ( ({calendar:month_date format='%n'} < 11) || ({calendar:month_date format='%n'} > 3) ) )}
    <li>
        <a id="category-link-{category_url_title}" href="/calendar/category/{category_url_title}">{category_name}</a>
    </li>
{/if}

```

This doesn't seem to work either -- i.e. all categories get displayed all the time.

Can anyone point out what I'm doing wrong in either or both of these cases?

Thanks!

Misha

# Answer
There is currently limited support for conditionals due to performance reasons and because many of these date variables are timestamps set with UTC.

One workaround for now might be to use an embed to handle the parsing. This isn't a plug and play solution, but it should give you an idea of what options you have for adjusting your template:

```
{embed="calendar/conditional_check" date="{calendar:day_date format='%D'}"}

```

And in the embedded template:

```
{if embed:date == "Mon"}*{/if}

```

However, I have made a note about this for future consideration to allow for this functionality. :)
> 1 votes

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


title: MX Google Map Control Panel Error

text:
# Question
Title: MX Google Map Control Panel Error
I am getting the following errors when opening an entry with an MX Google Map field type. Map is not loading in control panel. Any suggestions on how to fix this?

ReferenceError: Can't find variable: google

```
 mapTypeId: google.maps.MapTypeId.ROADMAP,

```

TypeError: undefined is not an object (evaluating '$.mxgoogleMaps.defaults')

```
var opts = $.extend({}, $.mxgoogleMaps.defaults, options);

```

# Answer
As the site is running over https I had to modify the URL in the following line of code to https.

**fx.mx\_google\_map.php (Line 135)**

```
ee()->cp->add_to_foot('<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>');

```
> 1 votes

---
Tags: jquery, mx-google-map
---


# Question
Title: remove second segment in url for entry listings
Currently using `{url_title_path='blog/blog-entry}` for listing entries, but URL outputs `/blog/blog-entry/listing-title`. I'd like the URL to be `/blog/listing-title`. Can I do this using routes? What's best way to accomplish?

# Answer
> 0 votes
just use a href="blog/{url\_title}" however, you'd have to add some segment checking in your blog template like {if segment\_2 == ''}show overview{if:else}Show post{/if}

---
Tags: templates, url, url-title, template-routes
---


title: New Domain Name - Staging Server

text:
# Question
Title: New Domain Name - Staging Server
My company is in the process of migrating a client's EE site from their old hosting company to ours. Prior to flipping the DNS switch and making everything live, we wanted to import the site to our servers and test it to confirm everything was working and unfortunately it's not. When we pull the site up on our site (which does have a new domain tied to it, since it's a temporary binding), we just get a blank white screen.

Our first thought is it's related to a licensing issue, as the "new" domain isn't licensed whereas our assumption is the old one is. We're fairly new to EE as an engine (mostly a Wordpress team) so am I on the right track here or is there something else we should look for?

# Answer
> 2 votes
First thing is checking your config.php and database.php. They can be found in /system/expressionengine/config. Check your database credentials.

In the config.php file check the file paths and turn error reporting on.

Also, there might be an alternative config solution such as config bootstrap or master config. If that's the case, update those files with the proper settings.

Check the paths in your index.php and admin.php files in your root dir.

Check to see if you can log in to the EE cp

If you can log in, check and update all server paths

Also check this gist: https://gist.github.com/litzinger/5598641

If nothing helps, Contact us again ;-)

---
Tags: server-migration, staging-server, domain
---


# Question
Title: Solspace User module allow only admin to register
I'm new to this module. Here is my dilemma. I want have only one person be able to register members and I have to do this through a front end template because I want to be able to assign categories to them. Is it possible to have "allow new member registration" turned off and still accomplish this? I've had issues in the past where I had that turned on and got spammed with 1000's of registrations. Any help would be great!

Here is my template code:

```
{if logged_in}
 {if group_id == 1 OR group_id == 6}
<-- registration fields -->
 {/if}
{/if}
{if logged_out}<h2>Please <a href="{path=members}">login</a> to view this page.</h2>{/if}

```

# Answer
> 2 votes
Well, you should be using either Captcha or a Honeypot in your form; that would really prevent a lot of your issues. You will need to have `Allow New Member Registration` set to on, but can prevent the spam.

A really simple way to do this on the front end would be to create a user registration form and wrap the whole form in a tag like this:

```
{if group_id == 100 || group_id == 1}

    {!-- output your registration form --}

{if:else}

    {redirect=404}

{/if}

```

Provided the id of your "Member Registrar" group is 100, this will output the form if the logged in user is in the group that's allowed to register people; if not it will redirect to a 404 page. It also allows super admins (`group_id == 1`) to access the form. Your post success page should be protected from rogue HTTP `POST` requests since it will require a generated CSRF token.

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


# Question
Title: installing EE on web server in sub-directory...URLs...ugh
I'm new to expression engine and I run into this aggravating problem EVERY time I install EE. Whenever I upload my templates, my URLS break almost everytime. The only way to fix it is to go in an manuelly tag every image IMAGE/CSS/JS URL with {base\_site} and then ensure my folders are all on the base of the my site/sub-folder. Is there any other way to ensure my URLs won't break at upload other than what I just said? It's just so time-consuming to have to do it all manuelly? Once again, this is in a sub-direction (i.e. website.com/\_development\_sites/mysite).

See the below code for an example. Do I really have to insert the {base\_url} for all my JS/CSS files and IMAGE tags and image links in order for them to work? Isn't there a faster work around so I don't have to spend so much time customizing my HTML template before uploading?

Any ideas?

\`

```
<link rel="stylesheet" href="{base_url}css/overrides.css" type="text/css" />
<link rel="stylesheet" href="{base_url}css/responsive.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />`

```

# Answer
> 1 votes
I'm not sure if this answers your question but I'll at least give a suggestions moving forward (it is probably too long for a comment). One reason I'm not sure if it answers your questions is because your `.htaccess` rules could handle this, but I wouldn't recommend that route.

If you install EE in a sub-directory (say `http://www.site.com/ee-site/`), you should be setting your site `Default Base URL` to `http://www.site.com/ee-site/`. Then, when you **generate** new templates, always use the `{site_url}` tag in the beginning of your links:

```
<link rel="stylesheet" href="{site_url}css/overrides.css" type="text/css" />

```

This is a best (or at least better) practice. This way, say you have three copies of a website that look like this:

```
Development site : Default Base URL : http://www.site.com/development/
Staging site     : Default Base URL : http://www.site.com/staging/
Production site  : Default Base URL : http://www.site.com/

```

You can work on a template in your development site, and as long as you always use your `{site_url}` tag in the beginning of your `href` and `src` parameters, you can copy that template between sites freely and it will automatically work.

You could even change domain from say `http://www.site.com` to `http://www.new-site.com` and as long as you set each `Default Base URL` for each site correctly, you'll be all set.

---
Tags: url, ee3
---


title: How to set and get cookies in EE 3?

text:
# Question
Title: How to set and get cookies in EE 3?
I have found how to set/get browser cookies using older versions of EE (1&2) and can obviously do this also in EE 3 using legacy functions/libraries.

How would I do this in EE 3 NOT using legacy functions?

I would like to store a shopping chart for not yet registed users.

# Answer
> 1 votes
EE3 still uses the legacy Input library internally, so the same methods apply.

```
ee()->input->cookie();
ee()->input->set_cookie();
ee()->input->delete_cookie();

```

Or, use the Cookie Helper.

The one new method you can use for *getting* a cookie is the Request service.

```
ee('Request')->cookie($name, $default_value);

```

---
Tags: cookies
---


# Question
Title: Some valid form submissions are blocked and EE errantly thinks they are robots
I have several contact forms on our site, but only experience issues with the form for job applications (http://www.autouplinktech.com/careers). Most submissions work with no problems and I cannot reproduce the issue, but we have many seemingly random report of users not being able to submit the form because EE mistakenly thinks they are a robot. We have no captcha enabled on the form whatsoever.

Anyone experience this sort of issue or might know what to do?

We are using Freeform Pro for the form.

# Answer
So we've had some good feedback from a user to let us know what the problem is most likely. The issue was with our job application form on the Careers page. Users were attempting to submit their info from a 3rd party form like Flexjobs.com. When they attached their resume, the form attempted to submit their info with the resume as an attachment. Freeform just adds the resume to an Uploads folder which of course can only be accessed by our local system. EE or Freeform didn't know what to do with an attachment from a 3rd party form submit, so it treated like like a spam attack and blocked it.
> 0 votes

---
Tags: solspace-freeform, forms, spam
---


# Question
Title: Where does EE2 get the latest member_id from?
I've deleted a bunch of members (on purpose), so that I only have member\_id '1' left. Now if I create a new member... The newest member\_id is '176' and then increments as I add more… If the members have been deleted where did expression engine get that number from? The last member\_id created must be stored somewhere in order for EE to reference it? I can’t find it for the life of me.

# Answer
> 0 votes
This has nothing to do with ExpressionEngine. This is a counter that exists in MySQL when a column is set to `AUTO_INCREMENT` and is the primary key.

You can reset the column in this table if you'd like.

**TAKE A BACKUP OF YOUR `exp_members` TABLE BEFORE PROCEEDING**

This warning is just in case you fall down the rabbit hole of miss-typed syntax.

Run this MySQL query (provided your table prefix is the standard `exp`) to reset your counter to whatever you'd like:

```
USE `my_database_name`;
ALTER TABLE `exp_members` AUTO_INCREMENT = 1;

```

Set `1` to whatever you want the counter to start with (it will default to highest current index plus one if you have a row with 1 for the primary key). Remember, messing with your production database requires serious caution.

---
Tags: ee2, members, database, member-details
---


# Question
Title: How to empty/clear cart when adding a new product?
Is there any way to empty or clear the cart when a user adds a new product?

I'm aware of the `clear_cart` tag but this doesn't work when using the browser's back button, allowing users to add multiple products (or multiple types of products) to the cart.

I think this is happening because the page does not fully reload when using the back button so the `clear_cart` tag is not fired.

Expresso Store has a `empty_cart` parameter for it's product tag that empties the cart when a product is added as opposed to when the page loads.

I was wondering if there was anything similar for Cartthrob? Or a workaround that achieves the same thing?

I've thought about forcing the page to reload when using the back button but I'd prefer to avoid this if possible.

# Answer
> 0 votes
On clicking the add to cart button you could make an ajax GET request for a template that only contains the `clear_cart` tag... Although if it were me I'd probably build a quick extension to do this instead so it's not reliant on JavaScript. Would be very quick and easy using the `cartthrob_add_to_cart_start` hook: https://www.cartthrob.com/docs/developers/hooks/index.html#cartthrob\_add\_to\_cart\_start

# Answer
> 0 votes
(I'm with Vector; we make CartThrob)

Your "add to cart" link on product pages doesn't need to be a real "add to cart" link. When someone clicks "add to cart" on a product, they can be sent to a template like `/store/add_to_cart/{product_id}`. Then in your `store/add_to_cart` template you'd have something like:

```
{exp:cartthrob:clear_cart}
{exp:cartthrob:add_to_cart entry_id="{segment_3}" quantity="1" return="cart/index"}

```

ExpressionEngine should parse the `clear_cart` first, then the `add_to_cart`, and then redirect the user.

---
Tags: cartthrob
---


title: Freefom, Captcha and Ajax Submission

text:
# Question
Title: Freefom, Captcha and Ajax Submission
I have a Solspace FreeForm 4 form (free version) which I need to submit using Ajax. I can handle all the field validation in my JS but how do I handle a captcha error?

# Answer
I've been using Snaptcha http://devot-ee.com/add-ons/snaptcha on my recent sites, I can attest that it works very well, No one enjoys filling out these captchas anyway, and their efficacy is doubtful anyway.
> 15 votes

# Answer
When a Freeform form is submitted with AJAX Freeform can provide JSON response containing errors or success, which can be used to display errors. This has worked well for me on previous versions of Freeform. The docs for the latest version of Freeform say that Freeform will detect AJAX automatically and provide a JSON response you can use to display user error/success feedback.

See the `ajax` parameter in the documentation.

There is actually an example of ajax form submission with validation at the end of the documentation, too.
> 6 votes

# Answer
The captcha message comes back when the form is successfully posted. You can grab it in the success function of the ajax call:

```
var form_data = $('#form_id').serialize();

$.ajax({
    type: "POST",
    url: 'desired_url',
    dataType: 'html',
    data: form_data,
    success: function(responseText, statusText, jqXhr) {
        if (responseText.includes("errors")) {
            var msgArray = $.parseJSON(responseText);
            var errorMessage = msgArray['errors'][0];
            // do whatever you want with the errorMessage.
            return false;
        } else {
            // continue
            return false;
        }
    },
    error: function(jqXhr, statusText, errorThrown) {
        console.log(errorThrown);
        return false;
    }

});

```
> 0 votes

---
Tags: ee2, ajax, solspace-freeform, captcha
---


title: Subdomain Mapping by Proxy

text:
# Question
Title: Subdomain Mapping by Proxy
# Background

We are trying to map a subdomain to a regular EE template group, without changing the URL.

Assume that the 'natural' URLs to the templates would look something like this:

`my-domain.com/group`
`my-domain.com/group/url-title`

The desired subdomain set up would therefore look something like this:

`group.my-domain.com`
`group.my-domain.com/url-title`

The rewrite rule we have set up on the subdomain looks something like this:

`RewriteRule ^(.*)$ http://my-domain.com/group/$1 [P]`

which, as I understand, will proxy the request to the 'natural' URL.

# The Problem

The problem we are having is that by the time the proxied request hits the server, the `/group` portion of the URL has been duplicated. So the request ends up looking something like this:

`my-domain.com/group/group/url-title`

which obviously doesn't work.

# Debugging

* If I remove the `[P]` flag, the rewriting works correctly. (i.e. the request ends up looking something like `my-domain.com/group/url-title`).
* I have tried using other segments after the domain in the rewrite rule, (just fake ones e.g. `/abc`) and the same thing happens with them.

Could there be anything ExpressionEngine is doing to handle / map a request which could be affecting a proxied request?

# Answer
> 0 votes
Whilst I don't completely understand *why* it works, we do have a solution that works, so I thought I would post it here.

The rewrite rule now looks like this:

`RewriteRule ^(?:group)?(.*) http://my-domain.com/group/$1 [P]`

which correctly redirects as expected.

---
Tags: subdomain, routing, mod-rewrite
---


title: passing a category id to an embed

text:
# Question
Title: passing a category id to an embed
I'm trying to pass a category id to an embed like so:

```
{if local_ratings=="Los Angeles"}
{embed="embeds/ratings" cat="22"}
{/if}

```

The "local\_ratings" is an EE dropdown.

In my embed I have:

```
{exp:channel:entries channel="reports" disable="member_data|trackbacks"  limit="200" category="cat" dynamic="no"}
... stuff ...
      {if absolute_count == total_results}{if:else},{/if}
{/exp:channel:entries}

```

I cannot get anything to output from the embed. If I manually add an ID to the embed it works.

# Answer
> 1 votes
I believe you have to use proper tags to access embed vars, ie:

> {exp:channel:entries channel="reports" disable="member\_data|trackbacks" limit="200" category="{embed:cat}" dynamic="no"} ... stuff ... {if absolute\_count == total\_results}{if:else},{/if} {/exp:channel:entries}

---
Tags: ee2, categories, embeds
---


title: Removing index.php rewrite not working

text:
# Question
Title: Removing index.php rewrite not working
I use the official EE rewrite rule to remove index.php. This has always worked for me just fine... until now. I am using a hosting company that I've not used before and it is acting funny.

The problem: all routes are getting passed to the main index template, as if there were no additional url segments.

Here is what I'm using:

```
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond $1 !\.(gif|jpe?g|png|pdf|doc|mp3|mov|mp4|tiff|ico|tif)$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

```

Anyone seen this issue before?

Update: I am using an A Small Orange shared plan.

**The solution:** In config.rb, I needed to change this...

```
$config['uri_protocol'] = 'AUTO';

```

to...

```
$config['uri_protocol'] = 'REQUEST_URI';

```

# Answer
Try adjusting your uri\_protocol settings. When I have experienced these issues it has always been solved by specifying "PATH\_INFO" or "ORIG\_PATH\_INFO".
> 6 votes

# Answer
The one I've been using has a nice little comment that might help you:

```
<IfModule mod_rewrite.c>
 RewriteEngine On
 # Removes index.php
 RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ /index.php/$1 [L]
 # If 404s, "No Input File" or every URL returns the same thing
 # make it /index.php?/$1 above (add the question mark)
</IfModule>

```
> 2 votes

# Answer
I can't tell you why, but this is what I have. I host several sites with ASO and it has always worked for me. It's also possible there is something in there that isn't needed. I've just hated to mess with something that has worked!

```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.+) $1 [R=301,L]
RewriteCond %{THE_REQUEST} ^GET
</IfModule>

```
> 2 votes

# Answer
The one I use (which always works for me on MediaTemple DV hosting) is slightly different. Maybe it'll work for you:

```
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

```
> 1 votes

# Answer
You may need to add a `?` after `index.php`

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

```
> 0 votes

# Answer
I feel dumb for not realizing this before searching, but since this does in fact fix this problem for me: make sure the Apache rewrite module is actually turned on:

```
a2enmod rewrite

```

(for Ubuntu)
> 0 votes

---
Tags: htaccess
---


title: Is EE 3.4.5 buggy?

text:
# Question
Title: Is EE 3.4.5 buggy?
I was banned as a member and paying EE licensee from replying to Ingmar Greil on a post I made on The EE forums here at the following link:

https://expressionengine.com/forums/topic/249532/is-ee-3.4.5-buggy

I was hoping to be able to leave my comment but, since I was banned from replying hopefully this message will get to Ingmar Greil from here:

Here are the comments:

-

> Hello,
>
> After trying to post another reply on this thread I was greeted by the following EE' error Message:
>
> "Error Message
>
> Due to a heavy increase of spam within our community, the privilege of posting certain content is currently reserved for active community members and those who have purchase our software. If you feel you have received this in error, please contact sales@expressionengine.com with a support key of luktpi3v-g1sOk008-kOs848sc-Ooowg82s for more information"
>
> I am a member of the EE community and I have purchased countless EE licenses. Anyway, here is my response to Ingmar Greil that I couldn't reply to in my original message:
>
> For future visitors encountering the same issues, please note that upgrading from 5.3.3 on CentOS 6.8 requires third-party repositories. These upgrades tend to break functionality of some control panel updates (like mine). Do your own research very carefully. EE is naturally motivated by their own needs as a profit-making company, and they will not absorb the costs of fixing our complex problems. So from their perspective, they save money by retiring older software, but we as customers may not be yet ready to jump. That's why server OS's like CentOS and Redhat are considered stable and used by companies that need long-term stability and support of their software. Likewise, those types of companies using EE need longer support and stability of tried and tested versions.
>
> My only request to EE would be to continue to support V2 for a longer run since it is very stable. I have implemented EE on many sites over the past several years because of the fantastic development that began their entire operation with the invention of CodeIgniter and the earlier versions of EE which were developed to a point of excellent stability. I hate to see such a fantastic product degrade to the chaotic state of Wordpress' control panel - with its pull of news feeds, constant pings out to the parent and plugin developers sites etc - when EE began as a very unique product on the landscape of CMS's with its elegant and simple platform.

-

> Hello,
>
> Is EE 3.4.5 buggy? For example, I cannot create grid fields and have the fields permanently saved. Also, Do I really have to update php version to 5.3.10? My websites are running 5.3.3 on centos 6.8 fine. However, I’ve read on the other forums that updating to 5.3.10 can break some sites. If so, am I forced to revert to EE 2 which runs perfectly fine but will soon be phased out? Seems odd to do that when EE 2 works solidly.
>
> This is lost time and money for me, particularly since I purchased several EE 3 plugins that I may not be able to use. To top it all off, EE 3 puts a link on the control panel page for submitting bugs to EE… Should this be something my clients are subjected to do? They must become beta testers for EE but will not be compensated for it? EE is not a community working together on a FREE software project. That’s why I’m asking the question, is EE 3 buggy?
>
> eeadmin

-

> "Do I really have to update php version to 5.3.10?"
>
> Yes, EE needs at least PHP version 5.3.10. That said, this release is almost five (!) years old, so you really should be upgrading anyway.
>
> Ingmar Greil 29243 Posts

# Answer
> 2 votes
I'm not seeing any major issues with EE v3 running on php version 5.6.2. I'm only running a few modules and I'm doing it all locally (Mamp).

In your scenario, I'd pull down the db/templates and set up a test environment (wamp/Mamp etc) and do tests for your circumstances.

Bug report links are a norm these days and if you feel so strongly about it, lodge a feature request with EllisLabs to have it hidden by member group.

Is it (EE3) buggy? - my handful of tests suggest that it's quite stable but as with all software, it must be tested to gauge if it suits your needs and environment.

---
Tags: ee2, ee3, ee
---


# Question
Title: Filtering of search results based on multiple checkbox entries per field in Supersearch
I've got an advanced search set up on my site, using Solspace's Supersearch, in which I'd like to filter the results based on input from multiple checkboxes associated with a single field. The code is based on the following format:

```
<form method="post" action="{path='search/results'}/" id="adv-form">
<input type="hidden" name="csrf_token" value="{csrf_token}" />
<input type="hidden" name="inclusive_keywords" value="no" />
<input type="hidden" name="redirect_post" value="yes" />
<label><input type="checkbox" name="my_field_name[]" value="value1" />Value 1 </label>
<label><input type="checkbox" name="my_field_name[]" value="value2" />Value 2 </label>
<label><input type="checkbox" name="my_field_name[]" value="value3" />Value 3 </label>
<label><input type="checkbox" name="my_field_name[]" value="value4" />Value 4 </label>
<input type="submit" class="submit" id="submit" name="submit_adv" value="Search Our Directory"/>
</form>

```

I have entries with "Value 1" checked and no entries with "Value 2" checked. Searching for "Value 1" works, searching for "Value 2" gives me no results which is also fine. The problem is that when both "Value 1" and "Value 2" are checked my results are filtered for "Value 1" when I would expect it to give me no results.

# Answer
Unfortunately, you cannot perform inclusive searches like this on custom fields.

You could achieve inclusive (AND) searches with keyword searches by adding "&&" to each of your values, and in the URI it would show up like: http://site.com/search/results/search?keywords=value1&&value2&&value3

But the above does not work on custom fields yet, so the best it can do right now is "OR" searches: http://www.solspace.com/docs/super\_search/search\_syntax/#custom\_fields

Sorry for the inconvenience
> 0 votes

# Answer
I suggest trying out Reefine for this type of functionality. Worked well for me on one site, though I don't know about EE3 compatibility...

http://devot-ee.com/add-ons/reefine
> 0 votes

---
Tags: solspace, supersearch
---


title: Stash corrupting data in EE3

text:
# Question
Title: Stash corrupting data in EE3
Have simple use of stash in a template. Worked fine in EE2, but with EE3 after upgrade stash is scrambling the content.

Here is an example of the kind of issue. Example short-hand stash-set / stash-get syntax (but using long hand doesn't fix)

Value stored via this type of tag:

```
{exp:stash:value parse="yes"}test{/exp:stash:value}

```

And retrieved via this kind of tag:

```
{exp:stash:value process="end"}

```

In EE2 the second tag faithfully provides the required value (i.e. 'test'). In EE3 (for the test string 'test') I'm seeing this:

```
{cf517f46e6ed2e6b3d3f7e67d457f36f1602617362}

```

Any ideas how I can fix this?

# Answer
ExpressionEngine (**all** versions) will choke if you use the same tag as a single *and* as a pair in the same template:

```
{exp:stash:test process="end"}

{exp:stash:test}Test value{/exp:stash:test}

```

It could be that this worked for you in EE2 but not in EE3 because of subtle changes to the parser, but it would have been a fluke that it seemed to work at all.

This will work:

```
{exp:stash:get name="test" process="end"}

{exp:stash:test}Test value{/exp:stash:test}

```

Or:

```
{exp:stash:test process="end"}

{exp:stash:set name="test"}Test value{/exp:stash:set}

```

Or:

```
{exp:stash:get name="test" process="end"}

{exp:stash:set name="test"}Test value{/exp:stash:set}

```
> 1 votes

---
Tags: stash, ee3
---


# Question
Title: How to show category of entry within relationship field
How do I show the category of an entry within the native EE relationship field?

I've tried using this which doesn't seem to work. (EE v3.4.3)

```
{relationship_field:categories}
    {relationship_field:category_name}
{/relationship_field:categories}

```

# Answer
I guess you should try something like this:

```
{relationship_field}
    {relationship_field:categories}
        {category_name}
    {/relationship_field:categories}
{/relationship_field}

```
> 1 votes

---
Tags: categories, relationships
---


title: Social share not working on desktop

text:
# Question
Title: Social share not working on desktop
I currently have this code for our social share buttons. The twitter seems to work although doesn't seem to post the image but not the others. But if I do it from my mobile it does work.

```
<div class="share{if article_author} byline{/if}">
    <span class="pull-left">Share:</span>
    <a target="_blank" href="https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Fwww.example.com%2Fabout&text={exp:url_encode}Business News: {title}{/exp:url_encode}&tw_p=tweetbutton&url={exp:url_encode}http://www.example.co/section/news/{url_title}{/exp:url_encode}">
        <img src="/assets/images/share_btn_twitter.jpg" alt="Share this page on Twitter" width="39" height="19">
    </a>
    <a onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fwww.example.com/section/news/{url_title}','facebook-share-dialog','width=626,height=436');return false;" href="#">
        <img src="/assets/images/share_btn_facebook.jpg" alt="Share this page on Facebook" width="39" height="19">
    </a>
    <a target="_blank" href="https://www.linkedin.com/cws/share?url={exp:url_encode}http://www.example.com/section/news/{url_title}{/exp:url_encode}&title={exp:url_encode}South East Business News: {title}{/exp:url_encode}&source={exp:url_encode}http://www.example.com{/exp:url_encode}">
        <img src="/assets/images/share_btn_linkedin.jpg" alt="Share this page on Linked In" width="39" height="19">
    </a>
    <a href="javascript:window.print();">
        <img src="/assets/images/share_btn_print.jpg" alt="Print this page" width="39" height="19">
    </a>
</div>

```

# Answer
This is good you have write so many URLs to share the site on social media. You can shorten all this just by using ShareThis or AddThis.

Visit below URLs:

http://www.sharethis.com/

http://www.addthis.com/
> 0 votes

---
Tags: facebook, social
---


title: Unable to Access Add-ons Folder

text:
# Question
Title: Unable to Access Add-ons Folder
I have just installed EE 3.4.5 for a new site and have added two modules: Structure and Wygwam. When I try and go to the Add-ons folder to activate and manage them, I get the following error:

> No such property: 'assigned\_modules' on EllisLab\ExpressionEngine\Legacy\Facade ee/EllisLab/ExpressionEngine/Legacy/Facade.php:107

Has anyone else had this problem and if so, what is the solution?

# Answer
> 1 votes
This is a bug in 3.4.5. the solution is here. Click on the solution tab to see the necessary code change.

---
Tags: module, php-errors
---


# Question
Title: How do I display grid content in Bootstrap Carousel?
I am working with Bootstrap and EE 3.4.5 Grid and need a little help on the carousel.

With the following code all instances of the slide have class 'active'

```
<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->

  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
  </ol>

  <div class="carousel-inner">
    {slider}
    <div class="item {if count == 1}active{/if}"> <img src="{slider:photo}" style="width:100%" alt="First slide">
      <div class="container">
        <div class="carousel-caption">
          <h1>{slider:title}</h1>
          <p>{slider:sub_title}</p>
          <p><a class="btn btn-lg btn-primary" href="{slider:links_to}" role="button">{slider:button_text}</a></p>
        </div>
      </div>
    </div>
    {/slider}
 </div><!-- /.carousel-inner -->

```

If I remove {if count == 1}active{/if} the carousel disappears, but I only need active on the first slide. Any suggestions?

# Answer
I just realized that because it is in a grid it requires the following:

```
{if slider:count == 1}active{/if}

```
> 0 votes

---
Tags: bootstrap, twitter-bootstrap, carousel
---


# Question
Title: Is upgrading ExpressionEngine a big pain - or am I just a wimp?
until today I ran EE 2.8.1 because I always avoid upgrading EE.

Now again I tried to upgrade to the newest 2.10.x. I have about 15 Modules installed (mostly commercial), which I had to update. I downloaded EE 2.10. I made backups. I renamed folders. I set file permissions. And then, finally, running the update-wizard, I was told that the PHP-version on my server is just 5.3.7.x, 5.3.10... would be required, please contact your hosting provider. Ok. Turning everything back. On Monday I am going to contact my provider.

Ok - the updating-instructions are good and detailed. Taking backups makes sense. File permissions have to be set. I could have checked the required PHP-version before

But always when upgrading it is required to make backups from everything, setting file-permission, renaming files, changing index.php and admin.php … This drives me crazy. Really.

Now my question is this: Is updating EE a pain in the '\*$/%§ or am I just too sensible?

# Answer
> 3 votes
I wouldn't say it's a pain. It certainly should be a planned event though. There was a great podcast about this a few months ago over on the Ctrl+Click podcast. Check it out here: http://ctrlclickcast.com/episodes/upgrading-ee I've upgraded 100's of Wordpress sites many times and probably about 50 EE sites. Despite Wordpress having the one click update, I still cringe anytime I have to upgrade it. With one click, you are always rolling the dice, and trust me I've lost that battle many times. Even Drew Jaynes who just led up the 4.2 release said you're crazy if you don't upgrade your plugins, then deactivate them, backup your database, run the updater, then one by one reactivate plugins to test. So in reality, if we are doing it correctly, there's little to no difference.

A couple keys to remember (in any CMS) is to plan for upgrade. That means make sure any custom code you write isn't going to be affected by core updates (don't hack core), and use minimal plugins by people you know will support you and keep the plugins updates, backup.

Also, note that you don't have to copy files, rename, and change them back. I rarely do this. I just make sure I'm aware of what files I'm overwriting. I also use a git workflow though, so if mess it up, I just go back in time.

# Answer
> 2 votes
As a developer, I take on huge projects that span months to years with an incredible amount of engineering involved. I just upgraded a site with 500k weekly hits.

It wasn't the easiest thing ever, but compared to the very complex things a good developer is capable of, it was a walk in the park. I'm afraid it's one of the tiniest fish in the pond of hard tasks.

# Answer
> 2 votes
If you're on EE3, the update process is much more manageable for two reasons:

1. You only need to replace two directories as part of the update process. Ellis Lab did a better job of separating user files from core EE3 files.
2. You can now check for add-on updates directly from the Control Panel.

# Answer
> 1 votes
IF you are following each step mentioned in upgrade doc it's worlds easiest task.

however it's a bit tough if you are not using a stable version currently or your EE current version is older than 2.7 .

in both these cases you will face some deprecated functions issues, but trust me these can be resolved easily.

but when you say you are using 2.8.1 it's pretty easy to upgrade into EE 2.10.1

---
Tags: upgrade, updating
---


# Question
Title: Expression engine 3 -get the url of a channel entry
How do I get the url path for a particular channel entry?

```
{exp:channel:entries channel="work" limit="1" dynamic="no"}
    <h2>{title}</h2>
    <!-- link to url here -->
{/exp:channel:entries}

```

# Answer
there is no such thing as an url in EE. You can however grab the url title like so: {url\_title} however, you'll either have to do something like

```
<a href="(path="template_group/template"}">

```

(which i hardly use) or more harddcoded

```
<a href="{site_url}news/{url_title}">

```
> 3 votes

---
Tags: channel-entries, url, path
---


title: Creating a featured channel entry

text:
# Question
Title: Creating a featured channel entry
I would like to add channel field checkbox called featured and filter out the entries if it is checked.

Can this be done using the channel entries tag?

# Answer
> 1 votes
Yes, It is possible for sure. Follow the steps.

1) create a checkbox field named "featured" and pass the checkbox options i.e, "yes".

2) check the checkbox in entry which you want to set as featured.

3) on fornt-end code of your `{exp:channel:entries}` pass parameter `search:featured="yes"`

This will bring the entries only you checked as "yes" in backend.

---
Tags: channel-entries, custom-fields, filter
---


# Question
Title: How can an ExpressionEngine installation be updated to the latest version?
Simple as that -- How is an install upgrade performed? Links, anyone?

# Answer
If you're upgrading EE3 to another version of EE3: https://docs.expressionengine.com/latest/installation/update.html

If you're upgrading from EE2 to EE3: https://docs.expressionengine.com/latest/installation/upgrade\_from\_2.x.html

If you're upgrading EE2 to EE2: https://docs.expressionengine.com/v2/installation/update.html
> 4 votes

---
Tags: update
---


# Question
Title: Stash embed not working in EE3 after update
***Have edited this question in light of further information subsequent to the initial question being posted...***

Have Stash 3.0.4 running on EE 3.4.6.

Have migrated an EE2 site that is working fine, to EE3.

Several of the templates are simply a one-line {stash:embed} tag which redirects to one of several shared templates. The redirect templates look like this:

```
{stash:embed:_resources-cat-index process="start"}

```

This redirection approach works fine in EE2, but in EE3 the embeds are failing: rather than running the template defined in the embed, an error is displayed of this form:

> **The following errors were encountered**
>
> `Stash: the file "/var/sites/e/ee3.2gc.org/system/expressionengine/templates/default_site/stash_templates.group/_wwd-index.html" was not found.`

Because the error occurs before a template is loaded, there is no debugging information showing beyond this error message.

I have tried removing all the one other extension that uses the `template_fetch_template` method but it makes no difference.

Any ideas what might be a solution?

# Answer
Make sure you have defined a list of allowed extensions for embeds in your config, and that your embed is using one of them, e.g.:

```
$config['stash_file_extensions'] = array('html', 'md', 'css', 'js', 'rss', 'xml');

```

Make sure that you have defined the path to your stash templates:

```
$config['stash_file_basepath'] = "/path/to/my/stash/templates/"

```

If you have checked these and it still isn't working, there are a few possibilities:

* Verify that the `stash_fetch_template` and `template_fetch_template` extensions are installed. If not, delete and reinstall Stash.
* Check which other add-ons use the `template_fetch_template` extension hook. You may find that disabling them causes your embed to work, in which case you should contact the author of the add-on responsible and ask them to check the value of the `ee()->extensions->last_call` property when the hook is triggered, and to return a value from their extension.
* You may have other tags throwing errors which would interrupt the template parser and stop it completing. You can either use the template debugger to see which tag is processed last and/or remove other tags from the template until the embed works, to figure out which tag(s) are the culprit.
> 0 votes

# Answer
Found the answer: very annoying in the end. Lack of a trailing slash in the `$config['stash_file_basepath']` setting... grr!
> 0 votes

---
Tags: stash, ee3
---


# Question
Title: Stash construct works in EE2 but fails in EE3... why? how to fix?
I have this code fragment that works in a template when running EE2, but fails when the same template is run under EE3. I can't work out why. Would value any guidance anyone can give about how to fix. The fragment is:

```
{exp:stash:category_image parse="yes" trim="yes" output="yes"}
    {exp:category_construct:categories entry_id="{what_we_do_item_selector:image_button_switcher:entry_id}"}
        {if construct:level_count == "1"}
            {exp:channel:categories show="{construct:cat_id}" style="linear"}
                {category_image}
            {/exp:channel:categories}
        {/if}
    {/exp:category_construct:categories}
{/exp:stash:category_image}

```

which sets a value that is retrieved later within the same template using

```
{exp:stash:get name="category_image"}

```

It is a bit messy because `category:construct` cannot limit its output to a single entry using a tag parameter, and it is difficult to retrieve the `category_image` for a channel entry.

I am aware that the stash tag uses the 'short form' tag - but weirdly if I replace this with the long form tag, the tag fails in both EE2 and EE3.

This suggests I'm doing something that is probably illegitimate, but I cannot see what it is.

Anyhow - if anyone has any ideas about how I can capture the category\_image URL more efficiently I'd be pleased to hear.

Thanks in advance for whatever help you can provide.

For clarity, I'm using EE2.11.3 / EE3.4.6 and Stash 3.0.4

# Answer
> 2 votes
One obvious problem there is that that you are parsing only one layer down when capturing the Stash variable. So you would actually be capturing this:

```
{exp:channel:categories show="{construct:cat_id}" style="linear"}
   {category_image}
{/exp:channel:categories}

```

Rather than the value of that tag.

Parse deeper by setting a `parse_depth` when you set the variable:

```
{exp:stash:category_image parse="yes" trim="yes" output="yes" parse_depth="2"}
 ...

```

Other than that it's possible that another tag in your template is malformed and breaking the parser. Try the above on it's own in a template. Turn on template debugging and look for a line beginning `Stash: SET category_image ...` to verify that the value you want is being captured.

---
Tags: ee2, stash, ee3
---


# Question
Title: Duplicate markers appearing when using Google Maps for Expression Engine
I have a google map on a website using Objective HTML's Google Maps for Expression Engine add-on. The map plots all club locations in the area, so shows a number of markers.

Strangely it is showing one club in two different locations, even though only one entry exists in the database.

It seems I'm not the first to experience this (Random Duplicate locations when using Google Maps for EE).

Any ideas how I could go about solving this one would be massively appreciated.

Thanks in advance,

Tom

**Code:**

```
{exp:channel:entries
    channel="friendship_clubs_data_feed"
    dynamic="no"
    status="Open|Exclude from search results"
    orderby="title"
    sort="asc"
}
    {exp:gmap:marker
        id="map"
        address="{club_feed_postcode}"
        infobox="true"
        zIndex="5"
        icon="/assets/images/Map-Marker.png"
        clustering="false"
        show_one_window="false"
        extend_bounds="true"
        geocode="true"
        clearanceX="10"
        clearanceY="20"
        offsetX="10"
        offsetY="-10"
    }
        <a href="{url_title_path='clubs/our-clubs/detail/'}"><h5>{title}</h5></a>
        <h6 class="centre-location">{club_feed_town}</h6>
    {/exp:gmap:marker}
{/exp:channel:entries}

```

# Answer
> 1 votes
After several hours of investigative work, I finally found that a few addresses were entered incorrectly (country where region should have been, or vice versa). I came to this conclusion based on:

* All of the individual profile pages showed the correct map location
* On the map page, if I changed the code to produce an individual map for each location (one after the other rather than a single map with all of the locations plotted), then all of the maps displayed properly

What I did was created a list of the channel entries right after the map, including the {entry\_id} (so I could quickly see which entry might be the issue). In your case, maybe something like this

```
{/exp:gmap:marker}
<p>{entry_id} - {title} (Zip: {club_feed_postcode})</p>
{/exp:channel:entries}

```

This allowed me to see exactly what the map was seeing. Then I started to add a "limit=xx" to my {exp:channel:entries} until I could see what entry was causing the problem (in other words, where the map was working properly). In my case, I had 3 locations that were causing an issue. It might be a case that the entry that is appearing twice is not the problem, but the entry that comes up right before it is. In my situation, I was able to fix two of the locations, and excluded the other entry until they can come up with the proper version of the address that worked.

Not sure this will produce the same outcome as mine did, but it's worth a shot!

# Answer
> 1 votes
So I've now solved this one and thought I'd share the solution I found.

It appeared to be the lack of ‘limit"1"’ in the {exp:gmap:marker} tag that was causing the problem. By adding that in the issue disappeared:

```
{exp:channel:entries
    channel="friendship_clubs_data_feed"
    dynamic="no"
    status="Open|Exclude from search results"
    orderby="title"
    sort="asc"
}
    {exp:gmap:marker
        id="map"
        address="{club_feed_postcode}"
        infobox="true"
        zIndex="5"
        icon="/assets/images/Map-Marker.png"
        clustering="false"
        show_one_window="false"
        extend_bounds="true"
        geocode="true"
        clearanceX="10"
        clearanceY="20"
        offsetX="10"
        offsetY="-10"
        limit="1" <<<<<<<<<<<<<<<<<<<< THIS MADE THE DIFFERENCE
    }
        <a href="{url_title_path='clubs/our-clubs/detail/'}"><h5>{title}</h5></a>
        <h6 class="centre-location">{club_feed_town}</h6>
    {/exp:gmap:marker}
{/exp:channel:entries}

```

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


# Question
Title: Google Maps for ExpressionEngine: Marker/Infobox click area
I have a map that shows around 70 markers using the Google Maps for ExpressionEngine add-on.

I originally set it up using clustering but this stopped working at some point so I reverted back to showing individual markers.

I have it setup to show just one marker if multiple entries exist with the same postcode, but the problem comes when there are two markers very close to each other.

In this situation, it's impossible to click on the second marker without zooming in really close. This appears to be caused by the click area around the marker being larger than the marker image itself and therefore covering the marker behind.

Does anyone have a good solution to either 1) Allow more accurate selection of markers or 2) Get clustering working correctly?

Thanks in advance,

Tom

# Answer
> 0 votes
Yes, It is possible with spider js. Example: https://jawj.github.io/OverlappingMarkerSpiderfier/demo.html

Library: https://github.com/jawj/OverlappingMarkerSpiderfier

If you face trouble to implement the library, I have already implemented it in my previous project.

Include JS file in FOOTER or The very bottom of your template. **It will good if you download the js in your server and load from your server, It will increase the speed of loading the JS file.** `http://jawj.github.io/OverlappingMarkerSpiderfier/bin/oms.min.js`

Put Following code in your template for map. Make sure you have icon in your `/images/map-pin.png` directory.

```
{!--
======================================================
Include map
======================================================
--}
{exp:gmap:init id="map" class="gmap" style="width:100%;height:820px;" scrollwheel="false"}
{!-- Set Map Markers  --}
{exp:channel:entries channel="map" disable="categories|category_fields|member_data|pagination|trackbacks|relationships" dynamic="no"}
{if map_latitude && map_longitude}
{exp:gmap:marker id="map"  latitude="{map_latitude}" longitude="{map_longitude}" icon="/images/map-pin.png"}
<div class="map-address">
<h2>{title}</h2>
<a href="/map/{url_title}">View Details</a>
</div>
{/if}
{/exp:gmap:marker}
{/exp:channel:entries}

```

Put the following Script in your template

```
<script type="text/javascript">
    window.onload = function() {
        var gm = google.maps;
        var iw = new gm.InfoWindow();
        var oms = new OverlappingMarkerSpiderfier(map_map,
            {markersWontMove: true, markersWontHide: true});

        var usualColor = 'ffee22';
        var spiderfiedColor = 'eebb22';
        var iconWithColor = function(color) {
            return 'https://chart.googleapis.com/chart?chst=d_map_xpin_letter&chld=pin|+|' +
            color + '|000000|ffff00';
        }
        var shadow = new gm.MarkerImage(
            'https://www.google.com/intl/en_ALL/mapfiles/shadow50.png',
            new gm.Size(37, 34),
            new gm.Point(0, 0),
            new gm.Point(10, 34)
        );

        oms.addListener('click', function(marker) {
            iw.setContent(marker.desc);
            iw.open(map_map, marker);
        });
        oms.addListener('spiderfy', function(markers) {
            for(var i = 0; i < markers.length; i ++) {
                markers[i].setIcon(iconWithColor(spiderfiedColor));
                markers[i].setShadow(null);
            }
            iw.close();
        });
        oms.addListener('unspiderfy', function(markers) {
            for(var i = 0; i < markers.length; i ++) {
                markers[i].setIcon('/images/map-pin.png');
                markers[i].setShadow(shadow);
            }
        });

        var bounds = new gm.LatLngBounds();

        $.each(map_markers, function(x, marker) {

            var lat = marker.getPosition().lat();
            var lon = marker.getPosition().lng();

            var loc = new gm.LatLng(lat, lon);
            bounds.extend(loc);

            var new_marker = new gm.Marker({
                position: loc,

                map: map_map,
                icon: '/images/map-pin.png',
                shadow: shadow
            });
            new_marker.desc = marker.window.content;
            oms.addMarker(new_marker);
            marker.setMap(null);

        });
        map_map.fitBounds(bounds);

        // for debugging/exploratory use in console
        window.map = map_map;
        window.oms = oms;
    }
</script>

```

This is it. If you facing issue to load the map or in spidify clustering, Check the errors in console and comment here. I will help on that. All the best.

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


# Question
Title: Selecting specific channel entries, to link to a given entry
I have been using Playa to choose from my existing entries, to create a list of related entries/similar entries. I use the following fields in the linking:

* title
* url
* image (a custom channel field that I create, that is used in each entry)

Playa is not being ported to EE3, so I have to learn a new way/find a new plugin that lets me do this. Since I choose the related entries, and there are other entries that will have the same tags, I cannot use EE's native Relationships functionality/tag without significantly changing/re-learning how I organize my site and tag my content. (The level of tagging needed to relate the entries would be...untenable, to say the least.)

Does EE3.x have a way for me to select entries from the current channel to be linked on a given entry, and have those entries' title, url, and image fields available to me to use in linking?

# Answer
> 0 votes
The very simple answer to your specific question is yes - the relationships field does exactly what you describe. The relationships field is very similar in function to Playa, and indeed Ellis Labs have written a very handy migration tool that will automatically convert your existing EE2 Playa (and Matrix) fields to EE2/3 Relationship / Grid fields.

---
Tags: ee3, how-to
---


title: Translating Captcha Freeform Pro

text:
# Question
Title: Translating Captcha Freeform Pro
we are using Freeform Pro and Transcribe to build forms and translate content.

Using the composer tag, is there a way for the CAPTCHA label 'Please enter the word you see in the image below' to be translated.

Is there a way to break the captcha out of the tag and translate?

We are using the tag below to bring in the code:

```
{exp:freeform:composer
  form_name="general_product_enquiry"
  return="{segment_1}/{segment_2}/{segment_3}/thank_you"
  parse="inward"
}

```

Any help or suggestions would be appreciated.

# Answer
> 0 votes
Well there are two simple ways to do that:

1)

* Go to `system\expressionengine\third_party\freeform\language\english\freeform_lang.php`
* Search for the array `captcha_input_instructions` and change the text to yours.

2)

Use JQuery to change the text from Label:

Ex:

```
{if segment_1 == 'de'}
<script type="text/javascript">
    $(document).ready(function() {
        $('.captcha_label').text('DE text goes here!')
    });
</script>
{/if}

```

---
Tags: solspace-freeform, transcribe, captcha
---


# Question
Title: Popup editing modal in EE3 control panel?
In EE2's control panel, when working in a textarea field, there was an option to open a larger modal, effectively giving one a much larger screen area for editing. Then you'd either cancel the changes you made in that modal window, or publish to field.

I'm not finding this in EE3.x control panel. Am I just missing it?

# Answer
> 0 votes
It looks like it was removed in EE3. I know that WYGWAM had the ability to edit in full screen view. You should still have the ability to expand the text area from the bottom right hand corner though.

---
Tags: control-panel, ee3, textarea, modal
---


# Question
Title: SQL Query to Get count of entries of a certain status inside channel
Right now I have this inside of a channel entries tag.

```
{exp:query sql="SELECT total_entries FROM exp_channels WHERE channel_name = '{url_title}'"}
{total_entries}
{/exp:query}

```

Which provides me with the correct count as expected. (E.g. 8)

But say only 5 of those 8 are of the status I want to count. How can I have it only count those entries? Let's say the status is "featured" or "open"? I feel this is not the correct method.

Thank you!

# Answer
> 1 votes
So... I finally got it working, though not with SQL which I imagine is more efficient. Behold my mess. Note this is only because I'm having to nest it, and also match to url\_title because of how we use Structure Listings. Appreciate the help.

```
{exp:vmg_nested:channel:entries channel="{url_title}" dynamic="off" status="available" prefix="childlisting"}
{if 1 == '{childlisting:count}'}{childlisting:absolute_results}{/if}
{/exp:vmg_nested:channel:entries}

```

Used plugin: https://devot-ee.com/add-ons/vmg-nested

# Answer
> 1 votes
It might work out easier to turn this into a short plugin, but would a query like this work? You'd need to pass in the id of the channel you're looking for.

```
{exp:query sql="SELECT count(*) AS totaled FROM exp_channel_titles WHERE channel_id='{channel_id}' AND status='open'"}
{totaled}
{/exp:query}

```

# Answer
> 0 votes
`exp_channels` is a table that contains summary information about the channels defined within your EE MySQL database, and one of the fields it contains is `total_entries` \- so all your sql query is doing is picking that value from the table. You could get the same information with a bit less complication by using the statistics module within EE. Something like:

```
{exp:stats channel = '{url_title}'}
{total_entries}
{/exp:stats}

```

To get information on the status of entries within the channel, you'd need to run a query on the channel data itself (which is stored in the table `exp_channel_titles`). This would require a more complicated sql query, but you could also do it using a regular `exp:channel:entries` call such as:

```
{exp:channel:entries channel="{url_title}" status="{status}"}
{total_results}
{/exp:channel:entries}

```

HTH

---
Tags: ee2, query, count, query-module
---


# Question
Title: Solspace Freeform : error notice in control panel
I've just installed the free version of Solspace Freeform 5.1.1 in ExpressionEngine 3.4.5. When I go to *Add-On Manager \> Freeform \> Forms* and go to edit my form I see this notification:

...this appears to be preventing me from editing the form fields.

Can anyone point me in the direction of how to fix this error please? Thanks!

# Answer
> 3 votes
This is a known issue with Freeform 5.1.1 (and earlier) and EE 3.4.5+. This issue has since been fixed in Freeform 5.1.2 :)

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


# Question
Title: Migrating from one server to another - linebreaks in HTML
I'm migrating an EE (2.10.1) installation from one server to another. The CP seems ok, but all of the templates show linebreaks as \n, effectively breaking the site. The SQL import / export appeared to work fine. I guess this is some kind of character set issue, but I'm not sure how to resolve it. I can manually copy template contents from the old site and paste it into the new (does seem to work), but will there be other symptoms caused by the issue that I haven't seen?

**What I see in e.g. the offline template:**

```
\n\n\n\n\n\n\n\n\n\n\n
\n\n
System Offline

\n\n
This site is currently offline

\n\n
\n\n\n\n

```

**Migrating from:**

Database server

```
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.52-cll-lve - MySQL Community Server (GPL) by Atomicorp
Protocol version: 10
User: loft_user@localhost
Server charset: UTF-8 Unicode (utf8)

```

Web server

```
 nginx/1.9.2
Database client version: libmysql - mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 5.6.14

```

phpMyAdmin

```
Version information: 4.6.5.1

```

**Migrating to:**

Database server

```
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.53 - MySQL Community Server (GPL)
Protocol version: 10
User: cl31-intoloft@10.0.44.138
Server charset: UTF-8 Unicode (utf8)

```

Web server

```
Apache/2.4.23 (Unix)
Database client version: libmysql - mysqlnd 5.0.8-dev - 20102224 - $Id: 731e5b87ba42146a687c29995d2dfd8b4e40b325 $
PHP extension: mysqli Documentation

```

phpMyAdmin

```
Version information: 4.0.10.18

```

# Answer
> 0 votes
Simple fix in the end. I performed a find and replace in the SQL file - replacing "\n" with "\n". (No quotes)

---
Tags: import, migration, server-migration, database-migrations
---