# Question
Title: Can't upload files to Assets 2.0.5 in ExpressionEngine 2.5.5
Cannot upload files with Assets v2.0.5 in ExpressionEngine v2.5.5.

1. Files uploaded with native EE file manager works.
2. Directory permissions for upload directory is 777 (for troubleshooting sake).
3. XSS filtering on uploads is DISABLED per config file and db settings.
4. Action # 38 in database is **upload\_file** method.
5. Uploading files using assets results in the following error:

There was an error uploading your file: Your file could not be saved. Either the upload was cancelled, or there was a server error.

**Header/response information from the request below:**

```
Request URL:http://website.com/?folder=2&ACT=38&qqfile=small_image.jpg
Request Method:POST
Status Code:200 OK

```

Request Headers:

```
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Content-Length:5750
Content-Type:application/octet-stream
Cookie:exp_perpage=150; exp_last_visit=1361303427; exp_last_visit=1361303427; exp_last_activity=1361319620; exp_last_activity=1361319626; exp_sessionid=44b2b994fb6c7f4e0960bb746fdf415e3e01daa6; exp_expiration=1392855796; exp_sessionid=44b2b994fb6c7f4e0960bb746fdf415e3e01daa6; exp_expiration=1392856008; arp_scroll_position=0
Host:website.com
Origin:http://website.com
Pragma:no-cache
Referer:http://website.com/system/index.php?S...
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17
X-File-Name:small_image.jpg
X-Requested-With:XMLHttpRequest

```

Response Headers:

```
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:122
Content-Type:text/html; charset=utf-8
Date:Wed, 20 Feb 2013 00:26:57 GMT
Keep-Alive:timeout=5, max=99
Server:Apache
Set-Cookie:exp_sessionid=44b2b994fb6c7f4e0960bb746fdf415e3e01daa6; expires=Wed, 20-Feb-2013 02:26:57 GMT; path=/
Set-Cookie:exp_expiration=1392856017; expires=Thu, 20-Feb-2014 00:26:57 GMT; path=/
Vary:Accept-Encoding

```

# Answer
The solution was to recurse 777 to the /system/expressionengine/cache/ directory as there are thumb directories that Assets creates to hold thumbnails, etc.

Thank you Lisa Wess (from Pixel & Tonic) for the solution!
> 8 votes

# Answer
So I ran into this issue again and a recursive 777 on the /system/expressionengine/cache folder wouldn't cut it. Anyhow this was the issue/solution:

I was setting a custom cache path in my config.php:

```
$config['cache_path'] = FCPATH.'cache/sql/';

```

and despite that path having the proper permissions, I could not get my files to upload using the Assets add-on. I resolved the issue by simply letting Assets use the default cache path by commenting out my custom cache\_path in my config.php file.
> 0 votes

---
Tags: assets, file-uploads, v2.5.5
---


# Question
Title: Moving channel from one msm site to another
Is there a way to move a channel from one msm site to another? Both sites are within the site installation.

# Answer
**IMPORTANT NOTE** As I quickly look through the database it seems that the site\_id column is used all over the place, including within the entries, so there is a high chance this isn't going to work without a great deal of messing around.

If you're not confident fiddling with the database directly then it's probably best not to even try this.

There is no way to do this from the Controlpanel but you *might* be able to do it by making a change directly in the database.

**THIS IS NOT TESTED - BACKUP YOUR DATABASE FIRST AND WORK ON A DEV VERSION OF THE SITE**

Once you're backed up. Look in the database and get the id of the site you wish to change TO from the exp\_sites table.

Then go to exp\_channels, find the channel you wish to move and update it's site\_id value for the new channel. Don't change anything else.

You will also need to change the site\_id value for the field group associated with the channel.

If you're using categories on that channel then you will need to change the site\_id of the category group too. Just ensure that no other channels are using the same category group.

I think that's it but as I said **back up your database - I make no guarantees!**
> 1 votes

---
Tags: multi-site-manager, channel
---


title: Can submit grid field data

text:
# Question
Title: Can submit grid field data
I've got this error `You are not authorized to perform this action` using grid field in ExpressionEngine 2.9.0

# Answer
This is a known bug in 2.9 see this bug report https://support.ellislab.com/bugs/detail/20462/
> 1 votes

---
Tags: grid
---


# Question
Title: {structure:page:entry_id} doesn't render
EE 2.8.1 Structure 3.3.14.5

I've got a template Where I need to use {structure:page:entry\_id} to pass the current pages entry id in order to list some entries. However on this page {structure:page:entry\_id} does nothing, zilch, nada. When I place it anywhere in the template it doesn't output the entry\_id at all. In fact it gets rendered on the front end as if the variable were not valide with curly braces and all.

The Code that I'm trying to use is:

```
{exp:structure:entries parent_id="{structure:page:entry_id}"}
    {switch='<div class="tiles">||'}

        <div class="tile one-sided">
            <a href="{page_url}" class="tile-content">
                <img src="http://placehold.it/230x100" alt="">
                <h5>{title}</h5>
            </a>
        </div>

    {switch='||</div>'}
{/exp:structure:entries}

```

If I hard code in the parent\_id the code renders as expected.

# Answer
Turns out the issue is more about the way the templates are being routed and using Low Variables. The solution was to pass the the variable to low variables using the preparse parameter.
> 0 votes

# Answer
Structure's global variables are only applicable to a Structure **Page** or **Listing**.

It seems the template in which your code resides is not being utilised as a template by a Structure page or listing entry.

**Firstly**, I would suggest you disable and re-enable the Structure extension for sanity sake. The extension is what parses the template variables in the first place.

**Secondly**, to verify whether your template is a Structure page or listing, you will need to create a page in Structure and ensure you've selected the Structure Template (which has your code in it) from within the Structure tab. Check if your global variable outputs the correct `{entry_id}`

**Finally**, you may want to browse through the Structure Support forum to investigate further or get in touch with the vendor.
> 1 votes

---
Tags: structure
---


title: HTACCESS issues with multiple redirects

text:
# Question
Title: HTACCESS issues with multiple redirects
I'm having a hard time figuring out how to re-direct multiple portions of a site to the https:// version.

What I have so far does work, it just randomly throws in an extra '?' sometimes?

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

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

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

# https: redirect to safe CP url
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} system
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

# https: redirect to safe Product url
RewriteCond %{SERVER_PORT} 80
RewriteCond %{QUERY_STRING} /product/
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

# https: redirect to safe Checkout url
RewriteCond %{SERVER_PORT} 80
RewriteCond %{QUERY_STRING} /checkout/
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

# Force www:
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} ^(.+)$ [NC]
RewriteRule ^(.*)$ http://www\.%1/$1 [R=301,L]
</ifmodule>

```

This does work, partially. Like I said, sometimes when a re-drecit happens an extra '?' is thrown in and I can't seem to figure out why.

So if I go to

> http://www.mysite.com/product/some-product

for example, it will re-direct to

> https://www.mysite.com/?/product/some-product

If any additional info is needed let me know! And thanks for any input in advance!! :)

# Answer
On line 11, change:

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

```

to

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

```

And see if that works. According to https://ellislab.com/expressionengine/user-guide/urls/remove\_index.php.html, you only need to use your entry for forced query strings on hosts such as GoDaddy. However, if that's the case, you may be stuck with it.
> 1 votes

---
Tags: htaccess, .htaccess
---


title: Twitter Bootstrap CSS breaks Minimee

text:
# Question
Title: Twitter Bootstrap CSS breaks Minimee
I am using Minimee 2.1.12, and Bootstrap 3.2.0. When I add the bootstrap CSS file to my {exp:minimee:css} tag pair, I am getting an error "ERR\_CONNECTION\_RESET" in my browser.

I did some whittling down to the CSS file, and narrowed the issue down... This here is the smallest chunk of CSS from that file that will still cause that issue. If I remove any more, the issue doesn't occur... I don't know what about this section of CSS is causing the issue...

```
.table > thead > tr > td.active,
.table > tbody > tr > td.active,
.table > tfoot > tr > td.active,
.table > thead > tr > th.active,
.table > tbody > tr > th.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > tbody > tr.active > td,
.table > tfoot > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr.active > th,
.table > tfoot > tr.active > th {
  background-color: #f5f5f5;
}
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover,
.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr.active:hover > th {
  background-color: #e8e8e8;
}
.table > thead > tr > td.success,
.table > tbody > tr > td.success,
.table > tfoot > tr > td.success,
.table > thead > tr > th.success,
.table > tbody > tr > th.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > tbody > tr.success > td,
.table > tfoot > tr.success > td,
.table > thead > tr.success > th,
.table > tbody > tr.success > th,
.table > tfoot > tr.success > th {
  background-color: #dff0d8;
}
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover,
.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr.success:hover > th {
  background-color: #d0e9c6;
}
.table > thead > tr > td.info,
.table > tbody > tr > td.info,
.table > tfoot > tr > td.info,
.table > thead > tr > th.info,
.table > tbody > tr > th.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > tbody > tr.info > td,
.table > tfoot > tr.info > td,
.table > thead > tr.info > th,
.table > tbody > tr.info > th,
.table > tfoot > tr.info > th {
  background-color: #d9edf7;
}
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover,
.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr.info:hover > th {
  background-color: #c4e3f3;
}

```

That CSS doesn't break the site unless it's within my minimee tag.

Any ideas?

# Answer
This looks like an issue with the library used to minify the CSS. Try to change it.

Take a look at the configurations. The default library to is `minify`. Change it to `cssmin`.

In case you're configuring Minimee using `config.php`:

```
/**
 * Specify which minification library to use for your CSS.
 * Values: 'minify' or 'cssmin'
 * Default: minify
 */
'css_library'   => 'cssmin',

