# Question
Title: Channel entries Swith (looping) different DOM div blocks order?
I need display entries of a channel, is easy when you have the same structure of your DOM elements like:

```
{exp:channel:entries
   channel="{channel}"
   limit="6"
}

   <div class="{switch='row1|row2'}">
      <div class="john guitar">
         JOHN
      </div>
      <div class="jagger drums">
         JAGGER
      </div>
   </div>

{/exp:channel:entries}

```

so that is simple with https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_entries.html#switch, render the same structure 6 times jump between row1 and row2 BUT!!! my structure have 6 different block of code AND!!! in each block add new clases AND!! some pieces of code are in the top and later at the bottom, like this:

```
<div class="row1">
   <div class="john guitar">
      JOHN
   </div>
   <div class="jagger drums">
      JAGGER
   </div>
</div>

<div class="row2">
   <div class="jagger voice">
      JAGGER
   </div>
   <div class="john bass">
      JOHN
   </div>
</div>

etc...

```

you see, John is in the top, but in the second block is in the bottom and also add a new class to the div, later Jagger is in the bottom but in the second is in the top... and so on...

please see the the real code!!! html that I need looping through, is very clear what I need: http://cl.ly/code/3t3O0P3k3j0H (6 different blocks with new classes in)

I dont get it how can looping if the positions are different.

any help? thank you!!

# Answer
Hard to discern a pattern in your markup but have a look at the modulus operator https://ellislab.com/expressionengine/user-guide/templates/conditionals.html#modulus-operator which can be handy if you need to do something every nth iteration of a loop.

Why do you need the top-x2 and top-x1 classes?
> 0 votes

# Answer
You can always have multiple {switch tags}

```
<div class="row {switch='first|second'}">

  <div class="{switch='left|right'>Something</div>
  <div class="{switch='right|left'>Something else</div>

</div>

```

Or if you can work it out in your head something like this:

```
<div class="row {switch='first|second'}">

  <div class="{switch='left1|right1|left2|right2'>Something</div>
  <div class="{switch='right1|left1|right2|left2'>Something else</div>

</div>

```
> 0 votes

---
Tags: entries, loop, switch, custom-order-fields
---


# Question
Title: Relate EE Entries with Location (Region/City/Place)
What is best way to relate EE Entries with location (Region/City/Place) example 1. Entry of Simba National Park, 2. Then i choose park category (Game Park, Beach Park, Cultural Park, Mountain Park) 3. Now i Need to have location, or choose where its located, (Region/City/Place), sort of chain select on entry form? 4. I will later filter these parks by location, or search location to display parks etc

Thanks Paul

# Answer
Lots of option here:

**Use a 3 level category structure:**

Region

\__City

\____Place

Select categories as required for each entry. You can then call all entries in each category, with each deeper level of category refining the results.

**Use 3 channels with relationships**

1. Regions channel (no relationships)
2. Cities channel (relate city to Region entry)
3. Places channel (relate place to City entry)

When you call Regions you can just show a list of regions, or you can output each region's Cities as parent related entries

When you call Cities you can just show a list of cities, or you can output each citie's places as parent related entries.

Or you could just use categories for Regions, and the relationship method for deeper data.
> 1 votes

---
Tags: channel, structure, database, entry, channel-entries-api
---


title: Field Uniqueness

text:
# Question
Title: Field Uniqueness
I am working on a Web App that a teacher assigns a passphrase to a channel entry and students can sign in by searching for the phrase (not super secure I know, but it works for my application). My current dilemma: how to force a field to be unique, I don't want other teachers using the same passphrase, that won't work. Can Expression Engine force uniqueness in a "custom field". I know it does it for url-title. Is there a plugin maybe?

# Answer
You'll have to utilize an add-on: e.g. an extension that uses hooks to verify the value of the custom field.

Perhaps you could use the teacher's name or a prefix thereof to help make the passphrase unique; or an additional field that the user has to fill out. For instance, eCommerce sites often utilize an email address + zip code to look up an order. Or an order number and email address, etc. Essentially a two data-field way to gain access.
> 0 votes

---
Tags: channel, custom-fields, entry
---


title: Entry_date is the season

text:
# Question
Title: Entry_date is the season
Is it possible to show the entry\_date to the season it's been published? e.g. Written in Autumn at.........

This will also need to work in different time zones. Client will publish from Europe and Australia.

# Answer
You could use conditionals and the date format function to extract the month from the date and output a different season.

Of course you would then need to define seasons by the start/end of months. It's down to how precise you wish to be.

For instance;

```
{if "{entry_date format='%n'}" > 1 AND "{entry_date format='%n'}" < 5}
    It's Spring(ish) (matches feb, mar, apr)
{/if}

```

Thinking about this further you could be extremely precise if you forgo the automation and simply note the dates of the season changes for the next few years. How long do you expect this incarnation of the site to be live? It strikes me that it would be easier to hardcode the dates than write code to calculate them.
> 1 votes

# Answer
No, it isn't.

I believe your better solution is to code a simple plugin which converts a date into a season and vice-verse. You can provide as parameters:

* `season`;
* `start` or `end`;
* `hemisphere`;

Or something like that and use the returned value to fill the parameters `start_on` and ´stop\_before\`.
> 0 votes

---
Tags: entry-date
---


title: Cartthrob and Grid fieldtype

text:
# Question
Title: Cartthrob and Grid fieldtype
I'm trying to retrieve an image stored within a Grid fieldtype.

I'm getting grid\_parser errors using EE 2.7.2 and Cartthrob 2.4

```
{exp:cartthrob:cart_items_info}
      {exp:channel:entries channel="products" entry_id="{entry_id}"}
          {product_detail_image limit="1"}
              <img src="{product_detail_image:product_image}" alt="{title}" />
          {/product_detail_image}
      {/exp:channel:entries}
{/exp:cartthrob:cart_items_info}

```

The changelog says that Cartthrob has been updated to fix Grid compatibility.

Or perhaps an example if my code is freaky.

# Answer
I know this was asked over 3 months ago, but the question is still valid and the answer that was given is not.

With CartThrob, a lot of information is stored in the cart\_items\_info tag that needs to be displayed. In my case, I'm using a conditional whether or not to allow someone to update the quantity in the shopping cart. I'm using Grid to set details about the product and without the ability to parse the Grid data, the conditional doesn't work.

A work-around for most scenarios is to embed a template with

```
entry_id="{entry_id}"

```

and then using the channel:entries tag in the embedded template to display the Grid data.

CartThrob was updated to 2.5 which added some Grid support but has not fixed the issue with the cart\_items\_info tag.

Here's the error it's throwing when a Grid field type is within the cartthrob:cart\_items\_info tag:

```
A PHP Error was encountered

Severity: Notice

Message: Undefined index: 106

Filename: libraries/Grid_parser.php

Line Number: 155

```

**Update** \- I was able to get my conditional to work by using the embedded template and the entry\_id variable, adding the conditional with Grid :total\_rows parameter, adding another cartthrob:cart\_items\_info tag within the conditional and adding the entry\_id as a parameter so it will only display a single item as opposed to looping through all items. It's the long way around the situation, but it does fix my problem.

Hoping CartThrob will have full Grid support in the near future.
> 1 votes

# Answer
It seems a problem with cartthrob not parsing grid field data properly with paired tags. For a workaround I just created a small plugin till this issue is really resolved.

Download At : cartthrob\_gridimage\_fix

This helps in not using too many embeds and also a workaround without modifying the cartthrob core.

Tip : SUBSTANTIALLY THIS PLUGIN CAN ALSO BE USED TO LOAD GRID IMAGES FOR A GIVEN ENTRY AT ANY PLACE WITHOUT USING CHANNEL ENTRIES TAGS THUS HELPING IN, AVAID UNWANTED CHANNEL FIELDS.
> 0 votes

# Answer
Here is how it should work:

```
{exp:channel:entries channel="products"}
   {product_detail_image}
      <img src="{product_detail_image:product_image}" alt="{title}" />
   {/product_detail_image}
{/exp:channel:entries}

```

Or:

```
{exp:channel:entries channel="products"}
       {product_detail_image}
          {product_detail_image:product_image limit="1"}
             <img src="{url}"/>
          {/product_detail_image:product_image}
       {/product_detail_image}
    {/exp:channel:entries}

```

i think that you dont need this:

```
{exp:cartthrob:cart_items_info}

```
> -1 votes

---
Tags: cartthrob, grid
---


title: How to Modify a Global Date Variable

text:
# Question
Title: How to Modify a Global Date Variable
Is it possible to modify a date variable (entry\_date in this case) so that you have entry\_date plus one year (or any other amount of time)?

For example, if entry\_date was 6/4/14 2:59 PM, could I add one year to that date and end up with 6/4/15 2:59 PM, and would I still be able to use that variable in a conditional statement?

EDIT: Essentially what I want is something like this:

```
{if (entry_date + one_year) > current_time}
    <p>New Product</p>
{/if}

```

SECOND EDIT:

Robson, I tried the code that you added (both the regular and inverted logic) and I'm unfortunately STILL ending up with the same error. However, I continued to play around with the code and found that this does not throw an error:

```
{if {current_time format="%Y%m%d%H%i"} == {entry_date format="%Y%m%d%H%i"}}
    less than an year
{if:else}
    more than an year
{/if}

```

But this does throw the same error:

```
{if {current_time format="%Y%m%d%H%i"} - {entry_date format="%Y%m%d%H%i"} == 1}
    less than an year
{if:else}
    more than an year
{/if}

```

Do I need to change the comparative number to something more specific? Are we comparing two variables that we can't compare? Or am I just missing some bracket again? I feel like it's almost there...

# Answer
I never tried something like this, but maybe it could work.

You can't add a year to a date without an add-on., but there are mathematical operators on the conditionals.

Format the date like a number using all data required by the precision you need plus one year following the same format: YYYYMMDDHHMM.

```
{if {entry_date format="%Y%m%d%H%i"} + 100000000 > {current_time format="%Y%m%d%H%i"} }
    less than an year
{if:else}
    more than an year
{/if}

```

Maybe it's better to invert the logic to make the code easier to understand:

```
{if {current_time format="%Y%m%d%H%i"} - {entry_date format="%Y%m%d%H%i"} < 100000000  }
    less than an year
{if:else}
    more than an year
{/if}

