title: Category field description

text:
# Question
Title: Category field description
Has anyone seen a plugin or a method where I can set a description for a category field?

I have a client who is uploading wrong image dimensions to the category image field. I want to suggest "please use 500x500" for example.

# Answer
> 1 votes
No add-ons I'm aware of, as most deal with the initial display of categories and groups, rather than the editing page (e.g. Category Construct).

But you could modify the language file for the admin interface and change the title:

expressionengine/language/english/admin\_content\_lang.php line 604:

```
'category_image' =>
'Category Image',

'category_img_blurb' =>
'This is an optional field that enables you to assign an image to your categories.',

```

Ignore the 'category\_img\_blurb' reference as it would seem that's now redundant and not used.

Or if you really want to hack it, expressionengine/views/admin/category\_edit.php line 38 onwards, change to look like this:

```
<div class="category_field">
    <?=form_label(lang('category_image'), 'cat_image')?>
    <?=$cat_image?>
    <span><?=lang('category_img_blurb')?></span>
    <?php if (isset($cat_image_error) AND $cat_image_error !== ''): ?>
        <span class="notice"><?=$cat_image_error?></span>
        <br />
    <?php endif ?>
</div>

```

Added this line in: `<span><?=lang('category_img_blurb')?></span>`

**Update** \- Just thought of a better way. Install this addon. Then add something like this to the JS:

```
$('.pageContents form .category_field label[for="cat_image"]').after('<p>Description of your category field</p>');

```

---
Tags: categories, fields
---


# Question
Title: how to use freeform entry_id on different pages for displaying the result from freeform entries?
I get the entry id and now wanna to display the result on different page for a particular item and all the related information with it.

but not displaying the result as I want?

# Answer
Your question isn't super clear but I believe you are looking to have this for your form tag:

```
{exp:freeform:form return="template_group/template/%%entry_id%%"}
    Form content goes here.
{/exp:freeform:form}

```

The return parameter with that value in the third segment passes along the entry\_id of the submission in the URI. Then you can use the freeform entries tag on your submission template like this:

```
{exp:freeform:entries entry_id="{segment_3}"}
    Submission content goes here.
    {freeform:author}
{/exp:freeform:entries}

```

Freeform entries tag functions just like the channel entries tag.
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: how can I use free form entry id for fetching data on different pages?
Got the entry id but don't know how to use this to fetch the data on different pages.

# Answer
> 0 votes
I'll assume that you have redirected to a page capturing the entry\_id. i.e. `return="some/template/%%entry_id%%`

which would give you /some/template/456

On that page use the {exp:freeform:entries} tag and set the parameter, entry\_id="{segment\_3}"

```
{exp:freeform:entries entry_id="{segment_3}" form_id="111"}

```

With that you should have access to all the data for that entry. don't forget to also set the form\_id parameter.

---
Tags: solspace-freeform
---


title: Entry Layout Plugin issue with Stucture

text:
# Question
Title: Entry Layout Plugin issue with Stucture
In a channel, I've removed the Structure tab, but there's no way to get it back. Or at least, I'm missing it. The tab is gone, but all fields that were in it too and they're not in the Fields list.

I'm talking about 'Structure Parent Entry', 'Structure Page URL', 'Structure Template', 'Hide from nav' and 'Listing Channel'.

Any way of getting them back somehow?

# Answer
> 1 votes
Click 'Reset Publish Layouts" in the bottom right of the tabs panel to put it back to how it was.

---
Tags: structure, entry, publish-layout, layout-variables
---


# Question
Title: Wish a bit help with conditionals and operators
Im trying to show results after search so that if there is under 10, it shows A, but if there is more than 10 results, it shows B. But I dont understand how to make this happen.

I tried this but it wont work: `{if count == '1'}<h4>total results: <span>{absolute_results}</span>.</h4>{if:elseif count > '10'}<h4>There is more than 10 results. Refine your search?</h4>{/if}`

# Answer
> 3 votes
You've almost got it. `{count}` is the current count of the displayed entry in the tag's loop. Think of your entries as a numbered list, the `{count}` is the position in the list.

`{absolute_results}` however is total number of entries in the "list", so you want to build your conditional from it.

Here is one example using your markup:

```
{if count == 1}
    <h4>
        {if absolute_results > 10}
            There are more than ten results. Refine your search?
        {if:else}
            Total results: <span>{absolute_results}</span>
        {/if}
    </h4>
{/if}

```

---
Tags: conditionals, search
---


title: MailChimp integration

text:
# Question
Title: MailChimp integration
Now that SL MailChimp Subscribe is no longer in development\*, is there an alternative that I can use to sign-up members to a MailChimp list?

\*The extension throws a Javascript error for EE2.9.2

# Answer
Take your pick. There are a number of options.

https://devot-ee.com/search/results?keywords=mailchimp&collection=addons&addon\_version\_support=ee2

If you're getting a Javascript error with SL Mailchimp Subscriber then it's probably that it would be simple to fix. If you can provide some more details I'm sure someone could help you out.

But if you want something different then I've recently used Subscriber. Worked perfectly and easy to set up.
> 1 votes

# Answer
Have you looked into Postmaster? It allows you to subscribe people to MailChimp and other platforms plus do additional things based on triggers. Not the cheapest, but definitely worth the money and easy to use.
> 0 votes

---
Tags: mailchimp
---


# Question
Title: Deprecated function set_cookie() in MX Mobile Detect add-on
I'm using MX Mobile Detect by Max Lazar but it doesn't seem to have been updated for a while. Specifically, the Developer Log is showing the following error;

Deprecated function set\_cookie() called in /third\_party/mobile\_detect/pi.mobile\_detect.php on line 238.

Deprecated since 2.8. Use EE\_Input::set\_cookie() instead.

I'm just wondering how I should modify this line?

```
$this->EE->functions->set_cookie( 'mx_mobile_device', $this->cache['mx_mobile_device'], $this->cookie_expire );

```

Thank you.

# Answer
> 0 votes
Use it like this:

```
$this->input->set_cookie('mx_mobile_device', $this->cache['mx_mobile_device'], $this->cookie_expire );
```

---
Tags: mobile, mx-mobile-detect
---


title: Having problem adding new ee field

text:
# Question
Title: Having problem adding new ee field
How do I fix this problem? I've search online and renamed the entry\_type\_lang to lang.entry\_type.php on my cpanel directory but still I get this error Unable to load the requested language file: language/english/entry\_type\_lang.php Anybody can help me out?

i'm using EE2 9.2

# Answer
I used this add on with 2.9.2 a few days ago and it doesn't have this problem. Which makes me think you have installed it incorrectly

If you downloaded it from Github then you should rename the containing folder from rsanchez-entry\_type-0a0e58e to simply "entry\_type".

That folder should then be placed inside system/expressionengine/third\_party
> 1 votes

# Answer
This doesn't sound quite the same but there was a compatibility issue with Low Search 4.2 and entry\_type on EE 2.9.3 recently. Updating Low Search to 4.3+ fixed it. Just mentioning it as a just-in-case...
> 0 votes

---
Tags: entry-type
---


title: Postmaster & Escort Add-on

text:
# Question
Title: Postmaster & Escort Add-on
Does this replace the need for the Escort add-on? I also use Subscriptions by DevDemon, so I may need both, not sure if the two play nicely together or Postmaster simply replaces the need for the Escort module.

# Answer
> 1 votes
Escort will send any and all emails generated by ExpressionEngine (or add-os which use EE's built-in email library) via your selected third-party email service. It's quick an simple.

Postmaster can also do this, but in a more complex manner, if you create a parcel using the send\_system\_email hook. Its advantage is that you could also customize those emails via the Postmaster parcel you create (as you have to build a template for those system emails). But Postmaster's main strength really is in creating custom email notifications which fire when certain events happen.

If you use Escort for your system-generated emails, and Postmaster for custom emails, they will play together just fine.

---
Tags: email, postmaster
---


# Question
Title: Channel Videos youtube video upload: "not supported since april 15 2015"
I have started to have a problem uploading my videos from youtube since April with Channel Videos. Every time I do I only get a youtube place holder video telling me that the app is no longer supported by youtube. Why is this?

# Answer
DevDemon released Channel Videos 3.2 recently which addresses the YouTube API changes. See: https://twitter.com/devdemon/status/596450483788771329
> 1 votes

---
Tags: devdemon, channel-videos
---


title: Assets - 403 forbidden on all requests

text:
# Question
Title: Assets - 403 forbidden on all requests
I seem to be getting 403 forbidden errors when using assets.

I can see this happening in firebug when I try to index folders and if I try to upload a new file, it simply shows an alert saying 'undefined'.

Rooting around in the mcp.assets file I tried echoing the member\_id from:

```
$this->EE->session->userdata('member_id')

```

and it gave me '0' - so perhaps it's not getting the session value for some reason?

If I change the field to the native EE File field, I can upload the files successfully.

I just migrated servers, so it's probably something connected to that as I had it working before. I've tried uninstalling and re-installing the module with no joy.

I'm on Assets 2.1.3 and EE 2.6.1 on a server running PHP 5.3.25

Any suggestions would be great!

# Answer
> 5 votes
Issue appears to be with User Session Type in Security and Settings.

Ensuring that:

```
Control Panel Session Type = Cookies and Session ID
User Session Type = Cookies only

```

seems to fix the issue for me. Flipping the user session type to Cookies and Session ID made the error recur on my setup.

I seemed to be running into issues with sessions on other extensions so the 403 issue appears to be a symptom of a possibly wider issue and not Assets-specific.

# Answer
> 0 votes
This problem may also occur if you have two domains pointing to same expression engine site and you are trying to access asset thru the domain which is not setup as your default domain in expression engine setting(Admin -\> General Configuration -\> URL to the root directory of your site OR Admin -\> System Administration -\> Cookie Settings -\> Cookie Domain). Since you are not accessing asset thru default website domain your request will not be authenticated.

---
Tags: assets
---


title: Postmaster Functions

text:
# Question
Title: Postmaster Functions
**I want to purchase this add-on but not sure if it will fit into what I need. Maybe someone who already has it can let me know?**

1) Can the add-on be setup to email a registered user when that end user submits a new entry (confirming they submitted an entry)? Plus email the admin.

2) Does this email the end user to new updates to their entries? Does Postmaster send an email to the end-user if the admin updates their entry via the ACP or the front end using Channel:Form?

3) A bit of a stretch, but does the add-on have the ability to update a channel entry from an email?

4) Can the add-on notify on a per user basis if I create (as admin) a new entry that I only want them to be contacted on (assign them to get a notification)? I assign it to the member and they get an email saying they have a new entry waiting for them.

Any clarification is greatly appreciated! Thank you!

