title: Product Modifiers

text:
# Question
Title: Product Modifiers
I'm trying to loop on product modifiers though I can't seem to do it, can someone tell me why I'm being dumb?

This page suggests I can do it with the product-tag: https://www.exp-resso.com/docs/product\_tag.html

This one suggests I can do it with the product-form-tag: https://www.exp-resso.com/docs/product\_form\_tag.html

Neither seems to work and when I copy/pasta the example code it just hard codes this in my template:

```
{modifiers}
<p>
  <label>{modifier_name}</label><br />
  {if modifier_instructions}<small>{modifier_instructions}</small><br />{/if}
  {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
    <select name="{modifier_input_name}">
      {modifier_options}
        <option value="{option_id}">
          {option_name}
          {if price_mod_val} ({price_mod}) {/if}
        </option>
      {/modifier_options}
    </select>
  {if:else}
    <input type="text" name="{modifier_input_name}" />
  {/if}
</p>
{/modifiers}

```

This Stack Exchange post suggests you cannot use it in the product tag unless its wrapped in product form tag (which I have also tried):

> However, you can't access the modifiers that way (there is no way for the fieldtype to return variable loops).

Outputting Exp-resso Store modifier-options without form-tag

Here is a screenshot of my entry in the backend of EE:

# Answer
This should work fine and while the code you've provided looks OK just double-check all your tags in that template are all closed properly as this is a common mistake that doesn't get caught properly by EE with an error.
> 1 votes

# Answer
You should be able to use the following:

```
{exp:channel:entries channel="products" limit="1"}
 {exp:store:product entry_id="{entry_id}"}
  {price} - {title}

 {modifiers}
  <p>
   <label>{modifier_name}</label><br />
   {if modifier_instructions}<small>{modifier_instructions}</small><br />{/if}
   {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
    <select name="{modifier_input_name}">
      {modifier_options}
        <option value="{option_id}">
          {option_name}
          {if price_mod_val} ({price_mod}) {/if}
        </option>
      {/modifier_options}
    </select>
   {if:else}
    <input type="text" name="{modifier_input_name}" />
   {/if}
  </p>
  {/modifiers}

 {/exp:store:product}
{/exp:channel:entries}

```

This assumes that your products channel is called `products` and that you are on a single entry page.

Also with your data above you would normally assign multiple options per variation. So something along the lines of Yes or No for TEST instead of just a single variation as you have. Basically you are trying to output a dropdown list with only 1 option at the moment.

The product\_form tag is a wrapper for the product tag that you would only need/want to use if you were trying to create a single form that allowed you to add multiple items to the page with a single submit. I often use it to allow a user to add multiple add-on type items after they have added a the main item to their cart. Think along the lines of add an iPhone to the cart I might present them the option to add a case, screen protector, and/or charger to the cart with a single submit button.
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Call to Stash embed being evaluated inside a Switchee statement when it shouldn't be
I have a problem with a Stash embedded template being called when it's inside a switch statement (or a conditional, already tried that too) which should evaluate as false.

For example:

```
{exp:switchee variable="{stash:_nav_active}" parse="inward"}

    {case value="home|404"}{/case}

    {case default="Yes"}

        {stash:embed
            name="partials:nav:{segment_1}"
            process="start"
        }

    {/case}

{/exp:switchee}

```

even when `stash:_nav_active` equals 404, the embed is being called and because the segment doesn't exist, I get:

> Stash: the file "/stash\_templates/partials/nav/made-up-segment.html" was not found.

# Answer
> 2 votes
I think since your stash embed is set to process on 'start' it will be run first before switchee, which is why you'd see a 'file not found' error if there's no stash file at that location. Try changing your embed to process="inline" and see if you still get the same error.

# Answer
> 0 votes
Pretty sure I recall that if you're evaluating a stash variable you can remove the square brackets.

```
variable="stash:my_var" parse="inward"

```

---
Tags: stash
---


title: EE sending to Spam, need help

text:
# Question
Title: EE sending to Spam, need help
I'm trying to send emails using EE \> tools \> communicate. I have tried PHP, SendMail, and now SMTP with no luck. The email send but goes into the spam folder.

Hotmail and Gmail are both sending to spam. I have created an email jim@mydomain.com and I'm sending from that domain. Normally I would tell Gmail that it is not spam, however this is for a client and they will change recipients often.

Ultimately I need my Freeform forms to NOT send to spam but for now I can't get this to work.

# Answer
> 9 votes
It can be many reason for this - first needs to check if domain or **Server IP** (can be for shared hosting) was not blacklisted.

Then check email header - you will have a whole picture if any spam flags here, servers ip, from what server is come etc. For example your email can failed DomainKeys (DKIM) test.

What I usually do, is setup mail setting for using third-party services like SendGrid or Mandrill to prevent possible issues. Both this services have free packages which enough for most sites needs.

# Answer
> 4 votes
Using SendGrid or Mandrill are great suggestions. Using Escort can help make that an easy process.

If you don't want to go that route you might also want to look into creating an SPF record wherever you are hosting your DNS for this domain name. That helps identify which mail servers are allowed to send email from a specific domain. There are a few wizards out there that can help you create SPF records such as http://www.spfwizard.net/ and then you need to work with your DNS host to add that record.

---
Tags: solspace-freeform, email, spam
---


# Question
Title: Is it possible to export/import a single site from MSM?
I've got a Multiple Site Manager set up with 3 different sites. I'm wondering if it is possible to export all EE content/channels/data from one of the sites, and import that same site data into another Multiple Site Manager instance. Is this easily accomplished, or will it involve dark SQL magic?

# Answer
In a word: no, nothing easy about this. All the data is stored in the same database tables using database-specific channels IDs, field IDs, entry IDs, etc, etc - which will almost for sure conflict with existing channels, fields, and entries in your destination database.

It's doable, but it's part-manual, part-automated, and requires a huge amount of analysis of both databases in order to figure out how you need to alter existing records so they don't conflict.
> 0 votes

---
Tags: channel-entries, multi-site-manager, multiple-sites
---


# Question
Title: How to achieve dynamic products using front-end form
We are doing a web app using ExpressionEngine where users create events (on the front end). Participants can register as an individual participant and participants can also register in groups of 2-5, either paying for themselves or for the group. Participants can add extras to their registration before checkout; these add-ons are determined by the original user who created the event.

Using Expresso Store, we'd like to ensure users can indeed create products (their registrations) from the front end, making them configurable by the participants before adding to the cart using options under Product Modifiers (eg. purchase lunch, or an event tshirt). Then have the participants add the group's registration or just some of the participants' registrations (including add ons) to the cart and check out.

We will also need a way for the participants to get notified when they've been added to a group, but have yet for their registration to be paid.

Is that all do-able using front end exp:channel:form tags? Any pointers, tips or show stoppers in this?

Thank you!!

Ps. If we should have gone with Cartthrob, let me know too! Not too late to switch.

# Answer
Yes, this is completely doable with Store and I have done it myself in the past. The big issue with the modifiers is if you want to customize the look and feel of the fieldtype. If you want to do that, you will have to match the submission structure of data.

The Store fieldtype is setup to make it very easy to enter product details, but if you want to customize this in Channel Form, that is where you would need to do some custom tweaking.
> 1 votes

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


# Question
Title: Super Search search between two channels
Here writing again because I do not know how to solve a problem.

I'm using Super Search and trying to search inside a channel using a keywords from other channel:

```
{exp:channel:entries channel="channel-1" limit="1"}

    {exp:super_search:results channel="channel-2" search="keywords={channel-1-custom-field}"}
        {title}</br>
        {channel-2-custom-field}
    {/exp:super_search:results}

{/exp:channel:entries}

```

`{super_search_total_results}` works and gets the number of results. I want to know how to get `{channel-2-custom-field}` and `{title}` from channel 2.

Thanks in advance.

# Answer
> 1 votes
Since Super Search uses the same Library as the `{exp:channel:entries}` tag pair, they share similar variable names. The outer `{exp:channel:entries}` tag pair would parse first, followed by the inner `{exp:super_search:results}` tag. This would be why `{title}`, for example, parses to the outer `{exp:channel:entries}` value.

In other words, the issue is similar to nesting two `{exp:channel:entries}` tag pairs inside each other: you can't do that, or at least EE won't parse correctly.

One way around this is to place the `{exp:super_search:results}` code in an embed tag (and pass your `{channel-1-custom-field}` variable in the embed). This avoids parsing order issues and variable clashes.

---
Tags: solspace, supersearch
---


# Question
Title: "Invalid Conditional" error if relationship :count is 0 in conditional?
I'm getting an error if my relationship field does not have any related entries selected:

> You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.
>
> Parser State: Invalid Condition: Not enough operands for operator ” \> “.

The code throwing the error:

```
{if {select_testimonials:count} > 0} <--conditional open

      {select_testimonials} <--relationship field open

        {select_testimonials:testimonial} <--relationship:matrix field open

            <div class="testimonial">...stuff...</div>

        {/select_testimonials:testimonial} <--relationship:matrix field close

      {/select_testimonials} <--relationship field close

{/if} <--conditional close

```

What I'm trying to do here is only show this if there are related entries selected (I don't want an empty div if not).

If the relationship filed does have entries selected, everything works as expected.

What would be causing this error?

I have also tried removing everything but the conditional, and I still get the error, like this:

```
{if {select_testimonials:count} > 0} <--conditional open

{/if} <--conditional close

```

# Answer
> 1 votes
Since the version 2.9 of eecms, the expected format for conditionals is `{if var:count > 0}`. Some addons make necessary to use `{if "{var:count}" > 0}`, but just because of the way the developer coded the addon.

As the conditional is related to a 1st party module, probably the first option will work fine. Please, try:

```
{if select_testimonials:count > 0}
    [...]
{/if}

```

---
Tags: matrix, relationships, conditionals, count
---


title: related tag entries not working

text:
# Question
Title: related tag entries not working
```
{exp:stash:set_list name="related_skus" parse_tags="yes"}
    {exp:tag:related_entries channel="men_clothing" tag="t shirt" orderby="title" sort="asc" limit="6" paginate="bottom"}
            {exp:switchee variable="{channel_short_name}" parse="inward"}
                {case value="men_clothing"}
                    {stash:related}
                    <div class="each_ritems">
                        <div class="ritems_img">
                          {men_clothing_image limit="1"}<a class="image" href="{path='shop/product/{channel_short_name}/{url_title}}" title="View more"> <img src="{image:url:small}" alt=""></a>{/men_clothing_image}
                        </div>
                        <div class="each_rwrapper">
                          <div class="ritems_title">{exp:stash:get name="small_title"}</div>
                          <div class="ritems_price"> From: <div class="sus-rupee">{men_clothing_vendor:lowest column="mc_sales_price"}</div> To <div class="sus-rupee">{men_clothing_vendor:highest column="mc_sales_price"}</div></div>
                          <div class="ritems_details">{title}</div>
                        </div>
                    </div>
                    {/stash:related}
                {/case}
            {/exp:switchee}
    {/exp:tag:related_entries}
{/exp:stash:set_list}

{exp:stash:get_list name="related_skus"}
      {related}
{/exp:stash:get_list}

```

