# Question
Title: Javascript error when using Exp:resso Store in a Safecracker entry form
EE 2.5.5, Exp:resso Store 1.6.3

The Store Product Details field works fine in the Control Panel, but when using it in a SafeCracker form, I get the following javascript error (from themes/thirdparty/store/cp.min.js):

```
Uncaught TypeError: Object [object Object] has no method 'sortable'

```

Here's the template code I'm using:

```
{exp:safecracker channel="signups" entry_id="18" return="foobar" }
    {field:product_details}
{/exp:safecracker}

```

Is there anything else I should be doing to get Store to work with SafeCracker?

# Answer
> 1 votes
This appears to be a bug in Store introduced by newer versions of EE and/or SafeCracker. We will have a fix out for it shortly.

In the meantime, you can fix it yourself fairly easily by opening `ft.store.php`, and around line 37, replace this line:

```
$this->EE->cp->add_js_script(array('ui' => 'datepicker'));

```

with this:

```
$this->EE->cp->add_js_script(array('ui' => array('datepicker', 'sortable')));

```

That will tell SafeCracker that it needs to load the jQuery UI Sortable library, which is included by default in the EE control panel (hence why it is working fine for you in the CP).

# Answer
> 3 votes
Are you including your own version of jQuery by chance? This error looks like store is looking for jQuery UI Sortable and it's not present on the jQuery object, which can happen if: you load jQuery, plugins, then load jQuery again, thus overriding the original.

You can disable safecracker's auto jQuery load: http://ellislab.com/expressionengine/user-guide/modules/safecracker/#include-jquery

---
Tags: expresso-store, safecracker
---


title: Exit if condition found - updated

text:
# Question
Title: Exit if condition found - updated
In this case I'm using switchee to test if a product exists in a cartthrob order (could be 1 item or 100 in the order) and should a particular product be found then load a snippet.

The issue is the test continues running for all items in the cart, spitting out multiple snippets if the condition is met more then once, obviously. You could replace cartthrob data with channel:entries data and same behaviour persists.

What I suppose I'm asking is there someway with switchee or normal if syntax to exit when any condition is met?

I am already using stash which may be useful but at a bit of a loss ATM.

**UPDATE#1**

```
{exp:cartthrob:cart_items_info}
{switchee variable="{channel}" parse="inward"}
    {case value="event"}{!-- There is an event, look it up and show results --}
        <div class="upsell upsell-item">
            {stash:embed:upsell:emb_get_upsell stash:entryid="{entry_id}"}
        </div>
    {/case}

    {case default="yes"} {!-- If no event exists then add generic upsell snippet --}
        <div class="upsell upsell-item">
        <p>Need a generic products upsell here</p>
        {stash:embed:upsell:emb_generic_upsell}
        </div>
    {/case}
{/switchee}
{/exp:cartthrob:cart_items_info}

```

Looking at that code, I can see why it's repeating and adding multiple, what I really want is to look through all :cart\_items\_info & if an event IS found, load the desired snippet and EXIT OR if no event exists then load generic snippet AND exit.

# Answer
There are several ways you could go about it really. The simplest would probably be to try a relatively new (and experimental) parameter in the car\_items\_info tag which filters the results based on a custom field:

```
{exp:cartthrob:cart_items_info search:field_name="value"}
    ...
{/exp:cartthrob:cart_items_info}

```

Where `field_name` is the name of your custom field and `value` is the search criteria. I don't know what you have in your Channel Fields but there may be something you can hook on to there. Just remember that this is still under development and may not be 100% reliable just yet.

Alternatively if you say you already have Stash installed then that will happily do the job:

```
{!-- Loop through the cart contents --}
{exp:cartthrob:cart_items_info}
    {exp:stash:set parse_tags="yes"}
        {exp:channel:entries entry_id="{entry_id}"}
            {!-- Grab the Channel Name as the handle & set the variable --}
            {stash:channel}{channel_name}{/stash:channel}
        {/exp:channel:entries}
    {/exp:stash:set}
{/exp:cartthrob:cart_items_info}

{!-- Later on in the template, outside of the Cartthrob cart_items_info tags --}
{if "{exp:stash:get name='channel'}" == 'event_channel_name' }
    It's an event!
{/if}

{!-- Or with Switchee --}
{switchee variable="{exp:stash:get name='channel'}"}
    {case value="event"}{!-- There is an event, look it up and show results --}
        It's an event!
    {/case}

    {case default="yes"} {!-- If no event exists then add generic upsell snippet --}
        It's NOT an event
    {/case}
{/switchee}

```

In your example code you have another inner Stash tag where you're pulling stuff in so you'd need to compensate for that but I'm giving the breakdown on how it can be implemented. The inner details you'll need to sort out as I don't know the Channel Fields or the rest of your template data.

Hope that helps.
> 1 votes

---
Tags: cartthrob, stash, switchee
---


# Question
Title: Forum attachment real path, anyone knows?
im trying to do something with Exif infos but using the {attach\_image\_url} isnt the right path, because ExpressionEngine generates something else than actual file name and location to it.

So, what i need, and hope to find out, is that what is the variable that could parse out the real url for the image attached.

Anyone, ideas?

**UPDATE:**

Im trying to get exif data out with this:

```
    <?php
$image_file = '{path:image_url}';
$image_type='';

$tab=str_repeat(' ',12);
if(file_exists($image_file)){
$details=exif_read_data($image_file);
foreach($details as $key=>$val){
echo $key.' = '.$val.'<br/>';
if(is_array($val)){
foreach($val as $key2=>$val2){
echo "<span style=\"margin-left:30px;\">".$key2.' = '.$val2.'</span><br/>';
}
}
}
}else{
echo 'File does not exists';
}

?>

```

But it doesnt find the image attached. I would be glad if someone could provide a way to get the real path to actual image attached, cos I cant find any kind of documentation of it anywhere. thanks.

# Answer
> 1 votes
If it's for the forum module then you'll probably need `{path:image_url}`. Give that a try.

---
Tags: ee2, image, forum, attachment
---


title: Member Chat Module?

text:
# Question
Title: Member Chat Module?
I am looking for a module that allows me to integrate a simple chat / shout box for the members of my EE site - Any suggestions apart from writing it myself?

# Answer
> 3 votes
You could try Cometchat. That's EE ready and you can either integrate it yourself or get them to do it for you. I've heard there are a few EE users successfully using this.

# Answer
> 0 votes
I just installed Cometchat and it works great. I use the basic version so far, but it still can be adjusted, so that you can allow only logged in members to chat and create rooms, send files in one-2-one chat etc. Very usefull, even the basic version that costs only 49 dollars.

AND, if you run issues like i did, just check the paths, and if no success, contact InScripts and they will for sure, help you out. (i did write to their facebook wall, and it took only 24 hours and all was running 110%).

Only downside there is, you have to manually (or some cronjob) clear chatrooms and other chat history, maybe they bring out more functions later? (Or maybe there is already in other versions).

But as far, i find it usefull (Cometchat) for users to take rapid chats on what ever is hot on forums/site. Saves a lot of non relevant post replies etc. if your members just are active enough to use chat also.

---
Tags: members
---


title: Yearly archives w/ custom field

text:
# Question
Title: Yearly archives w/ custom field
Does anybody know of a way to output a list of yearly archives using a custom date field? Low Yearly Archives is exactly the functionality I need, but referencing a custom date field, not the entry\_date field.

Thanks! \- B

# Answer
It's not supported out of the box, but if you change the SQL query that the plugin uses, it should work with a custom date field (not taking DST into account, tho):

Look up this in pi.low\_yearly\_archives.php:

```
$sql = "SELECT
        CONCAT(t.year,t.month) AS ym,
        COUNT(*) AS num_entries
    FROM
        exp_channel_titles t
    INNER JOIN
        exp_channels w
    ON
        t.channel_id = w.channel_id
        {$sql_cat_join}
    WHERE
        w.site_id = '{$sql_site_id}'
        {$sql_category}
        {$sql_expired}
        {$sql_future}
        {$sql_status}
        {$sql_channel}
        {$sql_author}
    GROUP BY
        ym
    ORDER BY
        ym ASC
";

```

And change that to:

```
$sql = "SELECT
        FROM_UNIXTIME(d.field_id_XX, '%Y%m') AS ym,
        COUNT(*) AS num_entries
    FROM
        exp_channel_titles t
    INNER JOIN
        exp_channels w
    ON
        t.channel_id = w.channel_id
    INNER JOIN
        exp_channel_data d
    ON
        t.entry_id = d.entry_id
        {$sql_cat_join}
    WHERE
        w.site_id = '{$sql_site_id}'
        {$sql_category}
        {$sql_expired}
        {$sql_future}
        {$sql_status}
        {$sql_channel}
        {$sql_author}
    GROUP BY
        ym
    ORDER BY
        ym ASC
";

```

Where `field_id_XX` should be changed to whatever the actual field ID is.
> 2 votes

# Answer
**EDIT2**: EEvent helper will match a custom date field to your entry's publication and expiration date if you can live with that.

**EDIT1**: sorry, misread your question. Thought you needed a custom year range

Combining Low Archives with the dt plugin should give you what you need.
> 0 votes

---
Tags: low-yearly-archives
---


# Question
Title: Search Results Tag Pair - Limiting Results
How do you limit the amount of results on the...

> {exp:search:search\_results}

tag pair. I can see nothing in the EE documentation?

# Answer
Search module results are controlled not via the `search_results` tag, but via the "results" parameter on the search form.
> 1 votes

# Answer
The Simple Search module is rather...erm...simple, so the options are limited but you can use the results parameter on the search\_form tag:

```
{exp:search:simple_form
    channel="my_channel"
    status="open"
    results="10"
    result_page="search/results"
}

```

This will limit the results to 10 per page for example but you can then just leave off the pagination (so no more pages are visible) and you'll have your 10 results only.
> 2 votes

---
Tags: simple-search
---


title: Stash and Categories

text:
# Question
Title: Stash and Categories
Is it possible to set the category id in a channel entries tag based on the last segment or by another method so that I don't have to create multiple templates?

I'm trying to get this template to fly.

```
{embed="_layouts/index"}

{exp:stash:append name="listings"}
        <div class="widget">
            <div class="whead"><h6>Listings</h6></div>
            <div class="shownpars">
                <table cellpadding="0" cellspacing="0" border="0" class="dTable">
                    <thead>
                        <tr>
                            <th>Name<span class="sorting" style="display: block;"></span></th>
                            <th>Location</th>
                            <th>Phone</th>
                            <th>Email</th>
                        </tr>
                    </thead>
                    <tbody>
                        {exp:channel:entries channel="members" category="{category_id}" status="Open" limit="100" disable="category_fields|member_data|pagination|trackbacks" dynamic="no"}
                        <tr>
                            <td>{title}</td>
                            <td>{member_location}</td>
                            <td>{member_phone}</td>
                            <td class="center">{member_email}</td>
                        </tr>
                        {/exp:channel:entries}
                    </tbody>
                </table>
            </div>
        </div>
{/exp:stash:append}

{exp:stash:set name="content"}
    {exp:stash:get name="listings"}
{/exp:stash:set}

```

