# Question
Title: Stash set variable from POST variable and use in Entries Loop
I have the following code, and the stash variable doesn't seem to parse. I believe it's an issue with parse order. Apologies, this is the first time I've used stash. I'm trying to show a multiple entry page filtered by categories sent from a HTML form:

```
<form action="" method="post">
    <input type="checkbox" value="62" name="recipe_type_categories[]">
    <input type="checkbox" value="63" name="recipe_type_categories[]">
    <input type="checkbox" value="59" name="recipe_type_categories[]">
    <input type="checkbox" value="64" name="recipe_type_categories[]">
    <input type="checkbox" value="61" name="recipe_type_categories[]">
    <input type="checkbox" value="60" name="recipe_type_categories[]">
    <input type="hidden" name="XID" value="{XID_HASH]">
    <input type="submit" name="submit" value="GO!">
</form>

```

An array of category IDs are POSTed to the page, it then sets the ids to a stash variable.

```
 {exp:stash:get name="recipe_type_categories" dynamic="yes" save="yes"}

```

My template looks like this:

```
{exp:channel:entries channel="recipes" dynamic="no"
limit="18" uncategorized_entries="no"
disable="member_data|comments|category_fields"
category="{exp:stash:recipe_type_categories}"
status="not Closed" paginate="both"}

{title}

{paginate}
    {pagination_links}
        <span>page {current_page} of {total_pages}</span>
        <ul>
        {first_page}
            <li><a href="{pagination_url}" class="page-first">first</a></li>
        {/first_page}

        {previous_page}
            <li><a href="{pagination_url}" class="page-previous"><</a></li>
        {/previous_page}

        {page}
            <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
        {/page}

        {next_page}
            <li><a href="{pagination_url}" class="page-next">></a></li>
        {/next_page}

        {last_page}
            <li><a href="{pagination_url}" class="page-last">last</a></li>
        {/last_page}
    </ul>
    {/pagination_links}
{/paginate}
{/exp:channel:entries}

```

Unfortunately, I see this in template debugging:

```
(0.012391 / 8.23MB) Tag: {exp:channel:entries channel="recipes" dynamic="no" limit="18" uncategorized_entries="no" disable="member_data|comments|category_fields" category="{exp:stash:recipe_type_categories}" status="not Closed" paginate="both"}

```

Hopefully someone can suggest a solution.

# Answer
> 0 votes
The standard way of handling this is with the Dynamic Parameters parameter - have you tried this instead of Stash? http://ellislab.com/expressionengine/user-guide/add-ons/channel/dynamic\_parameters.html

==== Edit to add alternatives ====

Here's how the Stash approach could work. I've tested this and it seems to work fine for me. (You need to use parse="inward"):

```
<form action="" method="post">
    <input type="checkbox" value="62" name="recipe_type_categories[]">
    <input type="checkbox" value="63" name="recipe_type_categories[]">
    <input type="checkbox" value="59" name="recipe_type_categories[]">
    <input type="checkbox" value="64" name="recipe_type_categories[]">
    <input type="checkbox" value="61" name="recipe_type_categories[]">
    <input type="checkbox" value="60" name="recipe_type_categories[]">
    <input type="hidden" name="XID" value="{XID_HASH}">
    <!-- (note you should use {csrf_token} instead of {XID_HASH} in EE 2.8+) -->
    <input type="submit" name="submit" value="GO!">
</form>

{exp:channel:entries
    channel="recipes"
    dynamic="no"
    limit="18"
    uncategorized_entries="no"
    disable="member_data|comments|category_fields"
    category="{exp:stash:get name='recipe_type_categories' dynamic='yes' save='yes'}"
    paginate="both"
    parse="inward"
}
    <li>{title}</li>
    {paginate}...{/paginate}
{/exp:channel:entries}

```

If pagination is still a problem you might consider some alternative solutions:

1. Native advanced search form
2. Reefine add-on
3. Low Search or Solspace SuperSearch add-ons

---
Tags: channel-entries, stash, pagination
---


# Question
Title: EE Not Sending Emails to Addresses from Main Domain
Not sure if this is an EE or server issue, but EE will not send any emails to our company addresses, but it will to outside addresses.

For example, our main site is autouplinktech.com. Emails sent from the EE Control Panel on that site arrive just fine in my personal gmail inbox, but no emails can be sent to our company accounts like name@autouplinktech.com.

I have email debugging turned on, but I see no error messages at all, and in fact I get a success message on the CP after sending an email to one of our company addresses, but nothing ever arrives in the inbox.

Any thoughts?

# Answer
> 4 votes
Likely a server issue.

You host the site at GoDaddy, but your email is hosted (looking at your MX records) somewhere else. Its likely your server has a local configuration still to handle email for your domain name, maybe a recent switch to another email provider? Your server would listen to the local mail server configuration and deliver locally before it would go off to your outside email company by way of your MX record in DNS.

So make sure your GoDaddy account is not configured to handle email for your domain any more, if you have an outside company handing your email.

---
Tags: email
---


# Question
Title: Send email with contents of channel form upon submission
I want to have a channel form (new version of SAEF) form on my website for users to fill out. Upon submission I want the form to obviously save as an entry in the system (which is what it does by default) but ALSO send the contents of the filled-out form in an email to a specified email address.

Is this possible either natively, via an addon, or possibly via a hook and writing an addon?

Thanks,

# Answer
MX Notify Control (free) or Postmaster (paid) can do this using the 'new entry create' hook.
> 3 votes

# Answer
Depending on your situation you can also use a workflow module that alerts an admin of publish & edits by sending an email. There is Publisher Lite (the full version supports translations too) and Better Workflow.
> 1 votes

---
Tags: channel-form, email
---


# Question
Title: Passing dynamic parameters to exp:channel:entries
I'm not sure why I can't get this to work.

I have a custom member field called local\_tunnel. I can retrieve that value no problem with either Solspace User which I have installed or the native EE tags.

However if I try and pass in either of those as a parameter for channel entries tag I get no results, not even the no\_results tag is evaluating. I've tried hard coding a value and that works.

```
 <div class="bolder">
                    {exp:user:stats}{member_tunnel}{/exp:user:stats}
                    {exp:member:custom_profile_data}{member_tunnel}{/exp:member:custom_profile_data}
                        {exp:stash:parse process="end"}
                        {exp:channel:entries
                                channel="tunnels"
                                entry_id="{exp:member:custom_profile_data}{member_tunnel}{/exp:member:custom_profile_data}"
                                limit="1"
                                disable="categories|category_fields|pagination"
                            }
                            {title}
                            {if no_results}
                            <p>No Results</p>
                            {/if}
                        {/exp:channel:entries}
                        {/exp:stash:parse}
                    </div>

```

# Answer
> 0 votes
You can't use a full tag pair as the parameter of another tag, because that tag pair won't be parsed until *after* the tag it is being used as a parameter for is parsed.

Instead, try this:

```
{exp:stash:parse process="end"}
    {exp:member:custom_profile_data}
        {exp:channel:entries
            channel="tunnels"
             entry_id="{member_tunnel}"
             limit="1"
             disable="categories|category_fields|pagination"
        }
            {title}
            {if no_results}
                <p>No Results</p>
            {/if}
        {/exp:channel:entries}
    {/exp:member:custom_profile_data}
{/exp:stash:parse}

```

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


title: SEO addon - recommendations?

text:
# Question
Title: SEO addon - recommendations?
I'm about to work on some basic SEO for my EE site. I'm trying to dynamically set the title, meta description, OpenGraph tags, and do XML Sitemaps. I've already started trying to dynamically set the title and meta description -- with a lot of if-conditions. It's starting to get ugly.

I've been looking at http://ee-garage.com/nsm-better-meta. Any comments about this addon? Are there other addons I should be looking at?

# Answer
> 4 votes
I like the **Variables plugin** for pushing meta data from my templates to my header.

