title: Category Filter for Google Map Search

text:
# Question
Title: Category Filter for Google Map Search
I currently working on a small project which utilises Google Maps by Objective HTML. The scenario is a page with a search form. The search form contains a postcode field, a distance field, and a category dropdown select.

It seems 2/3 of the search work OK. If I was to type a postcode and set a distance from that postcode then the idea is that the user is then taken to a results page displaying a map with the necessary points marked on it.

Thats all fine, the problem is categories. The dropdown list on the search form is populated correctly, but I'm struggling to grasp how to pass the category through to the results page, filtering your results according the category you've selected.

I maybe totally wrong but it was my understanding that categories are very reliant on the URL being used. That doesn't seem to come into the equation with this as you'll see below. The `return=` parameter needs to direct you to the results template, with no mention of category. My markup is below

```
{exp:gmap:search
    channel="property_sales"
latitude_field="fs_latitude"
longitude_field="fs_longitude"
geocode_field="location"
distance_field="distance_max"
cache_post="false"
return="/property/results/"}

<label for="location">Enter Postcode</label><br>

<input name="location" id="location" class="form-control" value="{if post:location}{post:location}{/if}" type="text">
{if error:location}<p class="error">{error:location}</p>{/if}

<label for="location">Distance from Postcode</label><br>

<select name="distance_max" class="form-control">
    <option value="" {if="" !distance_max="" ||="" distance_max="=" ""}selected="selected" {="" if}="">National</option>
    <option value="5" {if="" distance_max="=" 5}selected="selected" {="" if}="">5 miles</option>
    <option value="10" {if="" distance_max="=" 10}selected="selected" {="" if}="">10 miles</option>
    <option value="20" {if="" distance_max="=" 20}selected="selected" {="" if}="">20 miles</option>
    <option value="50" {if="" distance_max="=" 50}selected="selected" {="" if}="">50 miles</option>
    <option value="100" {if="" distance_max="=" 100}selected="selected" {="" if}="">100 miles</option>
</select>

<label for="categories">Category of Property</label>
    <select class="form-control">

        {categories}<option>{category_name} - {category_url_title}</option>{/categories}
    </select>

<button class="btn btn-primary btn form-control" type="submit">Search</button>

{/exp:gmap:search}

```

That is the search form and this is the result template markup, where I assume the category information has to come into it

```
{exp:gmap:init id="map" class="gmap" style="width:100%;height:400px"}

{exp:gmap:results
    order_by="distance"
    sort="asc"
    parse="inward"}

    {if has_searched}
<ul>
    {results}{total_results}
    <li>{title} - {distance}</li>
    {/results}
</ul>

        {results}

         {exp:gmap:marker
             id="map"
             latitude="{fs_latitude}"
             longitude="{fs_longitude}"}

            {/results}

    {if:else}

        {exp:channel:entries
            channel="property_sales"
            dynamic="no"
            disable="member_data|pagination"
            parse="inward"}

        {location_gmap id="map"}

        {/exp:channel:entries}

    {/if}

{if no_results}

<p>No results found</p>

{exp:channel:entries
        channel="locations"
        dynamic="no"
        disable="member_data|pagination"
        parse="inward"}

    {location_gmap id="map"}

{/exp:channel:entries}

    {/if}

{/exp:gmap:results}

```

I apologise for the long winded question, but has anyone managed to get a category filter working on this module

Thanks a lot, any advice is much appreciated

# Answer
> 2 votes
We're using checkboxes for the categories, but I'm assuming it's similar...

In the search form:

```
{categories show="1|2|3|4" limit="4"}
    <div class="checkbox">
        <label><input type="checkbox" name="categories[]" value="{category_id}" {checked}> {category_name} Products</label>
    </div>
{/categories}

```

Then in the results tag:

```
{exp:gmap:results
    orderby="distance"
    category_search_type="OR"
    match_categories_exact="yes"
    limit="25"
    paginate="true"
    pars_vars="true"}

```

# Answer
> 0 votes
As @christiaan and Andrew have mentioned you shouldn't have a problem passing the category , on your select element you will need to add `name="categories[]"` to pass the user selected categories to the results template.

**Updated Search Template Below**

```
{exp:gmap:search
    channel="property_sales"
latitude_field="fs_latitude"
longitude_field="fs_longitude"
geocode_field="location"
distance_field="distance_max"
cache_post="false"
return="/property/results/"}

<label for="location">Enter Postcode</label><br>

<input name="location" id="location" class="form-control" value="{if post:location}{post:location}{/if}" type="text">
{if error:location}<p class="error">{error:location}</p>{/if}

<label for="location">Distance from Postcode</label><br>

<select name="distance_max" class="form-control">
    <option value="" {if="" !distance_max="" ||="" distance_max="=" ""}selected="selected" {="" if}="">National</option>
    <option value="5" {if="" distance_max="=" 5}selected="selected" {="" if}="">5 miles</option>
    <option value="10" {if="" distance_max="=" 10}selected="selected" {="" if}="">10 miles</option>
    <option value="20" {if="" distance_max="=" 20}selected="selected" {="" if}="">20 miles</option>
    <option value="50" {if="" distance_max="=" 50}selected="selected" {="" if}="">50 miles</option>
    <option value="100" {if="" distance_max="=" 100}selected="selected" {="" if}="">100 miles</option>
</select>

<label for="categories">Category of Property</label>
  <select class="form-control" name="categories[]">
{categories}<option>{category_name} - {category_url_title}</option>{/categories}
  </select>

<button class="btn btn-primary btn form-control" type="submit">Search</button>
{/exp:gmap:search}

```

Then on the results page you need to add the proper category parameters to your opening results tag. Results Documentation the tags you might need to add are:

* category\_search\_type=""
* match\_categories=""
* match\_categories\_exact=""
* match\_category\_operator=""
* match\_no\_categories=""

---
Tags: categories, search, filter, google-maps-for-ee
---


# Question
Title: Member Photo only displays when inside channel tag pairs
I'm simply trying to display member photos, but cannot get my custom member group photos to display.

I am using the following code:

```
<span id="member-photo">
  <img src="{photo_url}" alt="{username}">
</span>

```

If I do this outside of a tag entry pair, I get the following code:

```
<span id="member-photo">
  <img src="{photo_url}" alt="adminname">
</span>

```

But if I put this inside of a channel entry I get the proper:

```
<span id="member-photo">
    <img alt="adminname" src="http://local.domain.com/uploads/member/photos/photo_1.png">
</span>

```

The problem is that when inside of the channel entry tag pair, it will show only the author of that entry's photo. How can I get this to show the logged in member's photo?

# Answer
> 1 votes
The reason the images were not displaying is because they needed to be wrapped in EE's *custom profile data* tag pairs. The following code is the fix:

```
{exp:member:custom_profile_data}
    <span id="member-photo">
            <img src="{photo_url}" alt="{username}">
    </span>
{/exp:member:custom_profile_data}

```

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


title: Solspace freeform & solspace calendar

text:
# Question
Title: Solspace freeform & solspace calendar
Is it possible to use freeform like channel form to add events to calendar? My goal is to include in my freeform form to allow clients to request an appt on the calendar ?

# Answer
Solspace Calendar is **not** a module that allows making "reservations" or "appointments". It's a module that allows creating **events** in a calendar.

The only form that allows creating **events** from the front-end if Channel Forms. Freeform cannot create Calendar events.
> 1 votes

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


# Question
Title: Updating Matrix Safecracker Cell type to File Cell Type
I'm doing a major update on a site -- EE v2.1.3 to v2.8.1

I have a Matrix field that's using the safecracker cell type and I'm wondering what's the best to handle this.

Pre-update the channel form field didn't exist and post update I'm not able to access the field to update it without error messages.

Should I edit the database directly and update the col\_type from 'safecracker\_file' to 'file'?

I'm thinking that if I do this then I can go in through the EE control panel and update the field details, but I'm not sure if there are other ramifications that I'm unaware of.

Appreciate any feedback or insights.

Jules

# Answer
Take backups is the 1st thing to remember.

