# Question
Title: How to properly implement Jquery within EE
So I've been using EE for some time now (since 1.6) and have been using 2.x for the past few months. I know that Ellis added the Jquery module, but I've seen absolutely no useful tutorials or information on how to properly use it.

For instance, I require a jquery slider. Before I simply got by with vanilla javascript but for this particular project that's simply not practical.

So how would I go about utilizing a jquery slider (from an external third party, like Craftyslide) within EE itself?

Here's what I have right now (which isn't working):

```
<!-- header start -->
    <head>
        <meta charset="UTF-8">
        <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javasript"></script>
        <script src="/JS/craftyslide.js" type="text/javascript"></script>
        <link href='http://fonts.googleapis.com/css?family=Muli' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" href="{stylesheet='site/stratagon.css'}">
        <link rel="stylesheet" type="text/css" href="{stylesheet='site/style.css'}">
        <link href="{stylesheet='site/SpryTabbedPanels.css'}" rel="stylesheet" type="text/css">
        <link href="{stylesheet='site/craftyslide.css'}" rel="stylesheet" type="text/css" />
        <script src="/JS/SpryTabbedPanels.js" type="text/javascript"></script>
        <title>{site_name}</title>
    </head>
    <!-- header end -->

....

             <!-- slider start -->
             {if segment_1 == ''}
                  <div id="slideshow">
                          <ul>
                            <li>
                              <img src="http://farm6.static.flickr.com/5270/5627221570_afdd85f16a_z.jpg" alt="" title="Light Trails" />
                            </li>

                            <li>
                              <img src="http://farm6.static.flickr.com/5146/5627204218_b83b2d25d6_z.jpg" alt="" title="Bokeh" />
                            </li>

                            <li>
                              <img src="http://farm6.static.flickr.com/5181/5626622843_783739c864_z.jpg" alt="" title="Blossoms" />
                            </li>

                            <li>
                              <img src="http://farm6.static.flickr.com/5183/5627213996_915aa49939_z.jpg" alt="" title="Funky Painting" />
                            </li>

                            <li>
                              <img src="http://farm6.static.flickr.com/5182/5626649425_fde8610329_z.jpg" alt="" title="Vintage Chandelier" />
                            </li>
                          </ul>
                  </div>

                  <script>
                     $("#slideshow").craftyslide();
                  </script>
                {/if}
                <!-- slider end -->

```