> The variables plugin gives the possibility to create variables (either static or dynamic) and use them later on. This means that for example ***you can set certain data and use it in the head (if it's embedded) without having to re-create a tag pair for the specific channel***.

Inside your channel:entries loop (or wherever) you SET a variable like this:

```
{exp:channel:entries channel="products"}
    {!-- SET VARIABLE FOR USE IN HEADER --}
    {exp:variables:set name="title" value="{title}"}
{/exp:channel:entries}

```

In your header you "GET" the variable like this:

```
{exp:variables:get name='title'}

```

This lets you build exactly what you need for your project.

---

This won't help with site map. Unless a site is using the Structure Module, I think it's best to build the sitemap manually in a template to allow for ultimate control.

# Answer
> 10 votes
SEO Lite is always helpful. Dynamic but let's you do page level overrides. No site maps though. http://devot-ee.com/add-ons/seolite

Also adds a tab to the publish view so it's readily available.

# Answer
> 6 votes
I would recommend this approach with Stash: http://www.jamessmith.co.uk/articles/expressionengine-stash-tutorial-level-1#meta

I dislike add-ons that purport to "do" metadata for you, because unless your site is a very basic static page-based affair (where one entry always translates to one page) they can never cover all the possibilities for how metadata should get set, and it harms the future-proofing of your site.

I also like to keep the definition of a given pageview's metadata in the same place as the content to which it relates (as opposed to with the layout markup), so the template partials approach makes the most sense to me, as well as its myriad of other advantages.

# Answer
> 1 votes
James Smith's recommended approach could work for you unless you're just looking for something simpler e.g. similar to fields that can be used across channels.

A starting place for that is as Jeremy said, i.e. SEO Lite. However, it is very basic, it's limited to those specific inputs and entries alone.

SurgeEO($) ties SEO/meta data to urls as opposed to content, but it seems to have the same limitation as SEO Lite, i.e. hardcoded inputs so you can't really get variety of metadata out of it.

SEOverride($) is a similar concept with a different interface, except instead of individual hardcoded inputs you have a simple grid/matrix-like option, where the type of meta data and its values for a given URL are entirely up to you.

I haven't used any of these yet but I'm personally going with SEOverride as it allows me to add Facebook Open Graph tags and whatever else I want in the future with relative ease. Don't have to think about what fields to add to which channel, minimal effort for templating, content entry is channel/entry/category agnostic, so it can suit the organization's needs if they decide to change or add things on a whim.

# Answer
> 1 votes
I would recommend that you check SEO Lite.This is actually very basic basic and very helpful. I think I will also check what notacouch have shared here. I will definitely check SurgeEO and SEOverride.

# Answer
> 0 votes
I do use NSM better meta and it is quite ok also. Also if you don't input any entry based meta, the default one comes in hand,but also , creating keywords and content for every entry is important too.

---
Tags: add-on, seo
---


title: Internal Linking within EE Controlpanel

text:
# Question
Title: Internal Linking within EE Controlpanel
Is it possible to somehow set internal links in the rich text editor (Or any other wysiwyg field). Instead of copying the links from the adressbar? Maybe with a dropdown?

Thanks?

# Answer
> 3 votes
There's an add-on called wygwam entries http://devot-ee.com/add-ons/wygwam-entries for P&T's wygwam which does exactly that. On github you'll find another wygwam one that can link to structure pages: https://github.com/pixelandtonic/wygwam\_structure\_pages

---
Tags: wysiwyg
---


# Question
Title: SSL Certificate Breaking User Login - ExpressionEngine
I have recently installed an SSL certificate on a website.

Unfortunately when enabled, members can not stay logged in. After the initial login, it logs you out every time the page refreshes.

Any idea on what could be causing this?

I am using this plugin http://devot-ee.com/add-ons/https-support

But i have also tried to achieve this using a rewrite in .htaccess

# Answer
This was a silly oversight after a long week of coding. Upon login the website redirected with a prefix of "www" where the rest of the site does not use this.

Fixed with WWW resolve in .htaccess
> 2 votes

---
Tags: login, ssl
---


# Question
Title: Extracting category ID of an entry and then using it to display more entries
I'm wondering what the best way to do this may be. I probably haven't worded the question in the best way so I'll explain.

Basically, I have an entry on page which is assigned to a category. On the page I'd like to be able to display other entries assigned to the same category. Sort of a 'similar projects' concept. This needs to be done dynamically however.

My hunch is that I may need to use a query to first pull through the category id of the current entry being shown, then use that value in the `category=""` parameter.

Can anyone point me in the right direction with this

```
{exp:query sql="SELECT cat_id FROM exp_channel_data"}

{exp:channel:entries
 channel="projects"
 dynamic="off"
 category="{cat_id}"}

  {title}

{/exp:channel:entries}
{/exp:query}

```

Maybe something like this but I'm really unsure. Any help would be much appreciated

# Answer
Apologies, I have just seen the `related_categories_mode="yes"` parameter.

Problem solved.
> 1 votes

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


# Question
Title: Can Grid be used as a Price Modifier in Cartthrob? I have problems mapping price and inventory
I am trying to use the Grid fieldtype as a price modifier for Cartthrob. Documentation is lacking on this, it only describes Matrix. I have set it up like Matrix, but obviously change tags to Grid tags.

I am also using the exp:cartthrob:multi\_add\_to\_cart\_form so we can add multiple options and quantities at the same time.

I can add multiple product options to the cart, but cannot get the price or the inventory as per the documentation for Matrix.

My product\_options fieldnames are options\_value, price, inventory, and I have mapped the inventory and price to my product\_options field in Cartthrob, but adding to the cart states "Product is out of stock" for all options. If I remove the inventory mapping, I can add them to the cart but then the price is 0.

So it seems I cannot map price and inventory to a grid field, like the docs say you can for Matrix. Does anyone know if this is possible?

Here is exp:cartthrob:multi\_add\_to\_cart\_form form:

```
{exp:cartthrob:multi_add_to_cart_form return="cart" }

{product_options}
<input type="hidden" name="entry_id[{product_options:count}]" value="{entry_id}">
<input type="hidden" name="item_options[{product_options:count}][product_options]" value="{product_options:option_value}">
<input type="text" name="quantity[{product_options:count}]" value="{product_options:count}">
{/product_options}

<input type="submit" value="Add To Cart" />

{/exp:cartthrob:multi_add_to_cart_form}

```

We are using the latest CT version 2.5 and EE 2.7.2

Thanks

# Answer
No, CartThrob does not support using a Grid field for price modifiers.
> 1 votes

---
Tags: cartthrob, grid
---


# Question
Title: Nested List Data not shown on first page load
I've got a nested set\_list that adds "tags" (which are really just relationships) to a list that the frontend then loops through.

It's set like this

```
{!-- SO: Grab relevant tags --}
{exp:stash:set_list:nested
  name="tags"
  context="{segment_3}"
  parse_tags="yes"
  save="yes"
  scope="site"
  refresh="120"
}
  {stash:tag}Blog{/stash:tag}
  {stash:url}/blog/{/stash:url}

  {exp:playa:children field="blog_contributor"}
    {stash:tag}{title}{/stash:tag}
    {stash:url}/contributor/{url_title}{/stash:url}
  {/exp:playa:children}

{/exp:stash:set_list:nested}
{!-- EO: Grab relevant tags --}

```

This works well, but only on the 2nd page refresh and after. The first time that you load the page the items set by the non-nested lists are fine but these bits are empty.

Looking at Mustash after first load it renders this:-

```
tag|=|Blog|&|url|=|/blog/|+|tag|=|Al Overdrive|&|url|=|/contributor/al-overdrive

```

But this isn't rendering on the front-end. The front-end code is

```
{exp:stash:get_list:nested name="tags" context="{segment_3}" scope="site"}
  <li><a href="{url}">{tag}</a></li>
{/exp:stash:get_list:nested}

```

I'm pretty sure I'm missing something obvious here, but any help is appreciated.

# Answer
> 0 votes
This was being caused because I was setting the list in the same file as I was getting it. If I moved the getting down a level by having an embed like `{stash:embed:layouts:standard}` which handled the UI it resolved itself.

---
Tags: stash
---


title: NavEE dropdown selector

text:
# Question
Title: NavEE dropdown selector
Is there anything that already exists that allows an author to select a navigation that was built in NavEE?

In other words, if I have multiple navigational elements in NavEE and want to give the author an easy way to select which one they would like to include in the page, is there a fieldtype available to do that?

# Answer
Have you checked out this "NavEE Select" addon?

http://devot-ee.com/add-ons/navee-select
> 0 votes

---
Tags: ee2, entry, navee, composer-template
---


# Question
Title: Using Low Variables and Grid to return a count
I'm building a slideshow using Grid and Low Variables. I have a checkbox to publish or hide the slide. What I can't figure out is how to get a count on the amount of items that are checked.

Using this:

```
{exp:low_variables:parse var="lv_homeslider" sort="random"}
    {lv_homeslider:checked}
{/exp:low_variables:parse}

```

total\_rows returns 5, but I only have 2 checked. Any ideas how to get the number for rows where checked=true?

# Answer
> 3 votes
You can use the Search parameter to return only rows that have the checkbox cell checked.

```
{exp:low_variables:parse var="lv_homeslider" search:name_of_checkbox_cell="true"}
    {total_rows}
{/exp:low_variables:parse}

```

"true" should be the actual value that you entered under "Multi-Select Options" in the checkbox field/cell settings.

---
Tags: grid, low-variables
---


title: EE Site Slow And Hangs

text:
# Question
Title: EE Site Slow And Hangs
I am new to EE and one of my sites is running very slow and tends to hang sometimes when users try to register or upload documents. What would be the cause of this? I have already enabled the gzip output setting in EE, but is there another way to free up memory of an EE website or any way I can resolve this?

# Answer
> 2 votes
1) gzip output from EE will actually add slight overhead, better if you are on a virtual server to enable mod\_deflate in apache, or use a hosting provider that offloads that to compression hardware to compress html, css, js. Much more optimal than having php do the compression.

2) Make sure you php 5.2, 5.3 or 5.4 you have something like APC bytecode caching enabled, or have php 5.5 which has its own bytecode caching will lower memory usage and increase performance.

3) Highly recommend not using EE's internal caching systems at all and use something like CE Cache which caches things in a much more optimal way.

# Answer
> 3 votes
I was surprised to find that optimizing tables can help performance a lot, especially if you've got over ~ 75 queries on a page. Tools \> Data \> SQL Manager \> Manage Database Tables. Then Select All and Optimize Tables.

# Answer
> 1 votes
Without seeing your template code it's only possible for us to guess. Typically though, EE performance problems are caused by one or several of items #1 #3 and #4 on this list:

http://www.jamessmith.co.uk/articles/expressionengine-beginners-guide

# Answer
> 0 votes
one of my sites was too running very slow, the problem came from the htaccess file.

I used the htaccess model from the EE doc, and the pages was loading in 8-10 seconds, I tried many other htaccess config, now it take less of one second.

To check if the problem come from of htaccess or not, rename your htaccess in htaccess\_off, and try mysite/index.php/page in place of mysite/page. If the page goes faster with mysite/index.php/page, the problem come from de htaccess.

---
Tags: ee2
---


# Question
Title: Can one low variable be used across multiple sites (using MSM)
Can 1 low variable be created and used across multiple sites. Or would you have to copy the instance for each site?

# Answer
You can, but you will have to use the Parse tag or one of its aliases:

```
{exp:low_variables:single var="my_site:my_var"}

```
> 2 votes

# Answer
I don't believe so. I think you'll have to create a new one on each site.
> -2 votes

---
Tags: low-variables
---


title: Modules vs Extensions

text:
# Question
Title: Modules vs Extensions
I am very new to ExpressionEngine and don't quite fully understand all the concepts yet as I come from a solid OOP environment. When would you use functions in modules and when would you use functions in Extensions?

# Answer
> 3 votes
Extensions are used when you want to take over, modify, or perform extra routines when native first-party methods are executed. For example, performing extra actions after an entry is saved.

Modules (and Plugins to an extent) are used when you want to make functionality (and therefore output) available in Templates via tags. Things that need to occur in a template, or add functionality that is explicitly outside of ExpressionEngine's native feature set.

You can find an overview of the different types of add-ons for ExpressionEngine (including Extensions, Modules, Plugins, Fieldtypes, and more) as well as some sample code and walkthroughs in the Add-on Development section of the User Guide.

---
Tags: ee2, module, extension
---


# Question
Title: Cartthrob Realex Redirect (Global Iris) - 505 error - URL masked
Everything works fine in Chrome.

However in Internet Explorer and Firefox, submitting the check out form results in an error message from Realex/Global Iris:

505 You cannot use this service from there.

Global Iris say that their logs suggest that the submission URL is somehow being masked - hence it doesn't match the referral URL that they have on record, so the request fails.

edit: if I type document.referrer into the browser console, Chrome shows http://www.domain.com/cart/checkout, while both IE and FF show nothing.

