# Question
Title: Does ExpressionEngine support child or sub themes (theme inheritance)?
I was wondering if ExpressionEngine support child / sub themes similar to the way other CMSs have implemented template / theme inheritance?

thanks!

# Answer
No, it does not. In fact, EE does not really use "themes", per se. it uses templates, which are in no way bundled together as "themes". It's very difficult to "theme" EE, because every EE install is completely different with different channels, custom fields, etc.

EE is really about bespoke, custom sites. If you go in thinking of it as a "theme-able" CMS, you are in for a world of confusion and hurt.
> 2 votes

# Answer
EE is independent of any preset theme. It exists as a CMS that works within any theme you choose - you could pick any HTML theme up from ThemeForest, replace the default text with EE tags, and boom - instant theme with CMS. that said, it's not wordpress where you just install the theme and off you go, but on the other hand, it's not limited to preset locations for content - your site doesn't have to resemble 1000 other ones. Unless that's what you had in mind..
> 1 votes

---
Tags: ee2, templates, themes
---


# Question
Title: Freeform Composer General Errors Not Showing on MSM
We have a website that is powered by MSM.

On the main website forms work fine and the form errors show.

On the sub-sites, the forms send but they don't show the general errors.

The code in question is:-

```
        {exp:freeform:composer form_name="{embed:form}" admin_notify="{embed:email}|info@redcarrot.co.uk" admin_notification_template="{embed:template}" inline_error_return="{embed:page}/#freeform" return="{embed:page}/thanks#freeform" inline_errors="yes"}
    {if freeform:general_errors}
        <h3>There were some error(s) with your submission:</h3>
        <ul>
            {freeform:general_errors}
                <li>{if "{freeform:error_message}"=="captcha_required"}Please type the two words at the bottom of the form{if:else}{freeform:error_message}{/if}</li>
            {/freeform:general_errors}
        </ul>
    {/if}

```

# Answer
> 0 votes
This was fixed.

Freeform stores inline errors in a "Flash" cookie. Because we had the cookie consent module enabled (with the intention to not set any cookies to users) it couldn't set them.

The reason it appeared to work on the main website was because we were logged into CP and thus had accepted cookies. D'oh!

---
Tags: solspace-freeform
---


title: EE in subfolder not working correctly

text:
# Question
Title: EE in subfolder not working correctly
I've got EE running in a subfolder on a dev environment, such as:

```
http://website.com/folder_name/

```

But somehow, the folder keeps being removed from the URL for certain things. E.g. the "Home" icon on the home button in EE errors, because the URL looks like this:

```
/themes/cp_themes/default/images/home_icon.png

```

Not:

```
/folder_name/themes/cp_themes/default/images/home_icon.png

```

How can I fix this? There is no .htaccess file at the moment

# Answer
You need to delete this out of your .htaccess when accessing EE from a sub folder:

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

```
> 1 votes

# Answer
There's a configuration value for the location of your themes directory. By default, in EE you'd change those by going here in the EE control panel:

Admin \> General Configuration \> URL to your "themes" folder

Eventually, many developers start setting configuration options like that in their config.php file; in this case, `$config['theme_folder_path']`and `$config['theme_folder_url']` would be the applicable items. Delving into auto-setting dev/staging/production settings in config.php is beyond the scope of this post, but, is something you'll probably want to look into, if you haven't already.
> 1 votes

# Answer
Sounds like your .htaccess file needs to account for your subfolder when removing index.php for EE. Here's a code snippet you can use.

```
<IfModule mod_rewrite.c>
  RewriteEngine On

    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # RewriteRule ^(.*)$ /index.php/$1 [L]
    # IF YOU HAVE WEBSITE IN A SUB FOLDER: comment out above line, uncomment below line, & replace 'SUBFOLDERNAME'
    RewriteRule ^(.*)$ /SUBFOLDERNAME/index.php/$1 [L]

</IfModule>

```
> 1 votes

---
Tags: url, path, themes
---


title: Set all channels to save revisions

text:
# Question
Title: Set all channels to save revisions
How do you set all channels to have revisions? Especially on a big MSM site, this takes a lifetime!

# Answer
This simple SQL command will find all channels that doesn't have versioning enabled and will enable it remembering 10 revisions (change as you see fit).

```
UPDATE exp_channels
SET 'enable_versioning'='y', 'max_revisions'='10'
WHERE 'enable_versioning'='n'

```
> 1 votes

---
Tags: multi-site-manager
---


# Question
Title: Listing related entries based on category
I want to list out related entries when viewing an entry, regardless of channel but according to the category of the entry.

On the page where the entry is output, I output the entry in a traditional {exp:channel:entries} tag and close it.

Then, I start a new tag where I thought I'd have to get the category\_id first, before inserting that id into the channel:entries tag. I use Stash for that.

And my tags looks like this:

```
{exp:channel:entries channel="channel1|channel2" limit='1' parse="inward"}
     {exp:stash:set name="cat" parse_tags="yes"}
        {exp:gwcode_categories entry_id="{entry_id}" last_only="yes" style="linear"}{cat_id}{/exp:gwcode_categories}
     {/exp:stash:set}

     <h1>{title}</h1>
{/exp:channel:entries}

```

And right before I want to output related entries, I can get the stash variable fine like this:

```
<h1>{exp:stash:get name="cat" process="end"}</h1>

```

But then, when I try to use this variable directly in the next tag, it comes out blank. Most likely because of parse order. I know the code works because if I manually add an ID for category, the entries as listed out like you'd expect.

```
{exp:channel:entries channel="channel1|channel2"
category='{exp:stash:get name="cat" process="end"}' limit="3" dynamic="no"}
      {title}
{/exp:channel:entries}

```

What am I doing wrong? How can I get the correct parse order? Edit: Yes, I can use an embedded template, which is what I'll be doing if I can't get this to work.

# Answer
> 1 votes
What about just using the `related_categories_mode=""` parameter on the channel:entries tag?

---
Tags: stash, parse-order, gwcode-categories, related-entries
---


# Question
Title: Cartthrob: how would I order products by popularity?
I need to set up a filter that will allow products to be ordered by:

* Title
* Price
* Popularity

The first two seem simple enough but I'm not sure what the most efficient way of ordering by popularity might be?

# Answer
You can use this SQL with the query module:

```
SELECT exp_channel_titles.*, COUNT(row_id) AS popularity
FROM exp_channel_titles
LEFT JOIN exp_cartthrob_order_items
ON exp_channel_titles.entry_id = exp_cartthrob_order_items.entry_id
WHERE channel_id = 1 #this is your products channel id
GROUP BY exp_channel_titles.entry_id
ORDER BY popularity DESC;

```

This will have the products that have been ordered the most at the top of the list. If you need more than just title, entry\_id, and url\_title, you'll need to use this query to collect a list of entry\_id's to feed into `{exp:channel:entries}`. I hope this gets you pointed in the right direction.
> 2 votes

# Answer
Your going to need to collect numbers on the total sales of a product and then show search results based upon this.

So as part of the checkout process i would suggest extending the PHP to update a field in the database with total sales for this item. Then when the user searched via popularity you could use PHP to find the top 10 items by comparing the total sales figures and put out the results accordingly.

I am assuming cart throb doesn't give you the ability to do this off the shelf.
> 0 votes

# Answer
It depends on your definition of popularity.

If it's "how many people have looked at this?" then you can probably use `track_views=` and then sort by that.

Documentation at:- http://ellislab.com/expressionengine/user-guide/modules/channel/channel\_entries.html#channel-entries-track-views
> 0 votes

# Answer
The "People Also Purchased" option in CT might also be considered one way to chart popularity.

http://cartthrob.com/docs/tags\_detail/also\_purchased/

Title and price can be sorted with native EE tags.
> 0 votes

---
Tags: cartthrob, ecommerce
---


title: Want to show all freeform entries

text:
# Question
Title: Want to show all freeform entries
Freeform documentation says exp:freeform:entries limit defaults to 20. I want to show all entries.

When I add limit="200" - even though right now there aren't 200 entires - the page takes forever to load. At least 3x as long. Problem is that client is hoping for 2000+ entries eventually.

Suggestions? Solspace, ideas?

Thanks Amanda

# Answer
> 0 votes
I had exp:freeform:entries in Low Vars. I don't remember if preparsing was turned on or not. Anyway once I moved the code to an embedded template all was smooth.

Sorry for not thinking through and trying stuff on my own before asking here.

---
Tags: solspace-freeform
---


# Question
Title: Index.php was not generated on localhost. (not a .htaccess issue)
when searching for an answer it always lead to a .htaccess issue, but that's not what this is.

i'm new to EE since my companies website works on it i'm learning on the fly. to try to learn it better i installed it to my personal website and i'm starting to get the hang of it. but when i tried to install it on my computer using a WAMP server, the index.php file never showed up. i get a 404 error when going to `http://localhost/index.php` after clicking on **view rendered template** in EE on my computer while WAMP is running.

# Answer
Bchavez,

Try to check the configuration files of ExpressionEngine, I guess there is a problem about the server path and or the url path settings.

Did you install EE on the root of your server, or inside a folder? If it's inside a folder you have to configure the paths.
> 2 votes

---
Tags: ee2, 404, localhost
---


# Question
Title: Index Categories in Expression Engine search results
I have a site that needs to include category names as a parameter for search results that's keywords might be the cat name.

Anyone know of a way to do this, or possibly a plugin that converts a chosen set of categories to field data automatically so I can spoof it.

Ta.

# Answer
> 2 votes
Check out Preparse from Solspace. It's a free extension that allows you to run a template against your entries when you save them and store the output in a field.

Low actually talked about this on his blog in the context of Low Search, but you can use the same principle for the native search module as well.

I recommend taking a look at the blog post and setting Preparse up on your site. I've done it before, and it works great.

---
Tags: categories, search
---


# Question
Title: Different shipping rates to countries inside the UK
Our client has asked us to help setup different shipping rates for Northern Ireland in CartThrob. This poses a problem because Northern Ireland is classed as part of the UK and so it does not have a separate country code to match shipping rates to.

At present on our site we use the Multi Location Manager to set 'By Location - Price Threshold' for countries outside of the UK and 'Customer Selectable Rates' for everyone inside the UK, which offers Standard Delivery and Next Day Delivery options.

We would like to be able to offer Standard Delivery and Next Day Delivery options to Northern Ireland customers but at different rates to elsewhere in the UK.

