# Question
Title: Low Search not finding three letter words
All three letter words using Low Search are not showing in results yet are showing when I use the native EE search.

These are words such as "Air" or "Ten" which appear in the entry title. These words appear in the Lexicon and the title has a weight of 3.

*Form tag:*
{exp:low\_search:form result\_page='search/lowsearch' collection='products'}

*Results Tag:*
{exp:low\_search:results query='{segment\_3}' collection='products' keywords:lang='en'}

*Details:*
EE: 2.9.2
Low Search: 4.4.1
Collection: products
Min word length: 3

# Answer
> 1 votes
The *Minimum word length* setting has to reflect your MySQL's `ft_min_word_len` setting. This defaults to 4. Some people, who have complete control over their hosting environment, can change this setting to a lower number, but most of the time, the default value is accurate. If you set the value to a different (specifically lower) number than is registered in MySQL, then unexpected results can happen. If you haven't customized your MySQL installation, then chances are that setting still has the default value.

Low Search's collection index uses MySQL's native full-text functions to get search results for keyword searches. MySQL's full-text index only indexes words that are of the `ft_min_word_len` and up. So, by default, 4 characters and up; 3 and below are ignored. That means searching for words that are 3 chars and below would return no results. This is why LS fires an alternative search method (based on `LIKE`) when it sees the keywords fall below the threshold. However, if the *Minimum word length* in LS is set to 3 while it's actually 4 in MySQL, the regular search method will fire with 3-letter words, and consequently will return no results.

tl;dr: change your *Minimum word length* setting back to 4.

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


title: Can't get entries to list

text:
# Question
Title: Can't get entries to list
I am a EE dev novice. I have created a practice website to learn EE. I am having trouble getting the entries for my channel to show here in the "endorsements section":

http://www.mannawebsites.com/\_development\_sites/ee3\_site/index.php/blog/blog-entry/driving-cars

I am not sure if the error is in the dashboard side of things or in the code.

I made a channel called "endorsements", made a field group called "endorsements". Assigned that field within the channel, made the fields "endorsement\_image"/"endorsement\_name"/"endorsement", then made one entry, and hard coded the following code in my template:

```
{exp:channel:entries channel="endorsements" related_categories_mode="yes" dynamic="no" custom_fields="yes" sort="asc" limit="3" status="open"}
        <div class="4u 12u(mobile)">

        <section class="highlight">
        <a href="#" class="image featured"><img src="{endorsement_image:mid-size}" alt="{title} photo" /></a>
        <h3>{endorsement_name}</h3>
                <p>{endorsement}</p>
                <ul class="actions">
                <li><a href="#" class="button style1">Learn More</a></li>
                </ul>
        </section>
</div>
{/exp:channel:entries}

```

Nothing shows in the browser despite all my efforts to troubleshoot. Also, I'm not sure which attributes are necessary here to make this work, I'm just throwing everything I can at it. I have category group "endorsements" category group and a custom field group? Do I even need that for this?

Can someone help me find where the problem is to make this show in the browser?

# Answer
I figured it out. Too many stinkin' attributes! I "think" the related\_categories\_mode attribute with the dynamic attribute did some type of EE collision. Live and learn, people... live and learn.
> 0 votes

# Answer
I think you are passing to many attributes. Try something this:

```
{exp:channel:entries
    channel="endorsements"
    disable="category_fields|member_data|pagination|trackbacks|relationships"
    dynamic="no" limit="3"
}

{/exp:channel:entries}

```
> 0 votes

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


title: modulo inside stash list

text:
# Question
Title: modulo inside stash list
I have a stash list for displaying entries. In general a row has 3 columns, but I also want to break with rows of 2 columns.

layout looks like:

30%|30%|30%
30%|30%|30%
50%|50%
30%|30%|30%
30%|30%|30%
50%|50%
30%|30%|30%
30%|30%|30%
50%|50%

```
{exp:stash:get_list name="dataEntries" prefix="archiveEntriesHomeList" require_prefix="no"}
    {if archiveEntriesHomeList:count % 7 == 0} DO 50% column
    {if:elseif archiveEntriesHomeList:count % 8 == 0} DO 50% column
    {if:else} DO 30% column {/if}
{/exp:stash:get_list}

```

but this will not work, since 50% columns should displayed when count is:

7 & 8
15 & 16
23 & 24
31 & 32
and so on...

any idea how to do implement this in a simple way?

# Answer
> 0 votes
In the first part of the conditional test for modulus of the next number:

```
{if (count + 1) % 8 == 0 }

```

So you end up with something like:

```
{exp:stash:get_list name="test"}
    {if (count + 1) % 8 == 0 } {count} DO 50% column<br>
    {if:elseif count % 8 == 0} {count} DO 50% column<br>
    {if:else} {count} DO 30% column<br> {/if}
{/exp:stash:get_list}

```

---
Tags: stash, conditionals, list
---


title: Stash embed not working

text:
# Question
Title: Stash embed not working
Hoping someone can help as this has been driving me crazy for 2 days now...

For some reason I just can't get this to work in a template:

```
{stash:embed:layouts:product}

```

When I view the page it simply shows that code above. I'm using EE 2.9.2 and Stash 2.6.5.

I have the following structure;

EE templates from file: /\_templates/base/\_pages.group/product.html (which contains the above embed)

Stash templates: /\_templates/base/\_stash/layouts/product.html

In my site's index.php I have the following;

```
// Stash
$assign_to_config['stash_file_basepath'] = $_SERVER['DOCUMENT_ROOT'].'/../_templates/base/_stash/';
$assign_to_config['stash_file_sync'] = ('ENV' == 'prod') ? FALSE : TRUE; // set to FALSE for production
$assign_to_config['stash_file_extensions'] = array('html', 'md', 'css', 'js', 'rss', 'xml');
$assign_to_config['stash_static_basepath'] = $_SERVER['DOCUMENT_ROOT'].'/../public_base/static/';

```

I can't figure out what is going on. The stash tags just doesn't seem to parse/process and I have this setup exactly the same on another site. Stash looks to be working as it is setting the stash cookie.

I would be really grateful if anyone can help.

# Answer
> 0 votes
It appeared that the install of the latest version of Stash installed multiple of the 2 Stash hooks in the extensions table. Reinstalled the extension and it then correctly added the 4 hooks. However, I had to change the priority of one of the template hook's because another module was causing a problem. Thanks to Mark Croxton for helping cure my sanity with this one.

# Answer
> 0 votes
Make sure that the Stash *extension* is installed on the extensions page in the control panel. The Stash extension converts `{stash:embed_name}` into the more "normal" `{exp:stash:embed name="embed_name"}` in the background, so it could be that for some reason this is not happening.

---
Tags: stash, parse-order, parse
---


# Question
Title: freeform multipage reset some values from other pages
I have a multi-page form set up as following :

question 1 \> question 2 \> question 3 \>

question 4 **if answered yes** \> question 5
question 4 **if answered no** \> question 6

All my questions have a return to last step button.

now my problem is that if someone answers **yes** on question 4, then answers question 5 and goes back to question 4 and set it to no and answers question 6 both values will be set. This is a problem for me since the the result page will depend on the answers on every question.

I have tried using the extension hooks, but every page only has the $\_POST values of that given page.

Does anyone know a way to clear the value when another value is submitted.

# Answer
> 0 votes
If you are good in backend development, I suggest you to manipulate data when it actually start insert in database. Use **freeform\_module\_insert\_begin** hook.

---
Tags: solspace-freeform, extension, hook
---


# Question
Title: Low Search and match 3 fields and then return data
I'm looking for a bit of guidance here, just need pointing in the right direction for. A solid solution.

Would this be possible with ExpressionEngine? Either using something like Low Search or even the Simple Search??

**Step 1:** Person enters: Surname, Postcode, Client reference number

**Step 2:** If those details match with the data in an entry(?), they then get put through to a confirmation page which is personalised with a unique code – this unique code will be already existing in the entry.

In step 1, the data inputted will need to match exactly so there is no risk of someone accidentally getting someone else's unique code. So blank spaces will need to be removed maybe??

Happy to take advice on a better way rather than entering x3 search fields.

Thanks

**UPDATE**

Here is the code I am using now.

Kind of works but I cannot get it to match exactly. For example searching for "Steve" or "Steven" in the first name field returns the same result. Where the actual name in the entry is "Steve". And then the client reference number returns the same result if "1234" or "12345" is enetered, where in the actual entry it is "1234".

**Form:**

```
{exp:low_search:form
            result_page="/site/success"
            collection="season_ticket_holder"
            required="search:firstname|search:surname|search:clientref|search:postcode"
            require_all="search:firstname|search:surname|search:clientref|search:postcode"
            exact="search:firstname|search:surname|search:clientref|search:postcode"
        }

        <div class="form-area">

            <p class="form-element">
                <label for="firstname">First name<em>*</em></label>
                <input type="text" name="search:firstname" id="firstname" class="txtbox">
            </p>

            <p class="form-element">
                <label for="surname">Surname<em>*</em></label>
                <input type="text" name="search:surname" id="surname" class="txtbox">
            </p>

            <p class="form-element">
                <label for="clientref">Client Ref<em>*</em></label>
                <input type="text" name="search:clientref" id="clientref" class="txtbox nowhite">
            </p>

            <p class="form-element">
                <label for="postcode">Postcode<em>*</em></label>
                <input type="text" name="search:postcode" id="postcode" class="txtbox">
            </p>

        </div>

        <input type="submit" id="submit" class="submit" name="submit" value="Submit ›" />

        {error_message}

        {/exp:low_search:form}

```

**Results page:**

```
    {exp:low_search:results
query="{segment_3}"
}
  {title} {first_name} {surname} {client_ref} {postcode}
  <h1>{discount}</h1>
  {if no_results}No search results{/if}
{/exp:low_search:results}

```

**Collection Settings:**

**FIX:** problem solved, the issue was the search fields were not matching the custom field names. firstname = first\_name. Thanks to Low for sorting that.

# Answer
Looking at your example code, you've got several filter parameters in your Form tag. And as stated:

> these parameters can be applied in two ways: as **input fields in a Form**, or as **hard-coded parameters in the Results** or URL tag.

Setting them as parameters in the Form tag *will not work*. In your case, that's the `collection`, `require_all` and `exact` parameters.

Secondly, the parameter you need (and which should be placed on your Results tag) is `exact` only. You don't need the `require_all` parameter, as all parameters (and fields, in this case) target a *single value*. Note that these params will act as tho you set search:field\_name on a channel:entries tag.