# Answer
If your url contains the proper category you can use Low's seg2cat plugin to grab the id

```
category="{segment_xx_category_id}"

```

http://gotolow.com/addons/low-seg2cat

I'm afk from pc, you may have to tweak parse order but I've used this plugin to great affect many times for this purpose.
> 3 votes

---
Tags: categories, stash, parse-order
---


title: Moving threads from forum to another

text:
# Question
Title: Moving threads from forum to another
There is no way to native movement of forum posts from board 1 to board 2. Has someone came up in any kind of solution for to do this?

I'm about to close one of my forums, and was wondering that do EE itself have now-a-days some tools to make that work, or is it possible to do via phpmyadmin or such?

Thanks.

# Answer
You could do it with a query on the database (you could use phpMyAdmin although a dedicated MySQL tool would be better), e.g.

```
UPDATE exp_forum_topics
SET board_id = X
WHERE board_id = y

```

You'd need to do the same for exp\_forum\_posts too.
> 1 votes

---
Tags: ee2, module, forum
---


# Question
Title: VZ Exif - has someone used this on forums?
I have been searching for solution to show EXIF infos on images on my forums. I found so far only VZ Exif that is EE2-ready, but didnt manage to make it work with forums, even that i run my forums via regular template.

So, can someone guide me, or give a helping hand, thanks.

# Answer
OK, because ExpressionEngine Forum Module does not give out the actual attachment location in url, you can not use this within Forums, even if they run via regular templates.

In order to make the add-on work in forums, you have to find out a way to get the actual path and name for attached image, something like /forum\_attacments/testimage.jpg
> 0 votes

# Answer
The forums module is a very different beast. If you're using regular EE templates however then it should work. If you're not seeing any EXIF data output using VZ Exif then make sure you have PHP EXIF extension installed. Run phpinfo() and search for 'exif'.

Also ensure that EXIF data is actually attached to your image files. Run a standard test in regular templates first to be sure.
> 0 votes

---
Tags: image, forum, attachment
---


# Question
Title: About the visitor statictics that ExpressionEngine gives
Ok, as all knows, there is issues with the last visit-info. That has been there long time, but now i have monitored the real-time statistics also. And what i found, that there is something in that also. Site says that it has about 50-60% more current visitors than Google Analytics. So that make me wonder, how i can trust to any of these infos.

So, what all you have to do, that system itself stops from tracking visitors and such? I just dont find this feature reliable anymore since logs doesnt match at all.

In simple: is or isnt there a way to totally stop tracking? It might and will also speed up the site if i just can stop all activity when it comes to tracking, and i dont find it nice either to tell wrong infos to members when they access to site that says "56 users logged in" but the real number is more like 8....

Thanks for any ideas that you might have.

# Answer
You can turn off all track from Admin \> Security & Privacy \> Tracking preferences. From here you can choose to turn off template tracking, online user tracking and channel entry tracking.

On high traffic sites this could help to improve performance but in most cases it probably wont make too much difference.
> 1 votes

---
Tags: members
---


title: Index.php and Strange Redirection

text:
# Question
Title: Index.php and Strange Redirection
OK, I had a site working and today when I went back to it some strange issues are happening. I'm not sure what I did, if anything. But more importantly, I can't figure out what to do!

Originally I had my .htaccess file set to remove the index.php from the URL. In the CP, under General Settings, I had the "Name of your site's index page" as blank (per a recommendation). Everything seemed to be working.

Today, any of my page links (ie mysite.com/page) simply show the home page (I've tested by adding and removing text from the home page template). I thought it was my .htaccess file so I replaced it with the one that Ellislab has in their documents. If I add the index.php back (ie. mysite.com/index.php/page), it works. However, the index.php is still showing up in the URL even though my .htaccess file is supposed to be removing it!

When I put my .htaccess file back, it removes the index.php, but then just shows the home page content again!

I don't know if I've inadvertently changed a setting or something, so any help or advice is greatly appreciated.

Todd

PS - This is an MSM site, and this is "Site 2" in the group. Again, it has been working the past few days while I was working on setting up the custom fields, etc....

# Answer
> 1 votes
I contacted Ellislab to look at this, and they couldn't figure it out either. So I finally opted to rebuild it from my last backup (note to self, take more frequent backups!!)

---
Tags: .htaccess, redirection
---


# Question
Title: conversion to wygwam field is hanging in ExpressionEngine 1.7
I'm prepping a large EE1.7 site (many, many entries) currently using MD Markitup fields with Textile by converting the content fields to Wygwam so when I upgrade the site to EE2 they're all set. I'm trying to switch the fields one at a time to Wygwam 2.7 and converting the textile content. When I make the change on the edit field page and click "update" the page is hanging for a long time and then goes blank. When I go back to check the field settings the field is still using the previous setting. Is there another way to convert the content?

# Answer
> 1 votes
I do not have experience converting the MD fields to WYGWAM-friendly fields but here are a couple of ways to troubleshoot this:

The first way involves upgrading to EE 2 by changing all of those MD fields to plain old textarea's (preferably with some SQL) then proceeding with the EE 2 upgrade. This lets you use the latest version of WYGWAM in EE2. Once the site upgraded you can use some SQL to update all of those old textarea's to WYGWAM and go from there.

Secondly, If you would prefer to do this in EE 1 first, it sounds like you are running into a PHP memory issue if you are getting a blank screen. Try upping PHP's memory allotment. A simple adjustment to the .htaccess:

```
php_value memory_limit 128M

```

Lastly, if you're interested in some more EE 1 =\> EE 2 upgrade tips, you can see this answer as well

---
Tags: wygwam
---


# Question
Title: How do I stop sitemap.xml displaying instead of the /sitemap/index.php template?
I have a template\_group/template like sitemap/index.php, in which I have a regular html site map for site visitors. I also have sitemap.xml in the root folder.

visiting www.site.com/sitemap is showing the sitemap.xml file and not the one I have in sitemap/index.php.

I'm using the EL supplied htacccess file to remove index.php from url's.

Be grateful for any suggestions on how to fix this please.

Best wishes Lee

# Answer
Thanks for the answers guy's! In the end i went super simple and just renamed my xml file to site-map.xml.
> 1 votes

# Answer
I would move your sitemap.xml file to an EE template make sure you choose xml as the template type. Then remove your sitemap.xml from the root.

YOu can update your xml sitemap url in google webmasters tool and set up an .htaccess 301 redirect to ensure there are no problems with the move.
> 1 votes

# Answer
If you ensure that the forward slash is appended to `www.site.com/sitemap/` this will tell EE that it is a directory rather than a file and it will go hunting for the index.php file in that directory.

You can also try to specifically set the headers for XML files in the .htaccess file to be sure:

```
# Set encoding for file extensions
<IfModule mod_mime.c>
  AddType application/xml .xml
  AddType text/xml .xml .xsl .xsf .xsd
</IfModule>

```
> 1 votes

---
Tags: templates
---


# Question
Title: Assets not recognising image manipulations after upgrade to 2.0.5
I have just updated a site to Assets 2.0.5. When I update the indexes, I get a list of files with the heading "There are some entries in the database that are out of date"

What does that mean and how safe is it to delete these files?

Coincidentally, after the update, I can no longer get EE image manipulations - I just get blanks where the images are supposed to be - no error messages.

My template code is:

```
{exp:channel:entries channel="catalogue" status="open|closed"}

  {product}

 <a href="{path='catalogue/products/{entry_id}'}">

 <img src="{images:catalogue}" alt="{title}" title="© Design by MaJools" />

 </a>{spiel}

  {/product}

{/exp:channel:entries}

```

{product} is a matrix field type

{images:catalogue}, where images is the assets field type and catalogue is the EE manipulation.

If I just use {images} I get the image un-manipulated

This worked well before the upgrade.

Any suggestions?

# Answer
> 1 votes
If the images are there and the filetype is that of a regular PNG then the chances are this is just Assets checking to be extra sure you want to still have those images recognised.

***Firstly, ensure that you have ALL images and the database backed-up*** just to be sure. Then hit the delete button. This is just to delete Assets' record of the file. Afterwards you should still have all of your images in place and the indexing should tell you it is complete. Your images should appear in your entries again.

**Note**: Just to point out that I'm not official support for Assets and anything involving hitting delete buttons is always risky which is why I say to have a solid backup in advance so you can recover if all else fails. I can't be held responsible for any loss of data as a result of following this advice.

Having said the above though I'm pretty sure that you'll find this solves the issue and the images themselves or associations will still be there. If you'd rather wait for one of the official support reps to hop on and check with them than that's fine. :)

---
Tags: assets
---


title: Matrix field customised in Safecracker

text:
# Question
Title: Matrix field customised in Safecracker
I have a Matrix field that I am using for an address.

I have 5 columns in total

Address 1 - Text Address 2 - Text City - Text County - P&T Dropdown Postal Code - Text

I have City and County marked as required.

Now using the standard short field name in Safecracker will not output the fields how I want them formatted, so I am breaking them out.

For example,

I have the following when it comes to address one...

```
<input type="hidden" name="address[row_order][]" value="row_new_0" />
<input type="text" class="span8" name="address[row_new_0][col_id_4]" />
<span class="help-block">Address (first line)</span>

```

This works fine for all the text fields, but I am not sure about how the best way to display the P&T dropdown field.

I am using a P&T dropdown, as it allows me to utilise option groups, which I am using like so

```
England
 -county 1
 -county 2
 -etc
Scotland
 - and so on...

```

Now the only way I have found to output this in safecracker, is to write out every option.

```
<select class="span6" name="address[row_new_0][col_id_6]">

<option value="" selected="selected">Select your county</option>
<optgroup label="England">
<option value="Avon">Avon</option>
<option value="Bedfordshire">Bedfordshire</option>

...

</optgroup>
</select>

```

The problem with this is that it does not seem to validate. If I leave the select unchanged, it doesn't throw up the "required" error.

Another issue is that if I do complete the required fields, but make other errors on the form, when submitted, it does not remember the values I entered. Presumably this is due to it not have a `value="something"` \- but I am not sure what 'something' should be.

Any help appreciated!

# Answer
> 1 votes
Rather than write out every option have you tried a tag pair for the the name of your field?

```
<select name="my_field_name" id="my_field_name">
    {options:my_field_name}
            <option value="{option_value}"{selected}>{option_name}</option>
    {/options:my_field_name}
</select>

```