Past that, I would look at using the original data and converting your safe\_cracker field to a simple text input field (not textarea, make sure the field doesn't convert your data - select 'none' in the format section).

Doing this should write the safe\_cracker data to your newly converted text input field.

Upgrade the CMS

When complete, select your text input field and set it to 'file' type. This should retain your file data and allow you to now use upload field type hopefully.
> 0 votes

---
Tags: matrix, channel-form, safecracker-file
---


# Question
Title: Issue with many relationship fields in a channel
I have a channel with 4 relationship fields and each entry can be related to one or two relationship fields. and I hide unnecessary fields using ENTRY TYPE(http://devot-ee.com/add-ons/entry-type) field type. In the template I am fetching the channel entries using fixed\_order and based on entry-type I am embedding a template with entry field values..all field values comes fine except relation fields and I am not able to understand why it directly show relationship field tags directly. My expression looks something like this

```
{exp:stash:set name="home_page_blocks"}
  {exp:channel:entries channel="pages"}
    {select_left_blocks}{select_left_blocks:entry_id}|{/select_left_blocks}
  {/exp:channel:entries}
{/exp:stash:set}

{exp:channel:entries channel="blocks" dynamic="no" parse="inward" fixed_order="0|{exp:stash:get name='home_page_blocks'}" }
{exp:switchee variable = "{select_block_type}"}

{case value="news_article_block"}
    {title} || {related_news_article}{related_news_article:entry_id}{/related_news_article}
{/case}

{case value="case_article_block"}
    {title} || {related_case_article}{related_case_article:entry_id}{/related_news_article}
{/case}
{/exp:switchee}
{/exp:channel:entries}

```

Now this expression outputs

Entry title one || {related\_news\_article}{related\_news\_article:entry\_id}{/related\_news\_article}

and I am not able to understand whats going wrong here,can anyone please help me out here

Cheers Nisar

# Answer
> 1 votes
Lets tidy this up:

```
{exp:stash:set name="home_page_blocks" parse_tags="yes" trim="yes"}//Trim removes whitespace
    {exp:channel:entries channel="pages" backspace="1"} // Remove last '|'
     {select_left_blocks}{select_left_blocks:entry_id}|{/select_left_blocks}
    {/exp:channel:entries}
{/exp:stash:set}

```

This should now output a list like "33|23|35" - test, test, test your output of this list as if it's broken here, the rest will fail.

Next you'll need to feed that to your other query:

```
{exp:stash:parse}//Wrap this in a parse block so its processed after the set above
  {exp:channel:entries channel="blocks" dynamic="no" fixed_order="0|{exp:stash:get name='home_page_blocks'}" }
  {exp:switchee variable = "{select_block_type}" parse="inward"} //Parse inward lives here

  {case value="news_article_block"}
    {title} || {related_news_article}{related_news_article:entry_id}{/related_news_article}
  {/case}

  {case value="case_article_block"}
    {title} || {related_case_article}{related_case_article:entry_id}{/related_news_article}
  {/case}
  {/exp:switchee}
{/exp:channel:entries}
{/exp:stash:parse}

```

Basically we've trapped your info in the required format (white space plays havoc with pipe delimited lists). Added a few stash additional stash calls and wrapped the "get" function in a parse to ensure it runs after the set (EE parse order takes some thinking/reading).

This is all untested and based on my own experience - it may or may not work as is, my code may not be perfect – but the approach is solid. You'll have to experiment your way through it. OR sit tight, be slack and wait for someone else to solve it for you ;-)

Have fun, try some different tags and see what results you get - think of it as learning!

---
Tags: stash, relationships, related-entries, switchee, related
---


title: Email Masking FreeFrom pro

text:
# Question
Title: Email Masking FreeFrom pro
I am using Freeform pro with a EE site that sells classified goods. I have a form where the customer can email another customer/member. But id like to mask the email with sender and receiver something like gumtree or craigslist. Can someone suggest a method for this if its possible.

Thank, Mario

# Answer
You'd need to run some custom software that integrated with a local mail server to do this - beyond the scope of even an EE add-on I'd say, because your mail server would need to know how to map the incoming email aliases to your site members.

Maybe there's a third-party service that lets you create forwarding addresses programmatically via an API? That would be your best bet, if it exists - then you'd just need to store that anonymous email address as a custom member field for each member.
> 0 votes

---
Tags: solspace-freeform, email, email-contact-form
---


# Question
Title: Display Full/Editable Grid within Relationship in Channel Form?
Using {field:grid\_name} in Channel Form displays full grid with all fields. But I was wondering if there's a way to display the Grid which is located within relationship?

For example:

```
{relationship_field}
        {field:grid_name}
{/relationship_field}

```

Something like that?

Thanks, Tim

# Answer
> 1 votes
Nope, you can't do this, because when updating an entry only the *parent* entry can be saved. You'd need to do something like have a link to open up a second Channel Form - say in a pop-up or overlay - which is for the *child* entry, and then make your edits there.

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


# Question
Title: Move Expresso Store's promotions back to the channel entries
I've updated from Store 1.6 to 2.3. My client is very unhappy with how the "sale price" has moved from the rest of the store information. It is in it's own "promotions" tab now, which makes sense but unfortunately I have to change it.

Has anyone tried moving the "discount sales" back into the channel entries? I've been screwing around to try and pull in the data but I'm having no luck.

Thanks!

# Answer
I'm not aware of any off the shelf ways to do it.

It would be possible to build a separate fieldtype which displays and updates sales related to a particular product. You could then add this to the product channels where you need it. However, I don't think there is anything like this which has been released yet.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Solspace Freeform 500 Internal Sever Error when Composer Template used
Well, I'm getting 500 Internal Server Error when Composer Template used.

Composer Template looks like:

```
<style type="text/css">
.ff_composer * {
-webkit-box-sizing : border-box;
-moz-box-sizing : border-box;
box-sizing : border-box;
}
.ff_composer .line,
.ff_composer .line:last-child,
.ff_composer .last_unit{overflow:hidden;}
.ff_composer .unit{float:left; padding:10px;}
.ff_composer .unit_right{float:right;}
.ff_composer .size1of1{float:none;}
.ff_composer .size1of2{width:50%;}
.ff_composer .size1of3{width:33.33333%;}
.ff_composer .size2of3{width:66.66666%;}
.ff_composer .size1of4{width:25%;}
.ff_composer .size3of4{width:75%;}
.ff_composer .line:last-child,
.ff_composer .last_unit{float:none;width:auto;}
.ff_composer p,
.ff_composer h1,
.ff_composer h2,
.ff_composer h3,
.ff_composer h4,
.ff_composer h5,
.ff_composer h6 {margin-top: 0;}
.ff_composer .required_item {margin-left: 4px; color:red;}
.ff_composer textarea,
.ff_composer input[type="text"],
.ff_composer input[type="email"],
.ff_composer input[type="url"],
.ff_composer input[type="number"],
.ff_composer input[type="password"],
.ff_composer input[type="search"] {width: 75%;}
.ff_composer ul.dynamic_recipients {list-style: none; padding:0;}
.ff_composer .field_label {font-weight: bold;}
</style>
{exp:freeform:composer
form_name="contact-us"
composer_template_name="contact"
return="contact_us/thank_you"
}
<div class="ff_composer">
{composer:page}
{composer:rows}
<div class="line">
{composer:columns}
<div class="unit size1of{composer:column_total}">
{if composer:field_total == 0}

{/if}
{composer:fields}
{if composer:field_label}
{if composer:field_type == 'nonfield_captcha'}
{if freeform:captcha}
<p>
<strong>{composer:field_label}</strong>
</p>
{/if}
{if:else}
<label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
{composer:field_label}{if composer:field_required}<span class="required_item">*</span>{/if}
</label>
{/if}
{/if}
{if composer:field_output}
{if composer:field_type == 'nonfield_title'}
<h2>{composer:field_output}</h2>
{if:elseif composer:field_type == 'nonfield_captcha'}
{if freeform:captcha}
{freeform:captcha}<br />
<input type="text" name="captcha" value=""
size="20" maxlength="20" style="width:140px;" />
{/if}
{if:else}
<p>{composer:field_output}</p>
{/if}
{/if}
{/composer:fields}
</div>
{/composer:columns}
</div>
{/composer:rows}
{/composer:page}
</div>

```

Code above is similar to code from documentation example.

Any clue what is going on?

Thanks

# Answer
Example from their documentation is for a "free" Freefrom version or full form inclusion into EE template

In this case all Freeform parameters must be stored using Template Params instead of creating code in the Composer Template.
> 1 votes

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


# Question
Title: Strange hosting questions in regards to godaddy and index,php
I had a site (EE 1.6) that was on godaddy. Something was changed in order to allow the pages to load with a ? in the url's. ie: http://domain.com/index.php?/site/fine\_art/

I am trying to move the site to a new server, I have upgraded to 1.7.3 for now. But I can't figure out how to change the system to not use index.php? in the string.

I must have changed somethign somewhere but can't find it. SO {path="site/fine\_art"} will result in http://domain.com/index.php?/site/fine\_art/ as the link.

# Answer
Force URL query strings This is a safety mechanism for servers that do not support the PATH\_INFO variable. NO
> 1 votes

---
Tags: url, hosting, godaddy
---


# Question
Title: Display List of Authors with Latest Post
I'm trying to display a list of authors in a sidebar along w/ their most recent post next to their name. So something like:

Alan Smith "The Great Beyond"

Brady Crab "In the Midst"

How can I accomplish something like this using Stash?

# Answer
This solution doesn't use Stash, but you certainly could. This query assumes a broad application, you may be able to simplify it for your needs. The `channel_id` in the `WHERE` clauses will need to be modified to match your channel ID, or converted to a `WHERE IN ()` if you are examining more than one channel (or omitted if no channel filtering is needed).

```
{exp:query sql="SELECT t.author_id, m.screen_name, t.title, t.url_title
        FROM exp_channel_titles AS t
        JOIN (
            SELECT MAX(entry_date) AS max_date, author_id
            FROM exp_channel_titles
            WHERE channel_id = 1
            AND status != 'closed'
            AND entry_date < {current_time}
            GROUP BY author_id
        ) AS t2 ON t.author_id = t2.author_id
        LEFT JOIN exp_members AS m ON m.member_id = t.author_id
        WHERE t.channel_id = 1
        AND status != 'closed'
        AND t.entry_date = t2.max_date
        GROUP BY t.author_id
        ORDER BY screen_name ASC"
    cache="3600"}
    {if count == 1}<ul>{/if}
        <li>{screen_name}: <a href="{path='news/article/{url_title}'}">{title}</a></li>
    {if count == total_results}</ul>{/if}
{/exp:query}

```

This solution takes future-dated and closed entries into consideration, but additional filtering there may be needed depending on the nature of the content in question.
> 4 votes

# Answer
I won't directly answer the question since Derek has already done so though, I'll add a few links which may be similar to this question and useful to you & or others down the road:

Entries Sorted By Author in ExpressionEngine

Display Recent Authors in Expression Engine (note the comment by GDmac about Stash)
> 0 votes

---
Tags: stash
---


# Question
Title: Creating rows with ExpressionEngine and a Grid using Switch
So far I was able to create rows with EE and a Grida data based on a solution from that article, but new template is not able to create rows (code below)

```
{exp:channel:entries channel="media" url_title="{segment_2}" limit="1" dynamic="no"}
...
<div class="row">
        {press_releases}
        <div class="col-md-2 col-sm-6">
                <a href="{site_url}pdfs/press/{press_releases:pdf}" target="_blank">
                    <img src="{press_releases:cover}" alt="{press_releases:title}" class="img-responsive">
                </a>
        </div>
        {switch='|||</div><div class="row">'}
        {/press_releases}
        </div>
....
{/exp:channel:entries}

```

any clue what is missing?

Thanks

# Answer
> 3 votes
If you're wanting the switch tag to apply to the grid rows, then you need to prefix it with your grid field name (docs):

```
{press_releases:switch='|||</div><div class="row">'}

```

---
Tags: grid, switch
---


title: Custom Fields adding <p> Tags

text:
# Question
Title: Custom Fields adding <p> Tags
This is an old issue that has resurfaced. I am creating entries using Profile:Edit and Relationships, that have address information and for some reason the first of the series displays all the address fields (which are set to format:none) with extra \< p \> tags on each element. The second series does not add those tags.

Here is the code I am using:

```
<p><strong>{facilities:title}</strong><br />
    {facilities:facility_street_address}<br />
    {facilities:facility_city}, {facilities:facility_state} {facilities:facility_zip}</p>

```

If I go into the field properties and change it to XHTML and then change it back to none, it solves the problem for existing entries, but any new entries, revert back.

Does anyone know how to resolve this?

# Answer
> 3 votes
Not sure if you want to use a plugin or not but you could strip out anything you don't want using Hacksaw: http://devot-ee.com/add-ons/hacksaw

Something like this might do it for you:

```
{exp:eehive_hacksaw allow="<strong><br />"}
      <strong>{facilities:title}</strong><br />
      {facilities:facility_street_address}<br />
      {facilities:facility_city}, {facilities:facility_state} {facilities:facility_zip}
{/exp:eehive_hacksaw}

```

---
Tags: relationships, text-formatting
---


title: Completely Remove Date DST Conversions

text:
# Question
Title: Completely Remove Date DST Conversions
I have an odd situation where a client wants to display a date as-is without any Daylight Savings Time conversions. Basically, if they enter a specific date they want it to display as is (with the formatting intact).

How would I do this with EE? This was an EE 2.2 site that was recently upgraded to 2.7.3 so it includes the DST goodies; unfortunately they hate the new DST stuff.

# Answer
Turn off the DST thing, make sure admin is the desired timezone and base all new members on admins timezone.

Or just use @lows nice date plugin.
> 2 votes

# Answer
DST is a nasty thing, I wish it simply didn't exist. You can always force the timezone on front end dates. For back-end dates, it depends on both the system and user's localization settings.
> 0 votes

---
Tags: date, dst
---


# Question
Title: Expresso returning logged out and to the wrong page
When a user purchases a product they are redirected to the Home page of: `return="/shop/order_complete/ORDER_HASH"`

They are also returned to the site logged out.

Checkout code

```
{exp:store:checkout
    payment_method="PayPal_Express"
    return="/shop/order_complete/ORDER_HASH"
    next="/shop/checkout"
}
  {!-- usual stuff, removed for example --}
{/exp:store:checkout}

```

I can't see anything in my htaccess file that could be causing this issue.

Any ideas?

# Answer
> 2 votes
It turned out that a rogue index.html file with a redirect inside was the issue.

```
<title>Redirect</title>
<meta http-equiv="refresh" content="0; url=index.php">

```

Everything hitting the root was being redirected so the ACTion ID's weren't able to process (which is pretty critical for Store payments to process). Removing this file resolved the issue.

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


# Question
Title: How can I apply shipping rules to multiple states in Expresso Store?
I’m currently setting up shipping methods within an Expresso Store site. Shipping costs are based on total product costs (not weight). The breakdown is shown below:

Standard Up to $50 $4.95 $50-$100 is $7.95 $101-$250 is $8.95 $251-$500 is $9.95 $501-$1500 is $19.95 $1501-$2500 is $39.95

2nd Day Up to $100 is $12.95 $101-$250 is $15.95 $251-$500 is $17.95 $501-$1500 is $29.95 $1501-$2500 is $59.95

Next Day Up to $100 is $34.95 $101-$250 is $39.95 $251-$500 is $44.95 $501-$1500 is $49.95 $1501-$2500 is $79.95

I’ve entered all these with no problem – they apply to all US states – but, shipping to western states must be $1.00 more for all of the above. There are 24 states that qualify as western. Since it doesn't seem possible to select multiple states from the dropdown in Filters, it means I’d have to enter each variation state by state. The would be 16 filters x 24 western states. Is there a way to do this without manually entering all 384 variations for the western states?

# Answer
> 0 votes
The only way to get around that without all the manual labour is to write a custom extension to handle it. That way you can specify the states to add the extra dollar to and it will apply it automatically. You can even use our Adjustments handling if you wanted to and then you'd be able to itemise the extra cost if you wanted/needed to using our {adjustments} tags.

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


# Question
Title: Very close to working - var_prefix= tabbed and nested
This almost works. its just on load it does not display correctly (all the tab options stack instead nesting) but once you start clicking the tabs they all work fine. (Please also note that when built in flat fashion all tabs work correctly).

The page looks like this: niwot.colorado.edu/index.php/location/test\_location

My code looks like this:

```
      <ul class="pill tabs-content contained">
         {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder"}
         <li {if count == '1'}class="active"{/if} id="pillTab{thirdorder:url_title}Tab">
           <div class="row">
             <div class="twelve columns">
               {thirdorder:summary_3rd_order}<br />

               {thirdorder:exp:playa:children field="4th_order_under_3rd_order" sort="asc" var_prefix="fourthorder"}
                 {fourthorder:title}
               {/thirdorder:exp:playa:children}

             </div>
           </div>
         </li>
        {/exp:playa:children}
        </ul>

```

Thanks for taking the time to look at my problem.

# Answer
you issue is that all your records have *class="active"*. It is happens because **count** is going from *exp:channel:entries* and for all playa records is the same - 1. You have already *var\_prefix* parametr for *playa:children*, so you just need to add it into condition.

```
  <ul class="pill tabs-content contained">
         {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder"}
         <li {if '{thirdorder:count}' == '1'}class="active"{/if} id="pillTab{thirdorder:url_title}Tab">
           <div class="row">
             <div class="twelve columns">
               {thirdorder:summary_3rd_order}<br />

               {thirdorder:exp:playa:children field="4th_order_under_3rd_order" sort="asc" var_prefix="fourthorder"}
                 {fourthorder:title}
               {/thirdorder:exp:playa:children}

             </div>
           </div>
         </li>
        {/exp:playa:children}
        </ul>

```
> 2 votes

---
Tags: templates, playa, template-scripting, nesting
---


# Question
Title: how to pass pipe data in expression engine query
this is my expression engine query

```
$query =  $this->EE->db->query("SELECT * FROM exp_categories WHERE parent_id=$parent_id order by cat_id ASC");

and $parent id = 4|7 (for category parent id passed from template by user)

```

now query should return result for both parent id's

# Answer
Isn't this really an SQL or PHP question?

I think you'd need to split the pipe delimited data up (say by using explode() to create an array) and then loop through it outputting a fragment of SQL each time and build your query up.

SQL syntax would be (not the full query);

```
 WHERE parent_id = 4 OR parent_id = 7 ORDER BY

```

Or:

```
WHERE parent_id IN (4,7)

```
> 5 votes

---
Tags: ee2
---


# Question
Title: File manager issues since upgrade to 2.6.1
I recently upgraded to 2.6.1 and i have had a few buggy issues in file manager since. Firstly i get a white screen of death on file sync and also when i click on a image link in the file manager table the light box is gone and it opens the image in the browser. Thanks for any help

# Answer
> 1 votes
Turns out it was caused by Generate HTTP Page Headers being set as on in output and debugging. This caused a real delay in the full page load and this caused the issues file manager.Turning it off and this sorted my problems

---
Tags: file-manager
---


title: Combining file, grid and relationships

text:
# Question
Title: Combining file, grid and relationships
Im trying to archieve the following, but somehow im missing something wich i can't figure out.

Basiscly, this is my setup:

I have an entry relationship with a grid field, wich contains a file/image.

And this is the syntax im trying to use. So far im able to get the grid field ouput, but i can't figure out how to show any file output.

This is my syntax: showcase = relationship field showcase afbeelding = grid field cf\_afbeelding = file field.

```
{showcase}
            <ul>
            {showcase:showcase_afbeelding}

                    {showcase_afbeelding:cf_afbeelding}

                        <li>  </li>
                    {/showcase_afbeelding:cf_afbeelding}

            {/showcase:showcase_afbeelding}
        </ul>
  {/showcase}

{showcase_afbeelding:cf_afbeelding} //works

{showcase_afbeelding:cf_afbeelding}
   {showcase_afbeelding:cf_afbeelding:path} //doesn't work.
{/showcase_afbeelding:cf_afbeelding}

```

# Answer
What would happen if you used:

```
{showcase}
            <ul>
            {showcase:showcase_afbeelding}

                    {showcase_afbeelding:cf_afbeelding}
                        //{URL} is the tag to spit out the location
                        <li>{url}</li>

                        //Not sure if you need to wrap in these tags
                        <li>{showcase_afbeelding:cf_afbeelding:url}</li>
                    {/showcase_afbeelding:cf_afbeelding}

            {/showcase:showcase_afbeelding}
        </ul>
  {/showcase}

```
> 1 votes

---
Tags: relationships, grid
---


# Question
Title: listing entries on lowest category level only
I'm using a classic /products/category/subcategory/ url structure.

On parent category pages I'm displaying a list of subcategories. However, for categories without children I'd like to show entries in stead.

Any thoughts on how to best approach this?

# Answer
> 0 votes
Turns out there is a plugin from GWcode that detects if subcategories exist via url segments: http://devot-ee.com/add-ons/gwcode-haschildren

---
Tags: categories
---


title: Switching 'views' with a cookie

text:
# Question
Title: Switching 'views' with a cookie
On a site I'm working on, I've got a lists of projects. These lists have two views: a thumbnail and a text-list view. On each page, there's a button to switch to the other view.

I'd like to make that selection persistent. So hit the button to change views, and all pages load that view (until you change the view again).

Is there an easy/recommended way to do this?

Edit: would be nice if it were compatible with some sort of template caching.

# Answer
Yes do it by setting cookie and then checking for the presence/value of the cookie and use the result to decide which layout to show (perhaps by using a conditional to use a particular embedded template).

As ever there are add-ons to help with getting and setting cookies, take a look at Cookies Plus as a starting point.
> 1 votes

# Answer
Cookie Plus is fine, but if you happen to already be using Stash, it can handle this kind of thing using `save="yes" scope="user"` parameters (which essentially creates a cookie).

https://github.com/croxton/Stash/wiki/%7Bexp%3Astash%3Aset%7D#scope--user
> 1 votes

---
Tags: cookies
---


# Question
Title: Two websites, same design & structure, only some entries are shared
I need to build a double website.

* Both sites must use different domain names
* Both sites share exact same design & structure
* Most static contents are the same
* Most dynamic contents are different
* Some dynamic contents can be SHARED across both sites
* Example:

1. Administrator of site A publishes an entry
    2. The new entry appears only on site A
    3. Administrator of site B is notified of the new entry
    4. Administrator of site B allows entry to appear on site B

At first I thought that would be easy using multisite manager. Now I’m digging in, I wonder : is that the best way to go ?

Cheers, L.

# Answer
This answer needs to be 30 characters long but the simple answer is "yes".
> 1 votes

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


title: Bug in transcribe

text:
# Question
Title: Bug in transcribe
I am using EE v 2.8.1 and Transcribe 1.6 and I am getting a warning on one page as

A PHP Error was encountered

Severity: Warning

Message: Division by zero

Filename: transcribe/ext.transcribe.php

Line Number: 472

Can anyone please help me out here

Cheers Nisar

# Answer
Just emailed a fix over to you!
> 2 votes

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


# Question
Title: Channel Info Tag - Two different channels
Is it possible to deliver the channel info tag for two different channels?

I know the below does not work using a pipe separator.

{exp:channel:info channel="news|contact"} {channel\_title} {/exp:channel:info}

Any suggestions?

# Answer
> 1 votes
No, it's not. There's no mention to multiples channels on docs and Boyink talks about this case too.

I don't know exactly what you're trying to do, but I believe that the query module can help you:

```
{exp:query sql="SELECT channel_title AS the_name_you_want_for_your_variable
    FROM exp_channels
    WHERE channel_name IN ('news','contact');"
}
    {the_name_you_want_for_your_variable}
{/exp:query}

```

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


# Question
Title: Bypass "Invalid activation request" if member group has been assigned by other means
I have a registration process which is split into a number of steps, at step 1 the user creates a free account (which requires activation by email to be moved from pending to the relevant group\_id), at step 2 the user can choose to become a paid member, the module I'm using then moves the member to the relevant paid member group upon completion of payment. This all works just fine and is quite a normal process to follow (I think, Github uses a similar mechanism).

The problem I have is that I want to validate email addresses for free accounts but if a user continues and becomes a paid member 'before' they have activated their account and then attempts to activate it subsequently, they currently get the "Invalid activation request" error because they are no longer a pending member.

To me it seems the simplest solution to this problem would be to allow member activation to fail silently or somehow hijack that process and bypass the error for members that are no longer pending.

I've searched far and wide for an existing add on that does this with no luck and it seems that the 'member\_register\_validate\_members' hook (http://ellislab.com/expressionengine/user-guide/development/extension\_hooks/module/member\_register/index.html#member\_register\_validate\_members) fires 'after' validation and not before so I can't see that it will help me.

Any bright ideas?

# Answer
> 2 votes
Ok well I solved this in the end by writing a bespoke extension to simply bypass the error message which is usually shown for an invalid activation request.

```
function activation_hijack ( $session_data )
{

    if (ee()->input->get('ACT')) {

        $act = ee()->input->get('ACT');

        if ($act==8 AND ee()->input->get('id')) {

            $id = ee()->input->get('id');
            // Is there even a Pending (group 4) account for this particular user?
            $query = ee()->db->select('member_id, group_id, email')
            ->where('group_id', 4)
            ->where('authcode', $id)
            ->get('members');

            if ($query->num_rows() == 0)
            {
                // Bypass activation and redirect, this user is no longer pending
                $path = ee()->functions->create_url('/', FALSE);
                header("Location: ". $path);
                exit;
            }
        }
    }

}

```

Does the job. :)

---
Tags: members, groups, activation
---


# Question
Title: create customer in stripe with expresso cart when order is authorized
Is there a way with the current Stripe integration with Expresso cart to create a Customer and Card and on the Stripe side when an order is authorized? If this does not exist in existing functionality in the Expresso cart does anyone have any code to do this?

# Answer
> 1 votes
Currently the Stripe payment gateway for Store does not do this. I don't imagine it would be that difficult though if you are comfortable with PHP.

First off, I'd suggest you make a copy of the Stripe gateway, rather than modify the original. Make sure it has a new name, which will involve renaming files, classes and directories, so that it comes up as a separate gateway.

From there, you'll need to reference the Stripe PHP documentation to alter the process, so a customer is created and charged, rather than just a charge being created.

If you're not comfortable with PHP, I'd suggest you get someone to do this for you, as it's a bit sticky to be mucking around with ecommerce functionality when you don't know what's going on. :)

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


# Question
Title: var_prefix= not working as one would hope
OK revamped question: now it displays all the right stuff but it doesn't interact with the tabs and stacks them all in a static display. straight forward EE code works fine. Once i insert the prefix to get the last breakdown locations names however it does not

http://niwot.colorado.edu/index.php/location (straight forward EE code) (PS if you click on the pills some don't have placeholder text)

http://niwot.colorado.edu/index.php/location/test\_location2 (with the prefix code but it repeats and doesn't interact with tabs. some how things are not set correctly. tried quite few variations with no success any suggestions?)

```
{exp:playa:children field="3rd_order_under" limit="25" sort="asc" var_prefix="thirdorder"}
             <li {if count == '1'}class="active"{/if} id="pillTab{url_title}Tab">
               <div class="row">
                 <div class="twelve columns">
                   {thirdorder:summary_3rd_order}<br />

                   {thirdorder:exp:playa:children field="4th_order_under_3rd_order" sort="asc" var_prefix="fourthorder"}
                     {fourthorder:title}
                   {/thirdorder:exp:playa:children}

                 </div>
               </div>
             </li>
           {/exp:playa:children}

```

note: please see playa doc on children for reference

# Answer
Here was the final solution.

```
     {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder"}
     <li {if '{thirdorder:count}' == '1'}class="active"{/if} id="pillTab{thirdorder:url_title}Tab">
       <div class="row">
         <div class="twelve columns">
           {thirdorder:summary_3rd_order}<br />

           {thirdorder:exp:playa:children field="4th_order_under_3rd_order" sort="asc" var_prefix="fourthorder" backspace="2"}
             {fourthorder:title}, {/thirdorder:exp:playa:children}

         </div>
       </div>
     </li>
    {/exp:playa:children}

```
> 1 votes

# Answer
To try and get a handle on what's going on, I would break things down to just the variable output and forget about the html markup until it makes sense. Try this and see if you can pinpoint it:

```
{exp:playa:children
    field="3rd_order_under"
    sort="asc"
    var_prefix="thirdorder"
}
    3rd count: {thirdorder:count} of {thirdorder:total_results}<br>
    3rd url_title: {thirdorder:url_title}<br>
    3rd summary_3rd_order: {thirdorder:summary_3rd_order}<br>

    {thirdorder:exp:playa:children
        field="4th_order_under_3rd_order"
        sort="asc"
        var_prefix="fourthorder"
    }
        4th count: {fourthorder:count} of {fourthorder:total_results}<br>
        4th title: {fourthorder:title}<br>
        <hr>
    {/thirdorder:exp:playa:children}

    <hr>
{/exp:playa:children}

```
> 1 votes

# Answer
The inner `exp:playa:children` tag should not be prefixed. The var\_prefix is for the variables inside the tag, not for other tags.

You'll want to do something like this:

```
{exp:playa:children
    field="3rd_order_under"
    sort="asc"
    var_prefix="thirdorder"
}
    3rd count: {thirdorder:count} of {thirdorder:total_results}<br>
    3rd url_title: {thirdorder:url_title}<br>
    3rd summary_3rd_order: {thirdorder:summary_3rd_order}<br>

    {exp:playa:children
        field="4th_order_under_3rd_order"
        sort="asc"
        var_prefix="fourthorder"
        entry_id="{thirdorder:entry_id}"
    }
        4th count: {fourthorder:count} of {fourthorder:total_results}<br>
        4th title: {fourthorder:title}<br>
        <hr>
    {/exp:playa:children}

    <hr>
{/exp:playa:children}

```
> 1 votes

---
Tags: templates, playa, variable, nesting
---


# Question
Title: EE Empty File Field Triggers - The uploaded file exceeds the maximum allowed size in your PHP configuration file
EE 2.8.1, non-required file fields when trying to publish a channel entry all trigger the below error if they are left empty.

> The uploaded file exceeds the maximum allowed size in your PHP configuration file.

Has anyone else come across this or had a fix? I haven't found anything but my Google-fu could be weak.

# Answer
This was due to me having the php post\_max\_size set to -1 (unlimited) on my local machine.

The file manager should probably handle this, but it doesn't so I've amended Filemanager.php to the below, which fixes it:

```
public function validate_post_data()
{
    ee()->load->helper('number_helper');
    $post_limit = get_bytes(ini_get('post_max_size'));

    # If the post limit is -1 (i.e. unlimited) return true as we
    # can't exceed the upload size
    if ($post_limit == -1) {
        return true;
    }

    return $_SERVER['CONTENT_LENGTH'] <= $post_limit;
}

```
> 1 votes

---
Tags: channel-entries, file-uploads, channel-files
---


# Question
Title: EE error "The page you requested was not found."
I just made a fresh EE install on one of my clients shared server,and after setting up permissions etc when I try to access admin.php file I get this error

"The page you requested was not found."

I am not able to debug it,is it some thing to do with server or is it a EE bug??

Cheers Nisar

# Answer
Could be a .htaccess configuration problem or verify the path or you admin.php
> 2 votes

---
Tags: ee2, control-panel, admin.php
---


# Question
Title: issue with pagination being picked up by conditional
I have some code that creates my breadcrumbs and it uses this conditional:

```
{if segment_1 == "media" && segment_2 != "media-view" && segment_2 != ""}
<li class="breadcrumb"><p><a href="{site_url}index.php/media">Media</a></p></li>
<li class="breadcrumb"><p>{title}</p></li>
{/if}

```

The problem is that now there are enough media files to have multiple pages, and the pagination becomes segment\_2, so it's no longer blank. So now the page is broken because its trying to put in a bunch of junk for the breadcrumbs.

How do you match against pagination? Is there a wildcard character so I could say something like the following?

```
{if segment_2 == "P%"}

```

It's been a while since I used EE and I can't seem to find the answer. thanks in advance for your help.

# Answer
One solution would be to use MoVariables : http://devot-ee.com/add-ons/mo-variables

You can check a conditional against pagination.

There is probably a better way to do this, but this should work.
> 1 votes

# Answer
The default EECMS conditionals can't check against RegEx, so your simplest solution is to use Switchee.

```
{exp:switchee variable="{segment_1}/{segment_2}" parse="inward"}

    {case value="#^media/P\d+$#|media/media-view|media/"}
        {!-- for this case, we show nothing --}
    {/case}

    {case value="media/{segment_2}"}
        <li class="breadcrumb"><p><a href="{site_url}index.php/media">Media</a></p></li>
        <li class="breadcrumb"><p>{title}</p></li>
    {/case}
{/exp:switchee}

```

To avoid complex and hard to debug RegEx, I created one first case to exclude all three situations you need to, separated by `|`:

* `segment_1 == media` and `segment_2` as pagination: `^media/P\d+$`, where`#` delimits a RegEx;
* `segment_1 == media` and `segment_2 == 'media-view'`: `media/media-view`;
* `segment_1 == media` and `segment_2` empty: `media/`.

If the first case doesn't match, then the second will be tested.
> 1 votes

---
Tags: pagination
---


# Question
Title: Conditional on Playa field with var_prefix
Is there any reason this conditional wouldn't work?

```
{standard_page_events var_prefix="cat"}
    {cat:event_category_description}
    {exp:playa:coparents var_prefix="event" channel="events" child_id="{cat:entry_id}"}
        {if {event:count} == 1}<div class="banded"></div><hr>{/if}
    {/exp:playa:coparents}
{/standard_page_events}

```

# Answer
Brandon's solution worked great! Thanks!

```
{event:if count == 1}

```
> 3 votes

# Answer
Ian's suggestion worked great for me. Here was my working code

```
{if '{thirdorder:static_map_3rd_order}'}
    <img src="{thirdorder:static_map_3rd_order}" alt="{thirdorder:title}" style="padding:10px;" width="100%"/>
{/if}

```
> 1 votes

# Answer
You may need to wrap it in quotes. Try this:

```
{if '{event:count}' == '1'}<div class="banded"></div><hr>{/if}

```
> 0 votes

---
Tags: playa, pixelandtonic
---


# Question
Title: Solspace Calendar showing previous entries for current month
I am using Solspace Calendar for managing events. Unfortunately it is behaving weird with dates. When I want to list the events for a particular month, it starts from one or two dates of the previous month or ends at one or two dates from the next month.

I also checked the generated SQL query which clearly shows that the start date is from the previous month rather than first day of the current month.

Any idea what I'm doing wrong?

Here is my code:

`{exp:calendar:cal date_range_start="year-month-01" date_range_end="year-month-last"}
 {display_each_year}
 {display_each_day}
 {events}
 <!-- List of entries here -->
 {/events}
 {/display_each_day}
 {/display_each_year}
{/exp:calendar:cal}`

# Answer
This is a *very* common question (and likely already answered somewhere on this site in another thread):

You need to add the **`pad_short_weeks="n"`** parameter. A more detailed explanation of why can be found here: http://www.solspace.com/docs/calendar/calendar/#pad\_short\_weeks

From the Calendar documentation:

> You'll likely need to have this parameter set to **n** in the event you're trying to display anything other than a typical calendar display. When set to **n**, weeks won't be "padded" to the nearest first day of the week and last day of the week, as Calendar does this by default for the sake of properly outputting and formatting a calendar.
>
> So for example, using the `date_range_start` and `date_range_end` parameters, if your code looks like this:
>
> ```
> date_range_start="2011-10-19" date_range_end="2011-10-21"
>
> ```
>
> With `pad_short_weeks` parameter NOT specified, Calendar will automatically display the entire week range (**2011-10-16 - 2011-10-22**). With `pad_short_weeks="n"`, Calendar will just display the selected range (**2011-10-19 - 2011-10-21**).
> 1 votes

---
Tags: solspace-calendar
---


title: Can't login to CP – form has expired

text:
# Question
Title: Can't login to CP – form has expired
So I just migrated from my dev server to the production server and I can see the site and CP login page fine. However, trying to login I get:

**An Error Was Encountered** This form has expired. Please refresh and try again.

I've Google'd around a bit but can't figure this one out yet. DB, server and browser cache all clear. Anyone had this before?

# Answer
> 6 votes
Big thanks to Joel Bradbury for solving this one. I needed to add

```
$config['disable_csrf_protection'] = 'y';

```

to my config. Here's why:

> It'll be because the tokens have been generated on a different base domain, and then it's moved and gotten stuck. Normally they're regenerated when they're detected as expired, but if it see's them as not expired, but invalid it can get confused. The hashes are kept in exp\_security\_hashes, just emptying that table will do it too.

# Answer
> 0 votes
This is a bug when the 'Cookie Consent Module' is installed on 2.8. Here are some temporary fixes for now:

* Disable CSRF protection by putting the following line in your config:

$config\['disable\_csrf\_protection'\] = 'y';
* Disable the Cookie Consent Module.
* Try the fix as explained on the Cookie Consent Module GitHub page (https://github.com/EllisLab/Cookie-Consent/issues/2). However, this will still set cookies.

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


title: Auto login on freemember registration

text:
# Question
Title: Auto login on freemember registration
Quick question - can the FreeMember register tag login the user automatically? Apologies if I've missed anything in the docs.

Thanks

# Answer
Yes, it can. You just need to make sure this is enabled in the ExpressionEngine settings, which FreeMember inherits.

Go to the ExpressionEngine Control Panel \> Members \> Preferences, and set *Require Member Account Activation?* to *No activation required*.
> 2 votes

# Answer
I need to leave member activation by email enabled for a certain member group but bypass it and auto-login the user for others after registration, is there some way to do this either by passing the registered member ID to the subsequent page where a 'log-in' plug can be used (dangerous!) or by performing the log-in by means of an extension which fires after registration in Freemember is complete?

I think I saw the idea of 'disabling' require member account activation' elsewhere by setting the variable before the register process starts but I don't recall exactly where this was.

Any thoughts?
> 0 votes

# Answer
No, it can't.

There's a third-party add-on called Simple Registration http://wedoaddons.com/addon/simple-registration/documentation that will do this, though.

TTFN

Travis
> -1 votes

---
Tags: freemember
---


title: Share members between two sites - MSM?

text:
# Question
Title: Share members between two sites - MSM?
We have an upcoming project coming up which will have two sides, let's call one the marketing site, and the other is an app.

The basic idea is the marketing site will sell access to the app, so the user will sign up through the marketing site to have access to the app.

So basically we need to be able to share members and only the members between both sites. Is MSM suitable for this?

Technically, it could be done through a single site but I don't want to be mixing up the channels and other data between the marketing site and the app.

# Answer
You can certainly share members between different sites when using Multisite Manager.

You mention that this could be done with a single site and, to be honest, that's precisely how I would approach it (unless the sites needed to be served under different domains). I don't understand what you mean when you say "mixing channels and other data" and why this would present a problem.
> 1 votes

---
Tags: members, multi-site-manager
---


# Question
Title: Setting User ID for Google Universal Analytics
I'm trying to set the User-ID for Google's new Universal Analytics, but it keeps erring saying " SyntaxError: Unexpected token '{' ".

Here is my code;

```
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXXX-X', 'auto');
{if logged_in}
ga('set', '&uid', {{{member_id}}});
{/if}
ga('send', 'pageview');
</script>

```

I have tried this with $env\_config\['protect\_javascript'\] = 'y' and $env\_config\['protect\_javascript'\] = 'n';.

# Answer
> 2 votes
Why do you have 3 sets of parenthesis around the member\_id tag?

Does it work if you simply use {member\_id}?

**EDIT** (after comments) I'm not completely sure how this should be set up as I've never used this (will need to get up to speed on it though) but based on what I see in the docs does this work;

```
{if logged_in}
    ga('create', 'UA-XXXX-Y', { 'userId': '{member_id}' })
{if:else}
    ga('create', 'UA-XXXXXXXX-X', 'auto');
{/if}

```

I'm not sure why the docs show UA-XXXX-Y for the user ID section.

---
Tags: members, javascript, analytics, google-analytics
---


# Question
Title: How to multiple channel entries in single generated pdf
As per We know , shine pdf only one time parsing so that we could not embed / stash other channel data entries in single pdf generate.

it means , how can we generate multiple channel data without any relation between channel in single shine pdf generate?

# Answer
You can do it through embeds sort of like this:

```
{embed='inc/generatePDF' pdfContent='
    {exp:channel:entries channel="foo"}
        {title}
    {/exp:channel:entries}
    {exp:channel:entries channel="bar"}
        {title}
    {/exp:channel:entries}'}

```

And then in your inc/generatePDF file you enable php and do something like this:

```
 <? $someVar = '{embed:pdfContent}'; ?>

 {exp:shine_pdf:make}
    <? echo $someVar; ?>
 {/exp:shine_pdf:make}

```
> 1 votes

---
Tags: shine-pdf
---


# Question
Title: Freeform user notifications not sending, but admin notifications are fine
I have a pretty basic Freeform contact form set up (fields are: first\_name, last\_name, email, user\_message). The form is set so that, when submitted, the admin receives an email to alert him/her to the fact that there is a new message, the user receives an email as confirmation of their submission, and the user is redirected to the thank you page (which recaps their message for them). The redirect and the admin notification are both working perfectly, but for some reason the User Notification is not.

I have a user notification template set up, I have user notification enabled in the CP, and the 'email' field is set as the delivery address. These settings are made in the CP but I also tried adding them into the form explicitly as parameters -- still no luck.

I should add that I do have a sender address correctly set in EE's email preferences (that tripped me up on a previous occasion when I was unable to receive admin notifications -- they were getting stopped as suspicious and spammy because the sender's address was blank). Also, the user emails are not showing up in the spam traps (either at server level or locally)

Anybody have any ideas why admin notification emails would go out/be received whilst user notifications won't? And where can I check, eg. logs, to see if the email is actually being transmitted by EE (in which case it will presumably be a mail server problem)?

Last thing: I'm testing this on MAMP.

Thanks.

# Answer
Without seeing the code you're using it's a bit tough to know for sure, but I have come up against this issue quite a few times before and it was because I missed out the **user\_email\_field** and **notify\_user** parameters.

For example:

```
{exp:freeform:form
   form_name="contact"
   return="contact_us/thank_you"
   user_email_field="user_email"
   notify_user="yes"
}

// ... rest of your form code

<input type="text" name="user_email" id="user_email">

{/exp:freeform:form}

```

This should then tell freeform that you want to notify users on submit and to use the **user\_email** field for their email address.

Hope that helps

## Possible solution for MAMP/Similar users.

If mail isn't sending as it should whilst using a local environment (such as MAMP), it's worth trying on a live environment before you try to dig in deeper. After all, that is where your site will live, so as long as it works there, your good to go :)

