title: Mollie - issuer field issue

text:
# Question
Title: Mollie - issuer field issue
sligtly duplicating the following question (Store - The Issuer field is required) but i really need someone to pick this one up.

Using the MOLLIE gateway on a project. Problem is i keep getting the "The issuer parameter is required" error. Mollie is an intermediate gateway for providing iDeal payment solutions.

It requires the client to make a selection via what bank they want to make their payment. So on my site i need to populate a dropdown with the banknames Mollie's got on file (they change this list when a bank goes offline). The gateway files already contains a method for doing this gateway.php function fetchIssuers.

I can't seem to be able to print this list out in the templates however. The documentation does refer to an simular issue with a direct iDeal implementatie

\< select id="payment\_issuer" name="payment\[issuer\]" \> {ideal\_issuer\_options} \< /select \>

Rewriting this to {mollie\_issuer\_options) etc doens't result in the desired effect or producing a list of banks in the select.

More troubling however is that when I populate the list manually it also doens't seem to take effect. I've tried it with different names/id's on the select but no joy on any of them. The one's ive tried are "issuer", "bank\_id", "payment\_issuer" and "payment\[issuer\]".

So let's try and attack these problems as methodical as possible.

1. What would the correct syntax be for printing the list of banks that's being mentioned in the gateway.php function fetchIssuers?
2. What would the correct naming convenstion be for this field so it can be processed in the class PurchaseRequest contained in the Mollie/Messages/PurchaseRequest.php file?

With these answers i'll check the system will start working and if not report back here for additional information.

With kind regard, Bas van Ginkel

# Answer
The issuers field was missing from Store 2, and this has recently been fixed in Store 2.1.

From the release notes:

> Added {gateway\_name:issuer\_options} variables for gateways which provide a list of issuers

The Mollie-specific documentation needs updating, but the correct syntax for the issuers variable in Store 2 is `{gateway_name:issuer_options}`. So you would use this in your templates like so:

```
<!-- inside your {exp:store:checkout} tag on the final page -->
<select name="payment[issuer]">{mollie:issuer_options}</select>

```

This should pre-populate with a list of banks provided by Mollie for your customer to select.
> 3 votes

---
Tags: expresso-store, payment-gateway
---


title: Store - The Issuer field is required

text:
# Question
Title: Store - The Issuer field is required
I have an issue with the Mollie payment method. I keep getting this error "The Issuer field is required."

Any ideas why?

# Answer
> 1 votes
From my understand of Mollie gateway it uses iDEAL gateway and iDEAL requires that you supply a card issuer field. From the documentation for the iDEAL gateway you would need to add:

```
<select id="payment_issuer" name="payment[issuer]">
  {ideal_issuer_options}
</select>

```

For the field to be filled properly.

# Answer
> 0 votes
The Mollie gateway works similarly to iDeal. In Store 1, you need to add the following code to your template on the final page of your checkout:

```
<select name="payment[issuer]">
    {mollie_issuer_options}
</select>

```

In Store 2, this variable has been renamed to `{mollie:issuer_options}`, so use this code:

```
<select name="payment[issuer]">
    {mollie:issuer_options}
</select>

```

This will pre-populate with a list of banks (issuers) automatically fetched from Mollie. Your customer can select one of these, and will then be redirected to the correct website for payment once they submit the form.

---
Tags: expresso-store
---


# Question
Title: Can I add more countries to Exp:resso Store shipping options?
What's the best way to add additional countries to the system with Store 2.x? I see a button in the CP to add a new state option to a country, but no control for adding a new country. Is it possible to do without diving into the database and adding records directly?

# Answer
> 2 votes
Store 1 uses EE's internal list of countries at `system/expressionengine/config/countries.php` as Justin mentioned.

Store 2 has its own list of countries at `third_party/store/data/countries.php`. When Store is installed, these are copied into the `exp_store_countries` database table.

So if you're feeling revolutionary, and you have already installed Store, the best option is to simply update the `exp_store_countries` table directly. There is no control panel interface for this, but there's no danger in doing it and your changes won't be overridden with any future upgrades.

# Answer
> 1 votes
Store picks up the countries from the `/system/expressionengine/config/countries.php` file. The countries are stored in an array in that file so you can just add any new countries to that array and they should appear in Store.

---
Tags: expresso-store
---


# Question
Title: Can variables be used in Freeform notification template settings?
I've set up a notification template to notify the site owner when a form submission is received. I'd like to have the email notification be from the person who filled out the form and the from email to be their email, not the site owner's. Can I use form field variables in the notification template options to do this? If so, how should they be entered there (e.g., in brackets, just the field name, etc.)?

# Answer
Yes, you can use any of the fields which exist in the form with which that notification template is related, via standard EE syntax (e.g., `{name}`, `{email}`, etc).
> 1 votes

---
Tags: solspace-freeform
---


# Question
Title: Display channel search result was found in
I'm wondering if there's any way to display the channel a search result was found in on the search results page. I have about 6 channels and I want to be able to search all of them with one search form. It gets confusing with the results though because some channels have entries with the same or a similar name. Is there anyway to include the channel the result is located in in the search result page? I haven't yet been able to really find any way of displaying the channel an entry is in yet.

Thanks for the help!

# Answer
> 2 votes
Yup: `{channel}`. Note that all of the Channel Entries variables are available within the Search Results tag.

---
Tags: ee2, search, simple-search
---


# Question
Title: How to prevent CartThrob from making hundreds of SQL queries and running extremely slow?
this may be somewhat of a noob question as I just started administering an ExpressionEngine site that uses CartThrob. My client complained of the site being slow during the shopping / checkout process so I enabled SQL profiling in EE to look into it.

I noticed something strange, which is that CartThrob is making many queries during each page load, far more than I would expect. Basically the page template uses

```
exp:cartthrob:add_to_cart_form

```

six times to show six different products. Then uses

```
exp:cartthrob:item_options

```

within each one to pull some various information about the product. The strange thing is that a single SQL SELECT and another SQL UPDATE query seem to be running over and over again on the same page (each of them runs over 50 times on one page load).

```
SELECT `cart`
FROM (`exp_cartthrob_cart`)
WHERE `id` = '12345'
LIMIT 1;

UPDATE `exp_cartthrob_cart`
SET `cart` = 'a-bunch-of-encoded-gibberish',
    `timestamp` = 1386624719,
    `url` = 'http://example.com/product-details'
WHERE `id` = '12345';

```

Why would cartthrob be running these same queries over and over again, and how can I optimize this code to prevent it?

# Answer
> 3 votes
Sounds like a poorly coded template... First, you should aim to refactor it using the `multi_add_to_cart_form` instead of the simple `add_to_cart_form`:

http://cartthrob.com/docs/tags\_detail/multi\_add\_to\_cart\_form/index.html

This will give you a single form for all 6 products so should reduce CT's load by 6X. You should then look into other optimisations and caching strategies for further gains (in particular, try to minimise or eliminate usage of EE's `embed` tag). It's likely that if the previous developer missed the multi\_add\_to\_cart\_form they probably missed a lot of other things...

---
Tags: cartthrob, mysql, performance, sql
---


# Question
Title: How do I install a new control panel theme?
I can't get the themes to work, it just shows "default" in the theme drop-down box. Have coppied everything into the right places in my EE installation, apart from the asset folder, no idea where that is supposed to go. Can anybody shed any light on this at all please? Many thanks!

# Answer
> 2 votes
Control panel themes are installed in the `DOCUMENT_ROOT/themes/third_party` directory. After placing the theme in there, you should see it in the list in the control panel general preferences.

---
Tags: cp-themes
---


# Question
Title: Fatal Error Message in EE CP when I want to open a template pr submit changes to a template
Sorry very new to EE. What do I do to sort out the following error

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 49 bytes) in /home/content/94/9617594/html/control/codeigniter/system/database/drivers/mysql/mysql\_result.php on line 147

Thanks

# Answer
> 1 votes
the same issue as in Templates in CP take over 4 minutes to load. Happens because too many template publications in DB (67k templates records in exp\_templates table).

---
Tags: templates, control-panel, admin
---


# Question
Title: Templates in CP take over 4 minutes to load
When I click on design/template/edit/XXXX/index or view the page is taking over minutes to load. Same issue under ADMIN. All othe sections load super fast.

related question Fatal: Error Message in EE CP when I want to open a template pr submit changes to a template

> Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 49 bytes) in /home/content/94/9617594/html/control/codeigniter/system/database/drivers/mysql/mysql\_result.php on line 147

# Answer
ok. Let summarize:

Hosting: Goddady

EE version: **2.1.3**

Do you use "Save Templates as files" option (*Design \> Template Manager \> Global Template Preferences*): **Yes**

Why templates is load so slow? You have 24 uniq templates

```
SELECT DISTINCT(template_name) FROM `exp_templates`

```

but **67866** records (49 Mb) in exp\_templates table. I can't tell you why this happens (is not good strategy to spend time to debug soo old version. Can be something with file permissions or ee bug), but you not uniq with this issue and version 2.1.3

My recommendation:

1. check if you template folder (\*/themes/site\_themes\*) have a good permissions
2. check if you have the last template version in files
3. backup db
4. cleanup exp\_templates table
5. recreate templates
6. **update your EE version**
> 2 votes

---
Tags: templates, control-panel, memory-limit
---


title: Calendar weekend days

text:
# Question
Title: Calendar weekend days
I am using solspace calendar. The weekend in our country is during Friday and Saturday. I would like to show the dates which are during the weekend in different color. Can anyone help me?

# Answer
Please, try this:

```
{if '{event_start_date format="%w"}' > 4} class="weekend" {/if}

```

`%w` returns the day of the week, from 0, for Sunday, to 6, Saturday.

`event_start_date` is available on both `exp:calendar:events` and `exp:calendar:cal`.
> 2 votes

# Answer
{exp:calendar:cal calendar\_id="218" enable="categories" {if segment\_3 == ''} date\_range\_start="year-month-01" date\_range\_end="year-month-last" {/if} {if segment\_3 != ""} date\_range\_start="{segment\_3}-{segment\_4}-01" date\_range\_end="{segment\_3}-{segment\_4}-last" {/if} } {display\_each\_month} {date format="%F %Y"} {display\_each\_day\_of\_week} {day\_of\_week\_short} {/display\_each\_day\_of\_week} {display\_each\_week} {display\_each\_day} {if day\_in\_current\_month} {date format="%j"} {if:else} {date format="%j"} {/if} {if day\_in\_current\_month} {display\_each\_hour} {events} 0} index\_difference\_{all\_day\_event\_index\_difference}{/if} "\> {/events} {/display\_each\_hour} {/if} {/display\_each\_day} {/display\_each\_week} {/display\_each\_month} {/exp:calendar:cal}
> 0 votes

---
Tags: solspace-calendar
---


