# Question
Title: Removing duplicate entries using an SQL query
I'm trying to create a search field (using Solspace Super Search) using a location from existing channel entries. Unfortunately this results in duplicate locations as some entries use the same location.

I explored removing duplicates using javascript but this doesn't play nicely with Super Search so I've been advised to try using an SQL query.

Here's the code I currently have but it doesn't appear to be working as it's outputting loads of duplicates now rather than just a few.

```
<select id="locationList" name="club_feed_town">
    <option value="">All Locations</option>
    {exp:channel:entries
        channel="friendship_clubs_data_feed"
        dynamic="no"
        status="Open|Exclude from search results"
        orderby="club_feed_town"
        sort="asc"
    }
        {exp:query sql="SELECT DISTINCT field_id_174 FROM exp_channel_data"}
            <option value="{club_feed_town}">{club_feed_town}</option>
        {/exp:query}
    {/exp:channel:entries}
</select>

```

Any ideas where I'm going wrong?

Thanks in advance,

Tom

# Answer
> 1 votes
I would have solved that with storing everything in a exp:stash:set\_list, and then looping out it with a exp:stash:get\_list.

Read more on how to do that here: https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Aset\_list%7D

Let me know if you need any code examples, I'd be happy to help out.

# Answer
> 1 votes
I've now solved this one by using an SQL Query as follows:

```
<select id="locationList" name="fieldName">
    <option value="">All Locations</option>
        {exp:query sql='
            SELECT DISTINCT field_id_174
            AS fieldName
            FROM exp_channel_data
            WHERE field_id_number <> ""
            ORDER BY fieldName
        '}
            <option value="{fieldName}" {if super_search_fieldName == "{fieldName}"}selected="selected"{/if}>{fieldName}</option>
        {/exp:query}
</select>

```

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


title: Memory exhausted when uploading images

text:
# Question
Title: Memory exhausted when uploading images
I am breaking my head with this issue for several days.

I am using Expression Engine 2.11.1

When trying to upload an image using the File Upload feature, I am getting the following error

```
Fatal error: Allowed memory size of 4251572 bytes exhausted (tried to allocate 100 bytes) in /srv/XXXXXXXXXX/public_html/site/zocalo/cm/codeigniter/system/libraries/Image_lib.php on line 1255

```

Everyone will say that my php.ini is low on memory but I have set everything correctly. Here my php.ini setup

`memory_limit = 200M
max_execution_time = 300
max_input_time = 60
log_errors_max_len = 1024
post_max_size = 8M
upload_max_filesize = 100M
max_file_uploads = 20`

The problem is that my pictures are **2KB** and **100x100pixels**. See images attached.

Any idea how I can fix this?

# Answer
Your php.ini could be overridden somewhere.

Check `Tools > Utilities > PHP Info` to see if there are any local values that don't match your php.ini

If you're on Apache try looking for a .htaccess file in the EE root or in any Virtual Host configurations you may have.
> 1 votes

---
Tags: ee2, file-uploads, php, image, fatal
---


# Question
Title: Email addresses display as [email protected] in entries
I am using EE v3.4.3.

In the 'options' tab of entries, the 'author' field displays the list of members. Until recently they showed correctly, but for some reason, they now display like:

\[email protected\] \[email protected\] \[email protected\] \[email protected\] ...

Does anyone know why this is, and how to turn it off?

# Answer
> 0 votes
My guess is that the domain is being routed through CloudFlare, and their email obsfucation feature has been enabled.

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


# Question
Title: Easy creation of new file upload directory per entry instead of per channel?
I want to know if there is a way to create unique file upload directories that are assigned PER ENTRY, instead of assigned to a channel?

I have a channel named "Projects" and each entry will have a slideshow of images. There are a LOT of entries in this channel, which means a LOT of images... and I'm worried about naming conflicts, organization, and ultimately confusing my users.

I realize I could just create a new folder and choose to upload images there when creating an entry, but this is too complicated to expect my users to do when they are creating entries.

Is there a way to create the upload directory on the fly and assign it to the entry? I need some way of organizing things so that each entry has a unique folder for uploads.

# Answer
If you want to upload a slideshow images per entry and you want separate directories per entry. You can simply use channel images plugin. It will create separate directories for each entry and you can also use image functions as well. https://devot-ee.com/add-ons/channel-images-ee2
> 1 votes

---
Tags: file-uploads, file-manager, files
---


# Question
Title: How can I conditionally reveal content of an asset based on day of the week?
I have an asset called specials. There is one special for each day of the week. On the homepage I'd like to have that days special 'magically' appear upon page load in the designated area.

Anyone have any idea how I could pull this off without the client having to go in everyday and manually change the day?

# Answer
> 1 votes
You could do something like:

```
{exp:channel:entries channel="specials" url_title='{current_time format="%l"}' }

```

{current\_time format="%l"} will yield the current day of the week. i. e. "Monday" Not sure how you are set up, but you get the idea.

---
Tags: assets, structure
---


# Question
Title: Selective parsing of {logged_in_username}
I have this in my template layout, running EE 3.4:

```
{if logged_in_group_id == "5"}
    <script>dataLayer = [{'userID': '{logged_in_username}'}];</script>
    Rest of the script pass data to Google Tag Manager
{/if}

```

It works most of the time – ie the usernames of the logged\_in users are sent to Google Tag Manager. But sometimes it just sends the string "{logged\_in\_username}" instead, without parsing the username.

Does anyone have a clue why this is happening? This conditional is in a template layout and just after the \<body\> tag. If users are not logged in, they are redirected to another page.

# Answer
When using EE variables inside of javascript, it's always best to separate the variables out onto separate lines to prevent the template parser from treating them as javascript objects (and thus skipping them).

```
{if logged_in_group_id == "5"}
    <script>dataLayer = [{
        'userID': '{logged_in_username}'
    }];</script>
    Rest of the script pass data to Google Tag Manager
{/if}

```
> 1 votes

# Answer
instead of using default variables, try some member plugin. Install https://devot-ee.com/add-ons/zeal-smart-members and use this code.

```
{if logged_in}
{exp:smart_members:profile}
    {if group_id == 5}
    <script>dataLayer = [{'userID': '{username}'}];</script>
    Rest of the script pass data to Google Tag Manager
    {/if}
{/exp:smart_members:profile}
{if:else}
    {redirect="__page_where_you_want_to_redirect__"}
{/if}

```
> 0 votes

---
Tags: members, global-variables
---


title: Contact form for free

text:
# Question
Title: Contact form for free
How can I transform a HTML form in a template into an email that someone can receive after they fill it out with any paid add-ons? If I need an add-on for that, can anyone suggest any?

# Answer
> 2 votes
There is also a free version of Freeform. https://solspace.com/expressionengine/freeform

# Answer
> 3 votes
There is a contact form bundled with ExpressionEngine: https://docs.expressionengine.com/latest/add-ons/email/contact\_form.html

---
Tags: add-on, bootstrap, email-contact-form
---


# Question
Title: In ExpressionEngine 3, what is the format of the config file to be able to use the Config Service?
I'm developing an add on for Expression Engine 3, and I can't figure out what the format should be for the config file that will be used from the Config Service. The Expression Engine documentation says that the config file should be in ./config/ relative to the add on directory, but it has no information on what the format should be.

The docs say that the configuration would be accessed with:

> ee('Config')-\>get('my\_addon:my\_config.my\_item');

# Answer
It works just like the main `user/config/config.php` file.

So in `user/addons/my_addon/config/config.php`:

```
<?php
    $config = array(
        'foo' => 'bar',
        'baz' => 'foo'
    );
?>

```

Then access your config items like so:

```
$foo = ee('Config')->get('my_addon:foo');
// returns 'bar'

```
> 1 votes

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


# Question
Title: Field Pack Dropdown Channel Form Problem
The following code doesn't work.

```
<label for="intent_of_posting">Intent of Posting</label>
<select name="intent_of_posting" id="intent_of_posting">
    {options:intent_of_posting}
         <option value="{option_value}"{selected}>{option_name}</option>
    {/options:intent_of_posting}
</select>

```

How to make Field Pack Dropdown work with channel form?

Am using EE 2.11.3 and Fieldpack 2.2

# Answer
> 0 votes
The `{options:field_name}` tag pair is actually a Safecracker tag, which only works with Field Pack 1.x out of the box. You can add Field Pack 2.x support by opening up system/expressionengine/config/config.php and adding these lines:

```
$config['safecracker_option_fields'][] = 'fieldpack_checkboxes';
$config['safecracker_option_fields'][] = 'fieldpack_radio_buttons';
$config['safecracker_option_fields'][] = 'fieldpack_dropdown';
$config['safecracker_option_fields'][] = 'fieldpack_multiselect';
$config['safecracker_option_fields'][] = 'fieldpack_pill';

```

Thanks to Brandon Kelly for answering the question

---
Tags: ee2, safecracker, field-pack
---


# Question
Title: Anyone know a WYSIWYG editor with Hex color picker
I am looking for a WYSIWYG editor for EE2 that allows you to drop in a hex color. Any got any ideas?

I looked at Wygwam, Editor and Expresso but none of them seem to have any color control. Any thoughts?

# Answer
Wygwam does the trick and allows you to add a hex code. https://devot-ee.com/add-ons/wygwam
> 0 votes

---
Tags: wysiwyg
---


title: EE3 where did multi-edit go?

text:
# Question
Title: EE3 where did multi-edit go?
Ok, now that I've updated several sites to EE 3, I noticed that I can't find the multi entry edit function anymore. Has it been removed? I read somewhere that it was still there, but I can find it.

# Answer
The bulk adding/removing of categories and changing of statuses is indeed gone in EE3. All you can do in bulk is delete entries.

I suggest making a feature request for this!
> 1 votes

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


title: Freeform Pro Submit Issue

text:
# Question
Title: Freeform Pro Submit Issue
I have a simple contact form built using FreeForm Pro (free version). Everything on the front end works as normal but when submitting the form I get directed to http://sxps.co.uk/?ACT=22 (not the actual site URL sxps.co.uk) No submission is recorded to the form either.

Any ideas why I get directed to this page and no information is recorded? Code below.

```
{exp:freeform:form
                            form_id="1"
                            required="email"
                            return="contact-us/thank-you"
                            notify_admin="yes"

                        }

                            <label for="full_name">Name:</label>
                            {freeform:field:full_name}

                          <label for="telephone">Phone Number:</label>
                            {freeform:field:telephone_number}

                            <label for="email">Email Address:</label>
                            {freeform:field:email}

                             <label>Message:</label>
                            {freeform:field:user_message}

                             {freeform:submit}

                        {/exp:freeform:form}

```

