title: Template Not Detecting Plugin Class?

text:
# Question
Title: Template Not Detecting Plugin Class?
Working on a plugin integrating with the Active Campaign API.

What I have is a folder inside third\_party containing pi.ActiveCampaign.php with a lib folder containing the API. The class describing the plugin is "Active\_Campaign" and the function I want to use with it is "insert\_contacts." The plugin appears in the add-ons section just fine, with all my documentation, but when I try to use it in a template:

It appears to not be detecting it. I've tried just using "exp:insert\_contacts" as well, same result.

Here's the PHP file, as it is now, if needed (bitbucket repo): https: https://goo.gl/Shm4JN

And for reference, here's the doc I'm following: https://ellislab.com/expressionengine/user-guide/development/plugins.html

jic.

Any advice?

# Answer
> 0 votes
FOUND IT!

I feel stupid. It was a case sensitivity issue with the file name. It was pi.ActiveCampaign.php but needed to be pi.active\_campaign.php.

---
Tags: templates, php, plugin
---


# Question
Title: Solspace User - Allow non-SA to send Key Invite?
Does anyone happen to know of a way to allow member groups other than Super Admins to send key invites via User from Solspace?

Their docs state that it's SA only, but I had four separate user groups that need to be able to access this function via the front end while not having CP access, thus they can't be Super Admins.

Anyone else run into this and/or discover a workaround?

# Answer
> 1 votes
For security reasons, we have limited the Key Invite feature to Super Admin's only. If you wanted to adjust this on your own, you would have to modify the code in **mod.user.php** around **line 9310**:

```
/** ----------------------------------------
/** Is the current user logged in?
//  are they an admin? must be admin
/** ----------------------------------------*/

 if ( ee()->session->userdata('member_id') == 0 OR ee()->session->userdata('group_id') != 1)
 {
 return $this->_output_error('general', array(lang('not_authorized')));
 }

```

---
Tags: members, solspace-user, groups, super-admin
---


title: Conditional Not Working

text:
# Question
Title: Conditional Not Working
I have an events listings. Events are by “start\_date”. When I have no events I want to display “NO EVENTS SCHEDULED” When I have events I want to remove the NO EVENTS SCHEDULED. I can’t seem to get the conditionals right. Need help, can not seem to get my head around it.

```
{exp:channel:entries channel=“Events” sort="asc" orderby="start_date"}
{if star_date == ""} <h1>No Events Scheduled</h1>{/if}
{if start_date} <h4><strong>{title}</strong></h4>{/if}

{start_date format="%l, %F %j, %Y; %g:%i %a"}</><br>
{rentals_main_copy}
{if start_date} <span>New Vic, 33 W. Victoria Street, Santa Barbara, CA, 93101 (<a href="/visit/location">map</a>)</span> {/if}
{if start_date}<hr class="bottom-2">{/if}

 {/exp:channel:entries}

```

# Answer
> 2 votes
You could use the search & no\_results tag like this and do away with the multiple `{if}` statements:

```
{exp:channel:entries channel="Events" sort="asc" orderby="start_date" search:start_date="not IS_EMPTY" }
  {if no_results} <h1>No Events Scheduled</h1>{/if}
  <h4><strong>{title}</strong></h4>{/if}

  {start_date format="%l, %F %j, %Y; %g:%i %a"}</><br>
  {rentals_main_copy}
  <span>New Vic, 33 W. Victoria Street, Santa Barbara, CA, 93101 (<a href="/visit/location">map</a>)</span>
  <hr class="bottom-2">

 {/exp:channel:entries}

```

---
Tags: conditionals
---


title: Low Search not displaying all results

text:
# Question
Title: Low Search not displaying all results
I'm using Low Search on my site and it's not displaying all results. I've rebuilt the index and lexicon. I'm testing this with one product. If I go to the products page I see product but if I try and search for it, no result for the title. Here is the code for the results page.

```
{exp:low_search:results
                    query="{segment_3}"
                    channel="products"
                    limit="15"
                    name="range:tags"
                    dynamic="off"
                    orderby="release_date"
                    sort="desc"
                }

                  {if count == 1}
                    <p>
                    Searched for <strong>{low_search_keywords}</strong>.
                    Search results: <strong>{absolute_results}</strong>
                    </p>
            {/if}

                {if count==1}<ul class="thumbnails">{/if}
                    {switch="<div class='row'>||"}
                    <li class="span3">

                <div class="thumbnail">
                    {if product_thumbnail}
                            <a class='' href="{entry_id_path='{template_group}/product_detail'}"><img src="{product_thumbnail}" /></a>
                    {if:else}
                    <a class='' href="{entry_id_path='{template_group}/product_detail'}"><img src="http://placehold.it/300x200" alt=""></a>
                    {/if}
                    <div class="caption">
                        <h4>{title}</h4>
                    </div>
                </div>
                </li>
                {switch="||</div>"}
                    {if count==total_results}</ul><!-- end row -->{/if}
                    {paginate}
                        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>

                     {if previous_page}
        <a href="{auto_path}">Previous Page</a>
    {/if}
    {if next_page}
        <a href="{auto_path}">Next Page</a>
    {/if}
                    {/paginate}

                    {if no_results}
                        <p>Sorry, nothing found.</p>
                    {/if}
                {/exp:low_search:results}

```

Any idea what I'm doing wrong?

# Answer
> 5 votes
If Low Search is giving no or not all results, check the following things:

### Native default parameter values negating search results

The Results tag extends the native channel:entries tag, so default filtering is in place:

* `status` will be limited to `open` only;
* `show_future_entries` will be set to `no`;
* `show_expired` will be set to `no`.

In 9 out of 10 cases, the status is not explicitly given, so only open entries are shown.

### Searchable fields are not weighted

For Keyword searches, the keywords must be present in the index. For words to be present in the index, the fields must have **weight of at least 1**. In order to give fields weight, create a collection for it. In order for a field to show up in the collection details, it must be marked as Searchable in the field settings.

### Very small amount of data in the index

The way keyword searches work (or to be more precise, MySQL full-text searches), means keywords shouldn't be "common". They are considered common if they appear in more than half of the index. Usually, this isn't a problem at all. However, when you're just setting up a site, and you have very few entries indexed with the same keywords, it's possible those keywords are considered common by MySQL, and will therefore not match a search query. Having more data/entries will solve the problem.

### Other trouble shooting tips

Low Search uses the Template Debugger extensively. If you're getting unexpected results, turn it on, and look up any lines that mention Low Search or low\_search. That should give you some more insight as to what is going on.

---
Tags: low-search
---


title: Categories loop with custom field

text:
# Question
Title: Categories loop with custom field
I'm trying to display a custom field within a categories loop (Channel Form). The `{category_name}` outputs just fine but ExpressionEngine refuses to render the custom field `{category_custom_field}`. (The custom field does work with `exp:channel:categories`.)

```
{categories show_group="5" parse="inward"}
  <option value="{category_id}" {selected}>
    {category_custom_field}
  </option>
{/categories}

```

# Answer
As per the docs for the Channel Form custom fields are not loaded.

You mention the solution though, we can wrap the bit where you need the custom field in an `exp:channel:categories` tag so you can load the custom tags. We do it this way so we can preserve the `selected` tags too

```
{categories show_group="5" parse="inward"}
  <option value="{category_id}" {selected}>
      {exp:channel:categories channel="1" style="linear" show="{category_id}"}
        {category_custom_field}
      {/exp:channel:categories}
  </option>
{/categories}

```

*You don't quote what channel the entry form is for so I use 1 in the example above.*
> 2 votes

---
Tags: categories
---


title: Set Entry ID & Member ID's higher

text:
# Question
Title: Set Entry ID & Member ID's higher
Hoping this is possible.

I want to set my entry\_id and member\_id numbers higher. Meaning when the next entry is entered or a member joins it goes to the new higher # I set. Right now my entry ID is at 271, I would like to put that at 1001 for the next entry ID entered. Also do the same for members, not so high but at least 100. I tried (ALTER TABLE exp\_channel\_data AUTO\_INCREMENT = 1001) but if simply kept the next number in line 272.

So can it be done, right now I have no members, I am just testing, I have a complete backup of everything.

Is it safe, is it possible without sending EE into a crash? Thanks.

# Answer
> 3 votes
It is possible, and I think it's safe but as you are doing make sure you backup test and roll back if you get unextpected results. (Is it safe??? lol)

You where almost rigth with what you did before, however `exp_channel_data` is not the indexed table for channel data, you want `exp_channel_titles`, these are your 2 queries :

```
ALTER TABLE `exp_channel_titles` AUTO_INCREMENT = 1001

ALTER TABLE `exp_members` AUTO_INCREMENT = 101

```

I did a quick test on my local sandbox and it seemed to work.

---
Tags: database
---


title: If statement is rendering to screen

text:
# Question
Title: If statement is rendering to screen
I am trying to check if a variable exists, and render it only if it does. Using the code below, the "{if facebook\_content..." etc renders to the screen, curley braces and all, rather than actually checking for this conditional. Its like it doesn't get processed at all. Why is this happening and how can I actually do this?

```
    {exp:stash:get_list name="st_facebook_feed_list" parse_tags="yes" process="end"}
                <a target="_blank" href="{facebook_url}">
                    <span class="feed-text">
                        {if facebook_content != ''}
                            {facebook_content}
                        {/if}
                    </span>
                </a>
    {/exp:stash:get_list}

```

# Answer
I beleive you can get some info from this ist : https://gist.github.com/croxton/9d012297096892ca5c10

The premise is the insides of the stash tag is parsed at the stage the module tags are parse, whereas conditionals are passed before (simple) and after (advanced).

Have you tried messing about with `{exp:stash:parse}` inside the `get_list` tag pair?

Also, what are your results when you call `get_list` without the `process="end"` parameter? I believe this may move the parsing of the inard of your tag to after all the conditional steps, ergo no evaluation. Of course you don't show us where you set the list so I couldn't debug the parse order any further.
> 1 votes

---
Tags: templates, template-scripting
---


# Question
Title: using "if else" conditionals with Channel Images
I'm trying to make a "previous" button link dependent on a couple of conditions: 1) if there's a previous image, it links to that; 2) if there is no previous image, it goes to the main portfolio page. Here's my basic code:

```
{image:paginate}
        {if image:previous_page}<a href="{image:auto_path}">
        {if:else}<a href="{site_url}portfolio">{/if}
            <img src="{site_url}images/arrow-back.png" alt="previous"></a>
{/image:paginate}

```