If it doesn't work on a live server, you can be pretty sure the error is code based.
> 1 votes

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


title: Channel Form : JS issue with date field

text:
# Question
Title: Channel Form : JS issue with date field
If I set include\_jquery="no" parameter I still appear to be getting JS code injected into my page as one of my fields is a date field.

Not including it is throwing two JS errors:

```
jQuery not defined and $ not defined.

```

If I include jQuery the errors go away but then the date field throws a weird value:

```
2014-05-22un22efine22

```

Questions:

1. If I have a field that EE recognizes as requiring a jQuery UI element will it always throw in the JS? Is there a way to override this?
2. If I do include jQuery how do I fix the weird date value?

# Answer
Have you tried adding `include_assets="no"` and `datepicker="no"`? These should stop Expression Engine including it's own JS.
> 1 votes

---
Tags: channel-form
---


title: comment form errors

text:
# Question
Title: comment form errors
I have a basic comment form with name, email and comment. Comments can be submitted by guests.

If a guest leaves all fields blank and submit the form, EE only throws one error, which is “the comment field is required” Then if the guest fills in the comment field and submit, EE throws the other two errors together, which are: “the name field is required” “the email field is required”

I need to read via ajax all 3 errors listed together, is there a way to do that? Any idea? Thanks for your help!