Off the top of my head I'm not sure how this would handle your groups though, I'm sure it's possible but give that a try and see if it yields any results first. That should go some way to solving the error too.

As for the values because you're posting the page it will reset all field values so you can just retain the values by setting it in the value attribute like so:

```
value="{field_name}"

```

i.e.

```
<input type="text" class="span8" name="address[row_new_0][col_id_4]" value="{field_name}" />

```

Where {field\_name} is the name of your field.

---
Tags: safecracker, matrix, pt-dropdown
---


# Question
Title: Matrix with a Playa field which has a Playa Field
To set the stage, I've got 3 Channels: Agenda, Sessions, and Speakers, with a breakdown of the custom field types as follows.

* Agenda contains a Matrix field with 3 columns - the start time, end time, and a Playa field to select the session to add to the time slot
* Sessions contains a title and description field along with a Playa field to choose the Speaker(s) for that session
* Speaker contains several custom fields that describe the speaker.

I'm trying to create the Agenda, and read about a few different options. This is what I have so far, but obviously it's not working.

```
{exp:channel:entries channel="agenda" dynamic="no" limit="1" show_future_entries="yes" }
<h1>{title}</h1>
{agenda_description}
<h3>{agenda_date_monday format="%l, %F %j"}</h3>
{agenda_monday}
<div class="details_left">{am_start_time format="%g:%i%a"} - {am_end_time format="%g:%i%a"}</div>
<div class="details_right">
    {am_session}<h4><a href="{path={channel_short_name}/{url_title}}">{title}</a></h4>
        {session_speakers}
          <p>{title}</p>
        {/session_speakers}
    {/am_session}
</div>
{/agenda_monday}
{/exp:channel:entries}

```

Thanks for any suggestions, and please feel free to ask clarifying questions!

# Answer
> 1 votes
As per the Playa docs on nested relationships:

> If you need to access a Playa field from within another Playa field, the only way to go about that is through an embedded template:

So in your case:

```
{exp:channel:entries channel="agenda" dynamic="no" limit="1" show_future_entries="yes" }
    <h1>{title}</h1>
    {agenda_description}
    <h3>{agenda_date_monday format="%l, %F %j"}</h3>
    {agenda_monday}
        <div class="details_left">{am_start_time format="%g:%i%a"} - {am_end_time format="%g:%i%a"}</div>
        <div class="details_right">
            {embed="agenda/_session_listing" entry_ids="{am_session:child_ids}"}
        </div>
    {/agenda_monday}
{/exp:channel:entries}

```

Then in **agenda/\_session\_listing**:

```
{exp:channel:entries channel="sessions" fixed_order="0|{embed:entry_ids}" dynamic="no" disable=member_data|pagination|categories"}
    <h4><a href="{path={channel_short_name}/{url_title}}">{title}</a></h4>
    {session_speakers}
        <p>{title}</p>
    {/session_speakers}
{/exp:channel:entries}

```

Another tip: instead of using `{path={channel_short_name}/{url_title}}`, consider using `{comment_url_title_auto_path}` (docs).

---
Tags: matrix, playa
---


# Question
Title: Displaying Category Type in Search Results Tag Pair
How do you output category info within the:

> {exp:search:search\_results}

tag pair?

In my case I want to display the category name.

# Answer
Just about all the variables available in the channel:entries tag pair are available in search results as well - have you tried just using the categories tag pair?
> 1 votes

---
Tags: search
---


title: Search results going to 404

text:
# Question
Title: Search results going to 404
I am pretty confused about this, since I upgraded Expression Engine to 2.5.5 all the searches from the simple search form are going to the 404 page. Here is the search form

```
    {exp:search:simple_form channel="bike_families|blog|faq|features|support_resources|team_member|bikes" no_result_page="search/noresults" result_page="search/index"}
         <input type="search" name="keywords" placeholder="Search" id="keywords" value="" size="18" maxlength="100">
         <input type="submit" value="Search" class="submit small"
{/exp:search:simple_form}

```

I have checked all my log files and there are no error messages being reported, simplifying the form by removing the channel definition also does not help. I made sure both the result page and the no result page exist and even tried changing the url.

I also dugg into the search a bit to see what was being constructed from the search module, it seems to be creating a proper sql query and and not returning 0 results. So something seems to be incorrect in the redirect logic.

EDIT:

Ok I have some more information. If I take a clean setup of the same site, upgrade everything along the same path then search works on that new site with different data. However if I take the code base where it is working and point it at the database of the site with the broken search then the search stops working there. So it seems to be related to the database. Also of note when I do a search it shows in the search logs, and shows that there are x results but then I get a 404 page on the front end.

Thanks, Cory

# Answer
Ok, I got this working. Some how the template synch tool had created multiple versions of the same template group in the database. I usually don't check the ui for template groups but when I did it reared it's head. It was really weird because only one version of the search folder was in my codebase but three redundant versions where in the db.
> 1 votes

# Answer
For each of the channels you're searching you need to specifically set the Search Results URL. This is in Admin \> Channel Administration \> Channels and under Path Settings. In your case make sure they're pointing to `/search/index`.
> -1 votes

---
Tags: search
---


title: Displaying First and Last in Pagination

text:
# Question
Title: Displaying First and Last in Pagination
I have this code that is not working as expected. No First or last or prev links will display...

```
{paginate}
                            {pagination_links}
                            <!-- post pagination -->
                            <nav class="post-pagination">
                                <ul class="pagination">
                                {first_page}
                                    <li class="pagination-first"><a href="{pagination_url}" rel="first"> First </a></li>
                                {/first_page}
                                {previous_page}
                                <li class="pagination-prev"><a href="{pagination_url}" rel="prev"> « </a></li>
                            {/previous_page}
                            {page}
                                <li class="pagination-num {if current_page}current{/if}"><a href="{pagination_url}"> {pagination_page_number} </a></li>
                            {/page}
                            {next_page}
                                <li class="pagination-next"><a href="{pagination_url}" rel="next"> » </a></li>
                            {/next_page}
                            {last_page}
                                <li class="pagination-last"><a href="{pagination_url}" rel="last"> Last </a></li>
                            {/last_page}
                            </ul>
                        </nav>
                        <!-- post pagination -->
                        {/pagination_links}
                        {/paginate}

```

I get this on the front end ... see attached. Any help would be appreciated.

# Answer
First and last links in pagination appear only when there are at least 4 pages of entries. It's not in the main documentation but it's included in the user-contributed notes in the docs.
> 1 votes

# Answer
ExpressionEngine usually shows 3 pages. If there are more page than 3, then it will display "First" and "last". In your case, it seems there is only 2 pages.

You can check it by decreasing the limit value.
> 0 votes

---
Tags: pagination
---


# Question
Title: Textarea Turning Iframe Tags into Special Characters
I am having an issue adding an iframe tag to a textarea field. The field is configured to accept XHTML. Any ideas on what could be causing the issue?

e.g.

```
<iframe id="xtranormal_So, have you heard about Montana Conservation Corps?" name="xtranormal_So, have you heard about Montana Conservation Corps?"  src="http://www.xtranormal.com/xtraplayr/13045605/so-have-you-heard-about-montana-conservation-corps" marginwidth="0" marginheight="0" border="0" frameborder="0" scrolling="auto"</iframe>

```

I am running EE v2.5.0

# Answer
> 1 votes
You should select "None" for "Default Text Formatting" under the field options.

It would work for you.

---
Tags: video
---


title: LikEE js wont work in the following

text:
# Question
Title: LikEE js wont work in the following
I came up with this odd issue. If i surf around my forum as usual, LikEE works, but when i come from outside of the site, or click internal links in forums, this wont work:

{exp:likee:js skip\_jquery="true"}

The javascript wont come, and the tag itself shows as is, in the sourcecode. Because i dont know the actual java, i cant "hardcode" it into end of the head-tag, neither i dont know if that even work then, because dont know how LikEE actual works.

I know this should be and have done into channels, but i just cant see why it wont work nicely in forums also.

And i do not use this with all posts, just if there is attachment in first post. (yep, i know, if someone replies and add another attachment, then all replies between first and last post has like - dislike buttons).

But somehow i have feeling that there might be a way to get this working with forums also? Any ideas or has someone even tried this?

# Answer
Most add-ons that work on the rest of the site do not work in the forums module as the forum templates are not typically sent through the EE template engine. You do have the option of running the forums through standard EE templates as mention in the docs but even then not every add-on works properly.
> 1 votes

---
Tags: add-on, forum
---


# Question
Title: Assets plugin has no files in Multiple Site Manager 2nd site
When I choose to copy everything with MSM in order to create a new site, the Assets plugin file meta-data is not copied over. I was hoping that the images in the Assets plugin would be available for all sites, or at a bare minimum, when copying a site, the ones from the original site would be copied in the DB so that the new site would not have all images broken.

Has anyone done anything more elegant than fixing them one by one? I figured someone has run into this and has an update statement that could get me started to duplicate all the meta data associated with each file in the DB.

Oddities of note: I am setting the $config\['upload\_preferences'\] array in my config file and have not followed the MSM documentation on creating separate vhosts and folder trees for additional sites, choosing instead to set the specific values MSM requires in index.php and admin.php conditionally on $\_SERVER\['SERVER\_NAME'\]. I also have all of my assets in a symlink folder so all the sites can use the same path. Hopefully none of those implementation details are a factor.

# Answer
Jared,

The data for those add-ons will not be copied; only the structure. We'd need a well placed hook in the MSM to be able to copy the data over as well. So definitely some database finagling if you want to copy that data over.
> 1 votes

---
Tags: assets, multi-site-manager
---


# Question
Title: Unable to upload files with Matrix Multi-Upload
Software Versions: EE 2.5.2 Matrix 2.5.3 Matrix Multi-Upload Accessory is version 1.1.1 but the module says version 0.9.1(downloaded today from github)

I'm able to upload fine thru Matrix, but not with Matrix Multi-Upload.

The files never fully upload with FF 19.0.2 on a Mac. They get to some random % and then show a little yield sign icon for HTTP Error and the files never make it to the server. In Safari they actually get to 100% but with the same yield icon. There are no javascript errors.

I'm using the absolute server path which starts with "/home/content/d/m/h/" so that shouldn't be the problem.

Any help would be appreciated.

# Answer
> 1 votes
Adding:

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

```

to /system/expressionengine/config/config.php fixed this up.

---
Tags: matrix
---


title: Show only images with specific keyword

text:
# Question
Title: Show only images with specific keyword
I am trying to display images tagged with a specific Keyword, however I also appear to be getting images that have my keywords in the images filename. Is this correct behaviour or am I just not getting my tags right? Code below..

```
{exp:assets:folders recursive="yes"}
    <h3>{folder_name}</h3>
    <ul>
        {exp:assets:files folder_id="{folder_id}" keywords="London"}
            <li><a href="{url:huge}" target="_blank">{if title != ""}{title}{if:else}{filename}{/if}</a></li>
        {/exp:assets:files}
    </ul>
{/exp:assets:folders}