# Question
Title: Item description from STORE to PayPal Express
I want to pass the item description from STORE to PayPal Express. At the moment in PayPal I see only the order number. All the other details are passed such as billing details, but not an item description.

I installed the CI Merchant GitHub Forkbut its still the same? I made sure I replaced the current file with: system/expressionengine/third\_party/store/ci-merchant/libraries/merchant/merchant\_paypal\_base.php

Does anyone have any idea what I am doing wrong or if anyone knows if its possible to pass an item or product description from STORE to PAYPAL.

I'm using the latest version of both EE and Store.

Many thanks

Graham

# Answer
you'll need to modify `merchant_paypal_express.php` if you want to include transaction details with the payment request.

On or around line 84 you'll see the `_build_authorize_or_purchase` method where the details are passed on to Paypal. You'll need to edit this to include the description with the OrderDescription.
> 1 votes

# Answer
I believe the latest store update does exactly this

https://exp-resso.com/docs/release\_notes.html
> 1 votes

# Answer
**Just Change your paypal url to **

"https://www.paypal.com/cgi-bin/webscr?cmd=\_express-checkout&token=$your\_token&useraction=commit"
> -1 votes

---
Tags: expresso-store, paypal-express-checkout
---


# Question
Title: What is the easiest way to display author information on channel entries in a template?
In EE 2.7.2,

If you have a channel where there are various authors to different articles, is there a way using the full version of EE to simply show some fields based on the author? The goal would be to display custom author fields. The code might look something like what you see below.

```
{exp:channel:entries channel="articles" orderby="date" sort="desc" limit="10"}
    <a href="{title_permalink='channel/comments'}">{title}</a><br>
    <div>{author_name}|{author_favorite_sport}</div>
{/exp:channel:entries}

```

I do have Solspace User installed, as well as my own custom module, but it just seems that I'm overthinking this somehow.

TIA for any help!

# Answer
> 3 votes
You'd do it precisely as you have done.

If you use the custom member fields within a channel entries tag loop then you will output information about the author of the entry being displayed.

You don't need any custom add-ons to do this.

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


# Question
Title: Sub categories information not being displayed
I have the following code within a template

```
<h1>{segment_2_category_name}</h1>
{exp:channel:categories show="{segment_2_category_id}" style="linear" parent_only="no"}

    {category_description}

    {if content-image}
        {exp:ce_img:pair src="{content-image}" max_width="328"}
         <img src="{made}" alt="{segment_2_category_name}">
        {/exp:ce_img:pair}
    {/if}
{/exp:channel:categories}

```

This displays the category description, category image etc. and it works fine for top level categories. However, it doesn't display anything but the title for sub-categories.

I have checked whether {segment\_2\_category\_id} is being parsed by placing it inside the channel:categories tag and it outputs the ID as expected.

Does anyone have a clue why this might not be working?

UPDATE: Removing the ce\_img tags makes no difference.

You can see the pages concerned here;

http://www.gillardcutting.com/applications/food-extrusion (top level cat)

http://www.gillardcutting.com/applications/dog-chews-dental-sticks (sub cat)

**UPDATE**

I've created a test template, cut back to the bare bones, in order to analyse the queries being run. The following query is executed;

```
SELECT LOWER(cat_url_title) AS cat_url_title, `cat_id`, `parent_id`, `group_id`, `cat_name`, `cat_description`, `cat_image`
FROM (`exp_categories`)
WHERE `site_id` =  '1'
AND LOWER(cat_url_title) IN ('applications', 'test', 'dog-chews-dental-sticks')
AND `group_id` IN ('3', '2')

```

If I run this query directly on the database then I get back the expected category information.

It's as if, for some reason, the stuff between the opening and closing exp:channel:categories tag pair just isn't being parsed IF I'm dealing with a sub-category.

This site is running on EE 2.4 (so next step is to try an update) and is using Structure as well as Low Seg2Cat but I don't think either of these is the issue as everything is working as it should except for this particular issue (and even then only with subcategories).

**UPDATE**

It appears that I must specify the parent category ID in order to get any child category information to display. This is despite my earlier finding regarding the query that is being executed.

Even adding parent\_only="no" does not allow me to display child category data without also having the parent category included.

Is this an intentional feature or just some peculiarity/bug relating to the version of EE that this site is running?

**Guess what? Another UPDATE - Workaround fix**

I've figured out a workaround based on my findings, it's not perfect by any means and will break quite easily but will work OK in this particular instance.

Basically;

I include the seg2cat tag to get the current category's parent id and include this in the show parameter, this ensures we can display the child data.

To ONLY show the child data I then use a conditional to check the category being output in the loop against the seg2cat category id and only show it if it's the child category.

```
{exp:channel:categories show="{segment_2_category_parent_id}|{segment_2_category_id}" parent_only="no" style="linear"}
    {if '{category_id}' == '{segment_2_category_id}'}

        {category_description}

        {if content-image}
            {exp:ce_img:pair src="{content-image}" max_width="328"}
                <img src="{made}" alt="{segment_2_category_name}">
            {/exp:ce_img:pair}
        {/if}
    {/if}
{/exp:channel:categories}

```

If anyone can come up with a better way to do this I'd love to know!

# Answer
I've figured out a workaround based on my findings, it's not perfect by any means and will break quite easily but will work OK in this particular instance.

Basically;

I include the seg2cat tag to get the current category's parent id and include this in the show parameter, this ensures we can display the child data.

To ONLY show the child data I then use a conditional to check the category being output in the loop against the seg2cat category id and only show it if it's the child category.

```
{exp:channel:categories show="{segment_2_category_parent_id}|{segment_2_category_id}" parent_only="no" style="linear"}
    {if '{category_id}' == '{segment_2_category_id}'}

        {category_description}

        {if content-image}
            {exp:ce_img:pair src="{content-image}" max_width="328"}
                <img src="{made}" alt="{segment_2_category_name}">
            {/exp:ce_img:pair}
        {/if}
    {/if}
{/exp:channel:categories}

```

If anyone can come up with a better way to do this I'd love to know!
> 1 votes

# Answer
can you try this.. if you don't mind using GWcode Categories plugin.

```
<h1>{segment_2_category_name}</h1>
{exp:channel:entries channel="applications" limit="1"}
{exp:gwcode_categories cat_url_title="{segment_2}" style="linear"}
{category_description}
{if content-image}
{exp:ce_img:pair src="{content-image}" max_width="328"}
<img src="{made}" alt="{segment_2_category_name}">
{/exp:ce_img:pair}
{/if}
{/exp:gwcode_categories}
{/exp:channel:entries}

```
> 2 votes

# Answer
What happens if you add a channel parameter to the tag? Does that change anything?
> 0 votes

---
Tags: templates, categories
---


# Question
Title: Redirect multi language site based on IP address
I have a multi language site (using Transcribe addon) and I would like my users to be redirected to the correct language based on their IP address.

My goal is that when a user visits the root homepage http://www.example.com it will redirect them to http://www.example.com/en if their IP address is from the UK or http://www.example.com/fr is they are from France for example. But once they are on a language they are not redirected. I’ve tried the native IP nation addon but it didn’t seem to work very well so I’ve used the IP Geo addon at http://devot-ee.com/add-ons/ipgeo. But I’m having loads of problems with rewriting the homepage with htaccess, forcing the correct redirect with Transcribe, template parsing order etc… So I’m thinking of starting from fresh if anyone can give me suggestions on how best to do this.

# Answer
> 1 votes
Doing a similar thing for a site now and here's what we're doing:

1. Enable the IP to Nation module
2. Install and activate the Clive Zagno ipgeo plugin
3. Add code below to EE - we put it in a snippet snp\_html-header
4. Set Transcribe to always use a language abbreviation in the url

```
{if "{transcribe:language_abbreviation}" == "es"}
  {if "{exp:ipgeo:code}" != "ES"}
    {redirect="index.php?ACT=23&lang=en" status_code="301"}
  {/if}
{if:elseif "{transcribe:language_abbreviation}" == "de"}
  {if "{exp:ipgeo:code}" != "AT" && "{exp:ipgeo:code}" != "DE" && "{exp:ipgeo:code}" != "CH"}
    {redirect="index.php?ACT=23&lang=en" status_code="301"}
  {/if}
{if:elseif "{transcribe:language_abbreviation}" == "fr"}
  {if "{exp:ipgeo:code}" != "BE" && "{exp:ipgeo:code}" != "FR"}
    {redirect="index.php?ACT=23&lang=en" status_code="301"}
  {/if}
{if:elseif "{transcribe:language_abbreviation}" == "it"}
  {if "{exp:ipgeo:code}" != "IT"}
    {redirect="index.php?ACT=23&lang=en" status_code="301"}
  {/if}
{if:elseif "{transcribe:language_abbreviation}" == "nl"}
  {if "{exp:ipgeo:code}" != "BE" && "{exp:ipgeo:code}" != "NL"}
    {redirect="index.php?ACT=23&lang=en" status_code="301"}
  {/if}
{/if}

```

I hope this helps you or someone else.

**Edit:**

Expanding on this, if you have root access you can install the php5-ipgeo module and add a global variable. That way you don't need the extra two EE addons.

In index.php:

```
if (function_exists('geoip_country_code_by_name')) {
    $assign_to_config['global_vars'] = array('global_country-code' => geoip_country_code_by_name($_SERVER['REMOTE_ADDR']));
}

```

# Answer
> 1 votes
I gave up with doing this with the Transcribe addon and did it client side instead....

```
// if at root homepage
if (/^http(s?):\/\/[^\/]*\/?$/.test(window.location.href)) {
    var url = "http://api.wipmania.com/jsonp?callback=?";
    $.getJSON(url, function(data) {
        switch (data.address.country_code) {
        case 'GB':
            location.href = location.href + "index.php?ACT=25&lang=en";
            break;
        case 'DE':
            location.href = location.href + "index.php?ACT=25&lang=de";
            break;
        }

    });
}

```

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


title: Stash & EE - compare 2 lists?

text:
# Question
Title: Stash & EE - compare 2 lists?
Can’t seem to find out how this is possible, but is there a way to compare and see differences between 2 stash set\_list arrays?

For instance:

```
{exp:stash:set_list name="location_list" parse_tags="yes"}
 {exp:structure_entries depth="999" parent="8"}
  {stash:item_title}{title}{/stash:item_title}
  {stash:item_id}{entry_id}{/stash:item_id}
 {/exp:structure_entries}
{/exp:stash:set_list}

```

and

```
{exp:stash:set_list name="checked_locations" parse_tags="yes"}
 {exp:channel:entries channel="checkins" author_id="{logged_in_member_id}" dynamic="no" }
  {stash:item_title}{title}{/stash:item_title}
  {stash:item_id}{entries_location}{entry_id}{/entries_location}{/stash:item_id}
 {/exp:channel:entries}
{/exp:stash:set_list}

```