Ideally, some kind of Table Rate would probably be best suited, so that we can match Northern Ireland postcodes (which all start with 'BT').

However we need to ensure we can still offer the Customer Selectable Rates to Northern Ireland customers.

# Answer
There are currently no available CartThrob shipping plugins that do what you require. You would need to create a custom shipping plugin.
> 1 votes

---
Tags: cartthrob, shipping
---


title: Hide Site ID from invoices

text:
# Question
Title: Hide Site ID from invoices
Since upgrading to CT2.5 I have started to get a Site ID value output with my order items tag in my invoice template. Is there a way to hide this?

# Answer
I'm assuming you're using an `{item_options}` tag pair within your `{exp:cartthrob:order_items}` tags in your invoice template. Something like:

```
{item_options}
    {option_name}: {option_value}
{/item_options}

```

Add a conditional to check for a "Site Id" `{option_label}` and only show the non Site Id options.

```
{item_options}
    {if option_label != "Site Id"}{option_name}: {option_value}{/if}
{/item_options}

```
> 4 votes

---
Tags: cartthrob
---


# Question
Title: Super Search returns no results with category parameter
I'm trying to filter results to a few channels and I want to exclude entries in the news channel with the category of "Internal News". The following returns no results.

```
{exp:super_search:results
    channel="not blog|breakouts|calendar|work|heros" sort_by="asc"
    limit="15"
    status="open"
    category="-Internal News"
    relevance="title=500+summary=10+body=2"
    relevance_proximity="yes"
    highlight_keywords="strong"
    smart_excerpt="yes"}
...
{/exp:super_search:results}

```

I've tried category="-internal-news" and I've tried the category filter in the search form with no luck.

# Answer
> 1 votes
Have you played with the `category_indicator=` parameter to make sure it's matching the way you are indicating your categories? I find it's always much more robust when using category url titles.

---
Tags: supersearch
---


# Question
Title: Low events field in Channel Form, customising
I'm trying to use the low events fieldtype within a Channel Form for users to submit events. If I use the field shortname `{field:myfieldname}` it works fine, but I am trying to customise the look of the fields/datepicker, mainly because the form is responsive and the EE styled datepicker breaks the design.

I have tried the same approach as what I would normally do with matrix, and have seen what HTML is outputted by the field.

```
<div id="low-events-120" class="low-events low-all-day" data-time-format="eu" data-time-interval="60" data-lang-decimal="." data-lang-mins="mins" data-lang-hr="hr" data-lang-hrs="hrs">
<input type="text" name="event_date[start_date]" value="2014-03-23" class="date start-date hasDatepicker" maxlength="10" id="dp1393520784651">
<input type="text" name="event_date[start_time]" value="" class="time start-time ui-timepicker-input" autocomplete="off">
—
<input type="text" name="event_date[end_time]" value="" class="time end-time ui-timepicker-input" autocomplete="off">
<input type="text" name="event_date[end_date]" value="2014-03-23" class="date end-date hasDatepicker" maxlength="10" id="dp1393520784652">
<label><input type="checkbox" name="event_date[all_day]" value="y" checked="checked"> All Day</label>

```

Now I have changed the class in order to target a different datepicker (using pickadate.js) and this works but it would not save the dates/times, so I'm not sure what else I would need to change? Presumably the values?

Also, I do not need an input for the end date/time as I only want the user to enter a single date and start time.

Any pointers on this would be greatly appreciated! Thanks!

# Answer
> 1 votes
Low Events expects the format of the both start date and end date to be `YYYY-MM-DD`. They both must be submitted. Also, the end date must be equal to or greater than the start date. The native JS (and styling) automatically changes the end date when the start date is modified. If you remove the class names, this check won't fire, so you'd have to do that yourself. You could hide the end date fields using `display:none` so the fields *are* submitted, but just not shown.

If you make sure these conditions are met, the values should be saved correctly.

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


# Question
Title: displaying spanish version of date while using transcribe
I am using transcribe and I was wondering if there is a way to display the entry\_date in spanish.

I could probably build a plugin that captures the entry date and returns the appropriate format based on transcribe's current language session, but I was wondering if there is anything out there first.

Thanks