# Answer
Admin ‣ System Administration ‣ Output and Debugging ‣ Redirection Method ‣ Location (faster).

Not sure why it defaults to the Windows option.
> 0 votes

---
Tags: cartthrob
---


# Question
Title: Take user straight to checkout (without adding items to a cart) using CartThrob
I've got a site where I'd like each order to contain just one product/item. Therefore, I want to bypass the step of adding an item to a cart, and being able to keep adding items to the cart (the reason I want to skip this is because I don't want the user to end up with more than one item in the cart when they go to the checkout).

I just want to take the user straight from a 'Buy Now' button to the checkout page, where they enter their payment details and complete the order. How would I go about doing this with CartThrob?

My usual workflow would be to use the Add to Cart form, then from there, go to the checkout page. I'm a bit unsure on how to cut out this 'Add to Cart' step in the middle though - I've tried using the checkout form with my 'Buy now' button, but I just get a message saying my cart is empty so I'm obviously going about this the wrong way.

# Answer
You can control what template a person gets sent to when they click on a button in the add\_to\_cart\_form and you can also control what's on that template.

The default templates that Cartthrob comes with are set up to have an update\_cart\_form, but you don't have to put that in there. Just include a form where you take the person's details inside a checkout\_form tag.

You've said you want to skip the add\_to\_cart\_form but have also said you want to go from the Buy Now button to checkout. The Buy Now button would be in your add\_to\_cart\_form so not sure why you think you need to skip that stage.
> 4 votes

# Answer
This worked great for me:
{exp:cartthrob:clear\_cart}

I just included it in the Add To Cart {embed} template, and that makes sure the cart is always empty before adding anything to it.
> 0 votes

---
Tags: add-on, cartthrob
---


title: Structure of an Extension

text:
# Question
Title: Structure of an Extension
I am trying to learn how exactly hooks and extensions are used. I am using expresso-store and have a function I need to call when the order is complete and gets to the success page (on hook '*store\_order\_complete\_end*') and two other functions that I need to call on events, both on a button click.

Could I include all three of these functions in one extension or does each function needs its own extension?

# Answer
> 3 votes
Extensions are for backend or server side stuff, whereas Modules can interact via the frontend or EE Control Panel. So an Extension captures a hook from another class, but can't capture a form submission or Ajax call from the frontend. Whereas a Module can't tap into a hook. But you can roll both an extension and a module into a single add-on (same name, shared folder, relevant separate files (ext.???, mod.???, etc).

Multiple hooks in a single extension: Multiple Hooks, One Extension

A Module would be able to capture the events via ACTion URLs. Example install code (upd.module-name.php):

```
    //###   Create ACTion IDs for the relevant functions   ###
    $formActions = array(
        "form_submission",
        "start_booking",
        "payment_notification"
    );
    foreach ($formActions as $method) {
        $data = array(
            'class' => $this->class,
            'method' => $method
        );
        ee()->db->insert('actions', $data);
    }//###   End of foreach

```

In the above example, my module has public functions for:

* form\_submission
* start\_booking
* payment\_notification

To render out the Action URL in your module (e.g. passing the ACTion URL to your frontend form or button click):

```
    $actionID = ee()->functions->fetch_action_id(__CLASS__, 'form_submission');

```

Although in theory, if your events triggered other modules or core EE functionality, e.g. Freeform, member login, etc, then you could use other hooks to tap into the event. But from your question, I'm guessing you want custom events not related to existing EE functionality or other add-ons.

# Answer
> 3 votes
It depends on whether the events that trigger the functions trigger a hook. If a button click, form submission, page load etc triggers a hook, then an extension is the right place for your custom functionality. If no hook is triggered and you need to respond to arbitrary clicks or form submissions, then a module or plugin would be appropriate.

You can react to any number of hooks in a single extension file and structure your code with as many public or private methods as you like in order to do so. Typically a single method will react to a single hook. However, after a hook has executed (or before), there's no way for other methods inside your extension file to get executed... they only exist in the context of the execution of a hook.

---
Tags: expresso-store, ee2, extension, hook
---


# Question
Title: Expression Engine Categories - Only super admin can change category on edit entry screen
I want to be able to give content members on my site the ability to choose which category an article should be listed within but at the minute only the super admin has this ability.

I've looked through the member group permissions and tried various options but nothing is working.

Thanks

# Answer
> 2 votes
Did you also check CP Home \> Administration \> Categories \> Specific Category Group \> Edit Category Group?

There are additional permissions settings there:

Can Edit Categories

Can Delete Categories

Also - are you sure you have assigned the category group to the channel, and also make sure you don't have a Publish Page Layout that is hiding the category options from non-superadmin users.

# Answer
> 0 votes
You need to go to Members \> Member Group \> Group in Question \> scroll down to Channel Posting Privileges \> Can Edit / Add New Categories and select yes for that member group as seen in the picture below:

---
Tags: categories, permissions, administration
---


title: Member Messaging

text:
# Question
Title: Member Messaging
I'm trying to integrate Comet Chat in my EE site. Whenever a message is sent in Comet Chat between two members of the site, I want that message to be stored in EE's native messaging system. Comet Chat is PHP based and resides on the same server as EE. In one of the hooks of Comet Chat, I have access to the sender's member id, receiver's member id, subject, message, etc.

**Is there a way I can insert this into EE's messaging without having to run a SQL INSERT query** (I'm worried that such an approach might cause potential problems in case I miss something)?

Alternatively:

* Does anyone know of a Comet Chat-like system that I can use with EE?
* Can someone give me some tips on what tables/fields I need to deal with when doing an INSERT into EE's messaging DB?

# Answer
> 1 votes
Unfortunately EE doesn't have a nice clean model for simply inserting a private message programatically.

If you were able to send your message data as a `POST`, and it would be happening during the active user's session, then you could possibly use the `Messages` library to do this, but it would also trigger any notifications for new message you have setup in EE, which you may not want.

You can explore further by looking at **/expressionengine//libraries/Messages.php** \- particularly the `send_message()` method.

But doing a direct insert is probably best. Do some test messages using EE, then inspect the `exp_message_data` and `exp_message_copies` tables to see how things are inserted. You'll also want to keep the `private_messages` column up-to-date in `exp_members`.

---
Tags: messages
---


title: Canadian taxes in cartThrob

text:
# Question
Title: Canadian taxes in cartThrob
I want to apply tax rule for canadian state in cartthrob . Can anyone guide me for that? Because the states/country dropdown has US states but not canadian states.

Thanks in advance.

# Answer
You need to change up your `locales` config.

> If you wish to modify the states and/or countries that are output, you can use your own custom list by renaming `system/expressionengine/third_party/cartthrob/config/_my_locales.php` to `my_locales.php` (remove the leading underscore) and editing that file.

http://cartthrob.com/docs/pages/locales\_config/index.html
> 1 votes

---
Tags: cartthrob, tax
---


# Question
Title: Add-ons for "batch" entry addition & tagging?
Are there any add-ons that can help speed up the process of adding large batches of images to an EE channel (that is, each image gets its own entry, rather than a gallery-per-entry situation) and applying specific tags to each batch of images? Or is the best approach to get Zenbu & Henshu to edit the entries after the fact? Does it handle tags?

# Answer
If you're able to compile all of your data into something like a spreadsheet, you may be able to use one of the import add-ons like Solspace Importer, Data Grab, or Data Import.

I've been using Solspace Importer for something similar to what you want to do, and it works well--and accomplishes a big chunk of the batch processing that I need.

However, in my case, after I run Importer to create and populate the entries, I need to do some custom SQL to translate the image file names that come from my spreadsheet into actual file entries in Assets, and into corresponding references in the Assets fields in the EE channel entry data.

So, if you use an import add-on, part of what you have to account for is the type of field you're using to store the image references. Each field type has it's own data structure in EE, albeit many store simply text in the regular EE channel data, and so don't require any special handling.

The above add-ons handle a bunch of different field types between them, so one or other may handle 100% of what you need. Otherwise, you might need to do some custom processing.

And, otherwise Zenbu & Henshu are probably the best way to go.
> 2 votes

# Answer
I have a similar requirement on a website (one image per entry and large number of uploads), I've tried several different solutions, including moving the galleries to a separate cms(koken), and here's my summary for you.

Currently there isn't a out-of-the-box solution for this type of gallery, unless you can somehow use the spreadsheet solution described above. Your solution is to choose either Assets or Channel Images(or other bulk uploader that I haven't tried) and write custom code that takes the uploaded photos and puts each one in its own entry. Then using Zenbu and Henshu you can do bulk cataloguing. There's a new version of Henshu in the oven that is perfect for this.

While choosing between uploaders you have to consider that some use GD library and others Image Magick, GD tends to screw up ICC profiles and that's why I looked for and external solution like Koken(and also for bulk cataloguing features), since then Channel Images started supporting Image Magick and with the new Henshu capable of the editing I need I'm moving back to a full EE gallery.

I hope this helps.
> 0 votes

---
Tags: tags, addons, zenbu
---


# Question
Title: Can't stop spam registrations, using Freemember
I'm having a nightmare with spam registrations! Can't seem to stop them.

We have changed the Profile Trigger Word to something completely random, and use Freemember to register members.

We have added the following Extensions:

* Accessible Captcha
* Hon-ee Pot Captcha
* VZ Bad Behavior

All work for me when I answer the wrong question, or enter the honeypot field.

I emailed one of the spammers email addresses (which are just random character emails at aol, gmail, and others), and got a bounce back saying it did not exist. I thought human spammers may at least use working emails.

Does anyone know why spam registrations can still happen?

Using EE 2.7.3

Thanks

# Answer
> 4 votes
Spam is an uphill battle, any solution made by man to stop it can be broken by man to abuse it.

The unfortunate truth is that traditional spam solutions are very short term and don't scale.

What I have noticed, though, is that on sites where similar things happen quite often the registrations stem from a couple of the same IPs and blocking them from the server cuts off the head (for the time being).

Take a look through some of the recent registrations and see if the IPs are shared. If they are add this to your `.htaccess` file

```
order allow,deny
deny from 192.168.0.1
deny from 192.168.0.2
deny from 192.168.0.3
[...etc...]
allow from all

```

and those IPs will be unable to even access the site.

Furthermore, consider using a service such as http://www.cloudflare.com/ \- you route your site via their service (there are free and paid plans) and you can benefit from CDN and optimisation plus anti-spam. Basically if they notice spammers on one Cloudflare powered site, they can be blocked across the entire network. Many large sites use it, and is a proactive and communal way to try to catch spammers out.