```
> 2 votes

---
Tags: css, twitter-bootstrap, minimee
---


# Question
Title: Upload image and get "URL Only" in text field
In EE1 part of our workflow was to upload images and store just the path to them in the a text field. Sometimes this images were uploaded in the control panel and sometimes when there were dozens of them they were uploaded via SFTP.

When we uploaded through the control panel we used the "URL Only" option.

EE2 introduced the File Field type which is a nice feature BUT they also took away the ability to get "URL Only" on upload. `/images/folder/imagename.png`

In my limited use of EE 2.8.1 when you upload an image you can only get the whole image tag `<img src="/images/folder/imagename.png">` AND you can only get the image to appear in a textarea not in a text field.

Am I overlooking something? Is there a way to recover the former functionality?

# Answer
Have you seen the image tag pair - https://ellislab.com/expressionengine/user-guide/add-ons/channel/custom\_fields.html#variable-pair-usage

If you're using a File field you have all the parameters and variables you need including options to output path, full URL, description, image manipulation, credit, date and so on.
> 2 votes

# Answer
Unfortunately not - you'll have to place the link to the file in the field, then remove the extraneous markup manually.

The only real solution here is to use Assets.
> 1 votes

---
Tags: file-uploads, image
---


title: Issues with deleted code

text:
# Question
Title: Issues with deleted code
I am having issues with the text editor in EE deleting code that I add to pages. We are wanting to style our support pages a certain way, and I need to be able to add divs and classes to existing p, ul, li, and other tags.

For example:

I have this content on a page:

\[p\]Getting Started\[/p\]

\[ul\] \[li\]FAQ\[/li\] \[li\]Support Contacts\[/li\] \[/ul\]

if I wrap it in a div, like this:

\[div class="support-content"\]

\[p\]Getting Started\[/p\]

\[ul\] \[li\]FAQ\[/li\] \[li\]Support Contacts\[/li\] \[/ul\] \[/div\]

and save, it keeps the div I added, but when I go to edit the page again, it deletes the div.

Is there a way to prevent this from happening, or turn off the rich text editor for certain pages so I can just directly edit the source code?

Thanks!

# Answer
You can configure Wygwam/CKeditor to ignore certain tags and classes/not strip them out.

I found something that may be similar over on Stackoverflow: CKEditor strips classes from divs. In your case, you're seeing Wygwam/CKEditor strip the whole div. Apparently, though, you can configure your instance of Wygwam fields to ignore certain types of code, and/or leave classes alone.

So I did a little more searching and found this on this subsite: Wygwam - stripping tags from ul li (class and id) \[Advanced Content Filter (ACF)\] that deals directly with configuring ckeditor in Wygwam. I think these two questions, and their answers, will be helpful to you.
> 0 votes

---
Tags: ee2, tags
---


# Question
Title: Permission Groups, Structure, and Entry Access?
Spinning wheels..

I need to separate pages into permission groups. I am using Structure. And I have Entry Access.

I'm not sure how to integrate this. I've been through the documentation of Entry Access and Structure while I have seen something close maybe I'm missing the clue to solving this...

All of the website content is all through Structure minus the `/index` and `/event` page.

All of the pages that are within Structure use 1 template `/structure/page` which comes from one channel `{exp:channel:entries="page"}` to populate the site's content. To possibly complicate matters for a front-end type of dashboard the site also pulling that channel again using `{exp:channel:form channel="page"}`

The issue is that I need to have 12 different permission groups.
Each needing access to a different area (page) within the `/structure/page` template and channel.

**For example:** `/about` using the `/structure/page` template will need to be accessed by permission group A

while `/gallery` also using the `/structure/page` template and channel will need to be accessed by permission group B and so on and so forth where some pages will need to have multiple permission groups allowed...

**A couple of questions however:**
Is there currently any way to do this with Structure as we have the site currently setup? 1 channel feeding 1 structure/page template.

And if so, any suggestions to nudge me in the right direction for setting up these permissions??

Thanks in advance!

Here's what the front-end template currently has. It works well but, without permission control.

```
{exp:channel:form channel="page" entry_id="{segment_3}" id="publishForm" return=""}

  </div>
</div>
<div class="col-lg-12">

  <div class="form-element-wrapper">
    <label for="title">Title</label>
    <input class="form-control" type="text" name="title" id="title" value="{title}" disabled="true">
  </div>

  <div class="form-element-wrapper" id="images-container">
    <label for="">Image Carousel</label>
    <div class="clear"></div>
    {field:images}
  </div>

  <div class="form-element-wrapper">
    <label for="about">About</label>
    {field:about}
  </div>

  <div class="form-element-wrapper">
    <label for="body">Body</label>
    {field:body}
  </div>

  <div class="form-element-wrapper" id="faq-container">
    <label for="">FAQ</label>
    <div class="clear"></div>
    {field:faq}
  </div>

  <div class="form-element-wrapper" id="external-links-container">
    <label for="">External Links</label>
    <div class="clear"></div>
    {field:external_links}
  </div>

  <div class="form-element-wrapper" id="documents-container">
    <label for="">Documents</label>
    <div class="clear"></div>
    {field:documents}
  </div>

  <div class="form-element-wrapper" id="message-container">
    <label for="message">Message</label>
    {field:message}
  </div>

  <div class="form-element-wrapper" id="mission-container">
    <label for="mission">Mission</label>
    {field:mission}
  </div>

  <input id="submit-form" type="submit" name="submit" value="Update and Finish" class="fin btn btn-primary btn-lg pull-right" style="margin:0 2% 2% 0;">
  <input id="submit-form" type="submit" name="submit" value="Update" class="upd btn btn-primary btn-lg pull-right" style="margin:0 2% 2% 0;">

</div>
{/exp:channel:form}

{if:else}
<div class="well well-lg">
<button id="page_select_submit" type="submit" class="btn btn-primary pull-right">Go...</button>
<select name="structure_parent_id" class="chosen-select">
<option value="0" selected="selected">Choose a Page...</option>

<!--  GROUP A  -->
<option value="100"> Page1</option>
<option value="200">-- Page2</option>
<option value="300">-- Page3</option>

<!--  GROUP B  -->
<option value="400"> Page4</option>
<option value="500">-- Page5</option>
<option value="600">-- Page6</option>

<!--  GROUP C  -->
<option value="700"> Page7</option>
<option value="800">-- Page8</option>
<option value="900">-- Page9</option>

<!--  GROUP D  -->
<option value="100"> Page1</option>
<option value="500">-- Page5</option>
<option value="1000">-- Page10</option>

</select>

</div>

{/if}

<script>
$(document).on('mouseenter', '.fin',  function(){
 $('[name=return_url], [name=return], [name=RET]').val('embeds/success');
});

$(document).on('mouseenter', '.upd',  function(){
 $('[name=return_url], [name=return]').val('embeds/success/{sement_3}');
});
</script>

```

On the option dropdown. I would like to only show the pages/ option vaulues that are relevant to that particular permission group to edit.

# Answer
> 3 votes
I did this exact same thing all natively with the exception of structure a few months ago. The challenge was to provide member groups access to different information on the same template with the added challenge of each member group having a state affiliation and union affiliation that they belonged to.

The most difficult part was a file system (think dropboxish) that showed particular documents according to state location and union access.

I controlled the file from the backend using grid which used searchable checkboxes to specify member and union types. Then used EE template embeds to work the magic.

My embed template:

```
{exp:member:custom_profile_data}

{if State == "{embed:state_name}"}

{exp:channel:entries channel="documents" dynamic="yes" limit="1" disable="categories|pagination"}

    {folders}

        {if folders:state_access == "{embed:state_name}" AND folders:union_access == "All Unions"}

            {sn_directory}

        {/if}

    {/folders}

{/exp:channel:entries}

{/if}

{/exp:member:custom_profile_data}

```

We need to include the {exp:member:custom\_profile\_data} in the embed because it is parsed AFTER the page is loaded. The union search could also be an embed variable if you wanted to loop out content on your template.

{sn\_directory} is a snippet I use to cache out the directory code which looks like

```
<ul>
    {folders:document_file}
        <li>
            <a href="{folders:document_file:document_file}">
                <i class="icon icon-file"></i> {folders:document_file:title}
            </a>
        </li>
    {/folders:document_file}
</ul>

```

In my template I pull the information in like so:

```
{exp:member:custom_profile_data}

    {if State == "Alabama"}
        {embed="directory/index" state_name="Alabama"}
    {/if}
{/exp:member:custom_profile_data}