# Answer
check your general config settings. Are you removing the index.php file? When it gets stuck here: http://sxps.co.uk/?ACT=22 Try changing it to: http://sxps.co.uk/index.php?ACT=22 or set index.php as the site's index page in general config. If that runs, then we know FreeForm is running. Then we can look elsewhere.
> 1 votes

---
Tags: solspace-freeform, solspace, email-contact-form
---


# Question
Title: Error: Unable to load the requested class: functions when uploading from localhost to server
EDIT 10/21/2016 - the original question is right below this edit.

User Anna\_MediaGirl suggested that I reuploaded the files to make sure none was missing. Sadly, it didn't worked out and the error is the same. I double checked the config.php to make sure I was addressing the database correctly. The same info was used on ee\_wizard, and the result is positive even on the suggested and optional requirements, so I believe everything is OK with my hosting service.

I'm sure I'm missing something here. Could it be the fact that it is running on a subfolder from my domain? The system path in admin.php is set as './system', is this ok? Or do I need to change it since I'm not in my public\_html's root?

Important to notice, this is running perfectly on localhost. The only changes in the install I did was a .htaccess with the following lines to remove the index.php from the URLs. The problem continues if I remove the htaccess file.

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

```

I'm sorry if some of my questions sounds dumb. Like I said, I'm not exactly a developer, but very interested in EE.

---

ORIGINAL QUESTION

I asked this question on EllisLabs' forum but am asking here as well, hope you don't mind.

Fact is I'm new to ExpressionEngine. My first run on EE was a freelance job, and apparently everything is fine. The install on my computer works fine (using Wampserver64) and the agency that hired me for the job had no problems uploading the site to the client's server.

Now I'm working solo on a new project, and trying to upload it by myself on my shared hosting. I followed all of the User's Guide direction to upload it, except for moving the system folder, for the sake of simplicity. The EE Wizard tells me my host is ok. I imported the database, did change the parameters on config.php to match the original database settings, granted all the permissions to files and folders.

However, when I try to access the admin.php I get the following message:

Error: Unable to load the requested class: functions

Since my client haven't decided on the domain yet, i'm running it on a subfolder of my portfolio, that is:

http://iconoclasta.com.br/heloee/

Please note that I'm not a developer. I work as a webdesigner for almost 10 years mostly with HTML and Bootstrap, so my skills on database management and back end development are inexistent.

Hopefully some one can help me with this? I'm pretty sure there's a begginer's mistake somewhere. I've been trying to find out the problem in the last 3 days and decided to call for help.

I'm using core 3.4.3 and no plugins or modules, only the vanilla core install. Any other information I need to provide?

Thank you very much!

# Answer
> 0 votes
So, I found a solution in EllisLabs forum: the functions.php file was being deleted by my server. In the link below, the file was located at system/expressionengine/libraries/Functions.php. Since the topic covered version 2.9.3, in my case the file was located at system\ee\legacy\libraries

However, the same solution applies. Changing

```
return eval('?'.'>'.$str.'<?php ');

```

to:

```
return eval('?>'.$str.'<?php ');

```

Now I can access the admin.php. The site is still broken, but at least this was solved :)

---
Tags: error, install
---


# Question
Title: How to search in a custom field with multiple values using exact
I have a Field Pack - Checkbox field (named doctors\_schedule\_now) with the following values:

```
nephrology : Nephrology
pediatric-nephrology : Pediatric Nephrology

```

In my entry, I'm checking the box for Nephrology. This populates in my DB field like this:

```
nephrology

```

Then I'm using Low Search to search in this custom field. This is the parameter I'm passing in the exp:low\_search:results tag:

```
search:doctors_schedule_now='nephrology'

```

This search parameter will return entries that have both "pediatric-nephrology" and "nephrology" checkboxes chosen. This is not what I want, so I modified the search parameter like this (with exact matching):

```
search:doctors_schedule_now='=nephrology'

```

This will return only entries with the "nephrology" checkbox chosen - great! But wait. If I choose both checkboxes - "nephrology" and "pediatric-nephrology", it populates my DB like this:

```
nephrology(paragraph return)pediatric-nephrology

```

Now I can no longer use the exact parameter because the field has multiple values. And, I still need to return entries ONLY entries with "nephrology" chosen. So, I cannot use the parameter like this:

```
search:doctors_schedule_now='nephrology'

```

Because it returns entries that have either "nephrology" OR "pediatric-nephrology" checkboxes chosen. In other words, this search parameter returns not only "nephrology" but also "pediatric-nephrology"

# Answer
You're looking for EE's `\W` suffix, see the docs:

> When doing a “Contains” search, ExpressionEngine is literally just looking for matches on the combination of letters given. For instance using “cat” in a “Contains” search would match entries with “cat”, “cats”, “category”, “vocation”, etc. If you need “Contains” matching, but only want entries that include the term as a whole word on its own, you can add the special trigger \W after the term.
>
> `search:body="cat\W"`
>
> The above example will return all entries that contain the whole word “cat”. It will not match entries where the phrase “cat” only lies within another word.

This behaviour is achievable by setting the `contains_words` parameter in Low Search, see the docs on the Field Search filter.

Given your example, combining parameters like this should give you the desired results:

```
search:doctors_schedule_now='nephrology' contains_words='search:doctors_schedule_now'

```

**Edit**

Actually, the query generated with those rules, will be a MySQL regexp with word boundaries. Which, according to MySQL means:

> A word is a sequence of word characters that is not preceded by or followed by word characters. A word character is an alphanumeric character in the alnum class or an underscore (\_).

This means a dash (-) is considered a word boundary, and therefore, both entries will be returned in the above scenario. If you change the value from `pediatric-nephrology` to `pediatric_nephrology`, then the above parameters *can* differentiate between the two.
> 1 votes

---
Tags: search, low-search
---


# Question
Title: Using a conditional within {exp:stash:set_list}... how?
I am sure there is an easy fix for this: just I'm unable to find it...

I have this simple code structure that puts values from a Low\_Reorder set into a stash list. It works just fine.

```
{exp:stash:set_list name="process" parse_tags="yes"}
    {exp:low_reorder:entries set="training_courses" disable="categories|member_data|pagination" parse="inward"}
         {stash:title}{title}{/stash:title}
         {stash:resource_hero_image}{resource_hero_image:url}{/stash:resource_hero_image}
         {stash:url_title}{url_title}{/stash:url_title}
     {/exp:low_reorder:entries}
{/exp:stash:set_list}

```

However, when I now add a conditional within the Low\_Reorder, I get no output at all. Vis:

```
{exp:stash:set_list name="process" parse_tags="yes"}
    {exp:low_reorder:entries set="training_courses" disable="categories|member_data|pagination" parse="inward"}
    {if segment_2 != url_title}
         {stash:title}{title}{/stash:title}
         {stash:resource_hero_image}{resource_hero_image:url}{/stash:resource_hero_image}
         {stash:url_title}{url_title}{/stash:url_title}
     {/if}
     {/exp:low_reorder:entries}
{/exp:stash:set_list}

```

The only change is adding the conditional - and if you remove the {stash} structure this code works flawlessly.

So the issue is to do with the {if} statement - I'm guessing that it is not being processed within the {stash} terms.

So I tried adding `parse_conditionals="yes"` to the set\_list tag, and then adding `parse_depth="3"` \- (so the opening stash tag eventually became `{exp:stash:set_list name="process" parse_tags="yes" parse_conditionals="yes" parse_depth="3"}` but these changes didn't help at all.

Can anyone help me with whatever the correct thing to do here is?

Thanks in advance for whatever help you can provide.

# Answer
Whilst I'm not sure why your current code doesn't work (have you tried removing `parse="inward"` on the Low Reorder tag?), I would approach this in a slightly different way by filtering out the current page *prior* to fetching the data for it - in other words something like this on your opening Low Reorder tag:

```
{exp:low_reorder:entries url_title="not {segment_2}" ...}

```

You could equally do the filtering during your `stash:get_list` process using `match` and `against`, but makes most sense to not fetch the data in the first place if you're never going to use it.

(Also worth noting that Stash's `parse="yes"` parameter is a handy shorthand for switching on both `parse_tags` and `parse_conditionals`.)
> 1 votes

---
Tags: stash
---


title: Datagrab stuck/fail on 90% 4/5

text:
# Question
Title: Datagrab stuck/fail on 90% 4/5
Been using dataGrab for a new site, to import stuff that’s exported to a Json-file from a PIM-system. All good, working like a charm.

Yesterday, we tried triggering the remote URL, with only 5 entries to be imported: It returned the page that says import done. But when going to the datagrab-plugin-page, it’s stuck at 4/5, and saying “running”.

This prevents me from trying it manually. If I try triggering it manually, I get the same “Import success”-page, but it’s stuck. And the logs return “A session had already been started - ignoring session\_start()”.

So, my question is, any way of stopping the session? Also, any idea of why it’s messing with me like this all of a sudden? :)

Running EE 3.4.2

# Answer
Figured it out. Posting here to help others in the same spot.

I had the batch field set to 500/batch, since we did huge imports at the start. Got the problem when we started importing \<500 I guess.

So, I removed the 500 from the input field, and now it works like it's supposed to.

Sweet!
> 2 votes

---
Tags: datagrab, import
---


# Question
Title: Stash and Multiple Grid Fields Not Populating
Running into strange issue getting content into a Stash list from two grid field. A stripped down version of my code is below.

The two grid fields are `{meeting_people}` and `{meeting_faculty}`. In the entry I'm using to test this both grid fields have four rows. With the code below, all four rows of the field called first are stashed but only one row of the second field gets stashed.

**Note:** *This is true even if the field order is switched in my code. That is, if I move `{meeting_faculty}` above `{meeting_people}`, all four rows of `{meeting_faculty}` are stashed while only one row of `{meeting_people}` gets stashed.*

This is on an ExpressionEngine 2.9.2 build running Stash 2.6.2.

```
{exp:stash:set_list name="alt_faculty_{url_title}" scope="site" site="default_site" save="yes" parse_tags="yes" parse_depth="10"}
  {exp:channel:entries site="default_site" channel="meetings" url_title="{segment_2}" limit="1" dynamic="no"}

    <!-- first grid field - returns all  -->
    {meeting_people}
      {stash:people_bio_override}{meeting_people:biography}{/stash:people_bio_override}
      {stash:people_director}{meeting_people:director}{/stash:people_director}
      {meeting_people:name} <!-- start relationship field -->
        {stash:people_name}<em>people_name: </em>{meeting_people:name:title}{/stash:people_name}
        {stash:people_credentials}{meeting_people:name:people_credentials}{/stash:people_credentials}
      {/meeting_people:name}<!-- end relationship field -->
    {/meeting_people}

    <!-- second_grid field - returns only one -->
    {meeting_faculty}
      {stash:faculty_name}<em>faculty_name: </em>{meeting_faculty:name}{/stash:faculty_name}
      {stash:faculty_bio}{meeting_faculty:bio}{/stash:faculty_bio}
     {/meeting_faculty}

  {/exp:channel:entries}
{/exp:stash:set_list}