```

---

## Using an add-on

If you can't update to EECMS 2.9 you can code your own add-on for this using strtotime() php function, like Low Nice Date does.

```
{exp:low_nice_date date="{entry_date format='%Y-%m-%d %H:%i + 1 Year'}" format="%Y%m%d%H%i"}

```

But the code will become far more complex and harder to maintain.
> 0 votes

---
Tags: global-variables, date-format, entry-date
---


# Question
Title: How to display radio or dropdown options from a matrix column
I have a Matrix field that has columns that are using cell type "Field Pack - Radio Buttons" and "Field Pack - Dropdown". Each of these has 4 options (Master, Advanced, Intermetiate, Apprentice). If an option is set for these columns, i can get these easily in the matrix pair tag.

Is there a way to access and display the entire option list (Master, Advanced, Intermetiate, Apprentice)? I'm sure there is a way to access this, but i have had no luck.

Any input would be greatly appreciated!

# Answer
If you're just wanting to show the values on a page, you could do it with an SQL query, or you could possibly output it using ExpressionEngine Channel Forms? It's the replacement for SafeCracker. Instead of showing a full form collecting info you could just use it to show the values.
> 0 votes

---
Tags: matrix
---


title: doing Forms in EE

text:
# Question
Title: doing Forms in EE
I'm really struggling with EE. I am trying to build an application that needs to build a complex form based on channel data and the user's location.

The current stuggle is this:

It's a multi-page form, with lots of logic happening, depending on the choices the user makes, etc. At the end, I need to store the information somewhere, ideally in an EE channel, but at this point I'm not tied to that.

Normally, I could build this in straight php no problem, passing data from step A to the form in Step B, doing the logic, etc.

Is this something that needs to be done via a module? I see you can have forms post there and process data that way. Not sure in the end if I can get it into a channel, but maybe in my own custom table.

Is building a custom module the way to go?

-Jim

# Answer
Use Channel Forms: https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/index.html

The *easiest* way to do multi-page forms is using javascript to just show / hide the next form section in the wizard when you click next / previous (and then submit on the final step).
> 1 votes

# Answer
Your suggestion of building it in straight php is still a **perfectly acceptable and valid option**. A few php-enabled templates with forms posting to themselves, validating and redirecting to the next step with already entered data in the session (just as you would normally in php) is sometimes how you have to go if the logic gets too complex. Then at the end you can create a channel entry using php (and even use EE's code to do so). Or just store it in a table depending on your needs. Good luck!
> 1 votes

# Answer
If you dont want to introduce PHP you can use one of the few plugins/modules to get you posted data. I've used Stash to do this in previous multi-step forms.

Simply like this:

```
 <form method="post" action="/{segment_1}/detail">
  <select name="state">
    <option value="state1">State1</option>
    <option value="state12">State12</option>
  </select>
</form>

```

Then on the 'detail' template, I can use:

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

```

Obviously if you're going to save all this to a channel form, a single form with each "step" turned on/off via JS is a simple way to achieve it and negates the use of modules or complex work-arounds.
> 0 votes

---
Tags: forms
---


# Question
Title: using low variable as parameter in exp:channel:entries
I'm having an issue I can't get around (even not after reading Low variable as channel entry\_id parameter across MSM sites that looks a similar problem)

```
{exp:channel:entries channel="references" limit="5"
sort="desc" category="{embed:cats}" entry_id="NOT {exp:low_variables:single
var='elv_excluded_entry_ids' preparse:target_channel='references'
preparse:from_subsite='innoviso' }" }

```

I'm trying to exclude certain entries to be shown based on some logic build in a low variable

```
{if from_subsite=="innoviso"}
{exp:dandy_cat:entries channel="{target_channel}" category="(17)&(not 16)"}
{entry_id}|
{/exp:dandy_cat:entries}
{/if}
{if from_subsite=="solutions"}
{exp:dandy_cat:entries channel="{target_channel}" category="(16)&(not 17)"}
{entry_id}|
{/exp:dandy_cat:entries}
{/if}

```

I've made generic so it can be reused on different parts of the site. When outputting the low variable in a template I get an list of entry\_ids as expected.

When I do the same in the exp:channel:entries tag i get something like this

entry\_id="NOT M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr"

I've tried the solution mentioned in the other post, but that does not work for me unfortunately. Any ideas anyone?

rg, Tim

# Answer
> 1 votes
The example you linked is a Select variable type, which stores its value as a pipe-separated list of items. You can use that as a parameter value.

Your variable, on the other hand, **contains conditionals and tags**. These are **not** parsed before they hit the template, but are put in the template and are **then** parsed **by the template**.

You're thinking the exp-tags and conditionals are evaluated **before** they hit the actual template, but that is **not** the case.

LV will put its content into the template, like Snippets. What you need, is an early parsed LV in variable syntax (ie. `{lv_my_var}`) which contains **the entry IDs themselves, *not* the logic to generate those IDs**. If you do need the latter, you'd need to create your own add-on that returns those IDs.

PS, I'll just leave this here: http://gotolow.com/parse-order

---
Tags: low-variables
---


# Question
Title: Channel Ratings "Unable to receive your comment at this time." Error
I'm getting this very unhelpful message when I try to submit a review form:

> The form you submitted contained the following errors
>
> Unable to receive your comment at this time.

This error doesn't give me much to go on, so I don't know where to start debugging it. Here's my template code:

```
{exp:comment:form
  channel='products'
  entry_id='{structure:page:entry_id}'
  parse='inward'
  form_class='member-review'
  rating:enabled='yes'
  rating:required='yes'
  rating:collection='member_reviews'
  rating:min_value='1'
  rating:max_value='5'
  rating:return='notifications/submission-success/product-review'
}
  {if rating:not_rated}
    <div class="alert-box ajax-form"><a href="#" class="close">×</a></div><!--.alert-box-->
  {/if}

  <div class="form-body">
    {if rating:already_rated}
      <p class="already-rated">You have already rated this product.</p>
    {/if}

    {if rating:not_rated}
      <div class="sub-ratings">
        <div class="rating-field">
          <div class="rating-name">
            <label for="rating-directions">Directions:</label>
          </div><!--/.rating-name-->
          <div class="rating-input">
            <input type="radio" name="rating[directions]" value="1" checked="checked" class="star required">
            <input type="radio" name="rating[directions]" value="2" class="star">
            <input type="radio" name="rating[directions]" value="3" class="star">
            <input type="radio" name="rating[directions]" value="4" class="star">
            <input type="radio" name="rating[directions]" value="5" class="star">
          </div><!--/.rating-input-->
        </div><!--/.rating-field-->

        <div class="rating-field">
          <div class="rating-name">
            <label for="rating-packaging">Packaging:</label>
          </div><!--/.rating-name-->
          <div class="rating-input">
            <input type="radio" name="rating[packaging]" value="1" checked="checked" class="star required">
            <input type="radio" name="rating[packaging]" value="2" class="star">
            <input type="radio" name="rating[packaging]" value="3" class="star">
            <input type="radio" name="rating[packaging]" value="4" class="star">
            <input type="radio" name="rating[packaging]" value="5" class="star">
          </div><!--/.rating-input-->
        </div><!--/.rating-field-->

        <div class="rating-field">
          <div class="rating-name">
            <label for="rating-overall">Overall Satisfaction:</label>
          </div><!--/.rating-name-->
          <div class="rating-input">
            <input type="radio" name="rating[overall]" value="1" checked="checked" class="star required">
            <input type="radio" name="rating[overall]" value="2" class="star">
            <input type="radio" name="rating[overall]" value="3" class="star">
            <input type="radio" name="rating[overall]" value="4" class="star">
            <input type="radio" name="rating[overall]" value="5" class="star">
          </div><!--/.rating-input-->
        </div><!--/.rating-field-->
      </div><!--/.sub-ratings-->

      <div class="fieldgroup comment">
        <label for="comment">Share your review with others</label>
        <textarea name="comment" id="comment" rows="8" class="required"></textarea>
      </div><!--/.fieldgroup-->

      <div class="submit-wrap">
        <input type="submit" value="Comment">
      </div><!--/.submit-wrap-->
    {/if}
  </div><!--/.form-body-->
{/exp:comment:form}

```

# Answer
> 1 votes
This error is coming from EE core, not Channel Ratings. It happens when a duplicate comment is submitted (like a test comment, i.e. "test"). Source.

---
Tags: devdemon, channel-ratings
---


# Question
Title: Template group parsing index file even when not called
I'm experiencing some strange behavior with one of my template groups.

There are two templates in the group, index and award. When loading the award template I am seeing content from the index file also displayed. The index file has PHP output switched on but this template shouldn't be getting parsed at all right?

In addition the award template first checks to see if a user is logged\_out and displays a login form. However this condition is never being met, it's always seeing the user as logged\_in even when not.

Any ideas what could be going on?

# Answer
I found out why the index file was being parsed. I using Stash to render my templates and I was missing the closing tag for exp:stash:set for this partial!
> 1 votes

---
Tags: templates, stash, parsing
---


title: How do I update SL Google Maps to EE2

text:
# Question
Title: How do I update SL Google Maps to EE2
I am in the process of upgrading from EE1 to EE2. My EE1 site makes use of the SL Google Maps add-on, which does not seem to have an EE2 version. How do I handle this problem? Is there an add-on available for EE2 which allow me to upgrade relatively seamlessly?

# Answer
> 1 votes
We've ported *SL Google Maps* to EE 2 by ourself, but ultimately switched to *Google Maps for ExpressionEngine* from *Objective HTML* nonetheless after a few month of operating SL GM on EE2 and several Maps-API-changes made by Google.

I would recommend you to switch to *Objective HTMLs* Module too.

# Answer
> 3 votes
The big daddy of googlemaps add-ons for EE2 is http://devot-ee.com/add-ons/google-maps but afaik there's no seamless upgrade path. You could contact objective html and ask though.

# Answer
> 1 votes
Another Maps plugin I can easily recommend is Gmaps \- the developer is always updating it and keep improving the experience..

---
Tags: ee1, upgrade, ee2-upgrades, google-maps
---


title: All new items have same ID# 0