```

Notice we're opening the custom profile data tag again. if State == represents the member's state field and the state\_name references the embed variable.

After this stage you could write something to loop that out 50 times or copy and paste it 50 times, doesn't really matter in my case but could in yours.

Either way, this works, it's fast, it's reliable and easy to maintain with zero add-ons.

Check out embed variables at http://ellislab.com/expressionengine/user-guide/templates/embedding.html

# Answer
> 4 votes
You need to create a channel field into that channel and in channel entry, you need to assign that user group type who can access the page.

for eg:

Suppose you have a channel (named as "XYZ") and add a new channel field (as 'group\_permission'). This channel field can be drop down and you can add group listing in drop down (as group A, group B)

Now Go to this channel entries and you can see this new field 'group\_permission' in these all entries. Now you can assign a group type (group A or group B) in channel entry.

Then you need to add following code to check the permission for entry into template as below :

```
{exp:channel:entries channel="XYZ}
    {if group_permission == 'group A'}

        //action you want to perform or redirect on other page

    {/if}

    {if group_permission == 'group B'}

        //action you want to perform or redirect on other page

    {/if}

     // your code...

 {/exp:channel:entries}

```

So you need to use your code like this.

# Answer
> 1 votes
I suggest you take a look at HooBlong, a module that allows members to belong to more than one group for front-end access control. More details can be found at https://www.debeer.com/index.php/debeer/expressionengine\_meet\_multiple\_memberships. There are some examples that could fit your needs at https://www.debeer.com/index.php/blogs

# Answer
> 1 votes
After much fuss.....(see below)

```
{if:else}
<div class="well well-lg">
<button id="page_select_submit" type="submit" class="btn btn-primary pull-right">Go...</button>
<select name="structure_parent_id" class="chosen-select">
<option value="0" selected="selected">Choose a Page...</option>

```

{exp:member:custom\_profile\_data}

{if member\_group == "1"}

```
<!--  GROUP A  -->
<option value="100"> Page1</option>
<option value="200">-- Page2</option>
<option value="300">-- Page3</option>

```

{/if}

{if member\_group == "2" }

```
<!--  GROUP B  -->
<option value="400"> Page4</option>
<option value="500">-- Page5</option>
<option value="600">-- Page6</option>

```

{/if}

{if member\_group == "3" }

```
<!--  GROUP C  -->
<option value="700"> Page7</option>
<option value="800">-- Page8</option>
<option value="900">-- Page9</option>

```

{/if}

and for pages that need multiple groups to access them:

{if member\_group == "4" OR member\_group =="5" OR member\_group == "6"}

```
<!--  GROUP D  -->
<option value="100"> Page1</option>
<option value="500">-- Page5</option>
<option value="1000">-- Page10</option>

```

{/if}

```
</div>

```

{/exp:member:custom\_profile\_data}

```
{/if}

```

NOW, the question is.. if in the future a member group needed access to a different page. How would that happen without having to hardcode that into the template as performed above?

I do have the Entry Access addon. That seems like it could help to solve this situation but the documentation seems limited.

---
Tags: channel-entries, templates, structure, admin, member-management
---


# Question
Title: creating channels / custome fields via a module
I've been asked to create a competition module for EE. I think that it'd be best to have the module create a new channel and custom fields. I can create my own tables and have a nice separate area, but I think it'd be better to have the user simply go to: create channel competition.. etc..

Is this possible from a module? I can't find any info on 'automating' channel creation..

Sorry if this is a dumb Q.. I've not used EE in a while..

Tris..

# Answer
> 1 votes
It sounds like you have found a solution that won't require it, but to answer your original question, it is possible for third-party add-ons to build Channel structures, using the Channel APIs.

---
Tags: custom-fields, multiple-channels
---


# Question
Title: How to add jquery spellchecker plugin to WYGWAM
How I would go about adding the jquery spellcheck plugin to WYGWAM?

# Answer
> 15 votes
Here’s an extension that should do the trick for you: Wygwam jQuery Spellchecker

Enjoy!

# Answer
> 0 votes
Check to see if your host has modsecurity enabled. Modsecurity might block the extension from loading giving you that 404.

---
Tags: wygwam
---


# Question
Title: Can Calendar show schedules for indiviual cases?
My client's site needs to show the tutoring schedule for an individual student selected from a list (only one calendar/student at a time).

So if I have Calendar taking the input on the back end in my channel for each student, can I display it on the front end for the selected student?

Also, is Calendar a channel field?

Thank you!

# Answer
> 1 votes
Calendar is not simply a channel field. Calendar is a module which, upon installation, creates two channels: **Calendar: Calendars**, to hold Calendar data, and **Calendar: Events**, which are event data created under a selected Calendar (created in Calendar: Calendars). Similarly named custom field groups are also created. Both channels contain specialized Calendar custom fields.

> **Important: You MUST use the channels and custom field groups provided by Calendar upon installation**
>
> You cannot create another channel to hold Calendar data, nor can you create another custom field group for the Calendar channels, nor can you move/use the special Calendar custom fields to another custom field group.

A good strategy would be to create 1 calendar per student. You would therefore have a **Calendar: Calendars** entry for each student. On the front-end, many Calendar tags have a `calendar_id=""` or `calendar_name=""` parameter that you can use to display event data for a single Calendar (or Student in your case).

---
Tags: solspace-calendar
---


title: Stash snippet problems

text:
# Question
Title: Stash snippet problems
Since upgrading to EE 2.9.0 and Stash 2.5.6 I am having problems with stash snippets.

I am getting results such as %Y-%m-%dT%H:%i:%s%Q

{exp:stash:set\_value name="my\_var" type="snippet" value="oof"}

{exp:stash:get name="my\_var" type="snippet"}

works fine and prints oof, but

{my\_var} prints {my\_var}

I have been using the second method extensively through my site in conditionals or simply to display elements.

Thanks

# Answer
> 2 votes
Stash variables set to `type="snippet"` can be accessed in the same way as in previous versions of EE. To demonstrate:

```
{embed="inc/snippet_embed"}
{exp:stash:set name="my_snippet" type="snippet"}My snippet{/exp:stash:set}

```

The template **inc/snippet\_embed** looks like this:

```
{my_snippet}
<br>
{if my_snippet} My snippet has a value!{/if}

```

Output:

```
My snippet
<br>
My snippet has a value!

```

Conditionals in EE 2.9 have of course changed which does have some implications when evaluating Stash snippet variables, which you can read about here:

https://gist.github.com/croxton/9d012297096892ca5c10

---
Tags: stash
---


# Question
Title: Use backspace parameter on Stash nested get_list
I'm using Stash to capture a list of articles. I'm trying to keep my viewModel separate from my view markup.

For each article, I'm capturing a nested list of categories.

In the view, I want to output comma-separated categories. I was under the impression that I could use backspace="x" on a get\_list, but it doesn't seem to work. I am I going about this incorrectly?

I suppose I could use an if/else with 'count' and 'total\_results' to remove the final comma and space, but would also like to know if backspace can work.

**Set article list**

```
{!-- Articles --}
{exp:stash:set_list name="articles" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries
        channel="news"
        dynamic="no"
        orderby="sticky|entry_date"
        sort="desc|desc"
        sort_type="numeric|numeric"
        disable="member_data|category_fields"
        {triggers:entries}
    }
        {stash:id}{entry_id}{/stash:id}
        {stash:sticky}{sticky}{/stash:sticky}
        {stash:title}{title}{/stash:title}
        {stash:summary}{article_summary}{/stash:summary}
        {stash:date}{entry_date}{/stash:date}
        {stash:url}{page_url}{/stash:url}
        {stash:image}{article_featured_image}{/stash:image}

        {exp:stash:set_list:nested name="this_article_categories" parse_tags="yes" context="{entry_id}"}
            {categories}
                {stash:category_name}{category_name}{/stash:category_name}
                {stash:category_url_title}{category_url_title}{/stash:category_url_title}
            {/categories}
        {/exp:stash:set_list:nested}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

**Get Articles** (See the get\_list:nested name="this\_article\_categories" in the code below.)

```
{!-- Get Articles --}
{exp:stash:get_list name="articles" prefix="news" paginate="bottom" limit="15"}
<article>
    <header>
        <div class="meta">
            {news:date format="%M %j, %Y"} in {exp:stash:get_list:nested name="this_article_categories" backspace="2" context="{news:id}"}
                <a href="/news-events/news/category/{category_url_title}">{category_name}</a>,
            {/exp:stash:get_list:nested}
        </div>
        <h1 class="gamma"><a href="{news:url}">{news:title}</a></h1>
    </header>
    <div class="article-body">
        {news:summary}
    </div>
    <p class="read-more"><a href="{news:url}">Continue reading <i class="ss-gizmo ss-right"></i></a></p>
</article>

<hr>

{/exp:stash:get_list}

```

# Answer
> 3 votes
The backspace parameter can be used with `{exp:stash:get_list}`, however be aware that any trailing whitespace and line breaks will count as 'spaces'.

```
{!-- Desired output - no trailing comma --}
Product 1, Products 2, Product 3

{!-- this won't work because of the line break after the comma --}
{exp:stash:get_list name="products" backspace="1"}
   {title},
{/exp:stash:get_list}

{!-- Either close the space up manually... --}
{exp:stash:get_list name="products" backspace="1"}{title},{/exp:stash:get_list}

{!-- ...or use the trim parameter --}
{exp:stash:get_list name="products" trim="y"}
   {title},
{/exp:stash:get_list}

```

---
Tags: categories, stash
---


# Question
Title: How to stop EE from converting straight quotes to html entities in <script> tags in an entry
I'm trying to embed an instance of jwplayer in an entry. The embed code for that looks something like this:

```
<div id='my-video'></div>
<script type='text/javascript'>
    jwplayer('my-video').setup({
        file: 'url_to_file',
        image: 'url_to_image',
        width: '320',
        height: '240'
    });
</script>

```

I was just wondering if there is anyway to keep the formatting set to XHTML and still have it not convert the straight quotes between the initial set of parenthesis into entities. Here is a snippet of the problem area:

```
<div id='my-video'></div>
<script type='text/javascript'>jwplayer(‘my-video’).setup({…

```

**Further Information:** I'd really like to get this worked out so let me clarify a few points here to try to make everything as clear as possible.

* Only the first set of quotes inside `jwplayer('my-video')` are getting converted, all the rest of the quotes are left alone. Nothing I've tried in changing the formatting works. In auto br mode, taking out the whitespace causes it to stop being mangled.
* I need to be able to add the embed code in the entry itself, not in the template code.
* I would prefer not to install an add-on to do it, but having already installed stash and allow-ee-code in the process of trying to get it worked out demonstrates that I'm willing if it is necessary.

# Answer
After a lot of experimentation I determined that everything inside the script tags inside a set of curly brackets was safe from being converted to entities. (This seems to be true with or without protect\_javascript turned on)

Given that information, here was my solution:

```
<div id='my-video'></div>

<script type='text/javascript'>
function placeVideo()
{
jwplayer('my-video').setup({
        file: 'url_to_file',
        image: 'url_to_image',
        width: '480',
        height: '360'
    });

}
placeVideo();
</script>

```

I had to wrap the call to the jwplayer function inside another function so that there would be curly brackets around the quotes.
> 0 votes

# Answer
There is a config variable called "protect\_javascript" which needs to be set to "no".

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

```

EDIT: You can also use Stash to solve this issue too.

```
{exp:stash:set name="jwplayer"}
    jwplayer({my-video}).setup({...});
{/exp:stash:set}

```

Then you would use the get tag and output this parsed data within a script tag.

```
<script>
    {exp:stash:get name="jwplayer"}
</script>

```
> 1 votes

# Answer
The quotes in the jwplayer call are not the quotes you need (8220 and 8221 are not the same characters you used in the rest of the code). Simply replacing these again with straight quotes and updating your entry should work.
> 0 votes

# Answer
I have found that formatting the javascript as strictly-compliant XHTML will prevent the Auto XHTML parser from converting the JS quotes to html entities and breaking the scripts.

Here are my tests and the results for each.

1 -- Nope

```
<script>load_slides_from("Some Text. ‘smart’ “quotes” are OK.");</script>

```

2 -- Nope

```
<script>
load_slides_from("Some Text. ‘smart’ “quotes” are OK.");
</script>

```

3 -- Nope

```
<script type="text/javascript">
  load_slides_from("Some Text. ‘smart’ “quotes” are OK.");
</script>

```

4 -- This works

```
<script type="text/javascript">
 //<![CDATA[
  load_slides_from("Some Text. ‘smart’ “quotes” are OK.");
 //]]>
</script>

```

5 -- This works

```
<script>
 //<![CDATA[
  load_slides_from("Some Text. ‘smart’ “quotes” are OK.");
 //]]>
</script>

```

6 -- This works

```
<script>//<![CDATA[
  load_slides_from("Some Text. ‘smart’ “quotes” are OK.");
//]]></script>

```

7 -- This works

```
<script>//<![CDATA[
  load_slides_from("Some Text. ‘smart’ “quotes” are OK.");//]]></script>

```

Since it is often the case that you will want to use Javascript that does NOT include curly brackets on their own line I think this is a more generally useful solution.
> 0 votes

---
Tags: ee2, javascript, html-entities
---


title: Grouping entries by custom field

text:
# Question
Title: Grouping entries by custom field
I was seeing this wunderful idea from Stephen T (Grouping entries by relationship field (title)), unfortunately it's not working for me.

I have a channel called market which actually is a store where people can share reviews of their market visits. I would like to group by market visit. So it would look like this

July 30th

* Market A
* Market B

July 31st

* Market B
* Market C

As the date refers to the actual visit date and NOT the entry date, date\_heading is not working (as it refers to enry date only)

Any idea is highly appreciated, especially a non thrid-party solution

# Answer
> 1 votes
Sometimes I feel like I am too stupid to read. Of course if works as described in the docs. Thanks Nutmeg for your help anyway. The visit date is obtained by a channel form and the code would look like this:

```
{exp:channel:entries channel="market_visits" limit="10" orderby="visit date" sort="desc"}

       {date_heading display="daily"}
...
                  {visit date format="%d.%m.%Y"}
...
       {/date_heading}
...
                 <li>{market}</li>
    ...
    {/exp:channel:entries}

```

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


title: Return category info in fixed order

text:
# Question
Title: Return category info in fixed order
Looking for suggestions for an active plugin or any obvious way to return basic categories info (category name, url\_title, and image) with a fixed sort order based on category ids (i.e: sort="3|5|2"). I know I can query for this, but maybe someone has another suggestion.

# Answer
> 0 votes
For the majority of my needs for category info in a fixed sort order, I found the plugin Categoree works: http://devot-ee.com/add-ons/categoree .

Example:

```
{exp:categoree:pair show="{lv_snippet_piped_cat_list}" fixed="yes"}{category_name}, {/exp:categoree:pair}

```

---
Tags: plugin, categories
---


# Question
Title: Custom URL structure using Playa segments
How can I build a custom URL structure using Playa fields as segments?

Like this:

```
http://example.com/templateGroup/template/playaParent/playaChild

```

# Answer
Playa tags will not have parsed before the page loads.

If you matched your playa field and template names you could generate links with Playa then clicking the link would take you to the corresponding template.
> 1 votes

# Answer
We'd need a bit more detail about what you're trying to do to give a more specific answer, but I don't think you need to do anything special to do this. I've done it before. Having both parent and child url\_titles in the URL and using each to load up the correct entries.

Really that doesn't have anything to do with Playa at all, except for when you want to ensure that the parent-child relationship in the URL really exists.

I've done this in the past by loading up the parent entry in a channel:entries tag and comparing the playa field's selected entry to the child entry in the URL. If they don't match, then throw a 404.
> 0 votes

---
Tags: playa, url
---


title: How Do You Update Expression Engine?

text:
# Question
Title: How Do You Update Expression Engine?
I've been a bit frustrated with the process of updating EE in past few months so I'd like to learn best practices from the community so I can alleviate my pain a bit. I manage my site with Git and Github and deploy to two bare repos (dev, prod).

Here it is how I do it currently:

* Download the latest version from Ellislab
* Dump my prod database and import it locally
* Create a separate branch for the update
* Follow the instructions on Ellislab on how to update
* After update is done I merge the branch onto master
* Import database to prod
* And finally push my merged master branch to Github and then dev.

On average, this process takes somewhere between 30 min to 1 hour. It depends on the size of your site (database, configuration, modules, etc).

What's flawed with my process? Is there a better process, if so what do you recommend? I'm eager to hear your suggestion and learn from you all!

Thanks,

Juliano

# Answer
> 6 votes
I use Git and Beanstalk to do a 2-phase upgrade process. I upgrade and troubleshoot locally then quickly deploy the upgrades to production when I'm done.

I wrote a blog post about it: https://www.kristengrote.com/blog/articles/the-20-minute-expressionengine-upgrade

# Answer
> 2 votes
Same process here, except that I update all add-ons the site uses in the process.

DevDemon updater can speed up the process a little bit.

# Answer
> 0 votes
If the site is not in version control (i.e. prior to me learning it) then I upgrade by using DevDemon updater and taking a backup just in case).

If the site is in version control. I pretty much do what Kristen mentions in her blog post except that I take a db dump locally before deploying and then import that db to the live site during deployment.

---
Tags: update
---


title: Freeform Composer return path

text:
# Question
Title: Freeform Composer return path
How do I inject the Return Path into my Freeform Composer template, so it directs people to the specified page, after submitting the form?

```
{exp:freeform:composer form_id="{form-freeform:form_id}" composer_template_id="{form-freeform:composer_template_id}" return="?????????" form:class="pure-form pure-form-aligned"}
    {composer:page}
        {composer:rows}
            <div class="pure-control-group">
                {composer:columns}
                {if composer:field_total == 0}{/if}
                {composer:fields}
                    {if composer:field_label}       {!-- Output field labels --}
                        {if composer:field_type == 'nonfield_captcha'}
                            {if captcha}<p>{composer:field_label}</p>{/if}
                        {if:else}
                            <label {if composer:field_name != ''}for="{composer:field_name}"{/if}>{freeform:description:{composer:field_name}}</label>
                        {/if}
                    {/if}
                    {if composer:field_output}      {!-- Output field inputs --}
                        {if composer:field_type == 'nonfield_title'}
                            <h4>
                                {if composer:field_name AND composer:field_required}{freeform:field:{composer:field_name} attr:required="required" attr:placeholder="Required"}
                                {if:else}{composer:field_output}
                                {/if}
                            </h4>
                        {if:elseif composer:field_type == 'nonfield_captcha'}
                            {if captcha}{captcha}<br /><input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px">{/if}
                        {if:elseif composer:field_type == 'nonfield_submit'}
                            <div class="pure-controls"><button type="submit" class="pure-button pure-button-primary">Submit</button></div>
                        {if:elseif composer:field_type == 'checkbox_group'}
                            <div style="display:inline-block">{composer:field_output}</div>
                        {if:elseif composer:field_type == 'radio'}
                            <div style="display:inline-block;vertical-align:top">{composer:field_output}</div>
                        {if:else}
                            {if composer:field_name AND composer:field_required}
                                {freeform:field:{composer:field_name} attr:required="required" attr:placeholder="Required"}
                            {if:else}
                                {composer:field_output}
                            {/if}
                        {/if}
                    {/if}
                {/composer:fields}
                {/composer:columns}
            </div>
        {/composer:rows}
    {/composer:page}
{/exp:freeform:composer}

```

# Answer
> 0 votes
I believe that you can just leave off the return parameter and it will take the value you put into the channel field

# Answer
> 0 votes
When you are using the fieldtype you don't need to use the entire {exp:freeform:composer} tag set. Just the field name as normal: {form-freeform} and everything else is automatic.

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


# Question
Title: Is there a way to relate channel fields to one another?
I am creating a staff profile page, where I want to display social media icons for any social media sites each staff member may have (see photo).

I don't want to list ALL social media options, but I'd rather have a channel field type "drop-down" with options, and then a corresponding URL field (which can just be a text field). If the user has more than one social media account, there should be a "add another" button on the Publish page, which will add another drop-down and URL field.

The drop-down field will correspond to a Class name (i.e. class="icon-facebook"), which will then place an icon on the published page.

Is this possible, or am I making this too complicated?

Is there another, better solution in order to make this work? Or would it be easier for me to hard-code a "Facebook" field, and a "Facebook\_url" field, "twitter," "twitter\_url," etc.?

THANK YOU!!!

# Answer
Have you looked at the Grid fieldtype?
https://ellislab.com/expressionengine/user-guide/add-ons/channel/grid.html

edit: if you need extra validation based on one of the columns (e.g. if an image is selected, validate that a caption is required), then you can insert some jQuery or javascript in a custom accesoire, or more simple, inside the field instructions. Be careful (and test) because the field-instructions do get formatted a bit (e.g. nbsp; inserted).

```
<script type="text/javascript">
$(document).ready( function(){
    console.log('hello console');
});
</script>
Other normal instruction text

```

or

```
<script type="text/javascript" src="/js/custom_grid_validate.js"></script>
Other normal instructions

```
> 2 votes

---
Tags: channel-fields
---


# Question
Title: Accesoire development, determine publish page
An older accesoire add-on i have have, uses
`if($this->EE->input->get('C') == 'content_publish'){ ... }`
to determine if we're on the publish page.

Since 2.8/2.9 the cp url structure changed
`example.com/system/index.php?/cp/content_publish/entry_form&channel_id=3&S=x`

1. Could check the uri class segments
2. Could check EE-\>router-\>class and -\>method

What are current/good methods to determine control panel pages we're on?

# Answer
> 4 votes
`ee()->router->fetch_class()` and `ee()->router->fetch_method()` should always reveal that information to you, regardless of the URL pattern or special routing.

---
Tags: add-on-development
---


# Question
Title: What is causing the paginate_base parameter to be ignored?
I am trying to add pagination to the site. I am using structure (which I suspect is part of the problem). Here is my code:

```
 {exp:channel:entries channel="blog" cache="no" dynamic="no" orderby="published_date" limit="5" paginate="bottom" paginate_base="blog/index"}

 {!-- Other code here to display the entries. --}

 {paginate}
   {pagination_links}
     <ul class="inline">
       {previous_page}
         <li class="pull-left"><a href="{pagination_url}" class="page-previous bttn bttn-orange bttn-small"> ‹ Previous</a></li>
       {/previous_page}

       {next_page}
         <li class="pull-right"><a href="{pagination_url}" class="page-next bttn bttn-orange bttn-small">Next Page ›</a></li>
       {/next_page}
     </ul>
   {/pagination_links}
 {/paginate}
 {/exp:channel:entries}

```

The main problem is that something is overriding the paginate\_base parameter and the value I am putting in there is getting ignored. The resulting links look like this:
http://www.faketld.com/blog/P5
http://www.faketld.com/blog/P10
etc.

I am expecting this to render links that look like this:
http://www.faketld.com/blog/index/P5
http://www.faketld.com/blog/index/P10
etc.

The strange thing is that if I use any other value for paginate\_base it works as expected. For example:

paginate\_base="index/blog" renders http://www.faketld.com/index/blog/P5
paginate\_base="/" renders http://www.faketld.com/P5
paginate\_base="peas/carrots" renders http://www.faketld.com/peas/carrots/P5

Oddly enough, it is specifically the one value I need to use that is overridden. Again, I have a feeling that Structure is causing this issue, but searching Google and this site haven't given me any solutions.

I have tried removing `dynamic="no"` but this seems to conflict with structure and I get no results.

Any help will be appreciated. Thank you.

# Answer
The index template of any template group does not typically show up when accessed this way in the url. So when the pagination base parameter is used with a template group's index template, it will automatically remove it the index part of the url.

I guess it would also be helpful to know why you need the word index in the actual url (for pagination or any other reason) so another solution could be offered. There is probably another way to program your template to allow for pagination without the use of index. If there is not, I'm sorry but that is how expressionengine functions.
> 0 votes

# Answer
You should be able to take out the dynamic="no" parameter and it should fix the pagination problem. The dynamic parameter should only be included when there is the posibillity of a URL\_title being in the URL.
> 0 votes

---
Tags: structure, pagination
---


# Question
Title: Can't switch system on / off in Expression Engine 2.9
I am on EE 2.9 and I can’t switch the system on / off anymore.

When I go to Admin -\> General Configuration and set “Is the system on?” to “No”, nothing changes.

I’ve already tried this in various browsers, cleared all browser and EE caches but to no avail.

I’ve also followed the steps suggested by Anna in this thread: System Offline problems

What else could I try?

Thanks for any help.

# Answer
> 0 votes
I know it might be obvious. But it's not because you are logged in is it? If you make sure you log out after turning the system off, refresh your browser and then see if the site is visible.

---
Tags: system
---


# Question
Title: How to empty grid in custom form (with html form elements)
I have a custom made data form, with therein a datagrid with multiple fields. I have made the possibility to add entries, in the background adding rows by adding input elements with the correct names:

```
<input name='field_id_16[rows][new_row_0][col_id_1]' type='text'>
<input name='field_id_16[rows][new_row_0][col_id_2]' type='text'>

```

.. etc.

this checkout the correct field and column names, and everything is going as planned. now I also built in the possibility of deleting, and as long I take care of the 'new\_row\_x' numbering, this all goes well.

now my problem is when the user deletes all entries. I don't have the form elements anymore (because there should be none - when the user removes all datarows) giving a value, and i don't know how to custom update a datagrid which used to elements, back to being empty...?

anybody knows what to do?

greets Rick

# Answer
After a bit more trying different things, I found out that by just using the field id name and keeping the value empty, submitting the form empties the grid.

see in my case (the grid having database id 16):

```
<input type='hidden' name='field_id_16' value=''>

```

empties the grid when submitted.
> 0 votes

---
Tags: safecracker, grid
---


title: Linking to jQuery

text:
# Question
Title: Linking to jQuery
I know this question has been asked a lot but I still can't figure out how to solve this problem. I'm not sure what I'm doing wrong.

Basically, what I did was I separated the jQuery files and added them in a template group called "styles" like so:

In the html file I tried to link them by using these code:

```
<script type="text/javascript" src="{path="styles/java"}"></script>
<script type="text/javascript" src="{path="styles/cycle"}"></script>
<script type="text/javascript" src="{path="styles/min"}"></script>

```

I know it seems to be a dump question but I'm totally new to this.

Thanks!

# Answer
I never use CSS or Javascript files as EE templates. Better to leave them as static files on the server and link to them like you normally would. Something like this (assuming the files are in a folder named "js"):

```
<script type="text/javascript" src="/js/java.js"></script>
<script type="text/javascript" src="/js/cycle.js"></script>
<script type="text/javascript" src="/js/min.js"></script>

```
> 1 votes

---
Tags: jquery
---


# Question
Title: Zoo Visitor Forgot password form not working
I'm using EE 2.8.1 and Visitor 1.3.32.

I have the following form on a /forgot-password template:

```
{exp:zoo_visitor:forgot_password error_handling="inline" reset_url="forgot-password" parse="inward"}
    {if password_sent}
            <h3>A password reset mail has been sent to the provided email.</h3>
    {if:else}
            <fieldset>
                    <p>
                            <label for="email" class="form-label">Your email:</label>
                            <input type="text" name="email" id="email" class="form-text" value="" />
                    </p>
                    {error:email}
            </fieldset>
            <p>
                            <input type="submit" value="Retrieve password" class="button" />
            </p>
    {/if}
{/exp:zoo_visitor:forgot_password}

```

When I submit the form, it returns to my home page and does not send an email. I have a sneaking suspicion that it has something to do with my htaccess file. However, I'm not adding any slashes, rather, removing them, etc:

```
RewriteEngine On

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

#remove trailing slash from URLs
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$  /$1 [R=301,L]

# Removes index.php from URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

```

Any thoughts here?

# Answer
> 0 votes
I cleared my cache and this worked fine.

---
Tags: zoo-visitor, forgot-password
---


# Question
Title: Navigation link structure: two templates, two channels, one category group?
I have a navigation/URL structure issue, and I haven't been able to find online exactly what I want to accomplish.

I have an "About" template and a "Staff" template - so different URL's for each template. I have two Channels, one for each template, but have only ONE category group.

I've set up the navigation so that I have a drop-down under my "about" navigation item, which lists all of the categories - About, Mission, Staff, Facts. All of the categories, except for Staff, will pull up on the "About" template. I want "Staff," however, to direct to my staff template. Is this possible?

What variable do I use to direct that one category to another template?

I have this code in my nav:

```
{exp:channel:categories category_group="1" style="linear" show_empty="no"}
                <li><a href="{path='??'}">{category_name}</a></li>
            {/exp:channel:categories}

```

# Answer
> 1 votes
In general using categories for navigation on "static" sections can be frustrating. They weren't really designed with that in mind.

In this case I'd try using a conditional inside the loop to look for the staff entry and then build a different link:

```
{exp:channel:categories category_group="1" style="linear" show_empty="no"}
        <li>
            {if category_url_title != "staff"}
                <a href="{path='about/index'}">{category_name}</a>
            {/if}

            {if category_url_title=="staff"}
                <a href="{site_url}about/staff'}">{category_name}</a>
            {/if}

        </li>
{/exp:channel:categories}

```

The reason for not using the path linking variable in the second case is that because it's within a category loop EE will create a category link (http://yoursite.com/about/staff/category/category\_url\_title) which in this case you don't want.

---
Tags: categories, category-group
---


# Question
Title: Multiple Channel Entries on Template - Works for Home Page - Not for Other Pages
I rarely do any crazy cross/channel templates. Most EE sites I've developed are based on individual channels. I did something that seems to be working for the home page, but not for the interior pages; e.g., anything past index.php/template-name/page-name

Here's my main template code:

```
{embed="inc/.header.doc-open"}

    {embed="inc/.left-sidebar"}

    <div class="ctnr cf two-four grid">
        {exp:channel:entries channel="content" limit="1"}
        <div class="ctnr cf one-one content" id="hero">

            {content_body}

        </div><!-- end #hero -->
    {/exp:channel:entries}
    </div><!-- end .ctnr -->

    {embed="inc/.right-sidebar"}

    {embed="inc/.footer.doc-close"}

```

I'm opening/closing channels within each include group; e.g.:

```
        <div class="left-sidebar ctnr cf one-four grid">
    {exp:channel:entries channel="left"}
        {left_content}
    {/exp:channel:entries}
    </div><!-- end .ctnr -->

```

This seems to be working perfectly on the home page... It sorta works if I just do the following url structure index.php/template-name - This pulls in the most recent entry. Once I put in the actual url title; e.g., index.php/template-name/page-title it pulls the content, but all the includes are messed up. They're getting pulled in, but the content and images aren't.

Any pointers on this?

Thanks!

# Answer
Have you tried adding dynamic="no" as a parameter for your channel entries? Since there is no url title on the homepage the entries loops assume it will be a listing, but as soon as you add more segments to your url. The entries try and pull that title. By adding dynamic="no", you are saying that you do not care what the url title is, you just want the listing. Check out the documentation
> 1 votes

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


# Question
Title: Return tag name from a segment in Tagger
I'm pulling tagged entries via segment\_3. When I'm showing this page, I'd like to have it titled "SEARCH FOR: {TAG}". Problem is that nowhere in the documentation can I tell where you can pull the tag name out from a segment....

Tried getting complex with this but it pulled all tags:

```
   <h1>SEARCH FOR:
    {exp:tagger:entries tag="{segment_3}" limit="1"}
      {exp:tagger:tags entry_id="{tagger:entry_id}"}
        {tagger:tag_name}
      {/exp:tagger:tags}
    {/exp:tagger:entries}
  </h1>

```

# Answer
> 0 votes
Have you check this out in the documentation?

```
{exp:tagger:tagname tag="{segment_3}"}

```

---
Tags: devdemon-tagger
---


# Question
Title: Entries within entries from a single channel template
Need some help and will try to explain as clearly as possible...

I'm redesigning a law site.

I have a template group called "attorneys" for each lawyer profile that has tabs holding various info. Right now, I have individual templates for each profile page that's working fine, but I want to put all the same data into a channel to allow the client to make additions/changes etc.

Moving the data into a channel, I'm using the index of the group which calls the new channel "attorneys" which holds all the data elements. Custom fields are used for each tabs' content with {if} statements to show or hide based on if there's content entered into the individual entries or not.

Simple enough for a standard template/channel combo.

**Here's where the tricky part comes in...**

The "attorneys" channel has a custom field called {blog\_posts\_tab}. It's a yes/no radio selection so each entry can have the option to show or hide the "blog posts" tab and its content.

The {blog\_posts\_tab} is supposed to display the entries written by that specific attorney that's held in a separate channel "news\_and\_articles".

For example, if you're viewing the 'Karl' attorney entry and click the 'Blog Posts' tab, it will display the title and date of the articles written by only Karl with links to those articles held in a separate channel.

The problem I'm having now is that the "Blog Posts" tab is empty and not pulling any data, only the title and entry of the entry you're viewing.

I've tried using:

{exp:channel:entries channel="attorneys|news\_and\_articles"}

combined with

{if blog\_posts\_tab == 'Yes' || channel\_short\_name == "news\_and\_articles"}

Here's the partial template code:

```
{exp:channel:entries channel="attorneys|news_and_articles"}
    <!-- ========== BIO DETAIL ========== -->
    <div data-equalizer class="row">
        <div data-equalizer-watch class="large-6 columns medium-6 large-push-6 end">
            <img src="{attorney_portrait}" class="right arrow-mask-left" alt="">
        </div>
        <div data-equalizer-watch class="large-5 columns medium-6 large-offset-1 large-pull-6">
            <div class="vertical-align">
                {body}
                <h5><a href="tel: 1-{attorney_phone_number}" class="normal">{attorney_phone_number}</a>
                  {if attorney_phone_extension != ""}, {attorney_phone_extension}{/if}</h5>
                <h5><a href="mailto:{attorney_email}" class="normal">{attorney_email}</a>
                </h5>
                {if v-card != ""}<a href="{v-card}" class="button">V-card</a>{/if}

                {if attorney_linkedin_profile != ""}
                <h5>
                    <a href="{attorney_linkedin_profile}" class="normal" target="_blank">
                        <img src="/img/global/icon-social-square-blue-linkedin.svg" width="18" height="18" alt="">LinkedIn Profile</a>
                </h5>{/if}
            </div>
        </div>
    </div>
    <br>
            <!-- ==========   TABS CONTENT   ========== -->
            <div class="tabs-content">
                <div id="tab-1" class="content active">
                    <div class="large-12 medium-11 columns medium-centered">
                        {tab-1-content}
                    </div>
                </div>

                {if tab-2-content != ""}
                <div id="tab-2" class="content">
                    <div class="large-12 medium-11 columns medium-centered">
                        {tab-2-content}
                    </div>
                </div>{/if}

                {if tab-3-content != ""}
                <div id="tab-3" class="content">
                    <div class="large-12 medium-11 columns medium-centered">
                        {tab-3-content}
                    </div>
                </div>{/if}

                {if tab-4-content != ""}
                <div id="tab-4" class="content">
                    <div class="large-12 medium-11 columns medium-centered">
                        {tab-4-content}
                    </div>
                </div>{/if}

                {if blog_posts_tab == 'Yes' || channel_short_name == "news_and_articles"}
                <div id="tab-5" class="content">
                    <div class="large-12 medium-11 columns medium-centered">
                        <ul class="no-bullet">
                            <li>
                                <h6><a href="{title_permalink}">{title}
                                    <div class="text-serif">
                                      <small>{entry_date format="%l, %F %d, %Y"}</small>
                                    </div></a>
                                </h6>
                                <hr>
                            </li>
                        </ul>
                    </div>
                </div>
                {/if}
    {/exp:channel:entries}

```

Is something like this possible??? Do I need an extra plug-in like Stash?

Here's the template that's working: http://www.krinternetlaw.com/attorneys/karl-kronenberger-profile

And entry that's not working: http://www.krinternetlaw.com/attorneys/karl-kronenberger

Thanks so much!!! Danny

# Answer
> 3 votes
No add-ons are necessary. You could use an embed, passing the lawyer's member ID to the embedded template. Embedded templates are parsed separately, and would allow you to use a separate channel entries tag inside another one. You would use the passed member ID in the author\_id= parameter of the tag on the "inner" template.

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


title: Display category name on page

text:
# Question
Title: Display category name on page
I have my category links:

```
{exp:channel:categories channel="pages" category_group="3"}
        <a href="{path='work/cat-landing'}">{category_name}</a>
        {if category_description}{category_description}{/if}
{/exp:channel:categories}

```

I'm trying to display the name of the category that was clicked on "cat-landing" template.

Using the following code, but that's just outputting all the categories I have selected in my entries.

```
{categories} {category_name}{/categories}

```

Any help is much appreciated!

# Answer
If you are using standard category url methods, you can just use the category heading tag.
> 0 votes

---
Tags: channel-entries, categories, category-name
---


title: MX Notify Control issues with EE 2.9

text:
# Question
Title: MX Notify Control issues with EE 2.9
I just updated my site to EE 2.9 from EE 2.6.1. I'm using MX Notify Control v. 2.4.6 along with the fieldtype MX Delegate Email to send out emails after Zoo Visitor updates. The field type is causing problems throughout the site now. I cannot access any of the Channel Fields in the EE CP, nor access any of the entries that use MX Delegate Email.

Since I have hundreds of Zoo Visitor entries that include a field for MX Delegate email, I was afraid to just remove the field to see if that fixes it.

The error I am getting is:

```
Fatal error: Call to undefined method EE_Fieldtype::EE_Fieldtype() in /home2/account/system/expressionengine/third_party/mx_delegate_email/ft.mx_delegate_email.php on line 16

```

I'm hoping that Max Lazar or someone will give me a suggestion of what to do.

---

UPDATE: I ended up doing a search for the Fatal error I mentioned above, and found a hack that worked here: http://devot-ee.com/add-ons/support/simple-s3-uploader/viewthread/12869

In the MX Delegate Email plugin code, I changed

```
parent::EE_Fieldtype();

```

to

```
parent::__construct();

```

It fixed the problems I mentioned above plus a few others I didn't know were related.

# Answer
> 1 votes
This compatibility bug was fixed 3 month ago and available in last version

---
Tags: mx-notify
---


# Question
Title: Need help with the MX Zip plugin for EE 2.7+
I've been using the MX Zip plugin for a while, but one function it used was deprecated in version 2.7.

```
Call to undefined method EE_Functions::remove_double_slashes()

```

It's a free plugin (http://www.eec.ms/add-ons/mx-zip), but it looks like it has not been updated for a while. Has anyone found a workaround for this?

# Answer
> 1 votes
This error was fixed in version 3.0.1

---
Tags: add-on, update, mx-zip
---


# Question
Title: Loading of data (40+ fields) for multiple (250+) entries on single page
I am querying whether this is a good idea, and if so best way to do it.

I have a channel (club\_listing) that contains 40+ fields. There are 250+ club\_listing entries.

On my clients current/old site, they have a Club Listing page which lists each of the club names. When you click on name a popup window appears with all the relevant details.

(I would prefer not to have a popup or new page displaying each clubs info.)

What i wanted to do was have hidden divs on the page that contains all the data for each entry. When the user click the club name, the relevant hidden div appears displaying all the info.

Now i already have a nice script that is doing this for the FAQS (click question, answer displays below it). I wanted to use this same script, but on test the page takes ages to load.

My initial template embeds the template with the club listing. This club listing template (uses parents tag so opens channel tag for the parent (zone) not club\_listing) embeds the data for each club (snippets don't work).

Is it NOT a good idea to have a single page load the data of so many entries (eg, 40 fields x 250 entries = 10000), or is there some way that it can all load quickly and is acceptable to do?

Any response is much appreciated!

# Answer
> 0 votes
Create your list as normal but don't include the detail on that template.

Create a 'detail' template which outputs the club's details using EE's normal URL parsing.

Make sure that all works, albeit loading the details into a now page.

Now, on the write some Javascript (or jQuery) which intercepts clicks on the club names and uses Ajax to load the club details - either into a div below the club name or into a modal window.

If you don't want to do the Javascript yourself then you can make this even simpler by using a framework such as Foundation which gives you some handy tools (such as the Reveal modal) for doing things like this simply by adding a data attribute to your link. I'd make a custom build of Foundation which didn't include the features I wasn't going to use - or look for a standalone jQuery plugin like Fancybox instead.

UPDATE to explain Ajax

Imagine one of your clubs was called 'Sports Club' and the URL for your embed would then be /lists/sportsclub

If you visited /lists/sportsclub in your browser then the details for that club would be displayed.

All Ajax does is use Javascript to load the URL **without** reloading the page. You can specify a container into which the loaded HTML gets inserted.

That container might be an ever present div, or one created dynamically by the javascript directly after the club you clicked on, or hidden in the foot of the page and used as a modal. It's up to you.

So in the case of using Fancybox - it creates a modal and loads the HTML from your URL into it. For instance, an Ajax example on the Fancybox site uses this markup

```
<a class="various fancybox.ajax" data-fancybox-type="ajax" href="/demo/ajax.txt">Ajax</a>

```

At this point, this is not an EE question but one on how to implement an Ajax call - specifically using Fancybox.

# Answer
> 2 votes
That's a lot of data so in addition to server performance, you want to consider client-side performance and the page weight. You could eliminate or minimize the server-side issue with long caches or using Varnish, but you'll still have a lot of data transmitted and potentially client-side heavy page.

I'm guessing that the visitor only cares about info for clubs they are interested in, and will not likely be browsing all 250 when they visit that page. So another balanced solution would be to retrieve the contents for the revealed container via AJAX. The AJAX template could have a single-entry tag, and return just the one field.

---
Tags: entries, embeds, loading-time
---


# Question
Title: Issue when forms - "This form has expired" error
I am using EE 2.9 and trying to put together a channel form. However, while it worked initially, now all it gives me each time I test it is the "This form has expired" error. This is the form setup:

```
{exp:channel:form channel="channel9" return="Links" class="Submit" id="Submit"}
<label for="title">Title</label>
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" />
{custom_fields}
<label for="{field_name}">{field_label}</label>
{if textarea}
<textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}" onclick="setFieldName(this.name)">{field_data}</textarea>
{/if}
{if textinput}
<input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" />
{/if}
{/custom_fields}
{category_menu}
<label for="categories">Categories</label>
<select name="category[]" id="categories" size="4">
{select_options}
</select>
{/category_menu}
{if captcha}
<br />
<label for="captcha">Please enter the word you see in the image below:</label>
<br />
{captcha}
<br /><br />
<input type="text" name="captcha" value="{captcha_word}" maxlength="20">
{/if}
<br />
<input type="submit" name="submit" value="Submit" />
{/exp:channel:form}