Thirdly, your search form uses the Field Search filter only. That's fine, but that also means you don't need to define a collection, as that's only used for the Keywords filter. Therefore, the settings you have defined in the Collection (specifically the field weighting) have no influence whatsoever on your search results.

### tl;dr:

* Move the `exact` param to the Results tag;
* Remove the `collection` and `require_all` params from the Form tag.

Oh, and remove the `name="submit"` attribute from your submit button for good measure.

### Edit:

Also make sure your field names match. So, `search:field_name`, where `field_name` *exactly matches* the name of the field you're targeting. `firstname != first_name`
> 1 votes

# Answer
I would imagine this approach would be doable in Low Search.

You would need to define a collection that comprised the three fields that you are looking for matches in (surname, postcode, client ref), and define the unique code field as the {low\_search\_excerpt}. Then run the search as an inclusive stack \- so all three terms have to be found in a result rather than any one of the three.

HTH
> 0 votes

---
Tags: search, low-search, supersearch, query, query-module
---


# Question
Title: How to proceed after upgrade error ee2 to 3?
I am upgrading from Expression Engine 2 to 3. The upgrade was stopped and the following is the message I received:

Error While Installing 3.4.1 Stopped Oops, there was an error

ExpressionEngine appears to already be installed on your database, even though your config file is blank. If you are attempting to update ExpressionEngine from a previous version restore your config file first, then run this installation wizard again.

HOW DO I PROCEED?

Thanks

# Answer
EE2 and EE3 have their config files in different directories. Did you do these two things?

Copy system/expressionengine/config/config.php to system/user/config/config.php
Copy system/expressionengine/config/database.php to system/user/config/database.php

From https://docs.expressionengine.com/latest/installation/upgrade\_from\_2.x.html
> 1 votes

---
Tags: database, ee2-upgrades, config
---


# Question
Title: Limit conditional results inside of channel entry
I have a channel entry that I want to display limited results and also only show results with a certain conditional applied to it.

Right now I am opening the channel entry and setting a limit inside of the channel opener, and then inside of that limit the conditional runs. So when the channel entries are displayed the channel limit runs first then it filters the conditional, and there are less than the limit of entries showing because not all of the entries met the conditional. Here is my example:

```
 {exp:channel:entries
  channel="staff"
  orderby="random"
  limit="12"
 }

  {if staff_photo !=""}
   12 photos
  {/if}

{/exp:channel:entries}

```

In this example, there are some entries in my channel that do not have a photo. I only want to display entries that have a photo first, then of those entries with a photo, I only want to show 12. Is there a better order of operations or way to structure this conditional? I tried using an embed to first call in the channel then filter the limit with the embed but was not having much luck with that. Any insight is greatly appreciated.

# Answer
You can use the `limit`and the `search:field` parameters together.

```
{exp:channel:entries
    channel="staff"
    orderby="random"
    limit="12"
    search:staff_photo="not IS_EMPTY"
}
    [...]
{/exp:channel:entries}

```

There's a setting for empty fields.
> 0 votes

---
Tags: channel-entries, conditionals, embeds
---


# Question
Title: Any way to login with email address in EE 3?
I'm working on a site where login with email is requested. NSM Email Login is only for EE2, and although the site is using User from Solspace, their solution to copy the email address into the username is inadequate for this site's needs.

Is there any other way to permit login with email address in EE3?

# Answer
The "User" 4.0.7 plugin from Solspace supports it.

You can find it at https://solspace.com/expressionengine/user/docs/email\_as\_username/
> 1 votes

# Answer
Did you tried using email instead of username ?

Replace this

```
<input type="text" name="username" />

```

to this :

```
<input type="email" name="email" />

```
> 0 votes

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


title: Low Seg2Cat Issue

text:
# Question
Title: Low Seg2Cat Issue
hoping someone can help me. Just installed Low Seg2Cat on an EE3 install after finding it to try and rectify duplicate META tags.

I have set it-up as follows but I cant seem to get it working .. it's not being parsed at all.

```
{if segment_1 == "latest-news" AND segment_2 == "category"}
    <title>Latest News | {last_segment_category_name}</title>
{/if}

```

OR

```
{if segment_1 == "latest-news" AND segment_2 == "category"}
    <title>Latest News | {segment_3_category_name}</title>
{/if}

```

Am I missing the complete obvious?

Any help would be appreciated ;)

# Answer
By not being parsed you mean `{last_segment_category_name}` is unparsed and that gets output to your `title` tag html?

Double check your Low Seg2Cat settings http://gotolow.com/addons/low-seg2cat/docs#settings

Try setting "Set all segments" to "Yes." Also, make sure you haven't limited the "Category Groups" setting.
> 0 votes

---
Tags: low, low-seg2cat
---


title: Pagination linking to all black page

text:
# Question
Title: Pagination linking to all black page
I've set up what I thought to be simple pagination links but when you click a link, it goes to an all blank/black page. Anyone ever experienced this? Here is my code:

```
{exp:channel:entries channel="news" limit="4" dynamic="yes" paginate="bottom"}
    <div class="entry">
    <img src="{news_image}" alt=""/>
      <h2 class="h1-grey">{title}</h2>
      <span class="date">{news_date format="%F %j, %Y"}</span>
      <span class="source">{news_source}</span>
      <p>{news_summary}</p>
      <span class="readmore-news"><a href="news/article/{url_title}">READ MORE ></a></span>
    </div>
    {paginate}
      {pagination_links}
    {/paginate}
{/exp:channel:entries}

```

Thanks for the help!

# Answer
> 0 votes
I was able to to get my paginations working by simply adding an extra segment to my url for my news articles. Before the url was site.com/news. For some unknown reason, my pagination would not work from this page. It would simply link to an all black page. When I change my URL to site.com/news/articles, it works fine. Would still appreciate any kind of explanation from someone when time permits. Thanks.

---
Tags: pagination
---


# Question
Title: Updating images (using File ft) within a Grid updates other File fields
I'm finding, since updating to EE 3.4.0, that when I have a Grid field of rows, each with a File field (to upload an image), I'm finding that updating one File field is then updating other File fields on the same page (some not even in the Grid field) with the same image. I then switch the other File field back to the image it should be and the first one switches to this one too - it's making it impossible to update entries, and has only been seen since upgrading EE to v3.4.0.

# Answer
Found the solution - https://support.ellislab.com/bugs/detail/22018/FilePicker-callback-methods-stacking-and-being-run-when-they-shouldnt

Will be fixed in EE3.4.1 - relates to a Javascript file messing with the File field
> 0 votes

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


# Question
Title: Expression engine Forms module include html section
I run expression engine **v2.10.1** with **exp:resso store 2.5.1** and have installed **Forms module 3.5.3.**

I created a test form and included it here

I have included a HTML section in the form where i load the current Cart contents.

**My Question:** Is it possible to include the shown html section in the form submission?

If not, is there another way to include current cart into a Form entry?

# Answer
Question: Is it possible to include the shown html section in the form submission?
Answer: technically NO!.

But you can create a hidden field or hidden textarea and save the html into that field via JQuery.
> 0 votes

---
Tags: devdemon-forms
---


# Question
Title: Why are there so many   displayed in the Category display?
I am running EE 3.4.1 and when adding subcategories to the category interface I am seeing a row of 's in front of all the subcategories in the drop down list - see the attached image.

This seems odd if not just annoying. Is this a bug or is there something causing this that can be corrected on the user side?

# Answer
Turns out this is a Bug in EE and has been reported to EE.
> 1 votes

---
Tags: categories, ee3
---


# Question
Title: An Error Was Encountered This form has expired. Please refresh and try again
I am getting the above error. Its not a constant error comes and goes. when it happens and i clear cache it seems to "go" but when client tests, the error comes back.

This happens when they upload images to an already existing entry(Image size not the problem, they use small images).