text:
# Question
Title: All new items have same ID# 0
I just updated a site from 2.6 to 2.9.2.

It's been very buggy since and nothing seems to work. I think I found the problem but I don't know where to fix.

All new entries have the same ID of 0 regardless if an entry, asset, asset folder, user etc.

New Assets load but don't stick to an already created entry(when I add an asset and save the entry and then go back, it is not there). Thumbnails of new Assets are wrong. Duplicate empty Assets folders are created in the CP when I update indexes.

Freeform does not submit because the url passed when submitting the form is .../?ACT=0. I get a blank page.

If I add user, I can log in fine but if I add a newer user, the password is now wrong, again because now both users have the ID of 0.

Anyone know why the ID column is defaulting to 0?

# Answer
> 1 votes
Turned out to be a boinked database migration or something went wrong with the upgrade wizard. Never could figure it out. I ended up having to go to the original files and start the process again. Second upgrade went without issue.

Always backup.

---
Tags: control-panel, database, upgrade
---


# Question
Title: Super Admin locked out of ExpressionEngine Control Panel (Zoo Visitor Addon)
I appear to have been logged out and cannot log back in to the site. Heres what I did:

1. Installed Zoo Visitor
2. created a new Clients member group
3. added a zoo visitor channel field to another channel (Notice Channel)
4. edited a Notice channel entry and added a new member to Clients from the zoo visitor field
5. It went straight to a grey Error page

Now I cannot log in with my super admin account.

Any ideas? Im pretty far into development of this site.

EE version 2.7.3 Zoo visitor version: latest. Thanks for your help!

# Answer
> 1 votes
Have you tried logging in using your Super Admin email address as your username?

# Answer
> 1 votes
I would recommend changing your admin\_session\_type in the config file to $config\['admin\_session\_type'\] = 's'; and trying again... if 's' (session) doesn't do the trick try 'c' (cookie)

It might also be worth taking a peek at http://ellislab.com/forums/viewthread/216411/

If you locked out your account from some reason, you might have to clear out entries in the exp\_password\_lockout table for that user.

# Answer
> 1 votes
If the issue is logging in, and that's it, you can change replace your password in the exp\_members table with an md5 hash of a password, and then log in using the unhashed version of the password.

It's also possible to log yourself in programmatically (see EE 2.6.0 Password Reset not working)

# Answer
> 0 votes
I had a similar problem (locked out super admin account after installing Zoo Visitor and transferring members) and when I went into phpMyAdmin for my database and looked at the exp\_members table, I saw that my super admin email address had been changed (one letter removed). I believe this was because I had two user accounts with the same email address -- my super admin account and an anonymous account used by a public channel form. The anonymous user kept my exact email address and the super admin user had a slightly modified version of the email address. Then I changed the anonymous user's email address in phpMyAdmin, logged in with my incorrect super admin email address, and changed my email address in the CP. I guess I could have changed that email address directly in the database, too, but I wanted to see if I could login.

---
Tags: login, zoo-visitor, super-admin, zoo
---


# Question
Title: Question marks in 100's of articles throughout site
I've inherited an EE2.6 site, which was migrated from EE v1 by another developer.

There are many articles that contain '?' characters throughout the text when displayed, they appear to be windows extended chars, and there are 1000's of articles, so too many to change by hand.

How can I get these to display correctly? I have tried changing the encodings, on the page, and on the database connection, didn't help.

database settings:

```
['char_set'] = 'utf8';

['dbcollat'] = 'utf8_general_ci';

```

config

```
$config['charset']  =  "UTF-8"

```

Will I have to run a global replace on the channel\_data? Not sure I can identify and map all the original characters!

Alternatively can I use WIGWAM's 'paste from word' option retrospectively on existing content somehow?

# Answer
> 0 votes
I found the cause; the original EE1 data was held in tables that were set to the default collation 'latin1\_swedish\_ci'.

The previous dev had exported this data as 'utf8' (phpmyadmin's default export setting, and maybe ExpressionEngine's upgrade script setting?), hence the '?'s, it needed to be exported as 'latin1', and then converted to UTF8 (I used textpad to do this).

---
Tags: templates
---


# Question
Title: show all entries based on author of current entry
I have a simple blog displaying a single entry using segment \_2 as the url title.

I want to display a list on this same page that displays links to read other entries by the same author.

The only way I have been able to do ti so far is by adding the author\_id to segment 3 but that is not acceptable to the client.

Is there an embed method or something else where I can display the other entries from the same author without using a segment to get the author id?

```
{exp:channel:entries channel="blog" entry_url="{segment_2}" limit="1" dynamic="yes"}
{title}
{content}

Other Entries by {author}
 {/exp:channel:entries}

<ul>
 {exp:channel:entries channel="blog"  limit="12" dynamic="no" author_id="???"}
<li><a href="{title_permalink=blog}">{title}</a></li>
</ul>
{/exp:channel:entries}

```

# Answer
SOLVED

using an embed here is the embed:

```
{exp:channel:entries channel="commentary" limit="12" dynamic="no" author_id="{embed:author_id}"}
<li><a href="{title_permalink=commentary-test}/">{title}</a></li>
{/exp:channel:entries}

```

Parent page:

```
{embed="commentary-test/author" author_id="{author_id}"}

```
> 1 votes

---
Tags: members, author
---


# Question
Title: Mix results params and search fields in solspace user
Is it possible to search in solspace user from search fields and hardcoded fields as attributes in the results tag?

Like so:

```
{exp:user:results group_id="6"
                            search:js_makecvpublic="YES"}
                        <div class="search-candidate-result">
                            <h3 style="padding:0;">{js_makecvpublic} - {js_firstname} {js_lastname}, {js_addresscity}</h3>
                        </div>
                        {/exp:user:results}

```

I have a form which searches through various member fields and works ok. But I need to filter only candidates that have allowed their CV to be made publicly available and i dont want to have it as a hidden field in the search form as it can be easily changed.

When i add the js\_makecvpublic to my search form as a hidden field, it works, when i hardcode it into the results tag, it doesnt. Possible?

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

In the meantime, although totals, and perhaps pagination, wouldn't be accurate (PHP could be used to get a total though), you could use a simple conditional inside `{exp:user:results}` to filter out users that have `js_makecvpublic` set to "YES". Eg:

```
{if js_makecvpublic == "YES"} ... {/if}

```

---
Tags: solspace-user
---


# Question
Title: ExpressionEngine Stash Troubles Using Logic Operators
I've been struggling with stash on this project for some reason. I have a business that has multiple locations available. The locations page is filtered by location to only show what the user selects.

I have the nested lists working now thanks to Mark Croxton (@croxton). I can't seem to get my logical operators working properly though.

So I have a list that looks like this:

```
{exp:stash:set_list name="locations" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries
        channel="location"
        orderby="title"
        sort="asc"
        disable="categories|member_data|pagination"
        dynamic="no"
    }
        {stash:item_entry_id}{entry_id}{/stash:item_entry_id}
        {address}
            {stash:name}{name}{/stash:name}
            {stash:street}{street}{/stash:street}
            {stash:street_2}{street_2}{/stash:street_2}
            {stash:city}{city}{/stash:city}
            {stash:state}{region}{/stash:state}
            {stash:postal_code}{postal_code}{/stash:postal_code}
        {/address}
        {stash:number}{phone_number}{/stash:number}
        {exp:stash:set_list:nested name="location_hours" context="{entry_id}" parse_tags="yes"}
            {hours_of_operation}
                {stash:status}{hours_of_operation:status}{/stash:status}
                {stash:day}{hours_of_operation:day}{/stash:day}
                {stash:open}{hours_of_operation:open format="%g:%i%A"}{/stash:open}
                {stash:close}{hours_of_operation:close format="%g:%i%A"}{/stash:close}
                {stash:range_open}{hours_of_operation:open format="%H%i"}{/stash:range_open}
                {stash:range_close}{hours_of_operation:close format="%H%i"}{/stash:range_close}
            {/hours_of_operation}
        {/exp:stash:set_list:nested}
    {/exp:channel:entries}
{/exp:stash:set_list}

```

I have figured out that I have to set the format of date/time stamps whilst setting the variables in stash rather than passing them through and formatting them when used. I wish there was a different way, but I can't seem to get that to work. This is why I have `range_open` and `range_close` variables. I am trying to use those in order to display the status of the location being viewed.

Per a thread in which Mark informed someone to pull the "parse\_conditionals" from inner and outer lists.

```
{exp:stash:get_list
    name='locations'
}
    <div class="contentbox {name}{if '{name}' == 'XXX'} active{if:else} hidden{/if}">
        <div class="grid_3 nomargin">
            <h4>{name}</h4>
            <p>{street}<br />{city}, {state} - {postal_code}</p>
        </div>
        <div class="grid_3 nomargin">
            <h4>HOURS</h4>
            <ul style="list-style:none; padding:0;">
                {exp:stash:get_list:nested
                    name="location_hours"
                    context="{item_entry_id}"
                    prefix="nested"
                }
                    <li><p class="text-left" style="font-weight:bold;padding:0;">{nested:day} : {nested:status}</p>{if "{nested:status}" == "Open"}<p style="font-size:85%;padding:0;text-align:center;">{nested:open} - {nested:close}</p>{/if}
                {/exp:stash:get_list:nested}
            </ul>
        </div>
        <div class="grid_3 nomargin {name}">
            <h4>STATUS</h4>
            {exp:stash:get_list:nested
                name="location_hours"
                context="{item_entry_id}"
                prefix="inner"
            }
                {if "{inner:day format='%l'}" == "{current_time format='%l'}"}
                    {if "{inner:status}" == "Open"}
                        {if "{current_time format='%H%i'}" >= "{inner:range_open}" AND "{current_time format='%H%i'}" <= "{inner:range_close}"}
                            <p>We are currently <strong>Open</strong></p>
                        {if:else}
                            <p>We are currently <strong>Closed</strong></p>
                        {/if}
                    {/if}
                {/if}
            {/exp:stash:get_list:nested}
            <h4>CALL</h4>
            <p>Phone: {number}</p>
            <h4>EMAIL</h4>
            <p><a href="{email}">{email}</a></p>
        </div>
        <div class="clearnospacing"></div>
    </div>
{/exp:stash:get_list}

```