```

I saw a suggestion about adding `<input type="hidden" name="XID" value="{XID_HASH}" />` but this made no difference.

# Answer
> 1 votes
Are you browsing behind a corporate firewall or some other network caching device? It could be errantly delivering you a stale error. I've also seen Chrome be a bit sticky with caches, so try to delete your browser's cache too.

# Answer
> 0 votes
Answered a question regarding this bug a little while ago...

EE 2.8.1 mailing list This form has expired

---
Tags: safecracker
---


# Question
Title: Change the expressionengine publish entry datepicker
As a programming project I have a task to change expressionengine default datepicker for inserting date in publish or edit entry form with a custom one! I know where the default datepicker file is located , but I'm not allowed in any case to replace or change this file , but I need to attach my own jquery datepicker using some extension hook to the expressionengine publish entry date field , but I really don't know how to define my datepicker in expressionengine , and I only need it in the control panel / publish entry / date area! not as a channel field.

PS : the reason to change the current EE datepicker is because we have a very different format for showing date (different year , month etc.) like how chinese date format is different with US!

# Answer
> 1 votes
You would have to prevent default to stop the existing datepicker opening on input click.

You could then use jQuery UI datepicker to add your own datepicker and customise it.

---
Tags: date
---


# Question
Title: Solspace Tag: undefined method Pagination_object::get_template() in mod.tag.php on line 2351
As far as I know I'm running current versions of EE core and all add ons...

* EE 2.9.0
* Solspace Tag 4.2.7
* Structure 3.3.14.5
* Campaigns 2.0.3
* CE Cache 1.9.5

{exp:tag:related\_entries} and {exp:tag:tags} are wrapped in {exp:ce\_cache:escape}.

On *some* entries I get a white screen when Tags are assigned. I remove all Tags from the entry, save, refresh front-end page and it renders properly.

Add a Tag back to the entry, save, refresh front-end page and I see:

```
undefined method Pagination_object::get_template() in mod.tag.php on line 2351

