# Question
Title: Is it possible to have a front-facing content creation form, for use of visitors, that creates draft content?
A client is interested in allowing visitors to leave their personal stories on the site. Ideally these would go to the content list in draft mode and then be published by staff.

Is it possible to take a content creation form for a channel, and put it in the front end, with no requirement to log in?

It's no big deal if it can't be done. I'm just curious.

# Answer
> 1 votes
Yes it is possible, there are a few different ways that you can do it.

The first would be to create a new channel for the users Personal Stories, with a few custom fields. Name, Story, Location or any other fields you would need. Then you can use the first party module SafeCracker to allow the user to post to the newly created channel. You can pass the status parameter as a hidden field to either closed or whatever status you want. To enable a guest to publish to the channel you can use the `logged_out_member_id` parameter (docs) along with a created guest member.

The other option would to be use something like Freeform to allow the collection of submissions then use the `{exp:freeform:entries}` tag pair to show the Freeform entries on the front-end of the site.

# Answer
> 1 votes
Is this what you are looking for?

Allow guests to post: http://ellislab.com/expressionengine/user-guide/modules/safecracker/#allowing-guests-to-post-entries

Then you can set a suitable status http://ellislab.com/expressionengine/user-guide/modules/safecracker/index.html#status and specify a default status

---
Tags: channel-entries
---


# Question
Title: Is Field Pack v2.x compatible with EE v2.5.x?
Pixel and Tonic, could one of you please confirm whether or not Field Pack is compatible with EE v2.5.x?

Thanks Brendan

# Answer
You will need to use at least EE2.6 to use Field Pack v2. The ability to have multiple fieldtypes in a single package was not added until 2.6.

In the change log:

**Reactor: Added ability to have multiple fieldtypes in one add-on package.** under the Developers heading is what allows for the new Field Pack to work.
> 0 votes

---
Tags: pixelandtonic, field-pack
---


# Question
Title: Quick questions on importing data using datagrab
I'm going to be importing some info using DataGrab for about 700 entries (on this site an entry is a construction project). One of the fields is a number that shows the cost of the project. On the front end of the site users need to be able to order the projects based on the cost. I want to display the cost on the front end with commas where necessary ($1,123,345). What is the best way to setup the import for that field? If it's a text field would I be able to order if it has numbers and commas? If it is a numbers field would I be able to add commas after the fact? I just don't want the client to have to go back and redo the projects import file. Any ideas would be great! Thanks.

# Answer
I would setup the field as a text input field and set the field content to `number` –this way sorting on the front end can work properly (ie. sort highest to lowest, etc.). Remove all currency characters & thousands separators on the numbers before importing.

Re: formatting, you can use several different number format addons to achieve the thousands separator.
> 1 votes

---
Tags: datagrab, number-format
---


title: Twitter integration for member profiles

text:
# Question
Title: Twitter integration for member profiles
We are running a membership site using EE v2.5.3 and would like to output a member's latest tweets on their profile page. Could you suggest the best add-on/ solution to achieve this?

Thanks

# Answer
Have a look at EE\_Twitter. It works with the 1.1 API and, once set up, you should be able to do something like:

```
<h3>Latest tweets</h3>
{exp:twitter:user screen_name="biz" limit="5"}
    {text}
{/exp:twitter:user}

```

More documentation at https://github.com/click-rain/EE\_Twitter. This is a free (and very nicely done) module.
> 1 votes

---
Tags: add-on, members, twitter
---


title: Assets is outputing strange file paths

text:
# Question
Title: Assets is outputing strange file paths
When I link a file in a WYGWAM field, the link seems to be created correclty. If I look at the source of the HTML, the link is displayed as,

```
<a href="/uploads/documents/campus_map.pdf">File</a>

```

If I look at the DB for that field, it is saved as,

```
<a href="{assets_25:{filedir_2}campus_map.pdf}">File</a>

```

However when the template is parsed, the final output is,

```
<a href="/uploads/documents/campus_map.pdfcampus_map.pdf}">File</a>

```

If I manually remove the "{filedir\_2}" from the DB record, everything works fine and the output is,

```
<a href="/uploads/documents/campus_map.pdf">File</a>

```

I'm using all the latest versions,

1. EE 2.6.1
2. Assets 2.1.4
3. Wygwam 2.7.1
4. Structure 3.3.10

Thanks for any help you guys can offer!

# Answer
> 0 votes
We've got a fix for this locally that will be in the next release of Wygwam. In the meantime, hit up support@pixelandtonic.com and we can send you the patched files.

---
Tags: assets, wygwam
---


# Question
Title: Channel Entries w/ Month, Day, Year Having Issue w/ Localization
Having issues with the following code, if entries are todays date, but past 07:00 PM they do not display. Even with **\*show\_future\_entries="yes"\*** unless the entries are dated 06:59 PM or earlier.

`{exp:channel:entries channel="lunch_order" status="open" day="{current_time format='%d'}" month="{current_time format='%m'}" year="{current_time format='%Y'}" show_future_entries="yes"}{lunch_order_account_number} {lunch_order_share_id} {lunch_formatted_order_total}
{/exp:channel:entries}`

I should also add the Localization is set to UTC-6 CST, and Allow members to set their own localization preferences is set to "No".

Any help would be greatly appreciated. Thank You!

# Answer
> 0 votes
I ended up switching parameters to start\_on, stop\_before which took care of my issue, not sure why it wouldn't work the other way though.

---
Tags: channel-entries, entry-date
---


title: Issue with Assets 2.0.5

text:
# Question
Title: Issue with Assets 2.0.5
I am getting an error when I try to load and entry in our EE Install. I am posting here first as I think it is an Assets issue. I am running EE 2.5.5 with latest version of MSM. This is only happening to users accessing this specific entry so far. As a Super Admin I can access the entry without issues. Here is the error I am getting. Originally this shows up as a blank white page until I turn debug mode on. Any help you be appreciated!

```
Fatal error: Uncaught exception
'Exception' with message 'Assets could not complete the requested operation.' in
/home/uuoci/public_html/system/expressionengine/third_party/assets/sources/ee/file.ee.php:33
Stack trace: #0 /home/uuoci/public_html/system/expressionengine/third_party/assets/sources/base_source.php(807
): Assets_ee_file->__construct(1467, Object(Assets_ee_source)) #1 /home/uuoci/public_html/system/expressionengine/third_party/assets/libraries/assets_lib.php(64
7): Assets_base_source->get_file(1467) #2 /home/uuoci/public_html/system/expressionengine/third_party/wygwam/helper.php(899):
Assets_lib->get_file_by_id(Array) #3 /home/uuoci/public_html/system/expressionengine/third_party/wygwam/ft.wygwam.php(397):
Wygwam_helper::replace_asset_tags('<h2>??Swi...') #4 /home/uuoci/public_html/system/expressionengine/fieldtypes/EE_Fieldtype.php(242): Wygwam_ft->display_field('<h2>??Swi...') #5 [internal function]: EE_Fieldtype-
>display_publish_field('<h2>??Swi...') #6 /home/uuoci/public_html/system/express in /home/uuoci/public_html/system/expressionengine/third_party/assets/sources/ee/file.ee.php on line 33

```

# Answer
I needed to recreate the entry from scrap and that fixed the issue.
> 1 votes

---
Tags: ee2, pixelandtonic, assets
---


title: Get category id when not in URL

text:
# Question
Title: Get category id when not in URL
I'll try to explain it. Here we go.

Searched all over the web but got nothing.

I've got a setup where no category is used in the URL. Navigation is build with stucture. I've got a channel with entries which do have a category.

When I create a entry with structue I assign a category as well. You'll get something like this in stucture:

Locations \- Location A (has template X and category Y) \- Location B (has template X and category Z)

Now the url looks something like this: www.website.com/locations/location-a/ www.website.com/locations/location-b/

I don't know the category. But I do want to display the entries which belong to the Location with category Y or Z.

The solutions I've tried all need the cat name or id in the URL

It could be that I'm looking at it the wrong way. Hope someone can help me or point me in the right direction.

Cheers, Martijn

# Answer
> 1 votes
I'm not sure I understand what you're trying to achieve. Have you looked at any of these addons to see if they can do what you want:

**URL Segment tom-foolary:**

**Full on routing**

I've not used any of the routing addons in production but they look pretty solid.

# Answer
> 0 votes
If you have the channel entries tag around your content, calling in the entry, than adding channel="locations" and category="#ID | #ID" where #ID is the id of the category, than it should do it. http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#category

OR if it is more complex...