Everything seems to be working well except for the store "STATUS" segment. I don't know if this is due to looping through the nested stash list twice or not. I didn't see anything in the docs saying it couldn't be done. I have even tried to change the "prefix" for the secondary loop to "inner" rather than "nested". The odd thing is that I can retrieve the values, but the logic won't compute.

For instance, in the secondary inner list loop, the line:

```
{if "{inner:day format='%l'}" == "{current_time format='%l'}"}

```

...when just output above the logic with this:

```
<h1>{inner:day format='%l'} == {current_time format='%l'}</h1>

```

...looks like this:

```
Sunday == Friday
Monday == Friday
Tuesday == Friday
Wednesday == Friday
Thursday == Friday
Friday == Friday

```

What's even more strange is that if I output the debug string with:

```
<h1>{inner:day format='%l'} == {current_time format='%l'}</h1>

```

Then I get the following:

```
Sunday == Friday
Monday == Friday
Tuesday == Friday
Wednesday == Friday
Thursday == Friday
Friday == Friday
We are currently Open
Saturday == Friday

```

So why would outputting the variable cause it to work? If I remove:

```
<h1>{inner:day format='%l'} == {current_time format='%l'}</h1>

```

Then I don't get the expected result. I have bypassed this for now by leaving it in and commenting it out with HTML comment tags, but this is definitely NOT the solution.

# Answer
> 1 votes
Stash itself doesn't have modifiers for variables, such as `format=""`. It can only capture strings from other tags. You will need to save the formatted dates when you *set* the Stash list if you want to use them in a comparison when getting the list.

---
Tags: ee2, stash, nested-list, logic
---


title: Is there a layout switcher in EE2?