```

Remove all Tags from the entry, save, refresh front-end page and it renders properly.

What's strange is that this is only happening on *some* entries.

The Solspace tags I'm using in this template are:

```
{exp:tag:related_entries
    channel="self_help_tips"
    entry_id="{structure:page:entry_id}"
    rank_method="total_entries"
    orderby="relevance"
    limit="20"
}

```

and

```
{exp:tag:tags entry_id="{structure:page:entry_id}"}

```

Please let me know if I'm doing something stupid here, but I can't figure out why only *some* entries are affected.

---

## EDIT Aug 2

I've trimmed down the EE template to just the following tags:

```
        <div class="col-sm-4">
            <h2>Related Tips</h2>
            {exp:tag:related_entries
                channel="self_help_tips"
                entry_id="{structure:page:entry_id}"
                rank_method="total_entries"
                orderby="relevance"
                limit="20"
            }
                <p style="line-height:1.2em;"><a href="{url_title_path='tips'}" style="text-decoration:none;">{title}</a></p>
            {/exp:tag:related_entries}
        </div>
        <div class="col-sm-4">
            <h2>Tags</h2>
            {exp:tag:tags entry_id="{structure:page:entry_id}"}
                {if tag_count == '1'}<ul class="list-inline tags">{/if}
                <li>
                    <a href="{path='tips'}/tag/{websafe_tag}">{tag}</a>
                </li>
                {if tag_count == tag_total_results}</ul>{/if}
            {/exp:tag:tags}
        </div>