# Answer
> 1) Can the add-on be setup to email a registered user when that end user submits a new entry (confirming they submitted an entry)? Plus email the admin.

Yes, if you setup a parcel to do this.

> 2) Does this email the end user to new updates to their entries? Does Postmaster send an email to the end-user if the admin updates their entry via the ACP or the front end using Channel:Form?

Yes, if you setup a parcel to do this.

> 3) A bit of a stretch, but does the add-on have the ability to update a channel entry from an email?

No, it does not.

> 4) Can the add-on notify on a per user basis if I create (as admin) a new entry that I only want them to be contacted on (assign them to get a notification)? I assign it to the member and they get an email saying they have a new entry waiting for them.

I don't think so - the conditions under which an email parcel gets sent have Member Group criteria, but not per-member criteria.
> 2 votes

# Answer
I'd like to throw another alternative into the hat...

MX Notify Control

This module is free so you'll not spend any £££ trying it out, and I do beleive it will fulfill point 4, as long as you set up the user to notify as the author at least...
> 1 votes

---
Tags: postmaster
---


title: htaccess/redirection madness

text:
# Question
Title: htaccess/redirection madness
Trying to access a google file on the server which is at http://www.norland.co.uk/googled096ea11cba5b121.html

This is an ExpressionEngine build.

My htaccess rules as follows:

```
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\.norland\.co\.uk$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/college$
RewriteCond %{REQUEST_URI} !^/(college|agency|norlanders|consultancy)/(.*)$
RewriteRule ^(.*)$ /college/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^www\.norland\.co\.uk$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

I would have thought the RewriteCond %{REQUEST\_FILENAME} !-d rule would exclude this but for some reason requesting this is redirecting to http://www.norland.co.uk/college/403.shtml

The 'college' redirection I can understand but not a clue why it is

* redirecting to /403.html
* why the source file cannot be found when I can see it on the server

Help!?

# Answer
Presumably this is all of the htaccess rules? Nothing like the below preventing serving of HTML files entirely?

```
RewriteRule ^(.*)?\.html$ - [F,L]

```
> 0 votes

# Answer
Forgive me I havn't the time to disect your htaccess fully, however the `-d` rule is for directories, granted you have the `-f` file rule as well, I won't comment on why it's ignoring files however (one of the guys here will correct me if I'm wrong) I beleive .html is a declared html file extension according to apache therefor not caught by the `-f`, just like .php or .htm.

Why perform 2 sets of rules though when you can literally achieve what you want with one? I assume `/collage/` needs to be appended in all cases (except the excempt paths) and that there's no actual `www.norland.co.uk/collage` links out there...

Here's a standard htaccess template I use, I've modified it to exclude requests to your google verification file and always add `/collage/` unless the directory is within the exclusions :

```
    #Exclude file paths, directory paths
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$

    #file whitelist, do not rewrite if file is root & name is ...
    RewriteCond $1 !^(favicon\.ico|index\.php|path\.php|php\.ini|admin\.php|googled096ea11cba5b121.html) [NC]

    #directory whitelist, do not rewrite if path begines with ...
    RewriteCond $1 !^(system|sysbase|images|themes|css|assets)/ [NC]

    #Rewrite what needs rewriting
    RewriteRule ^(.*)$ /collage/index.php/$1 [L]

```

Of course, you can add your `HTTP_HOST` rule back in if you've got more than one URl going into the same root directory.

Might not work (so sorry I'm typing on the move so no ability to test), but should give you something to get your teath into!
> 0 votes

---
Tags: htaccess, .htaccess, rewrite, mod-rewrite
---


# Question
Title: How to use page transitions with Expression Engine
I'm trying to use page transitions using smoothstate.js (http://miguel-perez.github.io/smoothState.js/).

What this appears to do is to load the destination of a link in the background when the link is hovered rather than clicked, meaning when it is actually clicked the content is already loaded and can be presented with a smooth transition.

The challenge I'm finding is that I often use an {if segment\_3 != ''} type conditional to use one template to show both a listings AND a detail page and avoid having to create an extra template and add an extra segment to my URL. Something like this...

```
{if segment_3 == ''}

    Listings page to go here...

{if:elseif segment_3 != ''}

    Detail page to go here...

{/if}

```

This seems to cause problems and not load the content on these detail pages correctly. I can only assume this is because when the content is loaded, the URL hasn't changed yet, meaning the EE conditional still comes out as false rather than positive.

Any ideas on how to get around this would be massively helpful and appreciated.

Thanks in advance,

Tom

# Answer
This is a completely front-end issue, as Max Lazar said. There is no way EE template conditionals have anything to do with browser presentation frameworks, only generated content and structure. If you are ajaxing some content, and your URL to the page you want ajaxed is correct, ie:

```
/products/product_category/

```

vs

```
/products/product_category/product_one

```

that template will be parsed exactly as it would be without this front-end framework.

If you can test and give us more details about your templates **without** using this front-end framework, we might be able to help you find a problem with your templates that is completely separate from implementing the framework.

**Update**

After looking at the two page examples, **they are binary equals**. Your issue here comes down to browser behavior with respect to loading stylesheet rules and painting them appropriately. I've run into this thing before; sadly there is no easy or direct solution. I would initially try reloading the stylesheet rules to see if you can get a browser repaint:

https://stackoverflow.com/questions/2024486/is-there-an-easy-way-to-reload-css-without-reloading-the-page

https://stackoverflow.com/questions/13721183/reload-css-stylesheets-with-javascript

http://ajaxian.com/archives/browser-reflows-how-do-they-affect-performance

But I can foresee that getting messy, unless you basically write a jQuery plugin (or vanialla JavaScript library) triggered by a smoothState.js callback of some kind. Either way, this is browser behavior in regards to the particular structure and stylesheet rules of your website. Browsers do not paint the same after load, I believe.
> 1 votes

---
Tags: conditionals, jquery
---


title: Installing Extension Ctrl+S Need Help

text:
# Question
Title: Installing Extension Ctrl+S Need Help
There is an EE extension (Ctrl+S) I want to install, but when I download it, it is just a php file, with no ReadMe file as to where to install it.

I am stuck, I don’t know where to put this, to make it work. I know I am missing something basic, can someone tell me what to do.

Thanks

# Answer
> 1 votes
All kinds of add-ons should be put on their own folders inside `system/expressionengine/third_party/`.

The info on installing plugins can be useful.

Pay attention that the name of the folder should be the same as the add-on without the prefix:

```
no_follow/pi.no_follow.php

```

Extensions also need to be enabled on Control Panel \> Add-ons \> Extensions.

# Answer
> 1 votes
If you mean this plugin : https://devot-ee.com/add-ons/ctrls

I have used this before. the file you get is called `ext.ctrl_s.php`, and you should install it here `/system/expressionengine/third_party/ctrl_s/ext.ctrl_s.php`.

I've just installed this on EE 2.10.1 to test and it works fine. AS mentioned you need to goto `Add-Ons > Extensions` and 'Install' it.

Of course, I've done nothing but expand on Robson's answer above, except I've gone and got the extension for myself to check (assuming I've referred to the right one!). Once you get it working, make sure you mark Robson's answer as correct!

---
Tags: extension
---


# Question
Title: Attempting to use plugin to addslashes in a template not working
I am fairly new to EE so please bare with me. I have an issue where I want to use `addslashes()` on a template tag that is in an array.

```
$product_array["{ProductEntryID}"][] = array(
    'CustomizationNotes' => "{CustomizationNotes}",
);

```

I've used two different plugins with success on my local development environment Format Characters and PHPStringFun. However when I attempt to use them on the production site nothing is output.

Not sure where to go from here any help will be appreciated.

Thanks,
Dan

# Answer
This smacks of Parse order, as Robson and Peter suggest.

if that piece of PHP code is on a template somewhere, I van only assume you want the tags filled in BEFORE the php is executed, therefor set your template to PHP `On` on `Output`. You can also add the addslashes into your php array creation.

By example, first lets echo out the array so we can see what happens when :

```
<?php
$product_array["{ProductEntryID}"][] = array(
  'CustomizationNotes' => addslashes("{CustomizationNotes}"),
);
print "<pre>".print_r($product_array,1)."</pre>";
?>
<span>I am not a number, I am a free span!</span>

```

assuming `{ProductEntryID}` evaluates to '10' and `{CustomizationNotes}` evaluates to "Don't use apostrophies" then, with PHP on Outout the first thing to happen is the tags are parsed, so your template becomes :

```
<?php
$product_array["10"][] = array(
  'CustomizationNotes' => addslashes("Don't use apostrophies"),
);
print "<pre>".print_r($product_array,1)."</pre>";
?>
<span>I am not a number, I am a free span!</span>

```

And neareer the end the php is evaluated so the source you end up with is :

```
<pre>Array\n
(\n
    [10] => Array\n
        (\n
            [0] => Array\n
                (\n
                    [CustomizationNotes] => Don\'t use apostrophies\n
                )\n
\n
    )\n
\n
)\n
</pre>
<span>I am not a number, I am a free span!</span>

```
> 0 votes

---
Tags: plugin, text-formatting, formatting, phpstringfun
---


# Question
Title: Rendering entry titles in dropdown using Stash
I'm trying to render a list of entry titles into a drop menu using Stash. However, I get no results. I modeled my solution using another thread here, but no go. Any help will be appreciated.

```
{exp:stash:set_product_list name="product_list_name" parse_tags="yes"}
   {exp:channel:entries channel="product_profiles"}
        {stash:product_title} {title} {/stash:product_title}
        {stash:product_entry_id} {entry_id} {/stash:product_entry_id}
   {/exp:channel:entries}
{/exp:stash:set_product_list}

```

```
<!--initial display field is blank-->
     <option value="" selected></option>

<!--values show in dropdown--->
     {exp:stash:get_product_list name="product_list_name" unique="yes"}
        <option value="{product_entry_id}">{product_title}</option>
     {/exp:stash:get_product_list}

```

# Answer
> 1 votes
Your usage of the stash tags is slightly wrong. It should be `{exp:stash:set_list}` not `{exp:stash:set_product_list}`. The same applies to your usage of the `{exp:stash:get_list}` tag.

Updating your code to the following should work correctly:

```
{exp:stash:set_list name="product_list_name" parse_tags="yes"}
   {exp:channel:entries channel="product_profiles"}
      {stash:product_title} {title} {/stash:product_title}
      {stash:product_entry_id} {entry_id} {/stash:product_entry_id}
   {/exp:channel:entries}
{/exp:stash:set_list}

<select name="product_select">
    <!--initial display field is blank-->
    <option value="" selected></option>

    <!--values show in dropdown-->
    {exp:stash:get_list name="product_list_name" unique="yes"}
        <option value="{product_entry_id}">{product_title}</option>
    {/exp:stash:get_list}