I believe that you can use gw:code (http://gwcode.com/add-ons) to grab the category group or category id's in your Entry Parameters to narrow down your returns, check out the documentation and examples in each addon to see which one may work best for you, I think 'gw:categories' should do it.

# Answer
> 0 votes
Are you looking for something like this?

```
{if segment_2 == "location-a"}

  {exp:channel:entries channel="location" dynamic="no" category="cat-y"}
  ...
  {/exp:channel:entries}

{if:elseif segment_2 == "location-b"}
  {exp:channel:entries channel="location" dynamic="no" category="cat-z"}
  ...
  {/exp:channel:entries}

{if:elseif segment_2 == "location-c"}
  {exp:channel:entries channel="location" dynamic="no" category="cat-y|cat-z"}
  ...
  {/exp:channel:entries}

{/if}

```

---
Tags: categories, structure
---


title: Transcribe + Expresso Store

text:
# Question
Title: Transcribe + Expresso Store
I have a current project that uses Expresso Store and I need to make the site multilingual (including the products available in the store). I am debating on using Transcribe to handle the heavy lifting of making the site multi-lingual and the products on sale, but I'm thinking there may be a problem. If Transcribe basically creates a duplicate related entry for the translation will this also duplicate the products in Store? (i.e.; Inventory items)

# Answer
Short answer is that Store and Transcribe do not play nice together. Things like modifier names, email templates, error messages would only be shown in the default language.

The only officially supported way of having a multilingual setup with Store would be to use MSM and have each site as a language.
> 1 votes

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


title: Help with Stash Conditionals

text:
# Question
Title: Help with Stash Conditionals
Hoping someone can help me with this problem. I have a list of channel entries that I am storing in a stash tag then outputting the complete list, but if there are no entries then it displays something else.

What I am hoping to do is if the total count of entries == 0 then display one thing, if the count == 1 then display something else and finally if the count is \> 1 then display a third option to the viewer.

Here is the code that I currently have.

```
{exp:stash:set name="dynamic_adventure" trim="yes" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="adventure_settings" dynamic="no" author_id="CURRENT_USER"}

          {exp:switchee variable="{embed:adventure_name}" parse="inward"}

              {case value="{dynamic_adventure_template:title}"}

                    <a href="{path="admin/{dynamic_adventure_template:url_title}"}/{url_title}" class="button small red">View Adventure</a><br>

              {/case}
              {case value=""}

              {/case}
          {/exp:switchee}

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

{if {exp:stash:not_empty name="dynamic_adventure"} }
        <h2 class="th-adventure-title">{embed:adventure_name}</h2>
        {exp:stash:get name="dynamic_adventure"}
{if:else}
    <h2 class="th-adventure-title">{embed:adventure_name}</h2>
    <a href="{path="admin/new-adventure"}" class="button small red">Start New Adventure</a>
{/if}

```

Any help is greatly appreciated. Thanks

# Answer
> 1 votes
You can store the total\_results of `channel:entries` on a stash variable.

```
{exp:stash:set name="dynamic_adventure" trim="yes" parse_tags="yes" parse_depth="2"}
    {exp:channel:entries channel="adventure_settings" dynamic="no" author_id="CURRENT_USER"}

          {exp:switchee variable="{embed:adventure_name}" parse="inward"}

              {case value="{dynamic_adventure_template:title}"}

                    <a href="{path="admin/{dynamic_adventure_template:url_title}"}/{url_title}" class="button small red">View Adventure</a><br>
                    {if count == 1}
                        {exp:stash:set name="dynamic_adventure_total"}{total_results}{/exp:stash:set}
                    {/if}
              {/case}
              {case value=""}

              {/case}
          {/exp:switchee}

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

```

Then, you can use the variable for conditionals.

```
{if "{exp:stash:get name='dynamic_adventure_total'}" == "1"}
    [...]
{if:elseif {exp:stash:not_empty name="dynamic_adventure"} }
        <h2 class="th-adventure-title">{embed:adventure_name}</h2>
        {exp:stash:get name="dynamic_adventure"}
{if:else}
    <h2 class="th-adventure-title">{embed:adventure_name}</h2>
    <a href="{path="admin/new-adventure"}" class="button small red">Start New Adventure</a>
{/if}

```

---
Tags: stash, count
---


# Question
Title: P&T Checkboxes not added to entry in Safecracker
I'm trying to add/edit a channel entry using Safecracker but my checkboxes in the form aren't showing up in the CP when I check the entry.

Any ideas? The Field Pack extension is enabled, as is the field type. Here's the template code within Safecracker:

```
        {options:therapy-coursemethods}
        <label for="coursemethods-{option_value}"><input type="checkbox" name="therapy-coursemethods[]" value="{option_value}" id="coursemethods-{option_value}"> {option_name}</label><br>
        {/options:therapy-coursemethods}

```

Here's the html:

```
        <label for="coursemethods-method1"><input type="checkbox" name="therapy-coursemethods[]" value="method1" id="coursemethods-method1"> Method 1</label><br>
        <label for="coursemethods-method2"><input type="checkbox" name="therapy-coursemethods[]" value="method2" id="coursemethods-method2"> Method 2</label><br>
        <label for="coursemethods-method3"><input type="checkbox" name="therapy-coursemethods[]" value="method3" id="coursemethods-method3"> Method 3</label>

```

# Answer
> 1 votes
Ensure that you include the `preserve_checkboxes="yes"` parameter in your Safecracker form. More info can be found here in the docs.

HTML checkboxes have an interesting quirk in that if they are not checked they are not sent in the form POST submission. Safecracker therefore can't distinguish between an unchecked checkbox and an omission in the form submission.

# Answer
> 1 votes
I'd been having issues with PT Checkbox in a Safecracker form as well. For me, this worked:

```
{options:field_name}
  {label:field_name}
    <input type="checkbox" id="field_name[]" name="field_name[]" value="{option_value}"{checked}>{option_value}

{/options:field_name}

```

Where field\_name represents the actual field name. This is EE 2.6.1, Safecracker 2.1 and Field Pack 2.0.2. As noted above, you have to include `preserve_checkboxes="yes"`

---
Tags: pixelandtonic, pt-checkboxes, field-pack
---


title: bulk update channel entries

text:
# Question
Title: bulk update channel entries
Good evening,

Im looking at creating a form for a website that allows for bulk updating of a price field within an expression engine channel, lets say for instance, increase all prices for all entries by 5%

Looking into it the HTML form is no issue, and I can pass the figure to a process to make the changes and I think the the thing i need is:

ee()-\>api\_channel\_entries-\>update\_entry((int) $entry\_id, (array) $data);

but im very new to EE and would appreciate any pointers on putting a script together that gathers all the info from each entry then applies the update

# Answer
> 1 votes
If you're using the channel entries API then the $data you need to send back is the entire entry. For example if you just pass the price through, all the other field data will be nulled. It's probably best you don't go down that route if you're not familiar with the API.

Best route imo would be to build a module that will update your price field in exp\_channel\_data to be x% of whatever you submit.

If all you are doing is displaying prices (not searching/filtering/ordering on) - the other option is simply modifying the prices at the template side using a math plugin:

http://devot-ee.com/search/tags/tag/math

---
Tags: batch-update
---


title: Solspace calendar all day event time

text:
# Question
Title: Solspace calendar all day event time
When you add a calendar event using Solspace calendar you have the option of inputting the times or selecting the check box 'all day event'. Currently the all day event times show as 12am-12pm. Is there any way of changing this? For example I would like the all day event check box time to be 8am-6pm.

Thanks, Julie

# Answer
> 1 votes
The option **all day event** is intended for a event to not have a specific starting or ending time. To prove that, you can take a look at the database:

```
SELECT * FROM exp_calendar_events WHERE all_day = "y";

```

When the user set an event as "all day", the saved start\_time and end\_time in database is 0.

So, no, you can't change this, but you can show different time on you template. If you are, for example, using the `calendar:events` variable pair, you can do this:

```
{if event_all_day}8am-6pm{if:else}{event_start_date format="%h%a"}-{event_end_date format="%h%a"}{/if}

```

I hope it helps.

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


title: URL Shows Outdated Version of Template

text:
# Question
Title: URL Shows Outdated Version of Template
I had a template and set the template cache to yes. Then a little while later I renamed it ".template-name" to hide it and renamed another template that I wanted to take it's place "template-name".

Now the URL displays the old template. The template is in the database not saved as a file. I switched cache to no. I've deleted all the caches in EE and then deleted the subfolders from "cache" to no effect.

I've tried everything to get have the template update without any luck. I'm usingEE 2.6.1 and using Freeform 4.012

Thanks in advance for any help on this.

# Answer
> 1 votes
Have you tried synchronizing the templates?

What is shown in the template editor within the CP?

# Answer
> 1 votes
What browser are you using? I know that Chrome tends to REALLY REALLY REALLY hang onto cached content, regardless of any server-side settings. Try looking at the template through a browser other than the one you normally use, and see if you can see your new/expected template. (I know it sounds like a basic n00b thing, but...dang if it hasn't caught me from time to time, and I've been doing this professionally for more than a decade.)

You might also try temporarily changing the name of ".template-name" to ".OLD-template-name" just to further let both the server and the browser know that Really, You Aren't Kidding, You Want To See That Updated Thing Now.

---
Tags: templates, solspace-freeform, cache
---


# Question
Title: ExpressionEngine and PHP parse order issue
I posted this question ExpressionEngine, php and stash - scope problem, please help and really appreciate the responses and take on board that mixing ExpressionEngine and PHP tags is bad practice, and also that using embeds in a loop is bad for performance...

I was originally trying to use stash and got to a place where the pdf generation would be blank the first time the user generated it and then every subsequent click to generate it, it would be one generation behind ie if you removed a favourite, it would only be reflected after generating the pdf twice more.

I thought tring to remove stash from the equation might help. However I have a situation where I am needing to extend the ExpressionEngine favorites plugin by having more than one entry on a page able to be favourited - in this case a barristers skills that are related to the barrister currently being viewed by a playa relationship. I have had to use PHP on output to sort through the favourited entry\_ids and have the barrister skills listed below each barrister and the client is keen to keep the content that is going into the pdf as ExpressionEngine tags so it is reusable in future projects.

What I am finding with the code below is that I can generate the accurate html code in one click and display it on screen, but if I attempt to do anything else with that variable (generate a pdf) using PHP, the pdf is sent but is made of unparsed ExpressionEngine tags.

My question is - is there any hope for this approach? I really can't think of another way to approach this problem and I am rather stuck! I happily use and pay for an ExpressionEngine plugin to do this but there isn't one out there that can sort through the favourited IDs and work out which are playa parents and format things in the right way and be compatible with Playa and Matrix.

Many thanks in advance for any light anyone can shed on this.

The code:

```
$barrister_expertise_titles = '{exp:stash:get name="barrister_expertise_titles"}';

// SORT BARRISTERS
$barrister_person_ids = '{exp:stash:get name="barrister_person_ids"}';
$barrister_person_ids = rtrim($barrister_person_ids, ',');
$barrister_person_ids = explode(',', $barrister_person_ids);
$barrister_person_ids = array_unique($barrister_person_ids);
$barrister_person_ids = array_keys(array_count_values($barrister_person_ids));

$other_favourites = '{exp:stash:get name="other_favourites"}';
$other_favourites = rtrim($other_favourites, ',');
$other_favourites = explode(',', $other_favourites);
$other_favourites = array_unique($other_favourites);
$other_favourites = array_keys(array_count_values($other_favourites));

$barrister_fave_ids =  "{exp:stash:get_list name='barrister_expertise_favourites'}{fave_id}{/exp:stash:get_list}";
$barrister_fave_ids = str_replace("{fave_id}","", $barrister_fave_ids);
$barrister_fave_ids = substr_replace($barrister_fave_ids ,"",-1);
$barrister_fave_ids = str_replace(' ','',$barrister_fave_ids);

$barrister_exploded_fave_ids = explode(',', $barrister_fave_ids);
$barrister_exploded_fave_ids = array_unique($barrister_exploded_fave_ids);
$barrister_exploded_fave_ids= array_keys(array_count_values($barrister_exploded_fave_ids));

$num_barrister_faves = sizeof($barrister_exploded_fave_ids);

$html_generation = "";

// THE LOOP
$i = 0;
$num_barristers = sizeof($barrister_person_ids);

while ($i < $num_barristers)
{

    $this_barrister_id = $barrister_person_ids[$i];

        $html_generation .= "{embed='includes/pdf_format_barrister' barrister_id='$this_barrister_id'}";

            $j=0;
            while ($j < $num_barrister_faves) {

                $html_generation .= "{embed='includes/pdf_format_expertise' barrister_id='$this_barrister_id' fave_id='$barrister_exploded_fave_ids[$j]'}";

            $j++;
            }

    $i++;
}

$html = $html_generation; // html is in this variable and correct if echoed...

// trying to use php to now generate the pdf (the included file below is on the server)
// but it sends a pdf without the expressionengine tags parsed...
require_once('generate_pdf.php');

```

PDF\_FORMAT\_BARRISTER

```
{exp:channel:entries dynamic="off" entry_id="{embed:barrister_id}" status="open" disable="pagination" limit="1" channel="barristers_jc|barristers_qc"}

<table width="100%" cellspacing="0" cellpadding="1" border="0" width="640">
          <tr valign="bottom">
                <td align="left" valign="middle" width="484">
            <h1 style="display: inline-block;">{title}</h1>
            <br />
                <p>
                {if barristers_year_of_silk}Year of Silk: {barristers_year_of_silk format="%Y"}<br />{/if}
                Year of Call: {barristers_year_of_call format="%Y"}<br />
                {if barristers_email!="" OR clerks_email!=""}<a href="{if barristers_email}{barristers_email}{if:else}{clerks_email}{/if}">{if barristers_email}{barristers_email}{if:else}{clerks_email}{/if}</a><br />{/if}
                {if barristers_direct_dial}Direct Dial: {barristers_direct_dial}{/if}
                </p>
               {if barristers_featured_quote}
                 <blockquote class="featured-quote" style="width: 50%; clear: both;">
                {barristers_featured_quote}
                    {quote}
                    {if author_year}<h4>- {author_year}</h4>{/if}
                {/barristers_featured_quote}
                  </blockquote>
                {/if}
                </td>
                <td align="right" valign="middle" width="156">
                    {if barristers_profile_image}
                        <img src="{barristers_profile_image}" alt="{title}" title="{title}" border="0" height="156" width="150">
                    {/if}
                </td>
          </tr>

          <tr valign="bottom">
                <td align="left" colspan="2" width="100%">
                    <h2 class="header" style="clear: both;">Overview</h2>
                    {barristers_profile_overview}

        {if barristers_other_quotes}<h2 class="header">Quotes</h2>{/if}
         {barristers_other_quotes sort="asc"}
         <blockquote>
             {quote}
             {if author_year}<h4>- {author_year}</h4>{/if}
          </blockquote>
        {/barristers_other_quotes}
                </td>
          </tr>
</table>

{/exp:channel:entries}

```

The pdf format expertise include is similar to pdf\_format\_barrister

# Answer
Have you tried writing a plugin that grabs everything between 2 tag pairs and creates a pdf in the plugin?

{create\_pdf}

{all the stuff}

{/create\_pdf}

http://ellislab.com/expressionengine/user-guide/development/plugins.html#processing-data-within-tag-pairs

Not sure if it would work, but shouldn't take too long to try.

Just this week I used mpdf(www.mpdf1.com) to create a pdf from a template with php enabled on output and it worked pretty well, just needed to change some of my html to tables so it would display correctly. So maybe you just try another PDF generator.

If you just want an easy way out, you could look at pdfcrowd.com/ which offers either a link that will create the pdf for you, or they have a browser add-on that will create the pdf with a click.
> 1 votes

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


# Question
Title: Is it possible to filter on title when using dynamic_parameters?
I have a list of products with a filter in the side bar, which allows you to filter by size, country, etc. I want to be able to filter by product name in groups - 0-9, A-C, D-F, etc. The product name, as you can imagine, is contained the entry title.

My dynamic parameters are working fine when it is any other custom field, but not when it is the title (or url\_title) that I am trying to filter on. I've even tried filtering by the exact product name, e.g. one of the products is "3 Fonteinen Oude Geuze", but still no luck.

Here's my code, just in case there is something obvious that I am doing wrong:

```
<form id="more-beer-sort" class="more-beer-sort" method="post" action="{path='{segment_1}'}">
  <label>
    Country:
    <select name="search:cf_more_country" id="search:cf_more_country">
      <option value="">All</option>
      {exp:query sql="SELECT DISTINCT field_id_48 AS cf_more_country FROM exp_channel_data WHERE channel_id=13"}
      <option value="{cf_more_country}">{cf_more_country}</option>
      {/exp:query}
    </select>
  </label>
  <label>
    Style:
    <select name="search:cf_more_style" id="search:cf_more_style">
      <option value="">All</option>
      {exp:query sql="SELECT DISTINCT field_id_49 AS cf_more_style FROM exp_channel_data WHERE channel_id=13"}
      <option value="{cf_more_style}">{cf_more_style}</option>
      {/exp:query}
    </select>
  </label>
  <label>
    Size:
    <select name="search:cf_more_size" id="search:cf_more_size">
      <option value="">All</option>
      {exp:query sql="SELECT DISTINCT field_id_54 AS cf_more_size FROM exp_channel_data WHERE channel_id=13"}
      {if cf_more_size!="Bottles|Draught"}
      <option value="{cf_more_size}">{cf_more_size}</option>
      {/if}
      {/exp:query}
    </select>
  </label>
  <label>
    Name:
    <select name="search:title" id="search:title">
      <option value="">All</option>
      <option value="0|1|2|3|4|5|6|7|8|9">0 - 9</option>
      <option value="A|B|C">A - C</option>
      <option value="D - F">D - F</option>
      <option value="G - I">G - I</option>
      <option value="J - L">J - L</option>
      <option value="M - O">M - O</option>
      <option value="P - R">P - R</option>
      <option value="S - U">S - U</option>
      <option value="V - Z">V - Z</option>
    </select>
  </label>
  <input type="submit" value="Filter List">
</form>

{exp:channel:entries channel="more" dynamic_parameters="search:cf_more_country|search:cf_more_style|search:cf_more_size|search:title" orderby="title" sort="asc" {sn_disable}}
  <!-- OUTPUT PRODUCTS -->
{/exp:channel:entries}

```

Note, I am using the query module to only show distinct/unique entries in the filter as per this post: Only show distinct entries

Thanks for any help or ideas of how to resolve this issue.

# Answer
> 1 votes
Looks like it should work at a quick glance. Since it seems that the Channel Search might not work with Title, I think your 2 options are create a new field for Product Name or you can write your own mysql query / plugin to do the search for you.

---
Tags: search, dynamic, filter, parameters, title
---


# Question
Title: Setting up field type tag pairs from custom plugin methods
I'm currently writing a plugin that returns a result set comprising channel\_titles and channel\_data. I have a file field in there, so the columns from channel\_data are formatted like {filedir\_1}filename.jpg

Now, I figure there must be a way to use this information so that I can call the file field type tags (like {field:size}) or the tag pair (like {field}{path}{/field}) from my template, but I don't have a clue how to do this and I can't find any documentation on it. Can anyone help?

In case this isn't clear, here's an example:

My plugin method

My template

You can see, I'm manually converting that string to the path, and it's ugly as sin. Ideally, I'd like to be able to use that file field type in exactly the same way as it's used in {exp:channel:entries}.

Anyone know how to do this?

# Answer
> 1 votes
I don't know exactly how EE does it, but you can grab the paths based on the filedir # like this: $query = $this-\>EE-\>db-\>query("SELECT url FROM exp\_upload\_prefs WHERE id='1'");

where id='1' is the filedir\_1. So you need to grab that # and use it to grab the url.

---
Tags: custom-fields, plugin
---


# Question
Title: Compare a get variable with a path of categories
I have a series of if:elseif statements that compare $\_GET Variables using `"{exp:parameters:get name='price'}"=="<?php echo $myVariableHere; ?>"`. This is filtering out some of the entries so that they don't show, this works perfectly.

NOTE: $myVariableHere is coming from `<?php $myVariableHere="{categories show_group='#'}{category_name}{/categories}"; ?>`

The exception is my 'region' variable, because it uses child categories. I tried to call them this way, `<?php $myVariableHere="array{categories show_group='#' backspace='2'}'{category_name}', {/categories}"; ?>`

The problem is that even though it appears to print to my page correctly ('Canada', 'Foo', 'Bar') it does not have separate keys in the array, they are all part of the 1st key. So I can not call on the categories separately to use them in my comparison.

In the end, I need to compare the $\_GET VARIABLE of ?region=Canada to the entries categories in that group ('Canada' with a child of 'Foo' with a child of 'Bar').

Looking forward to any suggestions. NOTE: I have been using gw:categories in places.

# Answer
Maybe im missing something, but can't you just use the php function explode to break ('Canada', 'Foo', 'Bar') into an array?
> 0 votes

---
Tags: categories, php, gwcode-categories, parameters, comparison
---


# Question
Title: Entries under a channel:categories tag don't show in template group
I am building a personal site to practice with EE, and on my resume page I am using the following code to display a list of categories with entries displayed under each category:

```
{exp:channel:categories channel="resume_skills"}
        <section id="{category_url_title}">
                <h6>{category_name}</h6>
                <ul>
                {exp:channel:entries channel="resume_skills" category="{category_id}"}
                    <li>
                        <p>{title}</p>
                        <p>{description}</p>
                    </li>
                {/exp:channel:entries}
                </ul>
        </section>
{/exp:channel:categories}

```

The page url is /resume (template group), but the entries don't display unless you go to resume/index. The categories display fine however. Any ideas on how I can remedy this and keep the url intact?

I tested it on a separate page (/site/test) to make sure it wasn't anything else in the code on that page messing with it, and it displayed fine.

# Answer
> 0 votes
Try dynamic="no" in your channel tag or you maybe disable strict urls.

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


# Question
Title: Displaying Recent Forum Topics last_author avatar
On our home page we have a list of the latest forum entries - see http://ellislab.com/expressionengine/user-guide/modules/forum/recent\_forum\_topics.html. The only thing that is missing is the last\_author avatar.

So far I've been trying to get around it with using the last\_author ID and replace the image. Example: `<img src="/images/avatars/uploads/avatar_{exp:low_replace find="site_url/SITE_INDEX/" replace=""}{last_author_profile_path}{/exp:low_replace}.jpg">` , but if course I get in to trouble if the member have something else then .jpg image.

Have anyone found a solution and will I have to do a hack to the module?

Thanks! John

# Answer
I think, you should develop a small plugin which would take {last\_author\_profile\_path} as parameter. In the plugin code, fetch the last segment of last\_author\_profile\_path and search it within the directory with PHP functions like `strstr` or `preg_match` and output the full name of avatar image (with image extension).

It would work for you.
> 1 votes

---
Tags: ee2, forum
---


# Question
Title: Problem with Safecracker File in a second Matrix field not uploading file
I have a Safecracker form where I have more than one Matrix field in the form. Each of these Matrix fields has a Safecracker File field as the first column. When testing the form out I can only upload files into the first Matrix field. I get no inline errors, just an empty field in the second Matrix field.

EE v2.5.5, Matrix v2.5.6, Safecracker File v2.1

Has anyone come across this problem before. Sample template code for the two fields below:

```
{exp:safecracker
    channel="awaentry"
    return="entries/nomination/URL_TITLE/success"
    id="award-entry-form"
    class="standard-form"
    url_title="{segment_3}"
    include_jquery="no"
    author_only="yes"
    error_handling="inline"
}

{global_errors}<div class="alert">
    {error}
</div>{/global_errors}

{field_errors}<div class="alert">
    {error}
</div>{/field_errors}

<div class="field">
    <span class="label">Screen Grabs (Desktop)</span>
    <div class="formHelp">Please provide a set of screen grabs with details, that can be used for promotional purposes.</div>
    {field:website_screens}
</div>

<div class="field">
    <span class="label">Screen Grabs (Mobile)</span>
    <div class="formHelp">Please provide a set of screen grabs with details, that can be used for promotional purposes.</div>
    {field:website_screens_mobile}
</div>

<div class="formControls">
    <button type="submit" class="submit">Save Entry</button>
</div>

{/exp:safecracker}

```

There's other problems with this combination when it comes to proper error messages being parsed through, but will get this working first.

Uploading to the second Matrix field works as expected in the EE control panel.

Would love some assistance as I'm really quite ready to punch someone fair square in the face...this shit should work by now!!!

# Answer
> 1 votes
After a week of banging my head, this ended up being a known problem with Safecracker - or Safecracker File and is to do with the field names.

Here's an earlier thread that pointed towards the problem: Safecracker File Fields only uploads the first one

Who would have thought that the name of the Matrix fields would also affect this problem. So basically my original field names were:

```
{website_screens} and {website_screens_mobile}

```

I changed these field names to the following:

```
{website_desktop_screens} and {website_mobile_screens}

```

And low and behold, it all uploads fine. What an absolute pain in the rear. Apparently it's a known bug and has been fixed (https://support.ellislab.com/bugs/detail/19231) but a trial under v2.6.1 showed that only renaming the fields solved the problem.

# Answer
> 0 votes
Brendan,

I get all sorts of errors doing this on EE2.5.5, but it all works flawlessly on EE 2.6, so you might consider upgrading.

---
Tags: matrix, safecracker, safecracker-file
---


title: Transcribe addon & XML sitemap

text:
# Question
Title: Transcribe addon & XML sitemap
I'd like to make a template that generates an XML sitemap for my multilanguage site (using Transcribe addon) that contains all entries in all languages. The site structure is just simple flat pages like so:

```
/en/page1-english
/en/page2-english
/de/page1-german
/de/page2-german

```

I tried this code and it works apart from the exp:transcribe:uri tag only gives me a link for the default language. How can I get transcribe to give me links for all entries in all languages?

```
<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
{exp:channel:entries channel="not products"  transcribe="disable" dynamic="no"}
<url>
<loc>
{exp:transcribe:uri path="{url_title}"}
</loc></url>
{/exp:channel:entries}
</urlset>

```

# Answer
Well I worked it out by myself in the end...

```
<?xml version="1.0" encoding="UTF-8"?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
{!--Homepage--}
<url>
  <loc>{site_url}</loc>
</url>
{exp:query sql="SELECT l.abbreviation, t.url_title, c.channel_name FROM exp_channel_titles t
inner join exp_channels c using (channel_id)
inner join exp_transcribe_entries_languages el using (entry_id)
inner join  `exp_transcribe_languages` l on l.id = el.language_id
where t.status='open' and c.channel_name<>'products'"}
<url>
{if channel_name=='home_page'}
  <loc>{site_url}/{abbreviation}</loc>
{if:else}
  <loc>{site_url}/{abbreviation}/{url_title}</loc>
{/if}
</url>
{/exp:query}
</urlset>

```
> 3 votes

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


# Question
Title: White screen of death with extensions enabled EE v.1.6.0
I've had a look through all the answers on here (this one seems the most complete) but since I'm using EE v 1.6.0 in this case I'm unsure what to follow.

I downloaded my site to run locally using MAMP, *it works fine on the server*.

But I get the WSoD when I login unless I disable extensions in my config file.

Any ideas of what to try to fix it?

**UPDATE:** My local version of PHP was 5.4 but the server was 5.2. I changed it locally to match and it's working perfectly.

# Answer
As per my comment above, check to see if you have a file upload add on installed (I can't recall the name of it now).

In the past I have seen this behaviour when a large image is present in an upload directory. The add-on tries to read/generate a thumbnail and runs out of memory. This happened even if you weren't directly viewing the file or an entry that contained it.
> 2 votes

# Answer
FIXED!

My local version of PHP was 5.4 but the server was 5.2. I changed it locally to match and it's working perfectly.
> 2 votes

# Answer
Have you tried increasing the php memory limit? Both times I've hit the WSOD issue of late I've solved it by increasing memory. 32Mb just doesn't cut it especially if you're using Assets or something similar.
> 0 votes

---
Tags: ee1, white-screen-of-death
---


# Question
Title: DataGrab and Matrix importing issue (no data imported into Matrix Field)
I'm trying to import data from a CSV into Matrix (2.5.6) using DataGrab (1.7.7) and I'm getting the following errors repeated for each row of data within the CSV

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: field_settings
Filename: fieldtypes/datagrab_matrix.php
Line Number: 114
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: fieldtypes/datagrab_matrix.php
Line Number: 136
A PHP Error was encountered
Severity: Notice
Message: Undefined index: field_settings
Filename: fieldtypes/datagrab_matrix.php
Line Number: 372
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: fieldtypes/datagrab_matrix.php
Line Number: 397

```

At the end of the import I should have a single entry with 30 rows in the matrix component, sadly the matrix field is completely empty.

I recognise that the Matrix field import is listed as beta within the tool itself but in this instance it isn't working.

Thanks for any thoughts / help / works for me on this.

# Answer
> 1 votes
After giving Andrew (the developer of Datagrab) the relevant access he was able to resolve the issue but suggested it might be another add on clashing with Datagrab.

I found the problem to be http://devot-ee.com/add-ons/title-master removing the channel from Title Master resolved the issue and the data imported into the channel and Matrix fields as intended.

---
Tags: matrix, datagrab
---


# Question
Title: Help requested with CE Cache cache-breaking rules
I have a large site that uses Structure for most of the static page content. I'm also using CE Cache for performance on those pages since some of them are pretty complicated and heavy.

I'm using the database driver.

Since the content doesn't change very frequently I have the cache set to never refresh. So far I've been forced to manually clear the cache for a specific content path since clearing the entire site cache just for one small section of the site seemed wasteful.

Since the site's secondary navigation shows the current section's pages and immediate siblings, the cache would need to be flushed for the current section as well as one level up just in case the structure URL changes. (see screenshot)

Is there a way to configure Cache Breaking in such a way that I can automatically clear all pages that are siblings as well as the immediate parents and their siblings?

# Answer
I think the best way to approach this is to tag the caches with their sibling ids. Structure actually makes this quite easy, because of its global variables:

```
{exp:ce_cache:it tags="{structure:sibling_ids}|{structure:page:entry_id}"}
    {exp:channel:entries limit="1" ...}
        ...
        {exp:ce_cache:add_tag}{entry_id}{/exp:ce_cache:add_tag}
    {/exp:channel:entries}
{/exp:ce_cache:it}

```
> 3 votes

# Answer
Complicated question, Ian, especially since you have Structure involved.

I think I'd want to talk with Aaron Waldron directly -- some basis below.

* the primary ability of CE Cache is to break on change or addition/deletion action within a channel. You can then target what might be broken as a result.
* you can of course break the entire channel. A tricky part here is what this may actually mean. CE Cache appears to break according to the apparent path -- template group/template. I am not sure if the original EE path isn't still available and used with Structure, but there are other implications.
* The rules you can set for CE Cache appear I think only on the add-on module's Cache Breaking page for the individual channel involved. And that emphasizes that you can only condition a cache break on channel changes.
* thus I think that to do something as you would like to do, it would be a non-trivial addition to CE Cache capabilities - both to trigger on path rather than channel, and then to identify at least a partial path per each such rule to break.

I'm thinking then that depending on what Structure's effects are, you may be just as well to break the channel/s holding all the items. You have the auto-rebuilding options at the top of the cache breaking page to get the full cache rebuilt in some sensible interval - see the notes for tradeoffs and times there.

I had a brief look at Template Morsels, but didn't spot anything more helpful there, and with those, I think you are required to do a lot of modifying of your template code, which is not needed in the default use of CE Cache, though it's fully capable of spot caching also.

Hope this view helps the thinking, anyway. I'd talk to Aaron...
> 1 votes

# Answer
How about escaping the secondary navigation so it's not cached at all?

```
     {exp:ce_cache:escape}
     Structure navigation here
     {/exp:ce_cache:escape}

```
> 0 votes

---
Tags: ce-cache, cache-breaking
---


# Question
Title: Stash: Test if nested list has value from outside nested loop
Yo,

I can't seem to figure this one out. I have a nested list of related Playa entires. Depending on if the list has a value, I want to show some code above the nested list.

```
<div class="well">
    <h4>How To Guides</h4>
    <ul>
    {exp:stash:get_list:nested name="related_guides-{e_id}"}
        <li><a href="{link}">{title}</a></li>
    {/exp:stash:get_list:nested}
    </ul>
</div>

```

I only want to show the 'well' div IF there is something to show.

Here is the nested list:

```
{exp:stash:set_list:nested name="related_guides-{entry_id}" parse_tags="yes" scope="site" save="no" replace="no" refresh="1440"}
        {filt_related_guides site="ht"}
            {stash:link}{title_permalink="guides/index"}{/stash:link}
            {stash:title}{title}{/stash:title}
        {/filt_related_guides}
        {gen_related_guides site="ht"}
            {stash:link}{title_permalink="guides/index"}{/stash:link}
            {stash:title}{title}{/stash:title}
        {/gen_related_guides}
        {pump_related_guides site="ht"}
            {stash:link}{title_permalink="guides/index"}{/stash:link}
            {stash:title}{title}{/stash:title}
        {/pump_related_guides}
        {tub_related_guides site="ht"}
            {stash:link}{title_permalink="guides/index"}{/stash:link}
            {stash:title}{title}{/stash:title}
        {/tub_related_guides}

        {if no_results}{exp:stash:set_value name="no_related" value="0"}{/if}
    {/exp:stash:set_list:nested}

```

Anyone got a solution to this? Or point out what I'm doing wrong?

Cheers

# Answer
> 1 votes
Well, you created your own solution.

To prevent conflicts, change the value of `no_related` to something diferent of "0".

```
{if no_results}{exp:stash:set_value name="no_related" value="yes"}{/if}

```

Then, use a conditional, but put this code on an embed, to make it be parsed **after** your nested list:

```
{if "{exp:stash:get name='no_related'}" != "yes"}
    <div class="well">
        <h4>How To Guides</h4>
        <ul>
        {exp:stash:get_list:nested name="related_guides-{embed:e_id}"}
            <li><a href="{link}">{title}</a></li>
        {/exp:stash:get_list:nested}
        </ul>
    </div>
{/if}

```

Or, you can just use the `not_empty` single variable and to no create the `no_related`:

```
{if {exp:stash:not_empty name="related_guides-{embed:e_id}"}}
    <div class="well">
        <h4>How To Guides</h4>
        <ul>
        {exp:stash:get_list:nested name="related_guides-{embed:e_id}"}
            <li><a href="{link}">{title}</a></li>
        {/exp:stash:get_list:nested}
        </ul>
    </div>
{/if}

```

---
Tags: stash
---


# Question
Title: Relatioship custom fields hide if no entries
I am building site with EE v2.6.1 and I have following snippet in one of my template

```
<div class="content-main">
        <div class="titel">Features</div>
        <div class="content-box">
          <ul class="features">
            {features}
            <li>
              <span>{features:title}</span>
              <img src="{features:icon}" width="65" height="55" alt="">
              {features:description}
            </li>
            {/features}
          </ul>
        </div>
      </div>

```

I want to hide the whole block if there is no entry in features relationship, is there any direct way or I need to use plugin?

# Answer
Can you try like:

```
{features}
    {if "{features:count}" == "1"}
    <div class="content-main">
            <div class="titel">Features</div>
            <div class="content-box">
              <ul class="features">
    {/if}
                <li>
                  <span>{features:title}</span>
                  <img src="{features:icon}" width="65" height="55" alt="">
                  {features:description}
                </li>
    {if "{features:count}" == "{features:total_results}"}
              </ul>
            </div>
          </div>
    {/if}
{/features}

```

I hope, it would work.
> 1 votes

---
Tags: templates, relationships
---


title: Preserving safecracker fields

text:
# Question
Title: Preserving safecracker fields
So I have a safecracker form that presents different fields to different users. Think admin controls vs user controls in the same form.

```
{exp:safecracker channel="channelName" url_title="{segment_1}" return="/{segment_1}" include_jquery="no" datepicker="no" require_entry="yes" class="form-horizontal" preserve_checkboxes="yes" }

```

The issue is that the user version of the form, which does not display the admin only fields, ends up wiping the values in the DB for those fields.

I am not presenting hidden fields and I not rendering the fields to the "user".

Does anyone have a solution to preventing fields not presented to the user from being cleared?

You're doing it wrong is an acceptable answer as long as you have a solution :-p

# Answer
I just addressed this same issue at http://ellislab.com/forums/viewthread/235757/

Basically you have to output that field value and just set visibility:false on the select tag.
> 1 votes

---
Tags: safecracker, forms, fields
---


title: Parsing JSON in EE tag

text:
# Question
Title: Parsing JSON in EE tag
We have a BrilliantRetail cart and I'm adding JSON data into an attribute named itemJSON. In the cart template, we loop through the items in the cart using the {items}{/items} tag and I need to show certain values from the JSON stored in the attribute.

Using the

```
{itemJSON}

```

tag shows the full JSON. I only want some of the values stored there without having to use PHP in my template. Is this doable? Doing it like either of these fails, it shows the tag, instead:

```
{itemJSON->SP->FN}
{itemJSON.SP.FN}

```

Would there be a way to use preload\_replace to do this?

**Edited-\>showing code:** This doesn't seem to be working correctly:

```
$json = json_decode($this->EE->TMPL->fetch_param("json"), true);
$values["StudentName"]    = $json["ShortParticipants"][0]["FirstName"];
$values["CEState"]        = $json["ShortParticipants"][0]["CEInfo"]["CEState"];
$values["CENameOnLic"]    = $json["ShortParticipants"][0]["CEInfo"]["CEFirstName"]." ".$json["ShortParticipants"][0]["CEInfo"]["CELastName"];
$values["CELicencelabel"] = $json["ShortParticipants"][0]["CEInfo"]["CELicenseText"];
$values["CELicenseNum"]   = $json["ShortParticipants"][0]["CEInfo"]["CELicense"];
$values["CEHours"]        = $json["ShortParticipants"][0]["CEInfo"]["Hours"];
$values["course_text"]    = file_get_contents("http://".$_SERVER["HTTP_HOST"]."/files/getCourseText.php?EventCode=".$json["eventcode"]."&Cart=yes");

$vars = array((array) $values);

$this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $vars);

```

Also, in using the tag like you show:

```
{exp:tnajson json="{itemJSON}"}
    {if sku == "CE_FEE"}
    <i>CE For Student: {StudentName}</i><br />
    Course: {course_text}<br />
    <hr style="color: #D9DDE3; background-color: #D9DDE3; margin-bottom: 5px;" />
    CE State: {CEState}<br />
    Name On License: {CENameOnLic}<br />
    {CELicencelabel}: {CELicenseNum}<br />
    Hours: {CEHours}<br />
    {if:else}
    <i>For Student: {StudentName}</i><br />
    {course_text}
    {/if}
{/exp:tnajson}

```

It shows this:

```
}}"}