```

# Answer
> 1 votes
it's the expected behaviour for Assets.

---
Tags: assets
---


title: How do Transcribe URLs work?

text:
# Question
Title: How do Transcribe URLs work?
I've just purchased Transcribe and can't quite figure something out (also using Structure).

http://screencast.com/t/YQ7ynAZi

So I create a test entry, save, go back into it and create an associated entry. After this I can see my 2 pages on 2 urls:

/en/test /ru/test

Perfect.

However, if I now and go edit either entry, the URL changes, e.g.

/en/test-1 /ru/test

If the segment after the language is not the same, then there is no real point having a language segment at all! e.g.

/en/test-en /ru/test-ru

Is not ideal and may as well be:

/test-en /test-ru

Is this intended functionality?

# Answer
The second segment in this case is the URL title (test) which must be unique so yes 'test' and 'test-1' would be created initially from attempting to create 2 entries with the URL title of 'test'.

'test' and 'test-1' are URL Titles created when you created 2 entries called 'test'. This isn't related to Transcribe as such but is the way EE handles URL titles.

So what I'm saying is that each entry has a unique URL title, regardless of it being a translation of another entry. This allows you to have a completely different structure with URL's specific to that language. So the URL would be the word 'test' in Russian for the other entry. This way you could also potentially have a different site structure between different languages.

A typical URL structure would be: /language/template-group/template/url-title/ e.g /en/news/item/test/

So yes this is pretty much intended behaviour.
> 2 votes

# Answer
What seems to be a bug, is actually a feature.

ExpressionEngine wants unique URL titles for each entry. While this may seem limiting, it's actually what you want. URL titles that reflect the language the page is in will help search engines and users understand your content.

```
/en/about-us
/es/sobre-nosotros
/de/wir-uber-uns
/fr/a-propos-de-nous

```

I could see how you might have URL title overlaps like with the case of /en/test and /ru/test. But you can use Pages or Structure URLs like this since they are matching against the full URI. So while your URL title would automatically be changed to "test-1" to avoid duplicates, the Page or Structure URL could still be /ru/test. I just tried it out and it seems to be working.
> 1 votes

---
Tags: transcribe
---


title: Search refer to homepage

text:
# Question
Title: Search refer to homepage
Everything was working fine, Till suddenly dynamic and classic search refers to homepage url?

The search refers to template result\_page="search/results" but instead it goes to homepage (www.site.com) instead of www.site.com/search/results

First thing i have tried to figure this out is to remove the .htaccess but it didn't change anything.

Second i made a new template to test this, used the example in EE user guide but the results also takes me back to the homepage instead of www.site.com/search/results

It's not a server problem as i have a similar copy of the website on the same server and there it works fine The only difference between both sites is transcribe. But i'm not sure that is related.

How should i go ahead and debug this to make it go to the result\_page="search/results"

Thanks

# Answer
Ok this is silly but it might help others, There wasn't any problem with transcribe

it was just in the EE configruation i removed the index.php from the "the Name of your site's index page"

I've put the index.php the search is now being redirected as it should :)
> 0 votes

# Answer
Try changing `result_page="search/results"` to `result_page="/search/results"`
> 0 votes

---
Tags: search, transcribe
---


title: How do I install Safecracker?

text:
# Question
Title: How do I install Safecracker?
I've just discovered that Safecracker isn't in the list of modules for the site I'm working on. How do I install it? I'm using EE v2.1.3

# Answer
If you upgrade to the current version, 2.5.5, it is bundled within the install.
> 3 votes

# Answer
You still need to select it as a module to install when installing EE. If you haven't done so then you can install it via Addons \> Modules \> Safecracker.
> 0 votes

---
Tags: add-on, safecracker, module, plugin
---


title: Secure Login Forms

text:
# Question
Title: Secure Login Forms
At present there doesn't seem to be an easy way to login securely using the Member module. Safecraker provides useful parameters in secure\_action="yes" and secure\_return="yes" to ensure encrypted submissions but the login form is left wide open by default (which is a unbelievable!).

How do other people handle secure login form submissions to ensure they are posted over HTTPS in the lack of a built in facility by default in EE?

I know that FreeMember has recently has this support added but if I'm not using FreeMember than I'd like to be able to find a way to secure my logins.

**UPDATE**: It looks like Zoo Visitor also supports secure login forms and it's now just been added to the docs with the same parameters as Safecracker.

# Answer
> 1 votes
In my case I think this solution works best. Using a combination of DM Force SSL to ensure that that template is served over HTTPS, and Find and Replace Plus to swap out 'http' with 'https'. They can be used in combination with the default Login form to provide a secure login:

```
{!-- Load the page over SSL --}
{exp:dm_force_ssl:force}

{!-- Ensure the form submits over HTTPS --}
{exp:replace_plus find='action="http:' replace='action="https:'}
    {exp:member:login_form id="login_form"}

        Login form...

    {/exp:member:login_form}
{/exp:replace_plus}

```

I've also submitted a feature request to EllisLab to try and get secure\_action="yes" and secure\_return="yes" included in the default Member module login form.

FreeMember and Zoo Visitor provide ready-made alternatives if using those modules and Authenticate goes some way towards providing some security too but I'm not sure it's fully encrypted...(?) Thanks Tyssen.

# Answer
> 0 votes
Authenticate has a secure\_return parameter. Will that do the trick?

---
Tags: security, ssl
---


# Question
Title: Selecting Channel data within a custom Addon
I'm going to be inserting some data into a channel via a custom Add-on. It looks as thought I should be using the Channel Entries API in order to do this, which is fine.

What I need to do first though is select some supporting data from some existing Channels. There doesn't seem to be anything in the above API to fetch existing data unless I missed it. What's the best way to accomplish this? I'm happy to use the DB Class, if that's the only way of doing it. I just wanted to check there wasn't a preferred method of doing this before I go re-inventing the wheel!

Any help, gratefully received.

# Answer
> 2 votes
I believe that fetching data from existing channels/entries is just a case of querying the database so it's either straight to the DB class or via CI Active Record It's probably better to use the Active Record class.

# Answer
> 2 votes
You should look here: https://github.com/objectivehtml/Channel-Data

It might help you.

---
Tags: channel-entries, add-on-development
---


title: Playa inside channel entries

text:
# Question
Title: Playa inside channel entries
I have a home channel in which I want to display various Playa fields bringing entries in from other channels. It's tricky though, home is a listing item as it will change everyday (Note the start and stop). The information Playa brings in is also from a listing.

```
{exp:channel:entries channel="home" limit="1" start_on="{current_time format="%Y-%m-%d 00:00"}" stop_before="{current_time format="%Y-%m-%d 23:59"}"}

{exp:playa:children channel="articles" field_id="18" parse="inward"}
{title}
{/exp:playa:children}

{/exp:channel:entries}

```

The problem here is that the Playa field always shows the title from the home listing, not the article listing even though I specified the channel in the Playa field. From looking at the Playa docs, this should work fine. Any suggestions?

# Answer
> 1 votes
Have you tried the simple fieldtype tag pair for the playa child entries loop to see if that returns the data you're looking for?

```
{cf_your_playa_field_short_name}
  {title}
{/cf_your_playa_field_short_name}

```

# Answer
> 1 votes
Not sure I get it but I'll take a shot. parse=inward is not needed here, nor is the field\_id I don't think. Also, I would use single quotes inside double quotes to avoid parsing problems. The following code should work provided that:

* a home entry is displayed by the outer channel entries tag
* you have entries belonging to the "articles" channel that are playa children of the "home" entry and that have a status of "open"

Could you give it a try?

```
{exp:channel:entries channel="home" limit="1" start_on="{current_time format='%Y-%m-%d 00:00'}" stop_before="{current_time format='%Y-%m-%d 23:59'}"}

    <h1>home entry title: {title}</h1>
    {exp:playa:children channel="articles"}
        <h2>article entry title: {title}</h2>
    {/exp:playa:children}

{/exp:channel:entries}

```

---
Tags: playa
---


# Question
Title: Git subtree with add-ons that have a themes folder
I've taken to installing add-ons that I have in development in separate repositories as submodules into each of my EE projects. This has worked fine for add-ons that do not have a themes folder, but I am now finally in the situation where I want to develop a module/extension that utilizes a themes folder.

I have come accross this other question for which answers suggest using symlinks to accomplish the goal. I find symlinks in git to be a scary proposition (they don't behave the same across platforms), and would prefer to have a way to do this that refers to the remote repo, not a local copy by a strict path.

Is there a way to use subtree merging to remap e.g.:

* `subproject/system/expressionengine/third_party/add-on-name` to `project/third_party/add-on-name` (I use ee-master-config to remap third\_party outside of the expressionengine directory, along with the templates directory)
* `subproject/themes/third_party/add-on-name` to `project/public_html/themes/third_party/add-on-name` (I keep the system folder above web root)?

To clarify the setup, this is my current folder hierarchy for any given EE site:

```
/public_html
  /public_html/themes
  /public_html/system (contains only an index.php pointing to ../../system)
/system
/templates
/third_party

```

Web root is set to public\_html so that executable server side code is never exposed to the wider world. In an add-on repository the folder structure is that of the default expressionengine setup, eg.:

```
/system
  /system/expressionengine/third_party
/themes

```

The trouble then is including the files from the add-on repository to different paths in an expressionengine site's hierarchy.

# Answer
I'm not too well versed in Git, but you could override the third party path for addon's in the `system/expressionengine/config/config.php` file and put site & addon assets in a folder outside of the EE system files with these overrides:

```
$config['third_party_path'] = '/server/path/domain.com/assets/addon_sys/';
$config['path_third_themes'] = '/server/path/domain.com/assets/addon_themes/';
$config['url_third_themes'] = '/assets/addon_themes/';

```

I typically put all site assets in one folder, so everything is easy to access:

```
/assets/addon_sys/
/assets/addon_themes/
/assets/css/
/assets/js/
/assets/img/
/assets/low_vars/
/assets/templates/
/assets/uploads/

```
> 1 votes

# Answer
As I understand it, this is not possible with `git-subtree`.

Taking the code example from the kernel.org docs:

```
$ git remote add -f Bproject /path/to/B
$ git merge -s ours --no-commit Bproject/master
$ git read-tree --prefix=dir-B/ -u Bproject/master
$ git commit -m "Merge B project as our subdirectory"