```

# Answer
Let me show you how the parser will parse that code before Stash tries to capture it as a list. I'll assume your relationship field only allows you to select a single person:

```
{!-- first grid field --}
{stash:people_bio_override}Person 1 biography {/stash:people_bio_override}
{stash:people_director}Person 1 director{/stash:people_director}
{stash:people_name}<em>people_name: </em>Person 1 name{/stash:people_name}
{stash:people_credentials}Person 1 credentials{/stash:people_credentials}

{!-- first grid field --}
{stash:people_bio_override}Person 2 biography {/stash:people_bio_override}
{stash:people_director}Person 2 director{/stash:people_director}
{stash:people_name}<em>people_name: </em>Person 2 name{/stash:people_name}
{stash:people_credentials}Person 2 credentials{/stash:people_credentials}

{!-- first grid field --}
{stash:people_bio_override}Person 3 biography {/stash:people_bio_override}
{stash:people_director}Person 3 director{/stash:people_director}
{stash:people_name}<em>people_name: </em>Person 3 name{/stash:people_name}
{stash:people_credentials}Person 3 credentials{/stash:people_credentials}

{!-- second grid field --}
{stash:faculty_name}Faculty 1 name{/stash:faculty_name}
{stash:faculty_bio}Faculty 1 bio{/stash:faculty_bio}

{!-- second grid field --}
{stash:faculty_name}Faculty 2 name{/stash:faculty_name}
{stash:faculty_bio}Faculty 2 bio{/stash:faculty_bio}

```

A Stash list is simply a table of data. We can easily represent the first 3 repeating rows like this:

```
+-------------------------+-------------------------+-------------------------+-------------------------+
| people_bio_override     | people_director         | people_name             | people_credentials      |
+-------------------------+-------------------------+-------------------------+-------------------------+
| Person 1 biography      | Person 1 director       | Person 1 name           | Person 1 credentials    |
| Person 2 biography      | Person 2 director       | Person 2 name           | Person 2 credentials    |
| Person 3 biography      | Person 3 director       | Person 3 name           | Person 3 credentials    |
+-------------------------+-------------------------+-------------------------+-------------------------+

```

But the last 2 rows don't share the same column headings (keys) so needs to be represented as a separate table:

```
+---------------------------------------+---------------------------------------+
| faculty_name                          | faculty_bio                           |
+---------------------------------------+---------------------------------------+
| Faculty 1 name                        | Faculty 1 bio                         |
| Faculty 2 name                        | Faculty 2 bio                         |
+---------------------------------------+---------------------------------------+

```

The solution to your problem is therefore to create two Stash lists, one for the first grid field and another for the second grid field.
> 3 votes

---
Tags: stash, relationships, grid
---


# Question
Title: Expresso Store: Fatal error: Class 'DOMDocument' not found in
Am I missing some dependency on the server? cURL is in php-xml is in etc.

I am trying to export an invoice to PDG and getting this error:

Fatal error: Class 'DOMDocument' not found in /MY-PATH/htdocs/system/expressionengine/third\_party/store/vendor/dompdf/include/dompdf.cls.php on line 481

Hope you can help - Thanks

# Answer
> 2 votes
`DOMDocument` is a built in PHP class. It sounds like the PHP DOM extension is disabled on your server - you will probably need to talk to your host about enabling it (it is enabled by default in PHP and I've never seen a host without it before).

To check this, you can visit Tools \> Utilities \> PHP Info in the EE control panel, and search for *DOM/XML* which should say *enabled* next to it.

# Answer
> 1 votes
Hmmm strange. Have you checked that the file it mentions is actually there?

If it is and it has read access then my guess would be that it's more of a memory issue. PDF generation can require a surprisingly large amount of memory (a min of 256MB) and I've had similar problems in the past. Make sure that you have at least 256MB as your memory limit in Tools \> Utilities \> PHP Info \> memory\_limit. Try increasing this to at least 256MB and seeing if that makes a difference.

What type of environment are you running on btw? Is this shared hosting?

# Answer
> 0 votes
si usas centos estas lineas son la solución: Fatal error: Class 'DOMDocument' not found in /var/www/html/ include/ dompdf.cls.php on line 177

Solved the problem by:

To install PHP-XML run the following command: yum install php-xml

To install DOM/XML run the following command: yum whatprovides php-dom

To restart Apache run the following command: service httpd restart

# Answer
> 0 votes
On Ubuntu:

sudo apt-get install php5-dom

In my case

sudo apt-get install php5.6-dom

---
Tags: expresso-store
---


# Question
Title: Show related category entries from relationship entry
I'm trying to list category entries from relationship entry: I'm trying to achieve this result:

```
          CategoryA
          test1

          CategoryB
          test2
          test3

```

but my attempt:

```
    {relationship_field}
      {relationship_field:categories backspace="2"}
        {if parent_id !="0"}
          {category_name}
          {relationship_field:title}
        {/if}
      {/relationship_field:categories}
    {/relationship_field}

```

shows this result:

```
          CategoryA
          test1

          CategoryB
          test2

          CategoryB
          test3

```

# Answer
Haven't got a system to test on - but looks like you need to explicitly loop the values that have the category. I suspect you need to use the 'siblings' tag - something like:

```
{relationship_field}
  {relationship_field:categories backspace="2"}
    {if parent_id !="0"}
      {category_name}
      {relationship_field:siblings field="relationship_field"}
            {relationship_field:siblings:title}
      {/siblings}
      {relationship_field:title}
    {/if}
  {/relationship_field:categories}
{/relationship_field}

```

HTH
> 0 votes

---
Tags: categories, relationships
---


title: Build a Relationship

text:
# Question
Title: Build a Relationship
I have 3 channels

**City**

-Name of City(Title)

**University**

-Name of School(Title) -Address -City(Relationship Field With City Channel)

**Professor**

-Name of Professor(Title) -University Name (Relationship field with University Channel) -Gender -Salary -Experience

Now What I have to do is On City Page I have to list all University and when i click on that university then on that University Page I have to show all Professor teaching in that University

The Code I am using is

```
  {exp:channel:entries channel="university" limit="1" url_title=segment_2}
  {title}
  {address}
  <table>
  {relationship_field="universityname"}
  <tr>
  <td class="gender">{if relationship_field:gender == 'M'}<span class="male"></span>{if:else}<span class="female"></span>{/if}</td>
  <td>{relationship_field:title}</td>
  <td>{relationship_field:experience}</td>
  <td>${relationship_field:salary}</td>
  </tr>
  {/relationship_field}
  </table>

```

But for some reasons i cant get the value of Professor Channel. Please Help

# Answer
Since the Professor is the one with the relationship field then **Professor \> University** is a **Parent \> Child** relationship. So if you're in a University (Child) entry you need to use the `parents` tag for the relationship to get the opposite relationship, so something like this should work:

```
{exp:channel:entries channel="university" limit="1" url_title=segment_2}
    {parents field="universityname"}
        <tr>
            <td class="gender">{if parents:gender == 'M'}<span class="male"></span>{if:else}<span class="female"></span>{/if}</td>
            <td>{parents:title}</td>
            <td>{parents:experience}</td>
            <td>${parents:salary}</td>
        </tr>
    {/parents}

```

More about parents in the EE relationship docs.
> 3 votes

# Answer
I'm guessing that the relationship field that points to the University in the Professor channel is called "universityname". If so, you are getting a bit confused about how to access the relationship field contents.

The code you want is like this:

```
  {exp:channel:entries channel="university" limit="1" url_title=segment_2}
  {title}
  {address}
  <table>
  {universityname}
  <tr>
  <td class="gender">{if universityname:gender == 'M'}<span class="male"></span>{if:else}<span class="female"></span>{/if}</td>
  <td>{universityname:title}</td>
  <td>{universityname:experience}</td>
  <td>${universityname:salary}</td>
  </tr>
  {/universityname}
  </table>

```

HTH
> 0 votes

---
Tags: relationships
---


# Question
Title: Extend cart_items_info function from mod.cartthrob.php
the `mod.cartthrob.php` has the `cart_items_info` function.

On that function I have

```
    foreach ($data as &$row)
    {
        $row['cart_count'] = $count;
        $row['cart_total_results'] = $total_results;
        $row['first_row'] = ($count === 1) ? TRUE : FALSE;
        $row['last_row'] = ($count === $total_results) ? TRUE : FALSE;
        //added by me
        $row['conversion_rate'] = $this->EE->cartthrob->store->config('Cartthrob_stripe_settings')['stripe_conversion_rate'];

        $count++;
    }

```

But the `stripe_conversion_rate` key was added by me in the file. I don't think this is the way, because I should not edit the core files. So in my case how can I add that key so in the html file to have access to `conversion_rate`:

```
{exp:cartthrob:cart_items_info}
  {conversion_rate}
   ..........

```

# Answer
CartThrob does not allow you to modify any of its tag functions. In this case you're better off creating your own small plugin which returns the value of `$this->EE->cartthrob->store->config('Cartthrob_stripe_settings')['stripe_conversion_rate'];`.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: Undefined Offset error in ExpressionEngine Parser.php line 52
Using EE 3.1.4

Everything worked fine, until I changed the relationship selection to a new one. When I did that, it gave me the error. Now, even if I select the previously related field, I get the errors.

The message I get is :

> Notice Undefined offset: 65
>
> ee/legacy/libraries/relationship\_parser/Parser.php, line 52 show details
>
> Severity: E\_NOTICE
>
> ---
>
> Warning Cannot modify header information - headers already sent by (output started at /system/ee/legacy/core/Exceptions.php:112)
>
> ee/EllisLab/ExpressionEngine/Boot/boot.common.php, line 459 show details
>
> Severity: E\_WARNING

Nothing changed in the template code or the entries except for the relationship selection.

---

***EDIT***

I have narrowed it down to a parsing issue somewhere in regards to a stash list. (See the following)

Everything was working until I changed the relationship entry to another entry. Now, even when I change back, I get the errors.

I am using the following embed:

```
{stash:embed:data:content_variables
    stash:channel="home_page"
    stash:segment_data="home"
    stash:limit="1"
    stash:dynamic="no"
    stash:status=""
    stash:order_by=""
    stash:paginate=""
    stash:url_title=""
}