In the above, item\_id returns the entry\_id of a Playa field. So, would it be possible to compare these 2 lists and only output the ones that don’t have a match? It’s to create a drop down of the entries that don’t have an existing Playa relationship.

# Answer
> 3 votes
Reposting here the solution that I posted on Devot:ee to the same question:

```
<ul>
{exp:stash:get_list name="location_list"}
  {if  0 == {exp:stash:list_count name="checked_locations" match="#^{entry_id}$#" against="entry_id"}}
   <li>{entry_id}</li>
  {/if}
{/exp:stash:get_list}
</ul>

```

# Answer
> 0 votes
Not quite sure of the end goal but if youre looking to produce a list of entries for logged in author that don't have playa relationships.

I'd just use your 2nd list to capture all the users entries then use stash:get\_list with match= and against= to spit out only items that match your criteria.

Using your set list above with the minor exception of just setting the relationship to a simple 'yes' as you don't need to set it if there is one present...

```
{exp:stash:set_list...}
...
{stash:item_id}{entries_location}{if entry_id}yes{/if} {if entry_id ==""}no{/if}{/entries_location}{/stash:item_id}
...
{/exp:stash:set_list}

{exp:stash:get_list name="checked_locations" match="#no#" against="item_id"}
... output items that don't have a relationship, set as no in the set_list
{/exp:stash:get_list}

```

This is all off-the-cuff and you'll have to fill in the blanks but by capturing it all in the exp channel loop and using the stash match tag you should be able to create a select list.

I've typed this up on my phone in transit so mind my simplicity pls :)

---
Tags: playa, stash
---


# Question
Title: Freeform "Field Options" Multi-List List type not working
I am trying to set up a form using Freeform Pro and when I try to use a "Select" field I am not able to click on any of the List type options. If I click on "Load from Channel Field" with the proper Channel Field selected I receive an error that says:

"You must choose some data option for multi-rows in order for this field type to work."

It seems as though it is not letting me actually select a list type.

I re-installed it, but it still didn't work.

Any ideas?

# Answer
Have you made sure that the themes are properly installed? Sounds like a JavaScript error.
> 2 votes

---
Tags: solspace-freeform
---


# Question
Title: Display a list of allowed entries in a different channel's field for a selected author
I get stucked. I've to do this: I've a channel "Projects" where a Super Author write a list of projects. I've another channel "Articles" where Authors can write articles and make a unique relationship with a single entry in "Projects" channel. But only Super Author can allow which Author can select that single project. So in a field in "Articles" entry for that author, it should be listed only allowed "Projects" entries for that author.

EX: There is S\_A (Super Author), A\_1 (Author 1), A\_2 (Author 2). S\_A make Prj\_1, Prj\_2, Prj\_3 and assign that permissions:

```
Prj_1 -> A_1
Prj_2 -> A_1;A_2
Prj_3 -> A_2

```

A\_1 when write an article in "Articles" channel can select from a dropdown only Prj\_1 & Prj\_2, and can't see Prj\_3 in the list;

A\_2A\_1 when write an article in "Articles" channel can select from a dropdown only Prj\_2 & Prj\_3, and can't see Prj\_1 in the list;

I've done this steps: I've created 3 different channels:

```
- Authors (with plug-in Profile:Edit);
- Project;
- Articles;

```

In Projects i've created this channel fields: prj\_author that is a Playa field to allow S\_A to select allowed Authors.

In Articles i've created this channel fields: art\_projects that is a Playa field to show all the entries in the "Projects" channel, but here i can't filter entries for the selected author in prj\_author playa field.

Please can somebody can help me? I can offer a beer :D

# Answer
> 3 votes
You'll need to write a custom fieldtype to achieve this - I can't think of any existing fieldtypes that could accomplish this for you.