```

In the `read-tree` command on line 3 you can only set a single `--prefix` value (which is where we set the subdirectory of the man project to target for the subtree merge). What you describe would require multiple values with some way to match subtree paths to main project paths.

I do feel your pain with this issue - I've hit the same problem with both client builds using 3rd party addons and with building addons myself. I don't think it's a solved problem so I'd love to hear what you come up with!

As an aside, I've not had issues with checking in symlinks, but then I don't work outside of a mac + Linux environment.
> 0 votes

# Answer
I've just finished getting my setup with git working the way I want. symlinks definitely made things easier but seeing how they're not viable in your case... perhaps just stick with keeping the full themes directory in your submodule and adding it in to the main project after your work is done.

One is apenwarr's git-subtree script

> The main difference is that, besides merging the other project as a subdirectory, you can also extract the entire history of a subdirectory from your project and make it into a standalone project. Unlike the subtree merge strategy you can alternate back and forth between these two operations. If the standalone library gets updated, you can automatically merge the changes into your project; if you update the library inside your project, you can "split" the changes back out again and merge them back into the library project.

Though I'm not quite sure how you'd work with only a path of the add-on repo.

Maybe it's easier without the git-subtree script, e.g. following the q-a here:

To start off:

```
$ git remote add Bar /path/to/bar
$ git merge -s ours --no-commit Bar/master
$ git read-tree --prefix=public_html/themes/third_party -u Bar/master:/themes/third_party

```

When pulling later:

```
$ get fetch Bar
$ git pull -X subtree=public_html/themes/third_party Bar master