```

This pulls in data from an embed template here:

```
{exp:switchee parse="inward" variable="{stash:segment_data}"}
    {case value="home"}
        {exp:channel:entries
            channel="{stash:channel}"
            dynamic="{stash:dynamic}"
            limit="{stash:limit}"
            status="{stash:status}"
            order_by="{stash:order_by}"
            sort="{stash:sort}"
            paginate="{stash:paginate}"
        }
            {exp:stash:sv_title}{title}{/exp:stash:sv_title}
            {exp:stash:sv_url_title}{url_title}{/exp:stash:sv_url_title}
            {exp:stash:sv_entry_id}{entry_id}{/exp:stash:sv_entry_id}
            {exp:stash:sv_entry_date}{entry_date format="%Y %m %d"}{/exp:stash:sv_entry_date}
            {exp:stash:sv_edit_date}{edit_date format="%Y %m %d"}{/exp:stash:sv_edit_date}
            {exp:stash:set_list name="slideshow_images" parse_tags="yes"}
                {slideshow}
                    {slideshow:slider_images}
                        {stash:sv_slideshow_image}{image:url:slider-optimized}{/stash:sv_slideshow_image}
                        {stash:sv_slideshow_title}{image:title}{/stash:sv_slideshow_title}
                    {/slideshow:slider_images}
                {/slideshow}
            {/exp:stash:set_list}

```

I stopped it there because the slider images is where I am getting the problem. If I comment out the section:

```
{exp:stash:set_list name="slideshow_images" parse_tags="yes"}
    {slideshow}
        {slideshow:slider_images}
            {stash:sv_slideshow_image}{image:url:slider-optimized}{/stash:sv_slideshow_image}
            {stash:sv_slideshow_title}{image:title}{/stash:sv_slideshow_title}
        {/slideshow:slider_images}
    {/slideshow}
{/exp:stash:set_list}

```

it displays fine. But if I leave that `set_list` statement in, I get the following:

> Notice:
>
> Undefined offset: 65 ee/legacy/libraries/relationship\_parser/Parser.php, line 52 show details
>
> Severity: E\_NOTICE
>
> ---
>
> Warning:
>
> Cannot modify header information - headers already sent by (output started at /system/ee/legacy/core/Exceptions.php:112) ee/EllisLab/ExpressionEngine/Boot/boot.common.php, line 459 show details
>
> Severity: E\_WARNING

What am I doing wrong here?

---

***EDIT***

Upon further testing, it appears to be an issue with ExpressionEngine since the following renders the exact same issue. :(

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

    {slideshow}
        {slideshow:slider_images}
            {image:url:slider-optimized}
            {image:title}
        {/slideshow:slider_images}
    {/slideshow}

{/exp:channel:entries}

```

# Answer
> 0 votes
This was eventually answered and I verified it here: https://support.ellislab.com/bugs/detail/21793

Essentially, if you delete/remove an entry that was related somewhere, you get this. It was not performed through query.

# Answer
> 0 votes
This happens when you delete a record with the help of a query eg. delete FROM exp\_relationships where child\_id = xxx.

---
Tags: stash, relationships, parse-order, ee3, parsing
---


# Question
Title: layout:set not working properly (EE 2.9)
Working with layout, have a problem:

```
{layout="_global/layout_cat"}
{exp:channel:entries channel="my_channel"}
    {layout:set name='htitle' value='{title} | some text'}
    Some text using the channel entry field values {title} {description}, etc....
{/exp:channel:entries}
{layout:set name="layout_param"}
 <script type="text/javascript">...some js script...</script>
{/layout:set}

```

When I look at the page, I see everything right, but also I see the parts of layout:set values, for example the half of {title} and "some text" then, including a '"}' at the end, and some parts of javascript insertions at the end.

What am I doing wrong? No plugins installed, clean EE Core 2.9.2

# Answer
> 0 votes
Got the problem myself;

In system/libraries/Template.php there is a function process\_layout\_template() It is working with strlen() & strpos() functions. Both are known as big trouble when working with multibyte strings. So I changed my VirtualHost settings:

```
# from:
php_admin_value mbstring.func_overload 2
# to
php_admin_value mbstring.func_overload 0

```

Now everything is working perfect, cause strlen is getting the right count of the letters for the end of {layout:set} when parsing templates.

---
Tags: template-layouts
---


title: Freemember and custom member fields

text:
# Question
Title: Freemember and custom member fields
I'm using freemember on a user registration form and custom fields are not being passed to the member profile on registration.

I've tried both standard `m_field_id_22` and freemember `member_newsletter` field names but neither are getting saved and the database is logging a value of null.

Any thoughts on solving?

# Answer
> 1 votes
Are you running the latest version of Freemember? Are you sure your custom field names are correct? Your code?

Ok, your code was not formatted properly..

```
{exp:freemember:register form_class="form form--standard"  error_handling="inline" return="account/register/thanks" required="first_name|last_name|email|company|address_1|city|postcode" error_delimiters='<span class="error">|</span>'}
<fieldset>
<h3>Do you want to request a trade account?</h3>
<div class="form__group form__group--inline">
{field:trade-account-yes}
<label for="trade-account-yes" class="form__label">Yes</label>
{error:trade-account-yes}
</div>

<div class="form__group form__group--inline">
{field:trade-account-no}
<label for="trade-account-no" class="form__label">No</label>
{error:trade-account-no}
</div>
</fieldset>

<fieldset>
<div class="form__group">
{field:accept_terms}
<label for="accept_terms" class="form__label form__label--required">I have read and agree to the <a href="/terms-and-conditions">Terms and Conditions</a></label>
{error:accept_terms}
</div>
<div class="form__group">
<button type="submit" class="btn">Continue</button>
</div>
</fieldset>
{/exp:freemember:register}

```

# Answer
> 0 votes
Okay - this was resolved. Was fiddling with MX Notify which was terminating the write to custom fields when you try and send an email. Testing via Ajax was stopping me see the response.

Thanks for time and response on this everyone (in forum and via Slack)

---
Tags: members, custom-fields, freemember, registration
---


# Question
Title: EE3 How to show random template variables
I created some template variables which is https://docs.expressionengine.com/latest/templates/globals/template\_variable.html, how can I show one of them randomly?

# Answer
> 0 votes
There is no built-in way to do this. But you could write a simple add-on which selects a random variable from the database and returns it.

---
Tags: variable, random
---


title: Display Output Profiler

text:
# Question
Title: Display Output Profiler
ExpressionEngine v2.9.2

I'm logged in as a Super Admin and I'm trying to turn on 'Display Output Profiler' in the admin control panel, but it will not save the change.

I suspect that this is because the config file does not have the permission set to allow writing, but I can't find which file to change permissions on, or is it something else?

# Answer
that should probably be config.php in /system/expressionengine/config/config.php it should be 666 according to the docs
> 1 votes

---
Tags: super-admin
---