```

No pagination is being used in these tags.

# Answer
I'm guessing this was an issue of file corruption, or perhaps some files did not upload properly to the production server.

These pages appear to be working fine after I deleted all /third\_party and /themes files for the Tag module and re-uploaded them to the server.

I'll keep an eye on it and will post again if anything else comes up. Thank you Solspace for the great support!
> 1 votes

---
Tags: solspace, solspace-tag
---


# Question
Title: Template editor malfunction after update to 2.9.0
Yesterday I updated one of my site to 2.9.0 (from 2.5.x ... yes I know ...) anyhow everything worked well except that the template editor is not working as before. Meaning:

* I can't insert tab spaces anymore as then the editor move my cursor to the next field (Preference, Template name)
* The Preferences, Access and Template notes block are always visible and I cannot collapse them anymore....

I'm just rebuilding the site of my customer and editing thousands of lines like this will not be easy ;-)

As anyone seen this before? thanks in advance for any hint.

Steven

# Answer
> 2 votes
This was an odd one! It turns out it was a suhosin.get.max\_value\_length setting.

Any value over 128 characters, the variable was dropped from $\_GET. And our combo loader specifies the files to pull in to create the js file via $\_GET:

```
plugin=ee_codemirror&file=codemirror/codemirror,codemirror/closebrackets,codemirror/lint,codemirror/overlay,etc, etc, way more than 128 etc....