# Answer
what you can do is to add some transcribe variables so you can generate language codes. make on like transcribe\_lang\_country with the value "en" and one like transcribe\_lang\_language with the value "US" (this is for the american english language version. I don't know the spanish ones)

then let the locale be determined by the browser by adding the country variable to the html:

```
<html class="no-js" lang="{transcribe_lang_country}">

```

This would let the browser render the time notation in the proper format. Mind you; EE wil render the date notation based upon the language settings of the logged in user. So to check if it works use another browser where you are not logged in.

Another nice little trick is when you are using validationengine on your forms you can get the error messages easily in the proper language by calling the right locale {transcribe\_lang\_country}\_{transcribe\_lang\_language}, which will render as en\_US

there is also the date/time convert addon from Carl Crawley that could help: http://devot-ee.com/add-ons/date-time-language-converter
> 1 votes

# Answer
I'm working on an add-on to do this and more but it's still in beta. If the code can help you, help yourself: https://github.com/tfitzgeraldca/Polyglot Any feedback is welcome.
> 0 votes

---
Tags: multi-language, transcribe, entry-date
---


title: Conditional PM Notification

text:
# Question
Title: Conditional PM Notification
Is there a way to send a member PM notification only if that member is not logged in the site?When the member is on the site, I show a growl notification to that member whenever that member receives a PM. In that case, there is no need to also notify the member via email. I'd like the PM notification email to only send when the member is not logged in. Is this possible?

# Answer
I had used Messaging addon much before and think it can work for you. Basically your main goal is "not to send PM email notification to member if logged in". Right? This addon is having a hook `messaging_pm_sent` by using which a small extension can be developed just return if member is logged in (no PM notification will be sent) or just a little hack can be put there.

I hope, it would help you.
> 3 votes

# Answer
I haven't used this, but it seems to have high reviews. Maybe you should try a plugin like :

http://devot-ee.com/add-ons/mx-notify-control

Otherwise I do not believe there is a way to anything like that natively in EE.
> 0 votes

---
Tags: members, email
---


title: Relationship fields in 2.7 as URLs

text:
# Question
Title: Relationship fields in 2.7 as URLs
Trying to link to pages as "Related Articles". Here is my code. The template is used to display the articles. My text, "Related Articles" is not showing either. Using EE 2.7. Any help is appreciated.

```
    <div class="sixteen columns mainContent redTop boxShadow">
    {exp:channel:entries category="{embed:pageCat}" limit="1"}

        <div class="text eleven columns alpha">

            <h1 class="blue borderBottom">{news_title}</h1>
            <span class="date orange">{entry_date format="%F %j, %Y"}</span>
            {if news_image}
                {news_image var_prefix="file"}
                <div class="pageImage right"><img src="{file:url}" alt="{file:alt_text}"></div>
                {/news_image}
            {/if}
            {news_text}

            {related_articles}
                {if related_articles}
                Related Articles:
                <ul>
                {/if}
                <li><a href="{site_url}/news/industry/{last_segment}">{related_articles:title}</a></li>
                {if related_articles:count == related_articles:total_results}
                </ul>
                {/if}
            {/related_articles}

        </div>

        {embed="includes/zipSearch"}

<div class="five columns sidebar right alpha">
    <div class="box boxShadow blueTop sideNav">{exp:channel:entries category="11"}
        <h4>Spread Awareness:</h4>
        {!--exp:navee:nav nav_title="main-site-nav" selected_class="selected"  parent_selected_class="selected" start_nav_with_kids_of_selected="true" start_nav_from_parent="true" start_nav_from_parent_depth="1" only_display_children_of_selected="true"--}
        {exp:navee:nav nav_title="main-site-nav" selected_class="selected" start_node="/spread-awareness/" start_nav_from_parent_depth="2" only_display_children_of_selected="true"}
    </div>

    {if "{related_video:count}" != ""}
    <div class="box boxShadow orangeTop">
        <div class="youtubeLink">
            <iframe width="420" height="315" src="//www.youtube.com/embed/{related_video}{related_video:video}{/related_video}" frameborder="0" allowfullscreen></iframe>
        </div>
    </div>
    {/if}
</div><!--end sidebar-->
    {/exp:channel:entries}
    </div><!--end mainContent-->

```

# Answer
> 1 votes
From the point that you probably always have related articles, you might try this:

```
Related Articles:
<ul>
{related_articles}
  <li><a href="{site_url}/news/industry/{last_segment}">{related_articles:title}</a></li>
{/related_articles}
<ul>

```

# Answer
> 1 votes
Here is the solution (hope this helps someone else):

```
                {related_articles}
                    {if related_articles:count == 1}
                    <h2 class="blue borderBottom">Related Articles:</h2>
                    <ul>
                    {/if}
                    <p><a href="{path="/spread-awareness/news/"}/{related_articles:url_title}">{related_articles:title}</a></p>
                    {if related_articles:count == related_articles:total_results}
                    </ul>
                    {/if}
                {/related_articles}

```

---
Tags: ee2, relationships
---


# Question
Title: display parent and children categories in a channel entry
I can't seem to find a way to display the parent and then the child category in a entry:

```
{exp:channel:entries channel="products" limit="6" }
<a href="{site_url}Products/detail/{categories}{category_url_title}/{url_title}">Details »</a>
{/exp:channel:entries}

```

this needs to display a link to domain.com/Products/detail/Parent-Category/Child-Category/url-title

I can only seem to get the parent to display

I also tried GW Categories with no luck:

```
<a href="{path="Products/detail/{exp:gwcode_categories entry_id="{entry_id}" style="linear" backspace="1" depth="1|2"}{cat_url_title}/{/exp:gwcode_categories}{url_title}"}">Details »</a>

```

# Answer
Solved

```
<a href="{site_url}Products/detail/{exp:gwcode_categories entry_id="{entry_id}" style="linear" backspace="1" depth="1|2"}{cat_url_title}/{/exp:gwcode_categories}/{url_title}">Details »</a>

```
> 1 votes

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


title: Using Multiple Live Rates Plugins

text:
# Question
Title: Using Multiple Live Rates Plugins
What's the correct way to pull multiple rates from multiple shipping plugins? I tried using the below but it generates errors:

```
<select name="shipping_option">
{exp:cartthrob:get_shipping_options shipping_plugin="shipping_ups|shipping_usps"}
    <option value="{rate_short_name}" data-price="{price}" {selected}>{rate_title} - {price}</option>
{/exp:cartthrob:get_shipping_options}
</select>

```

Am I using the shipping\_plugin parameter incorrectly?

# Answer
That get\_shipping\_options tag only accepts one argument for the shipping\_plugin parameter.

You can only have one shipping plugin active at a time. If you need both UPS and USPS options available at the same time, you'll need to combine those two plugins into a single plugin.

You can allow selection between those two shipping plugins using the multi\_location\_manager and custom\_data. https://github.com/CartThrob/addon-multi-location-settings-manager

You could trigger the plugin update using an update\_cart\_from.

```
{exp:cartthrob:update_cart_form}
    <select name="custom_data[set_shipping]">
        <option value="shipping_ups" {if custom_data:set_shipping == "shipping_ups"}selected{/if}>UPS</option>
        <option value="shipping_usps" {if custom_data:set_shipping == "shipping_usps"}selected{/if}>USPS</option>
    </select>
    {exp:cartthrob:get_shipping_options}
    <input type="submit" value="Update Shipping Options" />
{/exp:cartthrob:update_cart_form}

```

The settings in the multi\_location\_manager would look like this:
> 0 votes

---
Tags: cartthrob
---


title: moving site cannot see templates

text:
# Question
Title: moving site cannot see templates
So on my local server I can see my templates

http://mylocalhost.com/site/aboutus

I moved my site to another (staging server) and these templates have disappeared.

Any ideas? I have updated the Server path to site's templates and have synced the templates and all is good there.

edit: created a test template and /site/test is not visible either

# Answer
> 1 votes
Thanks for the replies it was not an EE error but a problem with the mod\_rewrite on the Apache server

# Answer
> 0 votes
Although you already mentioned your what your answer was. Always follow the steps described on this page.

http://ellislab.com/expressionengine/user-guide/operations/moving.html

---
Tags: ee2, server-migration, hosting, localhost
---


# Question
Title: Photo gallery with select list that displays different content
I am going to try an explain this as best as I can, it is a pretty broad question of which I a still working out the logic (before I try coding). I figure I will ask in here to see if anyone has dealt with anything of the like.

I am creating a photo gallery with a small select list at the top that lets you switch between designated sections of photos (I was thinking I could apply categories or something like that). I'm wondering if there is some kind of way to do this with EE logic, have a select list with the category names in them that feed into an entries channel below it with the pictures themselves maybe? Anyone have a foot in the door with something like this?

Thanks!!

# Answer
For your drop down,

```
{exp:channel:categories channel="whateveryourchannelis" style="linear"}
<option value="{category_id}">{category_name}</option>
{/exp:channel:categories}

```

Then when you are outputting the images put the category id's for the entries in a data attribute. Bind a on change event to the select field. Then used jquery to hide all the entries that are not in the newly selected category.

There are many other ways to do it with if you wanted a page refresh. I would recommend studying the documentation a little more and maybe browsing around on this site to get a handle on how ee categories work. Once you understand there are some really cool things you can do with ee.
> 3 votes

# Answer
Assuming each photo is a channel entry, and you are grouping them based on category, this should be pretty easy.

```
<select class="group">
  {exp:channel:categories
    category_group='1'
    channel='gallery'
    disable='category_fields'
    show_empty='no'
    style='linear'
  }
    <option value="{path='gallery/view'}"{if segment_3 == category_url_title} selected{/if}>{category_name}</option>
  {/exp:channel:categories}
</select>

<section class="gallery">
  {exp:channel:entries
    channel='gallery'
    disable='pagination|member_data'
    require_entry='yes'
  }
    {if no_results}
      {redirect='404'}
    {/if}

    <img src="{gallery_img}" alt="{title}">
  {/exp:channel:entries}
</section><!--/.gallery-->

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
  $('select.group').change(function(){
    window.location = $(this).val();
  })
</script>

```

This will reload the page to the updated category URL, and the channel entries tag will dynamically display only photo entries that are in that category.

If you wanted to get fancy, you can use ajax to load the updated photo listing without a page refresh.
> 0 votes

---
Tags: ee2
---


title: Login as Member not working

text:
# Question
Title: Login as Member not working
Since updating to v2.6.1 I am no longer able to login as another member. If I log in as a Super Admin and search for a user I can still click on the "Login as Member" link. I am taken to the next screen and offered radio buttons, which I select "Control Panel". It now ask for "You must submit your current Super Admin password to continue" which I provide and then I go to the main login screen. Anyone else having this issue? Hard to troubleshoot user issues without being able to login as the user occasionally.

Thanks!

Guy

# Answer
> 1 votes
The radio buttons I get are

* Site Homepage
* Other

Followed by a text box to enter the URL for the "Other" location to be redirected to. I'm then redirected to the desired location. Maybe there is something strange in the choice of radio buttons you have?

# Answer
> 1 votes
Not a technical solution, but I've found that if I don't select either of the radio buttons I'm able to login as the user (redirected to the homepage as them).

Hope this helps, Paul

---
Tags: members
---


# Question
Title: Stash : Can I pass a stash_list into a stash:embed file?
I'm trying to pass in a stash list into my embed file. It does seem to pass in the values but outputting the result does not seem to work.

Master Template:

```
    {exp:stash:set_list name="hours_list" parse_tags="yes"}
    {tunnel_hours}
        {stash:item_day}{day}{/stash:item_day}
        {stash:item_hours}{hours}{/stash:item_hours}
    {/tunnel_hours}
{/exp:stash:set_list}
{stash:embed:inc:sidebar-services-tunnels stash:hours="{stash:hours_list}"}

```

Embed Template:

{stash:hours\_list} creates the following

```
item_day|=|Monday|&|item_hours|=|9-6|+|item_day|=|Tuesday|&|item_hours|=|9-6|+|item_day|=|Wednesday|&|item_hours|=|9-6|+|item_day|=|Thursday|&|item_hours|=|9-6|+|item_day|=|Friday|&|item_hours|=|9-6|+|item_day|=|Saturday|&|item_hours|=|10-8|+|item_day|=|Sunday|&|item_hours|=|10-8

```

This displays nothing:

```
        {exp:stash:get_list name="{stash:hours_list}"}
        <h1>{item_day}</h1>
        {item_hours}
    {/exp:stash:get_list}

```

# Answer
> 1 votes
Shouldn't the list name just be hours\_list in the get\_list? Or are you deliberately using a stash variable for the list name?

That is, if you're using that set\_list above, then

```

{exp:stash:get_list name="{stash:hours_list}"}

```

Should be

```

{exp:stash:get_list name="hours_list"}

```

...unless you're trying to actually name your list as the contents of {stash:hours\_list}

---
Tags: stash
---


# Question
Title: how to put a category condition with exp:query?
```
{exp:query sql="my query"}

{/exp:query}.

```

This works fine.But I want to give a category condition to it.When I do it,it does not flter the data accordingly.

for example:

```
{exp:entrie:channel category="2"}

```

# Answer
With `{exp:query}` you'll need to spell things out. The actual query, will be dependent on what other data you are pulling via the custom query, but generally speaking, you'd want to also match the category id, `{cat_id}` to an `{entry_id}`.

For example, if I wanted to return just 10 random titles from the 'office supplies' category. I'd first look up the category id for 'office supplies' and 'desks' and learn that that the ids are 20, and 120.

```
{exp:query "SELECT t.title, t.entry_date, p.cat_id FROM exp_channel_titles t LEFT JOIN exp_category_posts p ON t.entry_id = p.entry_id WHERE p.cat_id IN(20, 120)"}

{/exp:query}

```

This assumes that the original query is fairly simple, and you're just limiting the results. But if you need to display the actual category name or already have a fairly complex query, then you'll need to or want to adjust which tables you join first, and how, you may even need a subquery.

But the basics of the query will hit the `exp_category_posts` table, since that's the table that joins relates an entry\_id to a category\_id. Category names are stored in the `exp_categories` table, etc.
> 0 votes

---
Tags: ee2, conditionals, query, categories, advanced-conditionals
---


title: Wygwam Link List - Hide Hidden Enteries

text:
# Question
Title: Wygwam Link List - Hide Hidden Enteries
We have an instance of wygwam.

When the user clicks the link button a list of all entries comes up for the user to choose from.

This list contains both open and closed entries, is there a way to hide the closed enteries and only allow linking to open entries?

# Answer
> 0 votes
I spoke to the makers of the plugin and they confirmed that this is not currently possible and have logged it as a feature request.

---
Tags: wygwam
---


# Question
Title: Fatal error: include(): Cannot redeclare class headings_rte
Hi guys I'm having trouble with a site I just took live. I had it running on MAMP without issues and now I'm getting errors regarding the headings\_rte. This is the one that is most persistent:

```
Fatal error: include(): Cannot redeclare class headings_rte in /srv/www/domain.com/sys/expressionengine/modules/rte/models/rte_tool_model.php on line 155

```

I couldn't find anything via Google or in the EllisLab forums.

# Answer
> 1 votes
My first suggestion is to reupload all files to the server. You can start with all files under the /srv/www/domain.com/sys/expressionengine/modules/rte/ directory. Something could be missing or was corrupted on upload.

My second suggestion is to make sure you are running the latest version of EE and addons. EL just released a new version so upgrading may solve your error.

My third suggestion is to look at line 155 of that file to see what the code is doing. That might give you some hints. It's very possible the issue is related to your server environment since no one has reported the error anywhere. Here are links to other "Fatal error: include(): Cannot redeclare class" errors.. Not the same specific file errors but these might offer some clues:

https://stackoverflow.com/questions/5611219/fatal-error-cannot-redeclare-class-customer

https://stackoverflow.com/questions/708140/php-fatal-error-cannot-redeclare-class

https://stackoverflow.com/questions/12222305/fatal-error-cannot-redeclare-class-net-ssh2-in-var-www-phpseclib-net-ssh2-php

# Answer
> 1 votes
Ok guys figured this out but don't know why it's happened in the first place but all I did was uninstall all modules and reinstalled and now there error does not pop up.

# Answer
> 1 votes
You need to put classes into "library" files (as opposed to "code" files) and always do require\_once or include\_once on them. Once you separate code from libraries, the next logical step is to switch to using autoloader mechanism of PHP.

If not possible, then put wrapper around the classes you are loading:

```
if (class_exists('headings_rte') != true) {
    class headings_rte { ... }
}

```

ah, and never mix autoloading with explicit require\_once - this is recipe for trouble.

---
Tags: error, rte
---


# Question
Title: How can i set AND conditionals on Switchee?
Sorry but I'm unable to use switchee.. how can i set AND conditionals?

this is my original code:

```
<!--The Categories Page ////////////-->
{if segment_2=="" AND segment_3==""}
{embed="travels/travels"}

<!--The Category Entries Page //////-->
{if:elseif segment_2!="" AND segment_3==""}
{embed="travels/trip"}

<!--The Single Entry ///////////////-->
{if:elseif segment_3!=""}
{embed="travels/trip"}

{/if}

```

thanks!

# Answer
> 2 votes
It's easy, actually. You can concatenate both segments. I used to use some RegEx for this, but I just got the idea to take advantage of the parsing order.

Please, try this:

```
{exp:switchee variable="{segment_2}/{segment_3}" parse="inward"}
    {case value="/"}
        {embed="travels/travels"}
    {/case}
    {case value="{segment_2}/"}
        {embed="travels/trip"}
    {/case}
    {case value="{segment_2}/{segment_3}"}
        {embed="travels/trip"}
    {/case}
{/exp:switchee}

```

There's no performance gain by using switchee on this case because the embeds are parsed after the advanced conditionals.

---
Tags: switchee
---


# Question
Title: Problems to display average rating with Solspace Rating
I need some help, about Solspace Rating,

If the entry named **hamburger** was rated 20 times, there are 20 **Entry's Rating** with the **hamburger** name, in the Rating's Control Panel.

When I Using this code, the 20 **Entry's Rating** of the Hamburger **Rated entries** are displayed on 20 lines. How to display only one line, and not all the entries, where appear the average note of all the hamburger **Entry's Rating** and of the other ones?

```
{exp:rating:entries}
        <ul>
            <li>
                {exp:rating:stats entry_id="{entry_id}"}
                     {stars_avg_rating}
                {/exp:rating:stats}
            </li>
        </ul>
{/exp:rating:entries}

```

**Update:**

Using this code, appear the average's notes of the **Rated entries**

```
{exp:channel:entries channel="receitas"}
    {exp:rating:entries limit="1" }
            <ul>
                <li>
                    {exp:rating:stats entry_id="{entry_id}"}
                         {title}{stars_avg_rating}
                    {/exp:rating:stats}
                </li>
            </ul>
    {/exp:rating:entries}
{/exp:channel:entries}

```

Does exist a more direct method than parsing **exp:rating:entries** inside **exp:channel:entries** ??

# Answer
I think you can do it like this:-

```
<ul>
    {exp:channel:entries channel="receitas"}
        <li>
            {exp:rating:stats entry_id="{entry_id}"}
                {title} - {stars_overall_avg}
            {/exp:rating:stats}
        </li>
    {/exp:channel:entries}
</ul>

```
> 0 votes

# Answer
Andrew,

the problem was independent about the `<ul>` position , all the Rating's entries was displaying. I found a better solution than to parse inside **exp:channel** in this case: using **{exp:rating:rank}** instead **{exp:rating:entries}**, no need more exp:channel:entries.

```
<ul>
{exp:rating:rank}
        {exp:rating:stats entry_id="{entry_id}"}
               <li>
                    {exp:rating:stats entry_id="{entry_id}"}
                         {title}{stars_avg_rating}
                    {/exp:rating:stats}
                </li>
                {/exp:rating:stats}
{/exp:rating:rank}
</ul>

```
> 0 votes

---
Tags: solspace-rating
---


# Question
Title: feel stupid, but, how code checkbox in form?
I do not understand why the examples in the manual not work. Here in the forum I do not see the ricgt code as well. I feel stupid.

I have a field, defined as checkboxes, values populated by other field. (I do not know how many values my client fills in there)

Please, how do I code this in my form? In the form, when coding {MYFIELDNAME} it just puts out all the values, no checkboxes there. This code does not work either:

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

```

# Answer
> 0 votes
Second time lucky!

I believe that Hansl was actually trying to have a check box field populate CartThrob item options.

That can be achieved by replacing his code with...

```
<select name="item_options[maat]">
  {maat}
    <option value="{item}">{item}</option>
  {/maat}
</select>

```

# Answer
> 1 votes
Don't feel stupid! You were very close.

The only thing you need to change is the `ID` and `name` attributes don't need the `{}`'s around them.

It should work if you make it...

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

```

---
Tags: cartthrob, checkbox
---


# Question
Title: Freeform: sending Composer form submission notification to a dynamic email address
I have a Contact Us form that is being generated in Composer and being assigned to my template via the Freeform Fieldtype. The template code simply uses the custom\_field name:

i.e. {modal\_form}

The form has a select statement that allows the user to select a location. Depending on the user's selection I would like that location to be notified via email of the form submission. Currently the site administrator has to manually forward the email to the correct location.

Is this possible?

Thanks.

# Answer
> 0 votes
Have you tried a Dynamic Recipients field on Composer?

It allows you to set a select drop-down which impacts the recipients of the email.

---
Tags: solspace-freeform
---


title: Forgot Password with Ajax

text:
# Question
Title: Forgot Password with Ajax
Is there anyway to implement Forgot Password with Ajax. I tried the Authenticate but it doesn't working properly with EE v2.7+. Could anyone please help me.

# Answer
You could probably load in http://ee-zoo.com/docs/visitor/examples/forgot\_password.html dynamically with Ajax into another template with relative ease.

Perhaps you could adjust http://ee-zoo.com/docs/visitor/examples/login\_ajax.html and call it in at an appropriate time.

If that's not quite right for you, could you clarify what you're after with the ajax implementation? It's a little ambiguous at the mo.
> 1 votes

---
Tags: ajax, forgot-password
---


title: Synchronize Assets with AWS

text:
# Question
Title: Synchronize Assets with AWS
I'm currently using EE 2.7.3 and Assets 2.2.2 with AWS (Amazon Web Services), which works beautifully, however when I removed a few files off AWS, the files are still visible after weeks on my EE install. Is there a way to resynchronize Assets and AWS so that the files I deleted off AWS are no longer being shown in Assets?

# Answer
> 1 votes
Have you pressed "Updated Indexes" in the main Assets module screen (rather than the field type)?

---
Tags: assets, pixelandtonic
---


# Question
Title: How to pass variables and then display the results?
Is there a plugin, technique, or combination of plugins/techniques that will allow me to do the following?

---

My channels are like this:

Parent: Product

Children: Colour, Size, Style, etc.

---

A search form with user-selectable fields such as these (or indeed hard-coded navigation menu links) - some of the fields are relationship fields:

Product

Colour

Size

Style

Min Price

Max Price

Stock status

---

..which would presumably result in a string such as ?size=M&min-price=100&stock-status=Y (or perhaps /medium/100/Y)

---

And then a results page with logic such as this:

{if

product="product" AND product\_colour="colour" AND product\_size="size" etc.

}

{/if}

---

Also, apparently I would need the conditional to parse early, as I'm displaying the resultant data in a grid that depends on a Switch tag to add closing divs to rows.

Would be v grateful for any pointers, however general they may be.

# Answer
> 1 votes
Try the Wires addon. Mark, who created switchee and ifelse, is yet writing the docs and improving the code, but, by my tests, it's stable.

# Answer
> 1 votes
You're basically just looking for a way to filter down channel entries based on a filled out form. Take a look at either Solspace's Super Search or my own Low Search. Both should be up for the job.

---
Tags: variable
---


title: create a link to admin area

text:
# Question
Title: create a link to admin area
I want to create a link from the font side of my site to the admin area.

The problem is the session id

```
<a href ="admin.php">go to admin</a>

```

This goes back to the login page even though I am logged in, how can I achieve this.

# Answer
You can use the `{cp_session_id}` global variable to create a control panel link. See the documentation here.

```
{if logged_in_group_id == "1"}
    <a href="{cp_url}?S={cp_session_id}">go to admin</a>
{/if}

```
> 2 votes

---
Tags: ee2, sessions, admin, links
---


title: Paybox integration expresso

text:
# Question
Title: Paybox integration expresso
I was wondering if anyone out here has tried to integrate paybox as a payment service for expresso store so far? I'm about to start working on the integration but if someone already made an attempt I would like some feedback before starting. :-)

# Answer
> 1 votes
One or two people have enquired about it but I haven't seen or heard of any completed gateways for Paybox as of yet.

If you're looking to create your own then feel free to look at Store Check to get an idea of how that gateway is put together and integrated as it's own extension. The other gateways that ship with Store will also provide a good starting point so give that a go and contact support@exp-resso.com if you need any tips along the way.

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


# Question
Title: Javascript error EE 2.8: Uncaught TypeError: Object 132 has no method 'replace'
I just upgraded to EE 2.8. I know it's brand new, but I'm already having an issue that I can't seem to fix.

On the publish page, and when adding a field to a field group, I see the following error in the developer log:

> "Uncaught TypeError: Object 132 has no method 'replace'"

JS features don't seem to work on the publish pages, and when I try to add a custom field to a field group, I can't customize any fields. No matther which field I choose, I just get the name and description options, but no ability to customize the actual field properties. For instance, if I choose relationship field type, I don't get the ability to customize the relationship settings. It just doesn't even show up.

I'm wondering if an installed module is conflicting, but I'm not quite sure how to find it. Anyone else having an issue with 2.8 like this?

# Answer
> 3 votes
The error has been confirmed as a bug in EE 2.8.

Bug tracker: https://support.ellislab.com/bugs/detail/20165

The issue will be fixed in the next release, and a patch has been posted to the bug tracker for any who need it.

# Answer
> 3 votes
For my specific case, it appears to be addons such as Matrix and Assets by Pixel & Tonic that are causing this. By uninstalling the addons I was able to get rid of this error.

---
Tags: custom-fields, javascript, ee2-upgrades
---


title: matrix - using with channel fields

text:
# Question
Title: matrix - using with channel fields
I am creating a 'dashboard' for my users I use matrix to let them add their employment history.

They can update their profile via channel forms but

1 - how can I insert/add data into the matrix fields (examples if you have a link to one please.

1. is is possible to use the ajax style add row that I can when logged in as the superadmin in the EE backend?

# Answer
> 1 votes
If you use Profile:Edit you can simply insert your custom channel field `{field:user_grid}` and it will automatically insert all the HTML and CSS/Javascript required for this module that would normally be inserted into the back end.

---
Tags: ee2, matrix, channel-form
---


# Question
Title: uploading videos to youtube or vimeo ( Save link in entry ) possible ?
I'm about to make a backend for a contest where people should be able to upload assets(documents,videos,sketches etc ) in their contest entry form. Is there any smart way to get these videofiles uploaded automaticly to youtube/vimeo rigth/straight from the entry form ?

I know it would be better just to have them provide a video link. Just investergating if any of you know other options (so they dont need to create their own youtubve/vimeo account , and later have all the content one place) ? My idea was/is to have a private youtube/vimeo channel for all entry uploads, So they wont be able to see the other videos in the contest before winners are announced.

Anyone done something like this .. hint or guides ?

Cheers

# Answer
> 1 votes
I don't believe there's an off the shelf Vimeo or YouTube uploader available currently.

Would you be open to using Amazon S3 for storage? If so, you could use Pixel & Tonic's Assets which allows you to use S3 as a file upload folder.

# Answer
> 1 votes
If you use S3 you don't need youtube. CloudFront even has streaming http://aws.amazon.com/cloudfront/streaming/

---
Tags: file-uploads, uploads
---


# Question
Title: Using Freeform - have form errors display in modal window (Fancybox) without closing
I'm working on a form (using Freeform) that lives in a modal box (become a partner on this page: http://framework.tunnel7.com/partners

What I'm trying to accomplish is having the error messages displayed inline (I have those parameters in place) when a user hits submit in the same modal window.

What is happening now is on submit the modal closes and if you click on the become a member button again it displays with the errors inline (so it's working) ... but I can't see a way to keep the modal open if there is an error.

Is there a way to accomplish this that I'm overlooking?

# Answer
> 1 votes
I use the jQuery Validation Plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/

with Freeform and it works really well. With it, the form is not sent (no page reload) until all errors are gone, and there is a lot of flexibility in customising the validations.

# Answer
> 0 votes
You could use $.post() to submit the form, then give the user feedback based on the response you receive. If you get an error, you tell the user about it, either within the modal or on a dedicated error page. If the form submitted successfully you either update the modal right there on the page or redirect the user to some sort of success/thank you page.

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


# Question
Title: Looking for advice on “subscribing” to a user
I'm building my very first EE website and I am looking for some advice regarding email notifications based on user activity. I would like members to be able to “subscribe” to or "follow" other members such that when a member posts an article or uploads a document, anyone subscribed to that user will get an email notification. It looks like Postmaster might be a step in the right direction? Are there any other suggestions on how to get me started? Thanks.

# Answer
> 1 votes
I would suggest checking out the Friends module from Solspace. It has a lot of this functionality built in. I'm not sure about the email notifications though, so you'll have to research that part, and if it doesn't do it natively, I'm positive Postmaster can help with that.

---
Tags: email, postmaster, notification, subscriptions
---


# Question
Title: How to stop extra authentication with admin area
When I am logged in as any user on my EE site (including superadmins), when I click over to the admin area it forces me to login again. This happens even if I've just logged in 5 seconds earlier. Is there any way to prevent this extra authentication?

Thanks.

# Answer
> 1 votes
I don't think that's possible. It's there as a security feature.

---
Tags: admin, authentication
---


title: Custom payment gateway issues

text:
# Question
Title: Custom payment gateway issues
We're trying to write our own payment gateway plugin for store, using version 1.6.5

The payment gateway in question is the Croatian Webteh form (off-site) and we're having an issue with the landing page after the card gets processed on their server and the order payment status info gets sent back.

Webteh gives us the following parameters in GET after a succesful payment:

?approval\_code=938745&authent ication=&cc\_type=master&currency=HRK&custom\_params=&digest=9b345418cb4dd64a23f7459230079ba82d6e6331&enrollment=N&language=hr&order\_number=24&response\_code=0000

Where exactly (route) does store handle returns from the payment gateway? Webteh has a fixed url in their administration panel where it redirects successful payments - what should we redirect to? Our webshop is set up at http://www.example.com/webshop/. Should it be /webshop/checkout3?

We can't seem to figure out where purchase\_return method is called.

Thanks!

# Answer
I'm not familiar with the Webteh API specifically, but usually it is possible to specify a custom return URL for each payment.

With Store v1 (and CI-Merchant), you should set the return URL to the value of `$this->param('return_url')`, as you can see in the PayPal Express gateway. This URL will then trigger Store's payment return code, and pass control to the `purchase_return()` method on your gateway.

Note that in Store v2, Omnipay is used instead of CI-Merchant, which uses a similar but slightly different approach.
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Using Low Replace and Low Nice Date Together
The database has a string which is a date in the format of dd/mm/yyyy (13/03/2014). No, it has not been saved to the database as a proper date/time.

With Low Replace we are able to change the format of this to yyyy/mmm/dd

```
{exp:low_replace find="/(\d{2})\/(\d{2})\/(\d{4})/" replace="$3/$2/$1" regex="yes"}
  13/03/2014
{/exp:low_replace}

```

Is it possible to apply Nice Date to the date after Replace has done it's thing as nice date won't work with dd/mm/yyyy? Or do we need to use something like Stash to create a variable for Nice date to work with once Replace has converted it?

# Answer
> 0 votes
I'd recommend changing the value of the date field to dd-mm-yyyy so you don't need to use Low Replace, and instead can use the value directly into Low Nice Date. The query would look something like this:

```
UPDATE exp_channel_data SET field_id_X = REPLACE(field_id_X, '/', '-');

```

Where X is the field ID in question.

# Answer
> 0 votes
You might have luck with this...

```
{exp:low_nice_date date="{exp:low_replace find="/(\d{2})\/(\d{2})\/(\d{4})/" replace="$3/$2/$1" regex="yes"}13/03/2014{/exp:low_replace}" format="%F %Y" parse="inward"}

```

If that works, consider moving the low\_replace into a snippet so it's easier to read

```
{exp:low_nice_date date="{sn_fixed-date}" format="%F %Y" parse="inward"}

```

Hope that helps!

---
Tags: low, low-replace, low-nice-date
---


title: Syntax error, unexpected T_ENDIF

text:
# Question
Title: Syntax error, unexpected T_ENDIF
I have the following code in my templates:

```
{exp:channel:entries channel="cover" limit="5"}
    {if total_results > 1}More than one{/if}
        {covervid_bg_video limit="1"}{file:url}{/covervid_bg_video}
{/exp:channel:entries}

```

And here is the error that I get:

```
**Parse error**:  syntax error, unexpected T_ENDIF in
**/home/user34/public_html/dev/system/expressionengine/libraries/Functions.php(689) : eval()'d code** on line **718**

```

I tried the following variation with no success

```
    {if '{total_results}' > '1'}More than one{/if}

```

# Answer
> 1 votes
If it did work it would output "more than one" 5 times.

I'd use count instead, like this:

```
{if count==2}More than one{/if}

```

There's this is interesting article over at ellislabs from some years back but still relevant.

---
Tags: conditionals, ifelse, advanced-conditionals
---


# Question
Title: How to add a placeholder attribute to a Matrix cell in a SafeCracker form
I'd like to add a placeholder attribute to a textarea Matrix cell in a SafeCracker form (so I can add some placeholder text to the field that says, 'Add your feedback here...'), and I'm using EE 2.5.5 and Matrix 2.5.6.

I don't want to hack any of the Matrix files to do this, so was hoping someone might have used a JavaScript solution for this previously and be able to share the code.

Here's the front-end output for this particular Matrix cell, and the entire Matrix field is surrounded by a div with an ID of cf\_amendment\_details. Thanks for any help with this.

```
<td class="matrix matrix-last matrix-text"><textarea class="matrix-textarea" name="cf_amendment_details[row_new_0][col_id_19]" rows="1" dir="ltr"></textarea></td>

```

# Answer
> 0 votes
This is the JavaScript I've ended up using to add a placeholder to the first row of the Matrix cell:

```
$('#cf_amendment_details').find('.matrix-textarea').attr('placeholder', 'Add your feedback here');

```

Couldn't get it working for every row, due to how the rows are added on-the-fly, but this will be fine.

---
Tags: matrix, safecracker, javascript
---


# Question
Title: Channel entries fields in a list of checkboxes, with Freeform (or any other solution)
I have a website running EE 2.5.2 with Freeform Pro 4.0.6. The website is about events people can subscribe to. Freeform is currently used to subscribe to one event. All events are (of course) entries in a channel field.

I’m looking for a way my users can use a select multiple events from a list of checkboxes and do a ‘multi-subscribe’.

In Freeform, I found the ‘checkbox group’ field with ‘load from channel field’ option. But it just displays a list of titles. I would like to (at least) also include a date and order the choices by date. Possibly I’d like to also include a category field.

Any help, ideas or examples are appreciated!

# Answer
> 0 votes
You can create a checkbox group field based on the "load from channel field" option, which will create a list of checkboxes with either entry titles or content of a custom field as labels.

If you're looking for more flexibility, however, the only option available is to manually create your own checkbox group list in a template. This can be done by using the `{exp:freeform:form}` tag and creating your checkbox group using `{exp:channel:entries}`, `{exp:channel:categories}` or whatever tag you need to create the list.

For example, let's say you created a field (textarea) called `form_events`. You would create your dropdown like this:

```
{exp:freeform:form /* Your other parameters here */}

  <h3>Choose your events</h3>
  {exp:channel:entries channel="events" orderby="date" dynamic="no"}
      <input type="checkbox" name="form_events[]" value="{entry_id}" />{title} - {entry_date format="%Y-%m-%d"}<br />
  {/exp:channel:entries}

  // The rest of the form
{/exp:freeform:form}

```

This way you have control over the checkbox labels, the ordering, etc.

The above field example will save your selected "event" channel entries as newline-delimited entry\_ids in the `form_events` Freeform custom field. Please note that the brackets `[]` in `name="form_events[]"` are necessary in HTML forms to submit and save an *array* of form data.

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


title: Nested conditionals with Switchee?

text:
# Question
Title: Nested conditionals with Switchee?
I'm trying to use Switchee for this scenario:

```
{if variable_1}

    {if variable_2} some text {if:else} some other text {/if}

{if:else}
nothing to show!
{/if}

```

So, if i want to use Switchee i need to nest two plugins?

```
{exp:switchee variable="{variable_1}" parse="inward"}

    {case value="{variable_1}"}

        {exp:switchee2 variable="{variable_2}" parse="inward"}
            {case2 value="{variable_2}"}  some text {/case2}
            {case2 default="yes"} some other text {/case2}
        {/exp:switchee2}

    {/case}

    {case default="yes"}
     nothing to show
    {/case}

{/exp:switchee}

```

Help please! :) thank you

# Answer
> 4 votes
The nested instances of switchee **should not** have the `exp` prefix.

```
{exp:switchee variable="{variable_1}" parse="inward"}

    {case value="{variable_1}"}

        {switchee variable="{variable_2}" parse="inward"}
            {case value="{variable_2}"}  some text {/case}
            {case default="yes"} some other text {/case}
        {/switchee}

    {/case}

    {case default="yes"}
     nothing to show
    {/case}

{/exp:switchee}

```

Or you can test both variables at once:

```
{exp:switchee variable="{variable_1}/{variable_2}" parse="inward"}

    {case value="{variable_1}/{variable_2}"}
        some text
    {/case}

    {case value="{variable_1}/"}
        some other text
    {/case}

    {case}

    {case value="/"}
        nothing to show
    {/case}

{/exp:switchee}

```

---

You should know that `variable_1` and `variable_2` need to be parsed before switchee or this code **will not** work.

---
Tags: switchee, nesting
---


# Question
Title: Setting a Stash variable in the first Matrix row
I'm sure this has something to do with the parse order or it might be a bug. I'm trying to set a Stash variable in the first matrix row. After looking at the template debugging, Stash sets the variable in each loop of the matrix, thus not listening to the conditional.

```
{matrix_field}
    {if row_count == 1}{exp:stash:set name="my_var"}{option_value}{/exp:stash:set}{/if}
    ...
{/matrix_field}

```

If I add a static character inside the conditional, it only parses once.

**Update**

I added `replace="no"` parameter to the `stash:set` tag which fixed the variable from being overwritten once it's set. However, I would still like to know if setting the variable like the above is possible or if I'm approaching it the wrong way.

**Update 2**

I'm running a CartThrob site that has a ton of price modifiers (PM) for buying sheds online. A user can choose between several options, colors & other upgrades to build and buy a shed online. The site relies heavily on javascript which uses variables to construct files paths and other logic. Some PM fields I need to capture the 'default' options (first row of matrix field) to set variables for file paths and pricing logic. So instead of adding a ton of matrix pairs to the template where needed, I'm trying stay as DRY as possible. Hopefully that makes sense?

Live Example, view console to see some variables (soft launch right now as we are adding more styles)

# Answer
Maybe try wrap your code in an explicit parse block:

```

{exp:stash:parse parse_tags="yes" parse_depth="5" parse_conditionals="yes"}
...
{/exp:stash:parse}

```

(PS - your site is looking great!)
> 1 votes

# Answer
I asked Mark over twitter and he replied:

> @siebird usually (but not always) conditionals that are 'owned' by tags are 'prepped' but not actually evaluated until the end of parsing.

Which I did not know, so that explains the `stash:set` parsing every time through the matrix loop. As I stated above, adding the `replace="no"` parameter fixed the issue.
> 0 votes

---
Tags: matrix, stash
---


# Question
Title: Freeform file upload not in database table
Does anyone know why the filename or names do not always record in the freeform table? Ex. my form is located in exp\_freeform\_form\_entries\_1. the file field is form\_field\_22. But on many of my forms, this field is blank.

I'm using ff pro v.4.0.12

My code is below

```
        <p><label for="file_field0">Please upload your file: (File format: .docx or .pdf)</label>
                <input type="file" id="file_field0" name="file_field0[0]" class="required" /></p>

```

Any help is appreciated.

Peter T

# Answer
OK, I'm just about there. I was trying to combine multiple uploads into one field. So I am now using two file upload fields and the fields were successfully entered into the form database table.

My issue now is that on the update form (exp:freeform:edit), I am only able to view one of the files. My code is below:

```
    <fieldset>
    <p><label for="380"><strong>Statement of Interest</strong>: (File format: .docx or .pdf)</label>
            {freeform:field:file_statement show="1"}</p>

    <p><label for="379"><strong>Transcript</strong>: (File format: .docx or .pdf)</label>
            {freeform:field:file_transcript show="1"}</p>

        <input type="hidden" name="completed" id="completed" value="Yes">
    <p><input type="submit" name="submit" class="btn btn-primary" value="Submit" /></p>

</fieldset>

```

I can't find documentation that states how to view and update multiple files on the freeform:edit form. Any help is appreciated. Peter T
> 1 votes

# Answer
Can you post more of your template code? Does a file get uploaded? Are you saying that it works sometimes?

Im not sure why your name attribute has the '\[0\]'

I have a form and the input looks like this:

```
<p><strong>Attach file:</strong><span class="required_field">*</span>  <input type="file" name="file1" class="required" accept="doc|docx"/><br/>5 MB max. MS Word format .doc or .docx</p>

```
> 0 votes

---
Tags: solspace-freeform
---


title: Expresso Store: Item Title

text:
# Question
Title: Expresso Store: Item Title
I am attempting to create a repeater list for all the items in the cart, however I am having trouble generating the title and and custom fields.

```
{items}
                            {exp:channel:entries channel="product" entry_id="{entry_id}"}
                            <tr>
                                <td style="width:350px"><p class="item-title">{title}</p><p>Size: Large</p></td>
                                <td style="width:75px"><input style="width: 40px;" type="text" name="items[{key}][item_qty]" value="{item_qty}" /></td>
                                <td style="width:260px"><p class="item-title">{price}</p></td>
                                <td style="width:260px"><p class="item-title">{item_subtotal}</p></td>
                                <td style="width:75px; text-align: center;"><input type="checkbox" name="remove_items[{key}]" value="1" /></td>
                            </tr>
                            {/exp:channel:entries}
                            {/items}

```

All the short-tags used by the store function as expected, however all the titles and custom fields will only grab the data from the newest entry and repeat.

# Answer
> 1 votes
Found what the issue was, seems obvious to me now. I was using an exp:channel:entries tag wrapped around the template to generate the fields for the page itself (just title in this case), this of course caused an issue because I was calling another exp:channel:entries tag inside of it.

In order to get around this I would need to place the entire {exp:store:checkout} -- all the stuff --{/exp:store:checkout} in its own embed, not just the 2nd {exp:channel:entries} tag.

# Answer
> 1 votes
A great way to solve issues like this is to `{embed}` the script you wish to repeat.

For example:

```
{items}
    {embed="cart/_items.html"}
{/items}

```

and within your template, eg `cart/_items.html`

```
{exp:channel:entries channel="product" entry_id="{entry_id}"}
    <tr>
        <td style="width:350px"><p class="item-title">{title}</p><p>Size: Large</p></td>
        <td style="width:75px"><input style="width: 40px;" type="text" name="items[{key}][item_qty]" value="{item_qty}" /></td>
        <td style="width:260px"><p class="item-title">{price}</p></td>
        <td style="width:260px"><p class="item-title">{item_subtotal}</p></td>
        <td style="width:75px; text-align: center;"><input type="checkbox" name="remove_items[{key}]" value="1" /></td>
    </tr>
{/exp:channel:entries}

```

Embedding helps to eliminate issues causes when nesting loops in Expression Engine.

See Embedding Templates within Other Templates

---
Tags: expresso-store
---


# Question
Title: How to protect a field from being changed - Profile Edit
I am using Profile:Edit to display a form which allows the user to update and edit their profile. However I have some custom fields which I want to protect from being changed. I am not displaying these fields to the user, but if the user was to 'hack' the page by manually inserting an input text field into the page they are viewing (using the browsers inspector tool) then they can submit any field they like and profile edit will happily update the value (I have tested this).

How can I stop Profile:Edit from updating any field it receives via POST, and only update values I give it permission to update?

Let me know if you don't get what I mean.

# Answer
I'm not certain this is something you have to worry about, unless you are also somehow providing your database schema to the user as well. Generally speaking in EE a name field is rarely just called a `name` field, it might be called `profile-name` or `profile_name`. So if you had custom fields that you aren't displaying, then no one but you or other staff members should know what the names of the fields are.

I know we use naming protocols for field names, so that the field provides us with some basic info. Ours is simple, typically, channel\_field or channel\_field\_type, which might look like staff\_firstname or staff\_firstname\_text. But are labels are pretty standard, basically 'First Name'.

Though, I guess if it is still worrisome to you, you could probably add some javascript to verify the submit, only submits the fields you specifically want. You'd need to remember to update it, whenever you add or remove fields from the list though.
> 1 votes

# Answer
Another option, if this is a big security issue, is to build an extension that hooks into either Profile:Edit or the underlying Channel Form and validates the POST array before it is processed any further.

Take a look at the extension hooks available in Profile Edit and/or Channel Form and you find one that is called before the profile is updated. You can then just use the PHP `unset()` function to remove any offending data from the POST array.
> 1 votes

---
Tags: profile-edit
---


title: Moblog - Can't get the template to work

text:
# Question
Title: Moblog - Can't get the template to work
I'm really confused about this moblog feature. And I can't understand what the documentation tells me, I don't feel it distinguish how the moblog template should look like, and what the email template should look like. So basically, I'd like some info on how the Moblog Template in the Control Panel should look like, and how the email itself should look like, to correspond with the right fields.

I have these fields that I'd like to populate with the data from the email.

```
{moblog_image}, {moblog_photographer}, {moblog_latlng}, {moblog_facts}

```

My Moblog Template looks like this:

```
{field name="moblog_image" format="none"}
   {images}
      <img src="{file}" width="{width}" height="{height}" alt="pic" />
   {/images}
{/field}

{field name="moblog_photographer}" format="none"}{text}{/field}
{field name="moblog_latlng" format="none"}{text}{/field}
{field name="moblog_facts" format="none"}{text}{/field}

```

I'm really not sure if this is correct.. And below is how the email looks like:

```
{field:moblog_image}
image.png (image I paste in the email)
{/field:moblog_image}

{field:moblog_photographer}
John Appleseed
{/field:moblog_photographer}

{field:moblog_latlng}
3464,5896
{/field:moblog_latlng}

{field:moblog_facts}
Some facts
{/field:moblog_sekundaer}

```

Is this correct? What am I missing, because when I send this email and check the moblog, the entry contains basically the whole email, fields and all.

# Answer
> 1 votes
The Moblog module simply creates entries from emails. It is admittedly a bit finicky though.

Can you verify that the entries are being created in your channel from the emails that you have sent?

If so, then you simply output the entries using the `{exp:channel:entries}` tag pair, just like you would for any other channel entry.

---
Tags: templates, fields
---


# Question
Title: Why my Expression Engine default menus don't load?
I was running 2.6.1 and I logged in today (hadn’t logged in since june 2013), none of the EE menus are working. All the menus and buttons at the top do not work anymore. I upgraded to the latest version flawlessly but yet still none of the buttons or menus are working. It’s like the AJAX/jquery or whatever they use to show the menus isn't being loaded.

The sidebar will not expand either. The menus at the bottom of the control panel EE Info, Learning EE, News and Stats, & quick tips wont expand either.

When I edit an Entry none of the buttons work there either, ie: publish, date, ping, pages, revisions, etc.

They all load but there is no effect when I click on them. Yes I have tried uploading it all again. I even uploaded it and tried it as fresh install (as a new site) and they still didn't work. I have tried it on IE, Chrome, Firefox, Safari. None of the menus works. It doesn't make any sense to me really.

# Answer
> 0 votes
Ok this is the solution I finally found thanks to Ellis Lab and my webhost Eleven2. Ellis Lab discovered it was a 403 issue doing some testing on my account and I passed along the information to Eleven2 and they fixed it with the solution below. I hope this helps anyone else hosting on Eleven2 or anywhere else that's having this problem.

It was an issue with the mod\_security.

You can give the following lines in the .htaccess file of the account to fix the issue.

```
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

```

# Answer
> 0 votes
I had the same problem last month, the only solution I found was to download the new version 2.7.3 and start with a fresh install... Did you save your template files? It's easy to put it all back if you did!

Sorry can't give you a better solution! But time was running out for my client!

---
Tags: ee2
---


title: Users cannot access File Manager

text:
# Question
Title: Users cannot access File Manager
I have a site running v 2.5.3 which all of a sudden has come up with a ton of errors and is not allowing the users to manage files. The errors look like this.

```
A PHP Error was encountered
Severity: Notice
Message: Undefined index: 1
Filename: cp/content_files.php
Line Number: 369

```

There's probably 30 errors in that file. Which then ends with

```
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /Applications/AMPPS/www/ruffinos_lafayette/system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 412

```

Super Admins have the ability to access this just fine, it's just users. I've deleted members, created new member groups, etc. Nothing has worked.

# Answer
> 1 votes
The issue was that the member had the ability to change file upload preferences on their own. They used that power to remove their own access and so the system was confused.

---
Tags: members, file-uploads, error, file-manager
---


# Question
Title: Weird pagination issue with test domain appearing in links!
I've just updated EE from 2.5.3 to 2.7.3 and gone from a local testing environment (using Focus Lab Master Config) to a remote server. All works great apart from in my search results (using Low Search). If I click past the second pagination link, the link starts with my local test domain!!! WTF?!

I've done a DB dump and tried to grep to find any instances of this local address and the only thing I see is in the developer logs.

Has anyone ever come across anything like this?

I've cleared the contents of my ee cache directory as well. No joy.

# Answer
> 4 votes
So thanks to Low stepping in and doing some testing with me, we worked out that the problem was down to an extension hook for Structure that was messing up ALL pagination across the site.

Low performed the following sql query to find the hook in question:

```
SELECT * FROM exp_extensions WHERE hook = 'channel_module_create_pagination'

```

and then removed the Structure hook with the following query:

```
UPDATE exp_extensions SET enabled = 'n' WHERE extension_id = 148;

```

Note that in my particular case the Structure related extension\_id was 148 - yours will no doubt be different (should anyone else come across this).

Now that is removed, all appears to be working as expected again.

# Answer
> 1 votes
Try completing the Comment Page URL fields in Channel Preferences. It's what Low Search uses for auto paths to multiple channels. Then double check it's not being overridden in FLMC.

# Answer
> 1 votes
It sounds like your local domain pp.dev has been saved in the database as the site url and it's either not being overridden properly by your config or LS is using the db version.

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


# Question
Title: Problems with Assets 2.1.3 when upgrading - throws db error
I'm trying to upgrade to version 2.1.3 of Assets but during the update process it throws the following error:

A Database Error Occurred Error Number: 1265

Data truncated for column 'folder\_id' at row 330

ALTER TABLE exp\_assets\_files MODIFY COLUMN `folder_id` INT(10) NOT NULL AFTER `file_id`

Filename: third\_party/assets/upd.assets.php

Line Number: 549

---

Once this happens I have to restore the db to get the site running again. Is there a fix for this?

I am using EE2.6.1, PHP 5.4.14 and MySQL 5

Thanks, Dave.

# Answer
Follow-up and fix from P&T support... 'about to be' released v2.2.5 solved the issue.

> the most common error for this is because some of the files that are registered for Assets fields are missing and during the update to Assets 2.x, Assets does not know where in folder structure the file belongs, so it gets a folder\_id of NULL. After that, there's a migration that sets the folder\_id column to NOT NULL, so that produces the error you're having about data being truncated.
>
> Then, when you run it again, some tables have been modified already, but Assets begins the process anew and that produces the second error :)
>
> Try the attached 2.2.5 version which is not yet released - it should work for you. You will have to revert the DB to the state it was before the failed update, though.
> 1 votes

---
Tags: assets
---


# Question
Title: Finding related Transcribe entries for use with Playa and Structure
I have a site set up with 2 languages using Transcribe and Structure and I am now adding a third. One section is a stockist list. The only way I could get this to work, without having to double/triple up on entering stockist information which is the same for each language, was to enter each stockist via the Publish tab (not using Structure) and then link it to the relevant country's state for each language (set up using Structure), using a Playa field (see at the bottom of this question). However, this is very cumbersome and a pain for my client to have to select the same named state for each language.

**English tree in Structure:**

**French tree in Structure**

Now that I am adding another language the problem has become worse. I now need to revisit every single stockist and chose the related state for the NEW language in the Playa field! Surely there must be an easier way? Is it possible to find the ID's of the related entries in the different languages so that I only need to choose the English entry and the French and German (and any other new language) are automatically selected as related? And then add this to my template somehow?

**Current Playa field in the Stockist entry Publish tab. Cumbersome.**

Thanks in advance for your help - I hope my explanation is clear!

# Answer
> 1 votes
Could you use some kind of entry duplication add-on and only change the desired fields?

---
Tags: playa, structure, transcribe
---


# Question
Title: Two different layout for the same template
I was wondering.. can I use the same template to display the page in two different layouts?

and how you can switch from one layout to another without adding any segment?

it would be nice for me to use a simple query url, so that you have:

```
http://mysite.it/portfolio?=list

```

or

```
http://mysite.it/portfolio?=thumb

```

How can I adopt this solution? Thank you!

---

EDIT: This is a solution found (thanks to Andrew Fairlie and Jean St-Amand):

```
{exp:switchee variable="{get:view}" parse="inward"}
    {case value="grid" default="yes"}
        {switchee variable="{get:tag}" parse="inward"}
            {case value="{get:tag}"}
                <div data-role="infinite-scroll" class="block-stack">
                {embed="portfolio/embed-tags"}
                </div>
            {/case}
            {case default="yes"}
                <div data-role="infinite-scroll" class="block-stack">
                {embed="portfolio/embed-ajax" infinite_scroll_vars="category_id|category_name|segment_1|segment_2" infinite_scroll_values="{segment_2_category_id}|{segment_2_category_name}|{segment_1}|{segment_2}"}
                </div>
            {/case}
        {/switchee}
    {/case}
    {case value="list"}
        <div data-role="infinite-scroll" class="block-stack">
        {embed="portfolio/embed-ajax-list" infinite_scroll_vars="category_id|category_name|segment_1|segment_2" infinite_scroll_values="{segment_2_category_id}|{segment_2_category_name}|{segment_1}|{segment_2}"}
        </div>
    {/case}
{/exp:switchee}

```

# Answer
> 2 votes
I'm assuming you're referring to EE 2.8 layouts.

It isn't possible to process layouts within a plugin or module tags so using an if statement or Switchee isn't going to work **within the template itself**.

However you could use something like Switchee as Jean St-Amand mentioned **within the layout** to provide variations of that layout depending on the string.

You could use the Mo'Variables `{get:parameter}` tag to get it.

So your *layout template* may look a bit like...

```
{exp:switchee case="{get:view}"}
    {case value="list" default="yes"}
            {!-- Do whatever you need to do here --}
    {/case}
    {case value="thumb"}
            {!-- Do whatever you need to do here --}
    {/case}
{/exp:switchee}

```

However you might find it better to look into EE 2.8's new template routes which allows you to serve up different templates and layouts based on the URL.

If you're worried about duplicate content with these 2 URLs you could set the canonical tag to be your preferred 'default' view.

Alternatively, this may be a job better suited to Stash lists.

**Useful pages**

# Answer
> 2 votes
Seems like you ought to be able to handle it with switchee using regex to determine which layout scenario is present in your URL, for example. I'm not a regex wiz so I won't pretend to know what patterns you would need - but it's switch case logic coupled with its support for regex is what made me think of it as a possible answer for you.

---
Tags: ee2, templates, querystring
---


# Question
Title: Deleting Channel Entries in the Frontend
Deleting channel entries is pretty straightforward in the EE Control Panel.

But how do I do it via the frontend? Do I need to use the Channel Form tag?

Or is there a native EE tag specifically for this?

# Answer
There isn't a built in method for this, not even with channel forms to my understanding.

My first thought was to have a template such as `/delete/{entry_id}/` where `{entry_id}` is what you wanted to remove. Of course, that template would need to check you had the correct permissions.

That template would have an `{exp:query}` module which would run the SQL to delete the entry. **But that isn't possible** because `{exp:query}` only allows for `SELECT` statements.

The alternative is to write a simple plugin `{exp:delete entry_id="segment_1"}` which would run that SQL for you.

**But I don't think any of this is a good idea.** It feels like it could open up security problems.

The control panel's deleting is based on permissions and is well rounded; a front-end solution is likely to fall short.
> 1 votes

---
Tags: channel-entries
---


title: Suitable e-commerce add-on?

text:
# Question
Title: Suitable e-commerce add-on?
I am looking for some advice if anyone can help please.

I have a potential project coming up that I would like to use EE CMS for with the addition of an e-commerce add-on, either CartThrob v2 or Store v2.

I have previously used both add-ons so I don't mind which one I use, however the project brief has a few areas that I am unsure of the best approach to build. Please see below:

1. Recently viewed products
2. Product search filter (e.g. by size and or colour)
3. Request a quote (for items that are not for sale due to complex variations, customer would add to a basket still but then send off for an email quote. Possibly using CT Wishlist?)
4. Powerful site search for searching content as well as products again with filters
5. Provide category gallery or list view with sortable column headers
6. Dynamically created pdf datasheet, taking the products tabbed description/content and providing the customer with a link on the fly using the HTML/CSS

Any thoughts on how to provide the above 6 items with either add-on would be appreciated. Looking through on first glance maybe CartThrob would be the best bet with it's wishlist add-on for the quote aspect?

Thanks, Wes

# Answer
> 2 votes
# Recently Viewed Products

As far as I'm aware neither platform does this directly, but because both store product information in ExpressionEngine channels you could use a plugin such as http://devot-ee.com/add-ons/recently-viewed-entries to achieve this.

# Product search filter & Powerful site search for searching content as well as products again with filters

You'd probably have better luck with something like Super Search or Low Search using categories to filter products.

# Request a quote

Exp:resso Store v1 had a quotation add-on (http://devot-ee.com/add-ons/store-quotations) but it's been discontinued.

I think you might struggle to pull this off elegantly in the basket and sounds like it could be a complicated user experience. Could it be simplifed so if they press "add to basket" on a product that needs a quotation they fill out the form on that page?

If so you could set a field in the product channel (maybe a P&T Switch) that lets you display either an "add to cart" button or a "request a quotation" button as appropriate.

# Provide category gallery or list view with sortable column headers

This is more of a UI issue than an add-on one. You could use URL Segments or cookies to remember the user's preferred sorting options and use if statements or Switchee to modify how the product category pages look. Either platform will be fine.

The last time I used CartThrob is was a bit of pain to do sorting because of how they stored data. Exp:resso Store have a really nice search tag that makes this really easy: https://exp-resso.com/docs/search\_tag.html

# PDF Datasheet

This could be created on either platform by having a template that generates the datasheet in HTML and then use something like http://devot-ee.com/add-ons/shine-pdf to convert it into a PDF.

---
Tags: expresso-store, cartthrob, ecommerce
---


title: View Count not working

text:
# Question
Title: View Count not working
I was using view count on one of my templates, and recently I noticed it had stopped working. The only thing which is different about my set-up since the last time i noticed it was working was

1. I am now using Focus Lab's Master Config instead of the regular config file
2. I have set up both APC and Memcache, to speed up the site.

Will any of these things stop view count from working and if so, is there a way around it?

I have added `$env_config['relaxed_track_views'] = 'y';` to the master config file but no success so far.

# Answer
> 1 votes
Are you using Ce Cache? If your cache is delivering pre-rendered flat content then your channel entries tags are going to get bypassed, and your count won't increment. If you check your viewcount, empty the cache and request that page again does your count increment?

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


# Question
Title: Detect user is coming from which country?
There are some channels in my table that will give different data which will vary with different countries. I want to detect it at the very begining.I did see some free pulgins but are very complicated to use.

I dont want to store users ip.Just want to detect their country?

Can anybody help ?

# Answer
EE have native IP 2 nation module
> 1 votes

---
Tags: ee2, module, plugin, ip
---


# Question
Title: PDF Press and generated PDF header/footer part
I have working PDF Press generator which uses save\_to\_pdf method because I need to have a name of generated PDF based on an entry title.

Based on DOMPDF FAQ https://code.google.com/p/dompdf/wiki/FAQ I can add footer/header image to generated PDF, but I'm stuck on which PDF Press file do I need to edit to have accomplish that part?

Thanks

# Answer
After couple back and forth with the add-on developer (more here: http://devot-ee.com/add-ons/support/pdf-press/viewthread/12738) I have got accomplished the goal using a CSS trick from here http://eclecticgeek.com/dompdf/debug.php?identifier=b264f350e6967875987e14faa0c751f0

Template example:

```
<html>
<head>
  <style>
    @page { margin: 180px 50px; }
    #header { position: fixed; left: 0px; top: -180px; right: 0px; height: 150px; background-color: orange; text-align: center; }
    #footer { position: fixed; left: 0px; bottom: -180px; right: 0px; height: 150px; background-color: lightblue; }
    #footer .page:after { content: counter(page, upper-roman); }
  </style>
<body>
  <div id="header">
    <h1>Widgets Express</h1>
  </div>
  <div id="footer">
    <p class="page">Page </p>
  </div>
  <div id="content">
    <p>the first page</p>
    <p style="page-break-before: always;">the second page</p>
  </div>
</body>
</html>

```
> 1 votes

---
Tags: add-on, pdf-press
---


title: PDF Press and CSS

text:
# Question
Title: PDF Press and CSS
Based on the PFD Press documentation:

> 1. Formatting the PDF File
>
> Formatting the PDF file is as simple as creating a special CSS file and referencing it in the tag in your template. Use the media attribute and set it to "pdf". This will cause the PDF Press to use the stylesheet (and it will be ingnored in your browser)
>
> `<link href="{site_url}css/pdf.css" rel="stylesheet" media="pdf">`

I have created mine CSS styes sheet and added to the header

```
<link href="{stylesheet='styles/pdf'}" rel="stylesheet" media="pdf">

```

Style sheet is loaded by the site but not added to generated PDF.

Any clue what can be wrong?

Thanks

# Answer
> 1 votes
Based on the add-on developer response:

> I think you might have to switch to a static CSS file or inline css in order for the stylesheet to be parsed by PDF Press.

Inline CSS works fine.

---
Tags: add-on, pdf-press
---


# Question
Title: Simple Search: search form redirects to home page
We had been developing a site on a temp URL with Media Temple and on Friday we launched live. We gave the IP to the client and they set the A record. Once the A record was set we cannot use the search feature. According to the search logs the last successful search was 15 minutes before site IP went to client for the A record.

So far we have stripped out and added back everything in the htaccess, we have tried Low Search addon, we have made test pages and tested the code piece by piece and nothing has worked. We checked all of the settings internally as well.

Has anyone else had this issue? It was working fine until the A record was set. I am open to suggestions :)

# Answer
Solved: The problem was with the host name in the server set up. The entire site was set up incorrectly from a server level. We moved the site and it works. Thanks to everyone who added anything here. Much appreciation.
> 1 votes

---
Tags: search
---


# Question
Title: Modifying .htaccess to include or remove
Has anyone had any luck combining the new .htaccess rules for removing index.php with a rule to add (or remove) the www string? Previously, we would use the following:

```
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^example\.com$
    RewriteRule (.*) http://www.example.com/$1 [L,R=301]

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

```

However the new suggested code:

```
    RewriteEngine On
    RewriteBase /

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

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

```

...is throwing all kinds of errors for me when combined with the www rule set:

```
    RewriteCond %{HTTP_HOST} ^example\.com$
    RewriteRule (.*) http://www.example.com/$1 [L,R=301]

```

# Answer
I'm using this code:

```
# ----------------------------------------------------------------------

# Option 1:
# Rewrite "www.domain.com -> domain.com"

  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#

```

I ever used the Ellislab suggested code to remove index.php, it doesn't work fine on the Apache server where Expression Engine is installed. Using the addon htaccess Maker it's working fine, nice performance: http://devot-ee.com/add-ons/htaccess-maker
> 1 votes

---
Tags: htaccess
---


# Question
Title: shipping switzerland, europe - international regions - how to?
so this is my second store site I am developing. and I never did a store v2.x site - so my question might be obvious...

so my customer has defined 3 shipping options:
1. switzerland 10.-
2. europe 15.-
3. international 18.-

so I've thought I make 3 shipping methods with the "default shipping plugin":
1 switzerland (with country = switzerland)
2 europe
3 international

I think that could work rather well. Would you do that the same way?

Or would you rather create only one shipping option and then first put switzerland, then all the countries of europe, and leave the rest for international orders. I know that this method would involve more work at the beginning, but customers woudn't have to choose the shipping options themselfs and they coudn't cheat that way - am I right?

Do you have any tipps on what's the best way?
If the first option is best, maybe a word on how to preselect the shipping method automatically?

any help appreciated!
stephan

# Answer
> 2 votes
Your second idea is correct. Since your shipping prices are fixed, you only need to have one "shipping method", and it can be preselected for all carts by default.

Inside the shipping method, you can add different rates for each country, and these will automatically be applied based on the shipping address of each order.

---
Tags: expresso-store
---


# Question
Title: store_check extension works on dev, doesn't locally
I have installed the Expresso store\_check extension locally. After enabling the extension I can see a row is created in the database in exp\_extensions. A new 'Check' payment method should be shown in the Store settings but it's not there.

Now when I deploy to my dev server there's no problem, everything just works. I've tried uninstalling and disabling the extension and removed the database entry numerous times without succes. What else can I try to get this to work?

# Answer
There isn't really enough information in your question to diagnose what might be wrong, but if it's working fine in your development environment, then the only explanation is a difference between your development and production environments.

This might sound silly, but the first thing I would check is that your production website does in fact have the extension uploaded correctly, and that database does in fact have the extension enabled (and that you don't have your production website talking to your test database or vice versa).
> 1 votes

---
Tags: expresso-store, extension
---


# Question
Title: "Send to Member Groups" not listing all Member Groups
I have created a couple of custom Member Groups. Now, I want to test sending an email to them. However, when I go to Tools -\> Communicate, I do not see my custom Member Groups listed under the "Send to Member Groups" section. I only see Super Admins and Members.

How do I add my custom Member Groups to the "Send to Member Groups" section?

# Answer
Each member group has its own permissions setting for this. When you edit member group preferences you'll see an option that says something like "show this group in communicate groups list" or something to that effect. Make sure that's checked for each group you want to show up there and you should be all good.
> 2 votes

---
Tags: members, email
---