But when I try this, I get an error code:

```
Parse error: syntax error, unexpected T_ELSE....

```

Any thoughts on either what's wrong or how to do this properly?

Thanks in advance....

# Answer
> 0 votes
I think I see what the problem is now. I looked more closely at the documentation, and for the `{image:previous_page}` tag it says

> This tag will conditionally display the code inside the tag if there is a “previous” page. If there is no previous page then the content simply will not be displayed. (In the {image:paginate} tag pair)

So I think since there is no "previous" page, then the `{if:else}` part is not displayed (at least this is my theory). So what I've done to make this work is this:

```
{image:paginate}
    {if image:previous_page}<a href="{image:auto_path}">{/if}
    {if {image:current_page} == 1}<a href="{site_url}portfolio">{/if}
        <img src="{site_url}images/arrow-back.png" alt="previous"></a>
{/image:paginate}

```

This is working for me. I do recall at some point that `{if:else}` was just not working in Channel Images, and when I was pursuing the question some time ago, there was never a resolution. I don't know if `{if:else}` will work now in Channel Images or not (I have 5.14.8). But with the new support system from DevDemon, I'd have to pay to find out.

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


# Question
Title: Override inclusive_categories="yes" with search string?
Is it possible to override the inclusive\_categories parameter with a search string? I want to use inclusive\_categories for every case except for when a search string is passed to the results template. For example, this is my template:

```
{exp:super_search:results inclusive_categories="yes"}
    Results
{/exp:super_search:results}

```

And I want to pass a search string to the results template and set inclusive\_categories="no". So I tried this string which does not work:

```
/search/locations/search?&channel=locations&XID={XID_HASH}&category=category1+category2&inclusive_categories=no

```

Any ideas on how to approach this?

# Answer
> 0 votes
Please excuse my ignorence if I've got you wrong, but are you simply asking how to get a value from the URL and put it into the *results* tag parameters?

I'm not 100% familiar with super search however I assume it allows the rest of the URL to be processed as a search request? channel, category, XID (ect)?

Also, in your code example you are seperating parameters with `&`, is this in fact `&`?

Back to the question and assuming the above, you could use PHP to query the GET values, set your template to PHP on Input :

```
<?php
    $incCat = strtolower( ee()->input->get('inclusive_categories', true) );
    $incCat = !in_array($incCat, array( 'no', 'false', '0', 'off' ) );
?>

{exp:super_search:results inclusive_categories="<?php echo ( $incCat ? 'yes' : 'no' ); ?>"}
    {!-- Results --}
{/exp:super_search:results}

```

# Answer
> 0 votes
You could use an if statement to override the inclusive\_categories parameter.

If your search string is in the url and assuming inclusive\_categories has "no" as a default value, you could do something like this:

```
   {exp:super_search:results {if segment_x}inclusive_categories="yes"{/if}}
    Results
   {/exp:super_search:results}

```

---
Tags: supersearch
---


# Question
Title: Low Search excerpt not rendering in Low Search Results
I'm not exactly sure why, but {low\_search\_excerpt} is not rendering in my search results:

```
{exp:search:results collection="careers|doctors|locations|patient-stories|services|specialties|static" status="open" limit="10" dynamic="no" paginate="both" status="open" keywords:inflect="yes" keywords:lang="en" keywords:mode="auto" keywords:loose="right" keywords:stem="yes"}

    <p>{low_search_excerpt}</p>

{/exp:low_search:results}

```

Things I've tried:

1. I've chosen an excerpt for each collection listed.
2. I went to each channel and verified that the correct field is chosen for an excerpt
3. I rebuilt the index and lexicon for each collection listed.

I appreciate any help you can offer!

UPDATE

I ran the query in the link you sent:

```
SELECT * FROM exp_extensions WHERE hook = 'channel_entries_query_result'

```

The following extensions using that hook are:

* Assets\_ext
* Low\_search\_ext
* Ep\_better\_workflow\_ext
* Low\_reorder\_ext
* Super\_search\_ext
* Low\_alphabet\_ext

This is my form code:

```
{exp:low_search:form
    result_page="/search/doctors/"
    collection="doctors"
    form_id="doctor-ajax-filter"
}

<input type="search" name="keywords" placeholder="Search for a physician name, condition or location..." value="{low_search_keywords}">
<button type="submit" class="button button-postfix-search"><i class="fa fa-search"></i></button>

... NOTE THAT I HAVE THE RESULTS TAG INSIDE THE FORM TAG. I NEEDED TO DO THIS BECAUSE OF THE WAY THE PAGE IS STRUCTURED

{/exp:low_search:form}

```

Could it be that I'm getting a conflict between Super Search and Low Search? The reason I have SS enabled is that I'm in the process of stripping it out all together and replacing it with your much awesomer search! Or, do you think it's because I have the form tag wrapping the results tag?

# Answer
> 0 votes
I managed to answer my own question. The reason it was not working is because I was wrapping the low\_search:results tag with the low\_search:form tag. Apparently this causes the excerpts to break. The page in question does not require that I structure my code this way, so I can easily fix. Is this a bug, or expected functionality?

---
Tags: low-search
---


title: Save As File & Low Variables

text:
# Question
Title: Save As File & Low Variables
To start I checkboxed "Save As File" for everything. EE Templates and Low Variables. I was reading on performance and from what I can tell, doing that, save as file is a performance drainer. Can anyone verify that, should I uncheck the option?

# Answer
Lol wut? Unless your database is behind a caching service (like memcache) and therefore loaded in memory, grabbing your files from your database is much more overhead. Where do you think database files are stored ;) ? They are on hard drives too. A well tuned, cached database would be faster for reads, but if you don't have that going on, saving as a file is much better. It also allows you to edit your template files with the editor of your choice, and well as set your templates in a repository.

Save as file is undoubtedly way better than just hitting the database. The only place it hurts is if you use the EE template editor, than on write you'll be hitting both the database and writing the file, but seriously, are you saveing templates through the EE template editor at a rate of 20 or 30 times a minute all day? Nope. Reads, however, just hit the file (when someone visit a page on your site). Which is definitely faster.
> 1 votes

# Answer
Enabling Save As Files in Low Variables does have a slight performance impact. In order to tie in to native EE functionalities, LV needs to update the native `exp_global_variables` table with the data gathered from the files. This means, in contrast to what jchrono-battle is saying, EE does not load from the DB *or* filesystem, as far as LV is concerned. Rather than that, the files are synced from/to the DB and then loaded from the DB later on in the process. When not saving as files, the first step is skipped.

My advice would be to use the Save As Files option only in development environments, and don't use it in production sites.
> 3 votes

---
Tags: templates, low-variables
---


# Question
Title: Error when upgrading to 2.10.1 - Site not working
My site, which was running 2.9.x, was delivering a blank page today. In the past, I've found that getting the current version was the first step to debugging.

So, I decided to start by upgrading to the current version of EE. After following the directions and clicking on the Upgrade button, I received the following error:

```
Error Number: 1

Can't create/write to file '/tmp/#sql_26a4_0.MYI' (Errcode: 30)

SHOW COLUMNS FROM `exp_sessions`

Filename: /home/bp/public_html/ee_cms/expressionengine/libraries/Smartforge.php

Line Number: 122

```

Oh, crap. Please help.

# Answer
You are having a weird disk corruption issue, here ya go homie:

http://thecancerus.com/how-to-fix-mysql-error-error-code-30/

You need control of your server for this fix. If you have control, back things up and go for it, if not, you should nicely ask your hosting partner to look into this issue.
> 1 votes

---
Tags: upgrade
---


title: Multiple Channel Entries on homepage

text:
# Question
Title: Multiple Channel Entries on homepage
Noob question, but trying to get all channels to show single entry by latest date on the homepage of the site. User guide says leave blank and will default to all, but no luck. I have 71 channels and doing all of them would be a real bear.

thanks in advance.

# Answer
Like Michael said, 71 channels seems like alot! sounds like you wanted to categorise similar entries instead of seperating by channel! However...

> Ours is not to reason why, ours is but to do and die

SO, here's your solution. I use SQL to draw the 'Maxed' entries out of the DB (grouped by channel), from this I can then populate a single `exp:channel@entries` loop. We need to use some PHP on the template, and it needs to be on *input* so we can use it to populate our entries tag :

```
<?php
  //get the entry_ids for the max entry date, by channel
  $res = ee()->db->query('
    SELECT entry_id
    FROM (
      SELECT *
      FROM exp_channel_titles
      ORDER BY entry_date DESC
    ) AS a
    GROUP BY channel_id
    ORDER BY channel_id ASC
  ');

  //concatenate the results into a string
  $eids = "";
  if ( $res->num_rows() > 0 ) {
    $eids = implode("|",$res->result_array());
  } else {
    //break the string of entry id's if we have no results
    $eids = "XX";
  }
?>

{exp:channel:entries dynamic="no" fixed_order="<?php echo $eids; ?>"}
  <h1>{title}<sup>{channel}</sup></h1>
  <a href="{url_title_path='group/template'}">permalink</a>
{/exp:channel:entries}

```

*PHP **ON** on **Input***

Have fun!

*references*
> 1 votes

---
Tags: multiple-channels
---


title: How to remove <p> tags from WYGWAM

text:
# Question
Title: How to remove <p> tags from WYGWAM
I'd like to know how to remove automatic

wrapping tags that outputs in page.

```
<p class="summary">{sous_titre}</p>

```

This is what I wrote inside my template. As you can see, I already put myself a

tag with a class summary. But in the code source of my page, this is what I get

```
<p class="summary"></p>
<p>My text bla bla bla</p>
<p></p>

```

I really don't understand that messed up right there. Tho, I just wanted to output what's inside my wygwam..anyway, so I did some research around forums and found out that I should go in WYGWAM advanced settings and set autoParagraph to No. I did that and I still get the same f%^&\* results.

Can anyone fixed this once?

Thx

# Answer
> 1 votes
Sounds like the parameter text\_only="yes" should sort you out. Documentation.

# Answer
> 1 votes
You might go about this using an add-on, using CE String or free add-ons, Remove HTML, SuperGeeky Tag Stripper.

I use CE String personally, but the others will do just as well.

# Answer
> 0 votes
Take a look at that channel field's settings. You need to edit this section to be "None". When you change it, **make** sure you say yes to reformatting all of your entries for channels that have that field group assigment to fix previous entries. To be safe, **back** up your channel\_entries data tables before making this change.