# Answer
I'd suggest doing front-end validation with a javascript library like Parsley or jQuery Validate \- that way you don't have to rely on EE's errors at all.
> 0 votes

---
Tags: error, comment-form
---


# Question
Title: Insert Freeform entries to Channel Entries
I am setting up a form using FreeForm. I would like user-submitted entries to be sent as a Channel Entry. Is this possible? I know that I can use the {exp:channel:form} tag to set this up, but I'd prefer having the backend features of Freeform.

I saw nothing about this in the documentation.

So here's a short demonstration on how I want this to work:

Freeform form \> User submits form \> Form is uploaded as a Channel Entry and marked as "Unpublished" \> Admin changes status of channel entry and the entry is live on site.

Possible? Thank you!

# Answer
You can use the freeform\_module\_insert\_end hook, which gives you access to all of the data posted via the form (and also the ability to retrieve that final data from the Freeform database via the form's entry\_id if you like).

Then inside of that hook method, you can use that data to build your entry, which you can then pass to the Channel Entries API.
> 1 votes

---
Tags: channel-entries, solspace-freeform, channel-form
---


# Question
Title: Output heading only once in channel entry
I am trying to output the heading "Related Articles" only once before all the blog submissions. The way I have it coded below, it's outputting heading in every entry. I've put it in multiple places and no luck. Any help is much appreciated.

```
        <div id="main">
            <section class="section">
                <div class="container">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2">

                            {!-- IF PREMIUM PAGE > ONLINE EXERCISES --}
                            {if last_segment == 'online-exercises'}{!--***--}
                                <ul id="online-exercises-list">
                                    {exp:channel:entries channel="blog" limit="200" orderby="title" sort="asc" }

                                        {if no_results}
                                            {exp:channel:categories}
                                                {if last_segment ==  category_url_title}
                                                <h1>{blog_content}</h1>
                                                {/if}
                                            {/exp:channel:categories}
                                            <h2>No Items in this category</h2>
                                            <h3>Sorry, but here are no listings under this category at this time.</h3>
                                        {/if}

                                        <li><a href="/blog/article/{url_title}" title="{title}">{title}</a></li>

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

                            {!-- OTHERWISE, SHOW STANDARD CATEGORY ENTRIES --}
                            {if:else}

                                {exp:channel:entries channel="blog" limit="7" paginate="bottom" }

                                    {if category_description == "y"}
                                        <article class="description-block">
                                            <div class="text-block">
                                                <div class="text-holder">
                                                   {blog_content}
                                                </div>
                                            </div>
                                        </article>
                                    {if:else}

                                        {if no_results}
                                            {exp:channel:categories}
                                                {if last_segment ==  category_url_title}
                                                <h1>{category_name}</h1>
                                                {/if}
                                            {/exp:channel:categories}
                                            <h2>No Items in this category</h2>
                                            <h3>Sorry, but here are no listings under this category at this time.</h3>
                                        {/if}

<div class="row">
    <h1 class="style">Related Articles</span></h1>
</div>

                                        <article class="post-block">
                                            <h2><a href="/blog/article/{url_title}">{title}</a></h2>
                                            <div class="info">
                                                <span class="author">by {author}</span>
                                                <span class="date">{entry_date format=" %F %d, %Y"}</span><br />
                                                {!--<span>in {categories}<a href="/blog/category/{category_url_title}/">{category_name},</a> {/categories}
                                                </span>--}
                                            </div>
                                            <div class="text-block">
                                                {if "{blog-videos:total_rows search:blog-videos_active='=y'}" > '0'}
                                                    {blog-videos search:blog-videos_active='=y' limit="1"}
                                                        <div class="placeholder alignleft">
                                                        {if blog-videoupload != ""}
                                                            <a href='/blog/article/{url_title}'>
                                                                {if blog-videos_thumb != ''}
                                                                    {exp:ce_img:single src="{blog-videos_thumb}" max_height="120" max_width="200" crop="yes" cache_dir="/cache" alt="{blog-images_title}"}
                                                                {if:else}
                                                                    <img src="/themes/site_themes/site/graphics/playvid.png" height='120' width='200' alt="playvid" />
                                                                {/if}
                                                            </a>
                                                        {if:else}
                                                            {exp:antenna url='{blog-videos_url}' max_width="570" cache_minutes="120" wmode="transparent|opaque|window"}
                                                                <a href="/blog/article/{url_title}"><img src="{video_thumbnail}" height="120" width="200" alt="{video_title}" /></a>
                                                            {/exp:antenna}
                                                        {/if}
                                                        </div>
                                                    {/blog-videos}
                                                {if:else}
                                                    {blog-images search:blog-images_active='=y' limit="1"}
                                                        <div class="placeholder alignleft">
                                                            {if '{blog-images_file}' != ''}
                                                                <a href="/blog/article/{url_title}">{exp:ce_img:single src="{blog-images_file}" height="200" width="200" crop="yes" cache_dir="" alt="{blog-images_title}"}</a>
                                                            {if:else}
                                                                <a class="float-right" href="/blog/article/{url_title}">{exp:ce_img:single src="{blog-images_after}" height="100" width="50" crop="yes" cache_dir="/cache" alt="{blog-images_title}"}</a>
                                                                <a class="float-right" href="/blog/article/{url_title}">{exp:ce_img:single src="{blog-images_before}" height="100" width="50" crop="yes" cache_dir="/cache" alt="{blog-images_title}"}</a>
                                                            {/if}
                                                        </div>
                                                    {/blog-images}
                                                {/if}
                                                <div class="text-holder">
                                                    {exp:eehive_hacksaw allow="" chars="275"  }
                                                        <p>{blog_content}</p>
                                                    {/exp:eehive_hacksaw}
                                                </div>
                                            </div>

                                        </article>
                                        <div class="read-more"><a href="/blog/article/{url_title}">READ MORE<img src="{site_url}themes/site_themes/site/images/more-arrow.png" alt="more arrow" /></a></div>
                                        <hr style="clear:both; width: 100%;"/>
                                    {/if}

                                {/exp:channel:entries}

                            {/if}

                        </section>
            </div>

```

# Answer
Use a conditional statement to only output the heading on the first row:

```
{if count == "1"}
<div class="row">
    <h1 class="style">Related Articles</span></h1>
</div>
{/if}

```
> 1 votes

---
Tags: tags, entry
---


# Question
Title: Cartthrob - Changing prices in the cart via Hook.
I've set up a fabric shop, which requires free sample purchasing. I've implemented this without issue using on the fly products for each fabric. However, the client now requires that after x amount of samples have been added (across all products) each additional sample should be charged.

I've spent several days trawling the developer docs & internet trying to find a solution, but so far it has eluded me. Can you please confirm the correct procedure for modifying a dynamic products price which is already in the cart. I've looked at the cartthrob\_update\_cart\_end hook and $this-\>core-\>cart - but can't seem to figure it out.

Thank you.

# Answer
> 1 votes
Sounds like you are building a custom extension. A start might look something like this.

Would have to know a little bit more about your products to give you a better example.

```
public function cartthrob_update_cart_end()
{
$items = ee()->cartthrob->cart->items_array();

foreach($items as $key => $value)
{

    if($value['title'] == "Some on the Fly Product")
    {
        // do something
    }

}

$this->EE->cartthrob->cart->save();

} // END cartthrob_update_cart_end

```

# Answer
> 1 votes
Using mjr's code as a basis, to actually edit the cart items data you will need to use the add\_item() method which will implement an update() if the item exists in the cart already. You don't need the save() method either. So to change a product price to 10 for example:

```
public function cartthrob_update_cart_end()
{
    $items = ee()->cartthrob->cart->items_array();

    foreach($items as $item)
    {
        if($item['title'] == "Some on the Fly Product")
        {
            $item['price'] = 10;
            ee()->cartthrob->cart->add_item($item);
        }
    }
} // END cartthrob_update_cart_end

```

---
Tags: cartthrob
---


# Question
Title: Specific Questions about Member Groups in ExpressoStore
We have two products, and want people added to one member group or the other when purchasing. If they purchase both products we want them added to a third member group. Will this be possible with Store?

# Answer
Sure - you would write an extension that uses the store\_order\_complete\_end hook. You'd then loop through the items in the order and perform your logic as to what member group the customer should get added to in the end.
> 1 votes

# Answer
**Store:**

As Derek mentioned you would need to create an extension to handle the logic of adding the user to a specific member group based upon their purchased items. Store does allow you to add a member to the default member group (per your membership settings) if they register a new account while they are completing checkout.

> **Registering Members**
>
> Member accounts will be created based on the order\_email, and the email address must not already be used for a member account. After creating the member account, any existing orders tied to that email address will be assigned to the new member.
> Docs Link

**Charge:**

From Docs about allowing member registration:

> **MEMBER FIELDS**
>
> If the create\_member = 'yes' option is passed to the form, Charge can create a new member account during payment. The created member will only be created if the user isn't currently logged in. When created the member will be added to the default site member group and immediately logged in. This can be especially useful if you want to create + add a user to a subscription, as the member account will be created first, then immediately added to any subscription as defined in the Charge action settings

As for Charge it does allow you to specify a member group that successful subscriptions members are moved to when they have an active subscription and the member group that they are moved to for a failed subscription or when the subscription expires. Having said that, the last time I looked you would still need to write an extension to handle setting the base member group and then having an alternative member group based upon 2 items in the cart or if the user has purchased one item already then comes back a week later and buys an item that should have them in the other member group.

From the docs on specifying success member group:

> **Success Member Group** The member group the user will be moved to after a successful purchase. **Failure Member Group** The member group the user will be moved to (if) their recurring payment fails. A failure can be caused by their payment being declined, their subscription ending (ie. if an Admin stops their plan from the Stripe dashboard), or other reasons.

If your site only had two items you could probably bypass the need for an extension by adding some additional template logic (I haven't tested and you might run into some parse order issues) and passing specific actions based upon the contents of the cart.

**General Thoughts**

Having the ability to assign a member to a member group based upon a subscription purchase is fairly common (Charge, Membrr, and CartThrob Subscriptions all offer the functionality) but in all of those add-ons you (or you can pay someone) have to write an extension to handle the logic of determining which member group to assign someone based upon products they purchased and possibly their past purchases.
> 1 votes

---
Tags: expresso-store, subscriptions, groups
---


# Question
Title: Getting Brilliantretail and Freeform Pro to play nice
So I was forwarded here by Solspace since this is apparently their "paid" support now for Freeform Pro users :P

c&p of my questions I posed to them: I recently ran across a project that requires me to make an order form. I'm currently using BrilliantRetail for the storefront, and then a special member groups gets to expedite things using an order form as apposed to going through a standard checkout process.

I have this, somewhat, working with Freeform Pro and am hoping to get a little more help to finish things up.

What I'm doing now is populating the form with channel entries (really br\_products, but it works the same). Each product has an qty option associated with it, which is simply a text field in the Freeform form. Now, I'm sort of getting the data I need, but not the details.

So I have a field named qty, then each product produces a tag like this:

```
<input id="qty" type="number" name="qty[]" value="" />

```

So the quantity gets passed along but I also needed the Title, SKU, and Price. So I added three hidden fields for this, and added this to my template:

```
<input id="title" type="hidden" name="title[]" value="{title}" />
<input id="sku" type="hidden" name="sku[]" value="{sku}" />
<input id="price" type="hidden" name="price[]" value="{price}" />

```

So this also works, but I'm getting product info for products not ordered (because all the hidden fields are now filled in they all get returned, not what I want). What I need to do is only see the "title", "sku", and "price" for products that actually have "qty" filled in. This is my problem, I don't know how to do this??

My idea was using data-attributes for the "qty" input, so the data is attached to the product being ordered, but I don't know how to do this??

Hoping someone here can help me figure this out! Thanks in advance!!

# Answer
So I, sort of, answered my question. Which only led to more questions!! See here: Solspace Freeform custom fieldtype and notifcation templates
> 0 votes

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


title: Template route manager issue

text:
# Question
Title: Template route manager issue
I'm trying to create custom URL's with the route manager.

```
{route='products/overview' series='series' range='range' prod='{url_title}'}

```

in my template named 'overview' I have three products that have been entered and they're linked to via the route path above. The correct URL does get generated but only one entry is shown for each of the pages, for example:

```
http://www.mysite.com/products/series/range/my_product_1

```

will show 'my\_product\_1' for each of the products even if the URL is

```
http://www.mysite.com/products/series/range/my_product_2

```

or

```
http://www.mysite.com/products/series/range/my_product_3

```

Any help is very much appreciated.

EDIT

I've attached some screenshots of the issue to aid help

The two screenshots above shoe the route manager and template with the route path

The two below are the web pages that are showing the correct URL's and the correct template but the same entry for each page. Just two examples but on the three entries I have set up one entry is shown on all pages.

```
{exp:channel:entries channel="product_range" limit="1"}
{embed="embeds/docHead" my_page_title="{title} | Pico Technology"}
<body>
<!-- Static navbar -->
<header class="navbar navbar-default navbar-static-top head-wrap">
{embed="embeds/headNav" myLocation="prod"}
<!-- main body -->
<div class="wrapper body-wrap">
    <div class="container main">
        <a href="/" class="navbar-brand"></a>
        <div class="row">
            <div class="col 12 col-sm-12 col-lg-12">
                <ul class="breadcrumb">
                    <li><a href="/">Home</a></li>
                    <li><a href="/products">Products</a></li>
                    <li><a href="/products/oscilloscopes">Oscilloscopes</a></li>
                    <li><a href="/products/oscilloscopes">PicoScope 2000 Series</a></li>
                    <li class="active">{title}</li>
                </ul>
            </div>
        </div>
        <!-- ABOVE CODE IS GENERIC TO EVERY SUBPAGE -->
        <div class="row">
            <div class="col-xs-12 col-sm-4 col-md-4 leftCol">
                {range_left}
                {left_copy}
                <img class="img-responsive" src="{left_image}" alt="{exp:assets:files}{alt_text}{/exp:assets:files}">
                {/range_left}
                {embed="option_panels/{price_option_panel}"}
            </div>
            <div class="col-xs-12 col-sm-8 col-md-8 mainContent">
                <ul class="nav nav-tabs" id="myTab">
                    <li class="active"><a href="{url_title}">Overview</a></li>
                    <li><a href="{url_title}-features">Features</a></li>
                    <li><a href="{url_title}-specifications">Specifications</a></li>
                    <li><a href="{url_title}-software">Software</a></li>
                    <li><a href="{url_title}-documents">Manuals</a></li>
                    <li><a href="{url_title}-accessories">Accessories</a></li>
                </ul>
                <div class="tab-content">
                    {overview}
                        <div class="prod-feat-mod">
    {if whatsinthebox != ''}<div class="well pull-right whatsinthebox">
                                {whatsinthebox}
                            </div>{/if}
                            {prod_image}{if lightbox == 'y'}<a class="imgRight zoom fancybox" href="{url}"><img class="img-polaroid img-responsive" src="{url}" alt="{alt_text}" title="{title}"></a>{if:else}<img class="img-polaroid img-responsive imgRight" src="{url}" alt="{alt_text}" title="{title}">{/if}{/prod_image}
                            {prod_copy}
                        </div>
                    {/overview}
                </div>
            </div>
        </div>
    <!-- BELOW CODE TO JAVASCRIPT IS GENERIC TO EVERY SUBPAGE -->
    </div>
</div>
<a href="#" class="scrollup">Scroll</a>
<!-- footer -->
<div class="wrapper foot-wrap">
    <footer>

        {embed="embeds/footerPanels"}
        {embed="embeds/footer"}

    </footer>
</div>

<!-- ABOVE FOOTER CODE IS GENERIC TO EVERY SUBPAGE -->

<script type="text/javascript" charset="utf-8" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{path='javascript/{price_option_panel}'}"></script>
<script type="text/javascript" charset="utf-8" src="{path='javascript/xdr'}"></script>
</body>
</html>
{/exp:channel:entries}

```

# Answer
Now I can help you.

The `exp:channel:entries` module just looks dynamically for an entry if its title appears on `segment_2` or `segment_3`. For your template, it appears on `segment_4`. **Buuuuuuuuuuut** template routes overrides this behavior. From the docs:

> Template Routes overrides the default behavior of URLs, if you wish to use a Channel Entries Tag in your template you must manually provide segments for any parameters that are normally set in the URL. You must provide a segment for pagination, categories, and entry titles if you wish to use those in your Channel Entries Tag. Additionally, be careful when using dynamic=”yes” with Template Routes, this can cause issues if your route does not have an appropriate segment set.

To make it work, set the `url_title` parameter of the `exp:channel:entries` and make it **not** dynamic.

So, on the template used for a single entry, `products/osc-overview` in your case, replace:

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

```

By:

```
{exp:channel:entries channel="product_range" limit="1" dynamic="no" url_title="{segment_4}" require_entry="yes"}

```

I added the `require_entry="yes"` to allow you to use `no_results` conditional.

The route segment still needs a name. For example, on the current routes setting, the forth segment is being called "alpha\_dash", what should be its rule:

```
/products/oscilloscopes/picoscope2000/{alpha_dash}

```

So, add its name and use `alpha_dash` as a rule:

```
/products/oscilloscopes/picoscope2000/{prod:alpha_dash}

```

Now, the `prod` segment can be accessed on the `exp:channel:entries` module variable by its right name:

```
{exp:channel:entries channel="product_range" limit="1" dynamic="no" url_title="{segment:prod}" require_entry="yes"}

```

You can use this logic for your other pages.
> 3 votes

---
Tags: template-manager
---


# Question
Title: Solspace Freeform inline errors / Ajax validation and composer
I'm using Solspace Freeform with a composer to built forms and found that I can use inline errors and Ajax validation with Freeform here, but documentation doesn't mention how to use it with a composer, only with form templates.

Any tips on that?

Thanks

# Answer
In order to use AJAX with Freeform Pro you create the form in the composer and then embed that form into a hidden template. You then create an additional html form manually which will actually be used and filled in by users. When you submit this form, you use AJAX to post it to the hidden template you previously created where it gets submitted and processed.
> 0 votes

---
Tags: solspace-freeform, error, validation
---


# Question
Title: Show categories associated with a list of channel entries
I'm wanting to filter a list of product entries with Ajax and I am wanting to create a dropdown list of all categories associated with the current list of entries.

eg. I have 100 products that have a main category and have all been assigned a category or two for filtering. In the dropdown list, I want to show ONLY the filtering categories that have been assigned to the current list of products.

So far, I've got a list of ALL categories from a group and not the limited list based on the products in the main category.

I'm currently playing with the query module to see if I can filter the category list down to the correct list of filtering categories.

Its a tough one to explain, but I hope I have done a good job.

Does anyone know the best approach?

I've test GWcodes categories and provided a list of entry\_ids, however this shows up a list duplicated categories. Basically the right result, but I get duplicates.

Any help and guidance would be gratefully received.

Thanks

# Answer
If you have easy access to the entry\_ids of the visible entries as a comma-separated list, this query should work:

```
SELECT DISTINCT cat_id FROM exp_category_posts WHERE entry_id IN(1,2,3,4,5)

```
> 1 votes

# Answer
Maybe you could benefit from a module like this: http://devot-ee.com/add-ons/reefine

Might save re-inventing wheel, maybe.
> 0 votes

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


title: Problem with listing articles

text:
# Question
Title: Problem with listing articles
i have a channel, called html5, that contains more articles (4 right now) and i have a template to show theese articles. When you open the website.com/html5, everything works: the default article is displayed, and the menu in sidebar contains all the articles listed, BUT, when you click on any of the links in the menu (redirecting you to website.com/html5/article-name), the right article is shown, but in the menu, just the active article is shown, and other articles just disappear. **So i ask, how to list all articles in channel even in single-article page?**

```
{embed="overall/header"}
<div class="row" style="margin-top: 10px;">
            //Sidebar START
    <div class="large-4 columns">
    <ul class="side-nav">
                //This shows static link to the home of the HTML section
                <li><a href="/html">HTML5</a></li>
                //And this lists all the articles... (The problem is right there!)
                {exp:channel:entries channel="html5"}
                    <li><a href="{url_title_path='html/index'}">{title}</a></li>
            {/exp:channel:entries}
    </ul>
    </div>
            //Sidebar END
    <div class="large-16 columns">
        {if segment_2 == ""}
        //STATIC content goes here
        {/if}
        {if segment_2}

            {exp:channel:entries channel="html5"}
                <h2>{title}</h2>
                {page_content}
           {/exp:channel:entries}
        {/if}

    </div>
</div>
{embed="overall/footer"}

```

# Answer
> 1 votes
On your side nav `{exp:channel: entries}` tag you need to add `dynamic="no"` to tell EE to ignore the URL and list all entries.

Keep your standard/main EE tags as is and u should be golden.

# Answer
> 1 votes
Use the `dynamic="no"` parameter on the channel entries tag for the menu, otherwise the channel entries tag will use the entry ID or url title from the URL to determine which entry to display.

---
Tags: channel, list
---


# Question
Title: Discussion Forum throwing error when trying to view
I just installed the Discussion forum module on a local site and have been going through the docs setting it up. When I try to view it on the front-end I get the error below..any ideas?

Fatal error: Call to undefined method EE\_Template::parse\_date\_variables() in /Users/mlohrman/Sites/synergetics/public\_html/synerg/expressionengine/modules/forum/mod.forum\_core.php on line 8298

EE v 2.7.2 Discussion Forum v 3.1.15

# Answer
> 1 votes
Ended up paying EllisLab for support only to find out the newest version of Discussion Forum only works with EE v2.8+. They provided the next version down which is working fine.

---
Tags: forum, discussion
---


# Question
Title: insert paragraph tag in exp_channel_data field?
I am inserting a para in one of the fields in table `exp_channel_data`.

The problem i am facing while retrieving that data.

Suppose if the inserted para is like :

`Kawhi Leonard had 22 points and seven rebounds as the San Antonio Spurs advanced to the Western Conference final with a dominant 104-82 win over Portland to give them a 4-1 series victory.
Danny Green scored 22 points and Tim Duncan added 16 points with eight rebounds as the Spurs ensured a third straight conference final.
Duncan said the Spurs are starting to come together at the right time.
"We got to the point now where we understand how we need to play for a longer period of time," Duncan said.
`

Please notice the br tag.

When I retrieve it back on my page,I get the br tags inside the decription..Is there any way i can make the br or p tag work?

# Answer
Go to the Channel Fields Settings screen for the field in question, and change the **Default text Formatting** to "XHTML".

Once you've done that, you can also remove the `<br/>` tags, and simply enter a single carriage return to create them. (Two carriage returns will create a paragraph.)
> 0 votes

---
Tags: ee2, html, table, html-entities, encryption
---


title: Automatic Updates to Social Media

text:
# Question
Title: Automatic Updates to Social Media
EE has been a great tool for my work, however there is one very perplexing problem that I wish I could solve. I'm hoping someone might point me in the right direction. I'm trying to implement a method that will automatically update Twitter & Facebook (+others) when I add a new entry with something like {title} {url}.

I'm looking to post a lot of photos to my site, so I want to direct people back to my site instead of using something like Twitpic or Instagram. A lot of this will be done from my phone while traveling. And this would be very similar to creating a Twitpic / Instagram type system using EE.

Here is what I had in mind and I'll explain the issues I've encountered.

1. A DSLR camera photo is sent to my Blackberry phone using Bluetooth and that image is sent via email to EE via Moblog
2. Moblog uploads the image and creates a new Entry. All of this works fine so far.
3. I wanted to use Solspace Shortcut to create a short link, however Moblog only supports text area fields, so this didn't work.
4. To update Twitter & Facebook, regarding the new entry, I can use email (for Twitter I use Tweetymail and Facebook uses their secret email address). I thought about using MX Notify to send an email whenever an entry in the Photo channel is made. The problem is that for Facebook the update needs to be the email subject, the email body is ignored, and MX Notify doesn't support dynamic content in the subject line. It would work brilliantly if it did because then you could just put {title} {shortcut-url} in and it would update Twitter and Facebook every time a post was entered.
5. I've attempted to get around the Moblog / Solspace Shortcut issue by wrapping the {exp:shortcut:url} around the long EE URL, but the parse order doesn't work so it doesn't send a link.
6. I also use CE Image to handle the image manipulation and uploading to Amazon S3 / Cloudfront.

I've also looked at a number of the social media modules (NSM Twitter, TweetLink and Social Update) and though they say "automatically" that is not the case. They are simply another field that needs text entered and then that is pushed to Twitter. This won't work with Moblog, though there is a possibility that they could (I'm not a programmer, unfortunately).

To summarize the problems, Moblog doesn't support any other fields other than text area and MX Notify doesn't support dynamic content in the subject line and all of the social media add-ons don't do things automatically.

As I mentioned, the goal is to simply send a picture to EE, have it create the entry and then send off the {title} and {url} to Twitter and Facebook. It seems simple, but I haven't figured out how to do this yet, and I've tried a lot of things.

Does anyone have any suggestions?

# Answer
> 4 votes
Did you consider using Postmaster in place of MX Notify? I belive it supports variables in subject.

# Answer
> 4 votes
For those who may not wish to spend $65 on Postmaster, you would probably be able to achieve this for free by generating an RSS feed of your entries, and then using something like Zapier (or ITTT) to push to Facebook and Twitter every time there's a new entry published. Just a thought.

---
Tags: ee2, solspace, twitter
---


# Question
Title: Solspace Freeform Pro + composer and Error Page
Based on Solspace Freeform documnetation

> The Error Page function allows you to bypass the native EE error message template and create and customize your own. Simply create a new EE template and add in the applicable variables below, along with anything else you typically use in your templates (template tags, variables, or embeds). This function is available for all use in all form functions such as Freeform:Form, Freeform:Composer, etc. Make sure you specify the error\_page="freeform/error\_template" parameter in the form you'd like to use this error template.

but where I can define `error_page="freeform/error_template"` parameter when I'm on a composer editor? I have try to add it to the Composer Template as Template Params but still is using default EE errors message page.

Thanks

# Answer
From Solspace support team:

> Ideally, put the code for the Freeform error page alone in its own template (eg. /contact/error), i.e. not with other, regular EE code.

In my case that tip works. Not sure which part of EE code interfere, but will dig deeper in that issue to find out.
> 1 votes

---
Tags: solspace-freeform, error-pages, composer
---