# Question
Title: Conditional within solspace calendar tag
I am encountering a strange (to me, but maybe I'm missing something) bug when attempting to use conditionals to distinguish between users in the Solspace Calendar tag. As you can see from the code below I'm attempting to display a different calendar dependent on the user's member\_group (I have also tried group\_id to no avail).

```
{exp:calendar:cal
    {if segment_3 == ''}
        date_range_start="year-month-01"
        date_range_end="year-month-last"
    {/if}
    {if segment_3 != ''}
        date_range_start="{segment_3}-{segment_4}-01"
        date_range_end="{segment_3}-{segment_4}-last"
    {/if}

    {!-- Main problem from here down --}
    {if member_group == 1}
        calendar_id="1|2|3"
    {if:else}
        {calendar_id="1|2"}
    {/if}
}

```

The above is essentially what I believe the code should look like. I have tried many different methods including:

* the same style of {if}code{/if} {if}code{/if} as the segment\_3 above it (which works for the segment\_3 bit)
* enclosing the entire tag within a conditional checking the member\_group
* making the conditionals around segment\_3 more specific to only allow certain member\_groups
* using quotes on the member\_group like so: {if member\_group == "1"}
* putting the member\_group check above the segment\_3 check
* Taking out the if statement for segment\_3 and only having one on member\_group
* probably various other things that I forget at the moment

When the conditionals are set up like either case of the example above, it will always use the second case. So if I make "1|2|3" the calendar\_id for the else statement, that is what it will display.

I have checked to make sure that I am getting proper values from the member\_group/group\_id by using conditionals with them just outside of the calendar tag and these work properly. Do I just not have access to them within the calendar tag?

Thanks in advance for any help!

# Answer
> 0 votes
I would change `{if member_group == 1}` to `{if logged_in_group_id == "1"}`

If that doesn't work, then perhaps also try changing:

```
{if member_group == 1}
   calendar_id="1|2|3"
{if:else}
   {calendar_id="1|2"}
{/if}

```

to:

```
{if logged_in_group_id == "1"}
   calendar_id="1|2|3"
{/if}
{if logged_in_group_id != "1"}
   {calendar_id="1|2"}
{/if}

```

I think depending on which version of EE you're using, there was a time (around EE 2.7 I believe) when `{if:else}` would not correctly work inside a template tag call due to parse order. :)

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


# Question
Title: Channel form error with grid file field, comma in file name
I'm running into a problem using Channel Forms on EE 3.4.4 with a file field inside a grid. If the filename contains a comma it will initially submit but subsequent saves return an error message: 'There was a problem with one or more grid fields'.

Everything works as intended through the Control Panel, it only appears to be affecting Channel Forms. As soon a I remove the file with the comma in the name it works perfectly fine.

Has anyone had any similar problems with this at all?

# Answer
**Caution:** I've noticed that duplicate files are being added when submitting an entry. I'm not sure whether this is a result of the below or not. First test indicate not but I'd use the below with caution.

I have managed to fixed this problem but its not entirely elegant.

Wherever the file name is being referenced in the 'file field' view file I've added `str_replace` to convert `%2C` to a comma. `<?=str_replace('%2C', ',', $string)?>`

`system/ee/EllisLab/ExpressionEngine/View/_shared/file/field.php`

```
<div class="file_field">
    <div class="file_set <?=$set_class?>">

        <p class="filename">
            <img src="<?=$thumb?>" alt="<?=str_replace('%2C', ',', $alt)?>"/> <!-- Optional -->
            <br />
            <?=str_replace('%2C', ',', $filename)?> <!-- Optional -->
            <?=$remove_file_link?>
        </p>
        <p><?=str_replace('%2C', ',', $hidden);?></p> <!-- Required -->
    </div>

    <div class='file_upload'>
        <p class="sub_filename">
            <?=$undo_link?>
            <?=$filebrowser ? $upload_link : ''?>
        </p>

        <div class="no_file <?=($filebrowser || $filename) ? 'js_hide' : ''?>">
            <p class='sub_filename'><?=$upload?></p>
            <?php if ( ! $allowed_file_dirs):?>
                <p><?=$dropdown?></p>
            <?php else: ?>
                <p><?=$directory?></p>
            <?php endif; ?>

            <?php if ( ! empty($existing_files)) : ?>
                <p class="file_existing"><?=$existing_files?></p>
            <?php endif; ?>
        </div>
    </div>
</div>
<div class="clear"></div>

```

I'm not marking this answer as accepted as there is probably a better way to solve this, however, I thought I'd add the answer in case someone else has the issue and needs a temporary fix.
> 0 votes

---
Tags: safecracker, file-uploads
---


# Question
Title: Setting a Stash variable within an old style EE conditional
I'm working on an old EE site (v2.5.2) which for reasons I won't go into I cannot update to a newer version.

I am trying to set a Stash variable based on whether or not a condition evaluates to true. But, because of the way this version of EE handles conditionals the Stash variable is always being set regardless of the actual condition.

Simplified code snippet:

```
{exp:stash:set_value name="sample" value="no"}

-- loop starts here --
{if entry_id==''}
    {exp:stash:set_value name="sample" value="yes"}
    Other stuff here
{if:else}
    Other stuff here
{/if}
-- loop ends here --

```

No matter whether entry\_id is empty or not, the Stash variable always shows as "yes".

I've tried using Switchee and If:else but have had absolutely no luck getting this apparently simple thing to work.

How can I get around this? It's driving me nuts.

Real code snippet (using Cartthrob's cart\_items\_info loop) and following information found at https://devot-ee.com/add-ons/support/switchee/viewthread/6566

```
{exp:stash:set parse_conditionals="true" parse_tags="yes" process="start"}
    {exp:cartthrob:cart_items_info}
        {exp:switchee variable="{item_options:sample}" parse="inward"}
            {case value="true"}
                {stash:sample}yes{/stash:sample}
            {/case}

            {case default="yes"}
                {!-- nothing going on here --}
            {/case}
        {/exp:switchee}
    {/exp:cartthrob:cart_items_info}
{/exp:stash:set}

{exp:stash:get name="sample"}

```

That loop will output the correct information based on the value of {item\_options:sample}. But the Stash variable is ALWAYS set to "yes" no matter what.

# Answer
> 0 votes
Some ideas you might want to try:

Use exp:stash:parse to make it parse the value at the end of the template https://github.com/croxton/Stash/wiki/%7Bexp:stash:parse%7D

```
{exp:stash:parse process="end"}
{exp:stash:get name="sample"}
{/exp:stash:parse}

```

Use `{embed="..." sample="{exp:stash:sample}"}` this always gets parsed at the end.

Wrap {exp:stash:set} around those tags like this:

```
{exp:stash:set name="sample" parse_conditionals="true" parse_tags="yes" process="start" parse_depth="4"}
    {exp:cartthrob:cart_items_info}
        {exp:switchee variable="{item_options:sample}" parse="inward"}
            {case value="true"}
                yes
            {/case}

            {case default="yes"}
               no
            {/case}
        {/exp:switchee}
    {/exp:cartthrob:cart_items_info}
{/exp:stash:set}

{exp:stash:get name="sample"}

```

# Answer
> 0 votes
What about checking the variable on getting instead?

```
{exp:stash:set
    name="sample"
    parse_tags="yes"
}{exp:cartthrob:cart_items_info}{item_options:sample}{/exp:cartthrob:cart_items_info}{/exp:stash:set}

{exp:stash:get name="sample"}

{!--or:--}
{if {exp:stash:not_empty name="sample"}}
    Do something
{/if}

{!--or possibly:--}
{if sample}
    Do something
{/if}

```

# Answer
> 0 votes
I've actually managed to get this working but I'm not sure why it now does.

```
    {exp:cartthrob:cart_items_info}
        {exp:switchee variable="{item_options:sample}" parse="inward"}
            {case value="true"}
                {exp:stash:set name="sample" output="no"}yes{/exp:stash:set}
            {/case}

            {case default="yes"}

            {/case}
        {/exp:switchee}
    {/exp:cartthrob:cart_items_info}

```

I'm sure this isn't the best way but I've lost so much time on this that I'm moving on to something else.

---
Tags: stash, conditionals, parse-order, ifelse
---


# Question
Title: EE3 Is there any simple way to implement infinite loop scrolling
Tried this tutorial not working http://iamjustinlong.com/blog/single/implementing\_infinite\_scroll\_in\_your\_expressionengine\_site/ when I click to next it goes to url instead of appending entries, no error on console.log.

Wondering if any one had luck on infinite loop entries lately. I have simple news channel:

```
<div class="articles">
  {exp:channel:entries channel="news" dynamic="no" show_future_entries="yes"}
    <div class="article">
      <h1>{title}</h1>
    </div>
  {/exp:channel:entries}
</div>

```

# Answer
I've used jscroll before http://jscroll.com/ it seems to work fine. Here's some sample code:

```
<div class="infinite-scroll">
    {exp:channel:entries channel="news" dynamic="no" show_future_entries="yes"}
    <p class="item">{title}</p>
    {paginate}
    {if next_page}
    <a href="{auto_path}" class="jscroll-next">Next</a>
    {/if}
    {/paginate}
    {/exp:channel:entries}
</div>

<script>
$('.infinite-scroll').jscroll({
    loadingHtml: '<img src="loading.gif" alt="Loading" /> Loading...',
    padding: 20,
    nextSelector: 'a.jscroll-next:last',
    contentSelector: '.item'
});
</script>

```
> 1 votes

---
Tags: ee3, loop
---


title: EE3 structure remove index.php

text:
# Question
Title: EE3 structure remove index.php
When adding link "using structure page link type" via backend (wygwam) all links include index.php automatically, is this a bug?

# Answer
> 0 votes
Under Settings -\> URL and Path Settings -\> Website index page, it should be blank, by default it will have "index.php", so ensure you delete this.

---
Tags: wygwam, structure, index.php
---


title: Upgrading to EE3

text:
# Question
Title: Upgrading to EE3
We have a development teen designing our website from almost one year. Now is down and they did a wonderful job. We are happy, except for EE2, witch is fine but we will prefer to upgrade up EE3 (we already upgrade the license year ago).

This is their answer to my question regarding way we are using EE2:

I can answer your EE3 question though as it's a relatively simple one to answer.

While EE3 is a stable enough platform, but there are a large number of addons that you are using which are not EE3 compatible or released yet. Expresso Store for EE3 still hasn't been released for example and a number of the other add one that you are using.

Just because EE2 will be end of life, but it's not going to stop your site operating and running. In fact, EE1 sites ran for many many years after EE1 stopped support.

As I explained when we first started the site - we don't have the luxury of EE3 because addons are not available to do what you need.

Thanks

# Answer
> 1 votes
If you are after confirmation if what they are stating is correct, then I'd agree with what they are saying. Expresso Store is but 1 of many add-ons that are not yet (or never will be...?) available for EE3. But I still have an EE1 site in use that I'm only just upgrading (to Wordpress!), so the lifetime of EE2 will be more than you require for your current (new) website. Just because it is not supported by EllisLab any more, doesn't mean it's not a usable and stable platform - to be honest, I'd say it's a more stable and useable platform compared to EE3 in it's current form due to how stable EE2 is and how many add-ons there are to provide almost everything you need.

---
Tags: ee2, ee3
---


# Question
Title: Where are the demo template files stored after installing them?
I am using the solspace user addon to handle webfacing member login stuff. The installation guide says to install the demo templates in order to see how the addon works. So i install them and they are displayed nicely when i click the link that is provided after i clicked the install demo template button.

How do i get to these files that are being generated? I would like to change where they are located on my server as well as style them differently to match my website. Is this possible?

# Answer
The demo templates are stored in the database along with your other EE templates. You can view them by going to your EE Template Manager and look for the template groups called **user\_main**, **user\_inc**, etc (unless you prefixed them differently).

The assets (CSS, JS, images) for the demo templates are located in the themes folder, at **/themes/user/user/code\_pack/**

The demo templates are meant to be a starting point for using the add-on (in this case, User) on your site. You can copy, paste and modify code chunks out of those templates into other templates, or you can use them mostly as is and then adjust them to however you please. If you plan on using the demo templates as they come installed, I recommend that you place your any new CSS file elsewhere on your site though, and updating future versions of User may tell you to overwrite the files located at **/themes/user/user/**

And just to clarify, the demo templates are just regular templates, and just examples of the add-on at work. You can adjust them or not use them at all if you wish. :)
> 0 votes

---
Tags: solspace, add-on, solspace-user
---


# Question
Title: Prevent Users from Switching Sites in CP with Multi Site Manager
Does anyone know if it is possible to hide the 'Switch sites' links in the CP for certain member groups?

Thanks.

# Answer
One possible way would be to simply hide the dropdowns in CSS

```
li.parent msm_sites ul{display:none}

```

You'd also have to do some overrides for the arrow that appears when you click it but that would get you what you needed. I don't *believe* there is another way of doing this. But I'd love to be proven wrong!
> 1 votes

# Answer
Not sure it's possible without at best a plugin or at worst altering main EE code (don't do this).

I understand why you might want to remove the option to change sites, however if you are concerned about certain member groups seeing too much in the control panel, you can of course replicate the control panel posting functionality using Safecracker where you can totally control the page that the user sees.
> 0 votes

# Answer
If you want to authorize ony for one specific subsite i would sugest you create a specific membergroup. Since membergroup settings are site specific you can authorize for only one subsite, members in this group will nolonger be able to switch to the other sites..
> 0 votes

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


# Question
Title: .htaccess 301 for new structure from /blog/name to /blog/article/name
The title really says it all. I am by no means an .htaccess wizard.

I rebuilt the site and have an old URL of:

```
http://domain.com/blog/whatever

```

I need all these to redirect to:

```
http://domain.com/blog/article/whatever

```

I have tried various things, but to keep the question/answer clean, I will leave them out since they didn't work.

# Answer
If you are not sure / able to get .htaccess working, then maybe you would be better off installing the Detour Pro add-on for EE - which lets you do redirects like this via a CP module. Works well and supports both EE2 and EE3.
> 0 votes

---
Tags: url, htaccess, redirects, .htaccess, apache
---


title: HTML Template for Page load time

text:
# Question
Title: HTML Template for Page load time
I'm customizing a HTML template, any suggestions on plugins for good page load time?

# Answer
> 1 votes
To get the biggest improvements in page speed for your site you're going to want to do a few things server side first. The latest versions of PHP will give you a nice performance gain (https://ellislab.com/blog/entry/time-to-upgrade-php) as well as enabling g-zip on the server. From there you'll want to make sure your images are losslessly compressed. As far as EE goes there are caching techniques built in to help increase page performance. (https://docs.expressionengine.com/latest/optimization/caching.html)

As far as SEO, different people use different techniques. Some people use plugins to help them manage this, and some people do it a little more manually. If you take the manual route, you'll be creating more channel fields, but you have greater control over the content. You can also pass those fields through layout or embed tags.

---
Tags: ee3, pages, seo, loading-time
---


title: Forms module in MSM - change language

text:
# Question
Title: Forms module in MSM - change language
I created 3 subsites each with different language. Now i find out the same language is loaded for file upload notice "geen bestand".

Where can i change this?

Cant find this string in forms\_lang.php

The html the form outputs:

Anyway if im to use forms/language how can i set language for the forms in the subsites?

# Answer
> 0 votes
I think you'll have to look at the language settings in the EE CP. Set the default language to the right one. what version of EE are you on?

---
Tags: multi-site-manager, devdemon-forms
---


title: Order by two fields with Low Search

text:
# Question
Title: Order by two fields with Low Search
Is it possible to order search results by two fields? I have two price fields - `price` & `sale_price` and ideally need to order by both fields. Can this be done using the custom filters?

```
{exp:low_search:filters query='{segment_3}' result_page='products/results'}
    <select name="orderby_sort">
        <option value="">
            Order by
        </option>
        <option value="{low_search:url orderby_sort='price|asc'}"{if '{low_search_orderby_sort}' == 'price|asc'} selected{/if}>
            Price (Low to High)
        </option>
        <option value="{low_search:url orderby_sort='price|desc'}"{if '{low_search_orderby_sort}' == 'price|desc'} selected{/if}>
            Price (High to Low)
        </option>
    </select>
{/exp:low_search:filters}

```

# Answer
> 1 votes
Yes, by using separate `orderby` and `sort` parameters, eg:

```
{low_search:url orderby="foo|bar" sort="asc|desc"}

```

---
Tags: low-search, filter, orderby
---


title: Check if pagination in header

text:
# Question
Title: Check if pagination in header
guys.

I'm a beginner to EE and I'm looking for a way to add "" to any paginated pages in a Blog template in EE.

Is there any way to check in header if it's a paginated page and, if so, display this tag?

Thanks!

# Answer
> 1 votes
Ideally you don't want to lock your code to a specific segment and also for better performance comparing existing variables is better than running a regular expression.

My best recommendation, albeit a bit overkill just for this one conditional is to use the brilliant Mo' Variables plug-in, mainly because it adds loads more variables that are really useful to your build and obviouly make your code more readable...

```
{if paginated}
    ...
{/if}

```

Assuming you have a page of content (entry\_id) for the listing page, you could use this comparison:

```
{if url_title == last_segment}
   {!-- This is the first page (not pagination) --}
{if:else}
   {!-- This is a paginated page --}
{/if}

```

If the page only contains listed entry\_id's, you could use this conditional:

```
{if last_segment ^= "P"}
   {!-- This is a paginated page --}
{/if}

```

...Although this assumes that the template used hasn't got a segment already that starts with a capital P!

Checking for any above page one (obviously this only works inside the `{paginate}` tag pair)...

```
{if current_page > 1}
    ...
{/if}

```

The official documentation suggests this:

```
{if segment_3 ~ "/^P\d+/"}paginated{/if}

```

But I'd try to opt for this version instead:

```
{if last_segment ~ "/^P\d+/"}paginated{/if}

```

---
Tags: pagination
---


# Question
Title: Using a Channel Entry as an Embed Template
Is it possible to have Channel Entry as a text input be used dynamically to include a design template? In other words, something like:

```
{exp:channel:entries channel="mychannel" limit="1"}
    {embed="embeds/{myentryfield}"}
{/exp:channel:entries}

```

OR some other similar method to accomplish the same task.

# Answer
I have a file with html content in a channel entry. Say the name of the field in the entry is {myfile}. The value of {myfile} I can choose since in EE. If it were "/mycontent/myfile.html"

In the template, could you enable PHP and say this:

```
<?php include_once("{myfile}") ?>

```

which would be the same as

```
<?php include_once("/mycontent/myfile.html"); ?>

```

Would that work?
> 0 votes

---
Tags: templates, channel
---


# Question
Title: Using Low Replace with {site_url} not working
I'm having a problem making this Low Replace statement work. Basically I'm trying to use Low Replace to change any local URLs for images to use our CDN URL. I am using the {site\_url} EE variable and a global variable I created called {cdn}. So when I ran the following code, the replacement didn't happen.

```
{exp:low_replace find="{site_url}images/" replace="{cdn}/images/"}
     <img src="http://www.domain.com/images/test.png" />
{/exp:low_replace}

```

If I try and just put in the actual site URL in the find parameter, then it does work. But I don't want to do that since it makes switching between environments with different URLs a hassle.

Any ideas what I can do?

# Answer
> 1 votes
{site\_url} is a late parsed variable, i.e. after tags are parsed. That means Low Replace will look for the literal string "{site\_url}" rather than its content.

You'll have to use the actual var's value here.

---
Tags: low-replace
---


# Question
Title: FreeForm not allowing file upload fields to be required
A site I'm working on is **EE 2.5.5** with **Freeform 4.0.10**.

There are several required fields already, but I'm trying to add two file upload fields to be required as well. I've had no luck yet with adding the field short name to the required part of the form tag.

```
{exp:freeform:form
    allowed_file_types="doc|docx|pdf"
    form_name="{embed:form_name}"
    form:class="form new-hire-form"
    form:id="new-hire-form"
    required="first_name|last_name|address_1|city|state|postal_code|how_hear_about_us|email_address|phone_number|cover_letter|resumes"
    return="{embed:return}"
}

```

and the way the tag is being called inside this is

```
{freeform:field:cover_letter}

```

I've also tried adding a hidden field per another devs request, but that didn't help at all either.

Any suggestions or pointers on what might be going wrong would be greatly appreciated.

Thanks!

# Answer
I seem to recall having trouble with FreeForm uploads a while back...

Latest version for EE2 is 4.2.5 would definitely recommend you update and see if your problems are resolved.
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: EE3 Title url generates differently with Structure when using dot in it
When typing title EE3 generates url title automatically but it doesnt generate same as on sturcture url, so post links goes wrong. Had to do manually every time.

Example if I type:

```
My.Title

```

EE3 url generates:

```
my.title

```

but structure url generates:

```
my_title

```

Any fixes?

# Answer
I think there is no real fix for that. For EE2 there was an accessory https://github.com/shoeshine/url\_title\_match that sort of fixed this. I don't know of any EE3 alternative
> 0 votes

---
Tags: structure, url, ee3, url-title
---


# Question
Title: How do I generate a complete list of all "search-words" for a given Low Search query?
I know this is risky to make such a statement, but I am really afraid something is wrong and I do not know how to solve it. I did rebuild the tables from the CP.

Module: LOW search, system: EE ExpressionEngine v2.9.2 - Build Date: 20141004, Stash is used to produce a unique list for the found terms.

We search in 2 categories and 1 (one) field: 'Materials'.

test URL http://www.kc-vast.se/index.php/tests/SokTest

The problem is in the returned "search-words" that sometimes do not match the actual search. Sometimes words are missing, but I can see them in the entrees (results)

This goes well (example): Searching for 'sten' gives good result. Filtering category 1 with 'sten' also.

This goes wrong (example): 'vatten' 'ljus' 'sociala media' 'video'.

Assistance really appreciated. Thank you for looking at this.

EDITED 2016/11/16 21,15 CET Code for the combined test searchform and result page here:

```
        <!-- PageContent -->
    {exp:stash:set parse_tags="yes" save="yes"}<!--  main stash tag -->
          {stash:page_content} <!-- get page content -->
          {stash:ThisPageTitle}test for searching material on Kc-väst{/stash:ThisPageTitle}<!--  get the page title here -->
<div class="row colorWhite clearfix">
    <div class="medium-12 columns">
        {exp:low_search:form
    result_page="tests/SokTest"
    }
    <fieldset class="fieldset">
        <legend>category 13</legend>
        <div class="small-up-2 medium-up-4 large-up-6">
      {exp:channel:categories category_group="13" style="linear"}
        <label class="column">
          <input type="checkbox" name="category[]" value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} checked{/if}>
          {category_name}
        </label>
      {/exp:channel:categories}
  </div>
    </fieldset>
    <fieldset class="fieldset">
        <legend>category 11</legend>
        <div class="small-up-2 medium-up-4 large-up-6">
      {exp:channel:categories category_group="11" style="linear"}
        <div class="column">
        <label>
          <input type="checkbox" name="category[]" value="{category_id}"{if low_search_category ~ '/\b'.category_id.'\b/'} checked{/if}>
          {category_name}
        </label>
        </div>
      {/exp:channel:categories}
  </div>
    </fieldset>
    <fieldset class="fieldset">
  <legend>Materials</legend>
        <div class="small-up-2 medium-up-4 large-up-6" >
  {exp:low_options:material_content}
    {options}
        <div class="column">
            <input id="{option:label}" type="checkbox" name="search:material[]" value="{option:value}"
        {if low_search_search:material ~ '/(^|\|)'.option:value.'(\||$)/'} checked{/if}><label for="checkbox1">{option:label}</label>
        </div>
    {/options}
  {/exp:low_options:material_content}
  </div>
    <button class="tiny button float-right" type="submit">TestSearch</button>
    </fieldset>
  {/exp:low_search:form}
    </div>
    <div class="medium-8 columns">
<!--        use stash list to get non repeating search words -->
            {exp:stash:set_list name="found_materials"
            parse_tags="yes"
            parse_depth="2"
            }
                {exp:low_search:results
                  query="{segment_3}"
                  status="not closed"
                  disable="member_data|category_fields"
                  exact="search:material"
                }
                                            {stash:item_material}{material}{/stash:item_material}
                                            {stash:item_category}
                                                {exp:channel:categories show="{low_search_category}" style="linear"}
                                                <strong>{category_name}</strong><br>
                                                {/exp:channel:categories}
                                            {/stash:item_category}
                {/exp:low_search:results}
            {/exp:stash:set_list}
<!-- end set stash list -->
<h2>Results</h2>
<ol class="searchtestol">
    {exp:low_search:results
      query="{segment_3}"
      status="not closed"
      disable="member_data|category_fields"
      orderby="material"
      sort="asc"
    }
<!-- search result here -->
        <li>{title} by {konstnar}, with: <b>{material}  {exp:channel:categories show="{low_search_category}" style="linear"}<strong>({category_name})</strong><br>{/exp:channel:categories}</b></li>
    {if low_search_no_results}
        <p>
         Inget resultat
        </p>
      {/if}
    {/exp:low_search:results}
</ol>
    </div>
    <div class="medium-4 columns">
<h2>unique list of exact terms</h2>
<ol class="searchtestol">
    {exp:stash:get_list name="found_materials" unique="item_material"}
     <li>{item_material}</li>
    {/exp:stash:get_list}
    </ol>
<h2>Category:</h2>
    <ol class="searchtestol">
    {exp:stash:get_list name="found_materials" unique="item_category"}
     <li>{item_category}</li>
    {/exp:stash:get_list}
</ol>
    </div>
</div>
{/stash:page_content}
            {/exp:stash:set}
<!-- end PageContent -->

```

# Answer
First of all, don't worry. Your database is not corrupt, nor are you getting any database error messages. Most likely, your setup isn't producing the results you are expecting due to a combination of certain search parameters.

There's a lot to take in here, I'd recommend you clean up the template by getting rid of other tags and duplicates to make sure Low Search is returning the correct search results for you.

That said, I can point you to a couple of things that I noticed here.

First of all, **all selected categories are combined with OR**. In your current setup, all category checkboxes have a `name="category[]"`, which means that Low Search will return entries that have **any** of the checked categories assigned to it. If you want to return entries that have **all** checked categories assigned to it, then use the `require_all` parameter, as explained here.

Note that if you want to limit that to categories *belonging to the same group*, so for example (Boendemiljö OR Förskolor) AND (konst i rum OR konst inne), then use the Category Groups option, to treat each category group as a separate parameter.

Second of all, as with the categories, **all selected *materials* are combined with OR**. Like the categories, the Field Search parameter you set up will return all entries that have **any** of the selected materials selected. This means searching for *vatten*, *ljus*, *sociala projekt* and *video* will return entries where that field contains **one or more** of these values. If you want to return entries where that field contains **all** of the checked values, then use the `require_all` parameter, as explained here.

Thirdly, I can see that you're using `exact="search:material"` in one of the Low Search results tags (I wouldn't recommend using multiple, by the way). Setting that parameter will only return entries where the field would **exactly match** the given parameter **completely**. With multiple values, that would mean a field would have to exactly match 'foo' AND 'bar', which is never the case. I'm not sure what you're after with that list, but I'm pretty sure you need to use something other than `exact` here.

There are other tweaks you can do, too, unrelated to the issues you're having:

* `sort="material"` won't do anything. You're looking for `orderby="material" sort="asc"`.
* The `shortcut="{segment_2}"` seems odd. Are you sure you want to display shortcut results here?
* The `orderby` parameter on the Low Options tag won't do anything.

Finally, what I find odd is that you're generating a list of materials using Low Options and the `material_content` field, yet you're targeting the `material` field. Usually, you would generate the options of a field to create a list of search values for the same field. Are you sure you meant to do this?

As I said, plenty of stuff to tweak. But rest assured, your database is in no way corrupt nor generating any errors.

### Added later: how to output a list of given search terms and parameters

If you want to list all the options and categories that were selected, then you don't need to loop through all the search results to collect those values. You can already output the parameter values using the `{low_search_param-name}` syntax, and use that in the Form, Filters or Results tag. For example:

```
{exp:low_search:filters query="{segment_3}"}
    <h2>unique list of exact terms</h2>
    <ol class="searchtestol">
        {exp:low_list:each items="{low_search_search:material}" as="val"}
            <li>{val}</li>
        {/exp:low_list:each}
    </ol>
    <h2>Category:</h2>
    <ol class="searchtestol">
        {exp:channel:categories show="{low_search_category}"}
            <li>{category_name}</li>
        {/exp:channel:categories}
    </ol>
{/exp:low_search:filters}

```

...which uses Low List to output a pipe-separated list.
> 2 votes

---
Tags: ee2, stash, low-search
---


# Question
Title: Showing the amount of search results when using exp:low_search:popular
Can I show the amount of search results when using exp:low\_search:popular? And I would like to sort by the amount of search results if that is possible.

# Answer
You mean the actual amount of search results if you were to search your site with those keywords at that moment? If so, no, that's not possible. Performance would take a nosedive (as you're performing X searches in one go, where X is the amount of popular keywords) and you'd have to take other filters into account too, which could differ in countless ways.
> 0 votes

---
Tags: low-search
---


# Question
Title: Is there a way to convert SolSpace Calendar's recurrence rules into plain English?
* EE 2.10.1
* SolSpace Calendar 1.8.14

If I have an event on the 2nd and 4th Wednesdays of every month, how can I programmatically convey that recurrence rule in plain English? I know Calendar provides the `{rules}...{/rules}` tags inside `{exp:calendar:events}`, but the variables provided therein don't convert to English very easily.

Here's what I've come up with so far. It's not comprehensive by any means, as all it does is convey the specific recurrence rule I mentioned earlier in English—it's not flexible enough to handle many variations (it doesn't account for if a new rule is an exclusion, it assumes recurrence is monthly, etc).

```
<p>Schedule:
    <ul>
    {rules}
        <li>
        {rule_relative_dow backspace="2"}
            {if "{relative_dow}"}
                {relative_dow}<sup>{if "{relative_dow}" == 1}st
                {if:elseif "{relative_dow}" == 2}nd
                {if:elseif "{relative_dow}" == 3}rd
                {if:elseif "{relative_dow}"}th
                {/if}</sup>
            {/if} &{/rule_relative_dow}
        {rule_days_of_week backspace="2"}{day_of_week}, {/rule_days_of_week}
        of every {if "{rule_repeat_months}" > 1}{rule_repeat_months} months{if:else}month{/if}
        </li>
    {/rules}
    </ul>
</p>

```

I feel like there should be a more concise way to do this...

# Answer
This works for me:

{rules} {if rule\_repeat\_weeks}Every {if rule\_relative\_dow}{rule\_relative\_dow backspace="2"}{if '{relative\_dow}' == '6'}Last{/if}{if '{relative\_dow}' != '6'} {exp:ordinal}{relative\_dow}{/exp:ordinal}{/if} & {/rule\_relative\_dow}{/if}{rule\_days\_of\_week backspace="2"}{day\_of\_week}, {/rule\_days\_of\_week} {/if} {if event\_all\_day} (all day){if:else}at {rule\_start\_date format="%g:%i%a"}-{rule\_end\_date format="%g:%i%a"}{/if}
{/rules}

Get the Ordinal Suffix plugin free on Devot:ee
> 1 votes

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


title: Facebook Viewcontent Pixel Code

text:
# Question
Title: Facebook Viewcontent Pixel Code
I'm trying to start implementing some dynamic marketing on Facebook. To do this, I need to use the Facebook Pixels to track users behaviors.

```
<script>
fbq('track', 'ViewContent', {
content_ids: ['1234'],
content_type: 'product'
value: 0.50,
currency: 'USD'
});
</script>

```

The issue I have is having this code update with each different product. I was able to update the code (below) using EE tags to get the data I need, but to do so, I have to place the Facebook pixel code inside the EE {exp: loop. When doing this, Facebook doesn't recognize the pixel code. If I leave it outside of the {exp: loop, the EE tags don't work.

Updated code:

```
<script>
    fbq('track', 'ViewContent', {
        content_ids: ['{product_item_id}'],
        content_type: 'product'
        value: '{price}',
        currency: 'USD'
    });
</script>

```

Has anyone else had this issue with ExpressionEngine and Facebook Pixels? I'm running EE 2.8.1, Expresso Store 2.5.

# Answer
try adding a protect\_javascript variable in in config.php:

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

```
> 1 votes

---
Tags: expresso-store, facebook
---


# Question
Title: Expresso Store - Order conformation email not sending
We're using EE 2.9 and Expresso Store 2.3.1. We've set up an Order Conformation email template, but no matter what we put in the To or BCC fields, no email is sent to the client. We can send email ok from Tools \> Communicate and other emails from the site are sending ok.

# Answer
> 0 votes
Resolved now, Sendmail wasn't working, but switching to PHP Mail is.

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


# Question
Title: Is there a public repo for the EE User Guide?
I came across some missing documentation, and I was hoping I could create pull request to add the missing information. If there isn't a repo, any idea how to file a bug about the issue? The link at the bottom of the page - "Report a problem with this page" - is 404-ing.

# Answer
You can report a bug here: https://expressionengine.com/support/bugs

Or you can send an email with feedback to team@ellislab.com and we will take a look. The Docs are not in a public repo, so we aren't accepting pull requests for them.
> 2 votes

---
Tags: ee3
---


# Question
Title: Freeform - getting multiple submissions per user
I'm getting 2-3 submissions from the same user when they submit.. all with the same information. I can't figure out if a refresh of the page or something is doing this? Any ideas how i can stop this? i was going to use prevent duplicates on the email address, but won't this block that same user from submitting a form in the future?

# Answer
Had the same issue on multiple high traffic sites, it was due to the users slow internet connection so they would click the submit button multiple times while the form was processing. Eventually found a useful piece of code to stop this

```
<script>
 var $j = jQuery.noConflict();
 jQuery.fn.preventDoubleSubmission = function () {
            $j(this).on('submit', function (e) {
                var $form = $j(this);

                if ($form.data('submitted') === true) {
                    // Previously submitted - don't submit again
                    alert('Form already submitted. Please wait.');
                    e.preventDefault();
                } else {
                    // Mark it so that the next submit can be ignored
                    // ADDED requirement that form be valid
                    if($form.valid()) {
                        $form.data('submitted', true);
                    }
                }
            });

            // Keep chainability
            return this;
        };

$j('form').preventDoubleSubmission();
</script>

```
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: How do I import checkbox field values using DataGrab?
How do I format checkbox field values in an XML DataGrab import? I should mention that this checkbox field is in a Matrix but I am not sure if that will affect anything.

I've tried using the usual PHP\_EOL and pipes to separate multiple values but neither worked.

# Answer
> 2 votes
If you are using a normal, EE checkbox, you should just need to supply pipe-delimited values (eg, One|Two|Three).

If you are using a Field Pack checkbox, these aren't currently supported within Matrix fields, but I can add it pretty easily if you need it.

---
Tags: matrix, datagrab, import, checkbox
---


# Question
Title: Where can I find the HTML, CSS, and JavaScript files in my dashboard?
Hello ExpressionEngine community,

My available options in the bar along the top when I log in are:

* Content
* Members
* Site Control
* New Entry
* Edit Entry
* Home

My best guess was "Edit Entry", but I get a message saying "An Error was Encountered You are not authorized to access this page". Do I need special access rights to find the HTML, CSS, and JavaScript?

Thanks!

# Answer
> 1 votes
The HTML should be under **"Templates/Template Manager"** in a tab called **"Design"** which is normally next to **"Content"**. If you can't see that tab then yes, it most likely is your account doesn't have the permissions to access that section.

It's also worth noting that the HTML should be there but depending how the site was set up the CSS and JS might not be there and you might need FTP access to the server.

---
Tags: javascript, css, html
---


title: Expresso Store - Emails and SMTP

text:
# Question
Title: Expresso Store - Emails and SMTP
We're using EE 2.9 and Expresso Store 2.3.1. Automatic emails sent when an order is placed work fine with PHP Mail and Sendmail, but wont send over SMTP. The client wants to switch to SMTP, we've added the username, password etc.. to EEs email settings, is there anything else we ned to change?

# Answer
This is resolved, in settings email sender name and email address were swapped around
> 0 votes

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


# Question
Title: Display number of entries of a certain categories in a channel
I would like to display the number of entries of a given category within the same channel, and nothing else.

I've found this older question Display the number of entries in a channel but that does not solve my problem - I cannot add a category\_id to the stats module, and I'm not much familiar with the Query module - but still haven't found anything useful in the documentation.

# Answer
Maybe something like {exp:channel:entries channel="my\_channel" category="2" dynamic="no"} {absolute\_results} {/exp:channel:entries}
> 1 votes

# Answer
You can do this using the very helpful add-on "Category Construct". Something like this... all you need to know is the ID(s) of the channel(s) you want to count the entries for), and the ID of the category concerned.

```
{exp:category_construct:categories channel_id="{your_first_channel_id|your_second_channel_id|...etc}" cat_id="{your_chosen_category_id}" entry_count="true"}
    {construct:level_total_results}
{/exp:category_construct:categories}

```

Alternatively, this will output a list of categories and counts for a channel.

```
<ul>
 {exp:category_construct:categories channel_id="{your_first_channel_id|your_second_channel_id|...etc}" entry_count="true"}
   <li>{construct:cat_name}: {construct:level_count} entries</li>
 {/exp:category_construct:categories}
</ul>

```

HTH
> 0 votes

---
Tags: categories, query-module, statistics
---


title: Specifying URL on EE

text:
# Question
Title: Specifying URL on EE
Let's say I'm making a site in EE and I want to specify a URL on a specific page. As a former wordpress dev, I did that with ease, how would I do that with EE?

# Answer
> 0 votes
The slug used for every entry can be edited on the URL title field.

If you want to customize the full URL, you can use the pages module. It will make the Pages Tab available, where you can type the full URL. Use it with parsimony.

# Answer
> 0 votes
You can also use the Template Routes system. This gives you extraordinary control over what templates are used to generate content in response to URL entries. Hugely powerful, but with quite a steep learning curve. If you are happy to buy an add on there is also Structure which overlays a Wordpress like environment over EE.

---
Tags: url, ee3
---


title: cannot configure solspace email

text:
# Question
Title: cannot configure solspace email
I am desperately trying to make my Freeform (free version) to confirm to my HTML of my site. Here is the mess I have now so you see what I mean:

```
<!-- Contact Form -->

        <form class="contact-form row" method="post">

            <div class="col-md-6 col-sm-6 form-group">
                <input type="text" id="input_name" name="contact-name" class="form-control" placeholder="Name*" required/>
            </div>
            <div class="col-md-6 col-sm-6 form-group">
                <input type="email" id="input_email" name="contact-email" class="form-control" placeholder="Email*" required/>
            </div>
            <div class="col-md-12 col-sm-12 form-group">
                <input type="text" id="input_phone" name="contact-phone" class="form-control" placeholder="Telephone"/>
            </div>
            <div class="col-md-12 col-sm-12">
                <textarea placeholder="Comments" id="textarea_message" name="contact-message" rows="6"></textarea>
            </div>

            <input type="submit" id="btn_submit" formaction="mail:info@mannachurch.org" class="btn btn-default" value="send"/>

            <div id="alert-msg" class="alert-msg"></div>

            {exp:freeform:form
                        form_id="1"
                        required="name|email"
                        recipient1="Manna Church|info@mannachurch.org"
                        recipient_template="contact_form"
                        notify_user="yes"
                        user_email_field="user_email"
                    }

                        <p><label>Choose Recipients</label><br/>
                            <select name="recipient_email" />
                                {freeform:recipients}
                                <option value="{freeform:recipient_value}">
                                    {freeform:recipient_name}
                                </option>
                                {/freeform:recipients}
                            </select></p>

                        <p>
                            <label>{freeform:label:name}</label>
                            {freeform:field:name}
                        </p>
                        <p>
                            <label>{freeform:label:email}</label>
                            {freeform:field:email}
                        </p>

                        <p>
                            <label>{freeform:label:subject}</label>
                            {freeform:field:subject}
                        </p>

                        {if freeform:captcha}
                            <p>Please enter the word you see in the image below:</p>
                            <p>{freeform:captcha}<br />
                            <input type="text" name="captcha" style="width:140px;" /></p>
                        {/if}

                        <p>{freeform:submit}</p>

                    {/exp:freeform:form}

        </form><!-- Contact Form /- -->

```

Go to http://www.reachoutcelebration.com and scroll to the bottom to see what I mean. What am I doing wrong? EE newb desperately looking for help, let me know if this code is too much or not clear enough.

# Answer
The {exp:freeform form} will create the form tags for you. Once inside you aren't required to use the {freeform:field:xxx} tag, you can just use the typical input syntax. I'll include some code below for reference.

```
                {exp:freeform:form
                form_id="1"
                inline_errors="yes"
                required="name|email"
                return="/thank-you"
            }
                    <span>* = Required</span>
                    <input type="text" name="name" placeholder="Name*">
                    {if freeform:error:name}<strong class="error">{freeform:error:name}</strong>{/if}

                    <input type="text" name="email" placeholder="Email*">
                    {if freeform:error:email}<strong class="error">{freeform:error:email}</strong>{/if}

                    <textarea name="user_message" placeholder="Questions/Comments"></textarea>

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

            {/exp:freeform:form}

```
> 2 votes

---
Tags: solspace-freeform, ee3, html-email
---


title: Expression Engine and Anchor tags

text:
# Question
Title: Expression Engine and Anchor tags
Here is my website: http://reachoutcelebration.com/

I have another webpage here: http://www.reachoutcelebration.com/pages

When I click on "contact" on the menu of the "pages" page, it should lead you to the main reachoutcelebration.com page with the title Contact section. As you can see, it doesn't. It throws it some place else several hundred pixels above.

Does expression engine have any dandy way to make anchor tags?

# Answer
> 2 votes
Your issue is nothing to do with ExpressionEngine.

The template you are uses javascript to smooth-scroll within the page. It appears to be configured properly for in-page scrolling, but not for links arriving from other pages. This is a consequence of how the scrolling utility you are using is written - it needs to check for whether it is being called at page load or not, and if so effectively force a scroll to top of page before then scrolling back to the correct location.

You can fix this a number of ways, but how very much depends on what else you are doing on the page. But you might get some ideas for a way to proceed from other discussions on stackeexchange of the issue - e.g. look at the notes to the first answer to this question - https://stackoverflow.com/questions/14804941/how-to-add-smooth-scrolling-to-bootstraps-scroll-spy-function

More generally, EE is a powerful back-end CMS that gives you total control over how the information is displayed within your website. The upside of this is flexibility, the downside is that for the most part you have to create your own templates to control what HTML is generated; but within these templates your control over how an anchor tag is created is complete. In the light of this, your final question does not make much sense. Perhaps if you clarified what you are trying to do you might get a better answer.

Anyhow HTH.

# Answer
> 0 votes
After much stress and research, none of the javascript fixes worked. I moved the anchor tag on the other page in an awkward position. It's like the anchor tag pulls the viewport "too high" over the anchor tag making navigating the site disorienting. I manually moved the anchor down. I still have no idea how else to fix it. Marking this one up as ambiguous, until I learn more JS.

---
Tags: ee3, tags, links, html
---


title: Q re: nested conditional with grid rows

text:
# Question
Title: Q re: nested conditional with grid rows
I've got a Grid field (EE2.11) where one of the columns is called "Open?" with a checkbox for "Closed" so I can turn a row off and on. I'm using a nested conditional to first filter out anything that's marked closed, then a simple conditional within that, like this simplified version:

```
    {exp:channel:entries channel="samples"}
        {sample_grid}
            {if sample_grid:open <> "Closed"}
                {if sample_grid:videolink == ""}
                    {sample_grid:description}
                {if:else}
                    {sample_grid:videolink}
            {/if}
        {/sample_grid}
    {/exp:channel:entries}

```

So two questions: (1) is there a better way to turn Grid rows off and on (I was wishing for something I could put in the channel entries tag to do the filtering)? and (2) is there a better way to filter out the closed rows than with a nested conditional?

It's all working fine, I'm just wondering if there is some performance issue with this, or if this all seems like a good way to do this.

# Answer
To do the searching you can simply replace the outer conditional with a search tag (which has the same syntax as the channel entries search tag). The {if} tag is pretty efficient in 2.11 so not an unreasonable method for the either / or switch. Something like:

```
{exp:channel:entries channel="samples"}
    {sample_grid search:open="not Closed"}
        {if sample_grid:videolink == ""}
            {sample_grid:description}
        {if:else}
            {sample_grid:videolink}
        {/if}
    {/sample_grid}
{/exp:channel:entries}

```

HTH
> 1 votes

---
Tags: conditionals, grid
---


title: adding more channels increase load time

text:
# Question
Title: adding more channels increase load time
My site loads at a sluggish 5 seconds. I've made the images the smallest I can without loosing too much quality. It was at 4.1 seconds, which wasn't great, but I was happy with it. Would adding channels to the mix lower load time? Right now, I think I can get by with none. This is a free version of expression engine with only one free add-on. Website is reachoutcelebration.com

Any suggestions would be appreciated.

# Answer
> 2 votes
It isn't eecms' fault. Just open the source code and refresh it. Even without cache, it's almost instantaneous.

There's too much third-party content. And take a look at you HTML. Maybe some broken tag is delaying that waterfall of javascript files.

# Answer
> 1 votes
If you really are using no channels, you probably can static cache the site without problems. But equally, not clear this will help, as the main cause of delay in EE is data access and composition to then load into templates to generate the HTML you see: if you have no channels then presumably no data access and very little EE caused delay. Having looked at the site I would guess the probable cause is loading up video - for which EE optimisation / caching won't help.

# Answer
> 0 votes
Just found at per there documentation, it does:

"The greater the number of tags and variables you use, the more processing cycles the template rendering engine has to perform."

but luckliy there is caching

https://docs.expressionengine.com/latest/optimization/caching.html

# Answer
> 0 votes
I used gzip compression per googles suggestion. Thankful that EE makes that simple in the settings. Seemed to have help for approx 1 second of saved time.

---
Tags: ee3, loading-time
---


title: EE Admin Typekit error?

text:
# Question
Title: EE Admin Typekit error?
In our backoffice, I'm seeing this, which, of course, renders our Admin area almost unusable:

Has anyone seen this or know how to fix it? I can't find **ANY** instances of `jqv4zpf` or even `cycle.min` **ANYWHERE** on my system.

Apparently this only happened recently.

# Answer
> 0 votes
I have face the same issue. The error occurs in EE versions lower then EE 2.2. Actual error is not of typkit or something but the accessory named "ExpressionEngine Info". I uninstalled this accessory and it works.

---
Tags: ee2
---