```

And then none of the values.

# Answer
> 2 votes
Not sure what existing solution there are, but I would just create a real simple plugin with pkg.io.

Basically, your constructor method would look like this:

```
public function constructor()
{
    $json = json_encode($this->EE->TMPL->fetch_param('json'));

    // Now you need to parse the JSON object. This will be unique
    // depending on what your JSON object looks like.
    // This example assumes you have an object 1 level deep and it needs
    // converted to an indexed associated array.

    $vars = array((array) $json);

    $this->return_data = $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $vars);
}

```

Your template tags will look like this:

```
{exp:your_plugin json="{itemJSON}"}
    {your_obj_property_name_1}
    {your_obj_property_name_2}
    {your_obj_property_name_3}
{/exp:your_plugin}

```

---
Tags: templates, variable, preload-replace, brilliantretail
---


title: Split String from Variable

text:
# Question
Title: Split String from Variable
I've got a variable that outputs a string such as:

```
question ^ answer > question ^ answer > question ^ answer

```

Now, I added the symbols in between them to know where the split should happen. I've been using the 'Explode' plugin (http://devot-ee.com/add-ons/explode) and this works perfectly. BUT it only works to split based on one set of characters e.g. ^ only.

```
{variable} = question 1 ^ answer 1 > question 2 ^ answer 2