# Answer
> 2 votes
If you are not using the EE native member templates, then instead of making the trigger word a random word (might be difficult to guess, but can theoretically still be hit by spammers), you can simply add a hash in front of the trigger word so the URL can't be accessed, like:

`#member`

of if you are using a custom config file, you can do it like this:

`$config['profile_trigger'] = '#member';`

# Answer
> 1 votes
There is no fool proof way of preventing spam. Captcha solutions are obtrusive to the user experience and not very effective, which is why they are not recommended as the only line of defence. Eric Lamb has written a good article entitled "Avoiding CAPTCHA With ExpressionEngine" in which he also presents the solutions he recommends.

As the developer of Snaptcha, I can recommend it to anyone getting spam registrations, and in High Security Mode it is very effective against spambots. Keep in mind though that human spammers are a different breed altogether!!

# Answer
> 1 votes
Here's what I've done to completely stop spam members from registering on my default EE member registration forms while still allowing those forms to be used without needing any add-ons.

1. Make sure spam members are actually using the EE forms by adding a new member field that will be filled in with the current URL of the registration page. Hide it on the form `<input type="hidden" value="{current_url}" name="reg_url">`
2. In config.php (or config.master.php for Focus Lab's config) add this: `$config['profile_trigger'] = date('YmW');` \- This makes the "member" segment of the profile URL a numeric value based on the **Y**ear, **m**onth, and **W**eek. It will output like this -- 20140623 -- making the member URL for the week /20140623/register or /20140623/profile and so on.
3. To be able to link this in your templates, here's how to match the weekly URL segment: `{current_time format='%Y%m%W'}`. I usually put this in a snippet and just call the snippet in my template. Say my snippet is `{sn_member_dir_link}`, my template link will be `<a href="/{sn_member_dir_link}/profile">My Profile</a>`.

Setting the `profile_trigger` as the week's date is better than a random number if you need to access those templates on the front-end. If you don't need to use the native EE profile templates, just do this in your config.php: `$config['profile_trigger'] = rand(0,time());`

# Answer
> 0 votes
We've not had any spam registrations since:

1. Changing the registration template from /members/register to /members/join-now (not a spam prevention technique but may help prevent bots accessing known URLs)
2. Implementing jpunk11's solution of making the member profile trigger word inaccessible

I cannot say which was the solution as we did both the same time! My guess is they were using the native registration form even though we created a very random string for the trigger word. Stephen Callender's idea of storing the URL in the member profile would answer this.

# Answer
> 0 votes
Have you tried using the Blacklist/Whitelist Module? It's helped me a LOT in the past and I would highly recommend it! It comes with ExpressionEngine and is located under Modules. All you need to do is to make sure that your .htaccess file is writable by the server and you can set it up. That might also help!

---
Tags: freemember, registration, spam, captcha
---


# Question
Title: Getting To Know The EE Database Structure
I am new to ExpressionEngine2 and already working with it, but find the database structure very confusing coming from a pure OOP environment. What is an easy, fast way to actually find references or foreign keys / data that you are looking for?

# Answer
> 5 votes
My answer assumes you are for example trying to pull channel data manually. I'm not entirely sure of the OOP / Foreign key part of the question.

First you need to understand the `exp_channel_titles` and `exp_channel_data` tables. I will only go into the information that's relevant for basic database interaction.

**exp\_channel\_titles** contains the basic entry information without the custom fields. Think of the `title`, `url_title`, `sticky`, `entry_date` and so on.

**exp\_channel\_data** contains the custom field data of entries. The columns are named after the field id's that can be retrieved from the `exp_channel_fields` table.

So say you wan't to query a certain entry and you only have the `url_title` available you might want to do something like this:

```
SELECT
    `exp_channel_titles`.`title`,
    `exp_channel_data`.`field_id_1`
FROM
    `exp_channel_titles`
LEFT JOIN
    `exp_channel_data` ON `exp_channel_data`.`entry_id` = `exp_channel_titles`.`entry_id`
WHERE
    `exp_channel_titles`.`url_title` = 'lorem-ipsum';

```

Or this:

```
$result = ee()->db
    ->select('exp_channel_titles.title, exp_channel_data.field_id_1')
    ->join('exp_channel_data', 'exp_channel_data.entry_id = exp_channel_titles.entry_id')
    ->get('exp_channel_titles')
    ->result_array();

```

Of course this is a very simplistic scenario. There are fields that have tables of their own that need to be taken into the queries. In some cases this can get quite complicated.

If you want to find relationships between entries you need the `exp_relationships` table. It's a many to many setup where you have a parent and child id for the entries.

I hope this is what you are after.

---
Tags: ee2, mysql
---


# Question
Title: Display categories belonging to Expresso Store entries
It's easy to display categories in ExpressionEngine where entries are assigned using:

`{exp:channel:categories channel="products|book_library" category_group="13" style="linear" parent_only="yes" show_empty="no"}

{category_name}

{/exp:channel:categories}`

However we're using Expresso Store and wish to display only the categories for which a store entry exists (i.e. entries with prices set in the Store publish tab).

The reasoning being that we use two channels for products, a specific shop products channel (products) and then another (book\_library) where some entries will be available to buy, others will not.

Is there some way to do this without having to resort to some serious hackery?

# Answer
Hmm, probably hard to do in a categories loop. I would try using a product search loop (`{exp:store:search}`) along with the `search:price:min="0.01"` parameter (see the search paramater docs). You might have to do this once and silently assemble a PHP array of entry IDs and category IDs, sort them by category, then output in groups.
> 1 votes

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


title: Order by considering two fields?

text:
# Question
Title: Order by considering two fields?
```
{exp:channel:entries channel="ranking" order="points" sort="desc"}
{team} | {points} | {goals_scored} | {goals_against}
{/exp:channel:entries}

```

The code works fine,but when there are two teams locked at same points I want the Goal difference to take over the responsibilty of ranking teams.I do have the goal\_scored and goal\_against field.

How do I do this?

# Answer
> 3 votes
If by "Goal difference" you mean `{goals_scored} - {goals_against}`, you gonna have to write a custom query.

With the Channel Module, the closer you can get is to sort both fields in different directions:

```
{exp:channel:entries channel="ranking" orderby="points|goals_scored|goals_against" sort="desc|desc|asc"}
{team} | {points} | {goals_scored} | {goals_against}
{/exp:channel:entries}

```

Or, for a perfect result, code your own query:

```
{exp:query
sql="
SELECT
    ct.title AS event_title,
    ct.url_title AS event_url_title,
    ct.entry_id AS entry_id,
    cd.field_id_ID1 AS team,
    cd.field_id_ID2 AS points,
    cd.field_id_ID3 AS goals_scored,
    cd.field_id_ID4 AS goals_against,
    cd.field_id_ID3 - cd.field_id_ID4 AS goal_difference
FROM exp_channel_titles AS ct
JOIN exp_channel_data AS cd ON ct.entry_id = cd.entry_id
WHERE ct.channel_id = 2
AND ct.expiration_date NOT BETWEEN 1 AND unix_timestamp(Now())
AND ct.entry_date <= unix_timestamp(Now())
ORDER BY points DESC, difference DESC
"}
        {team} | {points} | {goals_scored} | {goals_against}
{/exp:query}

```

I added some fields that could be useful and prevented to show expired or future entries. You still need to change the IDs of the fields.

# Answer
> 1 votes
Another option if available in your build would be to use Stash. You could simply build a list containing the following for each `ranking`

* points
* team
* goals\_scored
* goals\_against
* goals\_difference (which you could calculate using something like mx calculator

You could then use multiple orders and sorts (amongst which the goals difference) when using `{exp:stash:get_list}`

Not tested but something along the lines of:

**Build list**

```
{exp:stash:set_list name="st_rankings" parse_tags="yes"}
    {exp:channel:entries channel="ranking" disable="categories|category_fields|member_data|pagination" dynamic="no"}
        {stash:item_team}{team}{/stash:item_team}
        {stash:item_points}{points}{/stash:item_points}
        {stash:item_goals_scored}{goals_scored}{/stash:item_goals_scored}
        {stash:item_goals_against}{goals_against}{/stash:item_goals_against}
        {stash:item_goals_difference}{exp:mx_calc expression="{goals_scored} - {goals_against}"}{/stash:item_goals_difference}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

**Output list**

```
{exp:stash:get_list name="st_rankings" orderby="item_points|item_goals_difference" sort="desc|desc" sort_type="numeric|numeric"}
    <h2>Team: {item_team}</h2>
    <p>Points: {item_points}</p>
    <p>Goals scored: {item_goals_scored}</p>
    <p>Goals against: {item_goals_against}</p>
    <p>Goals difference: {item_goals_difference}</p>
{/exp:stash:get_list}

```

---
Tags: ee2, orderby, sort, sorting
---


# Question
Title: how to upload image and create channel entry using simple html form in expression engine
how can i upload image in a channel using simple html form and create a new entry for every individual entry in channel.

i can't use channel form due to some issues so i have to upload it with simple html form

channel API can used for this.

any Idea how to do it.

# Answer
> 1 votes
You ideally should figure out a solution to the channel form error you are receiving, but as a possible workaround you will need to create your own add-on to do this.

This is usually best achieved with a module that makes use of ACTions to post your form submission, but as there might be issues with this given the fact that channel forms aren't working properly you might need to do this with a plugin instead.

As an example of a plugin that can do this, you would have as your form code:

```
<form action="upload_image" method="post">
   <input type="text" name="title">
   <input type="file" name="file">
   <input type="hidden" name="XID" value="{xid_hash}">
   <input type="submit" value="submit">
</form>

```

You would then create another template named "upload\_image" which contains your plugin tag, something like {exp:file\_upload} or whatever you choose to name your plugin.

Your actual plugin then would grab the input data using the EE Input Class for processing the posted data. You would then pass these stored variables to the EE Channel Entries API to create the actual entry. As file uploads can be sources of security breaches, you will want to do some php-based sanitization on the file uploads to make sure they are safe to store in your database and then subsequently be output in your site. To do this, you may want to try using the EE Upload Class which has some built-in security checks.

If you need help getting started with basic plugin structures, you should try making your own 'hello world' plugin by following the developer docs step by step here:

http://ellislab.com/expressionengine/user-guide/development/plugins.html

Once you understand the basics and can get your first plugin working, then you can apply the input class and upload class and channel entries API stuff to create your file upload plugin.

---
Tags: ee2, channel, channel-entries-api
---


title: Saving Credit Card Info

text:
# Question
Title: Saving Credit Card Info
I am working on a website in ExpressionEngine2 and need to save the user's credit card information in the database as I also need to display this in a dropdownlist in the front end (whichever credit cards are linked to the user)

Which is the best encryption method I can use to store the credit card details? I need to use the number again for processing payment. I suppose some kind of 2-way encryption?

# Answer
> 18 votes
**READ FIRST**: **Payment Card Industry Data Security Standard**

Do you really looked over all risks of this? The field encryption is not what you need to worry about in this case. I don't even want to advise something about encryption, because I feeling really bad even about this idea. It's no good solution to keep CC info secure enough this way .

To keep such sensitive information, your server must to be certified PCI compliant. It is means that you will needed to build a secure infrastructure & procedure around your server. It is really expensive.

The best way is use payment gateway for this. Other option is find tokenisation provider - certified organization which can keep such information. You need to check your bank - they possible provide such service. Or use third-party services - depended on area. For example for SA you can look on myGate.

# Answer
> 13 votes
**DO NOT STORE FULL CREDIT CARD INFO ON YOUR OWN SERVER.**

Even if encrypted, storing full credit card data on your own server is generally a very bad idea due to the security and legal ramifications should your website/database/server ever be compromised.

Many places store the last four digits of the credit card on their server for quick access or ease of identification, but only the last four digits. The full card can be associated with the account or payment selection with a payment gateway. Whichever gateway you are using may already have built-in functionality for this, like for example PayPal:

https://developer.paypal.com/docs/integration/direct/store-a-credit-card/

This way you do not have to store the actual card number on your server, but then you are still able to allow your site members to store different credit card aliases and last four digits so they can select the one they want to use. The payment gateway then assumes the risk, PCI compliance, and the complications involved in securing their servers and the stored credit card numbers so you don't have to.

If you do still want to pursue this, then this question is actually better posed at stackoverflow as secure database encryption and PCI compliance and sensitive data storage are not really EE-specific.

---
Tags: ee2, security
---


title: Solspace Search and Low Events

text:
# Question
Title: Solspace Search and Low Events
I am using Low Events and Solspace search and need a way of searching through Events by month and/or year. Where do i begin when searching through my low events field?

I realise i can use low search and will have to if there is no way, but i am already using solspace search so ideally would like to know if its possible.

My form currently has the following fields:

* Keywords
* Month
* Year
* Category

# Answer
As far as I know, Super Search cannot search directly in the low\_events database table, nor can it use the JSON encoded data in the native channel\_entries table. If you need to combine Low Events with a search, you'll have to use Low Search.
> 0 votes

---
Tags: solspace, supersearch, low-events
---


title: Installing The Free Version of EE2

text:
# Question
Title: Installing The Free Version of EE2
I downloaded the free/basic version of ExpressionEngine2 just to get use to EE and all of its features. How would I go about installing / setting it up on my pc? Would I follow the same steps as the commercial one, just without entering the serial key?

I love that there's a free version for beginners to get use to the system and it's inner workings, even though it's very basic..

# Answer
> 2 votes
Yes, EE Core installs and runs exactly the same as the full version: http://ellislab.com/expressionengine/user-guide/installation/installation.html

---
Tags: ee2
---


# Question
Title: Using a custom variable further up the page
I have a channel field with no results

**{if no\_results} set variable here {/if}**

I want to set a variable but use it further up the page

**{if my\_custom\_var != "empty"} do some layout stuff here {/if}**

# Answer
If a variable is dependent on an entries loop, you definitely have to run that loop first to get the results. From there, it's up to you whether you set the variable with something like stash or raw PHP. A good PHP example is available on Stack Overflow. Just make sure you have your template's PHP Parsing Stage set to "Output".
> 0 votes

---
Tags: parse-order, variable, pages
---


title: Assets 2.3.2 / Wygwam 3.3

text:
# Question
Title: Assets 2.3.2 / Wygwam 3.3
I’m getting an error when saving an entry. I do the following.

* edit entry
* select image in Wygwam (browse server opens Assets)
* save entry

When I save the entry I’ll see an example of the content with a wrong reference to the image.

For example:

http://www.nederlandsedansdagen.nl/uploads/images/Act\_Your\_Age/Act\_Your\_Age\_Nederlandse\_Dansdagen\_datum\_klein.jpg}" style="height:480px; width:480px”\>

Do you have any idea what’s wrong?

I use the latest version of Assets and the latest version of Wygwam.

Hope to hear from you.

Kind regards,

Jasper

# Answer
> 1 votes
The line of HTML you show has a } character at the end of the file name. Do you have an extra closing } in your template code?

---
Tags: assets, wygwam
---


title: No ability to choose Open/Close status

text:
# Question
Title: No ability to choose Open/Close status
With all of your help, I was able to port the live site to a development area and I thank you for all of your help.

This morning, I updated some images and, after submitting the changes, I went to look on the front facing portion of the dev site. Only the page was coming up, like a page set to close status.

I went back into the entry \> Options \> and there is nothing to select - Open/Closed are not available.

This was followed by going to Admin\> Channel Administration\> Status\> and both options are available.

I went to check other entries that I did not update any images and Open/Close - the status was available.

After which, I went into the db and ran this query:

```
SELECT *
FROM `exp_channel_titles`
WHERE STATUS = ""
LIMIT 0 , 30

```

The result set matched the entries that I was having issues with, and I changed the entries to status of "open" and everything is working as it should, which leads to my question.

What would prevent the status from being written to the database? Is there a file that I missed setting the permissions to 666 or 777?

Thanks in advance

# Answer
This is most likely caused because a "Status Group" isn't selected for the channel.

To check this, go to `Admin > Channel Administration > Channels`, then click on "Edit Group Assignments" for the channel having the issues. Your channel probably has "None" set for the "Status Groups". Change that to "Default Status Group" and click the Update button.
> 2 votes

---
Tags: entries, status
---


# Question
Title: I need to show channel entries in four columns and multiple rows ordered by latest entry first
I need to show channel entries in the form of a grid. The grid has four columns and five rows. Therefore I show the first 20 entries. I need to use pagination to show the next 20 entries. I am not able to think of how to accomplish this. Any help would be much appreciated.

# Answer
This is a use for the paginate parameter on the channel:entries tag

As a very simple example...

```
... start the table ...
{exp:channel:entries channel="foo" paginate="bottom" limit="20"}
    <tr>
        <td>{title}</td><td>{another_field}</td><td>{yet_another_field}</td
    </tr>
    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}
{/exp:channel:entries}
... close the table ...

```

EE will show a maximum of 20 rows and handle all the pagination for you

EDIT: From re-reading the question I see that you would be showing more than 1 entry per "row". Hence the answer referencing the modulus calculations.

Another way you might want to do it is to forgo the table completely (is a table the most appropriate element?) and use another HTML element that you can float across the page.
> 1 votes

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


# Question
Title: Assets 2.3.2 Lib file - Causes PHP error
After updating to the latest versions of the Assets extension for Expression Engine. When I am logged in as a Super Admin I get the following PHP error, I don't get this error when logged in as a different user.

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/Assets\_lib.php

Line Number: 814

This is caused by this following line of code in the Library file (line 814):

> if (!(count($full\_folder\_list) == 1 && $full\_folder\_list\[0\] == ":any:"))

Is there a fix for this line, I am not sure what:

> $full\_folder\_list\[0\] == ":any:"

means but this is the part that causing the error.

**I am looking for a fix for this?**

I am using Expression Engine 2.7.2

Assets Version 2.3.2

PHP Version 5.3

Thanks!

# Answer
Ugh, wasn't logged in properly....

They sent me this on email support:

*If you could just replace line 814 in Assets\_lib.php file with*

```
if (!(count($full_folder_list) == 1 && reset($full_folder_list) == ":any:"))

```

*you should be fine :)*
> 3 votes

# Answer
They sent me this on email support:

"If you could just replace line 814 in Assets\_lib.php file with "if (!(count($full\_folder\_list) == 1 && reset($full\_folder\_list) == ":any:"))" you should be fine :)"
> 0 votes

---
Tags: assets, pixelandtonic, php, php-errors
---


# Question
Title: Pagination Library on an Add-on Control Panel Page
I am updating the Link Vault add-on to paginate the report results in the control panel. For some reason, the link generated for the page 1 link always leaves off the defined suffix of query string parameters. Has anyone experienced this before? How do I fix it?

I verified that the $query\_string\_suffix variable is populated correctly. It must be since all the other pagination links are fine. It is just the page 1 or "first" link that is wrong. Why would all the others be fine?

```
// Setup the pagination links
$page_config = array(
    'base_url'          => $this->base_url.AMP.'method=reports',
    'total_rows'        => count($complete_report_data),
    'per_page'          => $data['limit'],
    'page_query_string' => true,
    'suffix'            => $query_string_suffix
);

```

Edit: I found this bug report from EE 2.5.5 but the known solution doesn't seem to describe code that is still located in the Pagination library.

# Answer
Don't add the module?

```
$base_url = 'C=addons_modules' . AMP . 'M=show_module_cp' . AMP . 'module=scheduled_trigger';
$root_url = BASE . AMP . $base_url;
$method_url = $root_url . AMP . 'method=';

```

Copied from Scheduled trigger, settings form the syntax changed slightly.

Edit: see also module tutorial, pagination is mentioned
http://ellislab.com/expressionengine/user-guide/development/module\_tutorial.html

Note to self: control panel links can/should be made with cp\_url() (EE 2.8+)
http://ellislab.com/expressionengine/user-guide/development/cp\_styles/index.html#cp-internal-links
> 0 votes

---
Tags: control-panel, pagination
---


# Question
Title: How do I order simple:Search results by channel?
I am using a simple:search form in the site footer to search specific channels and display results in search/results, but have not successfully been able to organize them per channel as of yet. Here is my search form:

```
{exp:search:simple_form channel="careers|leadership|news|product_entries|partner_entries|video|case_studies" search_in="entries" where="all" name="footer_search" result_page="search/results" no_result_page="search/no-results" status="not closed"}
        <input type="text" name="keywords" value="KEYWORDS" onclick="this.select()" id="search" />
        <input type="submit" class="button" value="Search »" />
{/exp:search:simple_form}

```

Here is my results code in search/results:

```
<section>
        {exp:search:search_results orderby="channel_short_name" sort="asc"}
            <h4>{if "{channel_short_name}" == "news"}News & Press{if:else}{channel}{/if}</h4>
            <p><a href="{if page_url}{page_url}{if:else}{auto_path}{/if}">{title} »</a></p>
        {/exp:search:search_results}
</section>

```

This produces results that don't actually order by the channel name, because partner\_entries and products will randomly display in the middle of a chunk of news results. This was the only way of ordering search results that I could find, and would like to be able to produce an organized outcome similar to the following example:

```
Results for {exp:search:keywords}:

News & Press
------------
- {title}
- {title}
- {title}
- {title}
- {title}

Products
--------
- {title}
- {title}
- {title}
- {title}

```

# Answer
The short answer is that you cannot sort by channel natively.

The long answer is that native search result ordering is determined by the search form itself so that the sorting can be done by the database when the search takes place. If an `orderby` field is present in the POST data, the sort can be customized with the following options:

```
<select name="orderby">
    <option value="date" >Entry Date</option>
    <option value="title" >Title</option>
    <option value="most_comments" >Most Comments</option>
    <option value="recent_comment" >Most Recent Comment</option>
</select>

```

You can set the order ascending or descending by including a `sort_order` input field set to the value of `asc` for ascending or `desc` for descending order.

Note that either of these can be set with hidden inputs if you like, but again, `channel_short_name` isn't an available sorting option (current as of v2.8.1).
> 1 votes

---
Tags: channel, search, simple-search, orderby
---


# Question
Title: using GWCode Categories, trying to exclude a category group and only show cats assigned to entry_id
I'm using the tag below to display the categories of an entry using the entry\_id. I'm using those categories to generate a form. I want to exclude specific category groups as they aren't needed in the form. When I use the tag below, the excl\_group\_id parameter doesn't work if the entry\_id parameter is included. if I remove the entry\_id parameter, the excl\_group\_id parameter works, but it then lists all categories for that channel and not just the selected categories from that entry...Is it possible to get that excl\_group\_id to work along with the entry\_id parameter?

```
{exp:channel:entries channel="products_beds" disable="categories|member_data|category_fields|pagination" url_title="{segment_4}" sort="asc" dynamic="yes"}

{exp:gwcode_categories entry_id="{entry_id}" channel="products_beds" style="linear" excl_group_id="4"}
    {!— code to generate form based on categories —}
{/exp:gwcode_categories}

{/exp:channel:entries}

```

# Answer
> 0 votes
I'm not sure why it wouldn't work but rather then delve into the GW code I'd simply use a conditional to remove the categories that aren't required. Should allow you to move on at least :)

```
{exp:channel:entries
  channel="products_beds"
  disable="categories|member_data|category_fields|pagination"
  url_title="{segment_4}"
  sort="asc" dynamic="yes"
}
    {exp:gwcode_categories entry_id="{entry_id}" style="linear"} //Should work without channel= tag
        {exp:switchee variable="{cat_id}" parse="inward"}
          {case value="4"}
            //Do nothing
          {/case}
          {case default="yes"}
            //Do something
          {/case}
        {/exp:switchee}
    {/exp:gwcode_categories}
{/exp:channel:entries}

```

---
Tags: categories, gwcode-categories, entryid
---


title: EE2 Use Of Action ID's

text:
# Question
Title: EE2 Use Of Action ID's
One of my pages in a website is a simple form to redeem a coupon (update the status of the coupon in the database). My update function exists in my own custom extension and I have added the id, class and function to the exp\_actions table in the database.

I know I have to use `$action_id = ee()->functions->fetch_action_id('Lb_cart_ext', 'redeem_coupon');` to retrieve the action id from the database and `{AID:Lb_cart_ext:redeem_coupon}` in the front end to use the action id in a link.

Where do I use/call the `$action_id = ee()->functions->fetch_action_id('Lb_cart_ext', 'redeem_coupon');` line?

# Answer
> 2 votes
If I am understanding this correctly what you need to go is create the form that will be displayed this is where you would pass the action id to the form. YEah this won't work in an extension. please move it to a module

How to do this you say, well let's say in your module you create another function that will generate the form and with all the required data and when you call this function on the front end it will display the entire for with all you fields required etc .

Eg this is in your module

//inside this you will get your action id

$action\_id = ee()-\>functions-\>fetch\_action\_id('Lb\_cart\_ext', 'redeem\_coupon');

// you will then pass your action id along with your other form data to a ee form //declaration function. you will first need to build your form data this is done like this

// Build an array with the form data

$hidden\_fields = array('ACT'=\> action\_id,'other\_hidden\_items'=\>$other\_Data);

```
$form_data = array(
    "id" => ee()->TMPL->form_id,
    "class" => ee()->TMPL->form_class,
    "hidden_fields" => $hidden_fields
);

```

// Fetch contents of the tag pair, ie, the form contents this gets your inputs you have add //to your form i.e your other inputs

```
$tagdata = ee()->TMPL->tagdata;

```

//finally declare the form with all the required form data

$form = ee()-\>functions-\>form\_declaration($form\_data) .$tagdata . "close form tags";

//return the form

return $form

}

On your template it will then look something like this {exp:module\_name:form class="test\_form"} //input name="fav\_car" //input submit type="submit" {/exp:module\_name:form}

Hope this helps

Thanks

# Answer
> 2 votes
Usually it is used for making form hidden fields in modules. In your case (for simple form) it is possible better to use **{AID:class:method}** tag in template:

```
<form method="post">
<input type='hidden' name='ACT' value='{AID:Lb_cart_ext:redeem_coupon}' >
<input type="hidden" name="csrf_token" value="{csrf_token}">
<input type="submit">
</form>

```

But I think it is first time when I see that somebody use it with extension. Don't even know if it will work.

I made couple tests - you can't use actions with extensions.

So you need to create module if you want proceed forms this way (**Bevin** describe it).

Alternative way is add **session\_start** or **session\_endt** hook and check for specific \_POST data to start proceed form by extension.

---
Tags: ee2, extension, act
---


# Question
Title: Expresso Store: Send Email X days after purchase
My client has requested that the site automatically sends users an email X days after their initial purchase.

Whilst I can probably work out some custom DB queries to get customers who had brought stuff X days ago are there any hooks I can use to trigger Expresso Store to send one if its own templates out?

Thanks in advance

# Answer
> 3 votes
A list of Expresso Store hooks can be found in their documentation here:
https://exp-resso.com/docs/extension\_hooks.html

I don't see a hook that does what you're asking. But you can build something on your own using the EE Email Class as detailed here:
http://ellislab.com/expressionengine/user-guide/development/usage/email.html

# Answer
> 2 votes
There is nothing built-in. You could as Anna mentioned build an extension that would allow to send it. There area few ways you could approach this, I have seen in the past an extension that changes the order status which triggers an email based upon the assigned status.

Alternatively you could use Objective HTML's PostMaster add-on. You would need to setup a parcel based upon the rules you want to trigger an email. Once the rule is triggered it will send the email out, the nice thing about this is that you can configure multiple parcels to send out multiple emails or different emails based upon what the user purchased.

The other option and an option that I see a lot of people use is to sign the user up to a MailChimp or CampaignMonitor list that will send out emails a set amount of days from being added to the list. This can be super handy if you have multiple emails that need to be sent out at certain times. The downside to this is that it is not as easy to pull in the purchased items to the email body.

# Answer
> 0 votes
Objective HTML Postmaster add-on takes care of all of your emails regardless of the condition! I strongly recommend using this add-on! Read the documentation and see for yourself..

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


# Question
Title: Can't output Channel Images data with Stash
I have the following template that sets values, including a set\_list for a Channel Images field, but I can't get the Channel Images data to be displayed in the stash layout;

```
{stash:embed:layouts:page}

{exp:channel:entries
    channel="shop-pages"
    disable="{global:channel_disable_basic}"
    require_entry="yes"
}
    {exp:stash:set parse_tags="yes" parse_depth="3"}
        {stash:meta}{exp:nsm_better_meta:template entry_id="{entry_id}"}{/stash:meta}
        {stash:page_title}{title}{/stash:page_title}
        {stash:page_entry_id}{entry_id}{/stash:page_entry_id}
    {/exp:stash:set}

    {exp:stash:set_list name="images" parse_tags="yes" parse_depth="3"}
        {cf_page_heroes}
            {stash:page_hero_image}{image:url}{/stash:page_hero_image}
            {stash:page_hero_title}{image:title}{/stash:page_hero_title}
            {stash:page_hero_description}{image:description}{/stash:page_hero_description}
        {/cf_page_heroes}
    {/exp:stash:set_list}

{/exp:channel:entries}

```

However, I can't get the Channel Images data to be displayed in the stash layout with the following code (it simply outputs the expressionengine tags);

```
<h1>{exp:stash:page_title}</h1>

{exp:stash:get_list name="images"}
    {stash:page_hero_image}
    {stash:page_hero_title}
    {stash:page_hero_description}
{/exp:stash:get_list}

```

Can anyone advisse what might be wrong?

Thank you.

# Answer
> 1 votes
The variables inside `get_list` should not be prepended with `stash:` \- You only do that when you're getting or setting a single variable directly, but it's your parent `get_list` tag which is doing the getting, so you should just get the vars as:

```
{exp:stash:get_list name="images"}
    {page_hero_image}
    {page_hero_title}
    {page_hero_description}
{/exp:stash:get_list}

```

---
Tags: stash, channel-images
---


title: ExpressionEngine 'loop'

text:
# Question
Title: ExpressionEngine 'loop'
I have a page in a website created with expressionengine. In my site, posts are shown with exerpt and by clicking the 'readmore" using {title\_permalink=''} you go to a 'single-post' page. On that template that is then shown i wan't to display some message from another channel, but the result is nothing... I do have result when i use the same code on the page where all the postst are.

Can one place a 'entries tag' on a page which is generated by a {title\_permalink=''}??

# Answer
When displaying channel:entries on a page where the url does not determine that particular conent, for example a sidebar list of recent entries you need to add the **dynamic="no"** parameter to your channel entries tag.
> 4 votes

# Answer
It doesn't matter how you link to the page, it matters what the current page's URL is.

Yes, you should be able to use a basic Channel Entries tag with a couple of important parameters. Note: Do not put one Channel Entries tag inside of another.

```
{exp:channel:entries channel="my_channel" dynamic="no" limit="5"}
  {title}
{/exp:channel:entries}

```
> 3 votes

---
Tags: channel-entries
---


# Question
Title: Handling back button happy users on member sites
We're working on an EE site where we have a multi page registration process using FreeMember. Works great but we're experiencing issues in testing with users opting to use the 'back button' in their browser which results in them being returned to a registration screen where they then re-attempt registration (confusion ensues).

On completion of registration they are automatically logged in. Is there some best practice to deal with such situations? headers to prevent caching of the registration page (not sure that will work) or a jQuery snippet to sniff if they are logged in and redirect to a profile edit page if they are?

# Answer
> 2 votes
Ultimately I've decided on the really rather simple solution as follows. An EE template at 'site/ajax\_is\_logged\_in' with the following markup:

```
{if logged_in}1{if:else}0{/if}

```

Then in the registration form template I use the following jQuery:

```
function is_logged_in() {
    $.get( "/site/ajax_is_logged_in", function(logged_in) {
        if (logged_in==1) {
            window.location.href = "/site/profile";
        }
    });
}

```

and just call it on page load. :)

# Answer
> 1 votes
You could add in a script that requires the page to reload/refresh if the user hits the back button. It's based on the time the page was first hit. Haven't tested this since I had it working on multi-page registration form.

```
<script type="text/javascript">
  $(document).ready(function() {
    var d = new Date();
    d = d.getTime();
    if ($('#reloadValue').val().length == 0) {
        $('#reloadValue').val(d);
        $('body').show(); // your site may not need this line
    } else {
        $('#reloadValue').val('');
        location.reload();
    }
  });
</script>
<input id="reloadValue" type="hidden" name="reloadValue" value="" />

```

---
Tags: jquery, freemember
---


title: Inconsistent URL paths

text:
# Question
Title: Inconsistent URL paths
Having some issues with paths on my build, i get a different output using {site\_url} to {path='site\_index'}, {site\_url} outputs the correct value but {path='site\_index'} outputs the correct value with lots of backslashes on the end, really can't work out why, any ideas as to why this would happen?

{site\_url} - outputs http://www.domain.co.uk/

{path='site\_index'} - outputs http://www.domain.co.uk//////////////////////

We're using the standard EE config.php and the correct URL is in general confiration. We're on v2.8.1 of EE and are using Structure, really can't think what else would be causing this?

# Answer
Turns out this was due to Transcribe, we needed to use {exp:transcribe:uri path="/"} paths!
> 2 votes

---
Tags: url, config, segments, transcribe, site-url
---


# Question
Title: Is it possible to change a Content Element Name when using Content Elements?
Is it possible to change a Content Element Name when using Content Elements? I can only see how to delete and re-add the Content Element from scratch, but you then lose all your data. I'm using Content Elements 1.6.10 and EE 2.8.1, and thanks in advance for any help.

# Answer
> 3 votes
Unfortunately, it's not currently possible (as of Content Elements 1.6.10) to rename a Content Element. The only workaround is to delete an element and create a new one. I've made a feature request for this to be added though.

---
Tags: control-panel, custom-fields, content-elements
---


# Question
Title: WYGWAM Increase Indent Not Working on Paragraphs
Since updating to WYGWAM 3.3 the ability to increase indent on text stopped functioning on standard paragraphs (ol and ul does work). Worse anything I had indented using this way has lost the styling for indents. I've looked at the configuration area but can't find anything that would cause this.

Any help would be greatly appreciated.

# Answer
> 5 votes
I was able to fix this by adding back in the indent block plugin from CKEditor. The process of doing so is as follows...

1. Download the CKEditor Indent Block Plugin. Make sure to download the version that matches the version of CKEditor being used by WYGWAM. Check the WYGWAM changelog if you're not sure.
2. Unzip and install that folder to themes/third\_party/wygwam/lib/ckeditor/plugins/
3. In the Control Panel, go to Add-ons -\> Modules -\> Wygwam.
4. Select the editor configuration you want to have this added to.
5. For the Dropdown "Add an advanced setting" choose "extraPlugins."
6. Paste "indentblock" without quotes into the field provided and click update.
7. Repeat 4 through 6 for any other editor configurations as needed.

Fair warning, you will need to add this plugin every time you perform a WYGWAM update. Ideally this originally standard feature will be added back in for a future release.

---
Tags: wygwam
---


title: Open_basedir error out of the blue

text:
# Question
Title: Open_basedir error out of the blue
I recently started getting errors in the control panel on a site that has not been touched in a while.

Message: is\_dir(): open\_basedir restriction in effect. File(/home/hosting/webs/mysite/mysite.com/web/themes/) is not within the allowed path(s)

Filename: libraries/Core.php

Any idea what could have caused the issue?

# Answer
> 2 votes
Have you checked with the hosting company? They may have updated the server software recently and enabled `open_basedir`.

P.S. You shouldn't post your real server paths publicly, it's a security concern.

# Answer
> 0 votes
It ended up just being a path issue. When they moved the install, they didn't update some of the paths to the new server path.

---
Tags: php-errors
---


title: How do you code your Home Page heroes

text:
# Question
Title: How do you code your Home Page heroes
In the past, I've mainly coded Home page Heroes the following ways:

1) individual channel tags with the offset parameter 2) Low Variables 3) Setup a custom feature that basically flags that the entry is for the hero. 4) an individual channel, and use the sticky functionality to designate which one should appear in the hero.

Trying to think of a creative way to code a Hero where there are 6 stories with one being the "Headline" Story for the day.

Any thoughts would be appreciated.

Thanks!

# Answer
You could use a a custom field - checkbox or dropdown so you know what the value will be - and a channel:entries tag pair using the search parameter to find entries with that value in the custom field.

You could use a status - but I dislike status because once you go past using just "open" statuses you have to declare all your status everywhere (IE the "featured" status entries won't show unless you tell them to even in places where they need to appear along with the open entries).
> 1 votes

# Answer
I would use the channel entries tags and set a limit to the number of post that show. Then I would only show the post that are made sticky. Below is an example of what I am talking about.

```
{exp:channel:entries  channel="news" limit="2"}

  {if sticky == 'y'}

    HTML code here....

  {/if}

{/exp:channel:entries}

```
> 0 votes

---
Tags: channel-entries
---


# Question
Title: Plugin Development - using template params in a function
I'm querying an external timetable database, and I need to get the start and end points of the journey to use in a hidden field.

My template code looks like this:

```
{exp:get_piers:departure_pier cruise_id="{cruise_id}"}

```

and

```
{exp:get_piers:arrival_pier cruise_id="{cruise_id}"}

```

{cruise\_id} is simply a numeric value that is set in the EE channel, but relates to the external database.

So I've created a plugin that looks like this:

```
class Get_piers {

    public $return_data;
    public $cruise_id;

    /**
     * Constructor
     */
    public function __construct()
    {
    $this->EE =& get_instance();
    //get cruise id from template tag
    $this->cruise_id = $this->EE->TMPL->fetch_param('cruise_id');
    //connect to external db
    $this->bookings_db = $this->EE->load->database('timetable', TRUE);
    }

// ----------------------------------------------------------------

/**
 * Departure Point
 */
function departure_pier() {
    $piers = $this->bookings_db->select('depPier')
            ->from('tbl_cruises')
            ->where('cruiseID', $this->cruise_id)
            ->get();
    return $piers->row('depPier');
    }

function arrival_pier() {
    $piers = $this->bookings_db->select('arrPier')
            ->from('tbl_cruises')
            ->where('cruiseID', $this->cruise_id)
            ->get();
    return $piers->row('arrPier');
}

```

The problem is that the value for $this-\>cruise\_id is showing in the query as '0', but if I try to return just the value for $this-\>cruise\_id (outside the sql), I get the correct number passed through from the template.

What am I missing? I'm guessing its something to do with visibility inside/outside the function, but having tried lots of alternatives, it just ain't working for me.

Can anyone offer any pointers?

# Answer
Numpty alert...fixed. The original code was in fact working fine, I had a stray tag in my template that had an empty parameter value - hence the null value in the SQL.

:-/
> 0 votes

---
Tags: add-on-development, plugin
---


# Question
Title: Multi Language - Transcribe channel entries page URI
How to set same page URI on page channel entries but shown in different language?

For example i have a 'contact' page entry which will shown as:

http://mysite.com/en/contact

and

http://mysite.com/nl/contact

how to set 'contact' page URI? because i've tried and EE mark it as error, i think because it should be unique.

but i know some site using EE transcribe and they can do it

currently i don't use channel entries for this page, but using template group

but then i wonder if my site will available in many languages, i have to create many template group and i am afraid if this page will not manageable easily

thanks,

# Answer
At its core, Transcribe provides three main functions for translating websites:

1. It lets you set up languages and will detect from the URL which of those languages the user wants.
2. It allows you to have different language versions of the same channel entry (e.g. About Us and Over ons) and (using step 1) gives you the correct language version in your `{exp:channel:entries}` tag.
3. It gives you variables to abstract out what would otherwise be hard-coded strings in your templates (you can create, for instance a variable called `{more_label}` which in English you would set to "Read More..." And in Dutch "Leer meer...").

In your case, since you are not using a channel entry, I see two easy choices:

* If your page contains just snippets of information to translate (for instance, form field labels for a contact form), and the templates look the same in both languages, you can make use of variables in the same template file. EE Harbor has good documentation.
* If you want to keep two template files for whatever reason (you don't want to use variables, your templates are different or the content is significantly different, that's just how you like it), you can have a contact/\_contact-en.html and a contact/\_contact-nl.html, and in your contact/index.html use the Transcribe tag `{transcribe:language_abbreviation}` to embed the right language:

`{if transcribe:language_abbreviation == "en"}
 {embed="contact/_contact-en"}
{if:else}
 {embed="contact/_contact-nl"}
{/if}`
> 1 votes

---
Tags: multi-language, transcribe
---


title: PHP parsing stage

text:
# Question
Title: PHP parsing stage
I seem to be a bind. I have this code below

```
...
foreach ($items as $item)
{

    ?>
    {exp:channel:entries
        channel="foo"
        search:field_name="<?php echo $item['some_key']; ?>"
        limit="1"
    }
        {if no_results}
            <td>None</td>
            <td>0.0</td>
        {/if}
        <td>{some_cost}</td>
        <td>
            <?php
                $price = number_format( floatval("{some_cost}") + floatval("{some_margin}"), 1);
                echo $price;
            ?>
        </td>
    {/exp:channel:entries}
    <?php
}
...

```

As you can see, I need to pass the value of a PHP variable into the channel entries tag. For this case, we want PHP to parse early, before EE tags. So that means PHP parsing stage should be set to "input"

But I also need to get the values of the EE tags inside the channel entries and compute them in PHP. However, that means that we want PHP to parse late, after EE tags are parsed. That could be done if PHP parsing stage should be set to "output"

Obviously, I can't set PHP parsing stage to both values.

Is there a way around this problem?

# Answer
Do this right way - do not follow the dark side.

Put all your php code into plugin. Your code is not good even from optimization way - not good solution to loop the channel entry. Just make function which will return list of

```
$item['some_key']|$item['some_key']|$item['some_key']|$item['some_key']

```

In this case you will do only one request of channel:entry. For calculation

```
$price = number_format( floatval("{some_cost}") + floatval("{some_margin}"), 1);

```

make one more function or use exist plugin (like MX Calculator);
> 3 votes

---
Tags: php, parse-order
---


# Question
Title: creating dynamic pages with Low Variables
I am trying to use low variables and the grid together to allow the client to create dynamic pages. I have the grid set up to create a title and then another field for the page content. I want to list the page titles on the side and when clicked shows the corresponding page content.

Is this possible? I have it currently populating the side column with the page titles with this code:

```
{exp:low_variables:pair var="lv_patient"}<li><a href="{path="patient/{exp:create_url_title}{lv_patient:page_title}{/exp:create_url_title}"}">{lv_patient:page_title}</a></li>{/exp:low_variables:pair}

```

I am then pulling in the page content with:

```
{exp:low_variables:pair var="lv_patient"}{lv_patient:page_content}{/exp:low_variables:pair}

```

Which just pulls in all the content not the stuff specific to the corresponding title.

# Answer
> 1 votes
I tend to agree with what's been said about LV versus regular Channel Entries in your case, but to actually answer your question...

I'd add a column to the LV Grid var, eg. `url_title`, where you enter a slug for that row. Then, using that slug in the URI, you can use the search:column\_name parameter on the Pair tag to filter out just that row:

```
{exp:low_variables:pair var="my_grid_var" search:url_title="={segment_3}"}
    ...
{/exp:low_variables:pair}

```

Note the `=` *inside* the parameter `search:url_title` to trigger exact matching. Also, it doesn't have to be a 'url\_title', but can be any column name that you can use to uniquely identify a row.

# Answer
> 1 votes
**Modular pages**

I have created dynamic/modular pages in the past. My favourite method so far is to create a set of modules as channels:

* video module
* Text Module
* Text and Image module (image left/image right setting)
* etc

I then create a modular page channel which is essentially just a title and a relationship/play field. Clients can then create and publish modules and then assemble / order these modules to create pages.

It is possible to reuse modules in various pages and, should the client need other modules, they can be easily created. Clients has maximum flexibility, while I retain as much control on the outputted code as possible.

**Low variables**

Regarding low variables, I look at it as global variables on steroids.

* Make all the bits and pieces of content that do not belong in a channel editable easily by the client (including "advanced" stuff like configuration options (yay for early parsing), homepage slider content, etc).
* Nice replacement for native snippets (the save as text option is a god send if you use git).
* etc

---
Tags: grid, low-variables
---


# Question
Title: Pass first level categories to switchee case value
I need to pass a list of the first level of categories to a nested switchee. The following works when I manually place the nested list. However I would like the client to be able to add/edit categories.

```
{exp:switchee variable="{segment_2}" parse="inward"}
  {case value="#^P(/d+)$#|category|''"}

    {switchee variable="{segment_3}" parse="inward"}

      {case value="walls|seating|workstation|training|private-offices|ergo|meeting-media-room"}{!--level 1 category listing--}
        first level category listing here
      {/case}{!--level 1 category listing--}

      {case default="yes"}{!--level 2 category listing--}

        2nd level category listing here

      {/case}{!--level 2 category listing--}

    {/switchee}{!--end nested switchee--}

  {/case}{!--listing & category listing--}

  {case value="value" default="yes"}
    single entry here
  {/case}{!--single--}
{/exp:switchee}

```

When I replace the case value list with the code below it doesn't work. I'm sure it's something to do with parse order, but am stuck. If I place the code below elsewhere in the template it outputs what I need.

```
{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:gwcode_categories}

```

Possibly this could be done with Stash, but I've never been able to grok how to use stash.

# Answer
> 2 votes
With Stash:

```
{exp:stash:set name="categories" parse_tags="yes"}{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:gwcode_categories}{/exp:stash:set}

{exp:stash:parse}
  {exp:switchee variable="{segment_2}" parse="inward"}
    {case value="#^P(/d+)$#|category|''"}

      {switchee variable="{segment_3}"}

        {case value="0|{stash:categories}"}{!--level 1 category listing--}
          first level category listing here
        {/case}{!--level 1 category listing--}

        {case default="yes"}{!--level 2 category listing--}

          2nd level category listing here

        {/case}{!--level 2 category listing--}

      {/switchee}{!--end nested switchee--}

    {/case}{!--listing & category listing--}

    {case value="value" default="yes"}
      single entry here
    {/case}{!--single--}
  {/exp:switchee}
{/exp:stash:parse}

```

# Answer
> 1 votes
`parse="inward"` is the villain here. Switchee is being parsed before the `exp:gwcode_categories`.

Since I believe you need the parameter, your option is to force `exp:gwcode_categories` to be parsed early. Let's try using embeds.

```
{embed="group/template" categories="{exp:gwcode_categories channel="products" depth="1" style="linear" backspace="1"}{cat_name}|{/exp:gwcode_categories}"}

```

Then, on embed:

```
{exp:switchee variable="{segment_2}" parse="inward"}
  {case value="#^P(/d+)$#|category|''"}

    {switchee variable="{segment_3}"}

      {case value="{embed:categories}"}{!--level 1 category listing--}
        first level category listing here
      {/case}{!--level 1 category listing--}

      {case default="yes"}{!--level 2 category listing--}

        2nd level category listing here

      {/case}{!--level 2 category listing--}

    {/switchee}{!--end nested switchee--}

  {/case}{!--listing & category listing--}

  {case value="value" default="yes"}
    single entry here
  {/case}{!--single--}
{/exp:switchee}

```

There's yet some room for improvement here. For example, you're checking for `segment_3` even if `segment_2` is empty.

---
Tags: switchee, template-scripting
---


# Question
Title: Unable to Edit Categories via Channel Entry
I'm unable to Edit Categories under the Categories tab of a Channel Entry view. When I click on Edit Categories nothing happens. Looking at Console this is the error it produces:

```
Uncaught TypeError: Cannot read property 'clone' of undefined

```

I've been using EE for four years and have never had this issue. Any thoughts?

Using EE 2.8.1.

# Answer
Sounds like this is a known js error - maybe patch here will work? https://support.ellislab.com/bugs/detail/20237
> 2 votes

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


# Question
Title: How do I allow users to add a snippet without having to access the template?
I want to setup a bunch of snippets (or even embeds?) and give users the ability to place these within their pages, but without having to create special templates or pre-defining where in the template each item should be. I know I can setup channel fields that simply toggle them, but I want users to have more control in terms of where they go. For example, I want all 'pages' to use a single template {pages/index} which has 3 columns, where the user has the flexibility to pull in different snippets in different places. Here's few examples of the snippets I'd want users to be able to place themselves:

* sitemap: user should be able to add page copy then pull in the snippet in whichever column they see fit
* latest news/blogs: user may want to show these on some pages and not others - maybe in different places
* call to action/advertisements: some pages may need these, some not, again maybe in different places, perhaps to 'fill' blank space depending on how long their main content is
* newsletter signup/quick contact forms: the user should be able to put these wherever they want

It would be awesome if you could just add {snippet\_name} inside a WYSIWYG, but clearly it doesn't work. Does anyone know how to achieve this?

# Answer
Snippets are not intended to be used by / known by end users. They are developer tools for making your code more DRY - not so much to hold content. This is why the access to them is through the Templates area of the CP rather than the Content area.

Here is one approach to allowing users to create different sidebars - note that you could use the native relationship tools to do this now as they have added features since this was written: http://www.train-ee.com/courseware/free-tutorials/comments/flexible-sidebars-using-playa/

I have built upon that approach by using a large Matrix/grid field that allowed the end user to build out a page in a lego-building block fashion, but the vocabulary of blocks was relatively limited.

Overall though what you describe is a system that assumes much more control on the part of users than what I have usually built in ExpressionEngine. EE is a content management system that assumes a pretty controlled layout and lets users manage content within that layout.

You may want to investigate a more "page-based" CMS that allows users to create pages vs. just manage content.

Or, there are tools like http://devot-ee.com/add-ons/content-elements that swing EE back towards a more page centric system.
> 3 votes

---
Tags: embeds, snippets
---


# Question
Title: Solspace User - editing member categories in CP
Can an EE administrator with CP access be able to re-assign member categories from the EE member admin area? I have a Solspace User reg form that allows the user to select from a list of categories, question is how can administrators edit those categories on a per member basis from within EE CP?

# Answer
> 0 votes
Unfortunately this feature isn't available for the CP. I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions

Alternatively you could use the `{exp:user:edit}` form (http://www.solspace.com/docs/user/edit/) on a front-end template only accessible by admins and let them manage categories for users from there.

Lastly, you could work in the exp\_user\_category\_posts table, but we can't recommend you doing that unless you know what you are doing.

---
Tags: solspace-user
---


title: Newsletter for product catalog

text:
# Question
Title: Newsletter for product catalog
My client want to send a newsletter with a product's catalog to his customers

Is it possible with Postmaster? I thought that I need to create a template with custom fields, then the clients publish entries and use "comunicate" to send the newsletter

I don't know if it's possible or is the right way, 'cause I never developed a site with this functionality

Thanks in advance :)

# Answer
I would encourage the client to use a third party service such as CampaignMonitor or MailChimp. This will give you more reliable deliverability, excellent reporting and list management, as well as safeguarding your domain name against ISP blacklisting for unsolicited spam.

You can then integrate these services with EE. For example, something I've done before is to create an 'emails' EE channel and use relationship fields to pull in various articles and news items into an html email web page, complete with all the necessary CampaignMonitor tags for dynamic salutations, unsubscribe links and all the legal stuff that you are required to put on such mailings. CampaignMonitor then allows you to import the email directly from the web page.

I believe there are some ways you can integrate these services more tightly, but I've found this to be sufficient for my needs.
> 5 votes

---
Tags: postmaster, mailinglist, newsletter
---