i have tried this without Stash and passing channel name and nothing is working. need your expert advice

# Answer
tag:related\_entries accepts an `entry_id` parameter, not a `tag` parameter. This is because it looks for entries which have many shared tags in common to the entry you pass to it. (Hence, entries which are "related.")

If you simply want to display a list of entries which belong to a specific tag, use tag:entries instead.
> 1 votes

---
Tags: tags
---


# Question
Title: Search form to go directly to entry if exact keyword entered
I have a search form that searches based on keywords (which are essentially series of serial numbers for a product) in a channel field. I would like search to go directly to entry if a valid keyword is entered in search. User would only be taken to `search_results_serial` template if an invalid keyword is entered that isn't found in the keywords on channel field.

Here's the search code:

```
{exp:search:simple_form channel="pages" category="1" no_result_page="site/search_no_results" result_page="site/search_results_serial" search_in="entries"}
    <form action="#" method="get">
        <label for="serial">SERIAL NUMBER</label>
        <div class="form-search">
            <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" class="input-text">
            <button class="button" title="Search" type="submit"><span><span>Search</span></span></button>
        </div>
    </form>
{/exp:search:simple_form}

```

Any help is much appreciated. Thank you in advance.

UPDATE: Added custom plugin

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

class search_redirect {

    public function __construct()
    {
        $search_id = substr(ee()->uri->query_string, 0, 32);
        $query = ee()->db->query("
            SELECT keywords
            FROM exp_search
            WHERE search_id = '".ee()->db->escape_str($search_id)."'");
        if($query->num_rows() == 1)
        {
            $keywords = $query->row('keywords');

            // Say your custom field which contains your serial number is field_id_10 (look in exp_channel_fields)
            $entry = ee()->db->query("
                SELECT t.entry_id, t.url_title
                FROM exp_channel_titles t
                LEFT JOIN exp_channel_data d
                ON t.entry_id = d.entry_id
                WHERE d.field_id_27 = '".ee()->db->escape_str($keywords)."'
                LIMIT 1");
            if($entry->num_rows() == 1)
            {
                // Assuming you display your product at product/index
                ee()->functions->redirect(
                    ee()->functions->create_url('/product/'.$entry->row('url_title'))
                );
                exit();
            }
        }
    }
}

/* End of file pi.plugin_name.php */
/* Location: ./system/expressionengine/third_party/plugin_name/pi.search_redirect.php */

```

And added to search results template:

```
{embed="embeds/head"}
{embed="embeds/header"}

        <!-- START Main Content -->

        <div class="main-container col2-left-layout">
            <div class="main">
                <div class="col-main">
                    <div class="breadcrumbs">
                        <ul>
                            <li class="home"><strong>Search Results >></strong></li>
                        </ul>
                    </div>
                        <article id="content">
                        <div class="parts_table">
                          <table>
                              <tr>
                                <th>Support Documentation</th>
                                <th>Support Page Link</th>
                                <th>Serial Number Searched</th>
                              </tr>
                          {exp:search_redirect}
                          {exp:search:search_results}
                              {if count == 1}
                                <p>You searched for serial number '<strong>{exp:search:keywords}</strong>' and got {exp:search:total_results}{total_results}{/exp:search:total_results} result{if "{exp:search:total_results}" != 1}s{/if}. {if {total_results} == 1}You got an exact match!</p>{if:else}<p>Too many results? <a style="text-decoration:underline;" href="{site_url}machine-support">Try searching again with a valid serial number</a> <strong><span></p>{/if}
                              {/if}
                              <tr>
                                <td><b><a href="{page_url}">{title}</a></b></td>
                                <td><a href="{page_url}">View Support Page</a></a>
                                <td>{exp:search:keywords}</td>
                              </tr>

                              {if count == total_results}
                                  </table>
                              {/if}

                              {paginate}
                                  <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
                              {/paginate}

                          {/exp:search:search_results}
                          </table>
                        </div>
                    </article>

                </div>
{embed="embeds/sidebar_nav_left"}
            </div>
        </div>
        <!-- END Main Content -->

{embed="embeds/footer"}

```

# Answer
> 1 votes
One note first: you don't need to add a manual `form` tag inside of the `search:simple_form` tag - it generates its own.

The best way to do this (since the Search module doesn't have great extension hooks) is to add some custom code on the search result page. This would be best done in a custom plugin.

You'd grab the keywords based on the search query in the URL, then use that to perform query for a matching serial number, and if found, do a redirect to that entry's URL.

Some quick, untested code for inside your plugin:

```
$search_id = substr(ee()->uri->query_string, 0, 32);
$query = ee()->db->query("
    SELECT keywords
    FROM exp_search
    WHERE search_id = '".ee()->db->escape_str($search_id)."'");
if($query->num_rows() == 1)
{
    $keywords = $query->row('keywords');

    // Say your custom field which contains your serial number is field_id_10 (look in exp_channel_fields)
    $entry = ee()->db->query("
        SELECT t.entry_id, t.url_title
        FROM exp_channel_titles t
        LEFT JOIN exp_channel_data d
        ON t.entry_id = d.entry_id
        WHERE d.field_id_10 = '".ee()->db->escape_str($keywords)."'
        LIMIT 1");
    if($entry->num_rows() == 1)
    {
        // Assuming you display your product at product/index
        ee()->functions->redirect(
            ee()->functions->create_url('/product/'.$entry->row('url_title'))
        );
        exit();
    }
}

```

So then you'd just put this in your search results template:

```
{exp:my_custom_plugin}

```

---
Tags: simple-search
---


title: Using Stash image alone not displaying

text:
# Question
Title: Using Stash image alone not displaying
I'm new to the EE using stash i'm getting the output for other fields only image is not displaying. I'm using the stash version 2.6.1. If any one help me to solve the issue it would be grateful!!!

```
{exp:stash:set_list name="product-list" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="gshopper_Dresses" limit="5" orderby="date" disable="member_data[pagination|categories" dynamic="no"}
        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:p_name}{product_name}{/stash:p_name}
        {stash:description}{product_description}{/stash:description}

        {exp:stash:set_list:nested name="prod_image" parse_tags="yes" parse_depth="2"}
            {photos}
               {stash:p_images}{product_images}{/stash:p_images}
            {photos}
        {/exp:stash:set_list:nested}

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

{exp:stash:parse process="end"}
    {exp:stash:get_list name="product-list" orderby="date" sort="asc" limit="5"}
        <div>
            <h2>{entry_id}:{p_name}</h2>
        </div>
        <div>
            {exp:stash:get_list:nested name="prod_image" unique="yes" parse_depth="2"}
                <img src="{site_url}themes\default_site\image\{product_images}">
            {/exp:stash:get_list:nested}
        </div>
        <div>
            {description}
        </div>
    {/exp:stash:get_list}
{/exp:stash:parse}

```

# Answer
> 0 votes
It looks like you might have a misnamed stash variable. When getting the list "prod\_image" you have a variable called {product\_images} when it should be {p\_images}.

---
Tags: stash, image-path
---


title: Channel form date picker issue

text:
# Question
Title: Channel form date picker issue
i recently upgraded to expression engine from 2.6.2 and 2.8.2 and made the change to channel forms from safecracker.Everything went well and the forms are working fine but I am having a issue with my date picker field. It still works but seems to have lost the path to its style and im not sure what to change to fix this. See picture below

Any help is greatly appreciated

# Answer
Link to the CSS.

From the docs: https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/#including-assets
> 0 votes

---
Tags: safecracker, date
---


# Question
Title: Can you completely disable members on the frontend?
Each time a template is loaded in ExpressionEngine is goes through a couple of member related tasks (as far as I can see):-

1. Is this user in a blacklist? `Addons_model::module_installed()`
2. Grab the current session data `EE_Session::fetch_session_data()`
3. Get the information about the current member `EE_Session::_do_member_query()`
4. Update the session information with this new visit `EE_Session::update_session()`
5. Fetch the CSRF token `Csrf_database::fetch_token()`

I found the above behaviour in the output, so perhaps they don't even run the above processes for the normal guest user.

But assuming a couple or all of them do - it seems quite heavy handed for a site that doesn't require memberships.

Is there a way to disable this?

# Answer
> 1 votes
My understanding is, basically, no but it should not matter too much.

You **can** remove/uninstall the Members module but it does not actually remove most of the member related tables and it doesn't control most of the queries which are sprinkled throughout core code and do not appear to be controlled by any global setting.

You also cannot disable sessions in EE, which is what most of what you are seeing is actually setting up. Even if there were a way to disable sessions, likely many add-ons would fail to work because many, many extensions hook into the sessions\_start or sessions\_end hooks and use them to do things completely unrelated to sessions.

However, I doubt that the performance penalty for these queries is very high -- in all likelihood if there are no members in the system then there is very little or no data to be returned by all of the Member related queries.

# Answer
> 0 votes
I am not sure if you can disable any member related functionality site-wide, but you can definitely disable it on the channel entries level, with something like this:

`{exp:channel:entries disable="member_data"}`

This should remove querying additional member related data that you are not using in your channels.

See: https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html#disable

---
Tags: members, performance, optimization
---


# Question
Title: How to Use assets_ignore_folder_patterns on the config
I would like to exclude multiple folders from the Asset list to minimize the amount of folders to be loaded.

I can't seem to get this config working. and there's not enough info available on the website.

Thank you.

# Answer
> 0 votes
Try something like

```
$config['assets_ignore_folder_patterns'] = array('/^cache');

```

---
Tags: assets
---


# Question
Title: Structure Navigation Showing Hidden Entries
I have what seems like a pretty straightforward Structure navigation menu, but for some reason, the entries that "Hide from Nav?" set to "Yes" are still displaying in the navigation.

The page is even labelled as "(hidden)" in the Structure interface, but still it shows up in the navigation.

Is there something wrong with my code?

```
<div class="nav-menu">
{exp:structure_entries depth="2" current_class="active"}
    {if {count} ==1}<ul id="top-nav" {if {current+child}==1}class="active" {/if}>{/if}
    {if {depth} == 1}
        {!-- Top Level --}
        <li>
            <a href="#">{title}</a>
        {if {children_total} == 0}{!-- No Children - so close markup --}</li>{/if}
        {if:else}{!-- Children (not top level) --}
            {if {sibling_count} == 1}
                {!-- First child - so open markup --}
                <div class="subnav-dropdown">
                    <ul class="level{depth} subnav">
            {/if}
                        <li>
                            <a href="{page_uri}">{title}</a>
                            {close_markup}
                        {if {total_children} == 0 || {depth} == {restricted_depth}}</li>{/if}
                    {if {last_sibling} && {sibling_count} == {sibling_total}}
                    </ul>
                </div>
        </li>{/if}
        {/close_markup}{/if}
    {if {count}=={total_results}}</ul>{/if}
{/exp:structure_entries}
</div>

```

# Answer
> 1 votes
I'll hazard a guess here and say that the reason your "Hidden from Nav" entries are being output is because you're not actually using a Structure module tag, but the *Structure Entries plugin.*

I'm not sure what kind of support Structure Entries has for Structure's Hidden from Nav feature. What version are you using? It sounds like there is a beta version that has a `hide_from_nav="yes"` parameter. There is a link to the beta v1.3.4 on its devotee page.

This Structure Entries support thread might also help.

A possible alternative would be to switch your template to use the Structure module's `{exp:structure:nav}` tag or another of the Structure module's tags.

---
Tags: templates, structure, navigation
---


title: DataGrab - is there a hook?

text:
# Question
Title: DataGrab - is there a hook?
Is there a hook at the completion of a DataGrab import? I need to run a script after an import.

# Answer
> 1 votes
It looks like DataGrab has three hooks:

* `ajw_datagrab_pre_import`
* `ajw_datagrab_modify_data`
* `ajw_datagrab_post_import`

If you open up `datagrab_model.php` and search for `active_hook` you will find them.

I haven't ever used them myself and I don't see any documentation on them. But they're worth a shot!

And as the developer himself pointed out in his comment below, the one you are after is `ajw_datagrab_post_import` so it sounds like you're in business.

---
Tags: hook, datagrab
---


title: Add-on for inserting Google Map embed?

text:
# Question
Title: Add-on for inserting Google Map embed?
I'm wondering if there's an add-on out there-- or perhaps an altogether different approach-- for allowing a user to easily insert a Google map embed (`iframe`) based on an address? I have a channel dedicated to "favorite destinations" with fields for name, address, etc. and currently prompt the user to copy and paste the corresponding Google map embed code into the appropriate field when publishing an entry. This approach is of course not ideal, as there is considerable margin for error with a user inputting actual markup, and I'm trying to figure out the easiest approach here to simplify the user's process.

I see that Objective HTML has the Google Maps for ExpressionEngine add-on, but I'm not sure if it allows for this sort of functionality--i.e. auto-generating the iframe embed code corresponding to a specific address and inserting it into the proper `div` in a template?

Thanks for any guidance here.

# Answer
> 2 votes
The short answer to your question is yes Google Maps for EE would be able to do exactly what you want to do.

You would add the included fieldtype to your channel which would allow a user to enter the address and find the correct location. Then in your template you would need to add the appropriate template tags to achieve what you are looking for.

You can see a bunch of examples here

---
Tags: channel-entries, add-on, google-maps-for-ee
---


# Question
Title: Solspace Calender Filtering events by category
I am using the demo templates from Solspace and having a bit of trouble getting filtering working. I have one calendar and I want to be able to filter the events based on a category. I can't get it to work. Do I need to create a calendar for every type of category and then just link to each calendar?

# Answer
> 1 votes
No, you definitely do not need to create a calendar for every type of category. You can put all the events into one calendar and filter by category. Just use the category parameter on the `{exp:calendar:events}` tag.

```
{exp:calendar:events category="1"}

```

Instead of hardcoding the category ID you'll probably want to pass it in via a segment variable. Depending on how you are building your URI's you might find Low Seg2Cat pretty useful.

If that's what you are already trying then please post some template code and I or someone else might be able to give you a more specific answer.

# Answer
> 0 votes
I've used Dynamic Parameters for filtering channels. I'm thinking you can do the same with Category.

https://ellislab.com/expressionengine/user-guide/add-ons/channel/dynamic\_parameters.html

---
Tags: categories, solspace, filter
---


# Question
Title: Limiting Store shipping country list to those with shipping rules
We have a client with an Expresso Store install where they have specified shipping rules for certain countries only and wish to add more as and when they have time.

```
<select id="shipping_country" name="shipping_country" class="form-control">
{shipping_country_options}
</select>
{error:shipping_country}

```

Is there a way to have the shipping country list determined by those with shipping rules? For example I have the following UK shipping rules set up:

However despite only have shipping rules pertaining to the UK other countries still show up in the country select list for shipping.

# Answer
Well technically you have shipping rules setup for every country since you have a rule with the country set as "Any".

IF you are only shipping to a few different countries you have a few options. You can either build the option list out yourself.

Something along the lines of:

```
<select id="shipping_country" name="shipping_country" class="form-control">
 <option value="">Select a country</option>
 <option value="USA">United States</option>
 <option value="GRB">Great Britain</option>
</select>
{error:shipping_country}

```

With this approach Store is still technically allowed to take orders from any country but your options will be limited to what you manually code into your templates. If you add a new country you need to modify your template. I have seen people get around this with a Low Variables filed in the past where they would allow the admin to select multiple countries then output the select by looping though the checked countries.

Store also has the ability to disable certain countries. For example if you are selling liquor in the US you usually can't ship to other countries so you could goto Store \> Settings \> Counties / States menu and disable all of the countries that you don't want to ship to. This will automatically update your templates if you enable a new county if you are using the `{shipping_country_options}` helper tag. You would still need to create the shipping rules for each new country though.
> 1 votes

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


# Question
Title: Using stash to render custom field value rather than string literal
# Use case

The front page of a site has a region that should display the most recent item of featured content. Since this content can come from various channels, it needs to display custom channel fields depending on the channel that it originates from.

## Approach

I'm trying to output the value of a custom field using stash but am only able to output the literal value of the variable. I'm using example code found on the stash repo at: https://github.com/croxton/Stash/wiki/Mapping-custom-fields-to-a-common-nomenclature

So my code looks like:

```
{!-- make a list of your channel prefixes --}
{exp:stash:set_list name="channels"}
    {stash:channel}article{/stash:channel}
    {stash:channel}book{/stash:channel}
    {stash:channel}project{/stash:channel}
    {stash:channel}service{/stash:channel}
{/exp:stash:set_list}

{!-- make a list of your common field suffixes --}
{exp:stash:set_list name="fields"}
    {stash:field}subtitle{/stash:field}
    {stash:field}year{/stash:field}
    {stash:field}description{/stash:field}
    {stash:field}body{/stash:field}
    {stash:field}image{/stash:field}
{/exp:stash:set_list}

{!-- map channels and fields to generate tag pairs --}
{exp:stash:set name="mapped_fields" parse_tags="yes" parse_depth="2" type="snippet"}
   {exp:stash:get_list name="fields"}
      {stash:{field}}
         {exp:stash:get_list:nested name="channels"}
            {{channel}-{field}}
         {/exp:stash:get_list:nested}
      {/stash:{field}}
   {/exp:stash:get_list}
{/exp:stash:set}

{!-- capture the data --}
{exp:stash:set parse_tags="yes" type="snippet"}
   {exp:channel:entries channel='{exp:stash:get_list name="channels" backspace="1"}{channel}|{/exp:stash:get_list}' parse="inward"}

   {mapped_fields}

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

```

...

```
{exp:channel:entries status="Front page featured" orderby="date|edit_date" sort="desc" limit="1" }

    {title} <br>

    {exp:stash:get name="subtitle"}

{/exp:channel:entries}

```

Outputs:

```
Dr. Strangelove or:
{project-title}

```

Where `{project-title}` should render `How I Learned to Stop Worrying and Love the Bomb`

## Edit

I've moved my channel entries to a stash embed and now calling the `{subtitle}` variable doesn't evaluate. However, calling `{mapped_fields}` returns:

```
{stash:subtitle}How I Learned to Stop Worrying and Love the Bomb{/stash:subtitle}
{stash:description}Dr. Strangelove, is a 1964 black comedy film that satirizes the cold war fears of a nuclear conflict between the USSR and the US. The film was directed, produced, and co-written by Stanley ...{/stash:description}

```

But, I'm unable to access these values as individual variables within my view template.

## Edit 2

My current embedded view template looks like the following:

```
{exp:channel:entries status="Front page featured" orderby="date|edit_date" sort="desc" limit="1"}

    {subtitle}<br>

    {mapped_fields}

{/exp:channel:entries}

```

I've tried variations on the variable syntax including `{exp:stash:get name="subtitle"}` and `{exp:stash:get name="subtitle" type="snippet"}` as well as wrapping the channel entries tag w/ `{exp:stash:parse process="end"}`

Strangely, if I have a channel prefix where the channel doesn't have a corresponding field, e.g., `service-subtitle` then that will render `{service-subtitle}` in the view when calling `{subtitle}`.

## Edit 3

Here's a test example that simplifies template architecture and produces similar results as described above.

### test.group - index.html

```
{!-- make a list of your channel prefixes --}
{exp:stash:set_list name="channels"}
    {stash:channel}article{/stash:channel}
    {stash:channel}book{/stash:channel}
    {stash:channel}project{/stash:channel}
{/exp:stash:set_list}

{!-- make a list of your common field suffixes --}
{exp:stash:set_list name="fields"}
    {stash:field}subtitle{/stash:field}
    {stash:field}description{/stash:field}
    {stash:field}body{/stash:field}
    {stash:field}image{/stash:field}
{/exp:stash:set_list}

{!-- map channels and fields to generate tag pairs --}
{exp:stash:set name="mapped_fields" parse_tags="yes" parse_depth="2" type="snippet"}
   {exp:stash:get_list name="fields"}
      {stash:{field}}
         {exp:stash:get_list:nested name="channels"}
            {{channel}-{field}}
         {/exp:stash:get_list:nested}
      {/stash:{field}}
   {/exp:stash:get_list}
{/exp:stash:set}

{!-- capture the data --}
{exp:stash:set parse_tags="yes" type="snippet"}
   {exp:channel:entries channel='{exp:stash:get_list name="channels" backspace="1"}{channel}|{/exp:stash:get_list}' parse="inward"}

   {mapped_fields}

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

{!-- embed the view --}
{stash:embed:test}

```

### stash\_templates - test.html

```
{exp:channel:entries status="Front page featured" orderby="date|edit_date" sort="desc" limit="1"}

    {subtitle}<br>

    {mapped_fields}

{/exp:channel:entries}

```

### Rendered result (in browser)

> {subtitle}
>
> {stash:subtitle} Test subtitle {/stash:subtitle} {stash:description}
>
> Test description {/stash:description} {stash:body} {book-body}
>
> Test body {/stash:body} {stash:image} {/stash:image}

# Answer
There's no sense in running channel entries twice.

This code generates a bunch of stash capture pairs, mapping field names in different channels to a common name:

```
{!-- make a list of your channel prefixes --}
{exp:stash:set_list name="channels"}
    {stash:channel}article{/stash:channel}
    {stash:channel}book{/stash:channel}
    {stash:channel}project{/stash:channel}
{/exp:stash:set_list}

{!-- make a list of your common field suffixes --}
{exp:stash:set_list name="fields"}
    {stash:field}subtitle{/stash:field}
    {stash:field}description{/stash:field}
    {stash:field}body{/stash:field}
    {stash:field}image{/stash:field}
{/exp:stash:set_list}

{!-- map channels and fields to generate tag pairs --}
{exp:stash:set name="mapped_fields" parse_tags="yes" parse_depth="2" type="snippet"}
   {exp:stash:get_list name="fields"}
      {stash:{field}}
         {exp:stash:get_list:nested name="channels"}
            {{channel}-{field}}
         {/exp:stash:get_list:nested}
      {/stash:{field}}
   {/exp:stash:get_list}
{/exp:stash:set}

```

The **{mapped fields}** variable would then be set to this value (formatted for legibility). Verify this is the case by looking in your template debug output for a line beginning `Stash: SET mapped_fields to value ...`

```
{stash:subtitle}
   {article-subtitle} {book-subtitle} {project-subtitle}
{/stash:subtitle}

{stash:description}
    {article-description} {book-description} {project-description}
{/stash:description}

{stash:body}
    {article-body} {book-body} {project-body}
{/stash:body}

{stash:image}
    {article-image} {book-image} {project-image}
{/stash:image}

```

Now you just need to use this variable when capturing your channel entry data. Note the `dynamic="no"`.

```
{exp:stash:set type="snippet" parse_tags="yes"}
    {exp:channel:entries
        status="Front page featured"
        orderby="date|edit_date"
        sort="desc"
        limit="1"
        dynamic="no"
        disable="member_data|categories|pagination"
    }
        {mapped_fields}
    {/exp:channel:entries}
{/exp:stash:set}

```

You then include the stash embed like so (this would be better at the top the of your template, but no matter). A native layout would also work just the same.

```
{stash:embed:test}

```

In your embed you can now access your 'Front page featured' content like so:

```
Subtitle: {subtitle}
Description: {description}
Body: {body}
Image: {image}

```
> 5 votes

---
Tags: stash
---


title: Restrict Members to their own files

text:
# Question
Title: Restrict Members to their own files
I want to have members register, then be able to publish content to a channel. That works fine, however when a user accesses the file manager to upload an image they have access to all images uploaded to that channel entry.

How do I restrict each user access to only the images they upload? Thanks,

# Answer
Here is one approach:

1. Put the users in a member group that has the member preference "*Can edit entries authored by others*" set to "*No*"
2. Use Channel Images or Channel Files to manage the file uploads. These add-ons have per-entry file management, so they will create separate directories per Channel entry.

This combination effectively makes it so that members (at least in the group of interest) are only able to access files they have uploaded themselves.
> 5 votes

# Answer
I don't think ExpressionEngine will allow such behaviour out of the box although the exp\_files table 'does' include a 'uploaded\_by\_member\_id' column so it's possible that you could leverage that through a custom file select field type to limit what the user can pick from.
> 1 votes

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


# Question
Title: How do I limit content display based on Categories selected?
Under most circumstances this would be an easy answer, but I have a slightly trickier segment I am working with.

The following code displays the category names if they are selected in the entry:

```
<div class="project-brief open-close">
    <h3>Results Type</h3>
    <div>
        <div class="project-brief">
            <ul class="brief-list">
                <?php  $parents= array(); ?>
                {categories show_group="5"}
                <?php $parent_id = '{parent_id}'; if(!$parent_id) {$parents ['{category_id}'] = '{category_name}';} ?>
                {/categories}

                <?php foreach ($parents as $key => $parent) { ?>
                <li><a href="/projects?category=<?php echo $key; ?>"><?php echo $parent; ?></a>
                    <ul class="brief-list-childs">
                        {categories show_group="5"}
                        {if parent_id == <?php echo $key; ?>}<li><a href="/projects?category={category_id}">{category_name}</a></li>{/if}
                        {/categories}
                    </ul>
                </li>
                <?php } ?>

            </ul>
        </div>
    </div>
</div>

```

However, the client wants to hide the entire section if none are selected in the entry.

I want to wrap the entire div in a conditional that checks to see if any of the categories are checked and display it only if it is not empty.

I would say it like this, but I can't seem to get the conditional right. Any guidance will be appreciated.

```
{If category count > 1}
   ... display the content
{/if}

```

# Answer
Not sure if this still works but might be worth a try:

```
{if "{categories}{category_name}{/categories}" != ""}

```

via: https://ellislab.com/forums/viewthread/136676/#673690
> 2 votes

---
Tags: conditionals, advanced-conditionals
---


# Question
Title: Is it possible to set the return email address based on user input?
So if the user enters their e-mail as part of the form that's submitted, and the administrator gets a notification, could that notification's "reply to" field be from the e-mail that was submitted?

This would be convenient because if the person notified wanted to reply to the user, they'd just hit reply, instead of having to copy/paste the e-mail into the e-mail field.

Currently notification "from e-mail" field is always set to the e-mail address that's set in Admin / Email Config / Return email address for auto generated emails.

# Answer
Sure you can add the field in the Reply to Email field in your notifications template. For example I use {email} which is the field I have set up to capture their email.
> 2 votes

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


# Question
Title: Stock Levels Disappear after adding to Side Cart
Seem to have something in-correct. As soon as I add a product to the side cart all stock levels disappear from the front end. So your unable to tell if any ticket stock levels of other tours are available.

I have 4 tours, each with an Adult and Child Ticket available with 10 stock each. Limit stock is ticked in the channel's field.

**Here is what I have...**

```
 {exp:store:product
  entry_id="{entry_id}"
 }

     <ul>
        <li><strong>Tickets available:</strong> <span class="store_product_stock"><!-- automatically set --></span>
        <li><strong>Price:</strong>
            {if on_sale}
                <del>{regular_price}</del><br />
                {price}
                <span class="label label-success">Save {you_save} ({you_save_percent}%)</span>
            {if:else}
                {regular_price}
            {/if}
        </li>
     </ul>

    {modifiers}

            <label class="control-label" for="{modifier_input_name}"><strong>{modifier_name}: </strong></label>
                {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
                        {modifier_options}
                                    <label><input type="radio" name="{modifier_input_name}" value="{option_id}" /> {option_name} {if price_mod_val} ({price_mod}) {/if}</label>
                        {/modifier_options}
                {if:else}
                    <input type="text" id="{modifier_input_name}" name="{modifier_input_name}" value="" />
                {/if}
                {if modifier_instructions}<p class="help-block">{modifier_instructions}</p>{/if}

    {/modifiers}

        <label for="item_qty"><strong>Quantity: </strong></label>
        <input type="text" id="item_qty" name="item_qty" class="input-mini" value="{min_order_qty}" />

       <input type="submit" name="submit" value="Purchase Tickets" class="button expand" />

{/exp:store:product}

```

# Answer
> 0 votes
Update to this, Brad pointed me in the right direction...

The javascript method can only be used on a single product page. Try using {total\_stock} instead.

Worked perfectly.

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


# Question
Title: Using Playa field to order channel entries list
I tried ordering a channel entries tag pair by a playa field (that is single entry relationship), like so:

{exp:channel:entries channel="channel\_name" orderby="playa\_field\_name" sort="asc"} looped stuff goes here {/exp:channel:entries}

What I got was in some sort of order, but it wasn't alphabetical according to the titles of the related entry. I think it's sorting according to the information hardcoded into the database for that playa field, which would sort it according to the entry\_id of the related field because the text in the database starts with the entry id in brackets. This is my theory anyway.

Surely I can't be the first person to run across this problem. Any thoughts?

# Answer
> 3 votes
Probably the order is the order in which the relationships were created; this at least would be the case for the native EE-relationships. I assume with playa it is the same.

From the docs:

> Ordering by a Relationship field will cause entries to appear in the order the relationships were made, not based on any content from the related entries.

# Answer
> 0 votes
The only way I can think to address this is to do some kind of post save processing to save a text string representing the title of the related entry to a custom searchable field. :/

---
Tags: playa, orderby
---


# Question
Title: entry "status" not honoured on import [json / solspace importer]
When I import a json file the Status is neglected. All imported items have the status "Closed" after an import when the value of the imported status field is set to "Open" and I have tried "open" just like in the docs. The import is completing successfully but the status setting is not being honoured. The status field is being recognised in the import profile settings.

Hope someone can help :)

(EE2.9.2 / importer 2.2.5)

# Answer
> 1 votes
Apparently I did not have the default status group linked to that particular channel. That why Importer could not apply the 'Open' status...

# Answer
> 0 votes
If you are just looking to fix up your imported data one time and don't need to repeat the import the simplest solution might be a quick SQL query. :)

---
Tags: solspace-importer
---


# Question
Title: Assets images and Content Elements with conditionals to control number of images displayed
This is probably really simple to solve but I've got stuck in a dead end. I want to allow users to upload single or multiple images using an Assets image field (resizing with CE Image) within a Content Elements panel, and then display *all* thumbnails if there's more than one image. Then I use content switcher jQuery to swap out the images. Simple? Not really.

The only way I could find to show all thumbnails if more than a single image was to use the Assets variable 'total\_files' in a conditional, not 'count'. Using '{if count \> "1"}' only thumbnails for images excluding the first image were shown, using {if count \>="1"} showed all thumbnails, but also showed a single thumbnail when only one image was present. But, using '{if total\_files \> "1"}' does show all thumbs however I can't now stop all the large images from displaying. I need to find a way to limit the large image displayed to a single image but I just can't seem to solve it. If anyone can point me in a new direction to solve this I'll be very grateful.

Here's my current rather messy code:

```
        <!--IMAGE SLIDESHOW IN BODY-->
    {assets}
    <div class="article-image">

    {files kind="image"}

    {exp:ce_img:pair src="{url}" width="800" height="400"}

            <div id="switcher-panel"></div><!--/#switcher-panel to swap out images from thumbs-->

            {if total_files == "1"}

                    <div id="{name}-content" class="switcher-content show"><a class="switcher">{exp:ce_img:single src="{url}" width="800" height="400" crop="yes"}</a>
                    <div class="image-credit-hover">{title} | {author} | {location}</div>
                    </div>

            {/if}

            {if total_files > "1"}

                    <div id="{name}-content" class="switcher-content show"><a class="switcher">{exp:ce_img:single src="{url}" width="800" height="400" crop="yes"}</a>
                    <div class="image-credit-hover">{title} | {author} | {location}</div>
                    </div>

                    <div class="article-image-thumbs">
                    {exp:ce_img:bulk src="{url}" width="120" height="90" crop="yes" attributes ='style="float:left;margin:0 auto;"'}<a id="{name}" class="switcher"><img src="{url}" alt="" width="{width}" height="{height}"  /></a>
                    {/exp:ce_img:bulk}
                    </div>

                    <div id="{name}-content" class="switcher-content">
                    <a>{exp:ce_img:single src="{url}" width="800" height="400" crop="yes"}</a>
                    <div class="image-credit-hover">{title} | {author} | {location}</div>
                    </div>

            {/if}

            {/exp:ce_img:pair}

    {/files}
    </div>
    {/assets}

```

# Answer
It's always the way - you solve you're own question after posting but Ive left it up in case anyone else might struggle with this for some reason. I got it to work with the following code, a mixture of 'total\_files' and limiting entry numbers in the assets/files variable. It doesn't seem tidy, but it does work. (NB Im not using Content Elements built in Gallery field as it doesn't have easy meta data input and isn't consistent image handling for my users.)

```
        <!--IMAGE SLIDESHOW IN BODY-->
            {assets}
            <div class="article-image">

            {files kind="image" limit="1"}

                <div id="{name}-content" class="switcher-content show">
                <a>{exp:ce_img:single src="{url}" width="800" height="400" crop="yes"}</a>
                <div class="image-credit-hover">{title} | {author} | {location}</div>
                </div>

            {/files}

            {files kind="image" limit="10"}

            <div id="switcher-panel"></div><!--/#switcher-panel to swap out images from thumbs-->

            {if total_files > "1"}

                {exp:ce_img:pair src="{url}" width="800" height="400"}
                <div class="article-image-thumbs">
                {exp:ce_img:bulk src="{url}" width="120" height="90" crop="yes" attributes ='style="float:left;margin:0 auto;"'}<a id="{name}" class="switcher"><img src="{url}" alt="" width="{width}" height="{height}"  /></a>
                {/exp:ce_img:bulk}
                </div>

                <div id="{name}-content" class="switcher-content">
                {exp:ce_img:bulk src="{url}" width="800" height="400" crop="yes" attributes ='style="float:left;margin:0 auto;"'}<a id="{name}" class="switcher"><img src="{url}" alt="" width="{width}" height="{height}"  /></a>
                 <div class="image-credit-hover">{title} | {author} | {location}</div>
                {/exp:ce_img:bulk}
                </div>
                {/exp:ce_img:pair}

            {/if}

            {/files}
            </div> <!--/.article-image-->
            {/assets}

```
> 1 votes

---
Tags: assets, ce-image, content-elements
---


title: Asterisk next to channel entry title

text:
# Question
Title: Asterisk next to channel entry title
When I review channel entries from the admin control panel, menu: "Content-\>Edit-\>Channel Name", some entries in the list have an asterisk at the end of the title. What does this mean?

# Answer
If an entry has auto-saved data which hasn't been saved manually yet, the entry will be marked with the asterisk you're seeing.
> 3 votes

---
Tags: channel-entries
---


# Question
Title: Using Reports module, need first row of CSV to be custom
I am using Nathan Pitman's Reports module to allow our client to export some custom information. I wrote up the SQL query and it works great. The only issue I have is that the first row (the header row) uses numbers for the column names, like shown here: http://cl.ly/image/3U2O451s1F3y I'd like to make those show as proper headers that make sense to the client. (For example: Member Group, Email, First Name, Company, etc.)

The Reports module does allow for post-processing but that is where I'm lost. I have no idea how to properly write the PHP to change the header row to what I need the column titles to be. I'd really appreciate some help here.

Query:

```
SELECT
      exp_member_groups.group_title as 'Member Group',
      exp_members.email as 'Email', exp_members.username as 'Username', exp_members.screen_name as 'Screen Name',
      exp_channel_data.field_id_13 as 'First Name', exp_channel_data.field_id_14 as 'Last Name',
      exp_channel_data.field_id_68 as 'OCB Member ID', exp_channel_data.field_id_59 as 'Company'
    FROM exp_channel_data
    JOIN exp_channel_titles ON exp_channel_data.entry_id = exp_channel_titles.entry_id
    JOIN exp_members ON exp_channel_titles.author_id = exp_members.member_id
    JOIN exp_member_groups ON exp_members.group_id = exp_member_groups.group_id
    WHERE exp_channel_data.channel_id = '6'
    AND exp_members.group_id = '11'
    OR exp_members.group_id = '10'
    OR exp_members.group_id = '9'
    OR exp_members.group_id = '8';

```

Thanks!

# Answer
> 0 votes
Ok, try a fresh download from https://github.com/nathanpitman/reports.mod.ee\_addon and see if that works... :)

---
Tags: add-on, php, csv, reports
---


title: Assign Entry to Member

text:
# Question
Title: Assign Entry to Member
As admin, I assigned a Member entry to myself, but after completing that action I was unable to re-assign that entry back to the member. In fact the member's screenname doesn't even show up in the list of Authors anymore. How do I give that entry back to the member?

# Answer
You will need to goto Members \> Member Groups \> \[The member group the member is a question of\] Edit Group \> Scroll down to Member Account Privileges. Look for "Include Members in PUBLISH page multi-author list?" and select "Yes".

You shouldn't need to assign the entry to yourself as an admin though you should be able to edit it fine either way.
> 2 votes

---
Tags: entry, author
---


title: solspace favorite 4.0 if variable

text:
# Question
Title: solspace favorite 4.0 if variable
Just upgraded my solspace favorite to version 4.0.

In favorite version 3 I could use

```
  {if saved}{/if} and {if not_saved}{/if}

```

My question: I want to use a variable to set my css to "active" So if I already added that member to my favorites the link will be red. If not than the link will be blue.

What I tried so far and does not work:

```
  {exp:favorites:info username="{visitor:email}" disable_pagination="yes"}
  {if favorites:favorite_id == "{favorites:favorite_id}"}

```

or

```
  {exp:favorites:members favorites_username="{visitor:email}" disable_pagination="yes"}
  {if favorites_username == "{visitor:email}"}
  <li class="item-1 active"><a href="#">fav</a></li>
  {if:else}
  <li class="item-1"><a href="#">fav</a></li>
  {/if}
  {/exp:favorites:members}

```

Hope someone could point me in the right direction...

Solspace Favorite 4.0.2 Expressionengine 2.9.2

# Answer
To check if a member has been favorited, you would use `{exp:favorites:info}` and check if there are any results (which means the member has been favorited) or not (which means the member has not been favorited). Eg:

```
{exp:favorites:info member_id="3"}
    RED (favorited)
    {if favorites:no_results}
        BLUE (not favorited)
    {/if}
{/exp:favorites:info}

```

As with any "if no\_results"-type conditionals, when that conditional is true, everything outside of the conditional will not parse nor be displayed (which is why "RED" isn't wrapped with anything above).
> 0 votes

---
Tags: solspace
---


# Question
Title: How to disable Editor (DevDemon) for Category Descriptions
I want to completely disable Editor for my Category Descriptions and have it revert back to the simple text area field that ships with EE.

Does anyone know how to do this?

# Answer
All you need to do is "disable" the Editor Extension. That is the only thing the extension does!
> 1 votes

---
Tags: categories, devdemon, editor
---


# Question
Title: Altering item data from store_order_item_add hooks (_start or _end)
I'm not sure if is deliberate, but the way hooks have been implemented in Exp:resso Store don't seem to allow the modification of data?

Using pass by reference has no effect (because of EE's hook calling approach?); any changes made to the data passed in the params is not available in the same variables in the hook calling method.

And there doesn't seem to be any point returning data from the extension method because there is no assignment in the Order model's addItem method, where the hook is called.

Are the hooks designed to expose data for reading-only? If I have to start hacking the Store logic code to add an assignment, or messing about modifying the records in the database, then the likelihood of functionality breaking with an update is high.

I'm disappointed this type of situation wasn't envisioned by the module developers. Why limit the hooks like this?

# Answer
> 2 votes
I have often used `store_order_item_add_end` to modify product attributes. `$item` is an object, and pass by reference does indeed work in this context.

So this code in your extension should change every item's price to $20:

```
$item->price = '20.00';

```

I have several sites doing this for items which I have javascript-driven price configurations for, and for which I want to confirm server-side to protect from being artificially modified in the browser.

# Answer
> 0 votes
What Store hook are you using? You can definitely modify Store data using an extension. Did you try using `$order->save()` ?

For example

```
public function store_order_complete_start($order)
{

    // Save some custom data on the order
    $order->order_custom4 = $my_custom_data;
    $order->save();

    return $order;
}

```

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


title: Can I do math on segment variables?

text:
# Question
Title: Can I do math on segment variables?
I want to build a very simple linear survey with multiple choice questions.

Each answer will be assigned a numeric value and I was hoping to pass that value via segment variables.

So at the end of the survey I could do something like:

segment\_1 **plus** segment\_2 **plus** segment\_3

= (value)

e.g mysite.com/template/01/08/09

would give a numeric value of 18

And then use that value to conditionally display another template.

Is this possible, advisable or just plain crazy?

Thanks.

# Answer
> 3 votes
Theoretically it is possible.

* IF you are on EE 2.9+ you can use Mathematical Operators in your conditionals. (Thanks Derek for reminding me about that!)
* If you are using a version below EE2.9 you would need to use something like MX Calc to calculate the totals and then use that to call an embed to get around parse order issues.

Having said that is probably not the best approach because EE only allows you to have 10 segments so your test could only have 10 questions (more likely 8 if you have a template\_group/template structure already in place).

You would be better off either doing the calculation when the user submits the form and appending the total value to the url or better yet determine the template you want to display and change the redirect value to that based upon the total.

Another option would be submitting the form and then using something like Mo Variables to grab the POST data on the next page.

# Answer
> 1 votes
Yes. The rest of this answer is to meet the minimum 30 character requirement. ;)

---
Tags: segments
---


# Question
Title: When will DevDemon's Campaigns module "URL Shortener" integration be ready?
DevDemon's Campaigns module has a section within its Settings for URL Shorteners. When you try to set up a service, however, you get the message seen in the following screenshot. Anyone know when this functionality will go live?

# Answer
> 0 votes
Questions like this are best submitted directly to the developer since they will be the best party to provide an answer for you.

---
Tags: devdemon
---


title: Adding value to {count}

text:
# Question
Title: Adding value to {count}
How do I add a value to the {count} variable?

I'm trying to do this:

```
{exp:channel:entries channel='links' orderby='link_order' sort='asc' dynamic='no'  category='12'}
<div class="item" id="pane-{count+15}" style="display: none;">
    <!-- stuff here -->
</div>
{/exp:channel:entries}

```

I want the HTML to come out like this:

```
<div class="item" id="pane-16" style="display: none;">
    <!-- stuff here -->
</div>
<div class="item" id="pane-17" style="display: none;">
    <!-- stuff here -->
</div>
<div class="item" id="pane-18" style="display: none;">
    <!-- stuff here -->
</div>

```

# Answer
> 4 votes
By default, EE is support calculations in conditions only. For other cases you can use MX Calc

```
{exp:channel:entries channel='links' orderby='link_order' sort='asc' dynamic='no'  category='12' parse="inward"}
<div class="item" id="pane-{exp:mx_calc expression='{count}+15'}" style="display: none;">
    <!-- stuff here -->
</div>
{/exp:channel:entries}

```

---
Tags: channel-entries, tags
---


title: Hook for when viewing single entry

text:
# Question
Title: Hook for when viewing single entry
I'm in the process of building my 1st extension (oi!) and I need to find a hook that allows me to fire off a routine when a member visits a single entry page.

I have listing pages and single view pages - I only need the routine to fire when viewing single entry pages NOT listing pages.

The list of hooks is extensive but I cannot seem to find one that fits.

**The broad picture is:**

I have an extension that relies on hooks to update the DB when ever a member adds a reply or adds a new entry. It gets a list of active users in the last 2 weeks, adds their member\_id to Solspace 'Favorites' table in the DB in a separate collection.

This is working as expected as I can call the 'fav' module to mark entries on a list view page as 'unread'.

What I now need to do is when a user visits an entry, remove their member\_id from the 'fav' table/collection. Someone adds a new comment/entry, it re-adds their member\_id and marks the entry as 'unread' once again.

I believe the best approach is to make a module that I can call in the template code within the entry template to remove the user from the 'fav' DB table.

# Answer
Crelate a plugin containing single function, say, function\_name. The plugin will accept member\_id of logged in visitor

```
ee()->session->userdata('member_id')

```

and ID of entry being viewed, passed as parameter

```
ee()->TMPL->fetch_param('entry_id)

```

In this function, if member\_id is not 0 (i.e. member is logged in), perform a check against your database table and if necessary, perform an update.

(Since there is DB interaction, someone might say you should create module, but since this is your first EE add-on and it has no settings, keep the things simple).

Then, in your single entry template, inside channel entries tag, call the plugin like this:

```
{exp:plugin_name:function_name entry_id="{entry_id}"}

```
> 3 votes

---
Tags: module, extension, custom
---


title: Lots of new member SPAM

text:
# Question
Title: Lots of new member SPAM
I'm working on a site that is online in a dev environment. I'm getting tons of new member spam. I have snaptcha installed and it's set to High and it doesn't seem to be helping. Anyone have any ideas how to fix this? Thanks!

# Answer
> 5 votes
Since it is your dev environment the easiest way to prevent registrations is to turn them off via Members \> Preferences.

While that doesn't really address the root of the issue it is effective. If you want to help combat the spam while still allowing member registrations you can do a couple of things.

* Change the member profile trigger word to something other then "member". You can do this by either navigating to Members \> Preferences \> Profile Trigger Word. The option that I use and that the FocusLab Master Config file uses it just to set a random string each page load by adding something along the lines of below to the config.php file

// randomize the member profile trigger word because we'll never need it $config\['profile\_trigger'\] = rand(0,time());
* Use a different Spam service/add-on. I have never used Snaptcha so I have no experience with it but I have used Low NoSpam for as long as I can remember and have only had a very limited number of spam registrations come in during that time.

# Answer
> 0 votes
You may also consider building invitations-based system.

Invitations add-on for ExpressionEngine will allow site visitors request invitations; and new signups will only be accepted from people who have valid invitation code.

---
Tags: spam
---


# Question
Title: Redirects from old site using queries to new EE site
I'm putting a new site live and need to redirect all the old pages to the relevant new ones. The issue is that the old site used PHP queries, whereas the new site doesn't.

This means that if I setup a redirect like so:

```
RewriteRule %{QUERY_STRING} range.php?type=baropt&item=01 [NC]
RewriteRule .* http://domain.com/range/bars/led-bar? [R=301,L]

```

Instead of redirecting as it should, it simply displays a blank page with the message '**Disallowed Key Characters**'.

I'm happy to setup manual redirects for the various pages (there's only around 80-90 in total). but can't workout how to do it. I've been told I'll need to use 'mod\_rewrite, request\_uri + query\_string conditions' but that doesn't mean much to me.

OLD URL: domain.com/range.php?type=baropt&item=01

NEW URL: http://domain.com/range/bars/led-bar

Any ideas gratefully received!

Thanks in advance,

Tom

# Answer
Did you actually mean this?

```
RewriteCond %{QUERY_STRING} range.php?type=baropt&item=01 [NC]
RewriteRule ^(.*)$ http://domain.com/range/bars/led-bar? [R=301,L]

```

You should use RewriteCond, not RewriteRule is first line, as it'a conditional that applies to the rule, the rule itself is in second line. Also replace &amp ; with simple ampersand (unless you really have &amp ; in URL)
> 1 votes

# Answer
If you have imported the previous URL as some field, let's say, `previous_url`, you can use a template to help you create the redirects.

Access the template, copy the rules and paste them on your .htaccess file or NGINX location.

## For NGINX

```
{exp:channel:entries channel="channel_name" limit="500"}
    rewrite ^/{previous_url} http://domain.com/template_group/template/{url_title} redirect;<br />
{/exp:channel:entries}

```

If everything work fine, replace `redirect` by `permanent` and restart nginx service.

## For Apache

```
{exp:channel:entries channel="channel_name" limit="500"}
    RewriteRule ^/{previous_url} http://domain.com/template_group/template/{url_title} [L,R=302]<br />
{/exp:channel:entries}

```

If everything work fine, replace `302` by `301`.
> 0 votes

# Answer
It's a bit pricey for what it does, but if you prefer to manage redirects from the CP, and think maybe there will be more in the future, than Detour Pro is a nice option: http://devot-ee.com/add-ons/detour-pro
> 0 votes

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


title: Which port for SMTP Mails

text:
# Question
Title: Which port for SMTP Mails
I am having an issue with my provider/hoster and I am looking for some advise.

We send Freeform forms with SMTP with this config. Looks like many others do the same.

```
$config['mail_protocol']    = 'smtp';
 $config['smtp_server']      = 'tls://smtp.gmail.com:465';
 $config['smtp_username']    = 'mail@xxx.xx';
 $config['smtp_password']    = 'xxxxx';
 $config['email_newline']    = "\r\n";
 $config['email_crlf']       = "\n";

```

The sending goes on port 465 but Google recommends port 587. And port 587 is what our hoster wants us to send on. But EE can not.

Our hoster opened port 465 for us. When they do server updates the port gets closed again and we don't get any forms untill we realize and ask to get the port open again.

If we use port 587 we get this

```
Message: fsockopen(): SSL operation failed with code 1. OpenSSL
Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong
version number

```

This leads to the question: does EE try to do someting like this

```
openssl s_client -tls -crlf -connect smtp.gmail.com:587

```

or

```
openssl s_client -ssl3 -crlf -connect smtp.gmail.com:587

```

instead of what our hoster finds to be the right way

```
openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587

```

He gave us this link for a reading http://blog.mailgun.com/25-465-587-what-port-should-i-use/

I just do understand a little of these thing and wonder if my hoster is right in saying EE has to send SMTP mails different than it does at the moment?

Or is our hoster not flexible enough? I know people on hosters that have no issues sending over port 465 all the time.

I appreciate some feedback on this.

# Answer
> 1 votes
The SMTP port is set in your Admin \> Email Configuration. TLS is specified with the `email_smtp_crypto` system configuration override:

$config\['email\_smtp\_crypto'\] = 'tls';

With both of those in place, removing the protocol and the port from your server string should allow you to send via SMTP with those settings.

---
Tags: email, smtp
---


title: Low Search Errors on upgrade to 3.5.1

text:
# Question
Title: Low Search Errors on upgrade to 3.5.1
We've just updated a site to use LS3.5.1 from 3.3.2 and I'm getting the following errors. EE is 2.9.0 - an upgrade is an option as the site is brand new.

> Severity: Notice
>
> Message: Undefined index: 7
>
> Filename: keywords/lsf.keywords.php
>
> Line Number: 869

We're using Structure, so for the link to the page we want to use `{page_uri}`. The results are all working as expected - we're just getting these errors.

I've been into each collection and added the language option. I've re-indexed the collections and switching `{page_uri}` for `{auto_path}` removes the error notices.

I've also deleted the module entirely and re-uploaded to make sure we're not missing anything in the filters folder which I've seen could be an issue.

Any thoughts?

# Answer
> 1 votes
I'll get the error fixed in the next version. For now, open up /low\_search/filters/keywords/lsf.keywords.php and look up line #869, which reads:

```
$row['auto_path'] = $this->_urls[$row['channel_id']] . $row['url_title'];

```

Change that to:

```
$row['auto_path'] = @$this->_urls[$row['channel_id']] . $row['url_title'];

```

Note the `@` added before `$this->`.

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


title: How to add tags via channel form?

text:
# Question
Title: How to add tags via channel form?
I am trying to allow for tags being added to an entry submitted via a channel form, but right now submissions end in an error message about the Language field being required (that's the tag field) even though I did enter a tag.

I am also wondering if it is possible to strip out the "suggest tags" and "top tags" buttons from the way the tag input appears in a channel form when using "{field:tag\_fieldtype\_name}"?

The form looks like this:

```
{exp:channel:form channel="channel9" return="Links" class="Submit" id="Submit"}
    <label for="title">Title</label>
    <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" />

    {custom_fields}
        <label for="{field_name}">{field_label}</label>
        {if textarea}
            <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" cols="50" rows="{rows}" onclick="setFieldName(this.name)">{field_data}</textarea>
        {/if}
        {if textinput}
            <input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" />
        {/if}
    {/custom_fields}

    {field:9_language}

    {category_menu}
        <label for="categories">Categories</label>
        <select name="category[]" id="categories" size="4">
            {select_options}
        </select>
    {/category_menu}

    {if captcha}
        <br />
        <label for="captcha">Please enter the word you see in the image below:</label>
        <br />
        {captcha}
        <br /><br />
        <input type="text" name="captcha" value="{captcha_word}" maxlength="20">
    {/if}

    <br />
    <input type="submit" name="submit" value="Submit" />
{/exp:channel:form}

```

The generated html looks like this:

```
<h3>Submission Form</h3>

<form id="Submit" class="Submit" method="post" action="http://www.westeros.org/Links/Submit"  enctype="multipart/form-data" >
<div class='hiddenFields'>
<input type="hidden" name="RET" value="http://www.westeros.org/Links/Submit" />
<input type="hidden" name="URI" value="Links/Submit" />
<input type="hidden" name="return_url" value="Links" />
<input type="hidden" name="author_id" value="1" />
<input type="hidden" name="channel_id" value="9" />
<input type="hidden" name="entry_id" value="0" />
<input type="hidden" name="ACT" value="19" />
<input type="hidden" name="meta" value="UjJTawVjV2QEOQ51BCIAPABpA28BL1YmVSVVag5mAXYPdQI4UzFSOAU0AzsDLwd6AXVbYVQ3VGhcIg8rVz5UIg19V3YKaVF3XT4IelZvUzZSaVNzBR5XPgRtDmUEIgAkAGcDJgE3VmNValUkDmABbQ82Am1TPlJnBWgDIwNvB3QBPFtjVDtUcFxjDzFXOlQ4DWZXYQprUWxdJwgyViZTOVJmU2sFcFc0BG8ObwQiAHUAfgNuAX5WblVmVTwOIQFWDyICYVM9UmsFcAMjA28HdAE8W2lUO1RwXGkPPVd5VG0Ne1c+CjFRb10nCFpWIFNhUj5TOAUmV3UEOA59BGsANwBvA28BL1YnVTVVZQ52AXcPMgJcUyJSZwVwA3QDJgdpASRbYFRjVGhcMA9iVyhUbA08Vz4KJVE/XXYIZlY7UyFSaFMzBWhXZwQ4Dn0EawA3AG0DbwEvVjVVJVVyDmsBag8lAlxTP1JsBWgDeAN2BzwBZFthVDFUaVxzD2NXalRlDTJXJgp1UTBddAh8VjxTcVI2Uw4FN1c5BHcOfAQoACQAZwM3ATdWZFVrVXUOOQEyD20CIVMjUmsFcANkAwsHbgFiW3lUOlQhXDoPaFdhVHQNOVcmCjxRJl0/CDhWZVM5UnFTMgU6VzYEbQ5gBDQAagADAzwBaVZ2VWtVdQ45ATQPbQIhU2lSIAU/A3IDbgc2ATVbYVQjVDZcZQ86VylULw14V3AKWFE2XW0IbFY2U2hScVNqBTBXbQQyDjUEIgA8AG0DYQE3VnZVMVVqDm8Bag8gAlxTM1JtBWkDbAMxB2kBclsoVCNUaVxzD2NXalRsDSpXagolUW5deA==" />
<input type="hidden" name="return" value="Links" />
<input type="hidden" name="site_id" value="1" />
<input type="hidden" name="csrf_token" value="91d57eea93d5db7b27df4e73b48072e4f2d8edad" />
</div>

<label for="title">Title</label>
<input type="text" name="title" id="title" value="" size="50" maxlength="100" onkeyup="liveUrlTitle();" />
<label for="9_url">URL</label>

<input type="text" dir="ltr" id="9_url" name="9_url" value="" maxlength="100" size="50" onclick="setFieldName(this.name)" /><label for="9_description">Description</label>

<textarea id="9_description" name="9_description" dir="ltr" cols="50" rows="10" onclick="setFieldName(this.name)"></textarea><label for="9_language">Language</label>
<script type="text/javascript" src="http://www.westeros.org/Scripts/ExpressionEngine/themes/third_party/tag/js/jquery.tag_autocomplete.min.js"></script>
<link rel="stylesheet" type="text/css" media="screen" charset="utf-8" href="http://www.westeros.org/Scripts/ExpressionEngine/themes/third_party/tag/css/tag.css" />
<script type="text/javascript" src="http://www.westeros.org/Scripts/ExpressionEngine/themes/third_party/tag/js/tag.js"></script>
<link rel="stylesheet" type="text/css" media="screen" charset="utf-8" href="http://www.westeros.org/Scripts/ExpressionEngine/themes/third_party/tag/css/front_base.css" />
<!--[if IE 8]><div class="solspace_tag_group ie8" id="solspace_tag_field_206"><![endif]-->
<!--[if IE 9]><div class="solspace_tag_group ie9" id="solspace_tag_field_206"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<div class="solspace_tag_group" id="solspace_tag_field_206">
<!--<![endif]-->
    <textarea style="display:none;" id="solspace_tag_ta_206"
              name="9_language"></textarea>

    <div class="solspace_tag_new_tags">
        <div class="tag_section_name">
            <div class="staticwrap">
                <span class="add"></span>
                Add Tags           </div>
        </div>
        <div class="tag_section_data">
                <div class="solspace_tag_input_area">
                <div class="tag_error_dialog">
                    <span class="notice">Error text</span>
                </div>
                <input type="text" name="tag_input" value="" class="tag_input"/>
                            <div class="suggest_tags white_grad">
                    <span class="glass"></span>
                    <span class="tag_button_label">Suggest Tags</span>
                </div>
                <div class="top_tags white_grad">
                    <span class="star"></span>
                    <span class="tag_button_label">Top Tags</span>
                </div>
                        </div>
            <div class="tag_clear"></div>
            <div class="solspace_tag_current_tags">
                                <div class="tag_clear"></div>
            </div>
        </div>
        <div class="tag_clear"></div>
    </div>
    <div class="solspace_tag_suggest_tags">
        <span class="tag_section_closer ex"></span>
        <div class="tag_section_name">
            <div class="staticwrap">
                <span class="glass"></span>
                Suggest Tags           </div>
        </div>
        <div class="tag_section_data">
            <div class="refresh_suggest_tags white_grad">
                <span class="refresh"></span>
                <span class="loading"></span>
            </div>
            <div class="tag_clear"></div>
        </div>
        <div class="tag_clear"></div>
    </div>

    <div class="solspace_tag_top_tags">
        <span class="tag_section_closer ex"></span>
        <div class="tag_section_name">
            <div class="staticwrap">
                <span class="star"></span>
                Top Tags           </div>
        </div>
        <div class="tag_section_data">
                            <div class="top_tag white_grad" data-tag="S2">
                    <span class="tag_count">762</span>
                    <span class="plus"></span>
                    <span class="tag_name">S2</span>
                </div>
                            <div class="top_tag white_grad" data-tag="Previews">
                    <span class="tag_count">686</span>
                    <span class="plus"></span>
                    <span class="tag_name">Previews</span>
                </div>
                            <div class="top_tag white_grad" data-tag="Game of Thrones">
                    <span class="tag_count">526</span>
                    <span class="plus"></span>
                    <span class="tag_name">Game of Thrones</span>
                </div>
                            <div class="top_tag white_grad" data-tag="WorldCon">
                    <span class="tag_count">485</span>
                    <span class="plus"></span>
                    <span class="tag_name">WorldCon</span>
                </div>
                            <div class="top_tag white_grad" data-tag="Season 3">
                    <span class="tag_count">459</span>
                    <span class="plus"></span>
                    <span class="tag_name">Season 3</span>
                </div>
                        <div class="tag_clear"></div>
        </div>
        <div class="tag_clear"></div>
    </div>
</div>
<script type="text/javascript">
    (function(global){

        //defaults and tag sets for the external JS
        var data = global.solspaceTag           = global.solspaceTag || {};

        //global items (ok to overwrite)

        //secureFormHash
        data.secureFormHash                     = '91d57eea93d5db7b27df4e73b48072e4f2d8edad';
        //this might be localized to fields later
        data.tagLimit                           = '0';

        data.langItems                          = {
            'error'                     : "Error",
            'tag_limit_reached'         : "Tag Limit of %num% reached.",
            'explode_separator_desc'    : "Error"
        };

        data.tabName                            = '';
        data.delimiters                         = {"colon":":","comma":",","doublepipe":"||","newline":"\n","pipe":"|","semicolon":";","space":" ","tab":"\t","tilde":"~"};

        //per field items

        //current tags
        data['currentTags']                     = data['currentTags'] || {};
        data['currentTags']['206']  = [];
        //top tags
        data['topTags']                         = data['topTags'] || {};
        data['topTags']['206']      = ['S2','Previews','Game of Thrones','WorldCon','Season 3'];
        //all open
        data['allOpen']                         = data['allOpen'] || {};
        data['allOpen']['206']      = 'no';
        //xids
        data['xids']                            = data['xids'] || {};
        data['xids']['206']         = '91d57eea93d5db7b27df4e73b48072e4f2d8edad';
        //auto complete
        data['autocompleteURL']                 = data['autocompleteURL'] || {};
        data['autocompleteURL']['206']= 'http://www.westeros.org/?ACT=59&method=tag_autocomplete&tag_separator=doublepipe&tag_group_id=1';
        //suggest tags
        data['suggestTagsURL']                  = data['suggestTagsURL'] || {};
        data['suggestTagsURL']['206']= 'http://www.westeros.org/?ACT=59&method=tag_suggest&tag_separator=doublepipe&tag_group_id=1';
        //suggest fields
        data['suggestFields']                   = data['suggestFields'] || {};
        data['suggestFields']['206'] = [];
        //EXPLOOOOOOODDDEE!
        data['explodeSeparator']                = data['explodeSeparator'] || {};
        data['explodeSeparator']['206'] = false;
        //separator
        data['separator']                       = data['separator'] || {};
        data['separator']['206']        = '\n';

        //if people load these via ajax, we need to set the events
        if (typeof  global.solspaceTag.domReadyFired !== 'undefined' &&
                    global.solspaceTag.domReadyFired == true)
        {
            global.solspaceTag.setFieldEvents("#solspace_tag_field_206");
        }
    })(window);
</script>

<label for="categories">Category</label>
<select name="category[]" id="categories" size="4">
<option value='170'>A Song of Ice and Fire Fan Sites</option>

<option value='174'>Fan Artists</option>

<option value='209'>Game of Thrones Fan Sites</option>

<option value='171'>George R.R. Martin Fan Sites</option>

<option value='221'>Official Sites</option>

<option value='172'>Professional Artists</option>

</select>

<br />
<input type="submit" name="submit" value="Submit" /></form><script type="text/javascript" charset="utf-8">// <![CDATA[
if (typeof EE == "undefined" || ! EE) {
var EE = {"publish":{"title_focus":true,"smileys":true,"url_title_prefix":"","default_entry_title":""},"user_id":1,"lang":{"confirm_exit":"When you leave, any data entered will be lost. Are you sure you want to leave?","add_new_html_button":"Add New HTML button"},"XID":"91d57eea93d5db7b27df4e73b48072e4f2d8edad","CSRF_TOKEN":"91d57eea93d5db7b27df4e73b48072e4f2d8edad"};}
EE.grid_cache = [];

window.Grid = {
    bind: function() {
        EE.grid_cache.push(arguments);
    }
};mySettings = {"nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br \/>\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"<\/p>\n"},"markupSet":[{"name":"b","key":"B","openWith":"<strong>","closeWith":"<\/strong>","className":"btn_b"},{"name":"i","key":"I","openWith":"<em>","closeWith":"<\/em>","className":"btn_i"},{"name":"blockquote","key":"Q","openWith":"<blockquote>","closeWith":"<\/blockquote>","className":"btn_blockquote"},{"name":"a","key":"A","openWith":"<a href=\"[![Link:!:http:\/\/]!]\"(!( title=\"[![Title]!]\")!)>","closeWith":"<\/a>","className":"btn_a"}]};

 // ]]>
</script><script type="text/javascript" charset="utf-8" src="http://www.westeros.org/?ACT=52&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=markitup,toolbox.expose,overlay,tmpl&file=underscore,cp/date&v=1405860060&use_live_url=y&include_jquery=y"></script>
<script type="text/javascript" charset="utf-8">
// <![CDATA[
$(document).ready(function() {
    var SafeCracker = {}; SafeCracker.markItUpFields = EE.markItUpFields = {};
    $.datepicker.setDefaults({dateFormat:"d-m-y"+EE.date_obj_time});
    $.datepicker.setDefaults({defaultDate: new Date(1422970896000)});
});
// ]]>
</script>
<style type="text/css">.hasDatepicker{background:#fff url(http://www.westeros.org/Scripts/ExpressionEngine/themes/cp_themes/default/images/calendar_bg.gif) no-repeat 98% 2px;background-repeat:no-repeat;background-position:99%;}</style>

```

# Answer
Not sure if 'Allow EE Code' can apply to a channel form but it works for CP side fields... https://devot-ee.com/add-ons/allow-ee-code
> 0 votes

# Answer
Please have a look at the Tag documentation for use in the EE Channel Form. The `{custom_fields}` tag pair might not work: try using the field as in the example in the documentation: `{field:tag_fieldtype_name}`.

To hide the "suggest tags"/"top tags" sections, you can do so using javascript of (even better) CSS.
> 0 votes

# Answer
You have this tag fields displayed 2 times: one time inside *{custom\_fields}* pair and another one when you call it by name.

You may filter the first one by changing *{if textarea}* to

> {if textarea AND field\_name != "9\_language"}
> 0 votes

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


# Question
Title: Freeform Pro - displaying entries using composer template
I used composer template to drag n drop and make my form. I have it working fine and allowing a submit. Now I need to let an admin display each persons application that was submitted through this form so they can print it. Viewing the forms through the module tab doesn't give a nice print layout like I need.

Is there a way to display all of a specific entry\_id entries with the same form layout made from composer template? This is the code I'm using to show the initial form

```
{exp:freeform:composer
     form_name="office_employee_app"
     composer_template_name="office_employee_template"
     return="admin/office-application-signature"
}

```

# Answer
> 0 votes
If you're looking to display details about form submissions on the front end, you can do it by using the Freeform:Entries template tag, and just make sure you're calling the entry\_id parameter and providing a value to it:

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

    <p>
        Submitted:
        {freeform:entry_date format="%F %j, %Y at %g:%i %a"}
    </p>

    <h3>
        By: {freeform:field:name}
    </h3>

    <p>Email Address: {freeform:field:email}</p>

    <p>Home Phone: {freeform:field:home_phone}</p>

    {if freeform:field:cell_phone}
        <p>Cell Phone: {freeform:field:cell_phone}</p>
    {/if}

    <p>Subject: {freeform:field:subject}</p>
    <p>Questions or Comments:<br />{freeform:field:question}</p>

    {if freeform:no_results}
        <p>No results found.</p>
    {/if}

{/exp:freeform:entries}

```

If if I understand you correctly, if you're trying to display the actual values inside an actual form, you could dummy up form fields to hold those values.

And lastly, seeing that you're using Composer, if you're looking for a way to have Freeform auto-populate everything by itself, you could use the Freeform:Composer\_Edit template tag (and just don't bother editing), and that would save you the work of recreating the form on the front end. :)

---
Tags: ee2, solspace-freeform, solspace, composer, composer-template
---


title: I want to get my duplicate webpage data

text:
# Question
Title: I want to get my duplicate webpage data
I'm beginner of web programming. Unfortunately, I take the job which modify the webpage. But I'm not familiar in Expression engine, and I'm very afraid about occur something problem. So I want to make copy of the webpage which i can learn to use Expression engine for practice. Is it possible? and if it is possible, please tell me how.

# Answer
> 1 votes
What you can do is make a duplicate of a template. To do that go to your Template Manager (under Design \> Templates), find an appropriate Template Group and click on the "Create a New Template" button. From there you can choose to "Duplicate an Existing Template" from a drop-down of templates already on the system. Hit "Create and Edit" to mess around with your new duplicate template. Any changes you make to your new template will not affect the one you duplicated.

If you're working on a live site I would name the duplicate template something out of the ordinary so that a user doesn't accidentally stumble upon your work environment. Also, be sure to delete the template once you've copied any final changes you want to make!

---
Tags: duplicate, mx-cloner
---


# Question
Title: How do I order file list in Dev Demon's Channel Files alpha by filename?
I need to order the files alphabetically by file name. How do I do this?

The "orderby" parameter docs are incomplete for Dev Demon's Channel Files. Both Channel Files and Channel Images docs are also blank after...

> "The “order” parameter sets the display order of the images. Setting options for this parameter include:

in the Parameters section of the docs. It just ends there after the colon.

# Answer
I would suggest using `orderby="title"`.
> 0 votes

---
Tags: devdemon, channel-files
---


# Question
Title: File Upload urls have //chroot added to the url
I'm using the FocusLab Master Config set up which may be relevant. I haven't had any issues previously like this however.

I'm in the middle of migrating from Dev to a new live server and 90% of images on the site are not displaying due to incorrect urls being output.

For example:

```
<img src="//chrootuploads/slider/bagtoearth-reroof.jpg" width="1090" height="435" alt="" draggable="false">

```

should be

```
<img src="/uploads/slider/bagtoearth-reroof.jpg" width="1090" height="435" alt="" draggable="false">

```

When I check the file upload settings in the CP the path and url are correct, but on the front end the url is incorrect.

I can't figure out why /uploads is being replaced by //chrootuploads Of the five slides only one is being output correctly and resized with CE\_image. Eveything else is doing this weird behavior and only on the live server (php 5.3.24).

Any ideas?

also interestingly random pages do not load - not even the 404 page, just a blank white screen

# Answer
> 3 votes
The image problem is usually caused by the setup at your hosting provider (Nexcess?).

I believe you can fix this by setting the correct base path for CE Image, as described here.

EDIT: And this is an example of how to set it at Nexcess:

```
$env_config['ce_image_document_root'] = '/chroot/home/account/domain/html';

```

---
Tags: file-uploads, image, focus-lab-master-config
---


# Question
Title: ExpressionEngine CP pages always seem to cache
I'm helping run an EE site that's developed a really strange problem that my other EE installs seem to have, even if they are on the same webhost and reseller hosting account.

What's going on is that control panel pages seem to keep getting cached. You'll do an action, and it will clearly be successful (you'll still get the green checkmark) but the reloaded page will be unchanged. Then you'll do a hard refresh on the page, and you'll definitely see it changed. Sometimes this problem is stubborn though, and you'll have to hard reload. This makes it difficult to change almost anything in the CP, like turning add-ons on and off, updating entries, etc.

I feel like this is either a very worrisome problem on a specific EE install, or a trivial issue I can change by updating a setting. Does anyone know why my site might be doing this? Interestingly, the front end of the site is not affected at all.

It sounds like it might be related to this issue but there were no answers suggested.

This site has existed since it was EE1 and went through an EE2 update.

Things I've done:

* cleared all caches in Tools \> Data \> Clear Cache

— checked that cache folder and subfolder are set to 777

* made sure no template uses Template Caching (even though those are front facing)

I'm running EE 2.9.2 and don't have any exotic caching plugins enabled, though I use Solspace Template Morsels.

Thanks everyone.

# Answer
> 2 votes
EE Control Panel is never being cached by ExpressionEngine itself. The chances are:

1. It is cached server-side by third-party server tools (you might want to talk to your hoster about that)
2. It is cached by your ISP, if you use proxy server
3. It is your browser's cache

As one possible way around, try changing Control Panel Session Type in preferences to different setting.

---
Tags: control-panel, cache
---


# Question
Title: rawurlencode not rendering correctly in anchor tag?
**EE Version. 2.7.3**

I am running rawurlencode on a field in a channel called description to encode it to pass on correctly to twitters sharing url string inside my template.

**Example input:** Check Out Company Names Latest Post!

so the result should be

```
 Check%20Out%20Company%20Names%20Latest%20Post!

```

When I echo it outside of the anchor tag it renders correctly with the proper encoding, but as soon as I echo out the variable inside the anchor tag, the %20 encoding is not rendered and regular spaces are in the URL again.

**PHP**

```
<?php
    $description =  rawurlencode('{description}');
?>

```

**Output:**

```
 <a href="http://twitter.com/home?status=<?php echo $description; ?> {site_url}" class="popup">

```

Any ideas what's wrong?

# Answer
It looks like you need to enable PHP in your template.

Alternatively, you could use a plugin for the URL encoding. For example URL Encode or CE String.

It's generally considered not the best practice to enable PHP in templates when an existing plugin or a custom-built plugin allows you to avoid it. Some rationale for that is in this Stack Overflow post, Is there ever a good reason to use PHP inside ExpressionEngine templates?
> 2 votes

---
Tags: ee2, templates, php
---


title: Wygwam embed media class missing

text:
# Question
Title: Wygwam embed media class missing
In V2.7 when you used the embed media toolbar button it automatically wrapped the embed code in a div with a class of embed\_media.

In V3.3.3 this no longer happens. The first time I did it it was just wrapped in a P tag, the next time it was a Div, but with no class. This makes applying CSS formatting for responsive sizing impossible.

Is there a fix for this?

# Answer
Whilst the plugin is missing there is a solution to wrap an iframe in a div and give it a class. See this answer
> 0 votes

---
Tags: wygwam
---


title: Disabling the Required *Title Field

text:
# Question
Title: Disabling the Required *Title Field
Still pretty new to EE. Running EE 2.9.2

I have tried a couple of third\_party downloads but to no avail:

* SP Title Filler
* MX Title Control

How can I disable the required title field entirely? It keeps popping up as a required field. I understand it is required for editing the entry (having a link to click on). But can I generate this title based on some other channel fields included in the channel group?

# Answer
According to the blurb for MX Title it can combine a combination of elements to achieve that:

*For patterns you can used any of exist EE2 tags (category, **all custom fields,** plug-ins etc.) successfully tested with EE 2.9.2*

You will have to then require all your custom fields but it should work. What did you actually try?
> 1 votes

---
Tags: title
---