{exp:explode separator=">" string="{variable}"}

    <div id="question">
        {exp_value}
    </div>

 {/exp:explode}

```

The above code would output:

```
    <div id="question">
        question 1 ^ answer 1
    </div>

    <div id="question">
        question 2 ^ answer 3
    </div>

```

Which is great, but I need my markup to be like this:

```
    <div id="question">
        question 1
    </div>

    <div id="answer">
        answer 1
    </div>

```

Which would require doing something like:

```
{variable} = question 1 ^ answer 1 > question 2 ^ answer 2

{exp:explode separator="^|>" string="{variable}"}

    <div id="question">
        {exp_value_1}
    </div>

    <div id="answer">
        {exp_value_2}
    </div>

 {/exp:explode}

```

Which would then output:

```
    <div id="question">
        question 1
    </div>

    <div id="answer">
        answer 1
    </div>

    <div id="question">
        question 2
    </div>

    <div id="answer">
        answer2
    </div>

```

Now the Explode plugin comes with the `{exp_value_1}` and `{exp_value_2}` variables, but they don't work on a 'Loop'

Is there any way of achieving this? With any other plugin? Or another solution

# Answer
I think you can do this with the Lists feature of CE Variables.

http://www.causingeffect.com/software/expressionengine/ce-variables/user-guide/lists
> 1 votes

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


# Question
Title: Has anyone coded a Playa Multi Select Drop Panes UI in a Safecracker Form?
Can't find anything online about it... is it possible? Someone must have done this before? Please give me some guidance.

# Answer
You can use the safecracker syntax of {field:field\_name} to get it to display exactly as it does in the CP / Publish page.
> 1 votes

---
Tags: safecracker, playa, filter, multiselect
---


# Question
Title: Displaying member custom_profile_data on front end of site won't work
{exp:member:custom\_profile\_data member\_id='{member\_id}'}{full\_name}{/exp:member:custom\_profile\_data}

The code above doesn't show anything. if I change the {member\_id} global variable to a number it does work. Why isn't it working when the variable is in there? {member\_id} displays correctly when used outside of the tag.

# Answer
> 2 votes
`{member_id}` and `{logged_in_member_id}` are standard global variables. All global variables are parsed **after** the modules. Take a look at the Template Engine documentation. The modules tags are the 15th item parsed, while the `{member_id}` is 24th and `{logged_in_member_id}` is 25th.

So, when the template engine parses the `exp:member:custom_profile`, the `member_id` isn't available yet.

By the way, you don't need to fill the `member_id` parameter because its default value is the current logged member.

# Answer
> 1 votes
You should see ExpressionEngine's Parse Order (http://loweblog.com/downloads/ee-parse-order.pdf). You can see that user deﬁned global variables are being parsed at last.

But if you would like to show the logged in member's profile data there is no need to pass member\_id parameter.

See this statement within user doc (http://ellislab.com/expressionengine/user-guide/modules/member/#custom-profile-data-tag)

> Specifies a particular member’s information to display. By default (if you do not include the member\_id parameter), the tag will simply display information pertaining to the currently logged-in user.

---
Tags: members
---


# Question
Title: Multi word url links bug in WYGWAM field
If I create a hyperlink from multiple words in a WYGWAM field it looks fine if I view the source code but when parsed in the browser it adds stuff to the link address causing it to fail. Example, I type some link text "Results and splits" I then highlight it and click the link button and browse and select the file. This is the source code generated in the WYGWAM field when viewed in the control panel:

```
<a href="/results-archive/2012-13/index.html">Results and splits</a>