```

When the comboloader created the js file, there was no file value since it had been dropped entirely- and none of that code was being included in the resulting js file. Hence massive breakage.

Tweaking the server config gets it squared away.

# Answer
> 1 votes
When working on larger projects, i usually write templates to files. That way you can more easily edit in a "real" editor (like sublime etc.) and store a copy in an archive or even version control with git or mercurial.

After everything works, you only have to sync all templates via the template manager once (and optionally disable templates as files to serve from database)

If you think there's a malfunction with template editor, maybe file a bug report.

# Answer
> 1 votes
Did you remember to update your themes? There is new JavaScript in 2.9.0 that handles the improved template editor. If you open your console on that page, I'm going to guess you have a number of JS errors (which also explains why your fields at the bottom are toggled open).

---
Tags: ee2, ee2-upgrades, editor
---


# Question
Title: Show only parent when segment 3 is active and dynamic
I have a simple entry with categories and children.

Parent A Child A Child B

When an entry is set to ONLY Parent A I want that entry to display. BUt what happens is the children entry is displayed instead.

```
{exp:channel:entries channel="channel_name" dynamic="on" limit="1"}
{content}{/exp:channel:entries}

http://domain.com/home/Classes/category/parent-a

```

in the example above the child category a displays instead of Parent A

# Answer
> 1 votes
auto-assign category to parents set to NO fixed it

---
Tags: categories, parent, child-categories, children
---


# Question
Title: Can you use Multi Currency in Cart Throb
I need to find an option to allow Multi Currency in Cart Throb checkout. Is there a way to automatically change the currency based on the customers country code?

# Answer
> 1 votes
I believe what you're after is: https://github.com/CartThrob/addon-multi-location-settings-manager

Found via this forum post: http://cartthrob.com/forums/viewthread/4884/, and this one: http://cartthrob.com/forums/viewthread/4622/P15/#28813

They look a little outdated (last update 2 years ago!) so don't know how relevent it is to the current release.

Hopefully that helps ;)

---
Tags: cartthrob, ecommerce, shopping-cart, currency
---


# Question
Title: PHP errors after upgrading Playa and EE, error number 1054
We migrated our site to a new server and upgraded from EE 2.5.2 to 2.9. Playa and other add-ons were already installed on the site when I inherited it. I updated Playa according to their instructions but I ran into a bunch of problems. First, while Fieldtypes displayed the new version, 4.5 when I went to Modules it was still saying 4.3.3. No matter what I did I couldn't get it to update in both places. Eventually I figured out it was a problem with permissions on the server so I contacted our host and got that resolved, uploaded the files again but that still didn't help. Ultimately I had to uninstall the plugin using the uninstall option on the backend, then I reinstalled it and that finally worked: I saw the current version 4.5 in both places on the backend.

Now the only problem is I got a bunch of PHP errors on the front end whenever I tried to display an article that used the Playa relationships field.

```
    Error Number: 1054

Unknown column 'rel.parent_is_draft' in 'where clause'

SELECT DISTINCT(rel.child_entry_id) AS entry_id FROM exp_playa_relationships rel WHERE rel.parent_entry_id = 1 AND rel.parent_is_draft = 0 ORDER BY rel.rel_order

Filename: /third_party/playa/mod.playa.php

Line Number: 739

```

It's identical to the problem mentioned in this thread. The solution there was that the Playa update didn't complete properly. I uploaded the new files several times. And I even reinstalled the plugin and still got the error. The only way I could get the site to function was to comment out several lines of code in that file. Now the site works and no more PHP errors but neither does Playa work and none of our Related Articles are displaying.

Can anyone help? Thanks in advance. :)

# Answer
Here's the `create table` statement that would get you to what I have installed on my version of Playa 4.5

```
CREATE TABLE `exp_playa_relationships` (
  `rel_id` int(10) unsigned NOT NULL auto_increment,
  `parent_entry_id` int(10) unsigned default NULL,
  `parent_field_id` int(6) unsigned default NULL,
  `parent_col_id` int(6) unsigned default NULL,
  `parent_row_id` int(10) unsigned default NULL,
  `parent_var_id` int(6) unsigned default NULL,
  `parent_is_draft` int(1) unsigned NOT NULL default '0',
  `child_entry_id` int(10) unsigned default NULL,
  `rel_order` int(4) unsigned default NULL,
  PRIMARY KEY  (`rel_id`),
  KEY `parent_entry_id` (`parent_entry_id`),
  KEY `parent_field_id` (`parent_field_id`),
  KEY `parent_col_id` (`parent_col_id`),
  KEY `parent_row_id` (`parent_row_id`),
  KEY `parent_var_id` (`parent_var_id`),
  KEY `child_entry_id` (`child_entry_id`)
)

```

From your error it appears you are missing the column `exp_playa_relationships`, possibly others. Compare to your current structure and fill in as necessary.
> 0 votes

---
Tags: playa, pixelandtonic, ee2-upgrades
---


# Question
Title: Channel Polls : 'Allow users to vote on multiple answers' Conditional?
One of the options in the field setup is to allow users to select more than one answer ('Allow users to vote on multiple answers' Yes/No).

There doesn't seem to be any mention in the docs of a conditional I can use to test this in my templates. Something like `{if poll:multiple_vote}` so I can at least swap out radio buttons for checkboxes.

Is a conditional like this already built in but simply missing from the docs, or do I need to hack the module to get it to work correctly?

# Answer
We have added a new conditional to Channel Polls that will be in the next release. If needed now simply email us, though I imagine you are the person we already built this for today!

This conditional is now included in the software.

```
{if poll:multiple_votes}

```

So do checkboxes instead you would do this:

```
{if poll:multiple_votes}
   <ul>
        {poll:answers}
            <li><input type="checkbox" name="{poll:form_name}" value="{poll:form_value}">   {poll:answer}</li>
        {/poll:answers}
  </ul>
{if:else}
   <ul>
        {poll:answers}
            <li><input type="radio" name="{poll:form_name}" value="{poll:form_value}">   {poll:answer}</li>
        {/poll:answers}
  </ul>
{/if}