I checked this post out, and it also seemed to be close (Can't login to CP – form has expired), but my question is entries based.

would adding this line in my config.php not affect security: $config\['disable\_csrf\_protection'\] = 'y'; and what would this do to my user front-end forms? is this the best solution? what would be the long term fix be for this?

thanks

# Answer
> 1 votes
$config\['disable\_csrf\_protection'\] = 'y'; is cannot consider as a permanent solution.

CSRF Token is for EE forms security and depends on sessions that will not allow to submit a form if proper CSRF not found. If this error generates in backend forms that are default EE forms, $config\['disable\_csrf\_protection'\] = 'y'; is best option.

If this error generates frontend you can simply putbelow code. Documentation of CSRF Token

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

```

For secure forms with https you need XID: (The XID constant is deprecated starting from 2.8.0)

```
<input type="hidden" name="XID" value="{XID_HASH}">

```

---
Tags: control-panel, system
---


# Question
Title: ExpressionEngine 3 photo file and signature file settings?
Same as EE2 where we can set avatar file settings, signature file settings and photo file settings Do we have something in EE3 where we can set file store location, height, width, max KB etc. for photo file and signature file ?

I search and found we can set avatar file settings but i didn't found same for Photo files and signature files. Any thoughts ?

# Answer
> 1 votes
After a lot of research, I found the default array saved in database that save those settings. I created my own setting form to update those settings.

If anyone wants to do so you can use this plugin: https://devot-ee.com/add-ons/zeal-smart-members

Still, Let me know if you have any other solutions.

---
Tags: ee3, files
---


title: Some general EE questions

text:
# Question
Title: Some general EE questions
Some random questions from a EE newb...

1.)

a.) Since Layout templates are so handy (cutting the template into interchangeable header/sidebar/footer, etc), why should our use an embed tag? Any ideas on when you should not use an embed tag over a layout tag?

b.) How would I create different template layouts for the user to pick? Would I need a channel for each? (Have't tinkered with multiple layouts yet, just wondering)

2.) A namespace is the words between the parentheses in any given attribute right? For example this:

```
{exp:channel:entries  channel="News" limit="3 status="open"}
<!--code here-->
{/exp:channel:entries}

```

"News" would be the namespace right?

# Answer
1.)

a.) Since Layout templates are so handy (cutting the template into interchangeable header/sidebar/footer, etc), why should our use an embed tag? Any ideas on when you should not use an embed tag over a layout tag?

> > Layout method is the best in flexibility, easy to use and run fast to. But the problem is you must need to write its code in first line. If you are planning to use CE CACHE plugin or something like that, it needs to write the code on first line and thus, you are not able to use CE CACHE with layouts.

b.) How would I create different template layouts for the user to pick? Would I need a channel for each? (Have't tinkered with multiple layouts yet, just wondering)

> > There are many ways to do so, It all depends how you want to do it. Simple way should be:
> > 1) create a template group like "\_layouts.group".
> > 2) Create different layout html files:
> > 3) Use the files to code by manually or create a channel for that and put options to select. (layouts code must be use in template in first line or else it will throw EE error.)

2.) A namespace is the words between the parentheses in any given attribute right? For example this:

> > Yes. The name between the parentheses of channel="\[short\_name\]" and all other attributes are values.
> > Suggestion: Always use disabled parameter with channel loop. It will boost the load of channel loop as it ignores the code given in disabled parameter.
> > Example: `disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks|relationships"`
> 0 votes

---
Tags: ee3, tags, layout-variables
---


# Question
Title: Need to host another application on server with EE
I have an EE instance on a server and need to host another PHP application in a subdirectory off the htdocs directory.

How would I adjust the .htaccess to allow this application to run without going through EE?

# Answer
I have EE installed in root directory and another php applications in sub directory named "domains". All other sites in Codeigniter, WP, EE are inside this directory.

I just write 1 line to tell htaccess to ignore the "domains" folder for checking the rules:

```
RewriteEngine On
RewriteBase /
RewriteRule ^(domains)($|/) - [L]

```

Let me know if you have any confusion and need the full code of htaccess
> 0 votes

# Answer
This is the standard rewrite rules for EE:

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

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

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

```

This line:

```
RewriteCond %{REQUEST_FILENAME} !-d

```

Means it will ignore folders from the rewrite, therefore won't add /index.php to the beginning of your URL so EE won't manage your URLs and the folder you specify (your other app) will have control and be called.

EE Documentation
> 0 votes

---
Tags: ee2, htaccess
---


# Question
Title: Let visitor upload file to expresso store order
Is there anyway to enable a file upload(s) to the expresso store order during any step of the checkout process?

# Answer
> 0 votes
File uploads is not possible with stores module. It is created for take orders and payments. If you want to do so it can easily done by custom code.

Are you good in front end custom code with ajax and php it will take no time to do so.

---
Tags: expresso-store
---


# Question
Title: Where to find the website's homepage in expressionengine?
I m trying to change the tag title of the homepage but I can't locate the homepage in the cms . I can't edit the layout page since it generates the tag title dynamically on the code below . Does anyone know how to locate the home page in the cms ?

```
{!--choozle tag--}
<script type="text/javascript"  src="//nexus.ensighten.com/choozle/200/Bootstrap.js"></script>
{!--end choozle--}

{if layout:meta_title}
     <title>{layout:meta_title} | {site_name} </title>
     <meta name='description' content='{layout:meta_description}' />
     <meta property="og:description" content=" {layout:meta_description}" />
     <meta property="og:title" content=">{layout:meta_title}" />

{if:else}
   {exp:seo_lite use_last_segment="yes"}
{/if}

{if layout:og-image}
    <meta property="og:image:url" content="{layout:og-image}" >
{if:else}
    <meta property="og:image:url" content="{lv-og-url}/images/og-logo.png" >
{/if}

```

# Answer
Usually, the website's homepage isn't an entry, but a only a template: the `index.html` template of the default template group.

For version 3, on control panel, go to Developer Tools -\> Template Manager and search for the template with a house icon.

For version 2, on control panel, go to Design -\> Templates -\> Template Manager. Search for the template group with an asterisk and the template wit a house icon.

On your case, look there for the `layout:meta_title` variable.

If you need to edit the group, but can't do it on CP, look at the `index.php` or `config.php` and search for config overrides. There are two related to this matter: `template_group` and `template`.
> 0 votes

---
Tags: ee2, control-panel, structure
---


title: Limit entries within column(s)

text:
# Question
Title: Limit entries within column(s)
Is there anyway I can limit entries within an entries tag. Not over all limit but within a particular column/row. If I have X amount of entries in a channel, I want them all to be displayed but only so many within a column. Please and thank you.

# Answer
You can do something like that:

```
{exp:channel:entries
    channel="test"
    disable="categories|category_fields|member_data|pagination|trackbacks|relationships"
    dynamic="no"
}

    {if count%2 == 1}
    <div class="even">
    {/if}

    <p>{title}</p>

    {if count%2 == 0 || count == total_results}
    </div>
    {/if}

{/exp:channel:entries}

```
> 2 votes

# Answer
Mufaddal's answer will split the results into 2 columns. From your question I'm assuming you want the first X entries to be in a column, then the rest elsewhere...?

```
{exp:channel:entries
    channel="test"
    disable="categories|category_fields|member_data|pagination|trackbacks|relationships"
    dynamic="no"
    }

    {if count == 1}
        <div class="column">
    {/if}
    {if count == 6}
        </div>
        <div class="elsewhere">
    {/if}

    <p>{title}</p>

    {if count == total_results}
        </div>
    {/if}
{/exp:channel:entries}

```
> 1 votes

# Answer
Being X the number of columns you want, you can use the modulus operator:

```
{exp:channel:entries channel="news" limit="10"}
    {if count == 1 || count % X == 1}
        <div class="row">
    {/if}
            <div class="column">
                <h2>{title}</h2>
                {body}
            </div><!-- .column -->
    {if count == total_results || count % X == 0}
        </div><!--.row-->
    {/if}
{/exp:channel:entries}

```

The modulus will give you the remainder of a division of the `count` variable by the number of columns will want. In case the remainder is `1`, the loop is starting a new row. In case it's 0, the loop is closing one.

Let's say you want 4 columns and a limit of 10, every new row will start at 5th and 9th iteration, being 1 the remainder of this positions by 4; and every row except of the last one will close at the 4th and 8th iterations, being their their remainders 0.

If you need to mark a last and incomplete row, you can use other mathematical operators at the first conditional:

```
    {if count == 1 || count % X == 1}
        <div class="row{if total_results - count < X} incomplete-row{/if}">
    {/if}

```

If the remainder is 1 and the difference between the `count` and the `total_results` variables is smaller than the number of columns you want, the row will be incomplete.
> 0 votes

---
Tags: tags, parameters
---


title: How do you remove a page

text:
# Question
Title: How do you remove a page
How do you remove a page from the website?

# Answer
If you are talking about templates of EE, it is only deleted permanently from backend.

1. Go to **Design \> Templates \> Template Manager**.
2. Select group you want to delete file from.
3. Click on delete button right side of templates (Delete once can never undone.)
> 2 votes

---
Tags: structure
---


title: Multiple Site Manger setup

text:
# Question
Title: Multiple Site Manger setup
The published support docs for ExpressionEngine 2 mention purchasing and installing MSM.

Where do I even find these files?

# Answer
> 0 votes
In Expressionengine v3 and up it comes preinstalled. You just have to enable it and purchase a license for each additional site. Go to your general settings and click on the radio button to enable site manager.

Then you will see another option in the dropdown list when you click on Developer called site manager, from which you can name and manage your other sites.

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


# Question
Title: Can I use CartThrob as an AdManager for my site?
I'm thinking if it is possible to use cartThrob as an Advertising manager for automating payments and recurring subriscriptions ad-banners?

Like if i have a link on a website 'Advertise w/ Us' and when click shows up a table for vacant advertising slot with prices per month and types of banners...Is that possible?

# Answer
You can definitely use it for that. CartThrob Subscriptions can handle the recurring billing aspect. Each slot can be a variation, and you can build logic to show or not show options based on what's available or not.
> 0 votes

---
Tags: cartthrob
---


# Question
Title: Override get_shipping() for "Cartthrob shipping by location price threshold" plugin
I am using `Cartthrob_shipping_by_location_price_threshold` plugin for `Cartthrob`.

What I need is to have a shipping by location price but, sometime I have software products, and this software products has shipping tax 0.

There is a function get\_shipping() in the `Cartthrob_shipping_by_location_price_threshold` class:

```
public function get_shipping()
{
    $location = '';
    $customer_info = $this->core->cart->customer_info();

    $location_field = $this->plugin_settings('location_field', 'shipping_country_code');
    $backup_location_field = $this->plugin_settings('backup_location_field', 'country_code');
    ........................
 }

```

And I would like to override this function. One other thing, how can I access a product shipping price? As I see the shipping price field was added from Channel Administration -\> Field Editor

```
    foreach ($this->core->cart->items() as $item)
    {
        print_r($item->..........shipping_price_field?.....);
    }

```

# Answer
(I'm with Vector, the people behind CartThrob)

Instead of overriding this, you should just create your own shipping plugin. You can duplicate `Cartthrob_shipping_by_location_price_threshold` in its folder, rename it, and update the class names/friendly name. Then you can implement any logic changes to `get_shipping()` you'd like.

For item price, are you looking for this?

```
foreach ($this->order('items') as $row_id => $item) {
    $price = $item['price'];
}

```
> 1 votes

---
Tags: cartthrob
---


# Question
Title: Call to undefined function Store\Model\form_dropdown() in ProductModifier.php on line 84
I run EE v2.10.1 with Store 2.5.1. I get the following error when logged in. This error doesn't happen all of the time which puzzles me even more..

> Fatal error: Call to undefined function Store\Model\form\_dropdown() in \[omited\]/system/expressionengine/third\_party/store/src/Model/ProductModifier.php on line 84

Any clue anyone?

# Answer
> 0 votes
form\_dropdown() method is default EE method lies on "form" helper.

Go to the file \[omited\]/system/expressionengine/third\_party/store/src/Model/ProductModifier.php and write this line at the beginning of function `ee()->load->helper('form');`

---
Tags: expresso-store, ee2
---


# Question
Title: Control Panel shortcuts in ExpressionEngine 3
In EE2, I could click the (+) icon in the top menu to add a shortcut button to the current page. These could be managed in my "Main Menu Manager" in my profile. This was really handy, but I cannot find a similar feature in EE3. Does such a feature exist out of the box, or are there any add-ons available to do this?

# Answer
> 5 votes
It seems they moved this feature to be in a drop down menu rather than directly in the main UI. I loved adding links to the top of the old EE, made things quick. But now they are in the top right corner under your username dropdown. When you click on your username you'll see a "new link" option, along with any other links you've already added.

You can also manage your links under "My profile-\>quick links". With "my profile also under the username drop down in the top right.

Hope that helps.

# Answer
> 3 votes
You can add short cuts into the control panel using the Menu Manager.

1. Go to Settings (button in top right hand corner)
2. Choose "Menu Manager" from the left hand navigation (under General Settings)
3. Click on "Add Menu Item"
4. Choose "Single Link"
5. Give the link a name
6. Enter the relative path to the addon e.g. cp/addons/settings/freeform
7. Save
8. Save Menu Set

I'm not sure how to use the addon dropdown option. Let me know if you work it out. I hope that this helps.

And here are the docs from EllisLab https://docs.expressionengine.com/latest/cp/settings/menu/index.html

# Answer
> 0 votes
Another thing you may want to look at is Addon Menu. It helps a little. Still similar to clicking your name if you just want Addon Links, but it essentially does it for you. ;)

https://github.com/amphibian/addon\_menu.ee\_addon

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


# Question
Title: Combine Pages module and the default URL behavior
An existing site uses the Pages module. There are already way too much pages and I have to add new pages now with content from a new channel.

Can I use for the new page/s the EE templategroup/template URLs and not using the Pages module?

Can both ways, Pages and the default URL behavior, be combined in one install?

# Answer
Yes, that will work. I do it all the time.
> 0 votes

---
Tags: pages
---


# Question
Title: Is there a limit to the number of categories I can create?
In Expression Engine 3.x is there a limit to the number of categories and sub-categories I can create? If so, how many?

# Answer
> 1 votes
No, there's no limit. However, the publish page might get a little unwieldy when using thousands of categories.

---
Tags: categories
---


# Question
Title: Coupon code does not exist in DevDemon Subscription
I added a coupon to the DevDemon subscription Coupon dashboard in the Control Panel.

I tried the coupon code within the subscribe tag.

```
{exp:subs:subscribe
    payment_method="authorizenet_cim"
    plan="pro"
    return="/join/create/%SUBS_HASH%"
}

<input name="coupon" type="text" value="{subs:coupon}">

```

It returns this error message:

> The submitted coupon code does not exist or is malformated.

The code does exist, I must be missing a small detail.

Any help is appreciated.

# Answer
I know this question was posted a while back, but I faced the same issue, so posting the answer here in case it is of help:

You need to check if the coupons were created in Live or Test Mode. When working on a local server, only Test Mode coupons and vouchers are applied.
> 1 votes

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


# Question
Title: Robots.txt is not found when placed in web root: where to place?
What would be the correct place to put my robots.txt file? In wordpress i was used to putting this in the web root but in EE this doesnt seem to work, when opened in webbrowser i get 404 error.

# Answer
> 4 votes
Sounds like your htaccess file is rewriting the request and serving it to ExpressionEngine index.php. Ensure you have `RewriteCond %{REQUEST_FILENAME} !-f` in your htaccess file which will ignore all physical file requests and not ask EE to serve the request.

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

```

Alternatively, don't have a physical file on the server, create the robots.txt file as a template in the main template group folder. You might need to utilise template routes to remove the template group name.

# Answer
> 1 votes
Very much depends on how your server is set up, but usually it should go in the same folder that you have index.php - which is usually the folder `public_html` or some such (depending on what server you are using).

If that is not finding it - check to see if you have some .htaccess processing going on: that might mess it up.

---
Tags: seo
---


# Question
Title: Updating an entry field, without updating every field
Using the Expression Engine Channel Entries API, is it possible to only update 1 field?

Using the below code, it appears you have to grab all the field data and then re-add it to the fields.

Is it not possible to do the below, just updating a single field (field\_id\_306).

```
ee()->load->library('api');
ee()->legacy_api->instantiate('channel_entries');

$query = ee()->db->select('title, url_title')
        ->from('exp_channel_titles')
        ->where('entry_id', $entry_id)
        ->get();

if ( $query->num_rows() > 0 )
{
    $row = $query->row();

    $data = array(
        'entry_id' => $entry_id,
        'title' => $row->title,
        'url_title' => $row->url_title,
        'field_id_306' => '10'
    );

    ee()->api_channel_entries->save_entry($data, $channel_id, $entry_id, FALSE);
}

```

# Answer
> 1 votes
It certainly is!

Here's what you need to do (From the manual) based on your example :

```
ee()->load->library('api');
ee()->api->instantiate('channel_entries');
ee()->api->instantiate('channel_fields');

//get the row to edit
$query = ee()->db->select('title, url_title')
    ->from('exp_channel_titles')
    ->where('entry_id', $entry_id)
    ->get();

if ( $query->num_rows() > 0 )
{
    $row = $query->row();

    $data = array(
        'entry_id' => $entry_id,
        'title' => $row->title,
        'url_title' => $row->url_title,
        'field_id_306' => '10'
    );

    ee()->api_channel_fields->setup_entry_settings($channel_id, $data);

    $success = ee()->api_channel_entries->save_entry($data, $channel_id, $entry_id, FALSE);

    if ( ! $success)
    {
        show_error(implode('<br />', $this->api_channel_entries->errors));
    }

```

Under the hood, you'll notice the main difference in loading the `channel_fields` library and the call to `setup_entry_settings` prior to the `save_entry` call.

It's quite convluted waht happens in `setup_entry_settings` but essentually it loads all the fields for the channel\_data table, I beleive it then then sets them to their existing value, or the default value, if they arn't present in the `$data` array, all under the hood.

Ref : https://docs.expressionengine.com/v2/development/api/api\_channel\_fields.html#Api\_channel\_fields::setup\_entry\_settings

Ref : https://ellislab.com/forums/viewthread/168319/#819749

Disclaimer : I have been using this lately in the context of create\_new\_entry but the logic is the same I understand.

**Scratch that** Ok, I've just gone ahead and actually read the function, it doesn't look like it does actually load the existing values however looking at `update_entry` (which is called from `save_entry`, it only builds the query using the columns in your data array, so as long as your entry\_id is set correctly (int the `$data` as well as in the `save_entry` parameter) it should update properly.

But please do let me know if it doesn't (with the channel\_fields part) please let me kno and I will adjust my understanding accordinly.

---
Tags: channel-entries, extension, channel-entries-api
---


# Question
Title: When should I use the embed tag over the dynamic/template tags?
Since Layout templates are so handy (cutting the template into interchangeable header/sidebar/footer, etc), why should our use an embed tag? Any ideas on when you should not use an embed tag over a layout tag?

# Answer
> 1 votes
One simple difference is that you can use only 1 layout template to do what takes at least 2 embeds to be done: header and footer code sections. Every template parsing you save counts.

You can use embeds for several things:

* to nest the same module inside itself or modules which have conflicting variables inside each other, because this can cause serious conflicts on the same template. Like a `exp:channel:entries` tag inside another one or a `exp:comment:entries` inside a `exp:channel:entries`;
* to have a different template cache time on an embed from the template it's loaded;
* to have similar templates loading at different URLs, if you are too scared of routes. Something like `/cars` and `/boats` loading the same template;

---
Tags: templates, ee3, layout-variables
---


# Question
Title: Is it possible to bypass required fields when using {freeform:submit_previous}
I've got an issue with Solspace Freeform whereby the required field error message is being triggered if the user chooses to go the previous page without entering any information on the current page. Is there any way to bypass this?

I already have a custom extension created which uses the `freeform_module_insert_begin` hook and contained within is a conditional for submitting to a previous page. Is there a function, or something, that I can use here to bypass the required field?

```
<?php
function checkup_method( $inputs, $entry_id, $form_id, $obj ) {
    if ( ee()->extensions->last_call !== FALSE ) {
        $inputs = ee()->extensions->last_call;
    }

    if ( get_class( $obj ) == 'Freeform' ) {

        $submit = 'submit';
        if ( isset( $_POST['submit_to_previous'] ) )
            $submit = 'previous';

        if ( $submit == 'previous' ) {

            // Custom code

        }

    }

    return $inputs;

}
?>

```

Thank you.

# Answer
> 0 votes
I've managed to get around this by hooking into `freeform_module_validate_end`. The hook in my question runs after the validation so I couldn't do anything with that. It simply clears any field errors on submitting to the previous page.

```
function checkup_override_required( $errors, $obj ) {

    if (ee()->extensions->last_call !== FALSE) {
        $errors = ee()->extensions->last_call;
    }

    if ( isset( $_POST['submit_to_previous'] ) ) {
        // Clear errors on submit to previous
        $obj->field_errors = array(); // This needs to be an array
    }

    return $errors;
}

```

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


# Question
Title: Multipage freeform pro append anchor to paging_url
I have a large multipage form on my site which is positioned in the middle of the page. After every page submission the page reloads which means the user has to scroll back down to proceed with the form.

I've been trying to add an anchor into the paging\_url attribute so that it automatically focuses on the form after the page reloads but it only appears to be working on the first page. Once I navigate past the first page the anchor is stripped from the URL on all subsequent pages.

```
paging_url="/{segment_1}/{segment_2}/%page%#screening-form"

```

Is there a way to get this to work using an anchor? Failing that ajax could be an option and instead of loading a new page it simply pulls in the next question into the page without the browser reloading?

I currently have a less than ideal solution using javascript, the problem being there is a brief moment where the form isn't in view on page load and the jump down to it is noticeable.

```
function moveWindow () {
    window.location.hash="screening-form";
}

```

# Answer
> 1 votes
I've managed to fix this using an extension I had created. It hooks into `freeform_module_insert_begin` which allows me to modify any of the data. With this I've been able to modify the next and previous params

```
function checkup_method( $inputs, $entry_id, $form_id, $obj ) {
    if ( ee()->extensions->last_call !== FALSE ) {
        $inputs = ee()->extensions->last_call;
    }

    if ( get_class( $obj ) == 'Freeform' ) {

        // Other stuff

        // Append anchor to these two bits
        if ( isset( $obj->params['multipage_previous_page'] ) ) {
            $obj->params['multipage_previous_page'] .= '#screening-form';
        }
        if ( isset( $obj->params['multipage_next_page'] ) ) {
            $obj->params['multipage_next_page'] .= '#screening-form';
        }

    }

}

```

**UPDATE**

I found out that this was causing errors on completion of the form so I've wrapped the `$obj->params['multipage_previous_page'] .= '#screening-form';` bits in conditionals to ensure that they exist before appending anything to them.

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


# Question
Title: Member management for EE 3 and Cartthrob 3
I am upgrading a EE 2 site with Carthrob to EE 3 with Cartthrob 3. I had been using FreeMember to handle registration, logins, password resets and the like.

I see that FreeMember has yet to be ported to EE 3 by DevDemon. I also see that they have acquired Zoo Visitor and updated it for EE 3.

In Cartthrob 3's documentation they say:

> Add-ons for member management In addition to using EE's built in member module, CartThrob is also compatible with Solspace User, Zoo Visitor, and our own product Profile:Edit. When Profile:Edit is installed CartThrob will can save customer data to your member channel entries automatically, in similar fashion to how it works with EE's member system.

Today, Cartthrob tech support responded to my question if DevDemon Visitor (and/or the new Zeal Smart Members) works with the current version of Carthrob by saying this:

> If Zeal and DevDemon Visitor use the standard ExpressionEngine member extension hooks, as Profile:Edit does, they should work properly with CartThrob. However, we haven't evaluated them to see; if there's a way to trial Visitor I'd definitely suggest that.
>
> Unfortunately Profile:Edit hasn't been updated for EE3 yet, and we don't have a timeline for doing it (and may not). So it's definitely worth looking at the other options!

I am wondering if anyone knows if DevDemon Visitor uses the standard member extension hooks?

Also, given that Cartthrob's documentation says that it is compatible with Zoo Visitor, am I right to guess that DevDemon Visitor is compatable with Cartthrob 3?

# Answer
I am developer of zeal smart members.

We have made plugin to make sure it uses the default ee methods for member registration, profile update etc.

It will call the default code while submit form and thus, default ee hooks can be use here. You can find documentation here.
> 1 votes

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


# Question
Title: Enabling the User to make different layouts on the site
How would I create different template HTML layouts for the user to pick/select when they want to make a new page on the site? Would I need a channel for each? Template group for each? I am aware there are multiple ways of doing this given the flexibility of EE. Can anyone assist a newb?

# Answer
> 2 votes
Right now, I can think on two options, but sure there is more. Everybody feel free to update this answer.

You can have a field for the user to choose between different designs.

## Multiple CSS

You can have multiple CSS.

```
{css_option}
    {layout:set name="custom_css"}{item}{/layout:set}
{/css_option}

```

Then on the layout template, you pick different CSS:

```
{if layout:custom_css}
    <link rel="stylesheet" href="/dist/css/{layout:custom_css}.css">
{if:else}
    <link rel="stylesheet" href="/dist/css/default.css">
{/if}

```

## Multiple embeds

On the default template you can have nothing but an `embed`.

```
{if template_option}
    {template_option}
        {embed="custom_designs/{item}"}
    {/template_option}
{if:else}
    {embed="pages/default"}
{/if}

```

Every embed can be a completely different template/layout/design.

# Answer
> 1 votes
Another possible solution is to use Structure which allows you to choose a template on a page-by-page basis. Structure allows you to define which template will be the default, but this can be changed to any template in the "Structure Template" dropdown. I use Structure in this way when I want to display the same content in a completely different HTML structure.

The solution from Robson Sobral is equally as valid, but you'll need to be much more creative when it comes to CSS.

---
Tags: templates, ee3
---


title: Member management for EE 3

text:
# Question
Title: Member management for EE 3
Does anyone know of any member management tools that are out for EE 3? I was hoping zoo visitor (now owned by devdemon) would be ported to EE 3, but that addon seems to have gone dark. And profile:edit which was also purchased by someone new has gone dark as well.

I preferred those addons to using the native member manager because of the flexibility in field types you could use. But with the lack of support behind any one member manager I may look to using the native tools to avoid any future problems.

Does anyone have any thoughts or other means they manager their website members?

# Answer
So I'm trying out the Solspace User plugin: https://solspace.com/expressionengine/user. If any other member plugins come online with EE3 I'll be sure to post it. I'm not sure solspace does all that I need ie custom field types for members but I think it'll provide some good member management benefits over the default EE system.

I do wish EE would add some more tools and power to the member management system. Annnywho.
> 2 votes

# Answer
Zeal smart members is new member management tool. This module is available in both EE2 and EE3. Have a look https://devot-ee.com/add-ons/zeal-smart-members
> 0 votes

---
Tags: zoo-visitor, devdemon, member-management, ee3
---


# Question
Title: Commenting is not available in this channel entry
I did a new entry on my web site today. For some reason, when I look at the comment page, it says "Commenting is not available in this channel entry." And, no comment form shows up. I checked the entry options and "Allow Comments" is checked. Other entries on this site don't have this issue. Any idea why commenting is not allowed?

# Answer
Figured this out. I checked the database, and this entry (in channel id 16) did have commenting turned on. But, there was another entry in a different channel (channel id 17) with an identical name/title, and it had commenting turned off. Somehow, EE got the two confused I guess. When I changed the name/title of the "other" entry (the one without commenting), then commenting on this entry started working.
> 0 votes

# Answer
You could try adding: channel="my\_channel", to your comment form tag where "my\_channel" is the short name of your channel, and see if that works. It seems to work for me, but I'll need to create some duplicate named entries to further test.
> 0 votes

# Answer
Have you tried this one? "cmt\_commenting\_has\_expired" =\> "Commenting is not available in this weblog entry.", I remember having the same problem at this website and it worked well. I hope it will help you.
> 0 votes

---
Tags: comments
---


title: No results not working

text:
# Question
Title: No results not working
I'm trying to display one entry with the search:field\_name parameter of ExpressionEngine. This works fine, but I can't get the no results tag to work. I have tried a lot of things, including the use of other things then exp:channel:entries. This is my current code:

```
        {exp:channel:entries
            channel="projecten"
            dynamic="no"
            search:project_trackcode="={freebie_2}"
            limit="1"
            require_entry="yes"
        }
            test
            {if no_results}
               Geen resultaten
            {/if}
        {/exp:channel:entries}

```

It doesn't matter if I set require entry to yes or no. The code does return entries if available, but when it doesn't find an entry, it doesn't even seem to enter the {exp:channel:entries}.

# Answer
> 1 votes
Late to the party here but my guess is because you have dynamic="no" so it will always return a result.

---
Tags: channel-entries, channel, search, no-results, freebie
---


title: show the {absolute_results} only once

text:
# Question
Title: show the {absolute_results} only once
If have a channel called 'scripts' and i want to display how many entries are in the channel filtered by the categorie they are in. For the category id 5 it should returns 4 entries. But it is displayed like 4 4 4 4. How can show the `{absolute_results}` only once?

```
{exp:channel:entries channel="scripts" category="5" disable="category_fields"}
    {absolute_results}
{/exp:channel:entries}

```

**Update** (full code):

```
{exp:channel:categories channel="scripts" style="linear"}
    {exp:channel:entries channel="scripts" category="{category_id}" disable="category_fields"}
        {if absolute_results == absolute_results}
            <strong>{absolute_results}</strong>
        {/if}
    {/exp:channel:entries}
{/exp:channel:categories}

```

# Answer
The channel entries loop run 4 times so you get repeated values.

Try something like this:

```
{exp:channel:entries
    channel="scripts" dynamic="no" category="5"
    disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks|relationships"
}
    {if count == total_results}
        {total_results}
    {/if}
{/exp:channel:entries}

```

Update based on question update involving categories tag pair:

You should go with query:

```
{exp:query sql="SELECT COUNT(ct.entry_id) as ab_results FROM exp_channel_titles ct JOIN exp_category_posts cp ON cp.entry_id = ct.entry_id WHERE ct.channel_id=29 AND cp.cat_id=65"}
    {ab_results}
{/exp:query}

```

Query module is required to run this.
> 0 votes

# Answer
I resolved it by using an Add-on called Construct Categories by Buzzingpixel.
> 0 votes

---
Tags: count
---


title: Import data from EE2 to EE3 site

text:
# Question
Title: Import data from EE2 to EE3 site
I am about to start work on a client site re-build.

The current site is running EE2. I plan on duplicating the site and then upgrading this duplication to EE3. The EE2 would continue to run as usual, with the re-build built on the duplication.

I am expecting the re-build to take around 3-4 months, in which time the live site will have a selection of new channel entries and members.

I need to find a way to bring over these new channel entries and members to the EE3 re-build site.

During the re-build, I will be modifying some of the existing channels. Some fields are going to be removed, possibly renamed or deleted. I will also be adding new fields.

Does anyone have any ideas if/how this can be done?

# Answer
There's no silver bullet unfortunately. I'd bring in the latest site to local. Upgrade local to V3. On local create/rename fields but don't delete.

Document every change to the channels & fields because once your local setup is ready you will have to set live to offline.

Then update to EE3 then update all channels & fields to match local. Then upload all new assets (templates, CSS etc).

It is a much talked about issue but there is no real solution, to my knowledge, other then what I've outlined.
> 1 votes

# Answer
Late answer i know... But i tend to always use Datagrab: http://brandnewbox.co.uk/products/details/datagrab
> 1 votes

---
Tags: ee2, ee3, import, export
---


# Question
Title: Local Copy of Expression Engine site is not showing changes
When I edit the files on my local copy, like the /project/templates/default\_site/main.group/layout.html file.

On my project local url the changes are not displaying, the site works but any changes I make or develop are not showing up.

Any Ideas, could it be cache? I did clear all cache multiple times.

Thank you in advance.

# Answer
Are you using a dynamic config bootstrap? If so (or even if not), check that your `tmpl_file_basepath` config variable is set correctly to match your local machine's path.
> 0 votes

---
Tags: development
---


# Question
Title: Confirmation page before finalising order in CartThrob?
Is it possible to create a confirmation page prior to the finalising the order in CartThrob?

The idea would be that the customer would enter in their billing/shipping details. Then a page will be shown with all of their billing/shipping details, alongside an overview of the order, asking them to confirm everything is correct. At this point, they could then enter the payment details to finalise the order, or go back to edit any details if necessary.

# Answer
> 1 votes
Yes, of course.

You can output anything relating to the cart contents using the `{exp:cartthrob:cart_items_info}` tag pair, and output anything relating to the user's personal details (including shipping info etc) using the `{exp:cartthrob:customer_info}` tag pair.

If you have any custom data held against the customer, you can fetch this with `{custom_data:your_var_name}` (having previously set it inside the `save_customer_info` form).

Then after all that just include `{exp:cartthrob:checkout_form}` tag pair somewhere to allow for final checkout.

---
Tags: cartthrob
---


# Question
Title: Get {count} for a Relationships field within a Grid field
How do I get count for this scenario? Each row returns "1":

```
{grid_field}
  {grid_field:relationships_field}
    {grid_field:relationships_field:count}
      // incorrectly shows 1 for each row
  {/grid_field:relationships_field}
{/grid_field}

```

Count works fine for the grid field.

EE 2.10.1

# Answer
Your code is right. You need to pass relationships field with grid prefix like this:

```
{grid_field}
  {grid_field:relationships_field}
    {grid_field:relationships_field:count}
      // incorrectly shows 1 for each row
  {/grid_field:relationships_field}
{/grid_field}

```
> 1 votes

---
Tags: relationships, grid
---


# Question
Title: Expresso Store on Expression Engine 3.4.2
I have purchased Expression Engine 3.4.2 and Expresso Store 2. However I can't get the addon to be shown in the add-on section with Expression Engine. After uploading it to several folders I started looking into the release notes of Expresso Store 2 and noticed that there are no notes about Expression Engine 3.4.2. Is it true that Expresso Store 2 is not compatible with Expression Engine 3.4.2?

# Answer
Looking on Devot-ee it looks like it's only supported by EE2. If it told you to install it using the /system/third\_party way then it's definitely EE2 only. EE3 plugins are installed in a different directory. You may want to look at CartThrob. Most plugin vendors offer a 30 day refund if it doesn't meet your needs, so you may want to look into that.
> 0 votes

---
Tags: expresso-store
---


# Question
Title: How to get file_id of file uploaded in Grid field
I have a grid field with rows containing files uploaded. These grid entries are output on a standard page but I need to access the filetype of the files uploaded and this only appears to be available in a '{exp:file:entries}' tag pair. How can I access the file\_id of the uploaded files in each row of the grid field in order to use a tag like `{exp:file:entries file_id="grid-row-file-id"}{filetype}{/exp:file:entries}`

# Answer
Have you tried a variable pair and the `{file_id}` variable inside it? But, by this way, you already have access to the mime type, using the `{mime_type}` variable.

```
{gallery}
    <figure>
        {gallery:image}
            <img src="{url}" height="{height}" width="{width}">
            <figcaption>mime type of file {file_id}: {mime_type}</figcaption>
        {/gallery:image}
    </figure>
{/gallery}

```
> 1 votes

---
Tags: grid, files
---


# Question
Title: Solspace Freeform, custom FieldType, and multidimensional array
Short question: In Freeform notification templates... where does it get its field data from? What's the best way to manipulate field data before the notification template gets a hold of it? Is there a custom FieldType method to use to process that data for the notification template?

Long question: There may be a better way to go about this but I'm attempting to build a custom FieldType for Freeform to accommodate inputs with multi-dimensional arrays. The user would be able to click an 'add employer' button to keep adding more employers to their work history. The reason why I'm going this route is to prevent having to create a hundred fields with names 'employer\_business\_1', 'employer\_zip\_1', 'employer\_business\_2', etc.

I've got a custom FieldType working great when placing the field data into the database, but I can't seem to get the data into a notification template. Where is the notification template getting its data from? My pipe separated data never makes it into my notification template.

I've embedded a template into my notification template so I can use PHP to manipulate the field data but it simply comes in as 'ArrayArray'.

An example of the form inputs:

```
<div class="employer_wrapper">

<label for="business">Place of Employment:</label>
<input type="text" id="business" name="employer_array[0][business]" value="" />

<label for="occupation">Employment Title or Position:</label>
<input type="text" id="occupation" name="employer_array[0][occupation]" value="" />

<label for="supervisor">Name and Title of Supervisor:</label>
<input type="text" id="supervisor" name="employer_array[0][supervisor]" value="" />

<label for="work_phone">Telephone:</label>
<input type="text" id="work_phone" name="employer_array[0][work_phone]" value="" />

<label for="employed_from">Employed From:</label>
<input type="date" id="employed_from" name="employer_array[0][employed_from]" value="" />

<label for="employed_to">Employed To:</label>
<input type="date" id="employed_to" name="employer_array[0][employed_to]" value="" />

<label for="starting_salary">Starting Salary:</label>
<input type="text" id="starting_salary" name="employer_array[0][starting_salary]" value="" />

<label for="ending_salary">Ending Salary:</label>
<input type="text" id="ending_salary" name="employer_array[0][ending_salary]" value="" />

<label for="address">Business Address:</label>
<input type="text" id="address" name="employer_array[0][address]" value="" />

<label for="city">City:</label>
<input type="text" id="city" name="employer_array[0][city]" value="" />

<label for="state">State:</label>
<input type="text" id="state" name="employer_array[0][state]" value="" />

<label for="zip">ZIP:</label>
<input type="text" id="zip" name="employer_array[0][zip]" value="" />

<label for="reason_for_leaving">Reason for Leaving:</label>
<textarea type="text" rows="5" name="reason_for_leaving" name="employer_array[0][reason_for_leaving]"></textarea>

```

```
<label for="business">Place of Employment:</label>
<input type="text" id="business" name="employer_array[1][business]" value="" />

<label for="occupation">Employment Title or Position:</label>
<input type="text" id="occupation" name="employer_array[1][occupation]" value="" />

<label for="supervisor">Name and Title of Supervisor:</label>
<input type="text" id="supervisor" name="employer_array[1][supervisor]" value="" />

<label for="work_phone">Telephone:</label>
<input type="text" id="work_phone" name="employer_array[1][work_phone]" value="" />

<label for="employed_from">Employed From:</label>
<input type="date" id="employed_from" name="employer_array[1][employed_from]" value="" />

<label for="employed_to">Employed To:</label>
<input type="date" id="employed_to" name="employer_array[1][employed_to]" value="" />

<label for="starting_salary">Starting Salary:</label>
<input type="text" id="starting_salary" name="employer_array[1][starting_salary]" value="" />

<label for="ending_salary">Ending Salary:</label>
<input type="text" id="ending_salary" name="employer_array[1][ending_salary]" value="" />

<label for="address">Business Address:</label>
<input type="text" id="address" name="employer_array[1][address]" value="" />

<label for="city">City:</label>
<input type="text" id="city" name="employer_array[1][city]" value="" />

<label for="state">State:</label>
<input type="text" id="state" name="employer_array[1][state]" value="" />

<label for="zip">ZIP:</label>
<input type="text" id="zip" name="employer_array[1][zip]" value="" />

<label for="reason_for_leaving">Reason for Leaving:</label>
<textarea type="text" rows="5" name="reason_for_leaving" name="employer_array[1][reason_for_leaving]"></textarea>

```

I'm using the save() method in my FieldType to turn the data into "|" separated text and store in the database:

```
public function save($data)
{

    if (is_array($data))

    {
        $data_string = "";

        for ($i=0; $i < count($data); $i++)
        {

            foreach ($data[$i] as $key => $val)
            {

                $data_string .= $key . "_" . $i . ": " . $val . "|";

            }
        }
    }

    $data = $data_string;

    return $data;

}

```

Since the notification template doesn't seem to pull that field data from the database table, what's the best way to manipulate that data before the notification template gets a hold of it? I don't understand where the notifications are pulling the data from and which function to use to process that data.

This is very similar to this post from 2 years ago except I'm attempting to utilize multi-dimensional arrays instead of a single array.

# Answer
> 0 votes
Incase anyone else runs into this matter in question, I did make it work. Now, I feel a little dirty with how I came about it but it's functioning great so far.

So, I ended up creating a custom FieldType called JSON, which uses the save method.

```
/**
 * store our data as json in the database
 * @access  public
 * @param   string data input
 * @return  string json
*/
public function save($data)
{
    // escape Tags, Apostrophes, Quotes, Ampersands, and Unicode
    $data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE);

    return $data;
}

```

For the notification email, I embedded an EE template within my Freeform notification in order to work with the JSON field data. The template has PHP Parsing set to Output. I then used a {exp:query} tag to query the form's database table to pull in the saved JSON, decode and parse it into my template. (I also passed in the {freeform\_entry\_id} to the embedded template to assist with the query.)

Notification Template:

```
{embed="freeform/employment_application" entry_id="{freeform_entry_id}"}

```

Embedded Template:

```
{exp:query sql="SELECT form_field_126 FROM exp_freeform_form_entries_31 WHERE entry_id={embed:entry_id} ORDER BY entry_id DESC LIMIT 1;"}

<?php

    // grab our stored JSON field
    $data = '{form_field_126}';

    // decode the json
    $data = json_decode($data, TRUE);

    // count number of employers and use for array
    $count = 1;

    for ($i=0; $i < count($data); $i++) {

        echo "<div style='border: 1px solid #DDDDDD; padding: 5px; margin: 5px;'";
        echo "<p><strong>Employer #$count</strong></p>";
        echo "<p>Employer: " . $data[$i]['employer'] . "<br />";
        echo "Occupation: " . $data[$i]['occupation'] . "<br />";
        echo "Supervisor: " . $data[$i]['supervisor'] . "<br />";
        echo "Phone#: " . $data[$i]['work_phone'] . "<br />";
        echo "Employed from: " . $data[$i]['employed_from'] . "<br />";
        echo "Employed to: " . $data[$i]['employed_to'] . "<br />";
        echo "Starting salary: " . $data[$i]['starting_salary'] . "<br />";
        echo "Ending salary: " . $data[$i]['ending_salary'] . "<br />";
        echo "Address: " . $data[$i]['address'] . "<br />";
        echo "City: " . $data[$i]['city'] . "<br />";
        echo "State: " . $data[$i]['state'] . "<br />";
        echo "Zip: " . $data[$i]['zip'] . "<br />";
        echo "Reason for leaving: " . $data[$i]['reason_for_leaving'] . "</p>";
        echo "</div>";

        $count++;

    }

?>

{/exp:query}

```

And there you have it. Multi-dimensional form inputs with Freeform using a JSON FieldType.

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


# Question
Title: How do I make a fieldtype use the full column width in the control panel?
I've coded a new fieldtype for my EE3 install. It works, but it doesn't look quite right in the control panel - the input fields only use up half of the available space. This looks fine for many fieldtypes, but I'd rather this stretch across the page, similar to a textarea or grid.

```
<fieldset class="col-group">
    <div class="setting-txt col w-8">
        <h3><span class="ico sub-arrow"></span>Fieldtype Name</h3>
    </div>
    <div class="setting-field col w-8 last">
        <label for="fto_field_id_21">FieldType Option</label>
        <input type="text" value="" name="field_id_21[fto]">
    </div>
</fieldset>

```

In Firebug, I can change the class **w-8** to **w-16** and get the desired look. However, I don't know where in my fieldtype definition I would set that. I dropped the following in my *install* method:

```
return array('field_wide' => TRUE);

```

While it is added to the fieldtype's global settings, it has no effect on how it is displayed in the control panel.

How can I get this full column width fieldtype? Thanks.

# Answer
> 0 votes
You're close! You need to save the `field_wide` setting for each individual field. You could either do this via a checkbox/radio setting in your field's `display_settings` method, or simply hard-code the value in your `save_settings` method:

```
function save_settings($data)
{
    return array(
        'field_wide' => 'y'
    );
}

```

---
Tags: add-on, control-panel, add-on-development, ee3, fieldtype
---


title: Custom Template route issues

text:
# Question
Title: Custom Template route issues
I have a template route like the following:

`/{static_country:regex[(zh|cn|usa)]}/{alpha_dash}` which matches a URI like `website.com/usa/about-us` fine and points to my template I've called `static` \- this works fine.

However, when I navigate to something like `website.com/usa/sdfsdfsdfsd` which is a **fake** route and isn't a route matching an entry in my channel, it still points to the first entry in the `static` channel instead of throwing a `404`.

I know I can limit this using regex like `/{static_country:regex[(zh|cn|usa)]}/{static_page:regex[(about-us)]}` but that isn't very dynamic if the client adds their own pages as we'd have to update the regex each time.

Is there a way around this at all?

# Answer
> 2 votes
## disclaimer

First things first: the documentation does not say it, but isn't advisable to use a route on the first segment. Why? I've no idea. This is something a former EllisLab developer told me.

---

## loading the entry

The Template Routes mess up with the automatic discovery of entries. From the docs:

> Template Routes overrides the default behavior of URLs, if you wish to use a Channel Entries Tag in your template you must manually provide segments for any parameters that are normally set in the URL. You must provide a segment for pagination, categories, and entry titles if you wish to use those in your Channel Entries Tag. Additionally, be careful when using `dynamic="yes"` with Template Routes, this can cause issues if your route does not have an appropriate segment set.

So, you need to deal with everything by yourself. Use the `dynamic`, the `require_entry` and the `url_title` parameters together with the `no_results` conditional.

Also, let's give your entry segment a name: `/{static_country:regex[(zh|cn|usa)]}/{entry:alpha_dash}`

```
{exp:channel:entries channel="static" limit="1" dynamic="no" require_entry="yes" url_title="{segment:entry}"}
    {if no_results}{redirect="404"}{/if}
    <h2>{title}</h2>
    {body}
{/exp:channel:entries}

```

## Require all segments

**If you need to set Require All Variables to `no`**, its default, you also need to prevent something like to match the second segment without the first one.

```
{if segment:static_country == ""}{redirect="404"}{/if}

```

And you need to prevent the `exp:channel:entries` from trying to look for an unparsed `{segment:entry}`. Putting everything together:

```
{if segment:static_country == ""}
    {redirect="404"}
{if:elseif segment:entry == ""}
    [...]
{if:else}
    {exp:channel:entries channel="static" limit="1" dynamic="no" require_entry="yes" url_title="{segment:entry}"}
        {if no_results}{redirect="404"}{/if}
        <h2>{title}</h2>
        {body}
    {/exp:channel:entries}
{/if}

```

Or, you can just enable the "Require all segments" setting.

## Without routes

Or you can create one `index.php` file for every language:

```
/public_html
    |
    |- /index.php
    |
    |- /zh
        |- /index.php

    |- /cn
        |- /index.php

    |- /usa
        |- /index.php

```

On every `index.php`, you can set variables related to the language they load

```
$assign_to_config['global_vars'] = array(); // This array must be associative

$assign_to_config['global_vars']['cv-language_code'] = "zh";
$assign_to_config['site_url'] = '/'.$assign_to_config['global_vars']['cv-language_code'];

```

---
Tags: channel-entries, url, ee3, regular-expressions
---


# Question
Title: How do I include an entry image in an RSS Feed?
A site (running EE 2.11.1) I am working on has the following RSS feed code:

```
{preload_replace:master_channel_name="blog"}
{exp:rss:feed channel="{master_channel_name}"}

<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>

    <title>The corecubed Blog</title>
    <link>{channel_url}</link>
    <description>{channel_description}</description>
    <dc:language>{channel_language}</dc:language>
    <dc:creator>{email}</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />

{exp:channel:entries channel="{master_channel_name}" limit="10" dynamic_start="on" disable="member_data|pagination"}
    <item>
      <title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
      <link>{title_permalink='blog/entry'}</link>
      <guid>{title_permalink='blog/entry'}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
      <description>{exp:xml_encode}{blog_body}{/exp:xml_encode}</description>
      <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    </item>
{/exp:channel:entries}

    </channel>
</rss>

{/exp:rss:feed}

```

Each blog entry has a photo associated with it and I would like to add it to the fee. I tried adding it using the following:

```
<![CDATA[<img src="{blog_image}" alt="{title}">]>

```

But that broke the feed.

Any suggestions would be helpful.

# Answer
## your simple typo

`<!\[CDATA\[` is closed with two brackets, `]]>`, not one, `]>`. ;-)

## a full explanation

Inside the `desciption` element, you can use HTML within a `<![CDATA[`:

```
<description><![CDATA[
    <img src="{blog_image}" alt="{title}">
    <hr />
    {blog_body}
]]></description>

```

Also, the `enclosure` element can be use to describe "a media object that is attached to the item". But not all parsers read it.

```
{blog_image}
    <enclosure url="{site_url}{url}" length="{file_size}" type="{mime_type}" />
{/blog_image}

```
> 1 votes

---
Tags: rss
---


title: Search box ability

text:
# Question
Title: Search box ability
I am new to EE. However, is it possible to create a search ability on a site without the need of an add-on? If not, what add-ons are good for creating a EE search ability for the site?

# Answer
> 0 votes
EE comes with search capabilities out of the box. https://docs.expressionengine.com/latest/add-ons/search/index.html

You'll need to make sure your channel fields are set as searchable, other than that the link above gives a few code examples.

Edit: If the default search doesn't do it for you then two big search add-ons are Low Search and Super Search

---
Tags: search, ee3
---


title: Edit a image upon uploading

text:
# Question
Title: Edit a image upon uploading
Is it possible to upload an image with the ability to edit it's opacity, screen tints, etc? (Not just cropping?) Do I really need an add-on for that?

-signed A Struggling novice of EE.

# Answer
You would need to use an add-on. A very powerful image adjustment add-on for EE is CE-Image.

As far as I am aware, there are no interactive image-editing add-ons for EE.

HTH
> 0 votes

---
Tags: ee3, file-manager
---


# Question
Title: Entry Handling - Categories/Status Group/Relationship Differences
I'm a novice at EE. What exactly are the difference between categories, status groups and Relationships within EE other they are all used for Entry organization?The documentation on EE for 3.3 is not very clear.

I have build at least two sites using EE and I have seen what you can do, but I struggle with explaining it clearly to others.

# Answer
I've tried to give an example of what you could use these for, I hope it helps. If not let me know and I'll try to explain further.

Categories - Let's say you're doing a product page with different types of shoes. You'll have a number of different entries, but you can use categories to divide these types of entries up. With categories set you can use your URL structure to also help you with filtering. Maybe you've got walking shoes, under $40, with special arch support. Your URL might look something like "http://shoesite.com/category/walking-shoes/under-40/arch-support". This way you can easily filter through the list of products with all of these categories and show them appropriately.

Status Groups - Status groups help you realize the state of an entry. For an e-commerce site think a product may go through stages such as Pending, Quoted, and Purchased. In ExpressionEngine you'd create a status group named Order Status, and add these three statuses. That way when someone is fulfilling an order they'd change the status so that everyone else is aware of the status of that order. Typically your entries will either be Open (meaning the entry is viewable to the outside world) or Closed (not viewable, but not deleted).

Relationships - Let's say that you're trying to feature one, or many of your shoes as a related product on another product page. You can use relationships to pull the data from these other entries and display it on another specific products page. You're able to filter what results you want relationships to return, which helps you get a little more granular in your options.
> 0 votes

---
Tags: categories, ee3, status
---


title: Upgrade install from EE2 to EE3?

text:
# Question
Title: Upgrade install from EE2 to EE3?
Do I need to have the latest version of EE2 installed before upgrading to EE3?

Thank you!

# Answer
> 4 votes
EE Recommends that you're on 2.10.1, this way you're less likely to run into issues. You'll want to make sure you have EE3 compatible plugins. The EE3 upgrade process requires you to change a lot of your EE2 files/directories to adhere to the new EE3 standards.

https://docs.expressionengine.com/latest/installation/upgrade\_from\_2.x.html

**Edited for clarity thanks to user1070143.**

---
Tags: upgrade
---


# Question
Title: Using hooks in EE3 calling methods in extensions from modules
I'm new to hooks, so pardon any ignorance in the questions...

So in my extension, (ext.staree.php), I have the following specifying the hook:

```
class Staree_ext
{
    public $hooks = array('channel_entries_row');
    ...

```

Then in the activation method, I have this:

```
public function activate_extension()
{
    foreach ($this->hooks as $hook)
    {
        $data = array(
            'class'     =>  __CLASS__,
            'method'    =>  'get_current_entry_id',
            'hook'      =>  $hook,
            'settings'  =>  serialize($this->settings),
            'priority'  =>  10,
            'version'   =>  $this->version,
            'enabled'   =>  'y'
        );

        // insert in database
        ee()->db->insert('extensions', $data);
    }
}

```

The `get_current_entry_id` is as follows: (Just to test right now)

```
public function get_current_entry_id($obj, $row)
{
    echo "<pre>";
    print_r($row);
    echo "</pre>";
    exit;
}

```

This gives me the following:

```
Array
(
    [entry_id] => 30
    [channel_id] => 5
    [forum_topic_id] =>
    [author_id] => 1
    [ip_address] => ::1
    ...

```

I need to get the current `entry_id` from my module `mod.staree.php`.

So inside my `Staree` class, I have the following method:

```
public function star()
{
    $testID = // (THIS is where I need the current id from the ext)

    $test = "Static return: 1, Passed Entry Id: ".ee()->TMPL->fetch_param('entry_id').", Dynamically Pulled Entry Id: ".$testID;

    return $test;
}

```

I know if I pass the `{entry_id}` like this: `{exp:staree:star entry_id="{entry_id}"}`, it will work by fetching the params, but I would like to just get it from the template wherever it is.

I'm close, but not used to working with hooks. Any help would be GREAT!

Thanks.

# Answer
> 0 votes
It's not going to work how you're wanting. The template parser is first going to parse `{exp:channel:entries}` and output all the entries, and THEN parse your `staree` module. So by the time your module parses, the channel entries parser is already finished outputting all the entries it's going to output and is out of the picture, so current entry ID isn't available to the module tag. But it is available to the extension as you see there, but you're not going to be able to get it at parse time within the module.

---
Tags: add-on-development, module, ee3, extension, hook
---


# Question
Title: Get the current entry_id from inside a module addon
I am working on an addon for EE3 and would like to be able to pull whatever the current {entry\_id} is to use inside the mod file without requiring the user to have to add it as a param.

Is this something that can be done? I feel like I have gone in circles through the docs as well as printing objects, etc...

I know I could do something like this:

```
{exp:my_module:my_method entry_id="{entry_id}"}

```

I would just like them to be able to use:

```
{exp:my_module:my_method}

```

and whatever optional params are wanted if need be.

Thanks

*** EDIT ***

@derek-jones pointed me in the right direction by sending me to the channel\_entries\_row in the Channel Module Extension Hooks here.

However, after reading through it, AND being new to hooks and how to use them, I am still unsure as to how to retrieve the data I am after. Any help in this would be greatly appreciated.

I created an extension for my module and in my hooks, I included it in the extension like this:

```
public $hooks = array('channel_entries_row');

```

(I placed it into an array so I can loop through all I end up using and adding them in one statement. I know it looks off here.)

So according to the docs...

How it’s called:

```
$row = $this->extensions->call('channel_entries_row', $this, $row);
if ($this->extensions->end_script === TRUE) return $tagdata;

```

So do I need to create a method inside my extension named the same as the hook? or create my own method and just call the hook?

So something like this?

```
public function channel_entries_row($this, $row)
{
    // Check if we're not the only one using this hook
    if (ee()->extensions->last_call !== FALSE) {
        $config = ee()->extensions->last_call;
    }

    // build the rows so we can get the entry_id
    $row = $this->extensions->call('channel_entries_row', $this, $row);

    echo "<pre>";
    print_r($row);
    echo "</pre>";
    exit;

    // The above are just there for trying to test right now...

    if ($this->extensions->end_script === TRUE) return $tagdata;
}

```

...and then call it from my module when needed?

Just trying to understand a bit here. I don't know if I need more coffee or what. ;)

# Answer
> 0 votes
The "how it's called" refers to how the application, ExpressionEngine, calls the hook, so you can see if your hook can return anything or if `end_script` can be set to end processing early. You should really never need to call your own hook unless your code is setup to be reusable in that way. You should just need to activate your hook, and then ExpressionEngine will call it when the event arises. So assuming you've successfully activated your hook (added your hook to the extensions table), the method you specify in your extension class, whether it be called `channel_entries_row` or whatever you call your method (doesn't have to be the same as the hook), will get called with the documented parameters for the hook. If the hook docs specify a return type, it tells you what your hook should return. For example, `channel_entries_row` allows you to modify the entry's data before it is printed to the screen, so you'd modify the `$row` variable and return it from your hook method. Hope this helps.

# Answer
> 0 votes
To fetch the data, you must have to pass the data. You should go with option 1

```
{exp:my_module:my_method entry_id="{entry_id}"}

```

You can fetch the entry id from your method by this code.

```
$entry_id = $this->EE->TMPL->fetch_param('entry_id');

```

---
Tags: add-on-development, module, ee3, parameters, entryid
---


# Question
Title: Expression Engine returns 404 on Javascript template
I have a bit of an issue with a project I recently took over using Expression Engine running v2.92 (I think). I'm pretty new to EE so maybe I'm missing something obvious.

The javascript template returns a 404 locally, but works fine on the production server. All the other templates (which are web pages) resolve fine. The database and files were downloaded directly from the production server and modified for my local system.

Things I've tried to no avail.

* Toggled Strict URL's in Template preferences
* Made sure the template path is correct for my local system
* Set the base url in config to my local system url in config/config.php
* Set the cachedir to my local path in config/database.php
* Set the proper URL's in Admin -\> General Configuration for root and themes
* Made sure the javascript templates are set to type of JS
* Checked the template routes, there doesn't appear to be anything here out of the ordinary.

This just doesn't make sense to me, I know it's reading the template files because if I edit one of the web page files directly the edit appears on the local site fine. It just acts like the javascript group doesn't exist at all. Am I missing something very basic here?

code linking the js template, this line lives in the footer of the templates that need this particular js file

`<script src="/javascript/products"></script>`

# Answer
> 0 votes
I don't know which is the difference between your local and remote environments, but I know that the link works on the remote one just by coincidence.

A `src` parameter value like `/javascript/products` points to a `products` file at a `javascript` folder on the site root.

If you want to load a template file saved together with all others EECMS templates, you need to use the `path` variable:

```
<script src="{path='javascript/products'}"></script>

```

In case of a css file, you've a specific variable for them:

```
<link rel="stylesheet" media="all" href="{stylesheet='channel/channel_css'}" />

```

This is necessary because is a good practice to keep your templates folder inaccessible to direct linking, for security. This way, you can keep it above the root.

Do you accept a suggestion? If your scripts and styles are purely static, put them outside EECMS template structure, for better performance.

---
Tags: templates
---


title: Dynamic return path using Freeform hook

text:
# Question
Title: Dynamic return path using Freeform hook
I have built an extension using the **freeform\_module\_insert\_end** hook according to Solspace Extensions documentation as I want the form to redirect to a custom url including a unique hash - but for some reason I cannot get the hook to fire. I have pasted the code below:

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

/**
 * Freeform Redirect Extension class
 *
 * @package        freeform_redirect
 */
class Freeform_redirect_ext {

    var $name            = 'Freeform Redirect';
    var $version         = '1.0.0';
    var $description     = 'Redirect to custom url';
    var $settings_exist  = 'n';
    var $docs_url        = '';

    var $settings        = array();

    /**
         * Constructor
         *
         * @param   mixed   Settings array or empty string if none exist.
         */
        function __construct($settings = '')
        {
            $this->settings = $settings;
        }

    /**
     * Activate Extension
     *
     * This function enters the extension into the exp_extensions table
     *
     * @see https://ellislab.com/codeigniter/user-guide/database/index.html for
     * more information on the db class.
     *
     * @return void
     */
    function activate_extension()
    {
        $this->settings = array(
            'max_link_length'   => 18,
            'truncate_cp_links' => 'no',
            'use_in_forum'      => 'no'
        );

        $data = array(
            'class'     => __CLASS__,
            'hook'          => 'freeform_module_insert_end',
            'settings'  => serialize($this->settings),
            'priority'  => 10,
            'version'   => $this->version,
            'enabled'   => 'y'
        );

        ee()->db->insert('extensions', $data);
    }

    /**
     * Disable Extension
     *
     * This method removes information from the exp_extensions table
     *
     * @return void
     */
    function disable_extension()
    {
        ee()->db->where('class', __CLASS__);
        ee()->db->delete('extensions');
    }

public function freeform_module_insert_end($inputs, $entry_id, $form_id, $obj)
{
    if ( ! $obj->edit AND
         ( ! $obj->multipage OR
            ($obj->multipage AND $obj->last_page)
         )
    )
    {
        $obj->params['return'] = 'thank-you/'.ee()->input->post('unique_hash');
    }
}

    // --------------------------------------------------------------------

} // End Class Freeform_redirect_ext

/* End of file ext.freeform_redirect.php */

```

# Answer
You are also missing a method call to match the hook 'method' =\> 'freeform\_module\_insert\_end', in your $data array. Uninstall and reinstall the extension.
> 0 votes

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


# Question
Title: stash embed in expression engine layout not parsing
I would like to embed my ads by a stash embed inside of my base template, is this not possible to achieve thay way?

`{layout:set name="backgroundAd"}
 {stash:embed context="ech/ads" name="background" stash:seg="{segment_1}"}
 {stash:embed context="ech/ads" name="interstitial_floating" stash:seg="{segment_1}"}
{/layout:set}`

# Answer
> 0 votes
It should work if you prefix the embeds with 'exp:'

```
{exp:stash:embed}

```

---
Tags: stash, ee3, embeds, layouts
---


title: Use transcribe in custom add on

text:
# Question
Title: Use transcribe in custom add on
Wondering if there is a way to use transcribe add on for expression engine in another add on.

So ideally I would want to use the command that I would use in a template {exp:transcribe:replace name="variable"} in a library page of a custom add on that I developed.

The reason is I am building a single page app that gets all of it's content from ajax calls. So the page will call an add on I built that does the api call and returns the content in json format. Ideally I would make the translation in that add on so it is already translated once the json is returned to the page. From there Handlebars is building the page with the json object.

I am hoping there is a fairly straight forward way of doing this as I am fairly new to expression engine.

My alternative plan is to make a call and grab all variables for a given language and create an object or array out of it and then cycle through it when I need to translate something. This is not ideally how I would want to do it though as it feels like a hack.

# Answer
> 0 votes
Yep, shouldn't be a problem. You'll need to load the class:

```
if ( !class_exists('transcribe') ) {
    require_once PATH_THIRD.'transcribe/mod.transcribe'.EXT;
}
$transcribe = new Transcribe;

```

You can then call the public functions from that class:

```
$transcribe->replace();

```

But I don't have access to Transcribe source to go much further in explanation. The challenge you'll have is that the replace tag requires a parameter (name).

If you were using a template tag that matches the same parameter names, it should just work and the transcribe method will pull the parameters from your template tag. But because you're calling via Ajax, I'm assuming your end point is to the module itself, not another template - so this won't help.

When I build add-on methods I always allow them to be called as functions, allowing the tag parameters to be passed as method parameters. Without seeing the Transcribe method, I can't confirm how flexible the developer has coded it, but ideally this could work:

```
$transcribe->replace("keyForTranslatedVar");

```

You might also find that the developer calls additional functions from their replace method and so instead you can call them directly, although they could be private. You may also be able to tap directly to the database functions.

If (worst case) the only way to get the value pairs into the method is via tag parameters, you could try manipulating the tag data, so that you've placed the parameter there already - so manipulating the `ee()->TMPL->tagdata` data. Their replace function will access it thinking it's come from a normal template tag parse.

---
Tags: transcribe
---


# Question
Title: Assets Image Path Issue with Wygwam on Front-end/View Entry Page
EE 2.6.1
Assets 2.3.1
Wygwam 3.3

We are having an issue where images from Assets are added to a Wygwam field, but do not display on the front-end or view entry page after save. They do appear fine within the Wygwam field on the Publish/Edit page.

A screenshot and corresponding HTML output looks like the following:

```
<img alt="" src="{assets_32:http://mydomain.com/uploads/myimagename.png}" style="width: 491px; height: 208px;">

```

I tried implementing the fix found here, but it did not resolve the issue. The assets tag is still not parsing.

# Answer
I believe this is the same problem as in this thread. Low's solution should help you. He said:

> To make sure extra processing is done before the var is put in the template, use the tag syntax rather than the variable syntax: `{exp:low_variables:single var="my_wygwam_var"}`

So try using `{exp:low_variables:single var="my_wygwam_var"}` Rather than `{my_wygwam_var}`
> 0 votes

---
Tags: ee2, assets, wygwam
---