```

But this is what the resulting browser source is:

```
/results-archive/2012-13/index.html2012-13/index.html}

```

But if I edit the link text by viewing source in the WYGWAM field and delete the words and then retype the words in source view and then save the link it works perfectly.

Edit:This is only when linking to a file via Assets

EE 2.6.1 WYGWAM 2.7.1

# Answer
> 1 votes
We've got a fix for this locally that will be included in the next release. Sending the patched files in your support request.

---
Tags: wygwam, assets
---


# Question
Title: How to allow access to Assets File Manager but no other modules
I want a member group of "Editors" to be able to use the Assets file manager directly but can't find a permissions combination that allows access to only Assets. You have to give them access to Modules and even if you only give them Module Access Privileges to Assets they can still see and uninstall other modules.

I don't know if there is something Assets could do that would allow a top menu button to be added and allow access to the Assets File Manager and no other modules or if it's an ExpressionEngine core function that needs to allow it.

I'm using the RogEE addon (Show Me My Assets!) to hijack some of the links to the native EE File Manager but it doesn't override the file manager link from the File upload preferences and sync pages and I can't see how to hide the links to File upload and Watermark preferences from the Content drop down menu.

# Answer
> 1 votes
The ability to access Modules, and the ability to install/remove modules are two separate group permissions. You can grant the former permission without granting the latter.

---
Tags: pixelandtonic, assets, file-manager
---


title: Getting the next time

text:
# Question
Title: Getting the next time
I have a monthly event. I want to say *"The date/time of the next event is \[time\]"*.
Lets say, the 5th of every month, from 5pm-6pm.

If it's currently January 4th, it'll say the next date is January 5th.
If it's currently January 6th, it'll say the next date is February 5th.

Additionally, I'll need to account for the day itself.

If it's currently January 5th: from 5pm to 6pm I want it to say the event is on *now*.
If it's currently January 5th, from 6pm onwards I want it to say the next date is February 5th.

I just don't know how to even begin using dates in conditionals, etc.
Any help would be appreciated. Thanks!

Edit:
These events aren't channel entries, they are just a known monthly date and I needed to check whether the current time is before, after or during the event.
This has been solved.

# Answer
> 0 votes
I ended up needing to write a plugin to handle this.

It just compares the event date/time and the current date/time, and outputs different date strings.

# Answer
> 1 votes
Can you use Low's nice date for this? It has a range setting.

http://gotolow.com/addons/low-nice-date/

# Answer
> 1 votes
If each instance of the event is an entry, you might want to check out Solspace's Date Field Filter \- which allows you to map a custom date field as the field upon which you would like to effect EE's native date functionality (oddly, date fields other than the actual entry date field behave differently) and allows you to specify a dynamic start and end date/time for the range (or open ended, looking forward, which I think is what you would want). I've used it a bunch of times and it worked great for this sort of thing. You could map your date field as your end date (so that an event that isn't yet over still displays) and do a simple comparison of your custom end time field against current\_time to be able to flag an event as "going on now"

# Answer
> 0 votes
I do not fully understood how you're trying to do this, but you can always use "%U" as format for using dates on conditionals:

```
{if {current_time format="%U"} > {field_start_date format="%U"} }
    {if {current_time format="%U"} < {field_end_date format="%U"} }
        event now
    {/if}
{/if}