</select>

```

---
Tags: stash
---


# Question
Title: Restrict related tagger entries to current language (transcribe)
I'm trying to pull back related tag entries restricted to the current language.

Say a news entry has a tag of "YMCA" in the English and Welsh versions then the tagger:related pulls back related entires for the welsh and english version.

I want to be able to restrict related tag entries to the current language.

Is this possible?

```
{exp:channel:entries
  channel="news"
  dynamic="no"
  url_title="{segment_2}"
  limit="3"
  entry_id="{exp:transcribe:entry_ids channel="news"}"
  parse="inward"
}

  {exp:tagger:related entry_id="{entry_id}" custom_fields="news-heading|news-content"}}

    {if tagger:no_entries}<p>No related entries were found.</p>{/if}

    <h2>{tagger:news-heading}</h2>
    {tagger:news-content}

  {/exp:tagger:related}
{/exp:channel:entries}

```

# Answer
> 1 votes
**EDIT** : Ok so I have a solution for you, however it's not ideal. What I've had to do is use PHP and take advantage of embeds and parse order to make this work.

At first I tried to acomplish this with EE tags, and potentually some embeds but I soon got myself into tag and embed hell, the problem is tagger does not honour transcribe and trandscribe doesn't effect tagger related entries. Therefor rather than nesting tagger tags inside transcribe tags and vice versa what I've done is written a small SQL query that will take care of the linking and filtering for us. Here's your main template:

**PHP** is **On** and parsed on **Output**

```
{exp:channel:entries
    channel="news"
    dynamic="no"
    url_title="{segment_2}"
    limit="3"
    parse="inward"
}
    <h1>{title}</h1>

    <?php
        //get the entry ID of the main entry into a PHP variable
        $entry_id = '{entry_id}';

        //use the transcribe:language_links tag to get a list of the availabel abbreviations
        $lang_in = rtrim("{exp:transcribe:language_links has_entry="yes" entry_id="{entry_id}"}{languages}'{abbreviation}',{/languages}{/exp:transcribe:language_links}",',');

        //The magic query, here this one query gets all the entries that the tagger tag is related too like tagger:related does, but then also checks the languages of those returned all at once
        $res = ee()->db->query("
            SELECT tag2.entry_id FROM `exp_tagger_links` as tag1
                JOIN `exp_tagger_links` as tag2 ON tag1.tag_id = tag2.tag_id
                JOIN `exp_transcribe_entries_languages` as trans1 ON tag2.entry_id = trans1.entry_id
                JOIN `exp_transcribe_languages` as trans2 ON trans1.language_id = trans2.id
            WHERE tag1.entry_id = '" . $entry_id . "'
                AND tag1.entry_id != tag2.entry_id
                AND trans1.language_id != 0
                AND trans2.abbreviation IN (" . $lang_in . ")
        ");

        //now its time to process the results if any
        $eids = "";
        if ( $res-> num_rows() > 0 ){
            foreach ( $res->result_array() as $row ){
                $eids .= $row['entry_id'] . "|";
            }
        }
        $eids = rtrim($eids, "|");
    ?>

    {!-- now we feed the result of our PHP query into the embed --}
    {embed="_site/part" eids="<?php echo $eids; ?>"}

{/exp:channel:entries}

```

Ok, so now we have to run PHP based on tag output so we can't then use the PHP to feed other tags parameters, so what we do here is take advantage of an embed template. Embed templates are processed *after* PHP on Output so we can feed our PHP into an embed, as per the above. My child template is fairly simple but you can expand this to whatever you like, as we are now using a standard `channel:entries` loop to display the filtered entries!

```
{exp:channel:entries channel="news" entry_id="{embed:eids}" dynamic="no" transcribe="disable"}
    <h2><sup>{entry_id}</sup>{title}</h2>
{/exp:channel:entries}

```

---

I spun up an example Where I had :

* Entry "One" in English(id:1) and Welsh(id:2), both tagged with "YMCA"
* Entry "Two" in English(id:3) Only, tagged with "YMCA"
* Entry "Three" in English(id:4) and Welsh(id:5), just Welsh version tagged with "YMCA"
* Entry "Four" in English(id:6) and Irish(id:7), just Irish version tagged with "YMCA"

Therefor of we just pull the entire related entries list for "YMCA" we would get id's ; 1, 2, 3, 5 & 7. To prove the test we would expect that when I view your template for "Entry One" we would get (any entry tagged with YMCA available in English or Welsh so) just the id's ; 2, 3 & 5.

Here's a copy paste of my result :

# One

## 2One

## 3Two

## 5Three

This produces the correct result. For completeness, versions used are : EE 2.10.1, Tagger 3.2.1, Transcribe 1.6.2

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


# Question
Title: Using Low Variables & P&T Pill in a Conditional
Having a bit of a weird problem happening with P&T pill field inside Low Variables.

When I used this code:

```
{if "{lv_metasocial_meta_title_display}" == "title_site_name"} | {lv_general_site_name}{/if}

```

It doesn't render out the `{lv_general_site_name}` variable. Moving this outside of the conditional makes it appear.

The options inside the Pill field are:

```
title_only : Meta Data Title Only
title_site_name : Meta Data Title and Site Name

```

Changing the pill values, and also resubmitting the variable multiple times doesn't make this work.

What could be causing this?

I also tried changing the tag to using the Low Variables Single tag, but it throws this error:

```
Fatal error: Call to undefined method Low_fieldtype_bridge::get_setting() in /.../system/expressionengine/third_party/low_variables/mod.low_variables.php on line 148

```

So I've had to just use it as the field name itself, which outputs fine outside of the conditional due to Low Variables Parse tag being wrapped around it.

Any ideas?

# Answer
Make sure **Early Parsing is enabled** for that Pill variable, then use this syntax:

```
{if lv_metasocial_meta_title_display == "title_site_name"}

```

...which is EllisLab's recommended syntax for conditionals.
> 1 votes

---
Tags: pixelandtonic, low-variables, low
---


# Question
Title: Garbled stash:nocache output when in stash:set_list in a nested embed
I'm putting together a sort of ViewModel-ish setup and getting strange output from `{stash:nocache}`

Here's the setup. First, the EE template:

```
{stash:embed
  context="@URI"
  file_name="viewmodels:detail"
  parse_stage="both"
  stash:_type="blog"
  stash:_layout="standard"
 }

```

### viewmodels/detail.html

```
{stash:embed:layouts:{stash:_layout} priority="1"}

{stash:embed
  file_name="viewmodels:detail:{stash:_type}"}

```

### viewmodels/detail/blog.html

```
{exp:channel:entries [single entry parameters...]}

[SNIP store some other data, eg title, body…]

  {exp:stash:set_list name="post_links" parse_conditionals="yes" parse_tags="yes"}
    [SNIP some other items…]

    {stash:link}
      {if forum_topic}
        {path='forums/viewthread'}/{forum_topic_id}/
      {if:else}
        {stash:nocache}
          {if logged_in}
            {path='/forums/newtopic/18/'}
          {if:else}
            /forums/member/login/
          {/if}
        {/stash:nocache}
      {/if}
    {/stash:link}
    {stash:text}
      {if forum_topic}
        Discuss in the forums
      {if:else}
        {stash:nocache}
        {if logged_out}Log in and start{if:else}Start{/if} a discussion in the forums
        {/stash:nocache}
      {/if}
    {/stash:text}

  {/exp:stash:set_list}

{/exp:channel:entries}

```

### layouts/standard.html

(part of it)

```
{exp:stash:get_list name="post_links"}
  <a href="{link}">{text}</a> <br/>
{/exp:stash:get_list}

```

All told, that outputs

```
<a href="[_Stash_1_SOMERANDOMLETTERSANDNUMBERS]">[_Stash_2_SOMERANDOMLETTERSANDNUMBERS]</a> <br/>

```

At first I thought it might an issue using `{stash:nocache}` within the `{stash:KEY}` elements of `{exp:stash:set_list}`, so I tried `prefix="CUSTOM"` on any/all of the `{stash:embed}`s and using `{CUSTOM:nocache}`, but that got me the same sort of garbled result. No combination of `parse_stage="both"` on any of the nested embeds seemed to make a difference either.

Extra weird, if I place the contents of `viewmodels/detail/blog.html` directly in 'viewmodels/detail.html' instead of the nested embed and just use `{stash:nocache}`, that works OK. So I could do that. But if anyone has any ideas why those list/`{stash:nocache}` elements are getting parsed that way so I could use the nested embed, that'd be useful.

# Answer
> 0 votes
Nevermind, looks like the issue was not having a distinct enough name for the stash list. "videos" was changed to "related\_videos" and this solved the issue

---
Tags: stash, embeds, caching, list
---


# Question
Title: Expresso Store: Return page from payment gateway error: form has expired
I'm using a custom gateway (offsite) for exp-resso store; upon successful transaction the return page gives out "This form has expired. Please refresh and try again."

The transaction is captured albeit not completed.

I'm using the default store\_example templates.

Edit: EE ver 2.9.3; Exp-resso 2.5.0

# Answer
Are you using the "return" parameter?

```
{exp:store:checkout return="order/ORDER_HASH"}
    <input type="submit" name="submit" value="Place Order" />
{/exp:store:checkout}

```
> 1 votes

---
Tags: expresso-store
---


title: DevDemon Tagger Related Image Entries

text:
# Question
Title: DevDemon Tagger Related Image Entries
Having difficulties pulling back the correct image for related entries. It's pulling back the same image as the main entry and not the related entries image.

```
{exp:channel:entries
channel="{news_channel}"
dynamic="no"
limit="3"
url_title="{segment_2}"
parse="inward"
}

{exp:tagger:related entry_id="{tagger:entry:id}" url_title="{segment_2}" custom_fields="news-heading|news-summary"}

    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{tagger:news-heading}</h2>
    {tagger:news-summary}{/exp:trunchtml}</p>

{/exp:tagger:related}
{/exp:channel:entries}

```

Tried using {tagger:news-thumbnail:medium} also but still no luck.

# Answer
> 0 votes
Not all custom fields will work. Unfortunately several fieldtypes rely on secondary tables in the db. You will need to embed another entries tag to make it work. For example:

```
    {exp:channel:entries
channel="{news_channel}"
dynamic="no"
limit="3"
url_title="{segment_2}"
parse="inward"
}

{exp:tagger:related entry_id="{entry_id}" url_title="{segment_2}" custom_fields="news-heading|news-summary"}

    {embed="news/.related" id="{tagger:entry_id}"}

{/exp:tagger:related}
{/exp:channel:entries}

```

Then on your .related template

```
 {exp:channel:entries channel="news" entry_id="{embed:id}" dynamic="no"}
    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{tagger:news-heading}</h2>
    {tagger:news-summary}{/exp:trunchtml}</p>
{/exp:channel:entries}

```

Also you had {tagger:entry\_id} in your inner loop, not sure how your code worked at all.

Brad

# Answer
> 0 votes
Thanks Brad, much appreciated :)

For reference I needed to remove the tagger: off the custom fields in the embed for them to show. But all working :)

```
{exp:channel:entries channel="news" entry_id="{embed:id}" dynamic="no"}
    <img src="{news-thumbnail:medium}" alt=" "/>
    <h2>{news-heading}</h2>
    {news-summary}
{/exp:channel:entries}

```

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


# Question
Title: Heavy CPU load on MediaTemple: help decipher from TOP query
For one of our clients, we have unusually high CPU/DB load. Here's what we got from the host:

> 1878 clientsite 20 0 213m 43m 8088 R 18.7 2.3 0:05.86 /usr/bin/php-cgi -c /var/www/vhosts/acme.com/etc/php.ini 1903 clientsite 20 0 219m 48m 7988 R 12.8 2.5 0:04.06 /usr/bin/php-cgi -c /var/www/vhosts/acme.com/etc/php.ini 1900 clientsite 20 0 214m 44m 8088 R 12.5 2.3 0:02.97 /usr/bin/php-cgi -c /var/www/vhosts/acme.com/etc/php.ini

Another appears to be from your database:

> 1005 mysql 20 0 282m 48m 6564 S 26.0 2.5 3:08.51 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log

Is there anyway we can find out what part of EE (if any) that's causing the load? We're having very frequent "Internal Server Error" site outtages.

Thank you all!

# Answer
> 0 votes
New Relic will help troubleshooting bottlenecks, but this particular issue turned out to be a Plesk service issue.

We had to restart the Plesk service on the server after a few tweaks, and the site became a lot more stable. So, at least on this particular site, the culprit wasn't EE nor the server itself, but Plesk.

# Answer
> 1 votes
New Relic is a fabulous tool for this.

---
Tags: error, performance, server
---


title: Best way to store SVGs?

text:
# Question
Title: Best way to store SVGs?
What are some ways to store full SVGs to later embed onto a page? I'm thinking of setting a multiline plain text field to store the raw SVG.

Maybe save the file and embed it onto the page via javascript or php?

# Answer
However you'd like. Yes, you could store them in a multiline plain text field, but why not use them as SVG files? Unless you are using channel entries to generate CSS content (which would be a very weird thing to do, unless you're specifically making a site that allows people to play with the SVG format), SVG files can be loaded by most modern browsers just fine. And the only other place to use them is in your stylesheets.

I gather you just want a way to store the plaintext of an SVG string. So you already have your answer.

http://caniuse.com/#feat=svg

http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#SVG\_in\_HTML

References in case you needed them.
> 1 votes

---
Tags: fieldtype
---


title: Colour code week 1 and week 2 per month

text:
# Question
Title: Colour code week 1 and week 2 per month
Is there a way to apply a class (so the week can be coloured) to week A and week A using Solspace Calendar as per the screengrab? Thanks

# Answer
> 0 votes
Users in the past have used categories for differentiating events. Depending on the category the event is associated with, a different class would be used in the calendar table cell. A lot depends on your template code, but the `{categories}{/categories}` tag pair should be useable.

There might be other strategies, such as using a custom field (eg. select field) to do something similar.

---
Tags: solspace-calendar
---


# Question
Title: Stash List Passed to Embed - Adding Blank Items
Wondering if this is a bug or a parse order issue (probably parse\_order).

Code is below, but basically i am trying to work with template partials approach and showing related videos for an article entry. The related videos field is a relationship and it can accept multiple.

In the main article template i store all related videos in a list. Then embed a partial below to display the videos.

The using stash:get\_list in the embed to loop through the videos.

The issue i am seeing is that in the main template the list has 1 item, but once in the embed, the list has 5 items, 4 of which are blank records.

Working on Stash 2.6.0 and EE 2.9.2

---Main template article/view.html

```
{!-- Channel Entries --}
{exp:channel:entries channel="article" url_title="{segment_2}" limit="1"}

{!-- RELATED VIDEOS --}
{article_videos status="open|Featured"}
   {exp:stash:append_list name="videos" trim="yes" parse_tags="yes"}
      {stash:video_entry_id}{article_videos:entry_id}{/stash:video_entry_id}
   {/exp:stash:append_list}
{/article_videos}

{!-- DEBUG, OUTPUT = 1 --}
{exp:stash:get_list name="videos" prefix="related_videos"}
   {related_videos:total_results}
{/exp:stash:get_list}

{stash:embed:partials:videos}

{/exp:channel:entries}

```

---Embedded stash partial stash\_embeds/partials/videos.html

```
{!-- DEBUG, OUTPUT = 5 --}
{exp:stash:get_list name="videos" prefix="related_videos"}
   {related_videos:total_results}
{/exp:stash:get_list}

```

Odd indeed, but it is messing up our conditionals and showing a bunch of blank images and cells.

Thanks, in advance

# Answer
This is odd indeed! Have you tried moving the partial outside of the `exp:channel:entries` loop? In case its a parsing bug and the `stash:embed:partials:videos` tag is getting replaced multiple times or there's a parse order thing within stash?

Also, have you tried a straight forward `{embed=""}` on the videos partial, instead of the stash method?

Either of these methods may yeild clues if not a work around. Let us know how you get on!
> 0 votes

---
Tags: stash
---


# Question
Title: The options loop in channel entries form does not accept an offset
I'm trying to add an offset parameter to the options loop within a Channel Entries form. While it accepts a limit, it simply ignores the offset. Here's an example:

```
{exp:channel:form channel="channel1"}
  {options:channel_name limit="4" offset="4"}
    {option_name}
    # limit="4" works, offset="4" doesn't
  {options:channel_name}
{/exp:channel:form}

```

**How can I add an offset?** I'm using this on a channel form.

# Answer
A word of warning, you could achieve this with PHP on a template (though some here don't like the idea of PHP on templates!).

Instead of tring to use the limit/offset syntax, lets push out options into a PHP array, then we'll do the array limits and offsets ourselves!

**PHP On = Output**

```
<?php
$options = array();
function print_options($limit, $offset){
  foreach( array_slice($options, $offset, $limit, true) as $option ) {
    print $option;
  }
}
?>
{exp:channel:form channel="channel1"}
  {options:channel_name}
    <?php $options[] = '<option value="{option_value}">{option_name}</option>'; ?>
  {options:channel_name}

  <select>
    <?php print_options(4, 4); ?>
  </select>
{/exp:channel:form}

```

Untested but hopefully you'll get the idea if I've not type-o'd in my code...

**Edit**: Simpler version, removed unneeded function and potential var scope issue.

**PHP On = Output**

```
{exp:channel:form channel="channel1"}
  {options:channel_name}
    <?php $options[] = '<option value="{option_value}">{option_name}</option>'; ?>
  {options:channel_name}

  <select>
    <?php
      //array_slice parameters = options array, limit, offset, preseveKeys
      foreach( array_slice($options, 4, 4, true) as $option ) {
        print $option;
      }
    ?>
  </select>
{/exp:channel:form}

```
> 1 votes

---
Tags: safecracker, loop
---


# Question
Title: Security test fails on freemember:update_profile form
**EDIT**

This question is related to compliance to a specific security test, the problem has nothing to do with Freemember extension. For the record : The solution found to pass the test was to simply str\_replace the posted data to remove anything between \< \> before it's sent to the database.

---

Security test flags : **Cross-Site Scripting: Persistent** on freemember:update\_profile form

The test machine manages to insert javascript code in the form fields

Any ideas ?

# Answer
I would assume that freemember is either pulling in values from the form using the unclean `$_POST` array or using `ee()->input->post('var_name');` (note the lack of second security parameter which should be `true`). I suspect the former as using the EE function (on latest 2.10.1) I *beleive* still strips dangerous script tags regardless of the XSS\_Clean parameter.

Because of the lack of detail here I can only surmise, however I would take a look through the modules code, identify where it gets the posted values and change the method of retrieval to

```
ee()->input->post('var_name', true);

```

This should then parse and clean the posts.

Another alternative is that you've changede the XSS Cleaning setting (in `Admin > Security`) to no or off. Please review this setting.

If I where you I'd submit this as a bug on freemember if your security settings are correct but it's still defeating them, the module is by DevDemon so you can submit an issue here

Lastly, you *have* set an encryption key on freemember, right?? Docs
> 0 votes

---
Tags: freemember, security, xss
---


# Question
Title: Solspace Calendar - Server Errors and Memory Issues
I am running Calendar 1.8.13 on EE 2.8.1 and I am getting 500 Server Errors and Memory warnings when I try and access calendar event detail pages.

Here is the memory error:

> Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in .../codeigniter/system/libraries/Typography.php on line 306

I tried allocating more memory - up to 512MB but the errors keep coming.

The site was built last year and has worked without issue until recently when the the server errors began happening.

Here is the code for the page:

```
{exp:calendar:events
limit="1"
event_name="{segment_3}"
dynamic="no" }
<h3>{event_title}</h3>

<div id="event-details">

    <h4>When:</h4>
        <p>
      {if event_recurs}
         {exp:calendar:date
            base_date="{segment_4}-{segment_5}-{segment_6}"
            output_date="today"
         }
            {date format="%l, %F %j"} @ {event_start_date format="%g:%i%a"}
         {/exp:calendar:date}
      {if:else}
         {event_start_date format="%l, %F %j @ %g:%i%a"}
      {/if}
   </p>

    <h4>Location:</h4>
    <p>{event_location}
        {if event_address}<br />
            {event_address}
        {/if}
    </p>

    <h4>Admission:</h4>
    <p>{admission}</p>

    <h4>Contact</h4>
    <p>{contact_phone}</p>

{/exp:calendar:events}

<div id="more-events">
        <h4>More Events</h4>

{exp:calendar:cal
    calendar_id="11"
    date_range_start="{segment_3}-{segment_4}-{segment_5}"
    date_range_end="{segment_3}-{segment_4}-{segment_5}"
    pad_short_weeks="n"
    event_limit="3"
    dynamic="off"}
    <div class="event-mini">
        <span>{event_start_date format="%m.%d"}</span>
        <p><a href="{path='calendar/event'}/{event_id}/">{event_title}</a></p>
     <div class="clearer"></div>
    </div>
{/exp:calendar:cal}

 <p  class="more-events"><a href="{site_url}calendar/">{ More Events }</a> </p>
</div><!-- #more-events -->

</div><!-- end #event-details -->

<div id="event-full-description">
{exp:calendar:events orderby="title" sort="asc" limit="1" event_name="{segment_3}" date_range_start="today" show_months="6" dynamic="off"}
        {event_summary}
    {/exp:calendar:events}

```

Any assistance in sorting this out would be appreciated.

# Answer
Do not use ini\_set()! It is only a temporary value change; after script execution ends the value returns to what is set in your configuartion file, and Solspace Calendar might be curling the server for all we know (I don't use it, I'm sure it's great).

Set the memory\_limit higher in your php.ini file. Then make sure to restart Apache/Nginx or whatever your PHP agent is. And admin.php shouldn't be executing on a template page view anyways, so ini\_set() wouldn't be your solution unless you made sure it was in index.php. You have a much better chance at testing this by putting

```
ini_set('memory_limit','512M');

```

at the beginning of your index.php file, but only use this for testing. If you're concerned about that particular template/page load, you can track down the load path or put a conditional in your index.php to only change the memory\_limit if it's hitting a particular page.
> 2 votes

---
Tags: solspace-calendar, php-errors, memory
---


# Question
Title: Are the following addons compitable with EE 2.8.1
Going to upgrade a site from EE 2.5.3 to 2.8.1

Are following addons compatible with EE 2.8.1?

* Assets
* Cartthrob
* Cartthrob Order Manager
* Channel Images
* Wygwam
* Playa
* Matrix
* Simple S3 Uploader
* CE Image
* AJW Export
* Profile:Edit
* Field Editor
* Ct Admin, User

Sorry to ask such question here. But I found many of those addons owner ask to post question here. Going to tag the question by addon name.

Thanks

# Answer
> 1 votes
I am using following add-ons with EE2.8.1 from your list.

```
 1. Assets
 2. Cartthrob
 3. Cartthrob Order Manager
 4. Channel Images
 5. Wygwam
 6. Playa
 7. Matrix
 8. Profile:Edit

```

# Answer
> 0 votes
There is a patch to manually update Simple S3 Uploader to work with 2.8.1 which can be found here:

http://devot-ee.com/add-ons/support/simple-s3-uploader/viewthread/12869

I'm finding errors on the backend of the server with Matrix at present.

I'd hold off to upgrading presently as there are many issues with addons not being updated to work correctly with 2.8.1.

Also there is an update page for Solspace addons to confirm if they are operating with the new version of EE:

http://www.solspace.com/software/compatibility

In other words, none of your current list of Solspace addons are ready yet.

# Answer
> 0 votes
Playa is playing some tricks - it actually throwing errors when you try access it from CP field types. Wygwam is working Freeform is working Matrix is working Channel images had some problems, but since I got in touch with their support and after replacing with edge version they sent me - everything ran fine.

The rest of your add-ons it seems I;m not using it

# Answer
> 0 votes
Since I use EE 2.7xxx field editor doesn't work anymore, even on a fresh install. Playa, Matrix, Wygwam, CE image works fine with EE2.8.1 installed, no problems related.

# Answer
> 0 votes
Actually the solution of the problem with Playa upgrade from previous version to 4.4.5 and DB error when you try to configure the field type:

is described here

Same answer I've got from Pixel & Tonic support.

# Answer
> 0 votes
I am using all these with EE2.9 with basically no issues:

```
Assets
Cartthrob
Cartthrob Order Manager
Wygwam
Playa
Matrix
CE Image
Profile:Edit
Field Editor
Ct Admin, User

```

The only one I am having issues with is Wygwam actually. I am finding some pages are CPU spiking and then timing out **depending on the content in that field**. I have to do some more testing and then will contact P & T about it, but if I remove the stashing of that field, the page loads quickly, add it back and it cpu spikes and never renders.

It's only on a few pages on the site, so it must be ?specific content related? - overall it's all working quite smoothly although I did need to attend to some session/login/forms/xid hash stuff as this all changed a bit after 2.8.1 - see After upgrading to EE 2.9.0 my front-end login page no longer works

...and a few conditionals needed a bit of revising with the new conditionals parse, but all in all way less pain that I expected (2.7.2 -\> 2.9 in my case)

---
Tags: cartthrob, pixelandtonic, solspace, ce-image
---


title: Ajax Login plugin

text:
# Question
Title: Ajax Login plugin
Looking for a plugin to get Ajax login functionality - can see a couple in Devote:ee but they seem to be pretty old and looks like a few of them aren't supported and/or have no developer response on the forums there.

Can anyone recommend an actively supported good plugin for this? Thanks!

# Answer
I'll post my answer from my comment above down here.

FreeMember is a great, free plugin that allows some flexibility.
> 1 votes

# Answer
AJAX Auth is supported and compatible with latest EE versions. If you need support or have pre-sales questions, email me directly to support@intoeetive.com
> 1 votes

---
Tags: login, ajax
---


# Question
Title: Is there any plugin for US map functionality means on clicking the particular area we get the updates about that?
Map for showing the data on clicking a particular area.

# Answer
Depends on your approach and what you want to display information wise.

I built this map using Entry data which populates hidden DOM objects that are shown and hidden depending on the state clicked. The SVG maps are open source with each state marked with ID and classes, although I had to customise to fit Alaska and Islands. Easy enough to colourise and specify the colouring via the entry data.

An alternative is Google maps, which you can utilise a couple of add-ons (ObjctiveHTML or Rein de Vries), I've used both, but to be honest I find it easier to talk to the Google Maps API directly in JS fed by entry data stored via templates, or if you're using a lot of data, load via Ajax after page load. There are other add-on options depending on your requirement.

Not sure why the question has been tagged with "Solspace Freeform" though...?
> 1 votes

---
Tags: custom-fields, fields
---


# Question
Title: can I Use dynamic parameter more than one time on a template in expressionengine
can I Use dynamic parameter more than one time (conditionally) on a template in expressionengine.

like

```
{if case1}
{exp:channel:entries ..... dynamic="off"}
stuff
{/exp:channel:entries}
{if:else}
{exp:channel:entries ..... dynamic="off"}
stuff
{/exp:channel:entries}
{/if}

```

# Answer
> 1 votes
Yes, you can use the dynamic parameter more than one time in a template and you can use it inside conditionals as well.

---
Tags: ee
---


# Question
Title: Expresso Store Discounts page takes ages to load with DB with lots of entries
I’ve spotted an issue with the Expresso Store discounts detail page:

i.e. /cp/addons\_modules/show\_module\_cp?module=store&sc=discounts&sm=edit&id=1

If you have ‘lots of entries’ (we have 124,114) then the discounts page take forever to load as it attempts to populate the ‘Match Entries’ multi select field with every single entry in the CMS!

Any thoughts on how we can fix/hack this so it’s usable?

:/

# Answer
The simple 'hack' to resolve this if you don't plan on using entries as a filter for discounts is to modify line 96 in DiscountsController.php to read:

```
$data['product_options'] = NULL;

```

It means you can no longer apply discounts on a per entry basis but it's a fix for the very slow loading of the form if you don't require that ability! :)
> 0 votes

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


title: P&T Matrix error after upgrade to 2.5.5

text:
# Question
Title: P&T Matrix error after upgrade to 2.5.5
I upgraded an EE site to 2.6.1 yesterday and then Matrix from 2.0.8 to 2.5.5. However when I went to Add-ons \> Fieldtypes \> Matrix, nothing happened. Isn't there supposed to be an upgrade script?

When I try to edit any entries, I get the following error:

```
A Database Error Occurred

Error Number: 1054

Unknown column 'is_draft' in 'where clause'

SELECT row_id, col_id_1, col_id_2, col_id_3 FROM exp_matrix_data WHERE field_id = 1 AND entry_id = 3 AND is_draft = 0 ORDER BY row_order ASC

Filename: third_party/matrix/ft.matrix.php

Line Number: 2912

```

I have tried uploading the Matrix files again and then to upgrade but still doesn't work.

# Answer
Use Field pack instead. P&T deprecated for newer versions of expressionengine.

it will copy your data into itself. so you don't need to worry about datta lose as well.
> 0 votes

---
Tags: matrix, upgrade
---


# Question
Title: Output List of P&T Dropdown Field Options
I was hoping to output the available options in my P&T Fieldpack Dropdown field with a template (into a dropdown used to filter results) but am having no luck.

I've seen some folks referencing a tag pair like {options:papers\_type} but I'm getting nowhere. Is anyone else familiar with how to do this?

Feels like I must be missing something. Merci!

# Answer
> 2 votes
Low Options can output native and P&T dropdown options in your templates.

# Answer
> 0 votes
it doesn't look like your missing anything, I've checke the docs but they are a little spartan to say the least...

If yuo wanted to simply display the field within a {exp:channel:form} SAEF it seems you can use the `{field:var_name}` syntax, you should also be abel to use the variable tag pair syntax within the Cahnnel Form. However it sounds like you just want to use the options in a custom dropdown as you mention 'a filter'

You still have some options, but if you're dead set on extracting the optoins from the P&T Dropdown on a Channel Field (rather than recreating them in a snippet/global variable or summin) you could roll your own PHP Sql query to get them or attempt to use the EE Template API to get the options/render the field again using PHP.

Let me know if you want a concise example, I'll have to knock one together. However in the meantime these docs might get you on the right path...

**Edit**: Been a while since I dipped into the Channel Fields API, so I tried an example. The following snippet will get you the options (as a key =\> value array) for a P&T Dropdown, provided you know the Channel (1) and Field ID (3) :

```
<?php

  //instansiate the channel entries API
  ee()->load->library('api');
  ee()->api->instantiate('channel_fields');

  //assuming Channle has ID of 1
  $channelSettings = ee()->api_channel_fields->setup_entry_settings('1', array());

  //assuming dropdown is field ID of 3
  $fieldOptions = empty($channelSettings['field_id_3']['options']) : array() ? $channelSettings['field_id_3']['options'];
?>

```

---
Tags: field-pack, drop-down, pt-dropdown
---


# Question
Title: Entry Category within channel:entries within options: loop within channel:form
I'm trying to display the channel entry category with `{categories}{category_name}{/categories}` but nothing shows up. I'm assuming that the `channel:form` somehow interferes with the `channel:entries` loop.

```
{exp:channel:form channel="message_on_hold" secure_return="yes" return="order/moh-checkout/ENTRY_ID" member_data="yes" error_handling="inline" secure_action="yes" entry_id="{segment_3}"}
  {options:moh_music}
    {if option_value != ''}

      <input type="radio" name="moh_music[data][]" value="{option_value}"{checked}>

      {exp:channel:entries entry_id="{option_value}" dynamic="no" limit="1"}
         {categories}{category_name}{/categories} ### Doesn't work, shows nothing
      {/exp:channel:entries}

    {/if}
  {/options:moh_music}
{/exp:channel:form}

```

# Answer
> 0 votes
is the channel you are linking to in the relationship field properly set up with a relivent category group (in Channel Preferences)?

Remember that within the `channel_entries` tag we are working on the child channel entries, not the parent!

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


# Question
Title: Offloading comments/login to thirdparty from Expressionengine to speed up website
Developing for potential high traffic website (Startup) which will be kind of like a news website ( Heavy on reading). One of the ways user will interact will be through comments. Thus a social login comment, and threaded comment is in consideration.

Question

Will offloading the login/comment/analytics to third party like disqus/livefyre/ intense debate etc will have any positive impact in sense that more concurrent users can be handled by the server. i.e. will having logged in users vs having NO logged in users will have better performance. e.g. Full page Static caching can be potentially used if you have no comments/login as Javascript will will be used for both login/comment and analytics

Note: This maybe not expression engine specific, even then what is opinion for handling high traffic with good efficiency for read heavy site.

Edited for simplicity.

# Answer
> 1 votes
Do you only need login to post said comments?

Perhaps all you need is Disqus? Modules already available : CX Disqus Comments, Alternatives

Of course, by outsourcing your comments and social login to Discus (or another) you will lose the overhead of managing and developing an EE userbase, however if you wanted to sync your users so they can also log into your site that will work.

You'll benifit from having your comments/discussions/arguements off site, likewise unless you want to sync your users you'll do away with the EE member stuff completely. YOu could use a social login plugin to extend this to cover native polls ect, continuing the "No need for my own members" philosophy.

As for loading and traffic, EE can handle large user bases (I have a couple of sites with numbers in the hundreds of thousands) however by using social login you're avoiding session handling in EE, posibly gaining a bit from the asyncronous nature. Of course this does add a JS dependancy to your site...

---
Tags: login, comments
---


# Question
Title: Expresso Store - Create order programmically
Is there a way to create an Exp:resso Store order programmatically? Whats the minimum requirements for it to show in the dashboard and be a valid order.

Thanks K

# Answer
> 1 votes
Store is fairly abstracted when it comes to order data. Take a look in the database at the tables starting with `exp_store_order...` \- these all come into play for a single order.

Also, if you want to record payments of any kind with an order, you'll need an entry in `exp_store_transactions`.

---
Tags: expresso-store
---


# Question
Title: Using a custom jquery plugin in a custom module
To use a jquery plugin in a control panel view the following is used in the module's mcp file:

```
ee()->cp->add_js_script(array('plugin' => 'dataTables'));

```

however I have a custom jqueru plugin, how do I load that into a control panel view? Where will the code above look for jquery plugins?

# Answer
Third party add-ons should store their javascript files in their *javascript* folder, and then loading them using:

```
ee()->cp->load_package_js('my_file');

```

(Docs.)

`ee()->cp->add_js_script()` will only load javascript which EE includes in the download for its own use.
> 0 votes

---
Tags: module
---


# Question
Title: CartThrob - Send customer IP to Authorize.net
Does anyone know how to send a customers IP address to authorize.net when an order is placed in CartThrob. The IP is currently saved in the orders channel but I don't know to send it to authorize.net.

# Answer
> 1 votes
I was able to send the IP address to authorize.net by adding:

```
"x_customer_ip"                 => $this->order('ip_address')

```

to the process\_payment function in Carthrob\_authorize\_net.php.

---
Tags: cartthrob
---


title: Add/Edit Form in Custom Module

text:
# Question
Title: Add/Edit Form in Custom Module
Developing a form using custom module for members to update football match day statistics. These include team sheets, goals substitutions. I have been able to get the team sheets working grand but stuck on adding in the goal scorers. On my form I will have to have a row per goal, so if a team scores 1,2,X amount of goals in the game I will need the same amount of rows. The data to be saved will be player, time of goal and whether a penalty or not.

I have a drop down list for the players name, textbox for time and a checkbox for penalty.

What I need help with is how to display the number of rows per goal. And I would also like use the same form for adding and editing the goals.

My module function

```
public function match_stats(){

    $match_id = ee()->TMPL->fetch_param('match_id');
    $team_id = ee()->TMPL->fetch_param('team_id');
    $match = ee()->clubmanager_matches->__get_match($match_id);
    $sql = "SELECT club_id FROM exp_ca_exec_clubs where member_id = ?";
    $query = ee()->db->query($sql, array(ee()->session->userdata('member_id')));

    $club_id = $query->row()->club_id;
    $season_id = 16;

    // Build an array to hold the form's hidden fields
    $hidden_fields = array(
        "match_id" => $match_id,
        "club_id" => $club_id,
        "team_id" => $team_id,
        "season_id" => $season_id,
        "ACT" => ee()->functions->fetch_action_id( 'Clubmanager', 'match_team_action' ),
        "return" => ee()->TMPL->fetch_param('return')
    );

    // Build an array with the form data
    $form_data = array(
        // Send form back to this url - the action must be the same as the form
        "action" => ee()->functions->create_url( ee()->uri->uri_string ),
        "id" => ee()->TMPL->form_id,
        "class" => 'form-horizontal',
        "hidden_fields" => $hidden_fields
    );

    // Make sure errors is actually an array
    if( ! is_array( self::$errors ) ) {
        self::$errors = array();
    }

    // Match Stats Goals
    $matchPlayersList = ee()->clubmanager_players->__get_match_players_list($team_id, $match_id);
    $clubplayerslist = ee()->clubmanager_players->__get_club_players_list($club_id,  $season_id);

    if($matchPlayersList > 0):
        $variables['players'] = $matchPlayersList;
    else:
        $variables['players'] = $clubplayerslist;
    endif;

    // Set up array to parse tagdata
    $variables['errors'] = array(
        array( self::$errors )// list of error messages
    );

    // Fetch contents of the tag pair, ie, the form contents
    $tagdata = ee()->TMPL->tagdata;

    // Parse tagdata for errors/submitted values
    $tagdata = ee()->TMPL->parse_variables_row( $tagdata, $variables );

    // Create the form
    $form = ee()->functions->form_declaration($form_data) .
        $tagdata .
        "</form>";

    return $form;

}

```

My template code

```
{exp:clubmanager:match_stats
                    match_id="{segment_3}"
                    team_id="{segment_4}"
                    return="clubhouse/fixtures/edit-success"
}
 <!--Table Search v1-->
                <div class="table-search-v1 margin-bottom-20">
                    <div class="table-responsive">
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>Player Name</th>
                                    <th>Assist Player Name</th>
                                    <th>Goal Time</th>
                                    <th>Penalty</th>
                                    <th>Status</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>

                                      <select name="player_goal">
                                        <option value="0">Select Player</option>
                                        {players}
                                        <option value="{id}">{name}</option>
                                        {/players}
                                      </select>

                                    </td>
                                     <td>
                                        <select name="player_assist">
                                        <option value="0">Select Player</option>
                                        {players}
                                        <option value="{id}">{name}</option>
                                        {/players}
                                      </select>
                                    </td>
                                        <!-- Text input-->
                                     <td>
                                      <input type="text" placeholder="time"     class="form-control" name="time" value="{time}"  />
                                    </td>
                                    <td>

                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <!--End Table Search v1-->

```

# Answer
I would use a grid field type, and programatically set the new rows on your template.

Ref :
> 0 votes

# Answer
So after some head scratching I have came up with this as they way to do it. There are going to be better ways to do this but this works for me at the moment. I have only included the main part of the code to build out the form tags.

```
// If no recorded goals fill out form with blank rows for score
    if($recorded_goals == 0){
        $num = 1;
        $goals = array();
        for ($i = 0; $i < $score; $i++){
            $goals[] = array('num' => $num++,
                             'row' => $i
                );
            }
        $variables['goals'] =  $goals ;
    }elseif($recorded_goal_count >= $score){// Display all recorded goals in the form.
                foreach ($recorded_goals as $row){
                    $i=0;
                    $num = 1;
                    $goals = array();
                    foreach ($recorded_goals as $goal)
                    {
                        $goals[] = array('num' => $num++,
                                         'row' => $i++,
                                         'goal_id' => $goal['goal_id'],
                                         'player_name' => $goal['player_name'],
                                         'player_id' => $goal['player_id'],
                                         'assist_name' => $goal['assist_name'],
                                         'assist_id' => $goal['assist_id'],
                                         'goal_id' => $goal['goal_id'],
                                         'time' => $goal['time'],
                                         'penalty' => $goal['penalty']
                                        );
                    }
                    $variables['goals'] =  $goals ;
                }
    }elseif($recorded_goal_count < $score){//Not enough recorded goals fill form will data and blank rows.
        foreach ($recorded_goals as $row){
            $i=0;
            $num = 1;
            $goals = array();
                foreach ($recorded_goals as $goal)
                {
                    $goals[] = array('num' => $num++,
                                     'row' => $i++,
                                     'goal_id' => $goal['goal_id'],
                                     'player_name' => $goal['player_name'],
                                     'player_id' => $goal['player_id'],
                                     'assist_name' => $goal['assist_name'],
                                     'assist_id' => $goal['assist_id'],
                                     'goal_id' => $goal['goal_id'],
                                     'time' => $goal['time'],
                                     'penalty' => $goal['penalty']
                                    );
                }
                $variables['goals'] =  $goals ;
                for ($i = $recorded_goal_count; $i < $score; $i++){
                    $goals[] = array('num' => $num++,
                                    'row' => $i
                        );
                }
            $variables['goals'] =  $goals ;
        }
    }

```

Template code to process the form

```
 {exp:clubmanager:match_stats
                    match_id="{segment_3}"
                    team_id="{segment_4}"
                    return="clubhouse/fixtures/edit-success"
                }
  <!--Table Search v1-->
                <div class="table-search-v1 margin-bottom-20">
                    <div class="table-responsive">
                        <table class="table table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>No.</th>
                                    <th>Player Name</th>
                                    <th>Assist Player Name</th>
                                    <th>Goal Time</th>
                                    <th>Penalty</th>
                                    <th>Delete?</th>
                                </tr>
                            </thead>
                            <tbody>
                            {goals}
                                <tr>
                                    <td>
                                    {num}
                                    </td>
                                    <td>
                                    <input type="hidden" name="goals[{row}][goal_id]" value="{goal_id}" />
                                    <select name="goals[{row}][player_id]">
                                        <option value="0">Select Player</option>
                                        {players}
                                        <option value="{id}" {if id == player_id}selected{/if}>{name}</option>
                                        {/players}
                                      </select>

                                    </td>
                                     <td>
                                        <select name="goals[{row}][assist]">
                                        <option value="0">Select Player</option>
                                        {players}
                                        <option value="{id}" {if id == assist_id}selected{/if}>{name}</option>
                                        {/players}
                                      </select>
                                    </td>
                                        <!-- Text input-->
                                     <td>
                                    <input type="text" placeholder="time" class="form-control" name="goals[{row}][time]" value="{if time}{time}{/if}"  />
                                    </td>
                                    <td>
                                          <select name="goals[{row}][penalty]" class="form-control">
                                        {exp:low_variables:options var="lv_penalty"}
                                                <option value="{lv_penalty:data}" {if penalty == lv_penalty:data}selected{/if}>{lv_penalty:data_label}</option>
                                        {/exp:low_variables:options}
                                        </select>
                                    </td>
                                    <td>
                                    <input type="checkbox" name="goals[{row}][delete]" value="delete_goal"  />
                                    </td>
                                </tr>
                                {/goals}
                            </tbody>
                        </table>
                    </div>
                </div>
                <!--End Table Search v1-->
{/exp:clubmanager:match_stats}

```
> 0 votes

---
Tags: forms, module
---


title: “Featured” status not working

text:
# Question
Title: “Featured” status not working
We faced a weird issue with **status="Featured"** for our channel entry tag today, when we changed the custom status of our health topic channel entry from "Featured" to "Closed", and created a new health topic channel entry with the status="Featured". This process has worked in the past, but doesn't seem to work today.

The tag looks like this:

```
{exp:channel:entries channel="health_topics" limit="1" status="Featured" dynamic="no"}
//HTML code
{/exp:channel:entries}

```

Nothing is displayed is the sections with the above snippet. This issue is common to another channel "Event".

What could be the issue? Any assistance is much appreciated. Thanks in advance!

# Answer
I found the solution to the problem. The problem is actually due to caching. Turned off 'Cache Dynamic Channel Queries' in the global channel preferences and now the results are coming up. I did try clearing all cache before I did that and it made no difference, so I believe there was a problem with file/folder permissions. It's similar to the error when we try to write to the cache folder and I noticed a similar error saving templates (when it tries to save templates to files). There was a cache file for that URL, EE couldn't clear the cache file, so it kept being used to figure if there were any matching results and coming back 'no'. Thanks everyone for your suggestions!
> 0 votes

# Answer
First things first, have you double checked your Status Group assignment in Channel Groups?

`Admin -> Channel Administration -> Channels -> Edit Group Assignments`

Sorry if you have checked this, you don't mention anything about your Status group setup and it's always good to start at the start!
> 0 votes

---
Tags: status, dynamic
---


# Question
Title: Expression Engine Search Issue: Incorrect Key file for table
The search query below is failing and results in a "Incorrect Key file for table '/tmp/....'; try to repair it" SQL error.

SELECT DISTINCT(t.entry\_id), t.entry\_id, t.channel\_id, t.forum\_topic\_id, t.author\_id, t.ip\_address, t.title, t.url\_title, t.status, t.view\_count\_one, t.view\_count\_two, t.view\_count\_three, t.view\_count\_four, t.allow\_comments, t.comment\_expiration\_date, t.sticky, t.entry\_date, t.year, t.month, t.day, t.entry\_date, t.edit\_date, t.expiration\_date, t.recent\_comment\_date, t.comment\_total, t.site\_id as entry\_site\_id, w.channel\_title, w.channel\_name, w.search\_results\_url, w.search\_excerpt, w.channel\_url, w.comment\_url, w.comment\_moderate, w.channel\_html\_formatting, w.channel\_allow\_img\_urls, w.channel\_auto\_link\_urls, w.comment\_system\_enabled, m.username, m.email, m.url, m.screen\_name, m.location, m.occupation, m.interests, m.aol\_im, m.yahoo\_im, m.msn\_im, m.icq, m.signature, m.sig\_img\_filename, m.sig\_img\_width, m.sig\_img\_height, m.avatar\_filename, m.avatar\_width, m.avatar\_height, m.photo\_filename, m.photo\_width, m.photo\_height, m.group\_id, m.member\_id, m.bday\_d, m.bday\_m, m.bday\_y, m.bio, md.*, wd.* FROM exp\_channel\_titles AS t LEFT JOIN exp\_channels AS w ON t.channel\_id = w.channel\_id LEFT JOIN exp\_channel\_data AS wd ON t.entry\_id = wd.entry\_id LEFT JOIN exp\_members AS m ON m.member\_id = t.author\_id LEFT JOIN exp\_member\_data AS md ON md.member\_id = m.member\_id WHERE t.entry\_id IN (4,20,38,42,94,104,106,118,134) ORDER BY entry\_date desc LIMIT 0, 8

We believe that the exp\_channel\_data table and its 1371 columns is at the source of the issue . When we remove it from the query (by removing wd.\* before the FROM) everything works as expected. We've read multiple stackoverflow posts dealing with "Incorrect Key File" issues in SQL and have noted that the most common response was to check that /tmp wasn't running out of space, but our /tmp directory has 15GB free. We've come across a forum post on your website that may relate to what we are experiencing; https://ellislab.com/forums/viewthread/61159/#301157.

# Answer
> 0 votes
Removing the DISTINCT from the above query allows the query to be executed without throwing an error, this is because the DISTINCT in combination with the ORDER BY causes mysql to build a temp table which cannot be created because the temp table (which is the entire exp\_channel\_table combined with the entire exp\_member\_data plus all off the other columns listed) exceeds the maximum row length of mysql.

---
Tags: database-error
---


title: Handling no results redirect with Stash

text:
# Question
Title: Handling no results redirect with Stash
This is more an A than a Q.

Last week I ran into no results / redirect problem with Stash and more precisely the EE's parsing order. The solution below worked for my case. I don't take credit for it as I found it either on the Devotee-forum for Stash or as a Gist someone was willing to share. I can't remember, after losing way to much time on this I didn't keep track. Anyway, thought I would share this as it may save others time.

On the template that collects the data...

```
{exp:stash:set
parse_tags="yes"
parse_conditionals="yes"
parse_depth="2"
no_results_prefix="nested"
}
    {exp:channel:entries
    channel="YOURCHANNEL"
    disable="categories|category_fields|member_data|pagination"
    status="open"
    dynamic="no"
    }

        // channel entry data stuff here...

        {if nested:no_results}
            {exp:stash:set_value name="no_results" value="true"}
        {/if}

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

{embed="YOURTEMPLATEGROUP/YOURTEMPLATE"}

```

Note: parse\_depth and no\_results\_prefix Stash parameters are necessary.

On the embed that outputs the data (the view)

```
{if {exp:stash:not_empty name="no_results"}}
  {exp:stash:unset name="no_results"}
  {redirect="home/404"}
{/if}

```

# Answer
Since this question has been answered above, but hasn't yet been added as answer, I'll answer it here, so it can be marked as answered and corrected.

I ran into the same issue but solved it a little bit differently. Where the answer above redirects in the template, I did the redirection immediately in the template, rather than the embedded snippet. Like this:

```
{exp:stash:set parse_tags="yes" parse_depth="2" unprefix="detail"}
     {exp:channel:entries
          channel="channel_entries"
          status="open"
          limit="1"
          disable="pagination|member_data|categories|category_fields"
          require_entry="yes"}

             {if detail:no_results}
                {redirect="404"}
             {/if}

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

```
> 1 votes

---
Tags: stash, parse-order, redirects, no-results
---


# Question
Title: How do i clone my whole EE instance into a test instance?
I want clone another instance for testing purposes.

I am trying to follow this guide: https://ellislab.com/expressionengine/user-guide/operations/moving.html

but I'm not sure where to locate the database in Step 4.

And I'm not sure how to verify and update the files in Steps 8 and 9.

Right now I just have a copy of admin.php, index.php, themes/, images/, and system/ in my test/ directory. And so, accessing www.mywebsite.com/test/ results in unavailable webpage.

# Answer
> 2 votes
It's just a matter of copying all the files to a new location, cloning the database and updating the database connection info in database.php

The database is a MySQL database so you will need to do an SQL dump from there. The database connection info is in /system/expressionengine/config/database.php and you will need to either use the command line, a MySQL GUI tool such as Sequel Pro, or something like PHPMyAdmin to export the entire database as an SQL file.

However, you'll probably find things infinitely simpler if you use a multiple config system such as Focus Labs Config. This will allow you to easily set up different configurations for different domains. Generally this is used when you want a local dev environment, staging environment, and a production server.

If you don't want to do that you could look at Deeploy Helper (assuming it's still available) which will let you change paths across your installation from a single place. It's useful but nowhere near as useful as using a multiple config system.

---
Tags: ee2
---


# Question
Title: Display WGYWAM to the front-end using Channel Form Field
I created a form using channel fields and i'm trying to figure how to allow the WYGWAM features to display on the front-end so, the end-user can do some basic text formatting.

```
            {exp:channel:form channel="careers"
                form:role="form"
                form:data-toggle="validator"
                include_jquery="yes"
                datepicker="no"
                id="careers"
                return="careers/thank-you"
                logged_out_member_id="2797"
                preserve_checkboxes="yes"
                status="pending"
                dynamic_title="[careers_job_title]"
                rules:careers_job_title="required"
            }

```

This is the channel field that I'm trying to add the WYGWAM to:

```
<div class="form-group">
  <label for="careers_job_description">Job Description</label>
  <textarea class="form-control" rows="5"></textarea>
</div>

```

# Answer
> 0 votes
As a guess you've not specified your WYGWAM field name you've created for the channel. Details here.

```
<div class="form-group">
  <label for="careers_job_description">Job Description</label>
  <textarea class="form-control" name="{field:wygwam_field_name}" rows="5"></textarea>
</div>

```

Not sure if you can just use `{my_field_name}` without the `field:` prefix.

Tag Pair:

```
{my_field_name}{/my_field_name}

```

Alternative:

```
{custom_fields}
    {if textarea}
    <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" rows="{rows}">
        {field_data}
    </textarea>
    {/if}
{/custom_fields}

```

---
Tags: wygwam, channel, forms
---


# Question
Title: Cleanest way to list entry titles with links to body of entry below?
I'm trying to achieve something that I think might be simple, but I'm just not getting it figured out. What I want is to have a list of my entry titles with links to anchors to the body of the entry immediately below, like this:

title1
title2
title3

body1
body2
body3

Here's the code I've got right now:

```
{exp:channel:entries channel="channel-name"}
   <a href="#{url_title}">{title}</a>
{/exp:channel:entries}

{exp:channel:entries channel="channel-name"}
   <a id="{url_title}"></a>
   {body}
{/exp:channel:entries}

```

It seems to me that calling the channel twice is redundant, but I don't know how to get around that. Am I missing something obvious?

# Answer
> 1 votes
Literally, you have a fine answer. There really is no other way to get the result you want except for how you're doing it. I double up on channel entry tags in templates all the time, especially when creating image sliders and the like (having to output an image and a caption in two different places).

You may be concerned about efficiency: Sure, it's less efficient and adds the tiniest amount of extra load time. In your applications server solution, however, you can really solve this issue with fantastic products like CE Cache or Cloudflare.

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

http://www.cloudflare.com/

You aren't even going to notice a page load issue with two channel entries tags (if your templates are intelligently designed, at least).

# Answer
> 3 votes
The only sensible way to do this with a single channel entries loop is to use Stash and create one or more Stash lists within your loop. Then outside the entries loop use the Stash list to output the titles, followed by the contents.

I think it would go something like:

First create the Stash list variables (there are a couple of ways to do this)

```
{exp:channel:entries channel="foo" dynamic="no"}
    {exp:stash:append_list name="my_list"}
        {stash:item_title}{title}{/stash:item_title}
        {stash:item_url_title}{url_title}{/stash:item_url_title}
        {stash:item_content}{content}{/stash:item_content}
    {/exp:stash:append_list}
{/exp:channel:entries}

```

Then output the list twice, getting different bits of it each time.

```
{exp:stash:get_list name="my_list"}
    <a href="#{stash:item_url_title}">{stash:item_title}</a>
{/exp:stash:get_list}

{exp:stash:get_list name="my_list"}
   <div id="{stash:item_url_title}">{stash:item_content}</div>
{/exp:stash:get_list}

```

To be honest, the way you've done it is probably what I would do unless I was running into performance issues in which case Stash might be of help.

---
Tags: channel-entries, list, dry
---


# Question
Title: Automatically show entry date plus set time
Is there a way to show the date of an entry with an additional set time. ie 90 days?

# Answer
> 1 votes
Not natively within EE's standard tags.

Entry dates are stored as timestamps though so you could use a maths plugin to add on 7776000000 (90 days in milliseconds) then use date formatting to turn that into a nice date.

But that's getting a bit "tag soupy" so you might be better off with a custom plugin that would return the modified, formatted date for you.

Or even more simply, use a plugin that's already out there such as DT

---
Tags: entry-date
---


# Question
Title: I'm trying to upload a favicon to EE, but it says the .ico file type is not allowed
I am not a developer- but I want to upload my favicon to my EE site. Which file folder (Content, Base Images, General Content, Gallery Images) should I upload it to? Is this the proper way to upload the favicon?

# Answer
> 2 votes
I would upload it to the root of the site and then link to it in the head of your document like this

```
<!--favicon-->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

```

# Answer
> 0 votes
You need to upload the file to the root of your site, as CreateSean said. To do this, you generally need to access your web server via FTP, File Transfer Protocol. I would recommend FileZilla for ease of use.

https://filezilla-project.org/

To log in to your web server via FTP, you'll need to know a username, password, and address (address is usually www.yourwebsite.com). You will probably need to contact your web hosting partner to get this information.

Once you have access, your web root is usually located here on a Linux server:

```
/var/www/html

```

I'm not sure where it would be on a Windows server. But this is generally where you'd upload your favicon.ico, and then you link to it as CreateSean said, with a link tag in your html header.

---
Tags: file-uploads
---


# Question
Title: Mx Notify Control doesn't work when bulk-editing
My client has been using MX Notify Control for some time to notify authors when their entries have been approved (status switched from *Pending* to *Open*). She tells me that when administrators approve a single entry, it works. But if they select a few entries and set all their statuses to *Open* at once, the notifications are not sent.

Should it work when editing multiple entries at once, or only for one at a time?

# Answer
> 0 votes
No, the extension does not contain this functionality.

Little side note: When saving an entry the hook "entry\_submission\_end" is called. For saving multiple entries the hook "update\_multi\_entries\_loop" should be called, wich is not the case.

---
Tags: mx-notify
---


# Question
Title: {video:img_url_hd} not working after 3.2 Channel Videos update
The {video:img\_url\_hd} tag is no longer working after we updated the plugin to the 3.2 version. It displays this gray image:https://i.ytimg.com/vi/GrdZjkNCp8I/sdhqdefault.jpg on the front end, even though the back end shows the correct thumbnail for the video.

I was able to change it to the {video:img\_url} version since that is working, but wanted to make sure the DevDemon folks knew about it and check to see if it's just our site that has this issue.

Thanks

# Answer
**Please note that the following solution requires modifying a part of the plugins core functionality. Any update to channel\_videos is going to remove this fix.**

We resolved it by modifying `line: 235` in `system/expressionengine/third_party/channel_videos/mod.channel_videos.php`.
**Before:**

`$vars[$prefix.'img_url_hd'] = str_replace('default.jpg', 'hqdefault.jpg', $vid->video_img_url);`

**After:**

`if (strpos($vid->video_img_url, 'sddefault.jpg') !== FALSE) {
 $vars[$prefix.'img_url_hd'] = str_replace('sddefault.jpg', 'hqdefault.jpg', $vid->video_img_url);
} else {
 $vars[$prefix.'img_url_hd'] = str_replace('default.jpg', 'hqdefault.jpg', $vid->video_img_url);
}`

**Whats happening:**

channel\_videos searches for `default.jpg` and replaces it with `hqdefault.jpg`.
The problem is that in some instances the string `default.jpg` is actually `sddefault.jpg`.
So when this happens it essentially replaces `default.jpg` of `sddefault.jpg` with `hqdefault.jpg` resulting in the two merging together to become `sdhqdefault.jpg`.
> 0 votes

---
Tags: devdemon, channel-videos
---


title: PHP Errors after OS X Upgrade

text:
# Question
Title: PHP Errors after OS X Upgrade
I got to work this morning and, after upgrading to Yosemite and MAMP Pro, I am getting a series of PHP Errors and cannot get access to to CP (returns blank page). The frontend of the site itself is fetching data from the DB but the issue appears to be with the config file? I'm using FocusLabs Master Config too.

The first error is

`A PHP Error was encountered
Severity: Notice
Message: Only variable references should be returned by reference
Filename: core/Common.php
Line Number: 242`

The warnings after that are "Cannot modify header information" warnings.

`A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/bjh/github/beacon/lighthouse/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212`

`A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/bjh/github/beacon/lighthouse/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212`

`A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/bjh/github/beacon/lighthouse/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212`

`A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/bjh/github/beacon/lighthouse/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212`

`A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Users/bjh/github/beacon/lighthouse/codeigniter/system/core/Exceptions.php:170)
Filename: libraries/Functions.php
Line Number: 446`

After pulling the working copy of our site from the dev server and copying the DB it appears as though this issue is only occurring locally. :-/

# Answer
> 7 votes
I'm getting the same issue since upgrading to OS X Yosemite.

I suspect the real issue is your version of PHP has been upgraded to PHP 5.6.

While upgrading the OS I also swapped to PHP 5.6 and now all EE sites with debug mode enabled display this PHP notice.

Someone else on the EllisLab forums has had the same issue and a fix has been posted: https://ellislab.com/forums/viewthread/244510/#1066393

# UPDATE

Sorry guys, I should have provided a code sample to the fix originally in the event that the linked page disappears.

Replace the last line in the `&get_config()` method of `system/codeigniter/system/core/Common.php` like so:

`- return $_config[0] =& $config;
+ $_config[0] =& $config;
+
+ return $_config[0];`

This should fix the issue.

# Answer
> 0 votes
I'm guessing that your system is using the bundled version of Apache/PHP rather than MAMP's version. You need to stop (and disable) the system version and ensure the MAMP version is started.

# Answer
> 0 votes
Update your php file system "system/core/Common.php" in mac mini(OS X Yosemite) like so:

Bellow code in "Common.php" :

```
      return $_config[0] =& $config;