So in your fieldtype, you'd query `exp_playa_relationships` for all `parent_entry_id`'s where where `child_entry_id` was equal to the `entry_id` associated with `ee()->session->userdata('member_id')`. (Not sure how *Profile:Edit* stores its Channel/Member relationships, but it's probably in a simple DB table.) Then, use that data to build a menu from there.

Very difficult to then pass this to a Playa field though - you'd be best off building your own dropdown menu.

---
Tags: channel-entries, playa, filter, author
---


# Question
Title: Show Order or Child Entry in Parent Entry
Is it possible to show the order by number that a child entry is placed into a relationships field of a parent entry? I'm creating a top 100 list of movies and I want to show what number a person has ranked that movie in their list.

So for the Person Channel Entry there's a relationship field where Movie Channel Entries can be added. On the frontend I can display a {count} number on a Person page that shows where that movie is placed in their list:

```
{person_film_list channel="films"}
    {person_film_list:count}
    {person_film_list:title}
{/person_film_list}

```

The above renders as 1. Movie1, 2. Movie2, etc.

But on the Movie page I can't reference the count that the movie is placed on the Person's list:

```
{parents channel="person" field="person_film_list"}
        {parents:count}
        {parents:title}
{/parents}

```

The above renders as 1. Person1, etc. no matter what placement the movie has in the relationships field of the Person parent entry. I know it's doing this because it's using the count of the Person parent entry instead of the Movie child entry. Is it possible to reference the count of the current Movie entry being viewed in relation to it's location in the Person parent entry relationships field?

# Answer
You should be able to get the count of the movie within the person\_film\_list relationship field by going one step further in your relationship drill down. When you get to the parent entry, add in a (child) relationship tag pair for the person\_film\_list field:

```
{!--   a movie entry   --}
{exp:channel:entries
    channel="MOVIES"
    dynamic="no"
    entry_id="ENTRY_ID"
    status="not closed"
}

    {!--   find all parent entries in the persons channel for this movie   --}
    {parents channel="PERSONS" field="person_film_list" status="not closed"}

        {!--   while on this persons entry, get the content of the person_film_list field   --}
        {parents:person_film_list status="not closed"}

            {!--   while looping through the content of the person_film_list field, only work with the movie we're targeting   --}
            {if title == parents:person_film_list:title}
                <p>
                    Movie Title: {title}<br>
                    Person Title: {parents:title}<br>
                    Movie's Count in Person's list: {parents:person_film_list:count}
                </p>
            {/if}

        {/parents:person_film_list}

    {/parents}
{/exp:channel:entries}

```
> 1 votes

---
Tags: relationships, related-entries, reverse-related-entries
---


# Question
Title: What is causing Wygwam 3.2.2 error: SyntaxError: Parse error, TypeError: Result of expression 'u' [undefined] is not an object
After upgrade of Wygwam on Exp Eng 2.7.2 our module Wygwam 3.2.2 is not loading in the control panel due to the following errors...

SyntaxError: Parse error /themes/third\_party/wygwam/lib/ckeditor/skins/wygwam3/skin.js?t=B9VJ5M2

TypeError: Result of expression 'u' \[undefined\] is not an object. /themes/third\_party/wygwam/lib/ckeditor/ckeditor.js

There are similar questions here... Wygwam3.21 not initializing - ckeditor error: TypeError: u is undefined and Wygwam - IE8 issue - editor doesn't load and throws javascript error

I've deleted and reinstalled the folders in both themes/third\_party and module/third\_party. Why is it using this particular skin? Any ideas on what is causing the error?

# Answer
> 1 votes
It looks like I found the issue I was having. The problem seems to have come from not updating the Channel Images plugin that Wygwam uses to enable inserting of images into the Body field using Channel Images. For some reason I had a different set of errors today compared to yesterday (original errors in my original post) which led me to the Channel Images plugin for ckeditor.

---
Tags: wygwam
---


title: Structure url_title

text:
# Question
Title: Structure url_title
Is there an equivalent to `{exp:channel:entries url_title=""}` except that goes by the "`structure__uri`" that is defined in the Structure tab of an entry?

So that I can do like `{exp:channel:entries structure_url_title=""}`

# Answer
No, even though we use the same hooks as the Pages module EE has no parameter for that. Here are all of the available parameters for the channel tag: http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#parameters
> 3 votes

---
Tags: structure, entries, url-title
---


# Question
Title: parse_variables multidimentional empty array?
I have a template tag that uses `$this->EE->TMPL->parse_variables()` to create a single item with an array of `[items]`.

`Array
(
 ...
 [accessRole] => reader
 [items] => Array
 (
 )
 ...
)`

What should the parsed variables look like if it's empty and what should be it's corresponding template tag if I want to do something different when there are no `[items]`?

An empty array doesn't seem to work (as shown above) when do `{if items}` or `{if "{items}" == ""}`.

Thoughts?

# Answer
This is not intuitive at all, but you need an array containing an empty array:

```
$variables = array(
  array(
    'accessRole' => 1,
    'items' => array(array()),
  ),
);

return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $variables);

```
> 2 votes

# Answer
Upon closer inspection, the conditionals parser does not deal with arrays properly. I think the only thing you can do is use a separate variable to use with conditionals.

```
// {if items_count > 0}
'items_count' => count($items),

// OR

// {if has_items}
'has_items' => count($items) > 0,

```
> 2 votes

# Answer
I found setting the array to `""` seemed to work. Albeit screwy.

Something like could be done programmatically:

`if (is_array($variables['items'] AND empty($variables['items'])) $variables['items'] = ""`

for instance.
> 0 votes

---
Tags: add-on-development, module
---


# Question
Title: How to work with the new channel forms and the new grid fieldtype ( and updateing it)
My little test looks like blow (fecthing a static channel entry 2 - works getting the data out )

When I submit my grid fields gets empty'ed Can somebody please help with the right syntax to update the grid values - plus if I want to add a new row.

my grid field is called mylist , in this i have two textfields text3 and date4

How is it done ??

{couldn't get the code to display so attact a image}

# Answer
The simplest way is to use

```
{field:your_grid_fieldname}

```

to automatically output the grid content. Make sure you are also including the channel form css:

```
<link href="{path=css/_ee_channel_form_css}" type="text/css" rel="stylesheet" media="screen">

```
> 3 votes

---
Tags: channel-form, grid
---


# Question
Title: BuiltWith: Info about Content Management System
I am asking myself for quite some time on how BuiltWith for example works in determining what CMS is being used for a site.

We are running an online store and at times I believe it would be good to disguise which CMS we are using. Weird thing is that I just tested it and BuiltWith doesn't return any info about the CMS, although it did in the past. I can't really tell why or when it stopped doing it which confuses me even more. When I head over to ellislab.com the info will be displayed. Maybe it's just temporary for our site?

Does anybody know what one would have to do to "disguise" the CMS informations for tools like BuiltWith and the such?

Thanks and Cheers,

Marc

# Answer
> 13 votes
You can detect EE by couple parameters like form uniq for EE names/hidden inputs fields, category short names, page count segment, ACT segment or cookies prefix.

Looks like BuiltWith is looking on cookies and if it see **exp\_** prefix (default EE prefix) - detected EE

```
Set-Cookie:exp_tracker=a%3A1%3A%7Bi%3A0%3Bs%3A5%3A%22index%22%3B%7D; path=/
Set-Cookie:exp_last_activity=1386303363; expires=Sat, 06-Dec-2014 04:16:03 GMT; path=/
Set-Cookie:exp_tracker=a%3A1%3A%7Bi%3A0%3Bs%3A5%3A%22index%22%3B%7D; path=/
Set-Cookie:exp_last_activity=1386303363; expires=Sat, 06-Dec-2014 04:16:03 GMT; path=/

```

cookies prefix you can change in *CP -\> Amin -\> Security & Privecy -\> Cookie Settings*

or in *config.php*

```
$config['cookie_prefix']

```

# Answer
> 2 votes
Though this probably has nothing to do with how Builtwith detects ExpressionEngine...

Another way to tell a site is running EE, as Derek pointed out in his answer to a similar question on Stack Overflow, is to look for hidden `ACT` and `XID` input fields in forms generated by EE modules. Anywhere a form is generated by an EE module (Search, Freeform, CartThrob, or Store, for example) you'll see something like this in the source:

```
<input type="hidden" name="XID" value="960dc9c6e426be168876f03e5c54c391fcf44ec6" />
<input type="hidden" name="ACT" value="40" />

```

# Answer
> 2 votes
This is also unlikely to be used by BuiltWith, but do check your RSS feeds, especially if you are using a standard ExpressionEngine RSS template. You will find inside `<channel>`:

```
<admin:generatorAgent rdf:resource="http://expressionengine.com/"/>

```

Check the Atom template too for a `<generator>` tag.

---
Tags: ee2
---


# Question
Title: Is it possible to orderby random for Grid fieldtype?
As far as I can tell, orderby="random" does not work on the new Grid fieldtype. Has anyone found a good workaround?

I have a grid with several images. I'd like to display one at a time, but randomize which image shows.

# Answer
As of EE 2.7.3 this is possible via the native orderby="random" parameter. http://ellislab.com/expressionengine/user-guide/modules/channel/grid.html#orderby
> 5 votes

# Answer
I don't know if Grid has that option, but you can use our little Shoe Shine Toolbox plugin to generate a random number. Get it from Github.

With it, you can do this:

```
{grid-field row_id="{exp:shoeshine_toolbox:random_number from='1' to='10'}"}
  ...
{/grid-field}

```

Note: There are other great add-ons that can generate random numbers. Just do a search on www.devot-ee.com
> 1 votes

---
Tags: grid
---


title: Relationships based on category

text:
# Question
Title: Relationships based on category
I am trying to just get relationships based on a certain category (accommodatie\_lesaanbod\_relatie). However this doesn't seem to do anything. All relationships are returned without any regard to the category it's in.

```
{exp:webs_low_search:results
    collection="accommodatie"
    categories_in_children_from_channel="les"
    disable="member_data|pagination|categories|category_fields"
    parse="inward"
    location_based="n"
    radius="{location_filter_radius}"
    limit="5"
}

    {stash:channel}{channel_short_name}{/stash:channel}
    {stash:channel_name}{channel}{/stash:channel_name}
    {stash:url_title}{url_title}{/stash:url_title}
    {stash:title}{title}{/stash:title}
    {stash:entry_id}{entry_id}{/stash:entry_id}
    {stash:item}accommodatie-{count}{/stash:item}

    {stash:subtitel}{accommodatie_stad}{/stash:subtitel}
    {stash:afbeelding}{accommodatie_afbeelding}{/stash:afbeelding}
    {stash:href}/{channel_short_name}/{url_title}{exp:webs_filter_url}{/stash:href}

    {accommodatie_lesaanbod_relatie category="5"}
        {exp:stash:append_list
            name="list-les-1"
            parse_tags="yes"
            save="{cache_collectie_h}"
            scope="{stash:_scope}"
            replace="{cache_replace_h}"
            refresh="{cache_refresh}"
        }
            {stash:title}{accommodatie_lesaanbod_relatie:title}{/stash:title}
            {stash:item}les-{accommodatie_lesaanbod_relatie:count}{/stash:item}
        {/exp:stash:append_list}
    {/accommodatie_lesaanbod_relatie}

{/exp:webs_low_search:results}

```

Does anyone know what the problem might be? Thanks!

# Answer
The `category` parameter was only added to the native Relationships tag pair in 2.7.3 (released yesterday). (See changelog.)
> 1 votes

---
Tags: relationships, low-search, related-entries
---


# Question
Title: No Collections Found upon submittal of channel:form
I'm getting a "No Collections Found" after submittal of a Channel:Form (safecracker). Googled that phrase + expressionengine and only found the potential of a conflict with Low:Search (installed btw). Is there a known solution?

# Answer
It's a known bug and will be fixed in the next version of Low Search. To fix yourself, open up `/low_search/libraries/Low_search_index.php` (v3.0.2), and look up line #79, which reads:

```
die('No collections found');

```

Change that to:

```
return FALSE;

```

...and you should be good to go.
> 4 votes

---
Tags: safecracker, low-search, channel-form
---


# Question
Title: Product Report within a time frame in CartThrob
I am trying to generate a report in CartThrob that will display individual products sold. In the CT order manager when you click on Product Report you get a list of products and how many you have sold of each.

Problem is when you add the date range and generate the report it generates an order report and not a product report.

I want to be able to generate a report that shows how many of Product A | Product B was sold within a time frame. NOT a report of orders.

Also the product report only shows 23 products, there does not seem to be a way to display all products or filter them at all.

# Answer
> 2 votes
Take a look at **CT Admin**. It's a 3rd Party reporting tool for CartThrob. Might do the trick for you.

> a stand alone store management panel that allows for order and customer management as well as reporting and data export.

Here are details on what the CP looks like for the addon:
http://www.mithra62.com/docs/detail/ct-admin-instructions/

---
Tags: cartthrob, shopping-cart
---


title: Share upload locations MSM

text:
# Question
Title: Share upload locations MSM
Is there a way to share upload locations between MSM sites, or to sync the dirs for both sites?

If not, is there another module that can do this?

# Answer
> 3 votes
If you have command line access on the server, you can setup a Symbolic Link: http://www.wallpaperama.com/forums/linking-files-with-symbolic-links-linux-unix-shell-command-tutorial-guides-t479.html

Apparently you can also set up a Symbolic Link without command line access using PHP: http://perishablepress.com/use-php-to-create-symbolic-links-without-shell-access/

---
Tags: multi-site-manager, file-uploads, file-manager, files
---


# Question
Title: Looking for a way to store office holidays to display custom messages on days we're closed
On our company contact page we have a footer with contact information that should change based on whether or not we're open. I'm using Low Variables to store this information and have standard office hours in there with a Time Select. That part is easy enough. It's the office holidays that are stumping me.

**1. Easy Solution:**

I build in a Matrix field where we enter, say, the next five years of holidays. Then I match the current date against that list when loading the contact page and show the appropriate footer.

**2. More Automated/Awesomer Solution:**

? I'm not sure. This is tricky because of things like Thanksgiving, or holidays that span multiple days. Ideally I'd just use some public holiday calendar feed and check off the holidays we honor.

Suggestions? Unfortunately I don't have time to develop something custom. May need to go with option #1 for now.

# Answer
> 3 votes
I hear what you're saying about automating but in reality just how many holidays do you honour? It's not going to take too long to do it manually.

I would create a channel for holidays and create an entry for each holiday with the entry and expiration dates set.

Then on your template use a channel entries tag pair with show\_future\_entries="no"

In theory this will mean that your holiday entries will be shown on the days you are closed.

I would think that it would be more useful to show entries a little bit in the future to give people notice of upcoming closures. In this case there are 2 simple options;

You could set the entry dates a little in advance (with a different field to display the actual closure dates)

or

Use a custom SQL query to grab entries with dates in the near future. MySQL has some really useful date handling functions so this shouldn't be too troublesome.

# Answer
> 2 votes
Try making this a global variable in your config file, then you can do all the date checking in PHP. Go to http://www.epochconverter.com/ and get the start and end date of when you're closed, then add this to your config.php file.

```
if (time() > 1387497600 && time() < 1388016000) {
    // Use this in your template {hours_open} and it'll show if the
    // date is between Dec 20th and Dec 27th
    $assign_to_config['hours_open'] = 'Whatever you want here.';
} else {
    // Otherwise don't show anything
    $assign_to_config['hours_open'] = '';
}

```

Note that $assign\_to\_config creates early parsed global variables, so you could instead set the values to TRUE or FALSE, then in your template do this:

```
{if hours_open}
    Yes, we're open on this day!
{if:else}
    Sorry, closed
{/if}

```

---
Tags: low-variables, date, calendar, time, low
---


# Question
Title: Your system folder path does not appear to be set correctly
I'm trying to deploy a new version of an EE site which has been upgraded to 2.7.2.

Rather than just overwrite the existing system folder, I'm uploading the new one alongside it (with a different name) but when I update `$system_path` in admin.php to point to the folder, *I get Your system folder path does not appear to be set correctly.* If I change it back again, the CP login page loads.

The path/name is definitely correct, I'm just swapping out the name of one for the other and they're both at the same level in the directory structure.

What else could be causing EE to not recognise the new system folder (server is running Windows if that helps)?

# Answer
This is more of a comment, but my rep is too low to comment.

Could it be a DB value? Any special characters in the second system folder name?
> 1 votes

---
Tags: system
---


# Question
Title: PHP error on publish/edit screen - certain channels only
On a site running EE v.2.2.1, I've encountered an error that affects the display of the top tab section of the publish/edit screen. It appears to be occurring in only two channels out of about a dozen on the site.

I'm attaching a screenshot that shows the garbled screen and the error message, which is:

> A PHP Error was encountered Severity: Notice Message: Undefined index: field\_visibility Filename: content/publish.php Line Number: 71

Line 71 in the file (expressionengine/views/content.publish.php) reads as follows:

```
<img src="<?=$cp_theme_url?>images/<?= ($field['field_visibility'] == "y") ? 'open_eye' : 'closed_eye' ?>.png" alt="<?=lang('delete')?>" width="15" height="15" />

```

Notes:

I built this site for a client a number of years ago and upgraded it to EE 2 in 2011, but I haven't really touched it since then. So I don't know what changes may have been made in the interim.

The only thing I do know is that the hosting company moved the site to a new server a couple of months ago. Of course, that may not be relevant -- or maybe it is.

Can anyone point me in the right direction to fix this? Thanks!

Brian

# Answer
> 1 votes
To me this looks like the publish layout got corrupted. This was fixed a number of versions back, but was common in the earlier EE releases.

To fix, you can simply re-save the layout, and it should reset you back to normal. You'll, of course, have to reconfigure and hidden fields or re-ordering that you had done previously.

---
Tags: php-errors, publish-layout
---


# Question
Title: An easy way to reorder many template groups at once
I'm wondering if there's an easier way to re-order template groups on the template manager screen, something that's easier to do in bulk than clicking and dragging one at a time.

Thanks.

# Answer
If you have an SQL editor, like Sequel Pro, that allows you to quickly edit data in SQL tables, the `group_order` column in the `exp_template_groups` table is where the order is stored.

You can see the data with:

```
select * from exp_template_groups

```

Fancy SQL to renumber the groups to match the ID order, or alphabetical order, also might be doable.
> 2 votes

---
Tags: templates, groups, orders, template-manager
---


title: Store Sessions Timer

text:
# Question
Title: Store Sessions Timer
We're looking for a plug in that is already made or someone who would know how to create a plug in for Store that would essentially create sessions for buyers. What I mean is that someone places Item A in there cart and there is 3 Item As in stock. Once that Item is placed in the cart it comes out of stock on the system and the person has 10 minutes to buy the product. At the end of 10 minutes the item is put back in stock if it is not purchased, if it is purchased it is not put back in stock at all. This would be the same system as say Ticketmaster when you buy tickets. It holds your tickets for you in a session. Any help would be greatly appreciated.

# Answer
> 1 votes
I don't know of anything that exists like this now. I think you'd have to build your own, which, I'm guessing, could be a bit of a complicated process.

---
Tags: expresso-store, add-on-development
---


# Question
Title: Stash embeds containing multiple nested plugins doesn't retrieve anything
I'm trying to do some stash embeds but when embeds contain nested plugins (so, more than one) he doesn't retrive any value.

```
{my_loop}{stash:embed name="my_total{count}" file_name="_stash:total_htva_stash" stash:collection_name="acompte{count}" process="inline" parse_stage="set"}{/my_loop}

```

My embed stash template :

```
{exp:mx_calc expression="round(({exp:tally:total collection='{stash:collection_name}' decimals='2'}*0.21),2)" parse="inward"}{calc_result}{/exp:mx_calc}

```

If I just put 1 plugin in the embed :

```
{exp:tally:total collection='{stash:collection_name}' decimals='2'}

```

the embed retrieve a sum (tally plugin is made to sum some numbers) but when I put tally into mx calculator (to do a math on the tally's sum) it doesn't work. When I made it in EE embed it works but I need stash embed to use the result as a variable in the host template.

I don't know if it is clear (english is not my mother tongue).

# Answer
> 1 votes
Try adding `parse_depth="x"` to the Stash embed, where 'x' is a number greater than 4 (which is the default).

EDIT:

You are effectively using the embed like a snippet, so I would suggest including the embed before tag processing begins, without parsing it so that you can still pass it variables during:

```
{stash:embed name="my_total{count}" file_name="_stash:total_htva_stash" process="start" parse="no"}

```

Rather than `{stash:collection_name}` use `{acompte{count}}` in the embed.

---
Tags: stash, embeds, variable
---


# Question
Title: Sending email address to custom field with Profile:Edit
I need to send the member email to a custom field in a channel entry after member creation. We use Profile:Edit to create a channel entry for a member immediately after creating them in the EE admin. Currently it sets the title to the username. I would also like to pass the email address to the channel entry.

# Answer
First things first... I would recommend that you *don't do this at all* and instead find a way of using the real email field for whatever purposes you need it. Mainly because the pain of having to keep dual fields in sync will become very tedious, especially if members can update their own email address.

However, if you insist on doing this there are two ways - you could use either or both:

1. Build an extension:

Using the member\_member\_register\_start hook you can take the real submitted email field and copy it to a new variable in the $\_POST array named to match your custom field. The Channel Form (Safecracker) module should then take care of the rest for you.

~~or 2. Copy to a hidden field using JavaScript:~~

~~Profile:Edit is based on the Channel Form (Safecracker) module, so all it needs is a field with a `name` attribute matching your custom field's shortname... so it would be quite trivial to write some JavaScript or jQuery that automatically copies the value of the real email field to the hidden input.~~

**EDIT:** Sorry I've just realised you're talking about registrations via the control panel, not via the front end, so option 2 above wouldn't apply. You should be able to do it with option 1, but you'll need to use the member\_create\_start hook or the profile\_register\_start hook instead.
> 2 votes

---
Tags: profile-edit
---


# Question
Title: Structure Nav, Non-Structure Listing Items, & MSM
I have a site that uses structure, and has a structure navigation.

* On the homepage, it shows all my top level nav items, which is correct.
* On my /news-and-events/news page, which is a structure page that draws from the news-and-events.group/news template, it shows the top level pages and the news and events sub-pages in the nav, which is correct.
* On /news-and-events/news/{url\_title}, the nav shows only the top level items again, which is incorrect.

The individual news pages run off the same template as /news-and-events/news, just checks segment\_3, and pull in content from a separate site within MSM, so they can't be a structure listing. I need a way to get these individual news pages to show the same nav as the news listing page, either through manipulating the structure nav tag or tricking it into thinking I'm still on the news page.

Any suggestions?

# Answer
> 1 votes
This code tells Structure Nav to always start at root and to show 2 levels of the tree all the time:

```
{exp:structure:nav start_from="/" max_depth="2"}

```

Structure Nav Docs:
http://www.buildwithstructure.com/tags/navigation/

# Answer
> 0 votes
```
{exp:structure:nav start_from='/' max_depth="2" show_depth="2"}

```

Does adding show\_depth help?

---
Tags: structure, navigation
---


title: Loading multiple stylesheets in Wygwam

text:
# Question
Title: Loading multiple stylesheets in Wygwam
I am using a UI Kit for styling out the pages on a site. With the UI kit, there are multiple CSS files and js files in order to achieve the results of the rendered objects. Is there a way to incorporate this into the wygwam field so that the editors can view the copy as it will render?

Too many times, they try to modify the copy to look like they think it should rather than trust the styles will render.

I know there is the option:

```
Enter the URL to a CSS file you want to be applied to your field contents.

```

but I need more...

*** EDIT *** Ok, I created a small CSS file that uses @import and load it in the custom CSS setting.

Now, I need to wrap the content in the field in a div so it renders properly during the entry process. Is that even possible?

*** EDIT 2 *** I have now modified the advanced settings to add a bodyClass of "grid page" which gets me somewhat close. I still really need a way to frame in the field as it is going to be used in the pages though.

# Answer
I have found (and apparently you have too!) that using one css file that 'imports' multiple is the way to go. I point WYGWAM to my wygwam-style.css file which includes:

```
@import url("/css/reset.css");
@import url("/css/dynamic-content.css");

```

Reset.css is just a basic css reset that I use on the front-end of my site, so I figured it'd be best if it was included. And dynamic-content.css is the styles that I coded up for the dynamic content areas.

I noticed that the body of the iframe tag within my WYGWAM field has a class of `cke_editable`, so I ended up using that class around the content areas on my pages. Thanks for pointing out the `bodyClass` setting! I'll use that from now on.

I was able to constrain the width of the content in the WYGWAM editor by using this css:

```
.cke_editable.cke_editable_themed {
    width: 634px;
}

```

I hope that helps!
> 2 votes

---
Tags: ee2, wygwam, javascript, jquery, css
---


# Question
Title: redirect request for file download to a template first
I need to log downloads to the database, to do this I'm trying to redirect requests for downloads to a template where I can call a custom module function and save info to the db, before providing the original download.

I have the following htaccess, but it just keeps appending to the URL and gives a ';Error: The URL contains too many segments.' error:

```
RewriteRule ^/downloads/files/(.*)\.zip$ /index.php/log/file_downloads/$1 [L]

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

```

This must be pretty close, any help appreciated!

# Answer
I got it! I think at least some if the problems i had testing various versions of this were down to FF caching

RewriteRule /downloads/files/(.\*).zip /index.php/log/file\_downloads/$1 \[L,R=301\]
> 2 votes

# Answer
There are two add-ons available for tracking downloads, so I'd suggest investigating these options before trying to roll your own. They are Link Vault and Protected Links both are quite similar and work very well for what you're looking to do.
> 1 votes

---
Tags: htaccess
---


# Question
Title: Updated Exp:resso Store to 2.1 - Shipping methods field is empty
We recently updated from Exp:resso Store 1.6 to 2.1 and after the update our client's shipping information is blank.

I looked at the documentation and it appears as though everything should work as it stands.

Below is the shipping code used in the template:

```
<tr>
<td>Shipping</td>
<td colspan="2">
{field:shipping_method}
{if error:shipping_method}<p class="help-block">{error:shipping_method}</p>{/if}
</td>
<td style="text-align:right">{order_shipping}</td>
</tr>

```

Any assistance would be greatly appreciated.

# Answer
> 1 votes
Since you have only created shipping rules for Hong Kong and United States, the most likely explanation is that your current cart does not have a shipping country set. In Store 2, if there are no rules matching the current cart for a particular shipping method, that method no longer displays in the checkout (since it is effectively unavailable).

To fix this, you should set a default country for new carts. You can do this under Store \> Settings \> Countries / States. Make sure to empty your cart after changing this setting, as it only applies to new carts. You can verify this is correct by displaying the `{shipping_country}` variable in your template.

# Answer
> 1 votes
After updating and getting some good feedback Exp:resso, we found that the update added a variable where the rule applied to carts from $0 - $0; thus it would never display.

---
Tags: expresso-store
---


# Question
Title: "Date field is required" error when saving entries
I'm using Store to manage products with lots of modifiers. At some point, a product will reach a number of modifiers where it starts producing a "Date field is required" error every time I try to save the entry in the Publish Page. There is, of course, a value in the Date field, but somehow it seems to not be making it to the server properly. How can I troubleshoot/fix this? Is it possible to have "too many" modifiers on a product?

# Answer
> 4 votes
Turns out, this has nothing to do with Store at all. Found my answer on StackOverflow:

> Since PHP 5.3.9 there's a new configuration setting called "max\_input\_vars" which limits the number of input variables. The default setting is 1000. Also check if Suhosin is installed, because there's also a similar setting.

---
Tags: expresso-store, php, error, php.ini
---


# Question
Title: Ordering events with Low Search Results and Low Events
I'm using the Low Search Tag extension from Low. He kindly pointed me to it so that I can find upcoming events based on a Solspace Tag.

This is correctly pulling through the events I need using the following code;

```
{exp:low_search:results tag_name="{segment_4}" websafe_separator="-" low_events:unit="upcoming" low_events:show_passed="no"}
{title}
{/exp:low_search:results}

```

However, I need to be able to order them by the Event Start Date. It doesn't seemt o be doing this by default. I tried adding 'orderby="low\_events:start"' but this didn't make any difference.

Wondering if anyone else had found a solution for this?

Thank you.

# Answer
> 2 votes
Simply ordering by the Low Events channel field would do the trick, so try:

```
orderby="my_low_events_field" sort="asc"

```

---
Tags: low-search, solspace-tag, low-events
---


title: Channel Forms edit form with pagination

text:
# Question
Title: Channel Forms edit form with pagination
Sooo I've got a bunch of entries in a channel and the user needs to be able to go through and edit them one by one and move prev and next through them if required.

So, ideally I'd probably nest a channel form tag in a channel entries tag as channel form doesn't provide any kind of pagination, but from what I've read, that isn't a good idea....not sure why....

Any ideas?

# Answer
I've also read that it's not a good idea to put the channel forms tag inside the channel entries tag, but I'm doing it anyway for a site where I couldn't find another solution to the problem I was encountering and it's working.

So I would say (like Romans-8---31-39 said in the comment) try it as a separate tag if possible. If you can't try nesting it and see if it works for your site. If that doesn't work you could have the channel form in an embed.

Ideas about why it's not a good idea: I would guess because you're doubling the query on the database for one thing, but it would also be doing that separating them or using an embed. The other thing is that in the parse order the surrounding channel entries tag gets processed before the channel form entry, and I'm not sure if that entry tags are being parsed by the channel entries tag or the channel forms tag.
> 2 votes

---
Tags: pagination, channel-form
---


# Question
Title: Using Stash Embeds for common elements such as call to actions
It seems to me that using Stash Embeds with variables could be a really powerful way to keep things **really** dry.

I was wondering if anybody uses them to create consistent elements throughout their sites and just cache them away?

For example for a consistent call to action button throughout the site...

```
{exp:stash:embed:partials:cta stash:action="Download Now" stash:location="/download/"}

```

Which would embed the partial template which would look like

```
<a href="{exp:stash:location}" class="cta">{exp:stash:action} »</a>

```

It would allow for impressively DRY code which in turn would be consistent code (call to action buttons are things I notice become inconsistent quickly on a larger site) and would facilitate the ability to change hundreds of CTAs in one line of code.

Would this have much of a negative effect on the performance of the site? Has anybody tried something similar to this in the past?

# Answer
Very late response here, and not quite an answer. In your case you want to cache all these things, in mine I want them to behave as functions, basically.

However it's in the same area so I thought might be useful for the discussion.

I use stash in a functional way all through he site I am developing. I guess coming from a programming background I just can't stand repeated code...so where I see it, I try and make a function.

Here's an example:

I 'call' it like this:

```

{stash:url_path}{stash:embed:utility:url_builder stash:channel_short_name="{channel_short_name}" stash:entry_id="{entry_id}" stash:urlt="{url_title}" random}{/stash:url_path}

```

and the 'function' itself is:

```

{!-- URL BUILDER --}
{!-- Takes: entry_id, channel_short_name, urlt (=url_title) --}
{!-- Takes: inks and paper_sub_cats - lists of categories --}
{!-- Returns: the URL stub for the entry e.g. /inkjet/print-packaging/cystral-clear-bags --}
{!-- Returns: 'ERROR' if it can't work it out--}

{!-- set a list of the inkjet categories--}
{snippet:global-global_set_inkjet_categories}

{!-- get (one of..) the deepest category for matching in url_builder--}
{exp:gwcode_categories entry_id="{stash:entry_id}" last_only="yes" limit="1" parse="inward" style="linear"}
    {exp:stash:set name="deepest_cat_url_title" debug="yes" random}{cat_url_title}{/exp:stash:set}
{/exp:gwcode_categories}

{exp:switchee variable="stash:channel_short_name" parse="inward" debug="yes"}
        {case value="product_inkjet_paper"}/inkjet/paper/{stash:urlt}{/case}
        {case value="product_printer"}/inkjet/printer/{stash:urlt}{/case}
        {case value="product_monitor"}/monitors/{stash:urlt}{/case}
        {case value="product"}
            {!-- the tricky one - these products can be found at a number of different URLs --}
            {!-- so we need to use categories... --}
            {switchee variable="stash:deepest_cat_url_title" parse="inward"}
                {case value="{stash:paper_sub_cats}"}/inkjet/paper/{stash:urlt}{/case}
                {case value="sample-packs"}/inkjet/sample-packs/{stash:urlt}{/case}
                {case value="print-finishing"}/inkjet/print-finishing/{stash:urlt}{/case}
                {case value="print-packaging"}/inkjet/print-packaging/{stash:urlt}{/case}
                {case value="albums-and-cards"}/inkjet/paper/{stash:urlt}{/case}
                {case value="{stash:inks}"}/inkjet/ink/{exp:stash:get name="deepest_cat_url_title" random}{/case}
                {case default="yes"}URL_BUILDER_ERROR{/case}
            {/switchee}
        {/case}
{/exp:switchee}

```

...this works a treat to give me the full url to an entry. It does have one issue though - I get whitespace in the returned url. The url is perfectly functional, but I haven't worked out a way to trim the whitespace yet as stash embed don't have a trim parameter (have been meaning to ask about Mark Croxton about this).

I have several of these utilities that are key pieces of code. There is most likely a performance hit but it seems well worth if for the much better maintainability of isolating this logic to one place.
> 1 votes

# Answer
In stash builds, I would use stash embeds for things like sidebars, etc. so maybe not as granular as CTA buttons.

In those cases, I use them with the `process=start` parameter, which makes them act pretty much like EE snippets and include them in the other template before any other EE tags are parsed. Using that, I often don't need to pass variables around.

I also use `parse_stage="set"`. Don't forget to turn of file syncing in production using `stash_file_sync='false'`.
> 1 votes

---
Tags: stash, embeds, template-partials, dry
---


# Question
Title: One most recent entry from multiple channels
I'd like to return 5 entries from 5 channels in a list, the list being comprised of:

* the one most recent entry from each channel
* in order of date

A simple exp:channel:entries loop with a limit of 5 and channel="blog1|blog2|blog3|blog4|blog5" will bring back the 5 most recent entries overall, but not just one entry per channel.

And 5 channel:entries loops will bring back the most recent, but not with them in the right order -- and the overhead of 5 channel:entries loops makes me cringe.

How would you do it?

# Answer
You're in custom plugin territory Travis. Pretty easy though.

* Run one (very quick) query to get the latest `entry_id` in each channel (query `exp_channel_titles` only). Save them all to an array.
* Then, you can either return those entry\_ids as a variable (concatenated with `|`), which you pass to your `channel:entries` tag in your template, or instantiate a new Channel instance and return it directly.

See this great answer on a related question by Adrian for some sample code.
> 3 votes

---
Tags: channel-entries, date, orderby, loop
---


title: Freeform edit entry order issue

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

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

I've tried to edit the plugin to do this, but am getting no where.

Has anyone else found a solution to this?

Thanks.

Andrew

# Answer
> 1 votes
The order the fields are displayed is based on the order they are in in the field definition section of the form configuration. I just tested moving several fields around, and the edit form reflects the changes. I am assuming that you are referring to the entry edit in the CP and not the freeform:edit tag. Just drag them into the position you'd like.

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


# Question
Title: Channel Entries - Advanced Entry Id Filters
When using the entry\_id param in `{exp:channel:entries}`, is it possible to do some advanced conditions like

entry\_id="(not 58) AND 99|100|101"

Basically, what I was looking for is if you can use AND, OR and NOT.

# Answer
This is not possible with this tag.
> 1 votes

# Answer
You can probably accomplish what you're seeking to do by using the **Channel Query** plugin. It has all of the features of `{exp:channel:entries}`, with the flexibility of the Query module.

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

```
> 1 votes

---
Tags: channel-entries
---


title: Expresso Store rounding tax rates

text:
# Question
Title: Expresso Store rounding tax rates
Is there a setting in Store somewhere that is rounding tax rates on me? I have a product in the cart for 150 with a tax rate of 23%. This should equal 34.50 in tax, and the total should be 184.50, but it is 185.

I saw in store 1.6.4 there was an option in general tab to 'round after tax' but this seems to be missing in 2.0.4?

# Answer
> 0 votes
First I would upgrade to Store 2.1, there are a few improvements and fixes to tax calculation in the latest version (especially when discounts apply to your products).

My guess is that possibly there is some shipping or handling also affecting your cart total, which might be affecting the tax total. Either way, using your example I would expect 150 + 23% = 184.50, which is neither of the numbers you mentioned above.

# Answer
> 1 votes
Just for anyone's reference should you come across this, what I did to solve the issue was:

1. Create a text field with $150 (text with no .00) in it and displayed this on my product page.
2. Put the decimal setting to 2 in store, which allowed the VAT/Tax to show to two decimal places, as well as prices.

All works the way it should. Payment gateways are another matter altogether.

---
Tags: expresso-store
---


# Question
Title: Unable to load requested field type file: ft.rel.php
Good Morning Everyone,

im sorry if this is duplicating my post on Ellislab forum, but I though id attack from all angles.

Im new to EE and Cartthrob, however I have an issue after each attempt at installing Cartthrob.

EE installs ok, however during the installation of templates and template store from the cartthrob I get an Internal Server Error, after a refrsh everything seems ok, however when i active the test store most of the pages produce the following error

**Error Unable to load requested field type file: ft.rel.php. Confirm the fieldtype file is located in the expressionengine/third\_party/ directory**

I spoke to CT, but they say this error relates to EE not CT.

Any advise would be greatly appreciated

# Answer
> 1 votes
I am having the same problem.... I even rolled back the version of EE to 2.5.5 and removed the CT pluggin and also turned off extension. Still getting the error. Something has changed in my database. I am in the middle of trying a full server restoration and putting a bullet in my head.

# Answer
> 1 votes
To summarise...

CartThrob has not been updated since the release of 2.6 (as is the case with many add-ons). I suspect it's assuming that it will find the old relationship fieldtype (which was called ft.rel.php) somewhere in its code.

Until the CT guys update the CT auto-install templates to work with EE 2.6 your options will be to either work without the auto-install templates or stick with EE 2.5.5. Prior to that EE 2.5.5 would have been the download in your account. Your best bet will be to drop EllisLab an email (sales@ellislab.com) and just explain why you need the previous version. I'm sure they'll help you out.

# Answer
> 1 votes
Had the problem as well after updating an old website. Here is how I solved it.

1. As mentioned in the comments `ft.rel.php` is the old relationship field. It was causing problems even though I wasn't using it because it was listed in the database.
2. Check that you are not using it in any of your fields by going to the `exp_channel_field` table and checking the `field_type` column. You should see no sign of a rel field there.
3. If that's the case, simply delete the row for rel field in `exp_fieldtypes`

That solved the problem for me.

# Answer
> 0 votes
I had the same problem only it was "ft.matrix\_url\_title.php"

I am on 2.6.1 and Matrix 2.5.5

The weird thing was that it was ok on my local machine but not on my dev server.

Turns out that the db table exp\_fieldtypes on the dev server had the field type name ("name" in the db column) as "matrix\_url\_title" whereas the local db had "matrix". Once I changed the dev server db to matrix it worked. So there was obviously a conflict when upgrading either to 2.6.1 (from 2.4.0) or to Matrix 2.5.5.

---
Tags: ee2, cartthrob, fieldtype
---


# Question
Title: Comment URL Title Auto Path for other channel
I've run into a bit of an issue when working on a video archive site for a church. I currently have sermon series in a channel and then services in another channel that is tied to the series channel by a relationship field. I want to be able to feature a single week's service on the homepage, but I can't seem to figure out how to get the service's URL to point to the series URL. The site is here: video.lifebridgechurch.com. On the homepage, I have the featured post which is using Comment URL Title Auto Path to generate the URL. However, I need the last segment of the URL to be the series URL instead of the service title since I don't have a template for just a single service. If you go to the full archives and click on a series, all of the services are shown in tabs so they don't need their own template.

I've tried MX Title Control but I can't seem to get it to do what I need.

Hopefully this makes sense! Thanks for any help!

# Answer
If the series is the parent that you are linking to, you can just use the relationship's parent tag

Then you could simply pull the url\_title of the parent entry.
> 1 votes

---
Tags: ee2, url, url-title
---


# Question
Title: Call to undefined function reduce_double_slashes() EE 2.5.5 to 2.7.3 upgrade
I'm not getting any response over on the EE forums, so I figured I'd post my issue here as well.

I’m attempting to update an EE site from 2.5.5 to 2.7.3, the installer process runs smoothly, but then I get the following error on the front end & when accessing control panel:

```
Call to undefined function reduce_double_slashes() in admin/expressionengine/libraries/Extensions.php on line 194

```

I have rolled my local repo back to 2.5.5, restored my old db, and applied the update again with the same results.

Has anyone else experienced this issue when upgrading to EE 2.7.x?

# Answer
Add this right above line 194 in admin/expressionengine/libraries/Extensions.php:

```
$this->EE->load->helper('string');

```
> 3 votes

# Answer
The error was misleading as it wasn't actually being caused by the call to reduce\_double\_slashes() on line 194 in Extensions.php. The issue was caused by the Custom System Messages extension, once I disabled that I was able to access the site.
> 1 votes

---
Tags: ee2, error, upgrade, ee2-upgrades
---


# Question
Title: Recommendation for dynamic Store product data updates
I'm wondering of the best way to tackle the development of some custom logic for a product inside Store 2.

I'm trying to update other Store fields of a project (Length, Width, Height, etc..), based on what Modifier has been selected. For example, if a user chooses Modifier A, add 3 inches onto the height; Modifier B, add 4 inches.

The Store product fieldtype doesn't provide any hooks for extension, so I'm wondering if all this should be done using other custom fields and updated on template run time, or if there is a way to hook into the product custom field and do this when a product is updated in the CMS.

Any thoughts, suggestions, or ideas would be appreciated. Thanks!

# Answer
> 2 votes
Since Store 2.0.4 it is possible to specify the length/width/height/weight fields dynamically at the same time the product is added to your cart, so you could implement this logic using javascript.

First you need to enable this feature under Admin \> Channel Administration \> Channel Fields \> Products channel \> Product Details field \> Enable Dynamic Weight & Dimensions.

Then, inside the `{exp:store:product}` tag, you can submit `length`, `width`, `height`, and `weight`, and these will override the values for that particular item in the cart. You can make these hidden fields, and simply change their values using javascript when the customer changes the product options.

---
Tags: expresso-store, add-on
---


# Question
Title: Secure Forms setting and Ajaxified Forms
As I discovered, it seems that "Secure Forms" setting won't allow anyone to submit more than once in Ajax.

I researched about this and I found out that it was because you can't send a form with same XID twice. You need to reload the page to get a fresh XID to submit.

However, this is a problem for Ajaxified forms, simply because of their essential nature and purpose.

Is there an elegant way to use Ajaxified forms inspite of the "Secure Forms" setting being turned on?

# Answer
Yes, you need to get a new XID each time via Ajax and update your form hidden value, so next time the form is submitted it uses the new XID.

Depends what your Ajax is returning of course and where it's submitting to, but in the past on return from the Ajax submission, I've fired another function to just do an Ajax request, then do the replacements.

For example as part of the Ajax Submission function:

```
request = $.ajax({
    url: $form.attr("action"),
    type: "post",
    data: serializedData
});

request.done(function (response, textStatus, jqXHR) {
    if (updateForm) {
        AjaxGet(window.location.href, updateHTML);
    }
});

```

Then new functions:

```
//###   Retreave content/pages via Ajax   ###
function AjaxGet(urlString, resultHandler) {
    if (urlString == undefined)
        return;
    if (request)
        request.abort();

    request = $.ajax({
        url: urlString
    });

    request.done(function (response, textStatus, jqXHR) {
        resultHandler(response);
    });
}

```

Then the capture:

```
var updateHTML = function (htmlString) {
    var XID = $(htmlString).find('form#yourID input[name="XID"]').val();
}

```
> 2 votes

# Answer
When I throw an ajax error I use ee()-\>security-\>restore\_xid() so I can use the same token again. Per http://ellislab.com/expressionengine/user-guide/development/guidelines/security.html#cross-site-request-forgery
> 1 votes

---
Tags: forms, ajax, xid, secureforms
---


title: Channels with Grids not retaining data

text:
# Question
Title: Channels with Grids not retaining data
**Data**:

I have 2 pages with {exp:channel:form} each using the same channel `foo`

Channel `foo` has 4 fields with Grid fieldtypes, `a`, `b` `c`, `d`

Page `1` shows a form to edit `a`

Page `2` shows a form to edit `b`,`c` and `d`

**This is the problem that I have.**

When I try to submit Page `1`, `a` data is saved but `b`, `c`, `d` data is erased.

When I try to submit Page `2`, `b`, `c`, and `d` data is saved but `a` data is erased.

How do I fix this?

UPDATE:

It seems that this is a problem with grid fieldtype.

When you save any channel that has a grid field using {exp:channel:form}, if that grid field is not included in the form, it will be reset/erased.

# Answer
It sounds like this bug: https://support.ellislab.com/bugs/detail/19772

and was resolved with the recent 2.7.3 release. Or you can see how to correct it via the link above.
> 0 votes

# Answer
Sounds like a clear bug that needs to be **reported to EllisLab**...

In the meantime, I suggest using **Matrix field** instead to get your project moving forward.
> 2 votes

---
Tags: channel-form, grid
---


# Question
Title: EE & CartThrob: How to pass custom field variables from Cart to Checkout pages
In my CartThrob {update\_cart\_form}, I have a Matrix-populated zip code drop-down field. When a user clicks "Checkout" I want the value of the drop-down menu to pass as a variable to the checkout page and populate the billing zip code field. Is this possible?

EDIT: You can actually view the precursor to this by going here: http://dandelionflowershop.com/index.php/website/cart

Keep in mind that you need $40 in your cart before delivery options become available.

# Answer
> 2 votes
You should be able to save some custom data to session using the `custom_data` array like this:

```
<select name="custom_data[whatever]">...</select>

```

Docs: http://cartthrob.com/docs/tags/global\_form\_settings/index.html#form-fields

The value should then be available in the CT checkout tag like this: `{custom_data:whatever}`

Docs: http://cartthrob.com/docs/tags/global\_tag\_variables/index.html#custom\_datayour\_data\_field\_name

---
Tags: ee2, cartthrob
---


# Question
Title: Parse order for Stash? - stashing an entry_id and retrieving it again later
I'm using EE 2.7.2 with Stash 2.4.7.

I'm attempting to stash an entry\_id and then retrieve it again elsewhere on the page.

I've got a site with two important channels - people and awards. On each award, I've got a relationship field (award\_winner) that points to someone in the people channel.

On any given award detail page, I'm trying to pull in a bunch of information related to the award winner and stick it in a sidebar.

At the top of a page, I stash an entry ID for a related entry.

```
{exp:stash:parse}
  {exp:channel:entries channel="awards"}
    {award_winner}
      {exp:stash:set_value name="winner_id" value="{award_winner:entry_id}"}
    {/award_winner}
  {/exp:channel:entries}
{/exp:stash:parse}

```

This is working correctly. If I do a \*{exp:stash:get name="winner\_id"}\* on its own, I get the proper entry ID, but it's not showing up when I try to stick it into *exp:channel:entries*.

Down in the sidebar, I'm pulling in a list of entries related to that award winner.

And I'm trying to do that like so:

```
{exp:channel:entries channel="people" entry_id="{exp:stash:get name="winner_id" parse="inward"}" dynamic="no"}
  <h2>Other awards won by {title}</h2>
    <ul>
      {parents field="award_winner"}
        <li>{parents:title}</li>
      {/parents}
    </ul>
{/exp:channel:entries}

```

When it gets to this second part, it's returning all entries in the people channel, instead of just the one defined by \*winner\_id\*.

The end goal, will be to have a bunch of channels (news, media, etc) that all relate to individuals, and that sidebar area is going to pull in (on any given page) a bunch of related items from multiple channels.

# Answer
Just a couple of points of guidance if you want to use that technique with parse="inward":

1. parse="inward" needs to be on the outer tag so that it instructs the inner tags in parameters to be parsed
2. be careful to use double quote marks and single quote marks as appropriate when nesting

Here's how to make your code work without the need for parse="inward". (See the previous revision of this answer to see how it would work with parse="inward".)

```
{!-- ====================================
SET
========================================= --}

{exp:channel:entries channel="awards"}
  {award_winner}
    {exp:stash:set_value name="winner_id" value="{award_winner:entry_id}"}
  {/award_winner}
{/exp:channel:entries}

{!-- ====================================
GET
========================================= --}

{exp:stash:parse process="end"}
  {exp:channel:entries
    channel="people"
    entry_id="{stash:winner_id}"
    dynamic="no"
  }
    <h2>Other awards won by {title}</h2>
    <ul>
      {parents field="award_winner"}
        <li>{parents:title}</li>
      {/parents}
    </ul>
  {/exp:channel:entries}
{/exp:stash:parse}

```
> 1 votes

---
Tags: stash, relationships
---


# Question
Title: Error when trying to display member profiles
When I try to display a member's profile using the url:

```
http://coastsider.com/[member trigger]/[member number]

```

I get the following error message:

```
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Member_settings::$config

Filename: member/mod.member_settings.php

Line Number: 370

Fatal error: Call to a member function item() on a non-object in [home directory]/expressionengine/modules/member/mod.member_settings.php on line 370

```

Interestingly, I get this message for every user *except* the Superadmin (user #1).

# Answer
> 0 votes
It turns out that re-installing EE solved the problem. I must have made a error when I did my last installation. The correct suggestion came form Kurt Deutscher on EE's Forums.

Thanks to everyone who asked the clarifying questions.

---
Tags: members
---


# Question
Title: Disable default email notification templates
I've installed the **Postmaster** module from Objective HTML and I'm using the **Send system email** hook. When the system sends an email I will receive it twice because the postmaster hook don't override the system functionality entirely... So how to disable the default email notification templates?

# Answer
You need to make sure the `End Script` setting is set to `False` in the hook setup screen. This will prevent the default action from occurring so the email is only sent one time.
> 2 votes

---
Tags: ee2, email, postmaster, system, system-messages
---


# Question
Title: How to pull a channel entry title from a previous page into a Freeform Pro field?
Is there a way to pull the channel entry title from a previous page into a Freeform Pro form field?

Here's the specific scenario:

There is a channel containing job postings. To apply for any of these jobs, the visitor clicks an "apply" button which takes him or her from the job description page to an application form. Is there a way to pull the entry title of the job on the previous page to a field on the form the visitor is now filling out?

If there is a way to do this, can the code be integrated into a Composer template?

# Answer
In the page with your job ad, you can use the url\_title of the currently viewed job ad in the link to your freeform url.

So say you have a job entry with the url title of 'web-designer', your apply now button could link to domain.com/job/apply/web-designer.

In this example, 'job' is the template group, 'apply' is your template with your freeform form. Within the freeform tags you can then use a channel entries tag to get the {title} for your form field based on {segment\_3}, looking something like this...

```
{exp:channel:entries channel="jobs" url_title="{segment_3}"}
<input type="text" name="position-applied-for" value="{title}">
{/exp:channel:entries}

```

Not sure if this can included in a composer template though.
> 1 votes

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


# Question
Title: 'site_index' variable in channel:categories has specific URL
In the following code, I want `site_index` to continue to point to `http://blah.com/` but instead it points to something like `http://blah.com/category/catalog/downloads`:

```
{exp:channel:categories channel="downloads" show_empty="no" style="linear"}
    <a href="{path='site_index'}/downloads">{category_name}</a>
{/exp:channel:categories}

```

How do I prevent `channel:categories` from taking over the `site_index` variable?

# Answer
> 2 votes
You'd be best left not messing with that and using `{site_url}` instead.

http://ellislab.com/expressionengine/user-guide/templates/globals/single\_variables.html#site-url

---
Tags: categories, path
---


title: Multi-site Cache Breaking

text:
# Question
Title: Multi-site Cache Breaking
I was wondering if anyone has been able to attempt Multi-site cache breaking with Ce\_cache? And what did you do to achieve this?

I am trying to stay away from PHP to achieve this, and having someone to Clear the cache every time the site is updated.

# Answer
> 1 votes
Purchase and implement the Stash EE companion called Mustash to setup up cache clearing rules. With Mustash you'll be able to tell the Stash cach eto empty whenever an entry is modified.

http://www.devot-ee.com/add-ons/mustash

---
Tags: multi-site-manager, ce-cache
---


title: How to check for a boolean field?

text:
# Question
Title: How to check for a boolean field?
I am writing a plugin, and everything is working fine so far. Some of my source data includes booleans. So I want to be able to test for true or false.

```
{if show_data}
   <p>This is some data</p>
{/if}

```

But it won't work. Are booleans not supported or am I doing something wrong?

EDIT:

Here is a sample of how I would like to assign a boolean.

```
$array = array('show_data' => true);
$str = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $array);

return $str;

```

# Answer
If I'm not mistaken, I read that you must return boolean values from plugins and modules as 'TRUE' and 'FALSE'
EE Template Class - Conditional Variables
> -1 votes

# Answer
It is **not** the case that you need to set your booleans as 'true'/'false' strings, it's that your variables array needs to be nested in its own array like this:

```
$array = array(array('show_data' => true));
$str = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $array);
return $str;

```

You'll now find that outputting {show\_data} in a template will return 1, and as such can be used in conditionals like so:

```
{if show_data}It's true{/if}
{if show_data == 0}It's false{/if}
{if show_data == ''}It's false{/if}
{if !show_data}It's false (as of EE 2.9+){/if}

```

Docs: http://ellislab.com/expressionengine/user-guide/development/usage/template.html#master-variables-array
> 2 votes

---
Tags: templates, plugin
---


# Question
Title: How to use negation with a boolean in a tag?
I am writing a plugin, and everything is working fine so far. Some of my source data includes booleans. So I want to be able to test for a value of false. This is the plugin code.

```
$array = array('show_data' => 'FALSE');
$str = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $array);

return $str;

```

and this is the template code:

```
{if not show_data}
   <p>This is some data</p>
{/if}

```

or

```
{if !show_data}
   <p>This is some data</p>
{/if}

```

But it won't work. Is this not supported or am I doing something wrong?

Currently I have this workaround

```
{if show_data}{if:else}
   <p>This is some data</p>
{/if}

```

# Answer
> 2 votes
ExpressionEngine interprets the returned value as the string "FALSE". You probably need to set your var like this:

```
$array = array('show_data' => '');

```

Or you need to format your if statement like

```
{if show_data == "FALSE"}

```

# Answer
> 1 votes
Please see my answer to your other related question which answers this too. (You need to set your vars array as a multidimensional array):

How to check for a boolean field?

---
Tags: conditionals
---


# Question
Title: Upgrading Solspace add-ons from EE1 to EE2
We have an EE 1.7.3 site with these Solspace add-ons:

* Static Page Caching
* Freeform
* Rating
* User
* Friends

Is there a preferred way to upgrade these items? Based on this post (EE1 to EE2 Upgrade), I'm understanding that I need to upgrade EE first, then upgrade the add-ons.

Backups we have covered and we're running trial upgrades on a dev server first, until we get it right.

# Answer
Actually, I would strongly suggest to **upgrade add-ons first, then EE**. This isn't only for Solspace add-ons, but any add-on for EE. Make sure you **update your add-ons to the latest version available for EE1 first**, then upgrade to EE2. Sometimes, you need to then upgrade the add-ons to the latest version available for EE2.

This usually gives you the smoothest upgrade path to having your add-ons working correctly on EE2. Moving to EE2 while still using an add-on version that was EE1-only (at the time of the add-on's version) can be a painful experience.

Of course, also **make sure you make backups at every step**, in case you need to backtrack to a previous state. Reading the upgrade instructions for each add-on, just in case there's a special requirement, is also highly recommended.
> 3 votes

---
Tags: solspace, ee1, upgrade
---


# Question
Title: How can I check to see if today is a holiday with Solspace calendar?
I've used Solspace Calendar to create an "Office Holidays" calendar where we enter all of the dates/times we're closed for the holidays. The idea is to let visitors know if we're open for calls or not. That said, I'm not sure what the best way is to check and see if the current time/date lands on a holiday or not. Especially without looping through all holidays in the calendar.

Any suggestions on ways to check to see if we're currently in a "holiday"?

# Answer
> 3 votes
Wouldn't you only have to loop through the events on a specific day (today) to see if there is a match for a holiday (and not the entire calendar)? I believe you could use the "Day" loop with a date\_range\_start of current\_time, couldn't you? And since your calendar entries are limited to office holidays, the return of any results for a given day would in fact mean there is a holiday.

So something like:

```
 {exp:calendar:day date_range_start="{current_time format="%Y-%m-%d"}"}
    {if calendar_no_results}
       Regular business hours today
    {/if}
       Today is a Holiday!
 {/exp:calendar:day}

```

# Answer
> 3 votes
Creating an "Office Holidays" calendar is a good start. Within that calendar you would create your holiday "events" in the "Calendar: Events" channel.

If you're looking to list the upcoming holidays as a list, you can use `{exp:calendar:cal}`. Don't forget to use `calendar_id=""` or `calendar_name=""` is you just want to display events within your "Office Holidays" calendar:

```
{exp:calendar:cal
  calendar_id="1"
  date_range_start="today"
  date_range_end="+6 months"
  pad_short_weeks="n"}

  {events}
     Holiday "{event_title}" on {event_start_date format="%Y-%m-%d"}<br />
  {/events}

{/exp:calendar:cal}

```

You can also create a calendar table using `{exp:calendar:cal}` (see the advanced example for a monthly calendar here), then use

```
 {if day_event_total > 0}Holiday!{/if}

```

...within the `{display_each_day}{/display_each_day}` tag pair to label days with holidays. Make sure the `{events}{/events}` tag pair is also present in the `{display_each_day}{/display_each_day}` tag pair.

---
Tags: date, solspace-calendar
---


# Question
Title: Max length Rule doesn't work for {exp:channel:form}
I have this form tag

```
{exp:channel:form
    channel="xxxxx"
    class="form-horizontal row-fluid"
    date_picker="no"
    error_handling="inline"
    include_assets="no"
    include_jquery="no"
    return="/foo/bar/"
    rules:title="required|max_length[5]"
}

```

I am trying to limit title to 5 characters. However, it does not seem to work since I was able to post titles with more than 5 characters without the form complaining.

# Answer
The documentation (user guide, channel form) does seem to mention (custom) fields. (a quick look at the source of channel:form lib indicates the same).

You could validate length with the help of a little bit of javascript, and/or report a bug (feature request) at EllisLab that rules should also apply to default fields.
> 4 votes

---
Tags: channel-form
---


# Question
Title: Cartthrob create_user 'your not authorised to perform this action' upon login
After using the **create\_user** tag during my cartthrob checkout process, a user is created.

Now when logging into the site, the message **your not authorised to perform this action** shows and I cannot login as the created user.

I can be sure that the user is created with the correct password using cartthrob debugging output and also by trying to login with an incorrect password I get rejected with the incorrect password message.

The only way Im able to get the account to sign in is by using the super-admin members panel and changing the password...

Is it possible that when cartthrob is inserting the user, that something isn't going in correctly?

Any ideas?

# Answer
It turned out to be a problematic entry into the sessions table by CartThrob, so removing it was a quick fix.

This is within the order confirmation cartthrob tab(post-payment).

(You need output stage php enabled, as {member\_id} is a CartThrob tag)

db-\>delete( 'exp\_sessions', array( 'member\_id' =\> '{member\_id}' ) ); ?\>
> 1 votes

---
Tags: cartthrob, members, login
---


# Question
Title: Is there a way to do an automatic follow up email with Freeform Pro?
I have a form on a website that offers a free download of a brochure, once submitted. I was wondering if there was a way to send an email notification after 2 days just asking if they were happy with the download?

I didn't know if it was possible to delay the notification somehow so that it was delivered 2 days later, then I could tailor the message accordingly. Or if there is a better way to do this?

Thank you.

# Answer
This will require custom development - either by:

1. Using the freeform\_module\_user\_notification hook to record elsewhere (likely in a custom database table) that a follow-up is required on a certain date for this particular submission, and then having other custom code send that email when the time comes.
2. Periodically (via a cron job) checking all entries in the relevant Freeform database table for submissions which match your criteria (certain form, and certain length of time passed), and then sending the follow-up via that data.

Hope that helps.
> 2 votes

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