```

Or, you can use format="%Y%m%d" for checking just on a interval of 24 hours.

---
Tags: date
---


# Question
Title: Making a directory's A - B - C - D etc. links
I'm making a people directory with the A - B - C etc. links, where clicking a letter will take you to the people whose last names begin with that letter. I have a People channel with a last\_name field that I can use.

Can anyone recommend a good way to approach this? Thank you.

# Answer
You might use "Low Alphabet"

See the tags from here: http://gotolow.com/addons/low-alphabet/docs/tags

For last\_name, just pass parameter `orderby="last_name"` within `{exp:low_alphabet:entries}`
> 4 votes

# Answer
Disclosure: This is probably insane.

That said, here's what I did to "solve" the problem utilizing P&T's Iterate plugin and Stash:

```
    <ul class="item-list-nav">
{exp:iterate alpha='a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z' parse='inward'}
        <li class="ig-{alpha}"><a href="#ig-{alpha}">{alpha}</a></li>
{/exp:iterate}
    </ul>

{exp:iterate alpha='a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z' parse='inward'}
    <div class="item-list-group" id="ig-{alpha}"><a name="ig-{alpha}"></a>
        <span class="item-list-group-title">{alpha}</span>
        <ul>
    {exp:stash:get_list name='service_list' match='#^(?i){alpha}#' against='item_title'}
            <li><a href="{item_url}">{item_title}</a></li>
    {/exp:stash:get_list}
        </ul>
    </div>
{/exp:iterate}

```

Insane? Maybe. But does it work? You bet.
> 2 votes

# Answer
At first I was thinking of trying the search:field parameter, but instead used a href="#A" links at the top with named anchors with PHP on Output in my channel entries loop:

```
    <td id="<?
                    $lchar1 = substr("{last_name}", 0, 1);
                    if ($lchar1 != @$lchar2)
                        echo "$lchar1";
                    $lchar2 = $lchar1;
   ?>">

```
> 1 votes

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


# Question
Title: Show content only if there are one or more relationships
Using Solspace Calendar, I am displaying a list of related entries (from a relationship field) on an individual event page, like so:

```
{exp:calendar:events event_id="{embed:event_id}"}
<section id="related-orgs">
<div class="hd">
    <h2>Related Organisations</h2>
</div>
<div class="bd">
    <!-- Start Entry Listing -->
    <ul class="entries compact">
        {event_organisations}<li class="entry"><a href="#">{event_organisations:title}</a></li>{/event_organisations}
     </ul>
    <!-- End Entry Listing -->
</div>
</section>
{/exp:calendar:events}

```

This is pulling through the related entries correctly.

**However, if there are no related entries, I don't want that section to appear at all.** I have tried using `count` and `total_results` as per the below, but this appears to prevent it from showing even when there are relationships.

```
{exp:calendar:events event_id="{embed:event_id}"}
{if event_organisations:count == "1"}<section id="related-orgs">
<div class="hd">
    <h2>Related Organisations</h2>
</div>
<div class="bd">
    <!-- Start Entry Listing -->
    <ul class="entries compact">{/if}
        {event_organisations}<li class="entry"><a href="#">{event_organisations:title}</a></li>{/event_organisations}
     {if event_organisations:count == event_organisations:total_results}</ul>
    <!-- End Entry Listing -->
</div>
</section>{/if}

```

Am I missing an obvious solution?

# Answer
> 1 votes
Since you don't need to show calendar data in this part of template, why not to use the traditional channel:entries module?

Plus, you're checking for the position in the loop **outside** the loop!

```
{exp:channel:entries entry_id="{embed:event_id}"}
    {event_organisations}
    {if event_organisations:count == 1}
        <section id="related-orgs">
            <div class="hd">
                <h2>Related Organisations</h2>
            </div>
            <div class="bd">
                <!-- Start Entry Listing -->
                <ul class="entries compact">
    {/if}
                    <li class="entry"><a href="#">{event_organisations:title}</a></li>
    {if event_organisations:count == event_organisations:total_results}
                </ul>
            <!-- End Entry Listing -->
            </div>
        </section>
    {/if}
    {/event_organisations}
{/exp:channel:entries}

```

---
Tags: relationships, solspace-calendar
---


title: Assets plugin not working at all

text:
# Question
Title: Assets plugin not working at all
I have installed the Assets plugin but it is not working at all. It is installed on a linux server with php 5.3.17, Expression Engine 2.6.1 and Assets 2.1.4. I have set the correct upload directories in the basic file manager which is supplied with EE itself. When I want to update the indexes of the Assets plugin, nothing happens. It does, however, uses the following http headers:

A POST from jquery to index.php with the callstack:

* jquery.js:177
* jquery.js:171
* jquery.js:162
* settins.min.js:1
* jquery:86
* jquery.js:78

The response tot that is a HTTP 302 to the location admin.php. Next a GET from /index.php with, again, a HTTP 302 response to admin.php?S=0&D=cpC=homepage. After that, a GET request is made to the forementioned page and a HTTP 200 is returned.

The same requests are made when trying to upload a new file from the Assets plugin. Also, the Upload Files button is disabled. After removing the disabled tag and trying to upload a new file, the three forementioned requests are made with the same response and a javascript alert with the message "Could not upload the file - server returned an unexpected response. Please check the server settings.".

I have reinstalled the module, checked all the required file chmod attributes and session/cookie settings. but to result.

# Answer
> 3 votes
Generally when this happens it’s because either your system is off, or your .htaccess file intercepting Assets’ Ajax requests.

If it’s the latter, you can try adding this to system/expressionengine/config/config.php:

```
$config['assets_site_url'] = "/index.php";

```

Assuming you don’t have a .htaccess redirect that forces “index.php” out of the URL, that should help Assets’ Ajax requests bypass your main index.php redirect.

If you *do* have a redirect that forces index.php out of the URL, then try modifying your main index.php redirect to include this line before the `RewriteRule` line:

```
RewriteCond %{QUERY_STRING} !^ACT= [NC]

```

And also change your `RewriteRule` line to this:

```
RewriteRule ^(.+)$ /index.php/$1 [L]

```

(Notice the ‘`.+`’ rather than ‘`.*`’.)

---
Tags: assets, module
---


title: Assign member to multiple member groups

text:
# Question
Title: Assign member to multiple member groups
Is it possible to assign a single user to multiple member groups / is there a module that does this?

I currently have several member groups, but they're not mutually exclusive. A La, "some dogs are black, but not all black things are dogs"

Currently I would have to setup something like the following:

* Group A only
* Group B only
* Group C only
* Group A + B
* Group A + C
* Group B + C
* Group A + B + C

Is there a more efficient route forward?

Thanks in advance,

J

# Answer
If I understood you right, you just want to categorize your members. Am I right? If this is your intention, I suggest you to try AB Member Categories. Zoo Visitor and Solspace User looks like so much power for so little needs.
> 3 votes

# Answer
Any of the add-ons that convert members to entries can do it. Zoo Visitor, Safecracker Registration, Profile Edit \- I think each take variations on the approach of using categories as member groups, and then syncing your member channel entries with the member module. And since they use categories, you can assign a user to more than one. Solspace's User module allows you to assign members to more than one group, but it handles it a bit differently, I believe, and adds a bunch of other member-oriented functionalities as well.
> 2 votes

# Answer
You can't do this with the native Members module but you can do it with Zoo Visitor.

Zoo Visitor handles your members as entries so you get the full use of custom fields and categories. The latter can be used to set up group memberships and allow you to put a single member in more than one group.
> 1 votes

# Answer
FWIW this late in this thread, I have a multiple membership module that does exactly what is asked by Jamie.

Bear in mind this V0.9 Beta. Suggestions for development are available.
> 0 votes

---
Tags: members
---


title: Member groups limited to view channels

text:
# Question
Title: Member groups limited to view channels
I have a EE website with around 20+ member groups and members from each of the membership groups should only have access to browse (front end only) certain channels of the website after signing in (front end).

Example: Membership group 'College 1' and 'College 2' should only be allowed to view channel 'book3', 'book5' and 'book7' when they browse the website (front end). I can do it in the template with condition, but it might be a bit messy to update the templates every time I add/remove a member group.

I've been trying to search for a solution, but have not found any yet, hopefully you have a solution.

Is this a function that is built-in in ExpressionEngine or if there are module you can recommend?

Thanks

# Answer
You can limit the ability to view channel content by channel/member group combinations using HooBlong.

Bear in mind this is still in beta.

Don't be put off by the fact that the module can also be used to assign a member to more than one group - the front end channel control that you are looking for is built in for all memberships.
> 1 votes

# Answer
You should try Zenbu module (http://zenbustudio.com/software/zenbu).
> 0 votes

# Answer
Although it may get complicated with 20 member groups, the basic way in EE is to wrap your content (either portions, or the whole page) in conditionals in your templates like:

```
{if group_id == 7 OR group_id == 8}
    show content
{/if}