```

Replace by bellow code :

```
   $_config[0] =& $config;
   return $_config[0];

```

# Answer
> -1 votes
Try to set permissions on the local cache folder to 777.

---
Tags: control-panel, focus-lab-master-config
---


# Question
Title: Grid conditional for a file(s) - If file exists display content (file)
I have a grid field (files), with a column/variable (file). I just need to display my content/snippet if a file has been uploaded.

So something like:

```
{if files:file}link to my file{/if}

```

Any help is appreciated.

# Answer
Do it exactly like you think.

{my\_grid\_field} {if my\_grid\_field:column}{my\_grid\_field:column}{/if} {/my\_grid\_field}
> 1 votes

# Answer
I worked this out by doing this

```
{if files}{my_snippet}{/if}

```

And then in my snippet

```
{files}
<a href="{files:file}">{files:file_name}</a>
{/files}

```
> 0 votes

---
Tags: conditionals, grid, files
---


# Question
Title: Switching default database engine to InnoDB
We recently altered our EE tables to use InnoDB as the database engine instead of MyISAM. All is good. INNODB is also set as the default engine in MySQL's preferences.

I just noticed that when Expression Engine is creating new tables (such as when we just installed CE Image) they are still being created as MyISAM.

This appears to be set in the following CI file:

`/system/codeigniter/system/database/drivers/mysql_forge.php` where I find this:

```
/**
 * The default engine to use when creating new tables.
 */