But this will allow your text fields to output without p tags!

---
Tags: wygwam
---


title: missing cookies after upgrade to 2.10

text:
# Question
Title: missing cookies after upgrade to 2.10
after upgrading from v2.1.3 to v2.10 i am no longer seeing several cookies including exp\_uniqueid, exp\_userhash, and exp\_memberid. I can only seem to log into the admin CP and not the site anymore.

# Answer
> 1 votes
I'm going to jot down what I have in my bog standard 2.10.1 install, after logging in. My install is fully working.

* PHPSESSID (for finding server session)
* exp\_sessionid (for finding your ee session)
* exp\_csrf\_token (for Form anti-forgery)
* exp\_expiration
* exp\_last\_activity
* exp\_last\_visit
* exp\_perpage
* exp\_tracker

I think the 'missing' cookies are actually a good thing! With them MITM attacks and other personal information gathering vectors could be used. I beleive EE now uses a more standard principle of toring your session in the DB, the session vars in your PHP session, and just a couple of reference fields for matching are sent via cookies (noted above).

This method is way more secure, yes we have a couple of nuggets of info but these are de-personalised. i.e. if I visited your machine while you were taking a 'toilet break' I could lift your cookies, they'd tell me when *someone* was last on the site on your computer, but doesn't tell me anything about what user it was...

Of course we don't have an answer yet as to why your login Is not working. We need to check the basics first (sorry):

1. Clear Cache, Clear Cookies, Go Private Browsing, authenticate and monitor the cookies sent
2. Please can you check and let us know your Security Settings (`Admin > Security & Privacy > Security & Sessions`)

---
Tags: upgrade, ee
---


# Question
Title: How can I set up a click and collect type of shipping option where a customer collects their order from us
I want to offer people shopping on my Xpresso Store the option of collecting their order from our HQ. I call this 'Click and Collect'. So basically they select this option when checking out and no shipping costs are charged, instead they simply come and pick them up. Thank you

# Answer
it would be preferable if you look at the Documentation before asking. I don't know this extension, but on this page:

https://www.exp-resso.com/docs/settings\_shipping\_methods.html

it seems clear that you can just create a shipping method with no shipping cost and title it "Click and Collect".
> 0 votes

---
Tags: shipping
---


# Question
Title: Outputting date variables with formatting in Channel Form
I'll preface this by saying that I am asking for information, not a coding solution. At this point, it is unclear to me why EllisLab would intentionally do this.

I'm creating an edit form for a channel entry. Inside my `{exp:channel:form}` loop, which works, I try to output a date variable with specific formatting.

When I output the date variable **once** with a format parameter...

`{p_date_available format="%Y-%m-%d"}`

...the variable is not parsed on the front-end. **However**, if I place the date variable in my template **twice**, once without the format parameter and once with the format parameter, my problem is solved. Placement of these two instances of the variable is irrelevant.

Can anyone provide an explanation as to why the channel form tag does this?

**EDIT:** Here is a snippet of the code for understanding the parse order:

```
{exp:channel:form channel="product" class="styled-form" return="dashboard" datepicker="no" url_title="{segment_3}" require_entry="yes"}
    {exp:store:product entry_id="{entry_id}"}
        <input type="date" id="p_date_available" name="p_date_available" value="{p_date_available format="%Y-%m-%d"}" required/>
        <!-- put here to force EE parsing of formatted date variable-->
        <input type="hidden" value="{p_date_available}"/>
    {/exp:store:product}
{/exp:channel:form}

```

# Answer
> 0 votes
What results do you get without the `exp:store:product` tag pair? Also, why do you have this within the channel form??

I'm thinking it might have sometihng to do with this you see. Try this out nad let us know what happens :

```
{exp:channel:form channel="product" class="styled-form" return="dashboard" datepicker="no" url_title="{segment_3}" require_entry="yes"}
    <input type="date" id="p_date_available" name="p_date_available" value="{p_date_available format="%Y-%m-%d"}" required/>
{/exp:channel:form}

```

MY thinking is that aa product is basically a channel entry, so we can use the channel entry form to influence it, without the need for the store tags. I don't know **why** it would make it work, but its worth a trial and error thang!

---
Tags: safecracker, date, date-format
---


# Question
Title: Add a new menu button in control panel on module installation
For the module I am developing I would like to add a new menu button in the control panel. I could do that manually, but I was wondering if there is a standard EE function to add a new menu button when the module is being installed?

# Answer
There isn't a standard function, but there is a standard event hook, so within your module you can create an extension too, and use this to input your menu item. This way when you install the module, you can install the extension as well and job done.

Check out the below, its a strip down of an extension I use to add items to the admin menu, as I have it to hand it might provide a short cut for you:

In the below the premise is we hook `cp_menu_array` on a fucntion called `add_menu_items`, this method recieves 1 parameter, the CP menu as a multi-dimentional array. Re-order, add to, remove from the array as much as you like, remember to return the array and your done.

```
class MY_admin_menu_ext {

    var $name = 'Admin Menu Manager';
    var $version = '1.0';
    var $settings_exist = 'n';
    var $docs_url = '';
    var $settings = array();
    var $EE;

    /**
     * Extension Constructor
     */
    function __construct($settings = array()){
        $this->EE =& get_instance();
        $this->settings = $settings;
    }

    // - Extensions -----------------------------------------------------------

    /**
     * Activate Extension
     */
    function activate_extension() {
        $this->settings = array();
        $this->EE->db->insert('extensions', array(
            'class'    => __CLASS__,
            'hook'     => 'cp_menu_array',
            'method'   => 'add_menu_items',
            'settings' => serialize($this->settings),
            'priority' => 10,
            'version'  => $this->version,
            'enabled'  => 'y'
        ));
    }

    /**
     * Update Extension
     */
    function update_extension($current = FALSE) {
        if (! $current || $current == $this->version) { return FALSE; }
        $this->EE->db->where('class',__CLASS__);
        $this->EE->db->update('extensions', array('version' => $this->version));
    }

    /**
     * Disable Extension
     */
    function disable_extension() {
        $this->EE->db->where('class', __CLASS__);
        $this->EE->db->delete('extensions');
    }

    // - Hooks -----------------------------------------------------------------

    //modify the control panel menu
    function add_menu_items($menu){

        //Add General Content Settings Link to the Content Menu after 'Files', before hr & overview
        $i = 0;
        $newMenu = array();
        foreach ( $menu['content'] as $key => $item ){
            $newMenu[$key] = $item;
            if ( $i == 2 ){
                $newMenu['global_settings'] = BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=DESIRED-MODULE';
            }
            $i++;
        }
        $menu['content'] = $newMenu;
        return $menu;
    }
}

```
> 2 votes

---
Tags: control-panel, add-on-development, module
---


# Question
Title: Possible to have larger thumbnails in Channel Images entry screen?
I've gone through the Channel Images documentation, but didn't find this issue addressed. In the entry screen (in table form) the thumbnail of the images is quite small -- so small, that it's difficult to see which image is which when I'm working on the order of the images for a gallery. Switching to tile view doesn't work, because that gets rid of other editing options that I need.

It's true that clicking on a thumb in the table view of the entry screen brings up a large view of the image, but for workflow of determining an order of a bunch of images, it's not practical to have to constantly click open an image, then close the window, and back and forth.

Anyone know if it's possible to make the thumbs in the entry screen larger, like maybe the size they are in the tile view? If not currently, I think this would be a great enhancement and would really improve the user workflow.

# Answer
Yes. You just need to choose the small and big preview in the field settings.

However the only way to make the table bigger would be to hack the CSS for the fieldtype.
> 0 votes

---
Tags: devdemon, channel-images, thumbnails
---


# Question
Title: DevDemon Forms - form:error:required_error
When setting fields to Required and testing the form submission, I noticed the text **form:error:required\_field** shows up. Is there a way to change the text to something else? I want it to just say Required Field or Value is Required. Thanks!

# Answer
> 1 votes
Just go to Modules -\> Forms -\> Settings and make sure you have messages in there. Then click Save. If you updated from an older version, these might not be saved.

---
Tags: error, forms, devdemon
---


title: Switch Parent Page and Child Page

text:
# Question
Title: Switch Parent Page and Child Page
Is there a way to switch the parent page with one of the child pages? I would like to avoid creating a new page for each child page under the new parent page.

# Answer
> 0 votes
I'm not sure I follow, but can you just drag one to go underneath another parent and then move the parent under it?

---
Tags: structure, parent, child
---


# Question
Title: 2 PHP errors while creating new entry using Publisher
Im having a minor issue with my channel form. The form is ment to create new entry instead of editing one. (when editing entries dont get the errors because entry\_id is present). Using latest EE 2.10.1, with Publisher 1.6.4 running on php5.6.2.

EE's docs states that when channel form doesnt find entry\_id, it will create new entry, and because Publisher is somehow checking things againts entry\_id, errors are thrown because there is no entry\_id available.

Here is the opening tag for channel:form I have now (have tried about all variations with dif params I can think of), does anyone have any idea what I might be missing? `{exp:channel:form channel="tapahtumat" include_jquery="no" status="open" entry_id="{segment_3}" datepicker="no" class="form-horizontal" author_only="yes" cache="no" return="{phrase:uustapahtuma}/ENTRY_ID"}` Below is inputs cos dunno how I can add them inside code here (sorry).

input type="hidden" name="lang\_id" value="{publisher:current\_language\_id}"\> input type="hidden" name="publisher\_view\_status" value="draft"\> input type="hidden" name="publisher\_save\_status" value="open"\>

Errors what I get are:

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: entry_id
Filename: publisher/ext.publisher.php
Line Number: 594

A PHP Error was encountered
Severity: Notice
Message: Undefined index: entry_id
Filename: publisher/ext.publisher.php
Line Number: 601

```

Not sure what else I can tell more than I use the phrase on return param because it didnt seem to translate the URL when creating entry in different language. I do not have drafts enabled, Im using Publisher purely for translating content.

Help would be nice, thank you.

# Answer
> 1 votes
Please submit this to boldminded.com/support. I don't do support here.

---
Tags: php-errors, publisher
---


title: Members last visit zoo visitor

text:
# Question
Title: Members last visit zoo visitor
I'm trying to display all the data of my members, including the last time they logged in (last visit), but I can't seem to get the right data. Either I receive the data of the users that's currently logged in, or nothing at all. I'm currently trying this:

```
Last visit