```
> 1 votes

---
Tags: devdemon, channel-polls
---


# Question
Title: Upgraded to Cartthrob 2.6 - Now can only view cart when logged in
Since upgrading to Cartthrob 2.6 (on EE 2.7.0) I can only view the items in my cart when I'm logged into the control panel. When anyone else tries to add to cart they just see the page refresh and an empty cart. We're not using or creating members for the cart, everyone uses the cart as a guest.

I'm using the standard add to cart form with the return set to the same page. There is only one product but with a range of options.

```
{exp:cartthrob:add_to_cart_form return="samepage" entry_id="2720"}

        <label>Card Value</label>
        {exp:cartthrob:item_options entry_id="2720"}
            {select}
                <option {selected} value="{option_value}">${option_value}</option>
            {/select}
        {/exp:cartthrob:item_options}

    ...

{/exp:cartthrob:add_to_cart_form}

```

If I add to cart when logged out (and see an empty cart) - I can then log in, refresh the page and can see that the item is in the cart. If I then log out and refresh the page again, the cart shows as empty.

I've tried changing the redirection method in EE, setting the cookie domain... I haven't found anything that alters this behaviour so far.

# Answer
Again: NOTE ExpressionEngine 2.8 + is REQUIRED to run CartThrob 2.6+ Lesser versions may be able to run CartThrob 2.6, but they are not supported.

A lot changed with session/security between 2.8 and 2.8 so it's probably not a big surprise you'll have issues in this area if you're on an older EE
> 1 votes

# Answer
I also need to find a solution to this and found that it was a session issue. This was my fix:

File: cartthrob/libraries/Cartthrob\_session.php

Replace $this-\>EE-\>input-\>set\_cookie('cartthrob\_session\_id', '', -3600); on line 168 with:

```
if ( version_compare(APP_VER, '2.8', '>='))
{
    $this->EE->input->set_cookie('cartthrob_session_id', '', -3600);
}
else
{
    $this->EE->functions->set_cookie('cartthrob_session_id', '', -3600);
}

```

And replace $this-\>EE-\>input-\>set\_cookie('cartthrob\_session\_id', $this-\>session\_id, $this-\>expires); on line 195 with:

```
if ( version_compare(APP_VER, '2.8', '>='))
{
    $this->EE->input->set_cookie('cartthrob_session_id', $this->session_id, $this->expires);
}
else
{
    $this->EE->functions->set_cookie('cartthrob_session_id', $this->session_id, $this->expires);
}

```

Besides this I haven't yet seen any other major issues with CT2.6 installed on my EE2.7.3, so this fix may also apply to 2.7.0.
> 0 votes

---
Tags: cartthrob
---


# Question
Title: EE 90 second PHP timeout... where does it live?
We're running a long, involved template/script (to store the results in a manual cache, of course) and we get:

> Fatal error: Maximum execution time of 90 seconds exceeded in system/expressionengine/libraries/Template.php on line 1112

The thing is, I have **ini\_set("max\_execution\_time", "3000");** in the script we're running, and nowhere else in EE can I find max\_execution\_time set to anything else, so... why/where is it being set to 90 seconds?

# Answer
> 4 votes
`system/expressionengine/libraries/Core.php` around line 64 (as of v2.9.0):

```
// Set a liberal script execution time limit, making it shorter for front-end requests than CI's default
if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
{
    @set_time_limit((REQ == 'CP') ? 300 : 90);
}

```

If you have a page that is taking more than 90 seconds to render, I would post a separate question about optimizing that template. ;)

**Edit**: `set_time_limit()` resets the counter from zero every time that it's called, so assuming you don't collide with Apache's timeout, you can add that to your script that is getting info about the files on the external server. Perhaps try to limit it to as small as possible; if the files are examined in a loop, place a reasonable timeout extension within the loop prior to each external call, e.g.:

`set_time_limit(10);`

Or whatever is actually needed for the communication to not be impeded between the two servers.

---
Tags: ee2
---


title: Global Variable For Site Domain

text:
# Question
Title: Global Variable For Site Domain
Is there any way - in Expression Engine - that there is a global variable or even a constant to reference the domain of the current site you are working on instead of hard coding the domain name in your links?

# Answer
You can use the global variable {site\_url}

But if you code your links as "/path/to/a/page" (with the initial slash) then that will work just the same.
> 1 votes

---
Tags: ee2
---


# Question
Title: Low Variables Error : "Field 'edit_date' doesn't have a default value"
I've had this happen on a couple of different projects today. Weird coincidence? Something I'm doing?

The error shows up upon trying to save a new variable. The variable does actually get created, but only the Variable Name is saved.

Anyone seen this error before?

# Answer
That's probably because of MySQL running in Strict mode and only if LV was installed before version 2.3.3. You can work around it by setting a default value of 0 on the edit\_date column in the exp\_low\_variables table.
> 1 votes

---
Tags: low-variables
---


# Question
Title: Work out range with Low Nice Date for past Low Events
I am using Low Nice Date to work out the range between the start date and end date of a Low Event.

I am testing to see if if the start date and end date are the same, if they are the same I want the date format output in a certain way or differently if it is not the same date.

I am not using the 'All Day' option in Low events because these are not all day events.

The issue I have is it works fine for upcoming events, where the date are in the future, but it doesn't work with past events where the date are in the past.

Here is the code I am using:

```
{exp:low_nice_date:range from="{event_date:start_date}" to="{event_date:end_date}"}
    {if days == 0}
        {event_date:start_date format="%j %F %Y - %H:%i"}
    {if:else}
        {event_date:start_date format="%j %F"} - {event_date:end_date format="%j %F %Y"}
    {/if}
{/exp:low_nice_date:range}

```

A past example event dates: 22 June 2012 - 21 July 2012

For some reason this returns true for `days == 0`, although this is not true.

Any help on how I can get this working for past entries would be great.

# Answer
> 1 votes
Instead of using Low Nice Date, why not try the :one\_day modifier that is available in Low Events itself? That should let you achieve what you want without an extra add-on:

```
{if event_date:one_day == 'y'}
    {event_date:start_date format="%j %F %Y - %H:%i"}
{if:else}
    {event_date:start_date format="%j %F"} - {event_date:end_date format="%j %F %Y"}
{/if}

```

---
Tags: low, low-nice-date
---


# Question
Title: Third segment / last_segment "success" not working?
I am attempting to display a message when the last segment equals "success"... I've done this many times before and for some reason I am having some trouble. I need an extra eye perhaps?

Below is my code. The url upon submission redirects and looks like this: http://site.dev/events/event\_submission/success/

However, the third segment isn't being read by EE because {last\_segment} equals "event\_submission" and {segment\_3} parses blank.

```
{exp:switchee variable="global:member_group" parse_tags="yes" parse="inward"}

    {case value="1"}
        {if last_segment == 'success'}
            Your event has been submitted. You will receive notification when your event has been approved or rejected. You can <a href="{path=logout}">logout</a> now or <a href="{site_url}events/event_submission">click here</a> to create another event.
        {if:else}
        {exp:channel:form channel="events_submitted" id="publishForm" return="events/event_submission/success" json="yes" include_jquery="no"}
            "Just to test: {last_segment} {segment_3}"
            <p>Welcome back, <strong>{screen_name}</strong>!</p>

```

I am sure I am just having a coding block but I cannot get it going... any tips?

# Answer
My only thought is that you may have freebie installed, which is a useful extension for structure. By default it makes success|error|preview in the segments "EE will act as if these segments aren’t in the URI at all". Check to see if you have this installed, in which case use {freebie\_3} to catch that segment (Freebie will work regardless of the channel used for structure). Or you could try changing "success" segment to something else like "thankyou".
> 0 votes

---
Tags: segments, switchee
---


title: Using Template Debugger with RSS

text:
# Question
Title: Using Template Debugger with RSS
I have an RSS feed that's taking a long time to process and would like to use the Template Debugger to help me isolate which parts of it are consuming time. The problem is, all the Template Debugger output is HTMLized inside of the RSS template, so it's not rendering correctly. And if I set the page type from RSS to Web Page, well, then the RSS doesn't process right and I have nothing to debug. Is there a way to get the template debugger to at least output non-HTML text? That way I could pull the file with CURL and examine it.

# Answer
> 0 votes
Try adding the debug parameter to the feed itself https://ellislab.com/expressionengine/user-guide/add-ons/rss/#empty-feeds-and-errors

---
Tags: ee2, debugging
---


# Question
Title: Assets (P&T) No thumbnail for Admin group
My admins can upload images to Assets field. They even see the thumbnail before saving. After saving though, the thumbnail does not display. This is a site-wide issue. I have updated the index. It also seems to be removing the image completely if it is saved again.

Assets 2.1.2

# Answer
> 0 votes
Make sure that the system/expressionengine/cache folder is writable. Also, consider updating Assets as you have a much older version.

# Answer
> 0 votes
I figured it out. It was a problem with a server path on one of the upload directories.

---
Tags: assets, pixelandtonic, thumbnails
---


# Question
Title: RSS feed for specific category in channel
I have a channel that has 20 categories - each representing a client who can post there or have others post there for their attention.

Of these 20 categories/clients one (only one) needs a personal RSS feed - is it possible to have a feed showing the one category only? Docs seem a bit unclear on this.

# Answer
The entries on a feed are created by the Channel Module. You can create a template just for it or add the `category_id` as a segment.

Let's say the feed is on `/xml/feed`. The filtered feed can be available at `/xml/feed/25`, for example:

```
<?xml version="1.0" encoding="{encoding}"?>
<rss [...]>

    <channel>
    [...]
    {exp:channel:entries [...] category="{segment_3}"}
        [...]

```

If you're using version 2.9, you can even test to make sure the `{segment_3}` is a number.

```
{if segment_3 ~ "/^\d+$/"}
    {preload_replace:pr-client_category="{segment_3}"}
{/if}
{preload_replace:pr-client_category=""}{!-- default empty value --}
<?xml version="1.0" encoding="{encoding}"?>
<rss [...]>

    <channel>
    [...]
    {exp:channel:entries [...] category="{pr-client_category}"}
        [...]

```

It's pretty easy!
> 3 votes

---
Tags: rss
---