```

You can also use something to limit access to a whole page by redirecting if not in a group:

```
{if group_id != 7 AND group_id != 8}
    {redirect="template_group/template"}
{/if}

```

To make things easier to manage, you might also make your most common 'access' conditionals snippets.
> 0 votes

---
Tags: member-management
---


# Question
Title: Exp:resso Store Inline Error handling restore previous values
Basically my problem is I wanted to retrieve the input values prior to submitting the cart so when an error is encountered, the values entered by the customer will still be in the form. Something like how the Codeigniter form validation library does. Is this possible?

# Answer
> 2 votes
You should be able to use the value attribute to recall the value entered into the form field like this:

```
<input type="text" name="order_custom1" value="{order_custom1}" />

```

In this case I'm using `order_custom1` as an example but the same can apply for any any order field. You may wish to also wrap it in a conditional to check if there is any value before displaying:

```
<input type="text" name="order_custom1" value="{if order_custom1}{order_custom1}{/if}" />

```

---
Tags: expresso-store
---


title: Embed labyrinth: which way to go?

text:
# Question
Title: Embed labyrinth: which way to go?
Have on mind that this post comes from someone who still after very few projects in EE is still a newcomer. That being said I’m looking forward to start a new project with a “best practice” approach. So, after listening and learning so much from the “unofficial” podcast with @lealea and @emilylewis (hopefully @mediagirl becomes part of the show) I’m in this anti-embed situation:

For I what I heard and read, {embeds} are not the best approach since they use many resources. But still I find no alarm or recommendation from EllisLab on how NOT to use them. The community via #eecms has shared some insights @Boyink tells me “try embeds and measure performance yourself. They still work fine in most cases.” @jasonleelab recommends Low Variables and @pauloelias goes for a Stash approach.

I thought about using Template Morsels and tried Stash Embed with very bad results: pages wont refresh and it was a design nightmare. (I did tried https://github.com/croxton/Stash/blob/dev/docs/working\_with\_files.md approach and I’m sure I’m doing something wrong).

I’m trying to find the best DRY method that doesn’t affect the site’s performance. At this point I have some HTML code that I want to use on several templates, a couple of {exp:channel:categories channel="Publicaciones" style="nested"} , etc. But I’m heading to a user site with lots of sessions and downloads and really wish to start the best way.

Any ideas? Thanks!

# Answer
> 1 votes
Have you considered using snippets?

> Snippets can be considered to actually be part of the template that they are used on, with their expanded contents parsed simultaneous to other tags and variables on the template. Embedded templates are separate templates, with their own preferences (caching, PHP parsing, access, etc.), and are parsed individually. Put another way, embedded templates are not included in the parent template, but rather added to them after the fact, using a separate query and full page parsing resources for each template.

Snippets tend to be more performance friendly. Boyink talks about snippets on train-ee as well including some performance tests.

# Answer
> 0 votes
Your best approach is to choose the right tool and just use addons if you really need them. Stash, for example, allow you to do really crazy things and it can improve or decrease your performance, like any tool.

For static code, use User-defined variables. They are just added to your templates after all dynamic parsing (number 21 on parsing order).

For repeatable pieces of code, use snippets. They are added to your code before the modules and addons do its job (number 5 on parsing order).

Snippets and User-defined global variables can be edited as plain files using SnippetsSync. Just remember to disable the automatic update on your live site adding this code to your config.php:

```
$config['snippetssync_production_mode_override'] = TRUE;

```

Embeds are full templates that are added to its parents close to the end of parsing (number 19 on parsing order. They are your last option before addons.

For really little pieces of code you need on early stages of parsing, add them to your config file.

```
global $assign_to_config;
if( ! isset($assign_to_config['global_vars']))
$assign_to_config['global_vars'] = array(
    'cv-static_domain' => '//a.do.main',
    'cv-short_domain' => 'http://do.main'
);

```

Config variables can be accessed on templates just like snippets and are parsed before all modules and add-ons.

# Answer
> 0 votes
Stash is...hard to grok. The new docs are much better then the old:

https://github.com/croxton/Stash/wiki ..but still hardly a 'beginners guide'.

I found this the best of the simpler guides: http://pixelfear.com/blog/stash-workflow

...and I am a LONG way from an expert....but here's my 2c:

Basically, this is a structure for setting up a router -\> data model -\> visual template approach. It's pretty simple once you try it. You don't necessarily need to use the routing approach, but the basic idea of it is to nicely separate your getting & processing of the data from your channel(s) - and then the display of this data. I've taken it a step further and broken my display side of things into very modular chunks (I call them stash chunks but I actually store them as early parsed low variables, which are the same as snippets but I can group them and work with them on disk...).

Anyway - basically it goes like this:

**Routing template:** Grab any data you need initially and stash set it (e.g. list of categories). Then your routing template parses the URL (switchee, low seg2cat & using any data grabbed in the initial step) and directs the request to the appropriate model (stash:embed:my\_model).

**Model**: The model grabs all the required data (exp:channel:entries or exp:low\_reorder etc) - and stash sets it (as single stash sets or lists). You can have different models pulling from different channels, but setting the same stash data (meaning you can use the same chunks in your view/display template that will accept this data - neatly getting around the 'different but similar channels can't share the same fields with the same name issue that is mind numbingly dumb about EE).

The model also stash embeds a 'view template' (and can do so conditionally based on the retrieved data, for example - so you can vary your actual display template based on what your data model retrieved.)

**View/Layout**: Your view is basically html/css wrapped around a bunch of stash gets/get\_lists. As I said, you can chunk this in to highly repeatable little blocks (stored as snippets/low vars). So you can then build you actual pages out of these re-usable modular blocks that receive the injected data.

Initially, avoid all caching stuff. That's what I have done - I suspect that's why your pages won't refresh..I havent even tried it yet but it will certainly complicate things initilly.

This approach makes the data grabbing stuff really easy and avoids a LOT of the parse order crap. It's pretty much a classic MVC approach....and very very DRY. Indeed if you go too crazy with chunking, it can be almost too DRY!

Anyway, @jason\_varga explains it better.

Stash really is pretty awesome and it can probably do what you want...it's jsut hard to get initially and could do with some basic 'if you want to do this -\> do this' type guides.

---
Tags: embeds
---


title: Structure / Listing Pagination

text:
# Question
Title: Structure / Listing Pagination
Pagination isn't working for me in Structure for a listing-template. My entries loop for the listing looks like this:

```
{exp:channel:entries
    channel='remedy'
    limit='9'
    dynamic='no'
    orderby='title'
    sort='asc'
    paginate='bottom'
}
    <article class="remedy">
        <h4 class="remedy-title"><a href="{page_url}">{title}</a></h4>
        <p class="remedy-description">{remedy_rel_product backspace='2' limit='3'}<a href="{url_title_path='shop/product'}">{title}</a>, {/remedy_rel_product}…</p>
    </article>
    {paginate}
        {pagination_links}
            <ul class="pagination">
                {first_page}
                        <li><a href="{pagination_url}" class="page-first">First Page</a></li>
                {/first_page}

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

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

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

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

```

The links output the right path, when I click on it going to /my-page/P##, it'll just default out to the site's home-template. In the template-debugger that's also exactly what I see:

`(0.000218 / 14.59MB) Path.php Template: /`

While without the pagination-segment it shows this:

`(0.000138 / 14.59MB) Path.php Template: _templates/remedy_listing`

Which is the correct template. Any thoughts as to what's going on here? I'm running Structure 3.3.10 on EE 2.6.1.

# Answer
Try uninstalling/reinstalling the extension (only). If that doesnt work, what ither extensions are installed?
> 1 votes

---
Tags: templates, structure, pagination, path, listing
---


# Question
Title: How to display Select Files field using Low Variables
I have a Low Variable titled lv\_accreditations to allow the client to select a series of logos to display in the site footer.

The variable is set to Enable Early Parsing and to output a comma seperated list.

However, i'm unsure how to actually display these in a template so that I can add additional tags around the outputted list. I'm using the following but i'm just not sure what to put in the src attribute and have the li created for image image in the Select Files field.

```
{exp:low_variables:pair var="lv_accreditations"}
<li><img src="" /></li>
{/exp:low_variables:pair}

```

Grateful for any assistance with this one. :)

# Answer
> 1 votes
Heh, after a bit more sweating here in blighty I managed to figure it out.

```
{exp:low_variables:parse var="lv_accreditations" multiple="yes"}
<a href="#"><img src="{lv_accreditations:data}" /></a>
{/exp:low_variables:parse}

```

---
Tags: low-variables
---


# Question
Title: How to check if EE member has a website address (field carries http:// so it always returns true )
I have the following code:

```
{if url}
    <p><strong>Website</strong><br /> <a target="_blank" href="{url}">{company_name}</a></p>
    <hr />
{/if}

```

However,because the website field in EE's member profile always has "http://" inserted by default, the above code will always return true and display the conditional HTML. I am having to edit profile, remove the "http://" bit and save. Even then the "http" bit is inserted back in again but the code above will work!

Any ideas on how to get around this?

Thanks

# Answer
For a solution for now, how about a different conditional?

```
{if "{url}" != "http://"}
    <p><strong>Website</strong><br /> <a target="_blank" href="{url}">{company_name}</a></p>
    <hr />
{/if}

```
> 3 votes

# Answer
If you are not entering any value within the URL then nothing will not be saved into database for member URL even if URL text box is showing "http://".

The URL text box always shows "http://" to help the user to enter correct URL format with "http://".

So the condition `{if url}` will return false if URL is not entered during registration or edit profile.

Please share if I need to describe more.
> 0 votes

---
Tags: conditionals, member-details, ifelse
---


# Question
Title: Should be simple... Playa field with categories
There are only two channels: 'videos' and 'products'

There are several categories all set by the managers.

Videos are entered as single entries and are given a category or multiple categories, depending on the usage.

Products are entered as a single entry as well. The only field is the playa field where you drag over the related videos for that product.

The page is simple as well. In the product template, I just need to render the {title} of the product for that page/entry. Simple enough.

Then there is a side nav listing the categories of the related/selected videos in the playa field. I only need to show them once, so if there are 30 videos and 3 categories total, it would show something similar to:

* Category A (14)
* Category B (12)
* Category C (4)

An finally in the main page, show the videos per category like:

Category A

VIDEO 1 - VIDEO 2 - VIDEO 3...

Category B

VIDEO 1 - VIDEO 2 - VIDEO 3...

*** EDIT ***

A little more info...

I run into trouble reading the product entry which has the playa field. The categories are attached to the videos and not the products. I can list out the playa fields in the videos section of the main page, but the side nav is still getting me.

How would I get the list of categories for the videos which are related to the product via playa? (And a count on top of that.)

I could write a query to do this, but I would like to keep it all intact if possible.

# Answer
> 0 votes
I ended up changing direction and making two category groups. One for Products and one for Sections. The can enter a list of products in the category Products and use Sections for the 'category' segments. This way I can just use "EE2 Child Categories" plugin by Nico to sort and filter as needed throughout the page.

To remedy the category url in the title, I just wrap everything in a query like so:

```
{exp:query sql="SELECT cat_id, parent_id FROM exp_categories WHERE cat_url_title='{segment_2}'"}