```

How are you working with actual third party add-ons whose developers release updates and/or require changes on your own?
> 0 votes

---
Tags: add-on-development, git
---


# Question
Title: Getting P&T Dropdown to submit a null/default/empty value?
I have a P&T Dropdown that has a default value of " : Select one..." and once you select and submit any other option than that default... there seems to be no way to reset that fields value back to the default.

Consider I have Field#1 "Are you Coming?" and the another Field#2 "What you eating?". When I use selects Field#1=Yes then they get to submit field#2 as "Fish". However, they may later come back and resubmit as Field#1=No in which case I reset Field#2 (via JS) to " : Select one..." and set it to "disabled" and submit. This however does not reset the field.

Figure 1

# Answer
This doesn't sound like it's doing anything wrong, but just what it's told to do. If you've made this a required field and you're default value is set to tell them to choose an option then once they've chosen and submitted that field then has a value. The only way to change it would be to give it another value but your default is just telling them to select (it's a null value).

It's just like the title field of an entry in the publish page being required. Once you've submitted that entry it's saved with that title value. If you then edit that entry and and try to submit with an empty title field (the default) then it will return an error telling you to give that entry a title.

For the dropdown field, why don't you set a default to either yes and no rather than put in a default value which is null (i.e. it's akin to the empty title field example).
> 1 votes

# Answer
Can you share how you had setup the P&T Dropdown field's options while creating this field type. Usually we have setting like:

option1 : value1 option2 : value2 ....

So if you are having all option : value pairs, all the options should be in same format i.e option&value be separated with colon.

Check if you are not having the default option in same format as other 2 options.
> 0 votes

---
Tags: ee2, module, pixelandtonic, drop-down
---


# Question
Title: P&T Matrix Required Col on VZ URL fieldtype not honored
I have a matrix fieldtype with a column that has a VZ URL field in it. The column is set to required but you can leave it blank when submitting an entry. Anyone else have this issue or any insight?

# Answer
> 1 votes
This seems to be intentional behaviour:

> Please note that VZ Url will not prevent the user from saving their weblog entry if if cannot validate the url—it just warns them. This is intentional, perhaps they are linking to a page they have not yet created, or the site they are linking to is currently down but they know the url is correct. I may add this functionality as an option later on.

---
Tags: matrix
---


# Question
Title: How to hide/show groups of markers by category with Google Maps for ExpressionEngine module
I'm looking to do something like what is done right here.

So here's the breakdown of what I need to do:

* Have markers grouped by category
* Have a checkbox (or anchor) for each category
* When anchor/checkbox is clicked the markers associated with that category get shown (or hidden) toggled on/off

As the title suggests, I'm looking for advice on how to do this with Google Maps for ExpressionEngine.

I've got all my data stored as EE entries and I am fully aware of how to display a map with all of these points using the module, I just need some advice on how to implement the jquery to accomplish toggling markers by category :-)

# Answer
That page you show assigns a group to each marker it outputs (it's doing this from an XML file which I haven't looked at).

The following jQuery function is then bound to the checkboxes' onclick event;

```
function toggleGroup(type) {
  for (var i = 0; i < markerGroups[type].length; i++) {
    var marker = markerGroups[type][i];
    if (marker.isHidden()) {
      marker.show();
    } else {
      marker.hide();
    }
  }

```

Here's an example of the checkbox markup...

```
<input type="checkbox" id="restaurantCheckbox" onclick="toggleGroup('restaurant')" />

```

This is called with a group name and loops through the markers in that group showing any markers that are hidden.

So the main trick is assigning a group to your markers as you output them and that's basically it!

EDIT. Here's the XML for the marker data. You could do it this way by

```
<markers>
    <marker name="Pan Africa Market" address="1521 1st Ave, Seattle, WA" lat="47.608940" lng="-122.340141" type="restaurant"/>
    <marker name="Buddha Thai & Bar" address="2222 2nd Ave, Seattle, WA" lat="47.613590" lng="-122.344391" type="bar"/>
    <marker name="The Melting Pot" address="14 Mercer St, Seattle, WA" lat="47.624561" lng="-122.356445" type="restaurant"/>
    <marker name="Ipanema Grill" address="1225 1st Ave, Seattle, WA" lat="47.606365" lng="-122.337654" type="restaurant"/>
    <marker name="Sake House" address="2230 1st Ave, Seattle, WA" lat="47.612823" lng="-122.345673" type="bar"/>
    <marker name="Crab Pot" address="1301 Alaskan Way, Seattle, WA" lat="47.605961" lng="-122.340363" type="restaurant"/>
    <marker name="Mama's Mexican Kitchen" address="2234 2nd Ave, Seattle, WA" lat="47.613976" lng="-122.345467" type="bar"/>
    <marker name="Wingdome" address="1416 E Olive Way, Seattle, WA" lat="47.617214" lng="-122.326584" type="bar"/>
    <marker name="Piroshky Piroshky" address="1908 Pike pl, Seattle, WA" lat="47.610126" lng="-122.342834" type="restaurant"/>
</markers>

```
> 1 votes

---
Tags: google-maps-for-ee
---


# Question
Title: Can't log in to CP after installing Multiple Site Manager, can't switch sites
ExpressionEngine v2.5.2 Multiple Site Manager 2.1.4

I installed MSM 2.1.4 in an existing running version of EE 2.5.2.

It seemed to be installed OK, I was able to create a new site, but before I had a chance to do more I logged out.

When I came back I was unable to log in. The login panel seems to submit, clears its fields, but remains in place without logging in. Multiple tries make no difference

The only way I have been able to log in is by editing config/config.php and setting $config\['multiple\_sites\_enabled'\] = "n"; instead of y;

If, after I log in, I set MSM to "on", I can access the menu to edit or add a site, but I cannot switch to the site I've created, it stays on the current site.

Once I log out, I'm locked out again.

On looking through as many references to this problem as I could find on StackExchange and the Ellis Lab forum archives (apparently it's not an uncommon problem) I found that in most cases they say deleting cookies and clearing the cache, and/or resetting session security preferences solves the problem.

This hasn't worked for me.

I have:

• Tried clearing caches and deleting all cookies - on 4 different browsers (Safari, Firefox, Chrome, Opera) on two different computers (both running Mac OS X 10.6.8)

• Tried changing Security and Sessions CP Session Type and User Session Type - to all thee options, logging out and logging in again each time. In each case I can log in as long as Enable MSM is set to "No". If I set Enable MSM to "Yes" and log out, I'm locked out again, no matter what the Session Type; only able to log in if I reset it to no in the config file.

• Tried adding these values to config/congif.php (as per this post: Can't login to CP after logging out ):

```
$config['cookie_domain'] = "";
$config['cookie_path'] = "";
$config['cookie_prefix'] = "";
$config['admin_session_type'] = "s";
$config['user_session_type'] = "c";
$config['require_ip_for_login'] = "n";
$config['require_ip_for_posting'] = "n";
$config['secure_forms'] = "n";

```

(No change - removed again)

I have successfully used MSM before on another site on the same web host (HostMySite.com).

Has anyone else encountered this problem to this level?

# Answer
> 6 votes
Found it.

Turned out to be a setting left over in config.php.

When the original site was constructed, I was using one of those temporary URLs that hosting companies often provide for viewing sites before domains are pointed at them.

The original setting for the temporary URL was still in the config.php setting for 'cp\_url'.

Apparently, changing the site URL in General Configuration from the temporary URL to the final domain name did not replace the URL in config.php (at least in EE 2.5.2).

This was enough to create both the login lock-out and inability to switch sites whenever MSM was enabled.

# Answer
> 0 votes
I believe you will need to upgrade your version of ExpressionEngine. You have the newest version of the Multi Site Manager (MSM 2.1.4), but an older version of ExpressionEngine (2.5.2). This has been known to cause some issues (occasionally). See errors and other reports from Ellis Labs forums.

If you can't update EE, then you may want to check with Ellis Lab if they can provide you with an older copy of MSM (to downgrade) to see if that works for you.

You didn't mention, but its worth a check, 'Did you properly configure 'index.php' and 'admin.php' to work with MSM?' It's also possible that your getting logged out because none of the sites are set-up properly. Turning off MSM would allow for a general configuration to stand, but with MSM, both the 'admin.php' and 'index.php' files need to be modified to work with the various sites, including the 'main' site.

# Answer
> 0 votes
You shall also take a look at the admin.php file from your main install, some values might be overwritten with the new site. It happen to me once. Verify that each admin.php has the values according to the site they are assigned to.

---
Tags: multi-site-manager, login
---


# Question
Title: How to create a global configuration page for my custom field type?
I have created a custom field type which integrates with a web service. I need to create a simple interface which allows the User ID and API key to be configured globally.

Will I need to create a module for this?

A simple example would be greatly appreciated!!

# Answer
> 2 votes
You can create a configuration page for your fieldtype by including a `display_global_settings()` and a `save_global_settings()` which display and save the settings respectively.

When your fieldtype class is instantiated your current settings are passed to a public `settings` property. You access your current settings within the `display_global_settings()` method with `$this->settings['setting_name']`. To display the settings page, return a string containing the HTML. You do not need to include a form tag or submit button in the returned HTML, these will be added for you.

To save the settings, you will create a `save_global_settings()` method. This method should retrieve the values using the `$this->EE->input->post()` method. You can manipulate the settings however you need, or simply place them all into a single array. The value you return from this method will be saved to the database and set to `$this->settings` next time the class is instantiated.

You can set the default settings value by returning it from the `install()` method.

You can find some examples under the global setting section of the fieldtype developer docs.

---
Tags: add-on, module, plugin, fieldtype
---


# Question
Title: Assets 2 on MSM: Tags have no output on second site
I'm branching this off of another question: Assets 2 MSM Cannot Upload or view images

I'm not seeing any tag output from Assets in the second site.

I'm running EE 2.5.5 with Assets 2.0.5.

This is a site that I've been migrating from an older site, so it's a clean slate. It's not an upgrade. I've migrated entries into the new database and updated templates that I've copied in.

Yesterday I set up a second site using MSM. I'm using Master Config, so there were a few issues with paths for third\_party add-ons and templates, but those have been resolved. My templates are outputting correctly now.

I have content in a channel on the 1st site (Site1): That channel's name is `experience`. If I drop the following code into a template on Site1, it works fine, including outputting the URLs of the Assets field's image (`{event-story-gallery-image}`):

```
{exp:channel:entries site="default_site" channel="experience" orderby="event-story-sort-order" sort="asc" dynamic="off"}
<a class="story-link" href="/experience/story/{url_title}"><span class="view">View</span><span class="border"><!-- empty div --></span>
    <img src="{main_url}{event-story-gallery-image}" width="320" height="230" />
    <span class="caption1">{title}</span>
    <div class="divider"><!-- empty div --></div>
</a>
{/exp:channel:entries}

```

If I drop that same code into a template in Site2, everything outputs correctly **except** the `{event-story-gallery-image}` tag. That outputs nothing. It's not an incorrect path, it's just not outputting.

I have the following in Master Config:

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

$config['assets_cp_path'] = 'admin/';

```

To be able to view the CP under Site2, I have to change the master config as follows:

```
// $base_url = $protocol . $_SERVER['HTTP_HOST'];
$base_url = 'http://ee2.morinsfinecatering.localhost:8888';
//$base_path = $_SERVER['DOCUMENT_ROOT'];
$base_path = dirname(__FILE__).'/../../../public';

```

That lets me see the CP correctly in Site2.

Accordingly, I changed my Assets settings as follows:

```
$config['assets_site_url'] = 'http://ee2.morinsfinecatering.localhost:8888/index.php';
$config['assets_cp_path'] = 'http://ee2.morinsfinecatering.localhost:8888/admin/';

```

I still cannot see my Assets files in the CP in Site2, nor get any output from the tags.

I've confirmed that the following in my config.php is the correct path as well:

```
$config['third_party_path'] = $base_path . "/client_ee/add-ons/system/third_party";
echo $config['third_party_path']; exit;

```

# Answer
After checking the first Control Panel and seeing that my Assets files did not display with those changes, I made the following changes:

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

$config['assets_cp_path'] = dirname(__FILE__).'/../../../public/admin/';

```

I'm now able to:

1. See my Assets files in Site1's CP.
2. See my Assets files output from the Assets tags in Site2.

I'm still unable to see my Assets files in the CP under Site2, but that's not a concern to me. The client will only work with the CP under 1 URL.
> 1 votes

---
Tags: templates, multi-site-manager, focus-lab-master-config, assets
---


# Question
Title: Referencing Playa Field inside a Matrix Field from another Channel
I am trying to reference an image field from blog posts (blog channel) to display on a staff profile page (pages channel).

On the blog post there is a matrix field "blog\_smile":

* **Column 1:** blog\_smile\_ortho (playa field - used to assign the staff member)
* **Column 2:** blog\_smile\_image (assets field - to assign image)

How could I be on the profile page and say:

1. Go look at the blog channel,
2. Look in the matrix field "blog smile" and find "blog\_smile\_ortho" entries that are the same entry id as the profile page you're on
3. Then get the "blog\_smile\_image" file from that same matrix field
4. And repeat this process up to 6 times working back from todays date.

Thanks for any advice you can give.

# Answer
This is possible, but limiting the output to just the last 6 photos is going to require some PHP in your template. So first go into your template’s preferences and enable PHP on Output.

Here’s the template code:

```
{exp:channel:entries channel="pages" ... }

    {!-- start the counter --}
    <?php $count = 0; ?>

    {!-- find the blog entries relating to this profile page --}
    {exp:playa:parents channel="blog"
                       field="blog_smile"
                       col="blog_smile_ortho"
                       orderby="date" sort="desc"
                       var_prefix="blogpost"}

        {!-- find the Matrix rows relating to this profile page --}
        {blogpost:blog_smile search:blog_smile_ortho="[{entry_id}]"}

            {!-- loop through the Assets images --}
            {blogpost:blog_smile_image}

                {!-- increase the counter --}
                <?php $count++ ?>

                {!-- only show this image if it’s within the first 6 --}
                <?php if ($count <= 6): ?>
                    <img src="{blogpost:url}" width="{blogpost:width}" height="{blogpost:height}">
                <?php endif ?>

            {/blogpost:blog_smile_image}

        {/blogpost:blog_smile}

    {/exp:playa:parents}

{/exp:channel:entries}

```

Hope that helps!
> 1 votes

---
Tags: ee2, matrix, playa
---


# Question
Title: Assigning a Value From One channel:entries Call To Be Used In Another
In my template I'd like to capture the entry\_id of my main channel:entries loop, because I have subsequent loops where I may want to avoid that entry in one case, and invoke it again in another. So I'm looking for some way to create a variable that will allow me to do this. But the only user-defined variables I've found so far are the preload\_replace ones, which happen before the channel:entries are run, so no good for my purposes.

Are there other user-defined variables I may have missed? How would you do this?

Thanks.

# Answer
> 1 votes
I think this is a job for Stash. We may leave the template with two channel:entries tags after all, but only because we're running out of time. This will be a ToDo if we run into performance issues.

In fact, you should be able to store the entire record in Stash, and not need a second channel:entries at all.

---
Tags: variable, template-scripting
---


# Question
Title: CartThrob Checkout - Create Account after order completes
Does anyone know if it's possible to allow a user account to create an account after they have completed their order and then assign that order to their newly created account?

Thanks.

# Answer
> 1 votes
You'd have to make an extension upon member registration. If you're using the native EE registration the hook would be member\_member\_register:

```
public function member_member_register($data, $member_id)
{
  $this->EE->load->add_package_path(PATH_THIRD.'cartthrob/');
  $this->EE->load->library('cartthrob_loader');

  if ($order_id = $this->EE->cartthrob->cart->order('order_id'))
  {
    $this->EE->db->update('channel_titles', array('author_id' => $member_id), array('entry_id' => $order_id));
  }
}

```

# Answer
> 0 votes
Yes it is.

On your `{exp:cartthrob:checkout_form}` just add `create_user="yes"`.

Make sure you map the appropriate fields in the Cartthrob backend.

You can read more about members in Cartthrob on their docs. http://cartthrob.com/docs/backend/members/index.html

---
Tags: cartthrob
---


title: Entry within an entry

text:
# Question
Title: Entry within an entry
I'm creating a newspaper style website. The homepage is made up of 'editions', each date should have a homepage with all the articles selected for that edition. I figure the best way to do this is with Playa.

I have a channel for articles, videos and graphics (listings in structure).

I've also created a channel for the editions (which is a listing in Structure), and using Playa you can select which articles, videos and graphics should be selected for that edition.

```
{exp:channel:entries channel="editions" dynamic="no" limit="1" show_future_entries="yes" start_on="{current_time format="%Y-%m-%d 00:00"}" stop_before="{current_time format="%Y-%m-%d 23:59"}"}

{home_main_article} (Playa field)
<h2>{title}</h2>
<div class="author">by {author} on {entry_date format="%d-%m-%Y"}</div>
<p>{article_content}</p>
{/home_main_article}
{/exp:channel:entries}

```

My issue is this: Articles created on dates that don't match the date the edition was created, don't show up. Even with `show_future_entries="yes"` set, they still don't show. This may be because of the home channel is set to only show the edition for that day... Essentially articles, videos and graphics should be able to be created on any day and linked to any edition, that edition should show the entry content.

# Answer
indeed the parts can be related with playa, the main edition could be fetched with year="" month="" and day="". you'ld need some logic with segment\_n conditionals and preload\_replace or switchee to check if the segments where filled in.

---

*Edit: examples added*

**Preload\_replace**

You can use `{preload_replace:varname="value"}` to set a variable that is instantly replaced in the entire template. Because it is instantly replaced, a second preload replace will not find any variable `{varname}` left in the template. However, simple segment conditionals are parsed earlier so we can use that to our advantage.

Say you have year in segment\_4 then you can check if segment\_4 is empty and set a preload variable accordingly.

```
{if segment_4==''}
  {preload_replace:p_year="{current_time format='%Y'}"}
{/if}
{preload_replace:p_year="{segment_4}"}

# if segment_4 is empty then {p_year} will hold the current year,
# otherwise it will hold the value from segment_4

```

You can then set the channel:entries parameter year="{p\_year}" and similar for month="" and day="".

**Switchee**

Another approach i have used somewhere, is using switchee on
`variable="{segment_4}/{segment_5}/{segment_6}`,
in combination with a crazy regular expression on the case value=""
to filter correct date ranges (only for year and month in this case).

```
{exp:switchee variable="{segment_3}/{segment_4}/{segment_5}" parse="inward"}
  {case value="#[12][0-9][0-9][0-9]/([0][1-9]|[1][0-2])/#"}
    // show archive year="{segment_3}" month="{segment_4}"
  {/case}
  ... other cases
{/exp:switchee}

```
> 2 votes

# Answer
I got it working using:

```
{exp:channel:entries channel="editions" dynamic="no" limit="1" show_future_entries="yes" url_title="{freebie_2}"}

   {home_articles show_future_entries="yes"}
     {title}
   {/home_articles}

{/exp:channel:entries}

```

The url structure is website.dev/edition/2013-04-01 (title of the edition)
> 0 votes

---
Tags: playa, structure
---


title: Bundle products with exp:resso store

text:
# Question
Title: Bundle products with exp:resso store
Can the bundle have a price that is different than the sum of the products' prices that make up the bundle?

Example: If I have 12 tracks at $1 each. Can the bundle product (the album that contains all 12 tracks) cost $10?

Also, do all products in the bundle have to exist and be purchasable on its own?

Example: If the bundle product (the album) has 14 tracks, I want 2 of those tracks to only be part of the bundle. The other 12 tracks can be purchased on their own, but not those 2 "bundle-only" tracks.

# Answer
> 1 votes
Store can certainly handle *bundled* products but the one gotcha is that each `bundle` will be a product in it's own right so Store (by default) will have no way of keeping track of individual item sales — tracks in this case. You can however easily set a different price for the bundle. Adrian and Justin have given a good answer on a similar scenario here:

> Since products are stored as channel entries, it's really easy to create bundles of product using Playa, or even standard EE relationships.
>
> Remember you can have multiple product channels. For example, with Tracks and Albums, you could create a channel for Tracks (which has a Store product fieldtype associated with it for individual track sales), and another channel for Albums (which also has a product fieldtype, and is related to the individual tracks.
>
> In your case you could also create a product channels for Tickets, Merchandise, and if you want to create some bundles containing everything, one more called Bundles or something similar, which can be related to any other product channel. How you display this on the front end is entirely up to you.
>
> The only downside to this is that it is not possible to keep track of stock levels for bundled products. If you are selling digital products this isn't an issue, and for physical products it really depends on your client's requirements.

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


# Question
Title: Expresso Store - Edit "Vendor TX Code" sent to Sage Pay
My client has very exacting demands on how the Vendor TX Code supplied to Sage Pay during checkout is formatted.

Is it possible to change this information?

Thanks in advance for any advice.

---

Thanks to Ian and Adrian I figured this out - my solution follows:

I duplicated the file Merchant\_sagepay\_direct.php renaming the class to reflect the new gateway.

In the \_build\_authorize\_or\_purchase method I added the line

```
$request['VendorTxCode'] = "ClientSpecificTag_" . substr($request['Description'],strpos($request['Description'], "#") + 1) . "_" . $this->param('transaction_id');

```

This structures the TXcode as per the clients requirement eg: ClientSpecificTag\_OrderNumber\_Transaction\_ID (order number is stripped from the description).

In order to allow refunds to work I had to add a new method:

I also added a new method

```
protected function _build_refund()
    {
        $this->require_params('reference');
        $reference = $this->_decode_reference($this->param('reference'));

        $request = parent::_build_refund();

        $request['RelatedVendorTxCode'] = "ClientSpecificTag_" . substr($request['Description'],strpos($request['Description'], "#") + 1) . "_" . $reference->VendorTxCode;

        return $request;
    }

```

Which ensures refund requests send the correct TX Code.

All tested and working fine.

# Answer
> 1 votes
Unfortunately this doesn't look to be possible from the Store interface. In the gateway itself it is pulling in the transaction ID and using that as the vendor TX code.

Gateways are designed to be plug and play however so there's no reason why you couldn't duplicate the existing gateway and then set the vendor TX code to be something specific other than transaction ID:

```
$request['VendorTxCode'] = $this->param('transaction_id');

```

# Answer
> 2 votes
Ian is exactly right. You can either edit the gateway directly, or you could create your own gateway class which extends the existing one and overwrites the VendorTxCode which is sent to Sage Pay.

This isn't something which I've heard of anyone doing before, normally the VendorTxCode is the same as Store's payment\_id which makes them easy to match up should you need to.

You shouldn't need to worry about refunds. Whatever you set the VendorTxCode to, Store will keep a record of that and sent it back to Sage Pay when necessary. Do a test to make sure, but I don't expect you will run into any issues here.

---
Tags: expresso-store, checkout
---


# Question
Title: What setting could make the 'Show Toolbar' link disappear?
Is there some preference field or setting in the CP that might make the 'Show toolbar' link to disappear from the publish page? Mine has vanished for a particular custom member group (the only group that I'm using apart from Superadmins), although it shows up fine when I'm logged in as an SA. This made me think that it was something in the preference settings for that particular member group, but AFAICT nothing in that long settings list deals with the ability to customise publishing layouts.

Any ideas?

# Answer
> 2 votes
this is by design. Only Super Admins can see the 'show toolbar' link on the publish page as this is mainly for administration. Generally you only want users to focus on the content and not the layout of the page.

You can however log in as Super Admin, make the changes to the publish page layout, save for the Member Group that the other user belongs to and then hit Save.

---
Tags: members, publish-layout
---


# Question
Title: Can Cartthrob credits be used to reward customers?
I am planning a new site and the client would like to reward regular customers by giving the 'reward points' that can be redeemed at checkout.

Is this possible with credits? I am aware that DevDemon Credits can do this, just winging if CT can do it too.

Cheers

# Answer
It is but you'd need to buy the separate Cartthrob Credits module or use DevDemon Credits. Natively it's not supported unless you build your own module to handle that.
> 1 votes

---
Tags: cartthrob
---


# Question
Title: How do I get the full Assets URL from Low Variables?
I'm having trouble getting the full URL to an image using Low Variables and Assets.

Using the short name of the variable just returns the file name without the rest of the path. `{lv_my_image}` renders as `image.jpg` not `http://site.com/images/image.jpg`.

I've tried several ways to do this.

```
{lv_my_image} = image.jpg
{lv_my_image:url} = {lv_my_image:url}

{exp:low_variables:pair var="lv_my_image"}
  {url} = *nothing is returned*
  {assets:url} = {assets:url}
{/exp:low_variables:pair}

```

# Answer
Turns out my problem was the `{exp:low_variables:pair}` tag was nested in a `{exp:channel:entries}` tag. To fix this you have to use the `var_prefix=""` parameter.

```
{exp:low_variables:pair var="lv_my_image" var_prefix="assets"}
  {assets:url}
{/exp:low_variables:pair}

```

With this syntax you can access all of the Assets' tags.

```
{exp:low_variables:pair var="lv_my_image" var_prefix="assets"}
  <img src="{assets:url}" width="{assets:width}" height="{assets:height}" alt="{assets:alt_text}">
{/exp:low_variables:pair}

```
> 11 votes

---
Tags: assets, low-variables
---


# Question
Title: CartThrob Price Modifier Not Adding Price
I have a CartThrob price modifier being output in an EE template and everything displays fine. The problem is that no matter what, the price modifier isn't doing anything to the actual price of an item.

Here's the template code for the price modifier:

```
{exp:cartthrob:item_options entry_id="{embed:entry_id}"}
{if dynamic}
    <div class="form-item">
        <label>{option_label}</label>{input}
    </div>
{if:else}
    {if options_exist}
        <div class="form-item">
        <label>{option_label}:</label>
        {item_options:select}
            <option {selected} value="{option_value}"> {option_name}{if price} {price}{/if} </option>
        {/item_options:select}
        </div>
    {/if}
{/if}
{/exp:cartthrob:item_options}

```

# Answer
> 3 votes
The issue was that in the setup the client had added a dollar sign to their prices. For some reason, CartThrob changes values with $ into 0 so the price update wasn't taking effect.

tldr; ensure the prices within your Price Modifier field are numbers (float, ints, etc) only.

---
Tags: cartthrob, price-modifier
---


# Question
Title: CartThrob Per User Limit Discount and Logged Out Useres
I'm trying to setup a discount in CartThrob so members can get 10% off their order. This works gang busters for those members but, for logged out members, the discount shows up and is applied. Is there a way to have a User Limit Discount *not* apply to logged out members?

# Answer
To get around this, you just have to ensure that there is a value of zero (0) in the Redeemed by list. Mine now looks something like this:

1|4|39|0|6

(Note that 0 above).
> 2 votes

---
Tags: cartthrob, discounts
---


title: WYGWAM field disappearing in IE8, IE9

text:
# Question
Title: WYGWAM field disappearing in IE8, IE9
We are having an issue where WYGWAM fields are disappearing on initialization of the js in the Edit Entry screen in the control panel. This is only for IE8 and IE9; other browsers work fine. This behavior is consistent whether we let the fields initialize on load or if we initialize on focus (in which case, the field's content loads and is visible, but disappears on click).

The channel contains a series of Matrix fields, including WYGWAM, Assets, and Playa fields. We are running an install of EE2.5.5, Matrix 2.5.3, Playa 4.3.3, and Assets 2.0.5.

In the browser console, we are seeing the following two errors:

* Not enough storage to complete this operation. ckeditor.js, Line 13
* Object doesn't support this property or method. compressed.js; Code: 0; Line 39.

Note, turning off nsm\_morphine\_theme where the compressed.js code resides eliminates the second js error, but does not resolve the issue above.

Here is a screen shot per Lisa Wess' request below. It is the Text field which has the Wygwam field type; the other empty fields simply do not have data entered in them.

------------------------------- UPDATE -------------------------------

There are two issues, both of which *appear* to be related to upgrading to Assets 2.

First, on upgrading we have the same issue as this: Clicking on folders in the Assets 2 file manager does not work on IE8.

Applying the hack Kevin Lees suggests takes care of the issue where the Assets 2 dialog box will not allow the user to select items from the popup.

The second, original issue -- that the Wygwam fields are not instantiating -- appears to be related to the control panel page making over 31 CSS calls; IE8/9 have a hard limit of 31 CSS calls, ignoring any calls above that number.

I believe this behavior is related to a change in Assets 2, which introduced a number of small, separate style calls in the head. No bid deal, except IE8/9 is counting each against the total. Therefore a page with multiple matrix and assets fields pushes past the 31-call limit.

Short of downgrading to Assets 1, the only fix we've found is to force the user to use Compatibility mode, which doesn't impose the 31-call limit.

I would be curious to hear if anyone else is having this problem or has found a better, long-term solution.

# Answer
P&T has some related fixes coming in future updates which may well solve these issues. Our final fix was to simply replace the Assets field type with the native file manager and Wygwam with EE's Rich Text field type. Bare bones, but now functioning correctly in IE8/9.
> 1 votes

# Answer
Sounds like our client is having a similar issue with IE9 and Windows 7. The WYGWAM field disappears when initialising.

I used browserstack to try it and it does disappear. I tried compatibly mode too but it didn't fix it. If you delay initialisation you can see the content but as soon as you click in the WYGWAM filed it goes.

Are there any other work arounds?
> 0 votes

---
Tags: matrix, wygwam, error, ie8
---


# Question
Title: How to make jquery UI Tabs + Google Maps for ExpressionEngine play nice together
Anyone have any ideas how to make this work?

Here's my live test example.

My example demonstrates Google Maps (almost) in action within jQuery UI tabs. Notice that the maps don't fully initialize in each tab. I know there's lots of questions and answers on this issue out there, but none of them apply to the way Google Maps for EE does it's thing with Google Maps API v3.

Any help would be forever and greatly appreciated :-)

# Answer
Your issue is answered here I believe: https://stackoverflow.com/a/3066751/135935

I recently fixed the same problem by changing my CSS to use the off-left positioning suggested in the answer. Worked perfectly.

> Use the off-left technique for hiding inactive tab panels. E.g. in your style sheet replace the rule for the class selector ".ui-tabs .ui-tabs-hide" with
>
> .ui-tabs .ui-tabs-hide { position: absolute; left: -10000px; }
> 2 votes

---
Tags: jquery, google-maps, google-maps-for-ee
---


# Question
Title: Fatal error: Maximum execution time of 90 seconds exceeded... codeigniter/system/core/Loader.php on line 846
I am running ExpressionEngine 2.5.2, was working on my site last night, tested everything, and all seemed to be running just fine. However, today when I try to navigate around the site, my pages are loading extremely slow. On a couple of the pages, I am receiving this error:

Fatal error: Maximum execution time of 90 seconds exceeded in /var/www/vhosts/cutandpaste.com/system167/codeigniter/system/core/Loader.php on line 846

This is what is on line 846 in Loader.php:

```
// Does the file exist?  No?  Bummer...
if ( ! file_exists($filepath))
{
   continue;
}

```

This error came up out-of-the-blue, and I have no idea where to start with fixing it.

# Answer
There is some processing going on somewhere in your system which is taking a long time and or is pretty intensive. What addons are you using and are you doing any large image/video processing at all?

That message is just saying that the process was timed out. You can try upping your execution times in your PHP config. Trying increasing `max_execution_time` in your php.ini file to see if this helps.

Failing that on line 96 of system/codeigniter/system/core/codeigniter.php there is a timeout override which is set to 300 by default. You can also try increasing this.

It could be beneficial to determine what exactly is taking the time to process however so I'd probably try disabling all addons first and testing again. It will just be a case of trial and error to try and find the culprit.
> 3 votes

# Answer
Your question is impossible to answer without have direct access to your install so all I can provide are troubleshooting steps I would take.

I'd start by contacting your web host to see if they are having issues on their servers or have changed anything on the server. A change/issue on their end would explain the sudden sluggishness if nothing in the actual install changed. The error is happening because the script can't execute within the set 90 seconds. You can increase the value in your php setting but I doubt that will fix your sluggishness. The error is a result of the sluggishness, not the cause.

I'd also take a look at your PHP error logs to see if anything obvious is showing up.

Another thing to check is the speed of you EE control panel... in the footer you will see the execution time for the page... eg: Script executed in 0.4833 seconds. If the CP is speedy but the front-end is slow, you should start looking at things that affect the front-end only. If the CP is also slow, the cause is most likely not anything related to EE and your web host is the person to call.

Also check the Network tab in your browser's dev tools to see exactly what is slow? Is it the initial GET request? downloading of external JS?

What does running a tracert show? Any network issues between you and the server?
> 1 votes

---
Tags: error, codeigniter, loading-time
---


title: matrix add image

text:
# Question
Title: matrix add image
I am unable to add even a single image when trying to publish or edit content. Clicking the "Add Image" link does nothing. I'm assuming this something to do with my EE installation, but can find anything to help fix it. I opened a JavaScript console and the following errors do display:

```
Uncaught TypeError: Object [object Object] has no method 'corner' template_variables.js:6
(anonymous function) template_variables.js:6
m jquery.js:43
l.fireWith jquery.js:44
b.extend.ready jquery.js:33
k.addEventListener.A jquery.js:42
yui: Modules missing: oop,event-custom-base,dom-core,dom-base,selector-native,selector,node-core,node-base,event-base,event-delegate,node-event-delegate,node-pluginhost,dom-style,dom-style-ie,dom-screen,node-screen,node-style,json-parse,json-stringify,pluginhost-base,pluginhost-config, 21 Controller_default_d34ceebffe812545808c75cbba886977.js:1
yui: Modules missing: pluginhost-base,pluginhost-config, 2 Controller_default_d34ceebffe812545808c75cbba886977.js:1

Uncaught TypeError: Object [object Object] has no method 'tablesorter' compressed.js:39
(anonymous function) compressed.js:39
m jquery.js:43
l.fireWith jquery.js:44
b.extend.ready jquery.js:33
k.addEventListener.A jquery.js:42

```

Any help would be greatly appreciated.

I am using EE 2.5.2 and Matrix 2.5.3

Thank you!

Keith Miller

# Answer
It sounds like your install of the Matrix addon is missing something.

I suggest you start over by reuploading the theme files into /themes/third\_party/matrix and the addon files to /system/expressionengine/third\_party/matrix.

Then in your control panel navigate to Addons \> Fieldtypes and uninstall then reinstall Matrix.

Make sure to backup your database if you are concerned about losing any data.
> 1 votes

---
Tags: matrix
---


# Question
Title: Enter prices tax-inclusive, and reverse engineer the tax?
I have a client who very much want to be able to enter the prices in Exp-resso Store tax-inclusive, and then calculate how much the tax will be on the order confirmation page.

I know it's not built in, but has anyone done anything like this, or do anyone have any ideas if it'd be plausible in any way?

I'd prefer to not have to hard code any values, I want the client to be able to update tax rates by product groups.

Any advice would be appreciated!

# Answer
> 1 votes
Prices should always be entered ex-tax in the CP, and as Ian mentioned, you can use the `_inc_tax` variables to display the correct amount to the customer, like:

```
{price_inc_tax}

```

It is also not currently possible to specify different tax rates per product group.

However, without going into too much detail, both tax-inclusive prices in the CP and different taxes rates per product category will be in the next version of Store. We don't have a planned release date yet though so your best bet is to work with the tax-exclusive pricing for the time being.

# Answer
> 1 votes
I'd recommend that when entering product prices they're entered *without* tax and then you can choose whether to include tax in the product prices when displayed in your templates or not with a simple tag:

```
{price_inc_tax}

```

If you want to summarise this on the order confirmation page there are tags for that too:

```
{order_tax}

```

You can pretty much use any of the existing tags and simply append '\_tax' to display the tax rates including for sub-totals, shipping, etc.

The only tricky bit I see is the bit where you mention about applying tax rates per product group. In most carts tax rates are applied by country or region so doing it by product group could be trickier. Is there a particular reason for that?

I guess if you know the tax rate for a product group and have a way of tagging it as such (using a category, a custom field, or a custom channel) then you could just use the standard Store tags and then a little calculation to add/deduct the tax percentage.

# Answer
> 0 votes
You would need to have a custom extension to handle something like this. You would want to use the store\_process\_product\_tax hook to check which category (channel or whatever you are using to distinguish product groups) to calculate the required tax amount.

---
Tags: expresso-store
---


# Question
Title: Additional <BR>s When Using LibrarEE For Custom Emails
I'm working my way through customising system notifications - new blog post etc.

If I send my HTML through the `tools > communicate` option it comes through looking fine. If I send it as a regular notification via LibraEE is comes through with a bunch of `<br>` tags all through it. Sometimes 8 `<br>` in a row. And sometimes it's adding in `<td><br></td>`.

LibrarEE has a preview function and the email looks fine there.

Can anyone suggest where to go to try and find where to resolve this issue?

Thanks.

EE2.5.5

LibrarEE 1.0.5

# Answer
> 3 votes
To fix this - turn off the setting for :

Enable parsing of HTML user notification emails

This will fix the issue.

Regards,

Carl

---
Tags: ee2, email
---


# Question
Title: Assets not able to create good gif/png thumbnail
I'm using assets to take care of images In the view of assets all thumnails of png and gif's don't show only the jpg's

I tried to see if it would work with the EE file upload and there it works fine

Is there a setting I should enable that i have missed or is this a bug?

EDIT: i forgot to say that when viewing the image of png or jpg with their tag in the template then they show correctly

Thanks!

# Answer
> 2 votes
Can you send an email to support@pixelandtonic.com referencing this question and include one of the images that don't render for you?

I can't reproduce this on my local Assets install.

Thanks, Andris

# Answer
> 0 votes
It's worth checking that the /system/expressionengine/cache/ directory is writable (777 permissions) and that you have the GD/GD2 library installed. Place a phpinfo.php file in the site root and view it's output to check.

---
Tags: assets, thumbnails
---


# Question
Title: Hide menu item if no results for a certain channel
I'd like to hide a menu item called 'Events and Activties', if there are no entries in that particular channel. I've tried to do this using this code but it's not working:

```
<ul class="nav-bar">
                    <li class="{if segment_1 !=""}not-{/if}current"><a href="{path=/}" class="main"><span>Home</span></a></li>
                    <li class="{if segment_1 !="case-studies"}not-{/if}current"><a href="{path=case-studies}" class="main">People <span>in {lv_siteSector}</span></a></li>
                    <li class="{if segment_1 !="job-profiles"}not-{/if}current"><a href="{path=job-profiles}" class="main">Careers <span>in {lv_siteSector}</span></a></li>
                    <li class="{if segment_1 !="ask-an-expert"}not-{/if}current"><a href="{path=ask-an-expert}" class="main">Ask <span>an expert</span></a></li>
                    <li class="{if segment_1 !="jobs-opportunities"}not-{/if}current"><a href="{path=jobs-opportunities}" class="main">Jobs & <span>opportunities</span></a></li>
                    {exp:channel:entries channel="choices_events" site="default_site" show_future_entries="yes" show_expired="no" status="open"}
                        {if count == 1}
                        <li class="{if segment_1 !="getting-started"}not-{/if}current"><a href="{path=getting-started}" class="main">Events & <span>activities</span></a></li>
                        {/if}
                    {/exp:channel:entries}
                </ul>

```

Any help would be very much appreciated.

Thanks,

Julie

# Answer
Expression Engine will be trying to determine the parameters for your channel entries tag dynamically from the url so you need to turn this off. You can do that with the `dynamic="no"` parameter. You probably should just get one entry to save on overhead using `limit="1"`. This will also simplify your code as you won't need to use the count conditional. Adding the disable parameter will further optimise things by turning off the data you don't need such as categories, member data and custom fields. Try using this code:

```
{exp:channel:entries channel="choices_events" site="default_site" dynamic="no" limit="1" show_future_entries="yes" show_expired="no" status="open" disable="custom_fields|categories|member_data"}
  <li class="{if segment_1 !="getting-started"}not-{/if}current"><a href="{path=getting-started}" class="main">Events & <span>activities</span></a></li>
{/exp:channel:entries}

```

You may need to exclude custom\_fields from the disable parameter if you need to use any fields you've defined for the channel.
> 2 votes

---
Tags: channel-entries, no-results
---


title: Config setting for disabling page cache

text:
# Question
Title: Config setting for disabling page cache
Is there a config setting for disabling page cache in EE? I've found a setting for disabling tag caching `$config['disable_tag_caching']` but not one for pages. I'm using the Focus Lab master config setup and would like to easily turn off page caching in development. I usually use CE Cache and are missing this option.

# Answer
I worked around this on an EE1 site by setting the cache directory of the dev site to have read-only permissions and it works fine. However, I've not tried this on an EE2 site yet...
> 1 votes

# Answer
It doesn't look like it. Seems someone else already asked the same thing over on the EL forums. The request makes perfect sense though. http://ellislab.com/forums/viewthread/198408/#932976
> 1 votes

---
Tags: config, cache
---