{exp:low_alphabet:entries
        channel="members"
        status="Members-id5"
    }
    {exp:member:custom_profile_data member_id="{entry_date}"}{last_visit format="%Y %m %d"}{/exp:member:custom_profile_data}
{/exp:low_alphabet:entries}

```

I thought this should work since this is the way it's being described here: https://ellislab.com/expressionengine/user-guide/add-ons/member/#member-profile-templates

Does anyone has the idea what's the right way to do it?

# Answer
The right way to do it turned out to be:

```
    {exp:channel:entries
        channel="members"
        dynamic="no"
        status="Members-id5|Super_Admins-id1"
    }
        {exp:member:custom_profile_data member_id="{author_id}"}
           {last_visit format="%d %m %Y"}
        {/exp:member:custom_profile_data};
    {/exp:channel:entries}

```
> 0 votes

---
Tags: members, zoo-visitor, status, low-alphabet
---


# Question
Title: Not displaying an entry that is in a certain category but also in other categories
We're trying to display certain elements based on whether they are in a category or not.

We have the following:

Type Category group

* Type1
* Type2
* Type3

Range category group

* Range1
* Range2

I want to display all of Type 1 in a page, all of Type 2 in a page and all of Type 3 page. However I don't want Range2 items to show up on these pages.

We've used code like this (1 is Type1 category ID and 5 is Range2):

{exp:channel:entries channel="product" category="1 not 5" dynamic="no" orderby="title" sort="asc"}

The problem we have is that if an item is part of Type1 and Range2, it'll still show up. Which is correct according to EE documentation (https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html#category), however how can I go about making this work the way I want to? Is it possible with standard EE or do i need an additional module installed?

# Answer
> 0 votes
We ended up using stash to do this, not sure it's possible with just standalone EE, if it is though i'd love to know!

---
Tags: categories
---


# Question
Title: "This license is in use on multiple domains" - Privacy & Security issue?
I noticed the following in my EE account: "This license is in use on multiple domains, please make sure each use is authorized". The reason seems to be due to me having EE installed on development server and production.

This got me wondering and concerned though. I'm guessing EE has some sort of homing beacon? What information is being exposed from my server to EE? I know it's at least exposing my domain names. Anything else I need to be concerned about from a privacy and securiry perspective?

Are any of the addons doing something similar?

# Answer
> 3 votes
Addons is too broad for the forum, you'll have to contact the manufacurers however I've never seen a 3rd party phone home from the popular developers (SolSPace, P&T, GotoLow, Expresso, PutYourLightsOn)...

The Licence check came in on version 2.9 (July 15, 2014), all it does is send some server details back to EllisLabs, heres the actual payload code for you to see :

```
$payload = array(
    'contact'           => ee()->config->item('license_contact'),
    'license_number'    => (IS_CORE) ? 'CORE LICENSE' : ee()->config->item('license_number'),
    'domain'            => ee()->config->item('site_url'),
    'server_name'       => (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : '',
    'ee_version'        => ee()->config->item('app_version'),
    'php_version'       => PHP_VERSION
);

```

Fairly safe. also I recall when they brought this out that the licence check is non destructive, it is for infomation purposes so you can manage your licenses better, but I can't find it anywhere(found it). The code doesn't show anything other than the payload-ping though...

*Quote EllisLabs*

> EllisLab has always taken a soft approach to license registration so we treaded very lightly here. You will never be locked out of your software nor will the behavior and output of your site be impacted by this in any way.

---
Tags: security, license, licensing
---


# Question
Title: FreeformPro Not Submitting After Upgrade
I have a site I inherited and did a big update on. All looked good until we tested the contact forms that use Freeform Pro and they aren't submitting.

EE 2.10.0 Latest versions of Structure/Publisher/FreeformPro.

Freeform code is:

```
{exp:freeform:form
            form:class="form-horizontal"
            form:id="freeform"
            form_name="contact"
            form:action="{root_url}index.php/{publisher:current_language_code}/?ACT=50"
            return="{root_url}index.php/{publisher:current_language_code}/{segment_1}/thank-you"
            parse="inward"
            ajax="yes"
            required="first_name|last_name|email"
            match="email"
            recipients="yes"
            recipient1="***email_removed"
            recipient2="***email_removed"
            recipient_template="contact_form_notification"
        }

```

Originally the "ACT=50" was "ACT=42" - on a whim I looked at the exp\_actions table and saw no entry there for 42 but Freeform had an action of 50 so I thought that might be the issue.

Googling around it looks like this is possibly .htaccess related. Currently the site has:

```
RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

When I try to submit the form the Chrome JS inspector shows:

```
`POST (**URL removed) /en/respond/contact-the-hope?ACT=50 404 (Not Found)

```

I threw a quick EE contact form in and it submits/sends email successfully.

Any thoughts?

# Answer
> 0 votes
I might be wrong but that first line looks like it's saying:

"If the request DOES NOT include ACT=50 route it to index.php"

So I'd try removing that and see what happens.

---
Tags: solspace-freeform
---


title: EE and Channel Images Copy and Paste

text:
# Question
Title: EE and Channel Images Copy and Paste
Has anyone noticed a problem when trying to add a CI description with copy and right click to paste into the description field? For me it is not being saved, if I paste it then re-type one letter or more it saves OK as does straight typing.

Using CI 5.4.19 and EE 2.10.1.

David

# Answer
> 0 votes
In Channel Images and you paste or write in a description field you have to click out of the field so it saves. The AJAX action is on the "blur" so if you click submit in EE the blur never occurs because how EE handles the submit.

# Answer
> 0 votes
Where are you pasting from my friend?

I've seen isues when you rtake your copy from like word documents ect (it copies nasty MS centric html formatting which can result in nothing the other end)...

A good test, copy your text, paste it into notepad, then re-copy and paste into CI tectfield. DOes that work?

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


# Question
Title: Member Profile Templates' Language Location?
I can't seem the find the location for the member profile templates' languages.

I'm building a front-end type of control panel for members. It's based off of the default member templates that come with EE, and I am customizing that. What I want to do is change the standard language used for all the member template functions.

For example: {lang:username\_and\_password} outputs "Username and Password". Or {lang:edit\_profile} outputs something like "Edit Your Profile".

I need to change what those language terms render. I've looked inside the control panel found settings that I thought would change this, but only seem to affect the back-end control panel language, not the front-end member profile templates.

Can't find similar questions on here, or topics from EE manuals.

# Answer
> 0 votes
I'm pretty sure you just have to translate default (English) lang pack and create new lang folder for the translated file versions. And then setup default language for the translated if you don't want English to be default. It's a jungle and takes time but it's worth it if you need it. And of course, if I remember right, someone is even selling language pack at devot:ee...

https://ellislab.com/expressionengine/user-guide/general/languages.html

---
Tags: templates, language, profile
---


# Question
Title: Using {redirect=""} to redirect to an external website
We're trying to use redirect to allow our website editors to link to external pages, however when we use:

```
{exp:channel:entries}
  {redirect='{external_link}'}
{/exp:channel:entries}

```

It just takes them to http://example.com//http://www.myredirecturl.com

Is it possible to use redirect to link to external websites? Thanks!

# Answer
> 7 votes
Not with a tag, but with a PHP snippet you can, you have some options:

1. Using EE's built on function

```
<?php ee()->functions->redirect('{external_link}'); ?>

```

You'll need **PHP parsing on**, if you want to use the `{external_link}` tag you'll have to set it to run on **Output**

2. Location Header redirect.

With the above you may get some screen artifacts as the template engine runs before the redirect. you can avoid this with a bog standard PHP redirect. Commonly known as a

```
<?php header('Location: {external_link}'); exit; ?>

```

This method you'll also need **PHP on Output**, so you can parse the `{external_link}` tag in the PHP snippet, but this should abort the template engine and redirect a bit cleaner. Make sure this statement is executed BEFORE you send anything to the browser.

3. You could always set up a JS redirect and push the tag into some script, means loading the page before redirecting though, but no need for PHP parsing:

My personal favourite is option 2.

# Answer
> 2 votes
Why just using either snippet or direct put to template meta-part instead of using PHP in-template if editors put full URL?

Something like:

```
{exp:channel:entries}
  <meta http-equiv="refresh" content="0; url={external_link}">
{/exp:channel:entries}

```

---
Tags: redirects
---


# Question
Title: Restrict Category Assignment To A Single Leaf Node
Is it possible in CPanel to restrict the assignment of a channel entry to a single leaf node category? My categories are hierarchical and only a single, bottom-most category is valid per channel entry.

# Answer
You can try Lonely Cat
Which will set a single category.
Possibly needs @Cheyney's answer too (Not auto-assign category parents)
https://devot-ee.com/add-ons/lonely-cat
> 1 votes

# Answer
"Assign", yes. "Restrict", no. Unless you find a plugin.

You can ensure that an entry is NOT assigned to categories above the node chosen by setting "Auto-Assign Category Parents" to "No".
> 2 votes

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


title: Cannot upload Adobe InDesign file

text:
# Question
Title: Cannot upload Adobe InDesign file
I'm having trouble trying to upload an InDesign file to my EE site. I've added the following to the `system/expressionengine/config/mimes.php` file `application/x-indesign` however upon uploading the file I'm shown an error message:

**File not allowed.**

Does anyone know a way around this? I've successfully added a photoshop file to the mime list and that works perfectly fine.

Here's a small slice of the mime $whitelist array

```
'application/x-dvi', // .dvi
'application/x-gtar', // .gtar
'application/x-gzip', // .gz
'application/x-indesign', // .indd
'application/x-photoshop', // .psd
'application/x-rar-compressed', // .rar
'application/x-stuffit', // .sit

```

Thank you.

*Edit:*

EE Version 2.10.1

# Answer
What version of EE are you using? Modern (2+) use an array to identify mime type allowances. In my version I'm looking at (2.9.2), it looks like this:

```
$mimes = array(
                'ai'    =>  'application/postscript',
                'aif'   =>  'audio/x-aiff',
                'aifc'  =>  'audio/x-aiff',
                'aiff'  =>  'audio/x-aiff',
                'avi'   =>  'video/x-msvideo',
                'bin'   =>  'application/macbinary',
                'bmp'   =>  'image/bmp',
                 ... and so on ...
);

```

So you'd want to add this:

```
                'indd'  =>  'application/octet-stream',

```

OR

```
                'indd'  =>  'application/x-indesign',

```

OR

```
                'indd'  =>  'application/x-adobe-indesign',

```

OR to be safe

```
                'indd'  =>  array('application/octet-stream',
                                  'application/x-indesign',
                                  'application/x-adobe-indesign'),

```

You'll have to try them all, the internet is reporting a few different things and it's quicker to just test these variants and see what works.

So I'm not sure what version you are running, but that appears to be a malformed mime type array (verified to be this format as far back as 2.5.5).

**Edit**

As Kieran McClung mentioned, EllisLab has switched to a new mimetype detection library for 2.10+. At this point, we now have a $whitelist flat array instead of a $mimes array that can have a second layer of depth. I'm pretty sure adding

```
'application/octet-stream'

```

was the fix, although Keiran said all three were needed, which would have resulted in a $whitelist array that looked like this

```
$whitelist = array(
    'application/csv', // .csv
    'application/epub+zip', // .epub
    'application/excel', // .csv, .xl, .xls
    'application/mac-binhex40', // .hqx
    ... and so on ...
    'application/octet-stream', // .indd
    'application/x-indesign', // .indd
    'application/x-adobe-indesign', // .indd
);

```

And that got things whipped into shape!
> 1 votes

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


title: ExpressionEngine and CORS?

text:
# Question
Title: ExpressionEngine and CORS?
I need to enable cross-domain AJAX requests on my site, while limiting the cross-domain access to a particular template.

This template is in its own template group, so the requests from the script would look something like this:

```
domain.com/embeddable-content

```

I have this in my .htaccess file:

```
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>

```

But this grants access across the entire domain. How would I go about restricting access to the single template?

I've googled around, but this is slightly out of my bailiwick, and I figure there my be complications because of EE's file structure (or lack thereof).

# Answer
If you're only allowing access to a single template, I'd imagine the easiest way would be to use PHP's header to add

```
header('Access-Control-Allow-Origin: *');

```

At the top of the template
> 6 votes

# Answer
You should be able to do this in htaccess:

```
<IfModule mod_headers.c>
  SetEnvIf Request_URI "^/index.php/embeddable-content(/.*)?" CORS=TRUE
  Header set Access-Control-Allow-Origin "*" env=CORS
</IfModule>

```

This'll only set the CORS header when your request matches that URI.
> 4 votes

# Answer
If you don't want to enable PHP in your templates you can also use https://github.com/nathanpitman/np\_access\_control\_allow\_origin.pi.ee\_addon to do this. :)
> 1 votes

---
Tags: htaccess, security
---


# Question
Title: Listing products related to store in google maps search results
```
{exp:gmap:results order_by="distance" sort="asc"}
    {if has_searched}
        {results}
            <script>console.log("{entry_id}");</script>
            {!-- Entry ID for store is output to console --}
            {exp:channel:entries channel="product"}
                <script>console.log("{entry_id}");</script>
                {!-- store entry ID is output to console, not product entry ID --}
                <tr>
                    <td>...</td>
                    <td>...</td>
                    <td>...</td>
                    <td>...</td>
               </td>
           </tr>
        {/exp:channel:entries}
    {/results}
{/exp:gmap:results}

```

I am trying to output a tabular list of all the products associated with the stores returned by the search results. In this setup, the product entries have a store relationship field. But not vice versa. That is because Channel Form does not allow the submission of data to two entries at a time (i.e. submit the product data to product channel, then append the product ID to the products relationship in the store channel entry).

The products are created by the stores since the store channel is really the channel containing all the member data since I use the Zoo Visitor plugin. So, the stores (i.e. members) create the products.

As I understand it, the `{results}{/results}` pair tag loops through the store channel. A solution I thought of was to have the product channel entry loop with the `author_id` parameter set to equal the `entry_id` of the store channel. But I get no output with this parameter:

```
{exp:gmap:results order_by="distance" sort="asc"}
    {if has_searched}
        {results}
            <script>console.log("{entry_id}");</script>
            {!-- Entry ID for store is output to console --}
            {exp:channel:entries channel="product" author_id="{entry_id}"}
                <script>console.log("{entry_id}");</script>
                {!-- store entry ID is output to console, not product entry ID --}
                <tr>
                    <td>...</td>
                    <td>...</td>
                    <td>...</td>
                    <td>...</td>
               </td>
           </tr>
        {/exp:channel:entries}
    {/results}
{/exp:gmap:results}

```

Without that parameter, I get the products, but I get every single product entry whose repetition is equal to the number of stores. So, I tested to see what entry ID I get inside the outer loop and the inner loop. In both instances I get the store entry ID.

Is there a way to resolve this so that I can **1**: filter the products with the `author_id` parameter being equal to the entry ID of the outer loop entry ID? And **2**: fix the inner loop so that `{entry_id}` returns the product ID, not the store ID?

# Answer
> 0 votes
I would use VMG nested.

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

This plugin allows you to use your channel tags in the exact same way, but allow you to **prefix** your variable outputs. Example:

```
{exp:vmg_nested:channel:entries channel="news" prefix="news}
    <!-- outside entry_id -->
    {news:entry_id}

    {exp:vmg_nested:channel:entries channel="blog" prefix="blog" author_id="{news:entry_id}"

            <!-- inside entry_id -->
            {blog:entry_id}

            <!-- ... magic! outside entry_id -->
            {news:entry_id}

    {/exp:vmg_nested:channel:entries}

{/exp:vmg_nested:channel:entries}

```

This might be your ticket.

---
Tags: channel-entries, zoo-visitor, google-maps-for-ee
---


title: grid add file / remove file javascript

text:
# Question
Title: grid add file / remove file javascript
I created a little accessory to insert a row anywhere in a Grid field. This works great with the exception of when the grid has a File field. When I create the row the Add File link does not get handled. I managed to dig through the compressed EE JavaScript code and was able to figure out manually process the Add File link with this.

```
$.ee_filebrowser.add_trigger

```

Using this I was able to populate the file image thumbnail and name to match what EE does. Although this seems to work it seems like a really bad idea for future compatibility with EE. The other issue I am having is handling the Remove File link.

So I have a couple of questions:

1) How can I use/call the existing EE JavaScript code to handle the Add File functionality?

2) How can I use/call the existing EE JavaScript code to handle the Remove File functionality?

# Answer
If you're implimenting your file field within an extension/accessory, why not use the File Field Class?

If you instansiate this field as per the docs it should add the required JS to your outputted template automatically (see Creating a file field and Initializing a file browser )
> 0 votes

# Answer
I changed my JavaScript so that when the Insert Row icons is clicked I trigger the add row click and then move to the newly created row to the correct location in the table. This allows for the EE JavaScript to handle any custom fields and now File fields work correctly.
> 0 votes

---
Tags: file-uploads, grid, javascript
---


# Question
Title: Low Search pagination not including passed keywords
This is what I have:

```
{exp:low_search:form
    result_page="search/clinical-trials/"
    collection="clinical-trials"
}
    <input type="search" name="keywords" placeholder="Search..." value="{low_search_keywords}">
    <button type="submit" class="button button-postfix-search"><i class="fa fa-search"></i></button>
{/exp:low_search:form}

{exp:low_search:results
    collection="clinical-trials"
    status="open"
    limit="10"
    dynamic="no"
    paginate="both"
    pagination_base="search/clinical-trials"
    status="open"
    keywords:inflect="yes"
    keywords:lang="en"
    keywords:mode="auto"
    keywords:loose="right"
    keywords:stem="yes"
}

    <a href="{page_url}/" class="channel {channel}">{title}</a>

    {paginate}
        <ul class="pagination pagination-lg">
        {pagination_links}
        {first_page}
            <li><a href="{pagination_url}">First</a></li>
        {/first_page}
        {previous_page}
            <li><a href="{pagination_url}">« Previous</a></li>
        {/previous_page}
        {page}
            <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
        {next_page}
            <li><a href="{pagination_url}">Next »</a></li>
        {/next_page}
        {last_page}
            <li><a href="{pagination_url}">Last</a></li>
        {/last_page}
        {/pagination_links}
        </ul>
    {/paginate}

{/exp:low_search:results}

```

It seems like everything is working properly until I look at the pagination URL after I pass a keyword. For example, I entered "cancer" as a keyword in the form and hit submit. This is the page URL:

```
http://www.example.com/search/clinical-trials?keywords=cancer

```

But the pagination link is:

```
http://www.example.com/search/clinical-trials/P10

```

It's lacking the keywords query! It should be:

```
http://www.example.com/search/clinical-trials/P10?keywords=cancer

```

I'm not sure what's going on here? I have the same code in other pages on my site and the pagination links seem to be forming properly.

# Answer
When not using encoded queries, Low Search will try and add the GET vars to the pagination URLs automatically. If that fails, you can always add the query string manually, by using this as your pagination links:

```
<a href="{pagination_url}{low_search_query_string}">

```
> 3 votes

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


# Question
Title: How do I create a static page with Structure?
Let me start off by saying I am completely new to EE (I have mostly worked with WP before). I have watched several tutorials, but I have yet to get the hang of it.

Can anyone advise me on where to start to make some static pages that are available through the top nav (like most websites). I have the Structure plugin downloaded. Here is my site as it stands: www.smplouisiana.org.

I'd like to make the site deeper than a 1 page, dynamic, channel. If someone could give me some starting points on this I would greatly appreciate it. I'll be happy to provide any other information requested.

Thanks so much!

# Answer
You should definitely read through the documentation on Structure. Pay great attention to the difference between a managed page, listing page, and an asset. I rarely use assets, but it's worth knowing what they can do for you.

For the sake of getting you started, go to Structure and click on the Channel Settings button. You will see three columns Channel | Type | Options. Let's assume you have a channel already named "static". In the type column, choose page and click the "Show in page selector" checkbox. Next in the options column, choose a pre-existing template you'd like to use for static pages. Save your Channel Settings.

Next click on the Pages button in Structure and click the Add Page button. This will create a static page. Populate the title and save the page. That page will show up in the Structure hierarchy. You can choose to add more pages at the same level by clicking the same Pages button you clicked before, or you can hover over a previous page and add a child page below it. For example:

```
Page (URL = page)
  -- Child Page (URL = child-page)
     -- Grandchild Page (URL = grandchild-page)

```

You should then be able to access those pages with these URLs respectively:

* /page/
* /page/child-page/
* /page/child-page/grandchild-page/

Make sure you've uploaded a minimum .htaccess file to the root directory of your site:

```
<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>

```

Note that you can choose to change the template you want to use for any of the pages you've added to Structure. For example, you may want to render a static page with a right column or a left column. Just create two different templates and within the entry change your Structure template to the one that fits your needs.

Keep in mind that you may want to render your entries using the exp:structure:entries tag instead of EE's exp:channel:entries. Structure and EE use two different URLs which sometimes are not exactly the same (a bone of contention with me). Using Structure's entries tag ensures that you're getting the correct URL. You must remember that with Structure you're basically co-opting EE's native way of handling how URLs are built. EE out of the box uses template\_group/page to determine URLs. Structure frees you from this (as I showed above with the /page/child-page/grandchild-page example.

There's so much to say about how to use Structure. I've been using it for years and I love it. I wish you luck!
> 0 votes

---
Tags: structure, ee, static
---


title: Emptying exp_super_search_terms

text:
# Question
Title: Emptying exp_super_search_terms
I'm having trouble importing a db locally. So I'm doing a reduction test by importing batches of tables at a time, until I meet the offender.

exp\_super\_search\_terms looks suspiciously offensive. It's weighing in at nearly 60MB and contains what looks like random spammy entries. There are over 1.2million entries in it. Yup, you read correctly. So, I'd like to empty it of it's gunk and possibly disable any future entries being recorded in it.

But the exp\_super\_search\_terms "does not contain a unique column. Grid edit, checkbox, Edit, Copy and Delete features are not available."

So how do I go about flushing it?

And how do I not make it writable anymore, until we sort out the spam barrage?

Much appreciated

UPDATE I've emptied the table. But I'd still be interested in knowing how to keep the table in check from further assaults.

# Answer
> 1 votes
The `exp_super_search_terms` table contains previously searched terms, as well as possible permutations of certain terms. These are compiled and used for quick retrieval by Super Search of previously searched terms, as well as for fuzzy searching and for the Super Search Cloud tag. Especially for free-style keyword searches, this table can fill up with quite a large number of terms (I've heard of much more than 60Mb for some users).

You can indeed clear this table from time to time without "breaking" Super Search, however the table is useful for general and fuzzy searching. Data in this table is therefore very likely not "spam", and would not be proof on its own of any kind of "attack".

Even if the table is cleared, the table will fill itself again after some time as searches are being conducted on the site with Super Search.

If you really want to, you could comment out the `log_terms` function near line 1496 of data.super\_search.php (i.e. which mentions `$this->log_terms( $keywords );`), but again this would be removing a very handy part of Super Search functionality.

---
Tags: solspace, supersearch
---


# Question
Title: Run Module Update error when updating Freeform (free) from 3.1.2 to 4.2.2
I'm trying to update Freeform (free version) from 3.1.2 to 4.2.2

***NOTE:*** I recently updated EE from v2.5.3 to v2.9.3

After I upload the new folders to the system and themes directories, and go to:

*Admin \> Modules \> **Run Module Updates***

I get the following error:

> A Database Error Occurred Error Number: 1054
>
> Unknown column 'settings' in 'field list'
>
> UPDATE `exp_freeform_fieldtypes` SET `settings` = '\[\]'
>
> Filename: third\_party/freeform/models/freeform\_model.php
>
> Line Number: 471

I've tried to revert back, by replacing the folders in system and themes with the old version and, then I get this error in:

*Admin \> Modules \> **Freeform**:*

> A PHP Error was encountered
>
> Severity: Warning
>
> Message: Creating default object from empty value
>
> Filename: addon\_builder/addon\_builder.php
>
> Line Number: 1333
>
> Fatal error: Call to undefined method Cp::set\_variable() in /admin/expressionengine/third\_party/freeform/addon\_builder/addon\_builder.php on line 1389

And now I'm stuck...

# Answer
> 1 votes
Ooo yeah you shouldn't have tried to revert. I ran into this issue upgrading a huge site; they literally just have a bug in the updater if I remember correctly. You just need to get the settings for the column from a previous backup, and make sure you create that column manually with the correct settings. Sorry, wish I could be more specific, but I don't have time to recreate the issue right now to give you a better answer.

But I would recommend reupdating FreeForm and then just manually creating that column.

---
Tags: solspace-freeform, php-errors, update, updating
---


# Question
Title: Subscribing the current member via Postmaster
I have a template that is called when a user wants to subscribe to the newsletter. It is formatted like this...

```
  {exp:postmaster:campaign:subscribe
    service="MailChimp"
    api_key="XXXXX"
    list="XXXXX"
    email="{email}"
  }

```

However the email part doesn't seem to load. How can you make it subscribe using the current member's email address?

# Answer
The issue is the EE parse order. The email tag doesn't parsed before the tag. I just updated Postmaster to parse CURRENT\_USER as the current logged in email. So this should work in the next update (1.4.7). Send an email to support@objectivehtml.com if you want a copy of the latest code before the official release.

```
{exp:postmaster:campaign:subscribe
    email="CURRENT_USER"
    service="Mailchimp"
    api_key="XXX"
    list="XXX"
}

```
> 2 votes

# Answer
I've upgraded to 1.6.0 and this is still an issue. I get this error: EMAIL must be provided - An email address must contain a single @ using the above code
> 0 votes

---
Tags: postmaster, mailchimp
---


# Question
Title: Template embedded in channel entry loop returns same data in each loop
I am having a strange issue in my product listing template. Basically I have 2 channels. First channel say items stores the product information like product name, sku, company id etc and other channel say images stores the images information like sku, company id image URL for the products. Please note that sku and company id also exists in images channel which relates both items and images channel.

So I create a product listing page which have a channel entry loop like this

{exp:channel:entries channel="items" orderby="date" limit="15" paginate="bottom" sort="DESC"} {title} {/exp:channel:entries}

I need to show related image of this channel entry i.e. image which have same company id and sku as this entry. So I added an embed template to it so my working code snippet is this

{exp:channel:entries channel="items" orderby="date" limit="15" paginate="bottom" sort="DESC"}

```
     {embed="path/item-image" company_id="{company_id}" sku="{stock_keeping_unit}"}

```

{/exp:channel:entries}

Here is how embed template looks :

{exp:channel:entries channel="images" dynamic="no" limit="1" orderby="random" search:image\_company\_id="={embed:company\_id}" search:image\_stock\_keeping\_unit="={embed:sku}" }

```
 {if no_results}
    <img alt="" class="item-image" src="/assets/images/default-product-image.jpg">
 {/if}
 <img alt="item-image" class="item-image" src="{image_url}">

```

{/exp:channel:entries}

*Now the issue is embed template keeps adding the same image with every loop. I have verified that company id and sku is different for each entry but it show the first image for all the items.*

I have searched on Google where people having similar issue fixed it by adding random but random does not have any effect on my code. I can only think that EE is not calling the identical template more than once for optimization. I have also tried stash with snippet as I need to pass variables to the embedded code but it also returns the same image over and over.

Has anyone had this issue before, and if so, let me know how can I avoid it.

# Answer
It feels like your search: isn't firing as you are expecting. If in your embed template, you display {image\_url} as text, is it correct?

Also put some text in the no\_results conditional so you can tell if that is what is always returning, or not.

The SKU should be enough for a unique identifier. Try the search with just the SKU.

If you hard code a SKU into the embed template, does it return the expected result? Get the embed template working as expected with hard coded values first. Then when you emded it and pass values for the search, turn on template debugging and check that the correct values are being passed as expected.
> 0 votes

# Answer
Why would you have 2 separate channels for products and images? Since an image can be seen as a property of a product to me it seems logical that they are in the same channel. Plus it would save an embed and other overhead in programming this. For the company i would suggest have a company channel which holds the company information, logo, etc. And you could link this from a relationship field in the products field group
> 0 votes

---
Tags: ee2, templates, embeds, cache
---


# Question
Title: Caching Solutions For A Customized Ticket System
I have created a ticket system in EE that is customized for reporting and alerts. It's all front-end but I want to make sure that it's snappy. Is there a good caching add-on you have used that is worth the money?

# Answer
CE-Cache. Use it. It's static file cache creates flat generated cache files that serve **instantly** on a site that gets 500k hits a week, over a million requests during the semester. You can use the cache breaking feature to break cache when you update channel entries, relationship, basically anything.

I can't speak for the alternative caching methods it provides, but the static cache method is baller (I don't work for them or make any money from them, it just works great).

http://www.causingeffect.com/software/expressionengine/ce-cache
> 1 votes

---
Tags: cache
---


# Question
Title: Solspace Calendar: ICS import field mapping
Is there any way to import additional fields from ICS files via Solspace Calendar (v1.8.13 on EE v2.10.1). There are the default Calendar: Events fields which typically get populated with imported data. And I can add additional fields like for links and images to the field group, but is there a way to map imported data into these additional fields?

I didn't see anything in the documentation or in the Calendar module in the CP to address this.

# Answer
At this current time there is no officially supported way to do this with ICS Update.
> 0 votes

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


title: Show date listing from today onward

text:
# Question
Title: Show date listing from today onward
How can I make a list which show the date from today to following 10 days? Like Thu, June 25, 2015 Fri, June 26, 2015 Sat, June 27, 2015 Sun, June 28, 2015 Mon, June 29, 2015

And then make entry list under the matching date to entry date.

# Answer
It looks like this is your best option.

https://github.com/ehousestudio/dailee\_entries

If you can't make that work, I can probably come up with a combination of PHP and template tags that would work. It'd be an ugly template but it would work.

**Edit**

If I were you, I'd fork this and just use it as a base to get the plugin to output how you'd like.
> 1 votes

# Answer
First I thought about the `display_by` parameter, but the user guide says:

> The display\_by parameter uses the last unit of time provided that has entries. If you `display_by="day"` then it will show the last day that has entries. If you `display_by="month"` combined with `limit="3"` then it will show the last 3 months with entries, even if these months are not consecutive.

So... I'm not sure it will work.

But there's another option. You should be able to use `+10 days` on `stop_before` parameter.

```
{exp:channel:entries [...] start_on="today" stop_before="+10 days" show_future_entries="yes"}
  {date_heading display="daily"}<h1>{entry_date format="%Y %m %d"}</h1>{/date_heading}
  <h2>{title}</h2>
  {body}
{/exp:channel:entries}

```

Please, try.
> 1 votes

---
Tags: date, entry, grouping
---


# Question
Title: Low search keywords + tagger tags + select2?
I'm trying to build a low search field that displays one visible predictive select2 input field that pulls in suggestions from a devdemon tagger field, as well as the last x most popular search terms. These options will probably generated with the template rather than an ajax behaviour as the list won't be huge and it would be faster to do it that way I think.

The ideal behaviour would be this: when the user starts typing, I suggest matching words based on tags/previous searches. If they select a tag from the list, I run a tag field search based on that tag; if they select a previous search term I run a keyword search based on that phrase. If they don't select any matching suggestions I run a keyword search based on what they typed.

Ideally I'd like them to be able to select more up to two suggestion combinations.

My question is - should I have one visible select2 input field, but populate hidden search fields when selections are made? (eg call the select field 'keywords' and also have a hidden field called 'tags' (or whatever my tag field is called)?

What's the best way (if any) to achieve this?

My fallback would be to remove the recent search suggestions and simply suggest tags, but still allow them to enter a keyword search. The same question applies to the fallback situation...!

# Answer
> 0 votes
Ok I figured this out; I build a hidden keywords value that searches against multiple fields (including the tag field). My code (simplified a little) looks like this (where stash:\_whichSearch returns 'resources'):

```
<script>
    var selectData = [{id:'Year+group','text':'Year group'}...]
</script>

{exp:low_search:form query="{segment_2}" required="keywords" form_id="{stash:_whichSearch}Search" collection="{stash:_whichSearch}" result_page="{stash:_whichSearch}/search"}
    <select class="js-example-data-array" multiple="" data-tags="true" data-placeholder="Search our {stash:_whichSearch}"></select>
        <input name="keywords" id="keywords" value='' type="hidden">
        <button type="submit" class="expand">Search</button>
{/exp:low_search:form}

```

and my jquery looks like this:

```
/* resources search */
    $(".js-example-data-array").select2({
        data: selectData,
        multiple: true,
        maximumSelectionLength: 2,
        minimumInputLength: 2,
        tags: true
    });

    var $eventSelect = $(".js-example-data-array");
    $eventSelect.on("change", function (e) {
        $("#keywords").empty();
        var objArr = $eventSelect.select2('data');
        var searchTerms = $.map( objArr, function( i, item ) {
            return('"'+i.text+'"')
        }).join('+');
        $("#keywords").val( searchTerms );
    });

```

---
Tags: low-search, devdemon-tagger
---


# Question
Title: Does adding Channel fields affect existing content in those channels?
I'm looking to add a couple non-required channel fields to a particular channel on my site.

How will adding these channel fields affect existing content in that particular channel? What will the value for this field in existing entries be (null, empty string, etc)?

# Answer
> 0 votes
No concerns, friend. It won't affect any current content in any channel\_data rows. When you add a new field to a field group, EE adds two new columns that look like this:

```
field_id_60
field_ft_60

```

and don't worry about field\_ft\_#, It's basically always set to "none" (I think it's a deprecated column but still lives their for compatability, I've never seen it set to anything else). Now for field\_id\_#, the stored value for that field for any particular column row is defaulted to **empty string**. However, you won't destroy any data in any other column. That would make ExpressEngine a terrible CMS :P

Concerned still? **Backup** your database before you add to the field group, but you'll be wasting your time (I assume you are EE version 2+, I don't know anything about EE 1.X).

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


# Question
Title: ExpressionEngine v.s. Database.Mangement System
I'm really confused! I've been trying non stop to connect to an Oracle database through ExpressionEngine throughout the last two weeks. I've finally given up when I saw a previous post(Is it possible to use ExpressionEngine with an Oracle database?) that stated that EE will not work with Oracle.

the error I'm getting is 'driver not found' when I use the PDO oci or undeclared function connect\_oci().

If this is true, why doesn't Oracle connect to EE? Why can Filemaker connect to EE? If this is true, is there a way to create documents that will allow Expression Engine to use Oracle? Can EE only use MySQL and Mysqli?

# Answer
CodeIgniter **does** have a DB driver for oci8. Have you changed your driver? I mean, so much of the core is built around MySQL or equivalents.

You would have to do an **entire** rewrite of the Database class, as well as catch all manual MySQL commands and make sure they are Oracle-syntax correct. You would also have to do the same for all of your add-ons. This is really a futile (or epic) endeavor.

You are in such a better position create your own module and import an Oracle driver, and build your own Oracle ORM as a module. Or, even simplier, why the heck aren't you just doing a database migration from Oracle to MySQL or MariaDB???

**Edit**

Here is really the best resource for building your own modules/addons:

https://ellislab.com/expressionengine/user-guide/development/modules.html

I can help you further, but only if you're building your own module. I'm a professional developer so you'll have to contract me if you want me to do it for you :) But if you can get it going, you can post new questions to the forum and we can help you.
> 0 votes

---
Tags: database, mysql, system
---


# Question
Title: Using Stash to limit repeating events output by Solspace Calendar
While using Solspace Calendar I'm trying to limit recurrent events to only the next occurrence. I found a great tip on how to do it with PHP here: Solspace Calendar: Only show next occurrence of recurring event in list of recurring and non-recurring events

Here's a trimmed down version of what I'm currently trying:

```
{embed="_layouts/index"}
{exp:calendar:cal date_range_start="today" show_months="4" pad_short_weeks="n"}
      {exp:stash:append_list name="events-list" parse_tags="yes"}
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}
      {/exp:stash:append_list}
    {/exp:calendar:cal}

{exp:stash:get_list name="events-list"}
  {exp:calendar:cal event_id="{item_entry_id}" event_limit="1"}
    {exp:stash:set_list name="events-show"}
      {stash:the_title}{title}{/stash:the_title}
    {/exp:stash:set_list}
  {/exp:calendar:cal}
{/exp:stash:get_list}

{exp:stash:set name="content"}
  {exp:stash:get_list name="events-show"}
    <h4>{the_title}</h4>
  {/exp:stash:get_list}
{/exp:stash:set}

```

Content is then pulled into my template.

I'm given no output but even if it did my logic is clearly off. Hitting the database this much is really bad.

Any suggestions?

# Answer
Going back through the stash documentation provided the answer I needed! The unique parameter on get\_list was the missing piece to the puzzle. Below is a refactored version of the code, which now hits the database far less.

```
{embed="_layouts/index"}

    {exp:calendar:cal date_range_start="today" show_months="4" pad_short_weeks="n"}
      {exp:stash:append_list name="events-list" parse_tags="yes"}
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}
        {stash:the_title}{title}{/stash:the_title}
      {/exp:stash:append_list}
    {/exp:calendar:cal}

    {exp:stash:set name="content"}
      {exp:stash:get_list name="events-list" unique="item_entry_id"}
        <h4>{the_title}</h4>
      {/exp:stash:get_list}
    {/exp:stash:set}

```

Hopefully that helps someone else struggling with the logic of using Stash and Solspace Calendar to pull off something similar.
> 1 votes

---
Tags: ee2, stash, solspace-calendar
---


# Question
Title: Template route not generating correct URLs
I followed Boyink's tutorial to the letter but still can't get template routes to work.

My multi-entry template is located at `company/people`. My single entry template is at company/person.

In the Template Route manager, I have `/company/people/{bio:alpha_dash}` for the \`company/person template.

Multi-entry template link code:

```
<a href="{route="company/people" bio="{url_title}"}">

```

Single-entry template channel entries tag:

```
{exp:channel:entries
    channel="people"
    limit="1"
    require_entry="yes"
    dynamic="no"
    url_title="{segment:bio}"
    disable="categories|category_fields|member_data|pagination"}

```

All of the links in the multi-entry template look like: `/company/%7Broute=`

I don't understand why the URL's are not getting generated correctly.

Any help is appreciated.

# Answer
I can't think on anything else than a syntax error. For now, you can use a root relative link:

```
<a href="/company/people/{url_title}">

```

It looks like some `"` or `}` is missing somewhere. Maybe some javascript? Or some CSS rule? Try to look for them or to replace the `"` by `'` inside the `{route}`:

```
<a href="{route='company/people' bio='{url_title}'}">

```

You can also, use the good old `{url_title_path}`:

```
<a href="{url_title_path='company/people'}">

```
> 0 votes

---
Tags: template-routes
---


# Question
Title: Expresso Store : Storing data within the exp_store_order_items table
I just wanted to check if I'm missing something here. Is there anyway to store custom data against an order item - for example, I have a set of sessions (think events) and I would like to store details against the specific session they've booked. Something like the name, address of the person attending the session.

This data may be different from the billing details, and the customer who purchases maybe purchasing multiple sessions for different people. I think the order items table is where this should come (or join) from.

I understand this is fairly edge case, but wanted to check I wasn't re-inventing some functionality before I crack out the extension generator...

Thanks

# Answer
> 1 votes
You can use the `order_customX` fields 1-9 to store custom data about the order (and/or can be linked to custom member fields to repopulate the fields in future orders). You would do this via the checkout tag (docs here).

Depending on the amount of data that you are collecting this could not be enough fields for the information that you need to store. In the past when I am selling event type tickets I add the custom data to the product using text modifiers set at the template level so I can easily include them outside of the publisher area for any and all events. For this approach you would add the additional details when you are adding the item to the cart via the product tag (docs here).

---
Tags: expresso-store
---


title: Install new payment method for Store

text:
# Question
Title: Install new payment method for Store
I just downloaded the Sisow (https://github.com/fruitcakestudio/omnipay-sisow) gateway for Store and copied all the files to the /store/vendor/omnipay/sisow dir.

But unfortunately the Sisow Gateway is not showing in the Store CP.

How do i add more custom gateways to the omnipay lib?

# Answer
> 0 votes
Additional gateways need to be included into Store via an extension so you would need to create an ExpressionEngine Extension. Store has a sample extension of what the gateway should like here with the proper folder structure and files needed to register an additional gateway.

You will need rename the ext.store\_check.php file to match the namespace of the sisow gateway. Once you have done that you will need to add the folder to your third\_party folder and enable the extension in the Add-ons \> Extensions age of EE and configure it however needed before you can use it on the site.

---
Tags: expresso-store
---


# Question
Title: Expresso Store: Registering Members - Specify member group in template
I am setting a site up where customers purchase memberships.

I was going to setup a product to handle this and then do a check in the checkout tag to see if the product had been bought and if it had specify a member id to add that user, during checkout, to their new member group.

Unless there is a better way overall, I am hoping there may be a way within the Registering Members templating to specify a member id

Any help, much appreciated. Thanks.

See: https://www.exp-resso.com/docs/checkout\_tag.html#registering\_members

# Answer
> 0 votes
There is not a way to specify which member group a member goes into when registering a member via checkout. Store will place the member in the default member group that you have set it in the Members \> Preferences \> Default Member Group Assigned to New Members.

Since EE only allow s members to be assigned to a single member group you would have issues if you offered multiple products at the same time that could assign members to different groups. Store does not currently have a mechanism to handle this kind of functionality.

If you need to assign member IDs or groups other then default you would need to create an extension to handle the logic required and override the default behavior

---
Tags: expresso-store
---


# Question
Title: Solspace Importer: Native EE Grid and Relationships
Does Solspace Importer support the native EE Grid and Relationship fieldtypes when importing into channel entries?

I may have made a mistake to assume compatibility to include those native fieldtypes when purchasing, but I've missed some pretty obvious stuff in my day before!

I have a set of XML files that is used to update just under 1000 entries in an EE 2.9.2 site, but the current add-on being used doesn't support cron imports in batches. I was hoping to replace it with Importer, but haven't had luck with it yet.

# Answer
Nope, Importer does not support importing into Grid fields, nor does it support creating/populating relationship fields. Have you looked at DataGrab?

Solspace does have a 30 day money back guarantee.
> 1 votes

---
Tags: solspace, relationships, grid, solspace-importer
---


title: Plugin function question

text:
# Question
Title: Plugin function question
If I have a function in a plugin that is normally called with parameters that are retrieved like this:

```
public function eventtitle() {
    $eventCode = $this->EE->TMPL->fetch_param("event_code");
    $_type     = $this->EE->TMPL->fetch_param("_type");
    // do other stuff
    return $value;
}

```

How do I call that same function from another function WITHIN the same plugin passing the same parameters?

```
$coursetitle = $this->eventtitle($eventcode);

```

# Answer
> 2 votes
Conditionals are your friend! Assuming both parameters are required:

```
public function eventtitle($eventCode=NULL,$_type=NULL)
{

    // is either of our parameters null?
    // if so, try and get it from the tag!
    if (is_null($eventCode) || is_null($_type))
    {
        $eventCode = $this->EE->TMPL->fetch_param("event_code");
        $_type     = $this->EE->TMPL->fetch_param("_type");
    }

    // do other stuff
    return $value;
}

```

And then just call it with params:

```
$coursetitle = $this->eventtitle("Event Code 1", "Type Var 1");

```

---
Tags: plugin, parameters
---


title: Discussion Forum - Deleting Posts

text:
# Question
Title: Discussion Forum - Deleting Posts
Can non moderators delete their own posts?

I cant seem to delete my own posts when logged in as one of my member groups.

Is this normal or is there a member preference of sorts that i need to tweak?

# Answer
It is not possible, sorry. You have to tweak/create custom code/addon for it.

All possible permissions per forums/boards are handled via Forum Module CP :( There is just can edit, and that's what my members has done, editing entries to have only a dot or few.

And if Im wrong for some very odd reason, It would be nice to know where that magic setting might be.
> 0 votes

---
Tags: forum, discussion
---


# Question
Title: Expresso Store Free Shipping showing $0.00 in paypal
If a product has FREE SHIPPING checked WHY does paypal show a line item for shipping UPS $0.00

I even tried hiding the shipping in the checkout but something is still being set to paypal..

{if shipping\_method && order\_shipping\_val != 0}

# Answer
> 0 votes
The PayPal payment gateway file is set to send the order totals, taxes, shipping totals, billing details, shipping details and line item details to PayPal. So Store sends the shipping total of $0 dollars when the shipping total is free just as it send the total of $9.95 when that is the shipping total.

IF you wanted to change this behavior you would have to open up the PayPal payment gateway search for the shipping cost lines and add a conditional to check the value of the shipping total with php and then only send the shipping variable if it has a total.

This should be noted that you would need to make this change again anytime you updated Store as it would be overwritten each update.

---
Tags: expresso-store
---


# Question
Title: Expresso Store Custom Message to customers per product
I need to provide a custom message when someone buys a specific product in their email confirmation. I have a field in the product channel called {Message\_to\_Customer} How do I include this field in the email customer email template?

# Answer
> 0 votes
In your order email template you would need to use the items loop to loop through each item then pass the entry\_id to a channel entries tag something similar to:

```
{exp:store:orders}
<h1>{order_id} - {order_date format="%Y-%d-%m"}</h1>
{items}
 {exp:channel:entries entry_id="{entry_id}" disable="categories|category_fields|member_data" limit="1" channel="products"}
  <h2>{title}</h2>
  Qty Ordered: {item_qty}
  Price: {item_total}

{if Message_to_Customer}
 <div class="alert">
  {Message_to_Customer}
 </div>
{/if}
{/exp:channel:entries}
{/items}
Order Subtotal: {order_subtotal
Order Total: {order_total}
{/exp:store:orders}

```

The above will show the Order ID and Date, then loop through all of the order items with some additional details including the message to the customer and then it will show order details like totals.

You can see more documentation about accessing custom fields here while in the items loop. The same `{items}` loop is available in the cart, checkout and order tag pairs if you need to replicate that functionality on the website.

---
Tags: expresso-store
---


# Question
Title: Outputting specific categories with exp:channel:form
I want my users to be able to post articles so I'm using channel:form to accomplish this, everything's working great but I can't work out how to output categories as checkboxes, I have two category groups that i'd like to output separately, the code i've tried either outputs all categories or none.

I have the following code:

```
{exp:channel:form channel="work" return="contribute/thanks"}
          <p>
            <label for="title">Title</label>
            <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();">
            <input type="hidden" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">
          </p>
<h2>Formats</h2>
          {categories}
            {if category_group_id == 4} {!-- formats --}
            <label class="checkbox">{category_name}
            <input type="checkbox" id="{category_id}" name="{category_id}[]" value="">
            </label>
            {/if}
          {/categories}

          <h2>Industries</h2>
          {categories}
            {if category_group_id == 1} {!-- industries --}
            <label class="checkbox">{category_name}
            <input type="checkbox" id="{category_id}" name="{category_id}[]" value="">
            </label>
            {/if}
          {/categories}

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

{/exp:channel:form}

```

This isn't outputting any categories, seems it's not understanding the if statements? However if I use the code shown on the example (http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/#categories)

```
<label for="categories">Categories</label>
<select name="category[]" id="categories" size="4" multiple="multiple">
  {categories}
    <option value="{category_id}"{selected}>{category_name}</option>
  {/categories}
</select>

```

This outputs all of the categories into one select dropdown, i'm struggling to see how to adapt this, any ideas would be most appreciated!

# Answer
First u can use (show\_group) param in your {categories} loop instead off {if} condition

```
      {categories show_group="4"}
        ......
      {/categories}

      {categories show_group="1"}
        ......
      {/categories}

```

and if you want to use {if} condition then change your code to :

```
      {categories}
        {if {category_group_id} == 4} {!-- formats --}
        ......
        {/if}
      {/categories}

      {categories}
        {if {category_group_id} == 1} {!-- formats --}
        ......
        {/if}
      {/categories}

```

the trick here is to around category\_group\_id variable with parentheses.

Note: this hack is in EE2.8.0 in another version maybe the line number will be different.

Regard's.
> 1 votes

# Answer
Like this for category group with checkbox using Channel Form

```
  {categories show_group="5"}
    <label class="checkbox">{category_name}
    <input type="checkbox" id="{category_id}" name="category[]" value="{category_id}">
    </label><br />
  {/categories}

  {categories show_group="6"}
    <label class="checkbox">{category_name}
    <input type="checkbox" id="{category_id}" name="category[]" value="{category_id}" >
    </label><br />
  {/categories}

```
> 0 votes

---
Tags: categories, safecracker, channel-form
---


# Question
Title: Why are all snippets loading several times on page load?
I have a simple about page being rendered with the content of only one entry and some Low Variables bits. It's rather slow (3.8806 seconds according to the Output Profiler), and the Template Debugging shows that all possible snippets are being loaded 6 times in each page load. The only number I could correlate with that is the number of templates being rendered in the page (aside from the main page, there's embedded template partials for the header and footer, scripts, etc). Am I correct in assuming that all snippet content is being loaded for every time a template is loaded? Is there any way to make it not do that?

# Answer
The snippets are not actually "loading" - they are simply bits of text being stored in memory (much like global variables). They aren't actually processed until they're called. So they're not an overhead problem.

You'll see these being "loaded" each time you run the template engine - which means the primary template, and then each embed.
> 2 votes

---
Tags: templates, performance, snippets
---


# Question
Title: I want to use the reserved word in template group
i am using ee for the first time, and i try to make a web design explanatory website, but I have a problem that the word 'css' cannot be used for template group name because it is a reserved word. I tried /CSS/ but it works only when the address is typed as .com/CSS/ ~ I want to use css instead of CSS. How can I do?

# Answer
Lol, use the word stylesheet or styles. Why are you trying to break all of the eggs in the carton? You'll run into a lot of roadblocks going the route you want to...

Also, at the end of the day, you are going to **not** want to do all your stylesheet editing, or any template editing, in your browser. You should use an ftp client and your preferred editor, saving templates as files. I would suggest getting your development tool-chain in order now, before you go down the rabbit hole.

**Edit**

To be clear, you can't do what you want. It would require insane core EE modification. Pick a different name for that group, or use your assets/css folder and edit them with a tool-chain solution.
> 1 votes

---
Tags: templates
---


# Question
Title: Set control panel site link to open in new window
Is there a way to set the upper right hand website link in the CP to open in a new window or tab?

Thanks!

# Answer
You could use the CP CSS & JS add-on (download link) to inject JS to add the attribute to the link?

```
$('#navigationTabs .msm_sites a').attr("target", "_blank");

```

Tested on EE v2.9.2 & v2.5.3. Don't worry about the msm reference - it's marked as that even if you don't have MSM installed.
> 2 votes

# Answer
I would suggest downloading a custom theme, and modifying the Javascript includes for that theme. All you should need to add to that file is this line:

```
$( '.first_level:last-of-type' ).attr('target', '_blank');

```

And that should hit the last button on your top level menu, which will be the redirect link to your site. Good luck!

*ps* this was tested in EE 2.5, not 2.9+, but I doubt they've changed class names in the CP when still in the same version. Subversion changes like that would break theme compatibility too badly.
> 1 votes

# Answer
Simple. You could edit menu.php file. It's located in system/expressionengine/libraries folder. You must go to the line 321 and change it so:

$menu\_string .= $this-\>\_process\_menu(array('help' =\> $this-\>generate\_help\_link()), 0, TRUE, '', 'external');

Byez
> 0 votes

---
Tags: control-panel
---