```

This way I can use the ID's and render the names and links for everything after.

---
Tags: playa, embeds, categories
---


title: Trouble with rEEservation template

text:
# Question
Title: Trouble with rEEservation template
I'm having trouble getting the rEEservation form to show up properly on my website. The basic form shows up okay, but it's not showing the options for which I created channels for. When 'proceed' is clicked, it leads to an error page saying, 'The object for booking is not provided' - because there was no way to select the options.

I'm trying to create a reservation system for 2 tables at a cafe, for 3 hour slots from 11am - 11pm. This is how it's set up at the moment: Channel: reserve\_table Channel Fields: {table} which is a text input field Channel Entries: 8 of them (Table 1: 11am - 2pm; Table 1: 2pm - 5pm; Table 1: 5pm - 8pm; table 1 - 8pm - 11pm - and then repeated for Table 2).

The template code:

```
{exp:channel:entries channel="reserve_table"}
<h3>{title}</h3>

{exp:reeservation:form entry_id="{segment_2}"}
<p>Name: <input type="text" name="name" /></p>
<p>Email: <input type="text" name="email" /></p>
<p>Phone*: <input type="text" name="phone" /></p>
<p>Booking date*: <input type="text" name="date_from" id="date_from" value="{current_time format="%Y-%m-%d"}" /></p>
<p>Leave a comment for your booking: <textarea name="comment"></textarea></p>
<p><input type="submit" value="Proceed" /></p>
{/exp:reeservation:form}
{/exp:channel:entries}

```

Ideally, the customer would be able to select a table time slot on a particular date (dropdown menu perhaps?), and have it verified that the time slot has not already been booked.

I've scoured the docs and just can't seem to move it past the point i'm at. I can add manual reservations, but not from the website. How do I get the channel entries list to show up? Where does the exp:reeservation:check (or do I use exp:reeservation:check\_multiple?) code go? And if I were to use the Simple Calendar code, which is provided, where does that go?

If anyone who has successfully used rEEservation before can help, or even let me peek at your template code, I would greatly appreciate it. Thanks!

==== Update: Problems solved!

I got rEEservation working with lots of help from Yuri. In the end, I now have 4 channel entries, one for each time slot. In the rEEservation settings, I have it set so that each time slot (or 'object') can be booked a maximum of 2 times per day (because there are two tables which can be booked). My final template code looks like this:

```
<code> {exp:reeservation:form return="bookings/thank_you"}
        <p>Table/slot*: <select name="entry_id">
        {exp:channel:entries channel="reserve_table" dynamic="no" disable="categories|custom_fields|member_data" orderby="title" sort="asc"}
        <option value="{entry_id}">{title}</option>
        {/exp:channel:entries}
        </select></p>
        <p>Name*: <input type="text" name="name" /></p>
        <p>Email*: <input type="text" name="email" /></p>
        <p>Phone*: <input type="text" name="phone" /></p>
        <p>Booking date*: <input type="text" name="date_from" id="date_from" value="{current_time format="%Y-%m-%d"}" /></p>
        <p>Leave a comment for your booking: <textarea name="comment"></textarea></p>
        <p><input type="submit" value="Proceed" /></p>
        {/exp:reeservation:form}</code>

```

# Answer
> 1 votes
You have 2 way to let user book each table/slot.

First is to display separate for for each entry. To do this, change `{exp:reeservation:form entry_id="{segment_2}"}` to `{exp:reeservation:form entry_id="{entry_id}"}`

Another option is to present table/slot selection as dropdown field. Then your code will look like:

```
{exp:reeservation:form}
<p>Table/slot*: <select name="entry_id">
{exp:channel:entries channel="reserve_table" dynamic="no" disable="categories|custom_fields|member_data"}
<option value="entry_id">{title}</option>
{/exp:channel:entries}
</select></p>
<p>Name: <input type="text" name="name" /></p>
<p>Email: <input type="text" name="email" /></p>
<p>Phone*: <input type="text" name="phone" /></p>
<p>Booking date*: <input type="text" name="date_from" id="date_from" value="{current_time format="%Y-%m-%d"}" /></p>
<p>Leave a comment for your booking: <textarea name="comment"></textarea></p>
<p><input type="submit" value="Proceed" /></p>
{/exp:reeservation:form}

```

# Answer
> 0 votes
Alissa, I looked sort of around on your problem, partly out of interest to know what was available as far as booking engines. Not any direct answer resulted, as you'll see, but maybe what's here will help gain a solution.

Would have to say that rEEservation doesn't seem to be able to handle hourly reservations, at least that I could find, plus there is a message from the developer saying it won't, here. Yuri seems to be a quite responsive and nice guy, but this add-on appears to have some history from comments elsewhere, and anyway may not be a fit.

I looked for alternatives to handle such a case If I were doing it, and came up with two approaches, roughly.

* Embed a PHP code library solution alongside EE, where BookingWizz may seem an example, and has an online demo where you can see the first page doing slots during a day such as you require. There's a one-time low cost to license, plus work you'd need to do to integrate any value-passing and match site styles, perhaps not too deep, but you'll know. How good is it? Lots of nice recommends - and the occasional not at all satisfied customer on their forum that you may find anywhere. It's not responsive, out of the box, but that's just markup work, isn't it? Looks like the developer answers often. Risk - some, until you try it and see.
* Slot in a SAAS offer, which means mainly adding some html/css/js they provide, plus again any value-passing integration. I kind of liked the look of Planyo -- also they're Swiss ;) -- which has a monthly CHF 24 (about GBP 17), and a lot of features. BookingBug is a somewhat more expensive UK one, but perhaps with some advantages in connecting. These cost a lot more obviously, and it is on-going. Advantages may be that they keep things up-to-date?

So, a few ideas, anyway. Interested in how you end up solving this site.

---
Tags: reeservation
---


# Question
Title: Since upgrading to 2.5.5, Template Manager links broken in Chrome.
Since upgrading to 2.5.5, in the Template manager screen, all the links have the same template group ID in them, so I can't switch between template groups. It works in Firefox, Opera, and even in IE, just not Chrome. Wondering if anyone else noticed this?

# Answer
I'd suggest reuploading the control panel theme files from your 2.5.5 install. Perhaps something was corrupted on upload. The files are stored at: /themes/cp\_themes/.

Also, make sure the page has completely loaded in Chrome before clicking on the template group.

Also, check the Chrome Dev Tools Network Panel for any 404 errors.
> 3 votes

# Answer
Strange, just had this happen to me after upgrading to 2.6.1. Replacing the cp\_themes directory didn't fix the issue, but replacing the whole themes one did.

Who knows. Hope this helps someone else.
> 0 votes

---
Tags: ee2, ee2-upgrades
---


title: Image Manipulations on existing images?

text:
# Question
Title: Image Manipulations on existing images?
Are you able to apply image manipulations to images that are already uploaded?

When does the image manipulation happen?

For instance you set a selection of manipulations, then you upload 50 images, then change the sizes in the manipulations, how do you have the 50 already uploaded images changed?

# Answer
> 4 votes
The manipulations happen just after a file be uploaded and it can be updated by the synchronize button on the file upload preferences.

You can modify the preferences, but sadly you can't remove old manipulations from the server. If you remove a manipulation, its folder will remain on server and you need to delete it by FTP.

---
Tags: file-uploads
---


# Question
Title: Does Assets allow you to use the built in Image Manipulations to resize on upload
I really want to use the built in Image Manipulations to allow the images to be resized at the time of upload to help remove some of the extra server stress on load in the templates using CE Image.

The idea is to create a few sizes small/medium/large and then use CE Image to modify these if necessary.

I want to continue using Assets, but not sure if the sizes will work with it.

Can anyone advise me if this is possible with Assets 2?

# Answer
Assets does work with the built-in image manipulations when using local sources. See Asset Image Manipulations

ie:

```
{my_assets_field:url:my_manipulation}

```
> 4 votes

# Answer
Assets respects the settings in the "File upload preferences". So if you have set a maximum size there it will be applied to an Assets upload.

I personally don't bother with creating any alternative sizes with the "Image Manipulations" option. I just use CE Image to create whatever I need whenever I need it in the template code. Why bother to create any if you are going to use CE Image anyway? After the image has been called once the smaller image is cached, so no extra load on the server.
> 0 votes

---
Tags: assets
---


title: Related Content issue

text:
# Question
Title: Related Content issue
I have an issue displaying my related content to an entry.

To serve some context, I have a Channel called Projects, and I also have a Channel called Services. In Projects I have a Relationship field called 'project\_services' that pulls in content from the Services Channel.

Below is a gist of my code.

https://gist.github.com/NickToye/6045642

Where am I going wrong?

# Answer
I couldn't find any issue in your code. It looks like a bug or a cache issue. Please, try to cleanup the relationships cache.

In your place, I would use categories for services, instead of a channel: better performance and no cache issues.
> 0 votes

---
Tags: relationships
---


# Question
Title: How to sort field from multiple Channels?
I'm looping through multiple Channels:

```
{exp:channel:entries channel="channel_a|channel_b"}

```

Say that `channel_a` has `a_field` and `channel_b` has `b_field`. I want to sort such that the values of `a_field` and `b_field` are consider part of the same list. I don't want to, say, sort all the `a_field` first, then all the `b_field` next.

Possible to do this in EE?

# Answer
> 3 votes
This looks like a job to Stash!

```
{exp:stash:set_list name="channels_a_and_b" parse_tags="yes"}
    {exp:channel:entries channel="channel_a|channel_b"}
                {stash:sort_field}{a_field}{b_field}{/stash:sort_field}
                {stash:another_field_a}{another_field}{/stash:another_field_a}
                {stash:another_field_b}{another_field}{/stash:another_field_b}
                [...]
    {/exp:channel:entries}
{/exp:stash:set_list}

```

Then, on an embed:

```
{exp:stash:get_list name="channels_a_and_b" orderby="sort_field"}
    {sort_field}
    {another_field_a}
    {another_field_b}
    [...]
{/exp:stash:get_list}

```

Just, please, don't get addicted to Stash. I have seen a lot of unnecessary and complex uses of Stash around there.

---
Tags: channel-entries
---