const ENGINE_DEFAULT = 'MyISAM';

```

I'd prefer not to hack the codeigniter core files. Is there a way I can override this value in EE's config file?

I am currently on 2.8.1 and getting ready to update to 2.10.1

# Answer
> 1 votes
Short version, No you can't alter this setting via a config file.

Long version, you see in your snippet in the OP it is defined as a `const` *constant* on the Class, conversly the items you change via the config files are *variables*. You can't change or redefine contastants with code as by their nature they are fixed.

Now it is possible (if you look to the `_create_table` function in this file) that the CI DB Forge object could pass a different engine (note the 6th parameter `, $engine=self::ENGINE_DEFAULT`) however if we look at `/system/codeigniter/system/database/DB_forge.php` (the parent class on which the driver specific classes inherit), line 193 (EE 2.10.0) we see the only call to `_create_table` :

```
$sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists);

```

Note that there is no 6th paramter, ergo the base CI database system is not and can not accept a configuration value, even if we could add such a value in we couldn't pass it to the relivent function without altering the core files.

So in this case I'm afraid the only solution is to alter the `const` on file as you say, and carefully monitor your core upgrade to ensure they don't change this file.

As a little bonus I've looked through the update files up to 2.10.0 and I don't see any changes at this level. I dob note however that the EE\_Schema does define the engine as MyISAM however I beleive this is only relivent to a fresh installation. Therefor I'd say change your value, perform your upgrade and check that no tables have been created as MyISAM and that your changed const remains in the file...

---
Tags: database, config, codeigniter, configuration-variables
---