^This is a snippet, not the complete template obviously (it's pretty meaty). But it contains all the important bits concerning the slider.

I have the appropriate jquery linked and working, I have the js file on the server in the right location and the code is all right as its taken directly from the provided demo file. But nothing works whatsoever.

Definitely need help here.

Edit: May have gotten it working. Apparently it didn't like the jquery version I was linking too via Google.

It -may- be fully working with this:

```
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>

```

Edit: Well it's getting closer. Images are displaying and transitions work. It will now progress to the second slide and then stop..

# Answer
> 2 votes
If it's just for a slider on the front-end, forget that you're even using EE and include jQuery as you would with any other platform. HTML5 Boilerplate recommends using the Google CDN with a local fallback, so you could throw this segment in your template:

```
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>

```

# Answer
> 0 votes
You can use the EE syntax inside javascript like:

```
<script>
     {if segment_3 != ""}
        {redirect="404"}
    {/if}
</script>

```

I guess if :

```
<script src="/JS/craftyslide.js" type="text/javascript"></script>

```

is jquery script it must be placet after the jquery library, else it will not work:

```
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javasript"></script>
<script src="/JS/craftyslide.js" type="text/javascript"></script>

```

---
Tags: module, javascript, jquery
---


# Question
Title: Template that iterates through channel entries and outputs categories that are selected for each entry
I've found it perfectly possible to output a list of all of the categories for a channel, or a list of all of the categories that are not empty for a channel. But when I am iterating through the different posts of a channel, how can I output for each post only the categories that are checked for that specific channel entry?

I've read through the documentation pretty thoroughly, http://ellislab.com/expressionengine/user-guide/modules/channel/categories.html, and I can't seem to find a way to make it work.

I'm trying to spit this information out as JSON... to put it into context, below is what I have as a base. Ideally I would like to nest an array in my associative array that contains all of the categories for that channel entry.

```
<?php

  $entries = array();

  {exp:channel:entries channel="my_channel_entries" dynamic="yes"}
    $entries[] = array(
      'name' => '{entry_name}',
      'description' => '{description}'
    );
  {/exp:channel:entries}

  header('Content-type: application/json');
  echo json_encode($entries, JSON_PRETTY_PRINT);
  exit;

?>

```

Any help/creative problem solving that you all can offer will be greatly appreciated! Let me know if I can provide any more details to help you, help me.

# Answer
> 2 votes
I got bogged down with `{exp:channel:categories}` when I was getting started; in this context, you'll want to use the `{categories}` tag pair within `{exp:channel:entries}`.

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


# Question
Title: Embedding PHP in EE tags or using equivalent expressions in PHP
There are so many essential things you simply can't do with EE; this is one I'm having issues with.

What I want to do:

1. Use AJAX to GET a template while sending data via the URL segments.

* In the ajax, we're preformatting integers to strings so that all single digit integers get preceding zeros (e.g.: `1` becomes `01` by using JS `var seg1 = '' + {segment_1}`, etc.).
    * We send these integers in date format to a template `/.../.../.../01/03/2014/`
2. On our template called via AJAX we embed another template using those values

* **However**, during the AJAX request all preceding zeros are truncated :p

So doing something like

```
{embed="calendar/event_landing" range_start="{segment_4}-{segment_5}-{segment_6}" range_end="{segment_4}-{segment_5}-{segment_6}"}`

```

will only represent the above example as `/.../.../.../1/3/2014/` with no zeros.

To circumvent this oddity, I thought I'd try to do something like

```
<?php
// Pad the segments with zeros because the preceding zeros on single digit segments are truncated during the $.ajax(...) GET request.
if (strlen($seg4 == 1) {
    str_pad($seg4, 2, '0', STR_PAD_LEFT);
}

if (strlen($seg5 == 1) {
    str_pad($seg5, 2, '0', STR_PAD_LEFT);
}
?>

```

then try something as audacious as it is ludicrous:

```
 {embed="calendar/event_landing" range_start="<?php echo $seg4; ?>-<?php echo $seg5; ?>-{segment_6}" range_end="<?php echo $seg4; ?>-<?php echo $seg5; ?>-{segment_6}"}

```

While that doesn't work at all (and really shouldn't anyway) I think it explains what I'm trying to do: pass the newly zero-padded integers to the embedded `calendar/event_landing` template where I'm using their values as follows using the Solspace Calendar plugin:

```
{exp:calendar:cal date_range_start="{embed:range_start}" date_range_end="{embed:range_end}" pad_short_weeks="n"}

```

In case it wasn't implied, the Solspace Calendar uses EE date formatting (as found here: http://www.solspace.com/docs/calendar/date\_formatting/), and will not accept single digit numbers. If single digit numbers are passed to it, then it causes an error and instead of throwing it, it simply reverts to the value of the current day.

(The beginning of this rabit-hole inquiry started here one day ago: Solspace Calendar embed range not registering)

# Answer
> 1 votes
Why not to use this?

```
{if segment_4 < 10}0{/if}{segment_4}

```

There's a lot of things the template language of EECMS can't, but... It is just a template language.

---
Tags: php, embeds, solspace-calendar
---


title: "TAG" Extension File?

text:
# Question
Title: "TAG" Extension File?
I've NEVER seen this before! I'm migrating an EE site from one server to another and am getting this error:

```
error

Unable to load the following extension file:

ext.tag.php

```

I'm running EE version 2.4 and am planning on upgrading, but need to get everything working like it was on the previous server first.

When I set `$config['allow_extensions'] = "n";` everything works fine, but when I re-enable my Extensions I get that error.

I've updated the config file from an `Envee` config to my stock config.php file and still getting that error.

I've downloaded all of the `third_party` folders and did a search for "ext.tag.php" (along with tag.php, etc...) but for the life of me I cannot figure out where that file is being called from.

Has anyone seen this? A Google, Devot-ee and EESE search comes up with nothing really helpful. Hopefully someone else has ran into this before! I have verified that the DB settings are correct and just strange that I can't figure out where this is being called from.

# Answer
If you've got access to the database (command line or phpMyAdmin), take a look at the exp\_extensions table and see if you can find something for "tag" there.

There are a few columns in that table with helpful clues; it should reveal what add-on it is (perhaps Solspace Tag?), and, there's a column you should be able to change to disable it independently of the other add-ons.

Hopefully that's enough to get you pointed in the right direction; would be interested to know what the problem turns out to be.
> 2 votes

# Answer
It's the Tag module from Solspace. If you've removed the files without uninstalling properly via the control panel, you'll need to delete the 'Tag\_ext' rows from 'exp\_extensions' in your database.
> 3 votes

# Answer
Solspace has a tag add-on which most likely includes this extension. The error is telling you the same thing you found through your search. That is, the file isn't there. However, it's still being called from the DB. The easiest way to fix this is to simply upload the tag add-on and then do what you need with it from there. If you no longer have it, then you will have to remove it manually through the DB. This will likely include remnants of the extension as well as the module.
> 2 votes

---
Tags: extension
---


# Question
Title: Get entries in fixed order with Stash/Playa
So I have the following snippets of code which contain a matrix field `{people}` with a nested playa field `{section_people}`

```
{!-- Get people sections --}
{exp:stash:set_list name="people_sections" parse_tags="yes"}
    {people}
        {stash:section_people}{section_people:child_ids}{/stash:section_people}
    {/people}
{/exp:stash:set_list}

{!-- Get related people: --}
{exp:stash:set_list name="people_list" parse_tags="yes" parse_depth="3" trim="yes"}
    {exp:channel:entries channel="people" dynamic="no" entry_id="{exp:playa:child_ids field='people'}" parse="inward" disable="{global:param_disable_default}"}
        {stash:entry_id}{entry_id}{/stash:entry_id}
        [other fields]
    {/exp:channel:entries}
{/exp:stash:set_list}

{!-- Display: --}
{exp:stash:get_list name="people_sections"}
<section class="team">
    <h2>{section_title}</h2>
    {exp:stash:get_list:nested name="people_list" match="#{section_people}#" against="entry_id"}
        <article>{entry_id}</article>
    {/exp:stash:get_list:nested}
</section>
{/exp:stash:get_list}

```

What I'd like to accomplish is: keeping the playa entries in a fixed order: `640|643|639`

However, when I get the entries using the stash get\_list they are returned by entry date: `643|640|639`

I see in the stash docs where I can sort by column, but is there a way to used a "fixed" sort order?

# Answer
In your channel entries tag, use the `fixed_order` parameter instead of `entry_id`.
> 3 votes

---
Tags: playa, stash
---


# Question
Title: Snippets breaking on one entry, but not others?
What would cause an EE template to barf on one set of comments but not another?

For example, the comments on this page are messed up:

http://alistapart.com/comments/seo

But it doesn't seem to be happening on any other article (that we've found). Example:

http://alistapart.com/comments/negativemargins

What could cause this? I've gone through the comments to see if I could spot any bad code, but even if I had found something I'm at a loss to explain why it would cause problems with EE rendering.

(EECMS v 2.5.5)

# Answer
> 2 votes
It looks like this page is breaking because of the edit comment functionality combined with PHP/HTML in a comment.

See comment #322268: he's got PHP-style and HTML tags in his comment, which all seem to be escaped properly, but when that same comment content is replicated in the hidden block for comment editing (.edit-comment), your page source code is abruptly cut off.

Since this is affecting the rending of EE conditionals on the page, I assume the choke is happening server-side - EE isn't liking the `<?` and `?>` entities inside of the the template's tagdata, and is choking on them.

---
Tags: templates, comments
---


title: Moderate first forum post only

text:
# Question
Title: Moderate first forum post only
I'm looking to require the first forum post of a member to be moderated before it goes live but then allow all subsequent posts to post automatically. Is this possible?

# Answer
> 1 votes
"You can moderate \*who\* is allowed to post, but not the posts themselves." http://ellislab.com/forums/viewthread/219793/#1013472

I'm not sure, but maybe you can create a post-only forum (for the "new-member" group) and once approved move the message to the regular forums and assign the user to "regular-members" group.

---
Tags: forum
---


# Question
Title: If not conditional not behaving as expected (== works, != doesn't)
I'm using DevDemon Forms, on two of my pages, which requires that jquery be included in the the document head. On other pages however, I want to include jquery in the footer.

So i thought I would post this in the header:

```
{if "{segment_2}" == "skjema" OR "{segment_2}" == "nyhetsbrev"}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{site_url}js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
{/if}

```

Then post this in the footer:

```
{if "{segment_2}" != "skjema" OR "{segment_2}" != "nyhetsbrev"}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{site_url}js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
{/if}

```

The first part works fine, as jquery is now only included in the header on page "skjema" and "nyhetsbrev".

The second part does not work, as it includes jquery no matter what, which means I'm including jquery twice on pages using Forms.

# Answer
TL;DR: Use `AND` in your second conditional.

Actually, it **is** working as expected. In the first conditional, you're saying *if x is a or x is b*, which will return `true` if x is a or b. The second conditional says *if x is not a or x is not b*, which will return `true` if x is a or b, as x cannot be both. Simple logic.

I take it you want the second conditional to be the opposite of the first one, so: *if x is not a or b*, which is the same as *if x is not a and x is not b*:

```
{if segment_2 != "skjema" AND segment_2 != "nyhetsbrev"}

```

Also note that I've removed the quotes and curly braces around the segment vars, which is best practice.
> 4 votes

---
Tags: conditionals, ifelse
---


# Question
Title: MSM or 'old way' - Which to choose in this scenario?
I'm about to create a new site with a **2-3 year lifespan.** The new site will run off an existing EE2 installation which already runs two MSM sites. After 2-3 years, the site will be taken offline and new site with a 2-3 year lifespan will replace it.

* The data model of content for the new site will be sufficiently similar to content on MSM site1 not to warrant new channels and fields (I feel).
* In addition some content from site1 will be displayed on the new site.
* MSM license allows for up to 3 sites; additional sites are purchased separately

Given this and the 2-3yr lifespan, my thinking is to create the new site using the 'old way' and not using MSM. Then display the appropriate content via a tag, custom field, or category based filter.

**Is this logical? Am I missing any "gotchas"?**

My other thought was to create a sufficiently generic new MSM site which I could re-purpose every 2-3 years. **Is this a better option?**

---

Edit: The 'old way' is a means of running more than one domain from an EE installation without using MSM (the Multiple Site Manager add-on for EE). It involves creating and modifying an 'index.php' file at the web root of your new domain. Prior to EE2 and MSM this was documented on the official EE wiki, but it is no longer officially supported. For exact details see, for example, this post: "Old-Style" multiple sites on one installation

# Answer
> 1 votes
If the site will go offline before being replaced with new one, I would choose MSM approach. You will not need extra licenses (as old site will be removed) and it is easier to manage than "old-style".

# Answer
> 1 votes
I tend to use MSM when the content is significantly different, but the 'old style' method for when sub-sites or shared sites have very similar content. It's pretty easy to set-up, I generally just add a field called 'subsite' which matches the info in admin.php, then use in field search.

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


# Question
Title: $this->EE->api_channel_entries->data (via entry_submission_ready hook) not working on front end
I have the following entry\_submission\_ready method in an extension to update a field's data. This works fine when saving an entry in the control panel, but it doesn't change the field value on the front end using Channel Form. The function is called, because I can output $data to the screen.

```
function entry_submission_ready($meta, $data, $autosave)
{
    $data['field_id_281'] = 'Test';

    if(isset($this->EE->api_sc_channel_entries))
    {
        $this->EE->api_sc_channel_entries->data = $data;
    }
    else
    {
        $this->EE->api_channel_entries->data = $data;
    }
}

```

It seems $this-\>EE-\>api\_channel\_entries-\>data is empty on the front end, but is used in the control panel. So what would one use to save the data on the front end using Channel Form?

# Answer
I have got it to work using a second hook, channel\_form\_submit\_entry\_start

Using channel\_form\_submit\_entry\_start I can manipulate the $\_POST array directly, then this saves. Seems wrong I should manipulate $\_POST, and also a shame I have to have a second method to do the same as the entry\_submission\_ready (difficult to combine as I am using different arrays), but at least this works:

```
function channel_form_submit_entry_start($obj)
{
    $_POST['field_id_281'] = 'Test';
}

```
> 2 votes

# Answer
I don't have experience with the channel form hooks, but I have implemented something similar using the the entry\_submission\_start hook, which should get fired on an entry submission regardless of whether it comes from the front-end or backend.

You can access and modify the channel data before it gets inserted by accessing `$this->EE->api_channel_entries->data` by reference.

Something like so would set `field_id_281` to have the value of `foo` regardless of what was submitted in the entry form:

```
public function entry_submission_start( $channel_id = 0, $autosave = FALSE )
{
    // access our data by referece
    $this->data =& $this->EE->api_channel_entries->data;
    $this->data['field_id_281'] = 'foo';
}

```

You'd replace $this-\>EE with ee() on EE version 2.7+
> 1 votes

---
Tags: hook
---


# Question
Title: Idle message when logged in to control panel
I get this message at the bottom of the page of the control panel: "You've gone idle, please enter your password to continue."

I just updated to ExpressionEngine to 2.7.3

# Answer
> 3 votes
To me that looks like a JS conflict with a cp add-on like Devot:EE monitor or a straight out EE theme error. Presumably on a new entry screen you'll see the file manager modal down there too.

Try replacing/re-uploading the themes folder for EE, updating the accessories to latest (or any extensions which modify the CP JS), then clear your browser cache.

---
Tags: control-panel, login
---


# Question
Title: Conceptual question regarding Store add-on
In the Payment Gateways section of the Store add-on docs (https://exp-resso.com/docs/payment\_gateways.html) it says that the off-site gateways require just one simple payment tag and that `No extra configuration is necessary.`

What does that actually mean in practice? Can anyone describe the process that a customer would go through in such a scenario? Is the customer taken to an external site during the payment process? If so, at what point in the process? Do customers select items, colors etc. and then get taken to an external site to pay, and finally land back on the original site?

Thanks for any advice or experience with this. :-)

# Answer
Absolutely. Essentially all you need to add is the `payment_method` parameter in the checkout tag, enter in your details for the payment gateway via the Control Panel and you're ready to start accepting payments.

In practice, the exact customer journey is completely up to you however. You may wish to design a one-page checkout or you may have various options and steps along the way you wish to add to collect extra information pertaining to the order. Single or multi-step checkouts can both be accommodated. Products (and their variations) will always be listed and chosen on your domain.

With regards to the payment process, again it depends on which payment gateway you select. There are a large number that ship as standard with Store. Some of these are "on-site" and some are "off-site" payment processors. "Off-site" is the easiest (and probably the recommended way) of handling payment processing as you then shift the burden of PCI-DSS compliance on to the payment gateway who will provide end-to-end security of the transaction and pass the user back to the site once the payment has been made for order confirmation.

"On-site" essentially means that you're taking a users' payment details on your actual website so it's completely down to you to ensure that security is provided by way of an encrypted transaction. It's highly recommended that you **never** store any payment information on your own site or servers but if you do then you need to ensure that you're fully PCI-DSS compliant (and that's no small feat).

So the easiest way to get up and running is to choose an off-site payment gateway, sign up for an account, enter in your account details via the Control Panel, and then set the `payment_method` to the corresponding gateway on the Checkout tag. Your products are listed as regular Channel entries with whatever custom fields you wish to add in the usual way to working with ExpressionEngine.
> 2 votes

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


# Question
Title: Expresso Store: Add a custom weight to a Product Modifier
My client sells Small, Medium, and Large sizes of many products that vary dramatically in weight, and can make a significant difference in shipping cost.

CartThrob Price modifiers allowed me to add columns for things such as "Weight", which I could then pass along as a hidden field when adding the product to the cart. Do Expresso Product Modifiers allow anything similar?

# Answer
It's not currently possible to set a specific weight to each product variation (modifier option) although it has been requested and in consideration as to the best way to present this as an option.

At present your two options are:

1) To create separate products for each weight variation. This way you can set a handling charge to each one if needed or just set the weight.

2) Create a custom extension using the extension hooks to set the shipping price based on user selection. This could be by way of an adjuster, a handling charge or just additional shipping charges.

The viability of the first one depends on the quantity of products and product variations you have. If it's a small inventory then this may be fine but for larger inventories it may not be ideal.
> 3 votes

---
Tags: expresso-store
---


title: Users Group Expiration

text:
# Question
Title: Users Group Expiration
I have a use case where I would like an add-on or admin to set a users group with additional privileges and provide an expiration that would change the user back to their original group, or even a default group such as members.

The goal would be to allow members to purchase a "subscription" but not as recurring.

I assume this can be done with simple commerce, however from everything i have seen there is no way to allow and administrator to change or setup and expiration for teh group change. Adding a transaction manually through Simple Commerce does not act as a subscription, and thus teh group change features will not work as intended.

# Answer
Eric Lamb's add-on, among it's many other rather cool features, Securit:ee includes an extension that does provide the amine the ability to auto-expire a member account within a given group after a set amount of time. Might be worth a look. I don't see mention of it changing the member from one group to another automatically though - just expiring the account.
> 2 votes

---
Tags: expresso-store, members, simple-commerce
---


title: Subpages not working

text:
# Question
Title: Subpages not working
I moved an ee page to the live server and now the subpages of the site don't work anymore.

I disabled the index.php removal directive and added index.php in the cp Panel. But that didn't help so it can't be a htaccess issue.

I use the Multilanguage Plugin by Bieber ltd. Im not sure if this is caused by the multilanguage plugin because tha language switch works.

How the heck can I find out this problem.

Also on my mamp environement it works all fine so it could be a server issue.

The site runs temporarily on a subdomain. Could this be the issue?

The page can be viewed here

# Answer
> 2 votes
Okay. We found the solution. There needs to be a '?' at the end of index.php. Now the .htaccess looks like this, if interested:

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

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

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

</IfModule>

```

---
Tags: url
---


# Question
Title: Show categories of entries based on year
I'm trying to get an archive to work on a web page, based on entries per year. This, in combination with an isotope-like filtering of categories. I want to output entries based on year, and then output the categories attached to these posts to use for the filtering. I've managed to get the year sorting to work by using Low Yearly Archives, but I can't add a year parameter in the categories tag.

The code that outputs the categories looks like this:

```
{exp:channel:categories style="linear" channel="News" category_group="1" dynamic="no" show_empty="no"}
    <li><a class="filter" data-filter="{category_name}">{category_name}</a></li>
{/exp:channel:categories}

```

And the code that outputs the entries looks like this:

```
{exp:channel:entries channel="News" dynamic="no" limit="12" year="{segment_2}"}
  {title}
{/exp:channel:entries}

```

This takes the segment\_2 from the url which low yearly archives outputs.

Now, the categories outputs all categories from all years, not the one from segment\_2. If only the channel category tag had accepted a year parameter, this would have been solved. Any idea how to solve this? I've tried combining channel category and channel entries tags, but I can't get the combination to work.

Edit: I've tried the following:

```
{exp:channel:entries channel="News" dynamic="no" limit="12" year="{segment_2}"}
    <li><a class="filter" data-filter="{categories}{category_name}">{category_name}{/categories}</a></li>
{/exp:channel:entries}

```

And although this outputs the categories assigned to the corresponding posts, I get duplicates. So I need to output unique ones.

# Answer
Tested this template on EE 2.7.2, and it appears to work.

We're going to use the channel entries loop you've already got to generate a list of entry id's, which we're going to feed to the remarkably handy GWcode Categories add-on, which will display a list of all of the categories that belong to the entries in question without duplicates.

```
{exp:gwcode_categories parse="inward" entry_id='{exp:channel:entries channel="news" dynamic="no" limit="12" ear="{segment_2}"}{entry_id}|{/exp:channel:entries}0'}
  {cat_name}
{/exp:gwcode_categories}

```

`{cat_name}` is all I'm outputting there, but, that add-on has a plethora of variables available; I'm sure you'll be able to display whatever you need.

A few other notes...

Not sure what the `limit="12"` is about; it should probably be removed, otherwise you're only going to be getting the categories for the first 12 entries each year.

`disable="categories,custom_fields,member_data,pagination"` should also probably be added to your `exp:channel:entries` to keep things as speedy as possible.

There's an extra "0" immediately following the channel entries loop; that's intentional, and is there to prevent issues with "no results" cases, and, prevents us from having to trim the trailing pipe - win-win, I say.
> 2 votes

---
Tags: channel-entries, categories, low-yearly-archives
---


# Question
Title: CartThrob: conditionally display info based on payment gateway on order confirmation page
I am trying to display different information on the order complete page, based on the used gateway. I have something like this at the moment:

```
{if authorized}

    {if {payment_gateway} == ct_offline_payments}

    Display this

    {/if}

    {if {payment_gateway} == paypal_express}

    Display that

    {/if}
{/if}

```

This however results in both blocks being displayed. I tried a lot of differnt syntax variations, some resulting in displaying nothing at all, some in displaying both and I just can't get it right.

Any ideas? Thanks and Cheers,

Marc

EDIT/UPDATE: Thanks Alex, but unfortunately this isn't working for me.

I have this code right now:

```
{!-- set the page layout --}
{stash:embed:layouts:standard}

{exp:stash:set name="page-title" parse_tags="yes"}Bestellung abgeschlossen. Vielen Dank für Ihren Einkauf bei FOXGEAR!{/exp:stash:set}

{exp:stash:set name="body_id"}abgeschlossen{/exp:stash:set}

{!-- main page variables --}
{exp:stash:set name="maincontent" parse_tags="yes"}

{if no_results OR segment_4!=""}{redirect="404"}{/if}
            <div id="content">

                <div>
                    {exp:cartthrob:submitted_order_info dec_point="," thousands_sep="."}

                    {order_payment_gateway}

                    {if order_payment_gateway == "ct_offline_payments"}
                        Offline
                    {if:elseif order_payment_gateway == "paypal_express"}
                        PayPal
                    {if:else}
                        Other
                    {/if}

                    {/exp:cartthrob:submitted_order_info}
                </div>

                <div class="clear"></div>

            </div><!-- /content -->
{/exp:stash:set}

```

And the rendered page outputs this (in content div):

> {order\_payment\_gateway} Other

That's it. Nothing else (header and footer working fine). :(

# Answer
I have a conditional based on order\_payment\_gateway in my receipt template and this works for me when used within the `exp:cartthrob:submitted_order_info` tag:

```
{if order_payment_gateway == "ct_offline_payments"}ACH{if:else}Card{/if}

```

So building from that you could try...

```
{if order_payment_gateway == "ct_offline_payments"}
    Offline
{if:elseif order_payment_gateway == "paypal_express"}
    PayPal
{if:else}
    Other
{/if}

```

I suggest outputting `{order_payment_gateway}` in your template so you can double-check that "paypal\_express" really is the correct value to test against.
> 2 votes

---
Tags: cartthrob
---


# Question
Title: Exporting lists of channels and associated fields?
Is there a simple way of exporting all the channels and associated fields?

Rather than copying everything out of the channel field groups manually, I'm looking for a simple way (even via a plugin) to export the list of channels and associated fields.

While all the fields are usually planned out in advance, the final product is a little different and I want something that could be easy to print out - for a variety of reasons, including double-checking the work and making a usage guide for end users.

# Answer
> 0 votes
You can export / import field groups with Field Editor, although it's in json format you should be able to reformat the text to suit your purposes.

# Answer
> 0 votes
There's nothing that I know of that will summarise your Channels and Field Groups like that but I think Field Editor will probably be the closest to what you need.

It will allow you to save your field groups for import/export along with providing a useful on-screen summary if you wanted a visual reference.

---
Tags: channel, fields, export
---


# Question
Title: Freeform multiple file upload, only one appears in review/edit form
I'm using Freeform Pro v.4.0.12. My form submits a to a review page so that user can edit their form data.

I'm using 2 file upload fields and both files are successfully uploading. However, on the review page, only one file appears. Any idea why or what I can do to make the 2nd file upload field editable?

Thanks!

Peter T

I saw this other post below, but since both my files are uploading, I don't think it applies to my issue.

Other post

# Answer
> 0 votes
It turns out the other post was a big help and answered my question!

---
Tags: solspace-freeform, file-uploads
---


# Question
Title: Custom Member Variables in Admin Notification Email?
* SCROLL FOR NEW EDIT

I understand that EE does not currently have functionality to show you anything beyond the basic member variables in the email notifications (such as username, etc).

I have many custom variables so that when a member registers, they have to enter specific data like contact information.

In order to facilitate the approval process, I NEED the notification email to display the information the user puts into those custom fields.

However, I have been unable to find any combination of plugins and templates that will allow this.

I am currently working with MX Notify and having trouble figuring out if it can actually do this. Right now I can get it to display the username, screen name and email etc, but I cannot for the life of me get it to display anything else from the user.

I have tried several plugins with no luck. ANY help is appreciated.

NEW EDIT - 6 JAN 2014

I tried the information from the link in the only answer here so far, and it made no difference. I still cannot display custom data in an email notification about a member's custom fields.

Is there nobody out there who has successfully done this??

# Answer
> 1 votes
Have you looked at Postmaster add-on? You should be able to set up a "parcel" to go out when a member registers that could include any custom member or channel fields (see the Variable Reference section in the Postmaster docs).

# Answer
> 0 votes
You may of come across this already, but if you haven't, look at http://www.eec.ms/forums/viewthread/117/#1676

---
Tags: members, plugin, member-details, member-management
---


title: Form Submissions just return JSON

text:
# Question
Title: Form Submissions just return JSON
This is on EE 2.7.2. I have just moved a site to a new server. The site was working perfectly before hand, but now that it was migrated all the backend form submissions only return JSON. Some examples:

* Save an entry, I get a page with just: {"message\_success":"Entry Has Been Updated"}
* Clear the cache: {"message\_success":"Cache files have been deleted"}
* Loading entries page: big list of JSON entries
* Saving an entry: {"message\_success":"Entry Has Been Updated"}
* Sometimes while reloading one of these JSON pages, it just logs the user out and shows a page with "Logged Out" and I have to wait a few minutes before I can load the backend login form.

Some submissions seem to work: Saving Template General Configuration: works as expected

I was wondering what could cause this. I am assuming it is a path setting, but wasn't sure what would only output JSON instead of loading a page. I also noted that there are no JS errors, but the developer log is full of this message:

Deprecated function generate\_json() called in system/expressionengine/third\_party/structure/mcp.structure.php on line 220. Deprecated since 2.6. Use the native JSON extension (json\_encode()) instead.

Is anyone familiar with this issue and what may be causing it? Thanks!

# Answer
The issue was related to PHP. This was a mediatemple GS server and it had the PHP set to 5.3.27 FastCGI. I had to change this to 5.3.27 CGI (stable) and this seemed to clear up all the issues. Hopefully this may help someone in the future as the issue was unexpected and not clear what the issue was.
> 3 votes

---
Tags: system, system-messages, json
---


title: Slide Show on homepage

text:
# Question
Title: Slide Show on homepage
We implemented a slide show in our homepage and would like to place a video as one of the sliding images.

1. Can a slider include a video?
2. If not, can you toggle between video and slider in the CMS?

# Answer
> 2 votes
Yes, assuming that your slider is powered by a channel, with a distinct custom field group, you could simply add a new field for your video items.

This could either be a text input field where you would paste the URL to a video (which you then turn into an embedded video using a plugin like Antenna), or a Channel Videos field which will generate the embed code for you, or even a text input field where you'd paste a simple YouTube video ID, which you'd then include inside some `iframe` embed markup in your template.

This assumes of course that whatever javascript you're using for your slider can accommodate video - but that's outside the scope of this site.

---
Tags: templates
---


# Question
Title: Freeform edit entry in the same order as the from
I know this issue has been mentioned before, but I can't find a solution to the problem anywhere.

I don't understand why when you edit a form submission, the fields don't appear in the same order as the form. I know you can edit how they appear in the main entries listings, but this doesn't carry over to the edit page for each individual entry.

I've tried to edit the plugin to do this, but am getting no where as my knowledge of object oriented PHP isn't great enough.

Is there something simple that I'm missing?

I've also tried deleting all forms and creating all the fields in the correct order. But even then, when you add an entry and try and edit it, the submission still appears alphabetically.

Can someone please shed some light on this issue?

Thanks.

Andrew

# Answer
> 0 votes
The fields are displayed in the order specified in each form's configuration screen (at the bottom, where you drag and drop fields for the form).

Note where it says:

> The fields in the right column will be available in this form on output and they will display in this order when using the {freeform:all\_form\_fields} tag pair.

(It really should include "and when editing form entries in the control panel".)

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


# Question
Title: Dynamic navigation on an MSM setup using {site_url}
I have an MSM setup where the primary site is the "main" site in EE and the subdomains are all sub-sites in EE. I have built out the primary navigation in the main site, but I don't know a good way to keep the primary domain as the first segment when needed.

So in all of my sub-domain sites, I use the following:

```
{embed="main_site:includes/.nav_main"}

```

And in that .nav\_main, I have this:

```
<!-- HOME -->
    <li><a href="{site_url}">Home</a></li>
<!-- HOME -->

```

That reads different on each sub-domain because they are all a "site". Some of the sub-domains will have their own navigational elements so {site\_url} works fine for them when/if I needed to use it.

It would be nice to be able to do something like:

```
{site_url:site_name} or {msm:site_name:site_url}

```

Is there a plug-in, add-on, or native functionality I am missing?

# Answer
Your best bet is to hold this URL via a global variable defined inside of your config file (as standard user-defined global variables will be scoped to each site).

Or to get fancier, use Low Variables, which will may help you elsewhere in your site build as well.
> 1 votes

---
Tags: ee2, add-on, multi-site-manager, navigation, global-variables
---


title: Modify body in email_send hook

text:
# Question
Title: Modify body in email_send hook
Is there an way to override the $\_body in the email hook 'email\_send'. I cant find a way to modify the raw body and not the $\_final\_body.

Rein

# Answer
> 3 votes
There is not. When building Escort, I had to manually break `$finalbody` into pieces using regular expressions so I could see what the email was actually made up of (note that it has already been mime-encoded at that point).

---
Tags: email
---


title: Basic Template for custom page

text:
# Question
Title: Basic Template for custom page
I would like the ability to set up individual pages for announcements. These pages would be read by employees only and they would have a specific url to to see these pages. Example: "We are closed today due to weather"

Is there a plugin for this or do we need to build them under "Basic Templates?"

Thank you

# Answer
> 3 votes
I recommend using the **Pages Module** for this. It will allow your users to easily create announcement pages with custom URLs and will keep your template set-up very minimal.

1. Create a re-usable "announcements" template to serve these entries (call it say, `pages.group/_announcements.html`).
2. Create an "Announcments" Channel. In the Pages module configuration set the default template for this channel to be the new template you created for these entries.
3. Finally, when publishing an entry in this Channel just be sure you give it a Pages URI. The Pages URI is a custom URL where your entry can be viewed (it can be anything you like).

On the other hand...

If having custom URLs for your announcements is not important, or you think you'll never need to offer the user the ability to create other types of one-off "pages" on the site, then you would be fine to forgo the Pages module and just create a template to serve content from this Channel (eg `announcements.group/index.html`). This would mean all your announcement page URLs would begin with the template group name and be very systematic, rather than custom. But that's not necessarily a bad thing.

---
Tags: ee2
---


title: {parents} sort and orderby

text:
# Question
Title: {parents} sort and orderby
I have done some searching and am unable to find an answer. I am trying to sort my entries using the {parents} tag and it does not seem to be working, can anyone confirm this as a bug or know of an alternative way I can accomplish it? I am using EE 2.6.1.

Here are the tag I have attempted with no results, just what seems to be random orders.

```
{parents field="sermon_series" orderby="parents:entry_id" sort="asc"}

{parents field="sermon_series" orderby="parents:date" sort="asc"}

{parents field="sermon_series" orderby="entry_id" sort="asc"}

{parents field="sermon_series" orderby="date" sort="asc"}

{parents field="sermon_series" orderby="" sort="asc"}

```

I appreciate any thoughts.

# Answer
> 1 votes
2.6.1 has a handful of bugs related to sorting/ordering relationships. Upgrading to 2.7.3 should sort those for you.

---
Tags: relationships, parent
---


# Question
Title: Get category_group and category_id outside the channel tag and use it to display category description text
I have to add a text, that describes the current category but I have to put it outside the channel tag with a single entry and if the category\_id is for example number 5, I have to get a text that describes that specific category.

Can anyone help me with an idea how to do that?

# Answer
> 1 votes
In its simplest form you'll need another channel entries tag & a free module to get the category info... like this:

```
{exp:channel:entries url_title="{segment_2}"}
  {exp:gwcode_categories entry_id="{entry_id}"}
    <h1>{cat_name}</h1>
    <p>{cat_desc}</p>
  {/exp:gwcode_categories}
{/exp:channel:entries}

```

We're asking the channel entries tag to get the entry via its url\_title (this would be segment\_x with x representing where it is in the URL).

We're then using a must have plugin by GWCode - gwcode categories which uses the entries entry\_id to pull in the category assigned to it. With this module you can get parent info, child info and a whole host of other category related data.

Of course, if the category is present in the URL you can use GWcode Category to get the info without the exp:channel tag to get the entry\_id.

**PT:2** Just saw you had Stash as a tag in your original question which requires only one channel entry tag and makes it simpler (of sorts).

Place this at the start of your template…

```
{exp:stash:set parse_tags="yes" parse_depth="2"} //This is a single entry so need for lists
  {exp:channel:entries url_title="{segment_2}"}
    {stash:my_title}{title}{/stash:my_title}
    {stash:my_content}{my_content_field}{/stash:my_content}
    {exp:gwcode_categories entry_id="{entry_id}"}
      {stash:my_category_title}{cat_name}{/stash:my_category_title}
      {stash:my_category_desc}{cat_desc}{/stash:my_category_desc}
  {/exp:channel:entries}
{/exp:stash:set}

//This above records all the parts of the entry. Then further down the template output all the 'stashed' bits.

<h1>{exp:stash:my_category_title}</h1>
<p class="summary">{exp:stash:my_category_desc}</p>
…
<div class="my_article">
  <p>{exp:stash:my_title}</p>
  {exp:stash:my_content}
</div>

```

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


# Question
Title: Any way to denote (in back-end) channel entries that have been selected in a Matrix?
As an example, say I have an Authors channel, and I have an Authors List channel. The Authors channel contains a lot of biographical info on my writers; the Authors List channel lets me create a listing of writers like maybe "Fall 2013 Best-Selling Authors." The Authors List channel is primarily populated by use of its Matrix field, which is where you're picking the authors to list.

What would be really nice is if there is some way when looking at any author in the Authors channel's back end to tell if that Author is currently included in a Matrix field in that Authors List channel. So that I can bring up Donna Tartt and see that she was listed in my Authors List entries of "Fall 2013 Best-Selling Authors," "Fall 2002 Best-Selling Authors," "Winter 1993 Best-Selling Authors," and "Fall 1992 Best-Selling Authors."

This would save a ton of time and be much less error-prone vs our Plan B, which is having to create a big text field in the Authors channel and go in and manually note by hand each time we include an author in an Authors List.

Thanks!

(oh, forgot, while I'm asking for the moon: what would be REALLY awesome is if this automagically generated listing of Authors List entries could include both its entry and its date. rough dates are sort of inherent in my example Authors List entry titles above, but not in my actual data. thanks!)

# Answer
> 1 votes
I usually create a front-end admin template for these kind of elaborate info panels with links back to the control panel. The editor can browse on the front and see all info (in a more dense way than usually shown on a website) and click an entry he/she wants to edit.

Alternatively, for the control panel, you could maybe develop a module-tab or custom field that will generate a view of your desired data. I've seen there's an add-on called introvert, but don't know if that does work with related entries from inside a matrix. http://devot-ee.com/add-ons/introvert

# Answer
> 1 votes
I know of none that work exactly like you;ve described but I have used Zenbu to great effect to filter/search entries.

Set it up how you like and then you can save the search criteria and you're away, very easy, quick and modestly priced.

---
Tags: matrix
---


title: Search module in html block

text:
# Question
Title: Search module in html block
I am new expression engine..I have added a htmlblock widget to a page that would show search box but is not supporting the {exp:search:simple\_form channel} all these tags what should i do?

Here is my code

```
{exp:search:simple_form channel="blog|news|pages" search_in="everywhere" where="all" result_page="search/" no_result_page="search/no_results" show_expired="yes" show_future_entries="yes"}
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" />
    <input type="submit" value="" class="searchbtn" />
{/exp:search:simple_form}

```

Thanks, Neha

# Answer
Assuming you have some form input elements within your simple\_form tags you also need to include the results tags somewhere. Normally this is on another 'page' but I think you can do it on the same page.

Documentation for the results tags can be found at http://ellislab.com/expressionengine/user-guide/modules/search/results.html

Basically, you do something like:

```
{exp:search:search_results}
    {title}
    {other_custom_field1}
    {other_custom_field2}
    etc...
{/exp:search:search_results}

```

Which will loop through the results and display any data you put within the loop for each result.

In light of your comment...

That's a huge question, another one!

I would suggest you take a look at http://ellislab.com/expressionengine/user-guide/intro/the\_big\_picture.html to start with. Basically, the URLs used on your site map to your template groups and templates. It's really fundamental that you understand how EE's templating works so I would go look at those docs before you go any further with your site otherwise I fear you will run into bigger problems further down the line.

So to make things simple, start by creating a template group named "search". Create a template in there called results - this is where you would use the tags I show above.

Then set your results\_page parameter to point at "search/results".
> 1 votes

---
Tags: search
---


title: SagePay (server) error message

text:
# Question
Title: SagePay (server) error message
In a Catch-22 situation where SagePay won't approve a merchant account for client unless we have a working dev site for them to test a transaction on which is set up to integrate with … SagePay.

Anyway, have set up a CartThrob install using Twitter bootstrap to keep things simple with the gateway at checkout set to 'SagePay Europe Offsite (Server)'. However, on checkout I get the following error message:

```
Error
<url> malformed (3)

```

Not sure how to troubleshoot or debug. My immediate guess is that the vendor name (which I don't yet have as the merchant account is pending approval) is required for sending a user to SagePay during checkout. Is that correct?

Cole

# Answer
> 1 votes
For the Merchant Service application - a working Test or Live wesbite is required so that the merchant bank, Elavon, can simulate the check out process up to the payment page. This does not need to be integrated with Sage Pay at this point.

# Answer
> 0 votes
have you configured your extload.php file to show where your system folder is / is called? That is the file used for the callback url.

---
Tags: cartthrob, checkout, sagepay
---


title: S=0 in URL's of ExpressionEngine site

text:
# Question
Title: S=0 in URL's of ExpressionEngine site
`S=0` is randomly appearing in URL's of an ExpressionEngine site that is being developed. Has anyone encountered this before? If so, what was the issue?

Example of url: `example.com/S=0/search/results/`

Thank you.

# Answer
> 5 votes
Make sure that you have "User Session Type" set to "Cookies only". (Docs.)

---
Tags: url
---


title: multiple search results

text:
# Question
Title: multiple search results
I am getting multiple results of same data.please suggest

**Search Page Code**

```
{exp:search:simple_form channels="pages|news" result_page="widgets/Widget_search_results/" search_in="everywhere" form_class="search" where="all" show_expired="yes" show_future_entries="yes"}
  <input type="text" maxlength="100" size="18" value="" id="keywords" name="keywords">
  <input type="submit" class="submit" value="search">
 {/exp:search:simple_form}

```

**Result Page code**

```
{exp:channel:entries {embed:_channel_params}}
<!-- Start Widget: {channel_short_name} -->
<table border="0" cellpadding="6" cellspacing="1" width="100%">
<tr>
<th>{lang:title}</th>
<th>{lang:excerpt}</th>
<th>{lang:author}</th>
<th>{lang:date}</th>
<th>{lang:total_comments}</th>
<th>{lang:recent_comments}</th>
</tr>

{exp:search:search_results switch="resultRowOne"}

<tr class="{switch}">
<td width="30%" valign="top"><b><a href="{auto_path}">{title}</a></b></td>
<td width="30%" valign="top">{excerpt}</td>
<td width="10%" valign="top"><a href="{member_path='member/index'}">{author}</a></td>
<td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
<td width="10%" valign="top">{comment_total}</td>
<td width="10%" valign="top">{recent_comment_date format="%m/%d/%y"}</td>
</tr>

{/exp:search:search_results}

</table>
<!-- End Widget: {channel_short_name} -->
{/exp:channel:entries}

```

# Answer
Not sure why there are `channel:entries` loops in this template - I'm assuming you've inherited this site from another developer?

Start by removing the opening and closing `channel:entries` tags.
> 2 votes

---
Tags: search
---


# Question
Title: htaccess redirect from non query url to query url
I'm trying to redirect a url from a non-query version to a query version with EE.

I can get the redirect working properly on a .php flat-file, such as:

```
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^test.php$ /test.php?var=1&var=2 [R=301,L,QSA]

```

However, I can not get a normal EE url like this to work:

```
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^testpage$ /testpage?var=1&var=2 [R=301,L,QSA]

```

I suspect it has to do with how EE handles queries.

# Answer
I've written a fairly robust set of mod\_rewrite .htaccess rules for EE; I've got a couple of rules in there that will deal with query strings, hopefully it'll solve your problem.

Note: you'll need all four of the cases I have in there, which should be a complete set of cases needed for query strings and removing index.php from the URL; those four cases would be used to replace whatever rules you have in place to handle that functionality now.

You may need to make a few minor tweaks, but, that Gist is pretty well documented; please let me know if you have any questions about it.
> 0 votes

---
Tags: ee2, htaccess, query, redirects, mod-rewrite
---


# Question
Title: Solspace Friends - Status Updates Display
Is there a way to display all status updates from a particular member group in templates irrespective of whether or not they are friends (of the logged-in user)?

# Answer
There is no built-in way to display all statuses of members in an EE member group. However, you can get this data using the EE query module:

```
{exp:query sql="SELECT * FROM exp_friends_status AS f
    JOIN exp_members AS m ON m.member_id = f.member_id
    WHERE f.group_id = 5"}
  {status} by {screen_name}<br />
{/exp:query}

```

...where **`5`** in `f.group_id = 5` is the EE member group\_id from which you want all the group's member statuses to be displayed.

Note: *The above is to display statuses of members within a **EE member group**, not a **Friends Group**. For a Friends Group, the query would be different.*
> 1 votes

---
Tags: solspace, status
---


title: style set wygwam

text:
# Question
Title: style set wygwam
I have defined a new set of style to use in the wygwam editor and that works fine. I have called this file "my styles.js" and included it in /themes/third\_party/wygwam\_assets/ as suggested in the guide located here: http://pixelandtonic.com/wygwam/docs/style-set

One of the styles I have included is called myclass (see below) and it does get applied within the editor. I have also included a style sheet in the same location as described in the guide that defines myclass. The problem I have is that the styling although being applied is not showing within the editor window.

```
    CKEDITOR.stylesSet.add( 'my_styles',
[
    // Block Styles
    { name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue' } },
    { name: 'Red Title' , element: 'h3', styles: { 'color': 'Red' } },
    { name: 'My Class', element: 'div', attributes: { 'class': 'myclass' } },

    // Inline Styles
    { name: 'CSS Style', element: 'span', attributes: { 'class': 'my_style' } },

    { name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } }
]);

```

# Answer
You still need to point Wygwam to the new styleset. In Addons \> Modules \> Wygwam, select the configuration you want to use. Then you'll see the '*CSS File*' field. This is where you place the full path to your CSS file to be applied to the Wygwam field. Copy that in here and hit '*Update*' and you should see your styles applied.
> 1 votes

# Answer
Actually you will need to set the StylesSet as Ian said, but the option looks like this:

It doesn't "really" matter where the file is located, you just have to enter the path to it. I prefer using a relative path. Then be sure you have the "Styles" drop down in whichever Configuration file you are using for WYGWAM:

Then just use the styles to add whatever style to text, images, etc...
> 1 votes

---
Tags: wygwam
---


title: Wygwam is not saving images

text:
# Question
Title: Wygwam is not saving images
I uploaded an image in the file manager, when I edit my channel entry and use the image icon inside of the wygwam editor window i find the file and it previews correctly. I add it to the page and everything appears normal. When I save the entry it does not show up on the live page. Then when i go back to check and edit the entry again I see the broken image symbol and the source is set to {ci\_image}

# Answer
Assuming you are using an older version of wygwam, try updating Wygwam to the latest version that has the "Restrict allowed HTML?" option in the Configuration settings, and set it to "No".
> 1 votes

# Answer
Have you checked the paths for the image upload directories? It sounds like the Server Path is correct but the URL of the upload directory could be wrong. I would make sure all of your paths are correct.
> 1 votes

---
Tags: ee2, wygwam, file-manager
---


# Question
Title: When parsing {exp:channel:entries} are all channel fields loaded, or only the ones used in the template
Scenario: I have a collection of projects (the channel) in a portfolio page (the template), with the title and feature image showing on each. When I click on a project, I want to have a modal box with all information about it - description, gallery of images, client, team members etc (custom fields).

My initial thought was to use AJAX to load the additional information by calling an XML template that accepted the entry id as a GET variable and returned all of the additional information. Then I wondered whether all of this additional information was already loaded in the portfolio template's database call. Are all of these custom channel fields already loaded and simply not displayed?

If they are, then I could simply create a hidden modal box for each project in the template, then show with simpler Javascript.

# Answer
Yes, all custom fields for each entry you call via `channel:entries` are loaded by the template engine and ready to be parsed, so your latter idea is a good one.
> 3 votes

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


title: Conditional not evaluating as expected

text:
# Question
Title: Conditional not evaluating as expected
I have this conditional

```
{if '{logged_in_group_id}' == '{exp:config_variables:get name="xxxxx"}'}...

```

where `{logged_in_group_id}` is equal to 3

and `{exp:config_variables:get name="xxxxx"}` is equal to 3

But why does this conditional return false?

I have also tried using a literal value

{if '{logged\_in\_group\_id}' == '3'}... {if '3' == '{exp:config\_variables:get name="xxxxx"}'}...

but they still returned false.

What is wrong with this?

# Answer
> 4 votes
Your problem is parse order, and there may be several workarounds for that... however, (and I'm guessing a bit at what you're trying to do) I would suggest that instead of using this unusual exp:config\_variables add-on and faffing about with parse order that you use the `assign_to_config` array to create your own early-parsed global variables. Then you can do a nice clean:

`{if logged_in_group_id == {gv_special-group-id}}...{/if}`

You can achieve this as documented either in the main index.php file, or if you prefer with a little trickery you can do it in your config.php file like this.

# Answer
> 0 votes
Have you tried it without using quotes around the variables?

For example, instead of '{logged\_in\_group}' you should just say {logged\_in\_group}

If you use quotes, I believe you are actually comparing strings, instead of comparing the values, and that means you are literally comparing the string {logged\_in\_group} to 3 instead of getting the value and comparing the two integers.

---
Tags: conditionals
---


# Question
Title: using free-form composer - form not appearing correctly
using tag: {exp:freeform:composer form\_name="test"}

It draws lines but doesn't show the form inputs example: http://sellitresolution.com/home/test

# Answer
If you view source, you'll see that all the Freeform code is there. This seems to be more of a display issue. Try that tag in a blank template and see what you get.
> 0 votes

---
Tags: solspace-freeform
---


# Question
Title: Add-on for Appointments scheduler suggestions?
Looking for an appointments scheduler add-on for EE. Looked at rEEservartion but not quite the right fit. Basically what we need is the following:

A system enabling appointments to be scheduled for a one-off 2-day event with set times of half an hour from 10 - 5.

Signed-up members - say 10 in total - form a 'pool' which need to schedule meetings with each other. Each member can click to 'book' (no payment involved) a half hour slot with another member of the pool and set this to unavailable in both their own scheduler and the booked one.

So, Mr Smith clicks on "10-10.30 AM" on Mr Jones Scheduler and the add-on blocks out this slot on both Smith and Jones' schedule. It also sends an email to both members notifying them.

Conversely it should also be possible to cancel this (by Smith or Jones) and free the slot again.

Is there any add-on for this? Does not need to hook up with any payment system...purely internal. I think it is also possible to do through channels and Zoo Visitor maybe and by-pass the Add-on.

Anyone done anything like this?

# Answer
> 3 votes
There is probably no easy add-on for scheduling as you describe it.

As you mention, this scheduling app would be possible with regular channels, channel:form and a bit of javascript. When adding a new booking, the system would need to check for entries (availability) for both members and then (ajax) submit a channel:form. To cancel a booking, you'ld need to set the status to cancelled (deleting entries with channel:form/safecracker is not possible, as far as i know).

---
Tags: events
---


# Question
Title: MX Notify Control not sending to more than 1 email address
Using the latest EE 2.7.3 and MX Notify 2.4.6 (tested on a fresh install), setting up a notification for anything, eg. a new entry posted, and notifying a user group or mailing list (or combination) with more than 1 email address in the array only sends to the first email address the system processes.

I've played around with setting different email config settings, but to no avail. The system can send via the communicate tab to more than 1 address, so it must be a problem with MX Notify.

The eec.ms forums don't allow registration, so I'm posting here in case someone can help.

# Answer
It seems that adding

```
$this->EE->email->initialize();
$this->EE->email->from($site_settings['email_' . $iRow] != '' ? $site_settings['email_' . $iRow] :  $this->EE->config->item('webmaster_email'), ($site_settings['from_' . $iRow] != '') ? $site_settings['from_' . $iRow] : $this->EE->config->item('webmaster_name'));

```

To the top of the foreach sending loop fixes the problem.

```
    if (count($emailTo) != 0 )
    {
        foreach ($emailTo as $key => $val)
        {
            $this->EE->email->initialize();
            $this->EE->email->from($site_settings['email_' . $iRow] != '' ? $site_settings['email_' . $iRow] :  $this->EE->config->item('webmaster_email'), ($site_settings['from_' . $iRow] != '') ? $site_settings['from_' . $iRow] : $this->EE->config->item('webmaster_name'));
            $this->EE->email->to($val['mbr_email']);
            $this->EE->email->subject($this->templater($email_sabj_tmp, $val));
            $this->EE->email->message(entities_to_ascii($this->templater($msg_body_tmp, $val)), (($plaintext_alt_tmp != '') ? $this->templater($plaintext_alt_tmp, $val) : ''));
            $this->EE->email->Send();

        }
    }

```
> 2 votes

---
Tags: email, bug, mx-notify
---


# Question
Title: Assets 2: Image Manipulations not showing for images in subfolders?
This title should be pretty self-explanatory. All the images and their manipulations are working just fine. Except when I upload the images into a subfolder of the main "`images`" upload-directory.

When I tell it to get the so-called "gallerythumb"-manipulation of said image, it returns the url: `/images/store-photos/_gallerythumb/111.jpg`

Which corresponds to the usual pattern: `/upload-directory-path/user-created-subfolder/_manipulation-name/filename.jpg`

Is this something that was never a part of Assets' functionality? I mean, I know it's not part of EE's functionality, but...

# Answer
> 1 votes
Sounds like a permissions issue to me. Make sure that the subfolders of the upload folders are writable by PHP. Image manipulations work for subfolders in Assets.

# Answer
> 0 votes
I could be mistaken but EE only sees one level of folder and by thereby only manipulate those in he top level folder.

Assets introduced sub folders and as far as I know not even EE file manager sees IMG in assets sub folders.

---
Tags: assets, file-uploads, file-manager, thumbnails
---


# Question
Title: Listing subfolders in an Assets fieldtype
I have a Assets fieldtype within a Matrix fieldtype column.

Is it possible to list subfolders for the uploads dir?

ATM, I only get top level folders as per the attached screenshot.

Im my Images folder, I have News and Product subfolders...I'd like these listed if possible?

# Answer
> 2 votes
As far as I know that's not possible. If you have a folder you need to use like that you'll have to just create a new root folder for it (if you don't want to use one of the existing ones)

---
Tags: matrix, assets
---


# Question
Title: Assets field within Grid field does not display
I have an issue using an Assets field (2.2.2) within a Grid field (EE 2.7.2). Here is my code:

```
{home_slideshow}

<img src="{exp:img_resize src="{home_slideshow:slide_image}" width="745" height="558"}" alt="Front Show Image" class="hero-image">

{/home_slideshow}

```

When I use Assets, the image displays fine but other Assets fields on the same page display nothing. When I swap out Assets and use a basic File field the above image does not display (and returns an empty img tag) but the other Assets fields on the page work fine!

I have already eliminated img\_resize as the problem by removing any references to it - the issue remains the same.

Any thoughts?

Thanks.

# Answer
I encountered this issue as well, and Pixel and Tonic confirmed it to me as a known bug in Assets 2.2.2. Email them for a fix: support@pixelandtonic.com
> 1 votes

---
Tags: assets, grid
---


# Question
Title: 501 Method Not Implemented error on Nexcess
Heyo everyone,

I'm getting a 501 Method Not Implemented error when saving a specific entry. Screenshot: http://d.pr/i/VeFj

After some googling it looks like a mod\_security issue. Has anyone else encountered this issue?

The entry is called "Deus Caritas Est" so it is possible that mod\_security is having a conflict with the entry title. I've issued a support request with Nexcess, but wanted to know if anyone else had see that issue.

Thanks!

# Answer
We had to contact Nexcess support to allow a mod\_security exception for our site. Hope this helps anybody else with a similar problem.
> 2 votes

# Answer
I have have this happen and **others have as well**... Usually comes up as a 403 Forbidden error.

**Alex Roper** posted this code for disabling in the .htaccess file.

```
<IfModule mod_security.c>
    SecFilterEngine Off
</IfModule>

```
> 4 votes

---
Tags: categories
---


# Question
Title: Calendar Entries posted between 11:00pm and 11:59pm show on next day's
I've got a channel of events. The main exp:channel:calendar tag displays the entry on the appropriate grid day. When I follow to the date's detail template (/calendar/2013/11/22) the entry that was previously in the grid does not show, and instead shows on the next day (/calendar/2013/11/23).

This only happens if the entry's date/time is posted between 11:00pm and 11:59pm. If I change it to 10:59pm it posts on the correct day just fine.

I know it sounds like a DST type issue. It also could be a server offset issue. I'm still looking into it, but would appreciate any feedback.

Thanks!

# Answer
> 0 votes
As I posted in a comment above, this was a DST server setting issue.

---
Tags: calendar, dst
---


# Question
Title: Working with EE Discussion Forum when Structure is installed
We've taken over a site at work and they were originally developed in Expression Engine with Structure installed. They recently asked us to install the Discussion Forum module on the site, which we have installed now, but I'm having a hell of a time trying to get it working. My assumption is that real problem here is Structure, but I'm also fairly new to EE, so maybe it's just a lack of knowledge?

I've got the forum working on a new template page using:

```
{exp:forum}

```

I created a page in Structure and assigned it to the template, so when you navigate to the page the forum shows up properly; however, when you try and do anything within the forum, like trying to view a forum or thread, it sends you back to the main site to a blank landing page for the forum page.

The only thing I can think of is that structure is seeing that the "viewforum" or any other page beyond the forum landing page doesn't actually exist.

I ended up installed Freebie hoping that would help solve some of my problems - the forum stopped redirecting back to the main site, but it won't actually work now because it relies on EE's core `uri->segment` and freebie stops that from being processed (at least from my understanding)

I've also tried adding a new channel for the forum and creating the page in Structure using that channel, it still does the same thing when you try to click into a forum.

I really hope someone knows a fix for this, I'm literally pulling my hair out trying to figure this system out and the documentation on this stuff is very minimal.

Thanks in advance to anyone that can help!

# Answer
> 1 votes
This probably needs ot be run completely outside of Structure and more like traditional EE for the forum to avoid all of the routing/url issues.

---
Tags: ee2, structure
---


# Question
Title: Adding Dimensions to Products with Expresso Store
Hello where would you think the best place to add Length x Width x Height to the products? I would think that this would then update the shipping details with costs. Rules don't seem to facilitate this. Recommendation for dynamic Store product data updates

# Answer
> 2 votes
The answer is already in the forum thread you linked to. You would set these fields as hidden fields on the product page and you would use JavaScript to fill these values in when the user *adds to cart* (use the on click event of the button as the trigger).

To enable this, when you add the *Store Product Details* field to your channel field group you will see an option to *Enable Dynamic Weight & Dimensions*:

You need to set this to Yes so they can be submitted from the front-end.

As long as you setup your shipping rules then they will match the selected dimensions of the product and increase or decrease shipping cost accordingly.

---
Tags: expresso-store
---


# Question
Title: Cartthrob gift certificates shipping cost
I use cartthrob with cartthrob gift certificates, but i have a problem with the shipping cost.

When a user buys a gift card shipping is included in the total. Since the giftcard is sent via email, I don't want shipping added for it.

I would like it to work like this:

* When the user only has a gift card in the cart we don't want to charge for shipping
* When the user has other products, the shipping should be charged

I hope someone can help me with this problem

# Answer
> 1 votes
Inside your {exp:cartthrob\_gift\_certificates:add\_to\_cart\_form} add the parameter shipping\_exempt="yes"

By adding that parameter, the gift certificate will not be factored in when calculating the shipping costs.

---
Tags: cartthrob, giftcertificates
---


# Question
Title: EE & CartThrob: Conditional Not Working?
I've been looking at this for a bit, so maybe my eyes are just fried right now, but I can't seem to figure out why the following conditional is not working:

```
{if {total_items} != "0"}
                        <div class="paddingleft36">
                            {if {exp:cartthrob:cart_subtotal prefix=""} >= "40"}
                                <div>Delivery Options<br />
                                <input type="radio" name="delivery_option" value="pickup">Pickup<br>
                                <input type="radio" name="delivery_option" value="delivery">Deliver to:
                                </div>
                            {if:else}
                                {exp:channel:entries channel="cart"}
                                <div>{pickup_only_notice}</div>
                                <div class="cart_options topminus">{delivery_minimum_notice}
                                </div>
                                {/exp:channel:entries}
                            {/if}
                        </div>
                    {/if}

```

Right now, it just spits out the {if:else} portion of the code, even if the shopping cart subtotal is greater than or equal to ( \>= ) 40. When the subtotal is over 40, the Delivery Options radio boxes should appear, but they don't.

This is very confusing and I assume that it might have something to do with the {exp:cartthrob:cart\_subtotal prefix=""} tag, but this is precisely how the CartThrob documentation suggests creating conditionals with the cart subtotal (e.g. stripping the currency prefix ($) to compare values.

# Answer
Try wrapping that cart\_subtotal tag in quotes inside your conditional.

I just tried this out and it worked for me:

```
{if '{exp:cartthrob:cart_subtotal prefix=""}' >= '40'}
    Delivery Options Code
{if:else}
    This is the else statement
{/if}

```

This worked with subtotals containing decimal values and also worked if I specified a number with a decimal as the compare value.

Not sure if prefix="no" was just a mistype, but by adding prefix="no" you're going to end up with something like "no30" as the subtotal value you're trying to compare. I think that will always evaluate as greater than 40.
> 2 votes

# Answer
I came to the solution for this about 10 minutes after I drafted this question, so I thought I'd share it with anyone who might be stuck on this one. It's simple, but might save some time and hair-pulling.

It turns out the "decimals" parameter in CartThrob's {exp:cartthrob:cart\_subtotal} tag must be set to "0" to properly compare its value with another number (even if that other number also contains a decimal). This seems illogical, but it's the way works.

Works properly:

```
{if {exp:cartthrob:cart_subtotal prefix="no" decimals="0"}[/code] >= "40"}
{if:else}
{/if}

```

Does not work properly:

```
{if {exp:cartthrob:cart_subtotal prefix="no"}[/code] >= "40"}
{if:else}
{/if}

```

Maybe a newbie solution, but a solution nonetheless. :D
> 1 votes

---
Tags: ee2, cartthrob
---


# Question
Title: Lock down certain member groups in the CP so other members can’t delete them?
Does anyone know if there is there a way to lock down certain member groups in the CP so other members can’t delete member accounts belonging to those member groups?

I have a specific member group, let's call them 'Administrators' which need to be able to create members and delete members in another member group, called 'Customers'. But I don't want the 'Administrators' to be able to delete members in other member groups.

Does that make sense. Any ideas?

# Answer
As Alex mentions, when a user has "Can delete members" rights, he/she can delete any member.

A different approach would be to, not allow to delete members, but to only allow users to be moved to a member group with no (login) rights at all. You can restrict to which group a member can be assigned by setting the group to "locked". If needed, the restricted member group could regularly be purged by a super-admin.
> 4 votes

# Answer
I think GDmac's answer is the way to go. But I thought it would be fun to start on an extension....

This seems to do the trick, though it is pretty bare-bones (no settings, not much detail in the message shown to the user).

Using the `member_delete` hook:

```
public function member_delete($member_ids)
{

    // Array of member group_ids for which to restrict delete permissions
    $supervised_member_groups = array('7');

    // Array of member group_ids for wich deletion is disallowed
    $protected_member_groups = array('5','6');

    // The group_id of the current admin
    $current_admin_group_id = ee()->session->userdata('group_id');

    // Check if the current admin is in the supervised member group
    if (in_array($current_admin_group_id, $supervised_member_groups))
    {
        // Generate an array of group_ids to which the deleted member(s) belong(s)
        $member_groups = array();
        $query = ee()->db->select('group_id')->where_in('member_id', $member_ids)->get('members');
        foreach ($query->result() as $row)
        {
            array_push($member_groups, $row->group_id);
        }

        // Check if the deleted member belongs to one of the protected member groups
        // and if so throw an error
        $overlap = count(array_intersect($protected_member_groups, $member_groups));
        if ($overlap) show_error('You are attempting to delete a member from a protected group. Please adjust your selection.');
    }

    return $member_ids;
}

```

Gist with full extension
> 1 votes

---
Tags: members, control-panel, delete
---


# Question
Title: Show sold products report status only for paid orders in Expresso Store?
i wanted to know how it is possible to filter the products sold report, because we have some orders which are paid directly and some which can be paid manual and sometimes they never get paid. So our order list is filled also with some shop reminder statuses and i don't want to have that products inside the products sold report.

Is there an option that only the products get counted where the paid status is true?

Any ideas?

Best Peter

# Answer
> 1 votes
There isn't an option to filter the report directly.

Your best option would be to export the report as CSV, and import it into Excel or another spreadsheet program, where you can filter and sort the data as necessary.

Alternatively, you could go through and manually delete orders which aren't paid within a certain timeframe. That way they wouldn't affect your report data.

---
Tags: expresso-store
---


# Question
Title: Using width / length / height as dynamic option
Im using this answer Recommendation for dynamic Store product data updates to setup my products, wich works great but the problem is they are not getting added as seperate products like products with product modifiers, basicly it only adds one quantity to the product.

Is there any way todo this? I could setup a dynamic product variable, but it would be great todo it this way.

# Answer
> 1 votes
That's a side effect of the fact that Store simply combines any products with the same modifiers. Unfortunately, if you don't change any modifiers, the products will become a single line item in the cart.

One solution would be to add a hidden modifier to the product, which you generate (either randomly or based on the dimensions). You can then use conditionals to hide this modifier in the checkout, so the only thing it will affect is the display of individual line items.

---
Tags: expresso-store
---


title: Favorites Module - Browser Problem

text:
# Question
Title: Favorites Module - Browser Problem
I have installed and managed to get the favorites module to work on a project I'm developing.

I can save and remove favorites.

I was doing this in Chrome and successfully viewed my favorites assigned to my user.

However just checked in other browsers and my favorites simply don't show up.

Has anyone come across this problem before ?

Please help.

# Answer
> 1 votes
Did you login on every browser? I believe the default setting for Favorites is private.

---
Tags: ee2, solspace
---


# Question
Title: Adding category data to URLs in Low Search results
I would to add category in the Low Search Url result.

On my page result appears the Channel name and the entry name:

```
www.mysite/recipes/hamburger

```

But i would insert the categories:

```
www.mysite/recipes/meat/beef/hamburger

```

I'm using this:

```
{exp:low_search:results query="{segment_2}"}
      <a href="{comment_url_title_auto_path}">{title}</a>
{/exp:low_search:results}

```

I tried but without success Thanks,

Stéphane

# Answer
> 1 votes
You'd have to construct it yourself, most likely with the native `{categories}` var pair. Something like this:

```
{exp:low_search:results query="{segment_2}"}
    <a href="/recipes{categories}/{category_url_title}{/categories}/{url_title}">
        {title}
    </a>
{/exp:low_search:results}

```

However, you can imagine how that turns out if your entry has a *lot* of categories. Also, I'm not sure if the `{categories}` var pair respects the order of the categories, based on parent/child relationship. It might be necessary to look for an add-on that gives you more control over the output of the entry's categories.

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


# Question
Title: Restoring Category Groups and Categories?
I recently updated a site from EE 2.2 (I think) to 2.7.2.

Somewhere along the way, the categories and groups went missing, but not the category associations for each entry.

(The person who was holding the backup of the DB seems to have misplaced it, otherwise I'd just pull it from there. I'm hoping it will still turn up...)

Is there a way to recreate the category structure based on the information in the entries?

# Answer
I'm afraid you're out of luck Tim. All you have left is numeric category IDs, which at best can tell you which entries were categorized the same - this might give you some clues as to which categories those IDs might have belonged to, but even that's a stretch.

May I suggest you take a look a Backup Pro after this is resolved?
> 1 votes

---
Tags: categories
---


title: Category / URL's Question

text:
# Question
Title: Category / URL's Question
I've always had this problem with categories in EE. I want to be able *somehow* to specify which categories show in the URL & a custom breadcrumb setup I've created.

For example, if I had the following setup...

```
Category Group 1
Category 1.1
Category 1.2
Category 1.3
Category 1.4

Category Group 2
Category 2.1
Category 2.2
Category 2.3
Category 2.4

```

Both assigned to a channel called "Products". Now every time I create a product I can choose which category the product goes in to.

For example...

Product 1, will go in Category 1.1, Category 1.2 and Category 2.4

But when I output the categories and limit it to just 2 in the URL doing something like...

```
{site_url}products/{categories limit="2"}{category_url_title}/{/categories}/{url_title}

```

It would also pick up on the first two categories category...

```
http://website.com/products/category-1-1/category-1-2/product-name

```

Is there anyway to make it specify which category to show?

This is an issue for one of our clients because they have MANY category groups and assign products to many categories. So if the groups were...

```
Group 1
Group 2
Group 3
Group 4

```

It still only displays the categories in the URL from Group 1, none of the others. Ideally this would help the SEO and the make the URL's make more sense if they could specify which categories appear in the URL.

# Answer
If, as per your example, you only want to show categories from a certain group, you can use the `show_group=""` parameter on the `{categories}` variable pair. Creating the URLs would then look something like...

```
/products{categories show_group="1"}/{category_url_title}{/categories}/{url_title}

```
> 2 votes

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


# Question
Title: Solspace User - Generating a Radio button from a custom member field
Solspace's documentation seems to suggest I can generate a radio list from a customer member field if that member field is set to SELECT type.

> This variable pair is a flexible method for creating pull-down menus, radio button arrays, etc. In the variable pair, you precede the short\_name of the member field with select\_ .Link to Documenation

However I cannot work out how to do it. Any suggestions?

# Answer
> 2 votes
In theory, you would do this:

```
{select_CUSTOM_MEMBER_FIELD}
    <label><input type="radio" name="CUSTOM_MEMBER_FIELD" value="{value}" {selected} /> Custom Member Field Label</label>
{/select_CUSTOM_MEMBER_FIELD}

```

However, since `{selected}` will output `selected="selected"`, when what you actually need is `checked="checked"`, I'm not sure how they figure this can be used for radio inputs. Maybe you can also use a variables named `{checked}` which will populate based on the current value?

# Answer
> 2 votes
Thanks to Derek's help I was able to work up a solution:

```
{select_CUSTOM_MEMBER_FIELD}
        <label><input type="radio" name="CUSTOM_MEMBER_FIELD" value="{value}" {checked} /> {value}</label>
    {/select_CUSTOM_MEMBER_FIELD}

```

---
Tags: solspace, solspace-user
---


# Question
Title: Get Channel entries using custom filed type value
Is there a way to return channel entries based on a custom field type value? I have set up a custom field type and I want to be able to return channel entries that just a have a specific value for that field. Is that possible?

Oh, and just to make it more complicated I can't use the `search:field_name=` parameter because:

1. The custom fieldtype I need to search is a P&T Dropdown
2. I actually need to also return any results that match a specific `author_id=` value in the same channel entry results
3. I really need to query multiple custom fields across multiple channels

So what a I really need is a `OR` type query using a custom field as a parameter. I thought about creating a custom query or even making a quick plug-in, but the channel entries table along with trying to query custom field data is so convoluted. It's seriously a complete nightmare.

I'm open to any suggestions. Thanks.

# Answer
> 1 votes
I think this is a good candidate for the **Channel Query** plugin. It has all of the features of `{exp:channel:entries}`, with the flexibility of the Query module.

```
{exp:channel_query
    sql="SELECT entry_id FROM exp_channel_titles WHERE /* your custom query here */"
}
    <!-- all channel entries variables can be used here -->
{/exp:channel_query}

```

Your custom query gets the entry\_id's that match your criteria. Then, because you've got all the parameters and variables that come with the channel:entries tag, there should be no further querying for entries-related data needed. Just template as usual, as if you are using the native channel:entries tag.

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


# Question
Title: Create a variable from a URL's Query String
How can I create a variable that is pulled from a URL like the one below?

eg: http://www.example.com/page.php?Item\_ID=774&score=42

Need to pull the number "42" from the url and placed into a form which is then emailed by the user.

# Answer
Use **Mo' Variables**. It will give you access to GET variables like this `{get:your_key}` (in your case `{get:score}`).

Mo' Variables has many other uses, as well!
> 10 votes

---
Tags: url, variable
---


# Question
Title: Search two channels with a relationship field
I have two channels. One channel has a relationship field and is used to store a list of people giving me their name and a description of who they are and a couple other details. The other channel is a vehicle for listing quotes made by the people in the other channel. I use the name of a person (with the relationship field) to be displayed in the other channel when I call up a quote by that person. (I hope you can get a picture in your mind of what I've just said).

My problem is that I'm using EE search:simple\_form to search out words in the quotes and display the results. But I also want my users to search out and display a specific person and ALL the quotes that I've attributed to that person.

I tried using a pipe to separate the two channels in the "Channel=" spot, but that didn't work. I could get results from the main quote channel but not the author channel. I've search this Answers forum but most results point to third party products and it's just not worth spending more than $10 to get a third party product to do this. It's something I would really love to be able to do, but there's no return to justify my spending more money on this.

I've also looked into building a Google custom search, but it seems they want money for that and the site that lets me try the search wasn't too impressive on my site either.

So, any help or ideas would be appreciated.

# Answer
My reccomendation here is to create a dedicated relationship channel. It's a bit complex at first, but I promise a simple concept.

That channel looks like:
We use this structure, but with all these extra fields for extendability. The kind of logic flow is using this channel to link two or more entries.

So it looks like you have people and vehicle listings. Lets say Bob comments on Mustang: "Bet she's fast!".

So the relationship entry looks like:

```
rel_id_a : bob_user_id
rel_id_b : mustang_entry_id
meta_a : "Bet she's fast!"

```

So now, finding all comments for a particular listing works like:

```
{exp:channel:entries channel="relationship" search:rel_id_b="={mustang_entry_id}" dynamic="no"}
    <p>{rel_id_a} said: {meta_a}</p>
{/exp:channel:entries}

```

Finding all comments for a user:

```
{exp:channel:entries channel="relationship" search:rel_id_a="={user_id}" dynamic="no"}
    <p>{rel_id_a} said: {meta_a} on listing: {rel_id_b}</p>
{/exp:channel:entries}

```

This method is fast and Easy to implement. It provides a generic recycle-able channel. You can use this same channel to also hold relationships of many types.

Best of all, its free and core to EE functionality, and I hope it helps you.
> 3 votes

---
Tags: search
---


title: Assets images disappear after site move

text:
# Question
Title: Assets images disappear after site move
The site in question has had its domain changed and files moved to a new spot on the server. The site loads, but all Assets image fields in entries have not retained their images. However, image thumbnails do appear in the Assets file manager.

EE2.7.2, Assets 2.2.2, Matrix 2.5.10

# Answer
> 0 votes
For some unknown reason, the exp\_assets\_selections table became blank and some point in the process. I restored a backup of the DB, and it works now.

For future ref: if Assets barfs, make sure there is data in the appropriate tables.

# Answer
> 0 votes
Did you update the paths in Content -\> Files -\> File Upload Preferences?

---
Tags: assets, pixelandtonic
---


title: Change default select statuses?

text:
# Question
Title: Change default select statuses?
Is there any way to change the default statuses displayed by the channel:entries tag to "not closed"?

# Answer
You need to add `status="not closed"` to your `channel:entries` tags. If you do not specify a `status` parameter, it will always assume `open`.
> 4 votes

---
Tags: channel-entries, status
---


# Question
Title: Is there a way to provide a pick list of avatar images using Solspace User module?
I'm using the Solspace User v3.4.4 module on Exp Eng v2.7.2 - Build Date: 20131008 and trying to provide a set of existing Avatars for members to select from. I've setup a javascript function that populates a hidden field with the filename of the Avatar image when it is clicked on in a displayed list. But when the User "edit" profile form is updated the value is not being saved/stored in the member's profile.

I've tried variations of the field from 'hidden' to 'file' to 'text'. I can see the field being set to the proper value on the web page when a radio button is clicked on. But no saving of the field value when the form is posted. It seems likely there is some other security issue blocking this or something that I'm missing.

Here's some of the html and javascript... (I've changed the initial character of some tags to '\[' so that the code will display)

`[p id="avatar_filename_set">Choose a New Avatar:
 [input type="text" name="avatar_filename" id="avatar_filename" value="" />
 [input type="hidden" name="XID" value="{XID_HASH}">`

````
<table border="0" cellpadding="3" cellspacing="3" style="width:100%;">
<tr>
<td align='center'><img src='{site_url}images/avatars/sports/stand-up-paddling.png' border='0' alt='stand-up-paddling.png'/><br />
<input type='radio' name='avatar' value='stand-up-paddling.png' {if avatar_filename == 'sports/stand-up-paddling.png'}checked='checked'{/if} onclick="javascript:document.getElementById('avatar_filename_set').getElementsByTagName('input')[0].value = 'sports/stand-up-paddling.png'; return false;" /></td>

````

Here is the javascript specifically...

`onclick="javascript:document.getElementById('avatar_filename_set').getElementsByTagName('input')[0].value = 'sports/stand-up-paddling.png'; return false;"`

Any ideas would be appreciated. Thanks.

# Answer
> 1 votes
The `avatar_filename` field is a **file** type field, and therefore only accepts a **file upload** (see the example in the documentation). You cannot submit **string** data to the `avatar_filename` field (through a *text* or *hidden* field for example), since the field expects not the filename, but an actual file attached to the field. Also, in HTML, you cannot submit a string of data (eg. a filename) as a value for a **file** field type.

To summarize, it's not possible.

---
Tags: javascript, solspace-user
---


# Question
Title: Unable to retrieve custom order data on checkout step
I can capture custom order data as per the instructions at http://cartthrob.com/docs/tutorials/adding\_custom\_data\_to\_purchased\_items\_and\_orders/ by using a field like this:

```
{exp:cartthrob:save_customer_info_form}
    <textarea name="delivery_note" id="txt-delivery-note" placeholder="Delivery note"></textarea>
{exp:cartthrob:customer_info}

```

That gets captured fine but I have a multi-step checkout and when you go back to the page this is on, I can't work out how to populate the field with the data that's been submitted.

It's on a page that has billing and shipping address fields and they all populate as expected but when I try to populate this custom data field as follows, the tag doesn't render:

```
<textarea name="delivery_note" id="txt-delivery-note" placeholder="Delivery note">{delivery_note}</textarea>

```

Any suggestions?

This is on EE 2.7.2, CT Pro 2.4.

Thanks

# Answer
Try adding custom\_data\[\] to the name of your textarea.

```
{exp:cartthrob:save_customer_info_form}
    <textarea name="custom_data[delivery_note]" id="txt-delivery-note" placeholder="Delivery note"></textarea><br />
    <input type="submit" value="submit" />
{/exp:cartthrob:save_customer_info_form}

```

Then when you're recalling the value use {custom\_data:delivery\_note}.

```
{exp:cartthrob:customer_info}
    <textarea name="custom_data[delivery_note]" id="txt-delivery-note" placeholder="Delivery note">{custom_data:delivery_note}</textarea>
{/exp:cartthrob:customer_info}

```
> 0 votes

---
Tags: cartthrob
---