text:
# Question
Title: Is there a layout switcher in EE2?
Ok so I have this dreamweaver extension called tab panel menu where each menu I can generate either a single column, 2 column, 3 column, 4 column, 5 column or sub menu. Now I wish to make use of this inside EE2 without having to do it on dreamweaver. I figured to make use of if:else statement for the html output. My problem if I want to generate column within channel entries? So if Field 1 = Layout Selection, Field 2-7 = Show field for Selected layout(Of course in horizontal order with labels' like For right sidebar, for left sidebar, for middle content).

So that if I were to write a new channel entry, I can just select layout and then fields for that layout will show up.

Example:
-On Channel Entry-
Field 1 - Layout Selection
(col-default
col-75-25
col-60-40
col-50-50
col-40-60
col-33-33-33
col-25-75
col-25-50-25
col-25-25-25-25
col-20-20-20-20-20)
Field 2 - Content A
Field 3 - Content B
Field 4 - Content C
Field 5 - Content D
Field 6 - Content E
Field 7 - Content F

-On template-
Some channel code here
{if layout\_selection == "col-20-20-20-20-20"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

\

{content\_c}
\

\

\

\

{content\_d}
\

\

\

\

{content\_e}
\

\

\

{if:elseif layout\_selection == "col-25-25-25-25"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

\

{content\_c}
\

\

\

\

{content\_d}
\

\

\

{if:elseif layout\_selection == "col-25-50-25"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

\

{content\_c}
\

\

\

{if:elseif layout\_selection == "col-25-75"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

{if:elseif layout\_selection == "col-33-33-33"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

\

{content\_c}
\

\

\

{if:elseif layout\_selection == "col-40-60"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

{if:elseif layout\_selection == "col-50-50"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

{if:elseif layout\_selection == "col-60-40"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

{if:elseif layout\_selection == "col-75-25"}
\

\

\

{content\_a}
\

\

\

\

{content\_b}
\

\

\

{if:elseif layout\_selection == "col-default"}
\

\

{content\_a}
\

\

{if:else}
What the?! where is my Content!!!
{/if}

Some channel code here

# Answer
If I understood what you want, maybe one of these add-ons can help you:

* Entry Type \- A dropdown fieldtype that shows/hides other fields on the publish page;
* Better Pages \- Better Pages is an ExpressionEngine fieldtype designed to make using the Pages module significantly more end-user friendly;
* Entry Layout \- Lets you link custom fields to any entry of your website. It will let you save a different publish layout for two different entries even if they come from the same channel. Useful for static pages such as contact, about pages, etc... Plus, its support member groups;
* Plates \- This fieldtype for ExpressionEngine 2 is a drop in replacement for the native Pages Module or Structure Module ‘Template’ field;
> 2 votes

# Answer
You might find Template Snippet Select useful if you want to allow a way of choosing a layout template in the publishing form. Works well with snippets or full templates :)
> 0 votes

---
Tags: matrix, forms, grid, ifelse
---


title: Interrupt Channel Entries tag

text:
# Question
Title: Interrupt Channel Entries tag
I have a landing page with a bunch of entries, displayed from a good ol' channel entries tag pair. Now, I'd like to have a link to another page right in the middle of the entries (after 3 entries). The problem is that I can't just have two different tag sets, because I want the whole thing to be paginated. What can I do?

```
{exp:channel:entries channel="mychannel" limit="6" paginate="bottom"}
    <div class="block">
        {photo_matrix}<img src="{photo}" alt="{alt}">{/photo_matrix}
        {contact}{if name}<div class="hover"><div class="info"><span>Submitted By</span> {name}</div></div><!-- hover -->{/if}{/contact}
    </div><!-- block -->

    {my_pagination}{!-- (pagination snippet) --}

{/exp:channel:entries}

```

This is what I want:

```
 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

{          }
{   LINK   }
{          }

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

 __________
|          |
|  Image   |
|__________|

[PAGE 1 of 5] [<] [1] [2] [3] [>] [LAST]

```

# Answer
> 1 votes
If you want only the first page in your pagination set to have the link you can use `absolute_count` conditionally.

```
{exp:channel:entries channel="mychannel" limit="6" paginate="bottom"}
    <div class="block">
        {photo_matrix}<img src="{photo}" alt="{alt}">{/photo_matrix}
        {contact}{if name}<div class="hover"><div class="info"><span>Submitted By</span> {name}</div></div><!-- hover -->{/if}{/contact}
    </div><!-- block -->

   {if absolute_count == "3"}
     Link goes here
   {/if}

    {my_pagination}{!-- (pagination snippet) --}

{/exp:channel:entries}

```

If however you want your subsequent pagination pages to have the link in position three as well then use `count` instead of `absolute_count`.

---
Tags: channel-entries
---


# Question
Title: Ideas please for creating survey and/or a poll
I need to start making weekly “survey” but not sure what way is the best to go.

Wish for some idea how to be able to manage simple poll that it is easy to store to database and easy to look overall stats when times goes (for old poll’s/surveys).

Current survey/poll results available after their submit to see for all users and site visitors.

Idea is simple:

* Site: one question
* User input: one out of 3-5 available choices
* Note: no email or anything else user input needed
* Action: redirect to same page to show results so far.

Another in mind is:

* Site: One question
* User input: simple textarea to fill in.
* Note: email input available, not required.
* Actions: redirect to page that simply says “thank you for your answer”.

——

Data handling: Admin-panel: easy access to collected data and results.

Thanks

# Answer
We've used Polls by EEHarbor - http://eeharbor.com/polls \- seems to work OK and does everything you ask for. It's paid-for though. Integrates with various chart libraries and is skinnable. The documentation isn't amazing but they have been quite helpful with support.

The results are easily viewable in the admin end but there's no export which would be nice.
> 0 votes

---
Tags: add-on
---


# Question
Title: Showing Playa field entries in Channel Entries loop
My EE site has 3 ranges of products separated into different channels. I also have a separate channel for featured products, which is basically contains a Playa field for dragging and dropping products from all ranges. There will only be 6 featured products.

On the first page of products, I want to show the 6 featured products, followed by 3 of the "normal" products, followed by pagination. I've marked the featured products entry as sticky, and have used a normal channel entries loop to retrieve all products for all ranges like this:

{exp:channel:entries channel="featured|channel-1|channel-2|channel-3" limit="9" orderby="title" sort="asc"}

However, as the featured products channel is classed as one entry, despite containing 6 products, the loop displays all 6 featured products plus 8 "normal" products. Is there a way to treat the entries in the Playa field as separate without using special statuses or categories? Any help is very much appreciated!

Thanks in advance!

# Answer
> 1 votes
A bit of a weird setup to be honest - but you can make this work with a conditional `limit`.

```
{exp:channel:entries limit="{if segment_2}9{if:else}4{/if}" channel="featured|channel-1|channel-2|channel-3" orderby="title" sort="asc"}

```

(This assumes that this code is in the `index` template of a template group.)

---
Tags: channel-entries, playa, channel, pagination
---


# Question
Title: Using Channel Form tag for a registration process need guidance
Putting together a site that takes a logged in user through a registration process, creating a golf tournament. I am using the channel form tag. What the client was promised was that the sign up could happen across several pages:

P1: Register a new tournament and details P2: Enter in golf course information P3: Enter in fundraising organization information ...

and there are several other steps. The user is using the "next" feature to get to the next part of the sign up. I set up a channel called tournament and created a set of fields for the inputs. It occurred to me that this isn't going to work because it won't understand the "next button if the form tag has been closed. I am a rank amateur at AJAX but I was wondering if there is a way to use one template while the user is going through the steps of the registration and still have all the info submit to one entry...

```
            {exp:channel:form channel="tournament"}
            <ul>
                <li>
                    <label for="tour_title">Tournament Name</label>
                    <input class="medium" type="text" name="tour_title" id="tour_title" value="{tour_title}">
                </li>
                <li>
                    <label for="tour_body">Tournament Description</label>
                    <textarea name="tournament-description"></textarea>
                </li>
                <li>etc .....</li>
            </ul>
        {/exp:channel:form}

            <section class="page_nav">
                <a href="#" class="form-button">Next</a>
            </section>
            <section class="page_nav">
                <a href="#" class="form-button">Last</a>
            </section>

```

The process is by no means over when the user hits "next", there are a bunch of steps. If someone knows a better way I am wide open. Thanks.

# Answer
> 0 votes
The best way to do with would be with Freeform Pro, which allows you to collect form data across multiple pages easily. Unless you specifically need the resulting entries to be Channel entries (rather than Freeform entries), it might be your best bet.

However - the simplest way to do this with a Channel Form is to simply show/hide different sections of the form with javascript.

```
{exp:channel:form channel="tournament"}
<fieldset id="section_1">
    <legend>Tournament Details</legend>
    <ul>
        <li>
            <label for="tour_title">Tournament Name</label>
            <input class="medium" type="text" name="tour_title" id="tour_title" value="{tour_title}">
        </li>
        <li>
            <label for="tour_body">Tournament Description</label>
            <textarea name="tournament-description"></textarea>
        </li>
        <li>etc .....</li>
    </ul>
    <a href="#section_2" class="next-section">Next</a>
</fieldset>

<fieldset id="section_2">
    <legend>Personal Details</legend>
    <ul>
        <li>
            <label for="tour_name">Your Name</label>
            <input class="medium" type="text" name="tour_name" id="tour_name" value="{tour_name}">
        </li>
        <li>
            <label for="tour_email">Your Email Address</label>
            <input class="medium" type="text" name="tour_email" id="tour_email" value="{tour_email}">
        </li>
        <li>etc .....</li>
    </ul>
    <a href="#section_1" class="next-section">Next</a>
</fieldset>
{/exp:channel:form}

```

Then some jQuery like so (this is pretty generic, but to give the idea):

```
$(document).ready(function()
{
    $('fieldset').not(':first').hide();
    $('.next-section').on('click', function(e)
    {
        e.preventDefault();
        target = $(this).attr('href');
        $('fieldset').hide();
        $(target).fadeIn();
    });
});

```

This doesn't actually *save* an data between "pages" of course - it just breaks the form into multiple steps so it's easier to digest for the user.

---
Tags: channel, forms
---


title: htaccess rules for subdomains?

text:
# Question
Title: htaccess rules for subdomains?
I am working on a site that is on a subdomain with a structure that looks like this:

http://dev.domain.co/sites/project/

I would also like to remove the index.php. I looked at THIS THREAD to see if it would apply but the client has the additional /sites/project in the URL. Does anyone know how I would set up the htaccess to remove the index.php within this environment? I can't get my navigation to resolve correctly and the CSS doesn't show. Thanks in advance.

# Answer
> 1 votes
In that case you just need to change the last line of the standard .htaccess rules. (That link is worth reading in its entirety.)

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

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

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

```

Re: links and CSS, that would all depend on how you're creating your navigation links, and how you're linking to your CSS. Hard to know what's up without seeing the relevant parts of your templates.

---
Tags: htaccess, subdomain
---


# Question
Title: URLs always resolve back to /index.php?/cp/login&return=
n00b to EE, just installed the free version 2.9.2 on ubuntu 14 VPS

I have moved the system folder one level up and am able to login ok

hitting /index.php gives me a login screen to the cp

I followed the quick hello world tutorial and created a page which should appear at /index.php/site

however, the url always/only resolves back to /index.php?/cp/login&return=

I am logged in at the time when i get this login screen

Can not find anything on the googles on this. thanks in advance

# Answer
Your index.php shouldn't be showing your Control Panel - admin.php should do that. Sounds like you've modified the index.php file incorrectly. Not sure what instructions you've followed, but I'd revert back to the original install index.php and admin.php and start here: Removing index.php.

And for moving your core folder you should follow these instructions. You should really have only needed to modify the `$system_path = '../system'` variable in both index.php and admin.php (unless you've renamed your admin.php file for additional security);

Supply an example of your htaccess folder if you're still having grief.
> 1 votes

---
Tags: login, ee, index.php
---


title: Expression Engine Control Panel

text:
# Question
Title: Expression Engine Control Panel
I am a newbie to EE. I went through the features and looks cool. I am planning to use it for my new project. But I want to know, whether its possible to create a custom page or function in control panel. Say I want to show the list of all users who booked an appointed. And I want to list them in a new page. Also buttons against each list item for specific function. Is it possible, can someone suggest some reference links to do such kind off stuff ?

# Answer
> 3 votes
Module tutorial:

https://ellislab.com/expressionengine/user-guide/development/module\_tutorial.html

Here is the official module creation tutorial (for EE 2.9.2). Custom modules allow you to create CP (control panel) views to handle almost any function, whether it be a simple 'settings' page for your custom module, or more complex views such as querying your database for specific records and displaying them in your CP.

A custom module doesn't even need a CP page though. Using either ACTions or the plugin API you could create a module that does what you want and outputs it to a template.

See the plugin API for more information on how to use your custom module in a template:

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

# Answer
> 1 votes
Depending on exactly what you want your buttons and "specific functions" to do, you can use the **Channel Form** (formerly SafeCracker) (https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel\_form/) add-on that will allow you to make changes to content within channels without having to log in to the CP. Note that even though it is considered an "add-on," it is built into all EE installs starting at version 2.7.

Basic syntax:

```
{exp:channel:form channel="store" entry_id="3" return="store/products"}
    <input name="price" type="text"> <!-- change info in the "price" field -->
    <input type="submit" value="Submit">
{/exp:channel:form}

```

Note: If you do not include an entry\_id or an entry\_title specification in the initial exp:channel:form tag, Channel Form will create an entirely new entry inside the channel in question ("store" in this case).

Hope this is helpful.

---
Tags: control-panel, custom
---


title: Dynamic Content In Fancybox Not Working

text:
# Question
Title: Dynamic Content In Fancybox Not Working
I have a listing of staff member that I want to have a link that pops up a bio via fancybox. I have no problem getting this to work using static id's, but when I try to do it dynamically via a custom field it doesn't seem to work.

Here is what I am doing:

```
<a class="staffLink" href="#" title="View {staff:staffName}'s bio">bio</a>

<script type="text/javascript">
                                        $(document).ready(function() {
                                            $(".staffLink").fancybox({
                                                href        : '#{staff:staffName} Bio',
                                                maxWidth    : 800,
                                                maxHeight   : 600,
                                                fitToView   : false,
                                                width       : '70%',
                                                height      : '70%',
                                                autoSize    : false,
                                                closeClick  : false,
                                                openEffect  : 'none',
                                                closeEffect : 'none',
                                                helpers     : {
                                                    media : {},
                                                    title : null,
                                                    overlay: {
                                                        opacity: 0.9
                                                    } // overlay
                                                }
                                            });
                                        });
                                    </script>

<div style="display:none;" id="{staff:staffName} Bio">{staff:staffName} test content</div>

```

If I take out the custom field (staff:staffName) and just leave "Bio" for the id of the popup and in the the href of the Fancybox parameters it works. Also, If I look at the outputted code it populates correctly. The staff name is filled in for the href and the id.

Any ideas?

# Answer
> 1 votes
You've got a few problems, all related to JavaScript, not EE though. You'd be better off asking on the general Stack Exchange if this doesn't answer it.

Your JavaScript code is being generated per loop of the bios, so you have 11 copies of the JS you've posted above and only the last one will ever run as they're all triggered from the same class trigger (.staffLink).

Next issue is your html is invalid - the ID you're trying to use the content for is invalid and has spacing in href: `'#Steve Eller Bio'`.

I'd suggest you ditch referencing it in that way and include only 1 occurance of the JS after all the bios have been output, then target the content relatively:

```
{START EE BIO LOOP}
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 staffItem item active">
    <a class="staffLink" href="#" title="View {staff:staffName}'s bio">bio</a>
    ...
    <div style="display:none;" class="staffBio">{staff:staffName} test content</div>
</div>
{/END EE BIO LOOP}

```

Note that the Bio content for the popup is inside the staffItem div. Now the JS (note I've changed the href parameter to `content`):

```
<script type="text/javascript">
    $(document).ready(function() {
        $(".staffLink").fancybox({
            content     : $(this).parent().siblings('.staffBio').html(),
            maxWidth    : 800,
            maxHeight   : 600,
            fitToView   : false,
            width       : '70%',
            height      : '70%',
            autoSize    : false,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none',
            helpers     : {
                media : {},
                title : null,
                overlay: {
                    opacity: 0.9
                } // overlay
            }
        });
    });
</script>

```

---
Tags: custom-fields, javascript, jquery
---


# Question
Title: How Calendar generates paths and how to get styles to carry through?
I'm working with SolSpace Calendar and I'm having trouble getting my styles to correctly display when paths are used in Calendar.

The calendar page is here: http://www.clubomgsf.com/calendar

For example: in the month view of the calendar, the "previous" and "next month" links look like this:

{path='calendar/month'}/{next\_month format="%Y/%m"}/ which ends up looking like this: http://clubomgsf.com/calendar/2014/10/

It looks like additional subdirectories are being called, but they don't exist. I know this is some sort of templating question, but I've looked around in the doumentation and can't seem to find an explanation of how this works.

**Question 1:** How is Solspace Calendar using these "subdirectories" (e.g. calendar/2014/10/ ) to pass these variables through to the next page?

**Question 2:** Currently I am using a snippet to link to global CSS document. What is the best way to get this styling to pass through to pages being called by "subdirectories" as mentioned above?

I appreciate your help.

EDIT: My MONTH template:

```
    <!doctype html>
<html>
<head>
<meta charset="UTF-8">
{exp:channel:entries channel="static_information"}
    <title>{website_name}</title>
    {site-includes}
{/exp:channel:entries}

</head>
<body>

<div id="background"></div>

<div id="masthead">
    {exp:channel:entries channel="static_information"}

    <a href="{site_url}mainsite"><img id="logo" src="{logo}" /></a><br />
    <div id="contact-info">
        {phone_number}<br />
        {address}<br />
        {e_mail}
    </div>

    <div id="sinker-left">
    </div>

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

<div id="content-wrapper">

    <div id="content">

        {exp:channel:entries channel="static_information"}
<a href="{site_url}mainsite"><div class="mobile-logo"><img src="{logo}" /></div></a>
{/exp:channel:entries}

        <div class="calendar-wrapper">

        <div id="fc_calendar">
            {exp:calendar:cal
            {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}

            <thead>
            <div class="floatleft"><a href="{path='calendar/month'}/{prev_month format="%Y/%m"}/">{prev_month format="%F"}</a></div>
            <div class="cal-header">{date format="%F %Y"}</div>
            <div class="floatright"><a href="{path='calendar/month'}/{next_month format="%Y/%m"}/">{next_month format="%F"}</a></div>
            </thead>

                <table id="fc_outer">

                <tbody>
                    <tr>
                        <td colspan="7">
                            <div class="wrap">
                                <table id="fc_inner">
                                    <thead>
                                        <tr id="days_of_week">
                                            {display_each_day_of_week}
                                            <th class="day_of_week {day_of_week}">
                                                {day_of_week}
                                            </th>
                                            {/display_each_day_of_week}
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {display_each_week}
                                         <tr>
                                            {display_each_day}
                                            {if day_in_current_month}
                                                <td class="day_cell">
                                                    <div class="date">
                                                        <a class="num"
                                                            href="{path='calendar/day'}/{date format="%Y/%m/%d"}/">
                                                            <div class="fp-cal">{date format="%j"}</div>  <!-- Dates in current month -->
                                                        </a>
                                                    </div>
                                            {if:else}
                                                <td class="day_cell out_of_range">
                                                    <div class="date">
                                                    <span class="num">
                                                        <div class="fp-cal-nonmonth">{date format="%j"}</div>  <!-- Dates in non-current months -->
                                                    </span>
                                                </div>
                                            {/if}
                                            {display_each_hour}
                                                {events}
                                                    <div
                                                      class="
                                                        event {if event_all_day}all_day{/if}
                                                        {if event_multi_day}multi_day{/if}
                                                        {if event_first_day}first_day{/if}
                                                        {if event_last_day}last_day{/if}
                                                        {if all_day_event_index_difference > 0}
                                                            index_difference_{all_day_event_index_difference}
                                                        {/if}
                                                      ">

                                                        <div class="c-eventbutton" style="background-image:url('{event_image}')">
                                                            <div class="c-infospacer">
                                                                <div class="c-eventinfo">
                                                                    {event_title}<br />
                                                                    {event_start_date format="%g%a"} •
                                                                    {if price}${price}{if:else}Free{/if}
                                                                </div>
                                                            </div>
                                                        </div>

                                                    </div>
                                                    {/events}
                                                {/display_each_hour}
                                            </td>
                                            {/display_each_day}
                                        </tr>
                                        {/display_each_week}
                                    </tbody>
                                </table>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            {/display_each_month}
            {/exp:calendar:cal}
        </div>

        SEGMENTS:<br />
1: {segment_1}<br />
2: {segment_2}<br />
3: {segment_3}<br />
4: {segment_4}<br />
5: {segment_5}<br /><br />

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

{embed="mainsite/sidebar-tpl"}

</body>
</html>

```

# Answer
> 1 votes
Ok everyone. I've figured this out.

If you are using segment variables like SolSpace Calendar does, please be sure to add **dynamic="no"** to your {exp:channel:entries} tags since the segment variables are designed to be used by the Calendar module.

In my case, Calendar's segment variables were mucking up other things that were supposed to be happening without being affected by these variables. This was happening even though I was NOT using any {segment\_#} tags in any of my {exp:channel:entries} tags, which seems quite counterintuitive. Just keep an eye out.

Whew!

---
Tags: solspace-calendar
---


title: Page responds with just a hash

text:
# Question
Title: Page responds with just a hash
Sometimes when I view my EE site on a local server, and less so on my live environments, I receive a 200 response which is looks like this:

{c1a3de9f993f7deec04da3d5075ac7f9948848712}

The next time I refresh the error goes away.

Does anyone have ideas of what causes this, or how to prevent it.

I use Stash, which may be related to the issue.

# Answer
> 2 votes
# How to fix

Disable template caching on all templates.

## Problem #1: Why is the template rendering as {c1a3d...8712}?

This bug was caused by EE's Template Caching feature and Stash.

Stash has two parsing stages. The first stage will replace the contents of a template with variables ('{c1a3d...8712}') that get parsed in the post-process stage.

If template caching is enabled for a template then EE will cache the template output *before* the post-process stage. When the template is loaded from the cache then Stash is unable to successfully execute the pre- and post-process stage and the half-processed template is displayed.

## Problem #2: Why is this occurring intermittently?

When Template Caching is enabled and the 'Refresh Interval' is set to zero then is might appear that caching is disabled.

However, EE checks the timestamp of the last generated cache vs. the current timestamp. Therefore if page is loaded multiple times in 1 second, the `time()` vs `time()` is `0` and the cached template is loaded.

Actual code: `elseif (time() > ($timestamp + ($refresh * 60)))`

Turn off caching to avoid this.

---
Tags: templates
---


# Question
Title: Solspace tag - display entries for multiple tags
How can I display entries for multiple tags?

For example http://www.my-domain.com/products/by-tag/color/blue+red+white should to display all entries which were tagged with blue and red and white "color tags"

I have try to split last segment by "+" and then loop through that array as separate `{exp:tag:entries channel="products" tag="<?php echo $tag; ?>"}` but final result is kind of messy, especially when multiple pages were returned.

# Answer
You should be able to list entries tagged with your three tags using `{exp:tag:entries}` and the `tag_separator=""` parameter. For example:

```
{exp:tag:entries
  channel="products"
  tag_separator="+"
  marker="color"
}

```

The default is a **comma**. If you want tags to be separated by a `+`, then use `tag_separator="+"`. In some cases, depending on your server and htaccess file settings, the `+` is actually read as a space, so if the above doesn't work try `tag_separator=" "`.

The `marker=""` parameter can be used when having Tag dynamically determine the tags from the URI, which would be detected using another URI marker rather than the standard `tag` marker segment. As an example using your case, insead of `template/tag/my_tag` it would be `template/color/my_tag`. Think of it as the `category` marker segment in EE for {exp:channel:entries}.
> 1 votes

---
Tags: channel-entries, tags, solspace-tag
---


# Question
Title: Can Super Search not log searches done by me?
I have been doing a lot of testing of the search feature recently (if you haven't seen my 5 or 6 recent other posts with Super Search questions), and I'm realizing that I'm filling up the search log with a bunch of my own searches. Is there any way I can not log searches based on IP address, or maybe by user (if I'm logged in)?

To that End can I delete searches from the search log easily (or at all, but I'd prefer not having to go through phpmyadmin)?

# Answer
> 0 votes
Unfortunately you cannot disable logging based on IP or any other criteria (feature request?). The only way would be to turn logging completely on or off.

As for clearing the Super Search log, in the Super Search module in the CP, under the "Search Log" tab, there's a **Clear Log** button in the bottom right of the screen to clear the log.

---
Tags: solspace, supersearch
---


# Question
Title: Super Admin unable to reset user password without knowing current pasword
So a staff member (belonging the 'editor' group) recently left, and we'd like to update the password to a dummy one but I can't seem to be able to do it as EE is asking me for the current password.

Any idea how?

Installed EE version is 2.8.0

# Answer
> 4 votes
The language is somewhat unclear on that screen. What you actually need to enter is *your* current password, not the *user's* current password.

# Answer
> 0 votes
Why don't you just ban or delete the account?

To answer your question, one method would be to run a MySQL query update on the members table row of that member\_id and insert nonsense into the password and salt fields, or better yet, take a look at the Auth library hash\_password method and generate a usable password hash and salt and insert that.

---
Tags: password
---


# Question
Title: Enable Membership Captcha on specific forms in ExpressionEngine
I am working on a website based on ExpressionEngine, which requires captcha on the member registration form.

For this, I enabled Membership captcha, and added the below code in the form.

```
{if captcha}
    <p>Please enter the word you see in the image below:</p>
    <p>{captcha}<br />
    <input type="text" name="captcha" value="" size="20" maxlength="20" style="width:140px;" /></p>
{/if}

```

It works fine, it shows the captcha as required. But the problem is, the website is divided into 2 parts:

* Free membership registration
* Paid membership registration

And I require captcha only on "Free membership registration" form and not on all the membership registration forms. I tried almost everything, and it has been 2 days, I am stuck with this problem.

Please let me know, how can carry this out? Help on this will be highly appreciated. Many thanks.

# Answer
Unfortunately, requiring a captcha is site-wide, not form-specific.

I'd suggest instead looking at Snaptcha, which is far more effective and requires no input from the user.
> 2 votes

# Answer
Thanks Derek Hogue for the reply. But I have found a work-around for this. I manipulated the config file according to the URI.Changed the LINE #173, and added an IF-ELSE condition.

```
if(stristr($_SERVER['REQUEST_URI'],"<Mypage_URI_Where_I_Dont_Cant_Captcha>") || stristr($_SERVER['HTTP_REFERER'],"<Mypage_URI_Where_I_Dont_Cant_Captcha>")){
    $config['captcha_require_members'] = 'N';
}else{
    $config['captcha_require_members'] = 'y';
}

```

I hope this helps someone looking for a similar work-around. Many thanks once again.
> 1 votes

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


title: URL structure for template

text:
# Question
Title: URL structure for template
I can't understand how to made URL structure for page For eg

http://site.com/template\_group/temlate1/template2/template3

http://site.com/services/cleaning/reviews/best

In admin panel, at template group services we have 4 templates

*index cleaning reviews best*

Every template have url

http://site.com/services/index/

http://site.com/services/cleaning/

http://site.com/services/reviews/

http://site.com/services/best/

I need to display some templates like this

http://site.com/services/cleaning/reviews/

or

http://site.com/services/cleaning/reviews/best/

# Answer
> 2 votes
It's important that you understand how EE parses URLs to determine what to display.

Generally it goes like this:

```
template-group/template/entry

```

or

```
template-group/template/category-trigger-word/category-id

```

The way you described your setup you seem to want to show two templates from the services channel at once (cleaning and reviews). Clearly this can't be done.

There are a number of ways to do what you want:

### Using EE's native parsing

Set up your template group, "services". Then create your "cleaning" template. Within this template you can place a conditional which looks at the third URL segment ({segment\_3}) and will then output the required reviews content. This might be done directly on the template, or by means of an embedded template.

### Use the Pages module

The pages module is really meant for the occasional static page but you could use it for this. It will allow you to set a custom URL for an entry and also choose which template should be used to render it.

### Use Template Routes

Template routes are very powerful and will let you set up different URLs to load specific templates. Within the route you can include rules to make sure your segments are a particular type.

### Use an add-on such as Structure

Love it or hate it but Structure can be extremely useful for some sites. This may be the simplest solution for you but be warned, it can bring it's own problems too.

---
Tags: ee2, ee
---


# Question
Title: Bring Matrix Data Editing to the Front-End using Channel Form
I am trying to create a form - FRONT END USER (channel form tag) - that uses a wizard (which is working) and in one panel it allows the user to fill in fields then duplicate the fieldset to add another set of criteria. I emailed Andris (P&T) and he sent me this link as a guide. I need some help, please.

```
<div class="fields" id="sortable">
            <div class="field"><!MATRIX FIELDS-->
            <input class="new_row_id" type="hidden" name="fundraising_organization[row_order][]" value="row_new_0">
                <ul>
                <li>
                    <label for="fundraising name">Fundraising Organization Name</label>
                    <input type="text" name="fundraising_organization[row_new_0][10]" value="{fund_name}">
                </li>
                <li>
                    <label for="fundraising address 1">Address 1</label>
                    <input type="text" name="fundraising_organization[row_new_0][11]" value="{fund_address_1}">
                </li>
                <li>
                    <label for="fundraising address 2">Address 2</label>
                    <input type="text" name="fundraising_organization[row_new_0][12]" value="{fund_address_2}">
                </li>
                <li>
                    <label for="fundraising city">City</label>
                    <input type="text" name="fundraising_organization[row_new_0][13]" value="{fund_city}">
                </li>
                <li>
                    <label for="fundraising state">State</label>
                     <select>
                        {options:fund_state}
                        <option value="{option_value}"{selected}>{option_value}</option>
                        {/options:fund_state}
                    </select>
                </li>
                <li>
                    <label for="fundraising postal code">Postal Code</label>
                    <input type="text" name="fundraising_organization[row_new_0][15]" value="{fund_postal_code}">
                </li>
                <li>
                    <label for="fundraising website">Website</label>
                    <input type="text" name="fundraising_organization[row_new_0][16]" value="{fund_website}">
                </li>
                </ul>
                <div class="buttons">
                    <input id="new" type="button" value="Add Another Organization">
                </div>
            </div>
        </div>

```

Should look like this (can't get Field Pack option to show either in above code):

# Answer
> 0 votes
Had the same problem with a Field Pack Dropdown field, according to the author of the post on Bring Matrix Data Editing to the Front-End

> the reason it will not work is because the {options} tag pair for ‘fund\_state’ is looking for ‘root level’ options, and it (this native usage) does not have a method for looking into a column of that field since Matrix is third-party.

Got around this thanks to the answer to my question on this page: https://expressionengine.stackexchange.com/a/26144/48

---
Tags: matrix, safecracker, pixelandtonic, fieldtype, field-pack
---


# Question
Title: Quantity based discount for single product in Expresso Store
I'm using latest build of Expresso Store, 2.3.1. I need to apply quantity based discounts to products, but the discount needs to apply to a single product. For example:

I have 10% off discount for all products in store when you order 10 or more of a single product, but the discount only applies to the particular product. So I order 11 of Product 1, 10 of Product 2 and 5 of Product 3. Products 1 and 2 will get the discount, product 3 will be full price.

As far as I can see this is not possible in Store. If so are there any ways I can handle this in the template? As our discount will likely be pretty simple, with the same discount being applied store wide.

Failing that, what are our options for extending Store to achieve this?

Update: Just to clarify, we are looking to apply this discount at a category or store wide level, rather than updating the pricing of an individual product, as there are thousands of products this would not be viable, in particular as we will likely just have one percentage discount that is the same for all products.

# Answer
Use this bulk discounts add-on, does exactly what you need. Create a new field type and discounts are controlled per product and at definable quantities.

Does need Matrix installed though.
> 1 votes

# Answer
We've just had the bulk discount configured to work with store 2.4 by another extension developer. You're right, it doesn't accept percentage discounts however you could easily use Datagrab to import the matrix fields all at once across any product range you wanted.

I'm sure we could put you in touch with the developer that made the add on compatible with store 2 if you wanted...
> 0 votes

---
Tags: expresso-store, how-to
---


# Question
Title: EE2.5.2 login doesn't work from Safari 7.1
A client on EE2.5.2 has just found that they can't login with Safari 7.1 on OSX. Chrome and FF work fine, but in Safari, pressing Submit just returns them to the blank login page. I tried changing "Control Panel Session Type" to "Cookies only" but that didn't do it.

I could try upgrading them to 2.9 but don't want to charge them for an upgrade if it's not guaranteed to fix the issue.

Any ideas why this might be happening? Thanks!

# Answer
> 1 votes
The 2.5.x branch has cache issues if I recall and depending on your system, 2.9.x can break a few things (plugins, conditionals, etc). Upgrading to a stable version before all the big changes, like 2.7.3, should be enough to enable "cookies only" and have it work reliably.

---
Tags: ee2, login
---


title: Index.php redirect based on url

text:
# Question
Title: Index.php redirect based on url
I have been struggling with managing domains for two separate EE installations. Htaccess redirects only seem to work with the site's homepage. Anything beyond that results in a 404 error.

For example: http://domain.com is set as the root, and uses index.php to set the systempath variable thusly: $system\_path = ‘./site1/‘;

My 301 redirect was pointing http://domain2.com to http://domain2.com/site2, which is what is causing the template mapping to fail. So, http://domain2.com/template\_group/ results in a 404 error.

What I want to do is point both domains toward the root, and have the index.php file detect the URL and do this:

if url is domain1.com { $system\_path = ‘./site1/‘; } if elseif url is domain2.com { $system\_path = ‘./site2/‘; }

I’m not sure what the proper syntax to use is, though. I know that CodeIgnitor has some specific functions for handling URLs.

Conversely, if someone can help me figure out why the htaccess isn't functioning. Either way, I just need to resolve the issue.

Thanks,

ty

# Answer
> 0 votes
This seems to do the job nicely:

```
$host = $_SERVER['SERVER_NAME'];
if($host == 'domain1.com')
{
    $system_path = './system/';

}
else
{
    $system_path = './site2/system/';

}

```

---
Tags: htaccess, redirects, index.php
---


title: ExpressionEngine piracy?

text:
# Question
Title: ExpressionEngine piracy?
I used to run a fairly basic Joomla website for a real estate company. Over the years it got way too large for Joomla so they decided to hire a developer to get their own CMS, where the database could be updated offline and the website synched with it. (I'm just a basic self-taught amateur web designer so this is over my head) Long story short: they put that CMS, which used elements of ExpressionEngine, on my server but as it grew larger than 10GB I had to upgrade my own hosting package in order for it to keep up. The problem was that as soon as it was moved the database stopped working. The backend seemed fine and the owner of the business could still see all the properties, but on the homepage there was a message saying the licence was not valid for this domain. ("The local license key is invalid for this location. Manage your license.") My suspicion is that this site was developed in not so legit ways as the developer threw a fit that I had moved the site, saying it is a nightmare to configure, etc. My hosting company never believed this and I am also inclined to mistrust said developer, who I think is hiding behind "it's complicated". The site was offline for 5 days and he's moved it to his own host now, so has full control. My knowledge is too limited to be 100% sure about this. This is basically a PHP driven CMS with Ioncube on it. The developer said Ioncube is what was making it hard to migrate to a different server (within same host), but he never answered my question as to why it had Ioncube on it in the first place, and why it was still working fine in the backend. Can anyone shed light on this? Would you agree this developer is probably a bit shady or am I being paranoid?

# Answer
I don't think that this is EE message - EllisLab just don't control they lic this way (at least no yet).

Possible developer made some custom solution (add-on) which he don't want to share with anybody w/o his own profit. And it is his piracy protection.
> 2 votes

---
Tags: php
---


title: Unable to select entry by last segment

text:
# Question
Title: Unable to select entry by last segment
I have the following code:

```
{if segment_1  == 'special-offers'}
        {exp:channel:entries channel="products" dynamic="no" url_title="{last_segment}"}
        <link rel="canonical" href="{site_url}{categories limit="1"}{category_url_title}{/categories}/product/{last_segment}" />
        {/exp:channel:entries}
        {/if}

```

This is returning no entries. If I remove the url\_title="{last\_segment}" part, I get all the entries in that channel, which Is not what I want. Can anybody see why I can't limit the results by the last segment? Is there another way to do it?

# Answer
Check the date on the entry. Perhaps it has accidentally been set to the future at some point and so only just started working now. Just a thought.
> 3 votes

---
Tags: segments, ee
---


title: File Manager and Assets Sub Folders

text:
# Question
Title: File Manager and Assets Sub Folders
I am having an issue with Assets sub folders and Expression Engine File Manager.

I have a folder called photos. In assets i create sub folders more for organisation purposes as having lots of images in the same folder will be hard to maintain at a later date as file count increases.

The problem is when moving files into these folders. Files are no longer shown in File Manager. Because of this I am having issues with expresso store download tag.

Does anyone have a solution for this? Keeping the files in the photos folder everything is fine even using assets. It is only when organising the files do I have problems.

Any help would be great.

Thanks

# Answer
The EE File Manager can't see inside subfolders - only the top-level folder. In this respect, Assets and the File Manager don't play well together.

I see from the Store docs that they indeed need the file to be indexed by the File Manager, so there's a feature request to be made to DevDemon there.

But maybe an add-on like Link Vault would help here, in place of the Store Download tag?
> 0 votes

---
Tags: expresso-store, assets, file-manager
---


# Question
Title: Expression Engine, Assets, ExpressoStore
I have almost finished a white label version of a photography download e-commerce site.

I have now hit a brick wall. If I keep all of my photos in the root folder say 'photos' everything is fine. But introducing sub folders into the mix is a no go area. Apparently Expression Engines File Manager does not allow sub folder indexing and this is causing a problem with Expresso Store download tag.

Is there absolutely no way I can get around this problem with the assets plugin?

I can see initially files will be fine in one folder. But sooner or later this is going to be very difficult to manage and this is where sub folders come to the rescue.

I would really like to know if there is a solution for this?

# Answer
> 1 votes
If you are using the Store Download tag (`{exp:store:download}`) you can only use what the default EE File Manager can see/use. So you would not be able to use subfolders.

Having said that you don't have to use the Store download tags to allow users to download the files after the purchase. You could use a third-party solution such Link Vault to secure your downloads folder and files. Link Vault works with Assets (I believe only if you are using the fieldtype tags `{your_assets_field:url}`) so you would be able to have subfolders to help with maintaining your downloads folder.

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


title: Expression Engine Menu-Menu items

text:
# Question
Title: Expression Engine Menu-Menu items
I am building a website in EE which has menu and menu items . For example, I create a menu called Events which has items called Local Events, International Events etc. The Events, local events, international events are pages which I create using pages module. What I have done is, I created a "Pages" channel. I also created a relationship field from where one can selected the parent page. But the problem is when I when select the drop down it also shows parent+child pages, that is the international, local events pages also in the relation drop down. I just want the main pages to be shown in the relation drop down. Can some suggest a solution, how it can be done. Or should I have to create 2 channel, Main pages channel and sub-pages channel ??

# Answer
> 2 votes
I would recommend you try to stop thinking in terms of 'pages', as you'll only end up frustrated by EE. For your purposes, what you are creating are categorised events, not pages. So set up a single channel - "events", and add an events category group to categorise each one as local or international.

How you list these events on the front end of the site is almost less important than making sure you've tightly defined the content, but there are lots of different ways of doing it. You can then set up a template group called 'events' and pull through the content there, or if you want to override the URL for each event you can use the Pages module to specify a simpler URI.

If you need a short intro section for the listings view(s), you could either hardcode this, or if your client insists on being able to edit it, use Low Variables/global variables. If the intro section is substantial and complex, maybe consider using the Single Entry add-on for a one-off specialised channel.

Above all, avoid using the Structure module. Web content *is not* pages. Web content is displayed *on* pages.

---
Tags: relationships, channel, parent
---


title: any conditional causes fatal error

text:
# Question
Title: any conditional causes fatal error
This is probably only partly related to ee and more to do with server setup but I am hoping someone can help. Adding any conditional to my templates results in the following error:

Fatal error: Call to undefined function EllisLab\ExpressionEngine\Library\Parser\Conditional\ctype\_alpha()

This is on a local machine setup which is new. I am running AMPPS I did a phpinfo check and it does say --enable-ctype=shared so I am assuming ctype is installed. I have tried this with the server running both php 5.3.29 and 5.4.32 and both produce the same results.

I have even tried it with a conditional as simple as

```
{if "yes" == "yes"}Do something{/if}

```

Any help would be appreciated.

# Answer
Sorry found the answer here. https://stackoverflow.com/questions/24867361/problems-with-ampps even though it appears the extension is there apparently it is not and I had to check it off on the extensions page.
> 1 votes

---
Tags: conditionals, fatal
---


title: Let a user 'subscribe' to categories

text:
# Question
Title: Let a user 'subscribe' to categories
Does anyone know if I can allow a member to subscribe to categories.

For example, for an automotive blog, with categories such as: Motorbike, Cars, Classic Cars, Motorhomes. As a user I would be able to login, choose the categories they were interested in, say Classic Cars and Motorbikes, and then only see posts that belong to that category.

Basically I want members to be able to personalise their feed.

# Answer
> 1 votes
You can use Member Categories module and let users assign themselves to the categories that they like using {exp:member\_categories:form} tag and then display entries in their categories

---
Tags: categories
---


# Question
Title: Low Search in fields: combine different search_modes
I have a Low Search form that looks like this:

```
{exp:low_search:form result_page="search/results"}

<input name="search:title" type="text" value="" placeholder="Title"/>

<select name="search:order-model">
<option value="">Select a model</option>
{exp:low_options:order-model parse="inward"}
  {options}<option value="{option:value}">{option:value}</option>{/options}
{/exp:low_options:order-model}
</select>

<input class="submit" type="submit" value="Search" />

{/exp:low_search:form}

```

The customer can search by title, model, or both. Now, for the title field I would like to use 'any' mode (return all entries that contain at list part of keyword) while for order-model field I need exact match (e.g. if user searches for m-200 it should omit km-2001 from seach results)

Is there any way to achieve that. It looks like that is probably possible with filters, but what about search form?

# Answer
tl;dr: use `exact="search:order-model"` on your Results tag.

You're not using the Keywords filter here, but the Field Search filter. Hence, the search\_mode parameter is not used; it's only used in conjunction with the Keywords filter. The Field Search filter is basically the native `search:field_name` parameter on steroids, so you can mimic what you'd normally do with such a parameter.

For example, this: `search:order-model="=m-200"` would look for exactly the value "m-200" in the target field. This is the same as using `search:order-model="m-200" exact="search:order-model"`, which you can split up with LS into a form field and parameter on the Results tag. You've got the former param as a dropdown in your form, so you should add the latter to the Results tag.
> 2 votes

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


# Question
Title: Error module Solspace Friends when using standard code from the manual
EE v2.7.2, Solspace Friends v. 1.6.4

*EDIT Updated Friends module, still same PHP errors. And they increase.*

I get this error with several messages, of which this is the first:

```
A PHP Error was encountered
Severity: Notice

Message: Undefined property: Friends_groups::$aob

Filename: libraries/Friends_groups.php

Line Number: 1365

```

when using this code

```
                {exp:friends:groups type="all_groups" friends_group_id="{segment_4}" limit="1" dynamic="off"}

<h5>Weblog Entries for this Group</h5>
                        <ul>
                        {exp:friends:group_entries
                        channel="groups_publications"
                            group_name="{segment_4}"
                        }
....my channel

fields....

    {/exp:friends:group_entries}
{/exp:friends:groups}

```

The EE tag does return the right data, so my question, is there something there should be done about this, or can I just ignore it? Thank you for looking at it.

# Answer
> 0 votes
I was able to duplicate this as well. As a temporary workaround, just comment out all 4 blocks of code that reference:

```
if (version_compare($this->aob->ee_version, '2.6.0', '<'))

```

That will solve the problem and the errors will not display anymore. :)

For your convenience I will respond to your official support ticket at Solspace.com with a patched file. :)

---
Tags: solspace, solspace-friends
---


# Question
Title: Redirecting Cartthrob to a different gateway when cart_total = $0?
I'm working on a digital downloads site that has free and paid downloads.

When only free items are in the cart at checkout, I want to use the ct\_offline\_payments gateway without cc data, but for some reason cartthrob is not loading the offline payments gateway called within the conditional, and is loading the default gateway (moneris\_direct).

The transaction fails due to missing cc data.

Here is my code.

```
{if "{exp:cartthrob:cart_total}" > 0}

{exp:cartthrob:checkout_form id="gateway" secure_action="yes" gateway="moneris_direct" return="{template_group}/order_complete"}

{gateway_fields}

<fieldset class="promo" id="promo">
<p><label for="coupon_code">Enter Promo Code</label>
<input type="text" value="" id="coupon_code" name="coupon_code" /></p>
</fieldset>

<fieldset class="payment" id="payment">
<img id="payment_cards" src="/assets/images/payment_cards.jpg" width="171" height="22" alt="Visa, Mastercard, American Express, Diners Club" align="right" /><legend>Payment Info</legend>
  <p class="required">* All Fields Required</p>

    <p><label for="credit_card_number"><span class="required">*</span> Credit Card Number</label>
    <input type="text" name="credit_card_number" value="" id="credit_card_number" class="required" /></p>

    <img src="/assets/images/RapidSSL_SEAL-90x50.gif" width="90" height="50" alt="Secured with RapidSSL" align="right" />
    <p><label for="CVV2"><span class="required">*</span> Card Security Code</label>
    <input type="text" name="CVV2" value="" id="CVV2" /></p>

    <p><label for="expiration_month"><span class="required">*</span> Expiration Month</label>
    <select name="expiration_month" id="expiration_month">
        <option value="11">November</option>
    </select></p>

    <p><label for="expiration_year"><span class="required">*</span> Expiration Year</label>
    <select name="expiration_year" id="expiration_year">
        <option value="2014">2014</option>
    </select></p>

</fieldset>

<input type="hidden" value="{clear_coupon_codes}">
<input type="submit" value="Complete Purchase">

{/exp:cartthrob:checkout_form}

{if:else}

{exp:cartthrob:checkout_form id="gateway" gateway="ct_offline_payments" return="{template_group}/order_complete"}

{gateway_fields}

<input type="hidden" value="{clear_coupon_codes}">
<input type="submit" value="Download">

{/exp:cartthrob:checkout_form}

{/if}

```

I have recently upgraded cartthrob to 2.6.1 from 2.05x, so it may be a syntax issue.

I have made sure it's not a (strict) conditionals issue with EE 2.9.x.

Any thoughts, or example working code to share?

Thanks very much for reading.

# Answer
I am working on a very similar case atm. I think I have just found the solution:

Use `{if '{exp:cartthrob:cart_total prefix=""}' > 0}`

instead of: `{if "{exp:cartthrob:cart_total}" > 0}`

Check out this reply in the CT forums for further reference.
> 0 votes

---
Tags: cartthrob, payment-gateway, redirection
---


title: Template routes

text:
# Question
Title: Template routes
I can't understand how to made URL structure for page For eg

http://site.com/template\_group/temlate1/template2/template3

http://site.com/services/cleaning/reviews/best

In admin panel, at template group services we have 4 templates

index cleaning reviews best

Every template have url

http://site.com/services/index/

http://site.com/services/cleaning/

http://site.com/services/reviews/

http://site.com/services/best/

I need to display some templates like this

http://site.com/services/cleaning/reviews/

or

http://site.com/services/cleaning/reviews/best/

What i need to type into template routes for template?

# Answer
This should be easy enough to complete using something similar to

```
{if segment_1=="services"}
  {if segment_2=="cleaning"}
    {if segment_3=="reviews"}
      {if segment_4=="best"}
Content of the best review
      {if:elseif segment_4==""}
Content of all reviews
      {/if}
    {if:elseif segment_3==""}
Content of cleaning page
    {/if}
  {if:elseif segment_2==""}
Content of Services Page
  {/if}
{if:elseif segment_1==""}
Content of home page
{/if}

```

Then it's just a case of properly formatting your navigation
> 0 votes

---
Tags: ee2, ee
---