# Question
Title: What is the best way to start using hooks?
I've used EE for a while now but I'm new to creating extensions or modules. I want to add a functionality where a bunch of email addresses stored in a database get notified when an entry is submitted in a particular channel. I've scanned docs and other sources and determined a module was my best bet.

I've started my module following the official tutorial. I've also found pkg.io which is very useful to kickstart module development.

My issue is that I can't figure out how to use hooks the way I want to. It seems that the entry\_submission\_end hook is the one I'm looking for, but I'm missing where `$this->extensions->call('entry_submission_end', $this->entry_id, $this->meta, $this->data);` should be included.

I've searched for tutorial on modules or extensions development using hooks but didn't not find any reliable or clear source that could help me. Thanks!

# Answer
> 2 votes
If you look at Activating & Updating in the Extensions documentation, you'll see in the code example that the data passed to the Insert query contains a reference to an ExpressionEngine hook. That database entry will enable your extension to be called when that hook is triggered.

All available hooks are documented here.

# Answer
> 2 votes
Yes, it can be a bit tricky to get into it at first. What you're looking for are the Extension docs: http://ellislab.com/expressionengine/user-guide/development/extensions.html

An extension can be included alongside a module.

The code that you posted is the actual code called within EE when loading any extensions attached to that hook. Thus all the parameters shown (after the first) are what you'll have access to within your extension.

---
Tags: add-on-development, module, extension, entry, hook
---


# Question
Title: Assets doesn't upload files larger than 2Mb
this problem only occurs in my local MAMP PRO 2 environment.

Assets acts like it's working (I see the progress bar till the end) but then no files!

NOTE THAT On my staging/production environment it's working!

my local settings : Assets 1.2.2 EE 2.5.3 PHP 5.3.20

in the logs when I try to upload I get this error (in apache logs)

\[Wed Mar 06 19:26:41 2013\] \[notice\] child pid 1425 exit signal Segmentation fault (11)

# Answer
> 3 votes
See here: https://stackoverflow.com/a/6135485/462702

You need to increase PHP's maximum upload size. This is nothing to do with Assets (otherwise it would be broken in your development environment too).

You need to change TWO settings (PHP will use the lowest). You can either change them in `php.ini` (preferable, if you have access to it), or your `.htaccess` (changing the values in your `.htaccess` won't always be allowed by your host). If neither option is available to you, you need to contact your web host.

Either set these in `php.ini`:

```
post_max_size=20M
upload_max_filesize=20M

```

Or add these to your `.htaccess`:

```
php_value post_max_size 20M
php_value upload_max_filesize 20M

```

You can check the current values by going to the EE CP Tools \> Utilities \> PHP Info and searching for the settings. I'd bet that one of them is currently set to 2mb :)

# Answer
> 2 votes
Try adding the following to your .htaccess file:

```
php_value memory_limit 128M

```

---
Tags: assets
---


# Question
Title: Channel tag showing future entries but show_future_entries is not set to yes
I have an entry showing a start time of 1:00pm today (current local time is 10:04am CST). The server time using php date is showing the same as our current local time.

This is my channel entries tag:

> {exp:channel:entries channel="general" category="4|14" orderby="date" sort="desc" limit="2"}

If I change the entry date to tomorrow, it doesn't show up. But when I change it to today's date with a future time, it shows up.

Now I've just taken a look at the template on the Sync Templates page and it says it was last saved at 4:00pm (I just saved it at 10:09am).

My php ini file says the timezone is America/Chicago for both Local and Master Value.

Any thoughts on what's going on here?

**Updated:**

I will check on SSH access. It's on Enginehosting but my set up doc is not accessible at the moment.

The entry was set for 1:00pm when it was created at 10:00am because we didn't want it to show up until the afternoon.

The Localization settings have not been changed at all (except when we first set the site up last year).

The user and I were logged in with the same username/pass.

# Answer
> 1 votes
Go to Admin, Localization Settings. Check that Server Time Zone is correct there and that the DST setting is correct.

**Update:** Within your `exp:channel:entries` output, compare `{entry_date}` to `{current_time}` to see if those match your expectations. See Current Time.

> ah yeah, there's a clue - the current\_time says 4:37pm while entry\_date is 1:00pm. So does that sound like the server time is off and I need to add an offset to the Localization Settings?

What sort of server do you have? Do you know where the host is located? Trying to figure out how best to validate:

> The server time using php date is showing the same as our current local time.

Is it a server you have SSH access to?

Did you change localization settings after the entry was created? I'm not sure that would trigger an update of the entry's date values. What happens if you edit the entry again? The offset may be stored in the actual entry as well.

Also -- Does the user who created the entry have a different time zone set? I've had that bite me before too.

This stuff is a pain in EE.

---
Tags: channel-entries, time
---


title: Can't delete forum threads

text:
# Question
Title: Can't delete forum threads
I'm trying to delete a forum thread using Forum Module v 3.1.10 and EE 2.5.2 and after I hit the delete confirmation button I get redirected to the site's home page which is blank. Refreshing the page brings up a dialogue for confirming form submission, and I get returned to the blank page.

If I manually change the URL in the address bar and then return to the forum, the thread is still there. So I'm unable to delete forum threads.

Turning on debugging in index.php isn't showing any errors.

Anyone else had this problem before?

# Answer
> 1 votes
Are you using .htaccess to either add or remove a trailing slash from your site URLs? If a request gets rerouted in that manner it gets stripped of the POST data, so that might be one possibility.

On a site where I was **adding** a trailing slash (which I do not believe is the default behavior any more), I added a condition to the rewriterule (second line below) in `.htaccess` file to NOT redirect a request if it had POST data:

```
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [L,R=301]

```

That patched the forums up and I haven't noticed any side effects.

---
Tags: forum
---


# Question
Title: Zoo Visitor Edit Profile: if field == problem
How do I check a member field for an answer, and if the answer is there display a new filed.

I am building a 2 page sign up with Zoo Visitor and the second page asks a question based on your answer in the first page.

```
{if custom_field_name == "ANSWER" }
<div class="category_select">
<category_menu>
<label for="categories">Ask Question?</label>
<select name="category[]" id="categories" size="4" multiple="multiple">
<select_options>
</select>
</category_menu>
</div>{/if}

```

# Answer
SOLVED:

```
{if "{custom_field_name}" == "ANSWER" }

```
> 1 votes

---
Tags: members, zoo-visitor
---


title: Assets 2.0.5 not indexing

text:
# Question
Title: Assets 2.0.5 not indexing
Just installed Assets 2.0.5 on EE2.5.2.

When I click 'update indexes' I get no loading bars.

I have checked my .htaccess file, which shouldn't interfere:

# EE-supported method for removing index.php

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

```
    # If 404s, "No Input File" or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)

```

# EE 404 page for missing pages

ErrorDocument 404 /index.php/404/index

# Simple 404 for missing files

ErrorDocument 404 "File Not Found"

RewriteCond %{QUERY\_STRING} sr= RewriteRule (.\*) http://www.kontera.com/$1? \[R=301\]

# Answer
> 1 votes
4midori -

I just logged in and went to Update Indexes. I got all of the progress bars and all of them updated just fine. They're now showing up in the sidebar.

Is everything working for you now?

# Answer
> 1 votes
4midori -

Can you please check that /system/expressionengine/cache and its subfolders are 777 permissions? We see this most often when permissions are off.

Also, if you're using local folders, please make sure you also synchronize them in Content -\> File Manager -\> File Upload Preferences before attempting to Update Indexes.

---
Tags: assets
---


title: Output plugin result as template tag

text:
# Question
Title: Output plugin result as template tag
I have read ExpressionEngine documents and I am fairly comfortable while creating plugins. However I had a requirement in which I wanted my plugin to output data as a template tags. Like,

```
{exp:awesome_plugin}
    {awesome}{awesome} {!-- outputs the data set for awesome tag. --}
    {really}{really}
{/exp:awesome_plugin}

```

Is this possible?

# Answer
Yes this is possible. It took me a while to find some documentation when I first tried to do it within a plugin. You need to look at the docs for the template class instead of the plugin API. Specifically the section for variable pairs.

You need to create a multidimensional array that contains the different rows for your variable pair. Here's some relevant sections from a plugin I wrote that displays a gallery that's created using matrix, assets and playa. I've simplified it a lot but hopefully you will get the idea.

In the first bit of code I've done a database query to get my assets and then looped through the results to create the variable pair array:

```
$assets_array = array();
if ($assets_query->num_rows() != 0)
{
  // loop through assets and create an array indexed with the associated matrix row_id
  foreach ($assets_query->result() as $row)
  {
    $assets_array[$row->row_id][] = array('image_url' => $this->EE->typography->parse_file_paths($row->file_path),
                                  'alt_text' => $row->alt_text
                                          );
  }
}

```

When I create the single vars for the main tag, I loop through the query result for the matrix rows and create a var that contains the assets array.

```
foreach ($matrix_query->result() as $row)
{
    $vars[] = array(
       'row_id'       => $row->row_id,
       'entry_id'     => $row->entry_id,
       'image'        => $assets_array[$row->row_id],
    );
}

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

```

Then in my template I can do something like this:

```
{exp:sp_gallery}
    {image}<img src="{image_url}" alt="{alt_text}"{/image}
{/exp:sp_gallery}

```

Hope that helps.
> 4 votes

# Answer
Yes, you can use the Template Class for it. See here how to create paired tags:

http://ellislab.com/expressionengine/user-guide/development/usage/template.html#parsing-variables
> 1 votes

---
Tags: templates, plugin, tags
---


# Question
Title: Problems with tag pair in pt_multiselect
Trying to use the tag pair feature of pt\_multiselect (1.0.3 installed on EE 2.5.5) and it doesn't seem to be working correctly

When used as a single tag I get a list of the selected options, however when used as a tag pair so we can tailor the output (and create links) nothing is shown

Works:

```
{regional_links}

```

Doesn't work:

```
{regional_links}
    <li><strong><a href="{option}">{option_name}</a></strong></li>
{/regional_links}

```

The list of data in the admin is formatted correctly with a a colon delimiting the name and the label and is showing fine in the content add / edit screen.

Data:

```
/asia_pacific/index : Asia Pacific About
/asia_pacific/people : Asia Pacific People
/asia_pacific/locations : Asia Pacific Locations
/asia_pacific/history : Asia Pacific History
/asia_pacific/showcases : Asia Pacific Showcases
/asia_pacific/expertise : Asia Pacific Expertise
/asia_pacific/partners : Asia Pacific Partners
/asia_pacific/contact : Asia Pacific Contact
/northern_europe/index : Northern Europe About
/northern_europe/people : Northern Europe People
/northern_europe/locations : Northern Europe Locations
/northern_europe/history : Northern Europe History
/northern_europe/showcases : Northern Europe Showcases
/northern_europe/expertise : Northern Europe Expertise
/northern_europe/partners : Northern Europe Partners
/northern_europe/contact : Northern Europe Contact
/southern_europe/index : Southern Europe About
/southern_europe/people : Southern Europe People
/southern_europe/locations : Southern Europe Locations
/southern_europe/history : Southern Europe History
/southern_europe/showcases : Southern Europe Showcases
/southern_europe/expertise : Southern Europe Expertise
/southern_europe/partners : Southern Europe Partners
/southern_europe/contact : Southern Europe Contact
/north_america/index : North America About
/north_america/people : North America People
/north_america/locations : North America Locations
/north_america/history : North America History
/north_america/showcases : North America Showcases
/north_america/expertise : North America Expertise
/north_america/partners : North America Partners
/north_america/contact : North America Contact

```

I know this is an oldish plugin but it is somewhat useful and would be great to get it working.

I've tried a more simple list of

```
One
Two
Three

```

Which again works as a single tag to output a list of the selected items, but doesn't work in a tag pair loop.

Any help or suggestions on this are much appreciated.

# Answer
Try grabbing the latest version of P&T Fieldpack from github. It's now up to version 1.1. I just tried it with your values and it's working fine with the tag pair. If that doesn't work please post more of your template.
> 0 votes

---
Tags: add-on, pixelandtonic
---


# Question
Title: Populate channel field based on other fields arithmetics
Let's assume I have a “products” channel which contains 3 fields: price(number), discount(integer 1 to 100), discounted\_price(number).

Is there a way to populate the discounted\_price field in CP, based on price - (price * discount / 100)?

# Answer
> 1 votes
You'll want to handle this using jQuery/JavaScript in your field's instructions.

You can include HTML in the Instructions field for your custom field. So you can include:

```
<script type="text/javascript">
// Do some stuff
</script>

```

You can set your code to fire onblur on your fields, so that every time a field is updated, the JS runs, and calculates the value for the other field.

You can do a View Source on the entry screen to find all the field references you need for your jQuery code.

---
Tags: fields, pre-populate, math
---


# Question
Title: Pagination links on CP Module screen are not clickable
I'm working on a module that's outputting data using `$this->EE->load->library('table')`.

I'm passing this back to my `index()` function to render things:

```
return array(
    'rows' => $rows,
    'pagination' => array(
        'page_query_string' => TRUE,
        'base_url'    => $this->_full_url(), // My own function
        'per_page'   => 20,
        'total_rows' => $total_rows
    )
);

```

This is all working wonderfully. In fact, my pagination links are working wonderfully as well. They're generating URLs like this:

```
http://addons.clearbold.localhost:8888/system/index.php?S=a87b760ae58c317d28e7d1ebf3c8f374e89173a5&D=cp&C=addons_modules&M=show_module_cp&module=module_name&tbl_offset=20

```

And if I do a View Source and click the links enabled in the source view, they take me to exactly the page I want to see.

On the CP screen, though... I can hover over the links and see the right URLs in the status bar. My cursor switches to the hover state to show they're clickable. But when I click them – Nothing happens. The browser doesn't follow the link.

Why aren't they clickable? I've tried recent Chrome, Safari & Firefox versions.

Full pagination output:

```
</table><p class="tbl_513a025265a0f" id="paginationLinks"> <a href="http://addons.clearbold.localhost:8888/system/index.php?S=b8223938e000fecfb1e3065326d799591cd9bda9&D=cp&C=addons_modules&M=show_module_cp&module=module_name&tbl_offset="><img src="http://addons.clearbold.localhost:8888/themes/cp_themes/default/images/pagination_prev_button.gif" width="13" height="13" alt="<" /></a> <a href="http://addons.clearbold.localhost:8888/system/index.php?S=b8223938e000fecfb1e3065326d799591cd9bda9&D=cp&C=addons_modules&M=show_module_cp&module=module_name&tbl_offset=">1</a> <strong>2</strong> <a href="http://addons.clearbold.localhost:8888/system/index.php?S=b8223938e000fecfb1e3065326d799591cd9bda9&D=cp&C=addons_modules&M=show_module_cp&module=module_name&tbl_offset=40">3</a> <a href="http://addons.clearbold.localhost:8888/system/index.php?S=b8223938e000fecfb1e3065326d799591cd9bda9&D=cp&C=addons_modules&M=show_module_cp&module=module_name&tbl_offset=40"><img src="http://addons.clearbold.localhost:8888/themes/cp_themes/default/images/pagination_next_button.gif" width="13" height="13" alt=">" /></a> </p>

```

# Answer
> 1 votes
Thanks to one of my teammates for suggesting I disable CSS & JS to troubleshoot.

The table is AJAXified, which overrides the link values. I was missing this:

```
$this->EE->table->set_base_url('C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=module_name');

```

Which the AJAX links require to refresh the table.

---
Tags: control-panel, add-on-development, module, pagination, table
---


# Question
Title: EE1 - Copy Field Groups to another site in MSM or use them in another site template?
I need to copy a page to another segment in a site both in MSM on 1.6.8. I was just calling the

```
site="first-site"
```
from the second site template and using the info that way. The problem is that the markets have now separated direction. They want the same "page" only with different content and style. (lol)

There are a lot of fields and I would like to just copy the field group and possible the entry over to the other site being that the entry options will remain the same.

Any ideas? Besides just database manipulation...

Thanks guys.

# Answer
The question was answered in the comments above...

I ended up copying the db out and re-upping the DB to a single site (new requirement added), then pulling everything out that ws with site\_id of the other sites, changing the site\_id of the site needed, and running with it that way. As for the fields, I kept the fields needed from the original site and changed the site\_id number to match the new config and all sub tables related.

I will write this up when I get some time. (still buried)
> 0 votes

# Answer
MSM offers you the option to copy or move over field groups and content when you first create a new site if memory serves, but that is a one time offer, which it seems like it is unlikely to help you now, EXCEPT:

If you dig into the MSM code that handles that part of things it would make it a lot easier for you to work out the queries that you'd need to do it directly in the database.

Here is a starting point:

In cp.sites.php is a function called `new_site_form`, in that function is a section demarcated by a comment:

```
/**  New Site?  Allow Moving/Copying of Existing Data

```

That has the code that does the interface providing those options

in the function `update_site` is a comment:

```
/**  Moving of Data?

```

That appears to be the logic that actually moves the stuff.

I'm short on time so that's as far as I can take it, but hopefully it gives you a boost.
> 1 votes

# Answer
Doesn't MSM offer to duplicate templates and field groups for you when you create a new site? I think this was true under the 1.6.8 version as well as now. I just can't recall. But you can always test it under a test site. That way, you'll have should end up with everything you need, then just adjust the templates as needed.
> 0 votes

---
Tags: multi-site-manager, ee1, field-group
---


title: Automatic double spacing

text:
# Question
Title: Automatic double spacing
Is there a already a plug-in out there that will auto-magically check all content for double spaces after a period and force double spacing if not there? I know there are some out there like Low's find and replace. I was just hoping for an automated "drop in" type of work without the need to add tags to all the templates. Reason being, there are 973 templates in this inherited build. :(

It is in the process of a redesign/rebuild, but that is still some time out and this is a "need".

Thanks.

# Answer
First off... Thanks for the insight nonprofit\_tech...

I never followed up on this. I apologize. I ended up suggesting a process injection for them when they would like to use double spaces in fields that "auto-corrected" them by adding a ' ' followed by a normal keyboard space.
> 0 votes

# Answer
Unfortunately, and I use that statement loosely, I don't believe so. In fact, some of the WYSIWYG editors may even remove double spacing after a period. Why? Because, technically speaking its bad practice. Everyone who follows or attempts to follow the standard rules of typography, The Complete Manual of Typography: A Guide to Setting Perfect Type by James Felici) will point perhaps call it 'wrong'. But, historically, there are or were a number of reasons for the double space after period. But for the last 50-60 years that hasn't been true.

Double space after a period is works great with typewriters, because of monospacing. It's not a a good guideline for print and digital content. You just make more work for anyone who needs to parse and clean your data in the future. We clean a lot of data and our first step is:

> Step 1: Remove all erroneous extra spacing. This process removes double spaces after periods, tab-spaces (actual tab then space, like \t.. (the tab is a predefined space, random double or triple spaces between words and paragraphs, etc.

I could go all parseable text-Nazi on you, but I'll just say, when you are creating content that may need to be digital reused in different ways, including potentially switching content management systems sometime in the future, it's best not to have formatting that could hinder portability. Both HTML and XML have whitespace folding rules, which double spaces after periods can break.

That said, if your client is insistent that double-spacing after a period is required, I can see two possible options:

1. **Building your own Type Toolbar.** You could probably modify CKEditor and force the issue of double spacing, or
2. **Modify CSS.** It's probably possible to modify your CSS file so that a period space, resembles a double space, thereby keeping cleaner typographer, but still satisfying the clients visual requirements. I'm not certain if you can directly target the '.', but if not maybe ` ` and ` ` spacing.

There was an interesting conversation of Stackoverflow regarding a similar topic, a project requiring double spacing. It mentions the possibility of adding `<span>` to your sentences or `. ` (period-nonbreaking space-space).

Eric Meyer, quoted from a 2006 list serve email, argues that:

```
p {white-space: pre-wrap;}

```

could work as a solution. Practically everything suggested is pretty much a hack, since its not standardly supported, anywhere that I know of. Your own toolbar editor would probably give you the best implementation and control over this. I'd assume you would just need to modify one of the javascript files in CKEditor, to change `. space` to `.  ` which would give you the two space look, but still retain a single space for future proofing, word wrapping, alignment issues, etc.
> 5 votes

---
Tags: ee1, plugin
---


# Question
Title: How Do I get Multiple Pictures from Matrix for use in a JQuery LightBox?
I am tring to get Pixel and Tonic's Matrix plugin to deliver images to ColorBox / LightboxI have Matrix delivering single images to my JQuery LightBox ( ColorBox) but I can not get it to deliver multiple images so that I can run them as a slide show.. What am I doing wrong ? Here is the mark up I have so far. My images are all contained in multiple rows but a single column{cell\_1}:

```
{exp:channel:entries channel="gallery"}
{gallery}
<a class="gallery"  href="{cell_1}">Gallery</a>
{/gallery}
{/exp:channel:entries}

<script>
jQuery('a.gallery').colorbox();
</script>

```

Many Many Thanks !

# Answer
It sounds like you want one text link to open a slideshow of several images in Colorbox, correct?

You'll need to add those colorbox links to the HTML but hide them with CSS. They can be grouped by using the `rel` parameter like `<a href="img.jpg" rel="group1">`

Here's an example of using the rel attribute with Colorbox.

Alternately, you can group them by setting the rel parameter in colorbox like this:

```
$(".group1").colorbox({rel:'group1'});

```

Here's an example of that.

In terms of your EE template code, you could do something like this and add a "hide" class to each link after the first matrix row:

```
{exp:channel:entries channel="gallery"}
  {gallery}
    <a class="gallery{if '{row_count}' > 1} hide{/if}" rel="group1" href="{cell_1}">Gallery</a>
  {/gallery}
{/exp:channel:entries}

```
> 2 votes

# Answer
First, ignore the JS code that makes it work and be sure that you can output multiple images.

Based on your current channel:entries tag you are trying to get an entry from the gallery channel dynamically based on the URL. Is that what you want? Also, you're not outputting any image tags, and is your matrix column really called cell\_1?

What do you get when you do this - be sure to replace the starred bits.

```
{exp:channel:entries channel="gallery" entry_id="**actual_id_here**"}
  {gallery}
    {**actual_cell_name**}
  {/gallery}
{/exp:channel:entries}

```
> 2 votes

# Answer
You might try embedding the gallery, I've built similar galleries using this method.

My embed template:

```
{exp:channel:entries
 channel="{embed:listings}"
 category="{embed:listingcat}"
 orderby="date"
 sort="desc"
 disable="member_data|trackbacks|pagination"
 dynamic="no"
 }

    <ul class="gallery">
    {gallery_images}
        <li{if row_count == "1"} {/if}>
          <a href="{large}" rel="prettyPhoto[{url_title}]" title="{text}" >
            {exp:imgsizer:size src="{large}" width="160" height="105"}
               <img src="{sized}" width="{width}" height="{height}" alt="{title}" />
            {/exp:imgsizer:size}
        </a></li>
    {/gallery_images}
    </ul>

{/exp:channel:entries}`

```

Embed tag:

```
{embed="_embeds/_category_listings"
listingcat="{category_id}"
listings="portfolio"
}

```

Screenshot of the matrix field settings: http://d.pr/i/lSzr

Screenshot of the publish fields: http://d.pr/i/r6ko

HTML output:

```
<ul class="gallery">
    <li class="first"><a title="title" rel="prettyPhoto[invitations1]" href="/images/uploads/portfolio/img1.jpg">
    <img width="160" height="105" alt="Invitations" src="/images/sized/images/uploads/portfolio/img1-160x105.jpg">
    </a></li>
    <li><a title="title" rel="prettyPhoto[invitations1]" href="/images/uploads/portfolio/img2.jpg">
    <img width="160" height="105" alt="Invitations" src="/images/sized/images/uploads/portfolio/img2-160x105.jpg">
    </a></li>
    <li><a title="title" rel="prettyPhoto[invitations1]" href="/images/uploads/portfolio/img3.jpg">
    <img width="160" height="105" alt="Invitations" src="/images/sized/images/uploads/portfolio/img3-160x105.jpg">
    </a></li>
</ul>

```

Javascript call:

```
$(document).ready(function(){
    $("area[rel^='prettyPhoto']").prettyPhoto();
    $(".gallery a[rel^='prettyPhoto']").prettyPhoto({});
});

```

Hope that helps!
> 1 votes

---
Tags: matrix, jquery
---


# Question
Title: Is there a way to log entry deletions within EE?
The Control Panel Log doesn't seem to record this type of activity. Am I missing something?

# Answer
Not natively, no. But there are various extension hooks that you can tie into with a custom module to easily log to a file or database table.
> 4 votes

# Answer
If this issue is occurring on a frequent/regular basis, you could remove delete privileges from that member group to see if the issue goes away.

If you remove delete privileges, you can still accomplish taking content offline using Status. `status==closed` should disable content from appearing. Typically your editors should not be able to delete anything from the site, for reasons like this. They should have the power to take content off the site, but that's a much different action than a delete.

You could also see if Better Workflow supports more fine-grained options or the feature you're looking for.
> 2 votes

# Answer
You can use OmniLog together with custom extension as suggested by Michael.

The Control Panel logging solution is really missing for EE. I have a customer with problems similar to yours and also having hard time figuring out who's causing the problems. I think I will develop something eventually, but that's not my top priority for now.
> 2 votes

# Answer
I just posted Audit on Devot:ee. An add-on that tracks additional activity in the Control Panel, including entry deletes.
> 2 votes

---
Tags: users
---


# Question
Title: How to force installation of extension during module install
When installing a module how do you require it's extension to be installed at the same time and vice versa?

I did a google search and looked over the docs as well and didn't find anything. That doesn't mean it's not out there. Maybe I wasn't searching for the right terms.

# Answer
> 6 votes
This is a bit of an undocumented feature, but it works like this.

In your extension, add a class variable called `$required_by`, with an array of values:

```
$required_by = array('module');

```

('module' is actually the only acceptable array value here, as neither plugins nor accessories have installation routines, which are needed for this to work.)

Note that this *does not automatically install* (or later, uninstall) your extension. It just makes it clear that you can't install one without the other.

So your module's `install()` method must *also* install your extension (basically, everything you'd normally have in your extension's `activate_extension()` method). Likewise, your module's `uninstall()` method must contain everything your extension's `disable_extension()` method would normally have.

(These methods in your extension in this case should just `return true`.)

Have a look at the bundled Safecracker package for a good example.

---
Tags: add-on, add-on-development, module, extension
---


title: EE Search Problem

text:
# Question
Title: EE Search Problem
I have never had this issue before but I am working on a site and implimented a simple search form like this:

```
{exp:search:simple_form channel="about" result_page="site/search"}
<p>
<label for="keywords">Search:</label><br>
<input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100">
</p>
<p>
<input type="submit" value="submit" class="submit">
</p>
{/exp:search:simple_form}

```

When I enter a search term and click submit I get a blank page that says:

"Safari can't open this page mytesturl.com%20/ because the page's address isn't valid"

And see that it is in fact trying to go to mytesturl.com%20/

This makes no sense - tried a few things but no luck yet. Any thoughts?

Thanks!

Guy

# Answer
> 3 votes
Looks to me like you have a space after your 'URL to the root directory of your site' in 'Admin' \> 'General Configuration' settings.

---
Tags: search
---


# Question
Title: {current_time format="%Y"} not working with Low Variables
I've got a low variable which is correctly parsing channel entries tags, but for some reason will not parse {current\_time format="%Y"} no matter what settings I use (early parsing on/off). All it outputs is the raw code for that tag.

please advise

# Answer
> 3 votes
It's to do with the good old parse order. To get around it use the short version of the tag together with early parsing and it should work so simply {my\_var} instead of e.g. {exp:low\_variables:single var="my\_var"}

---
Tags: low-variables
---


# Question
Title: Assets modal window doesn't appear for WYGWAM insert image dialog
I recall when I installed Assets 1, WYGWAM's insert image dialog would then pull up the Assets file picker. That doesn't happen with Assets 2.0.5.

I'm using WYGWAM 2.7 on EE2.5.5.

Ben

# Answer
> 1 votes
You must force WYGWAM to use Assets and not File Manager:

Modules \> WYGWAM \> Settings - choose Assets obviously :P

---
Tags: assets
---


title: Need to "front load" Matrix content

text:
# Question
Title: Need to "front load" Matrix content
I have a (P&T) Matrix storing related entries from a channel where the entry\_date for each entry is being used as a go-live date. Each row with its related content and more displays as its own page.

I need to somehow grab this date or create a similar functionality within the matrix, to either close the row before a certain date, or be able to create display parameters that only show rows marked by this date or before.

The only sticking point right now is paging - which pages into rows where the related content is not yet live, and this shows empty images and content. I need to skip these instances entirely.

PHP is an option.

Thanks in advance for any tips, references, or advice that might solve this! Again, it's all about row-to-row paging, though I suppose a solution that worked for more than just paging would also be awesome.

Many thanks.

EDIT!

\`

```
    {the_matrix limit="1" sort="asc" row_id="{segment_4}"}
                <h3>{title} - <strong>Page {if page}{page}{if:else}{field_row_count}{/if}</strong></h3>
                <div class="pagNav">
                    {if prev_row}{prev_row}<a class="btnPrev btn" href="{path="the/path"}/{segment_3}/{row_id}" title="Prev">Previous</a>{/prev_row}{if:else}<a class="btnPrev btn inactive" href="#" title="Prev">Previous</a>{/if}
                {if next_row}{next_row}<a class="btnNext btn" href="{path="the/path"}/{segment_3}/{row_id}" title="Next">Next</a>{/next_row}{if:else}<a class="btnNext btn inactive" href="#" title="Next">Next</a>{/if}
                </div>
                <div class="navSearch">
                    <!-stuff->
                </div>
            </div>
            <div class="contentBar">
                <img src="{related}{field_content}{/related}" alt="{title} img" />
            </div>
            <div class="pagFooter">
            <h3><strong>Page {if page}{page}{if:else}{field_row_count}{/if}</strong></h3>

                <div class="pagNav">

                {if prev_row}{prev_row}<a class="btnPrev btn" href="{path="the/path"}/{segment_3}/{row_id}" title="Prev">Previous</a>{/prev_row}{if:else}<a class="btnPrev btn inactive" href="#" title="Prev">Previous</a>{/if}
                {if next_row}{next_row}<a class="btnNext btn" href="{path="the/path"}/{segment_3}/{row_id}" title="Next">Next</a>{/next_row}{if:else}<a class="btnNext btn inactive" href="#" title="Next">Next</a>{/if}
                </div>

            </div>
            {/the_matrix}

```

\`

So that's my Matrix code, abbreviated in obvious places. Hope it's helpful. I need to query this in such a way to prevent next\_row and prev\_row from pulling rows with related content that isn't live yet.

Thanks!

# Answer
If I understand your question correctly this is a job for Stash, (or a custom plugin). Split the template into two parts - the first part simply fetches all the data and stashes into variables, then the second part can output those variables along with some conditional checks to ensure the dates are valid.

This should be enough to get you started:

```
{exp:channel:entries channel="whatever" dynamic="no" limit="1"}

    {!--  ============================================
    fetch and stash the dataset into individual variables
    ================================================== --}

    {exp:stash:set_list name="dataset" parse_tags="yes"}
        {matrix row_id="{segment_4}"}

            {stash:the_title}{title}{/stash:the_title}

            {!--
            add further current row fields here
            in the form {stash:anything_you_like}{column_name}{/stash:anything_you_like}
            --}

            {stash:row_date}
                {related}
                    {entry_date}
                {/related}
            {/stash:row_date}

            {prev_row}
                {stash:prev_date}
                    {related}
                        {entry_date}
                    {/related}
                {/stash:prev_date}
                {stash:prev_id}{row_id}{/stash:prev_id}
            {/prev_row}

            {next_row}
                {stash:next_date}
                    {related}
                        {entry_date}
                    {/related}
                {/stash:next_date}
                {stash:next_id}{row_id}{/stash:next_id}
            {/next_row}

        {/matrix}
    {/exp:stash:set_list}

    {!--  ============================================
    start output
    ================================================== --}

    <ul>
        {exp:stash:get_list name="dataset" trim="yes"}

            {!--  ============================================
            row_date, prev_date and next_date will be empty
            if the related entry_date is in the future...
            The first check on row_date prevents hacking via the URL
            ================================================== --}

            {if row_date}
                <li>
                    <h3>{the_title}</h3>
                    {if prev_date}<p><a href="{prev_id}">Show prev row</a></p>{/if}
                    {if next_date}<p><a href="{next_id}">Show next row</a></p>{/if}
                </li>
            {/if}

        {/exp:stash:get_list}
    </ul>

{/exp:channel:entries}

```
> 2 votes

---
Tags: matrix, php
---


title: If Page is not home page

text:
# Question
Title: If Page is not home page
I have a separate navigation that I want displayed on all pages that are not the home page.

I thought something link this would work but not quite:

```
{if segment_1}
{if:else}
<nav class="main-nav">
<a class="active" href="/">Home</a>
<a href="allergies.html">Allergies</a>
<a href="about.html">About</a>
<a href="services.html">Services</a>
<a href="locations.html">Locations</a>
<a href="contact.html">Contact</a>
</nav>
{/if}

```

Any help appreciated.

N

# Answer
This works:

```
{if segment_1}
<nav class="main-nav">
<a class="nav-one" href="{path='site_index'}">Home</a>
<a class="nav-two" href="{path='allergies'}">Allergies</a>
<a class="nav-three" href="{path='about'}">About</a>
<a class="nav-four" href="{path='services'}">Services</a>
<a class="nav-five" href="{path='locations'}">Locations</a>
<a class="nav-six" href="{path='contact'}">Contact</a>
</nav>

{if:else}
{/if}

```
> 1 votes

# Answer
Testing against a specific value seems to work more consistently in EE. So you could test if segment\_1 is not empty:

```
{if segment_1 != ""}
    Not the home page
{if:else}
    The home page
{/if}

```

or test that segment\_1 is empty

```
{if segment_1 == ""}
    The home page
{if:else}
    Not the home page
{/if}

```
> 1 votes

---
Tags: ifelse
---


# Question
Title: Restricting images and file links to members only
I need to create a news/blog section only accessible to logged in members. I know I can restrict templates to members and use {if logged\_in} to restrict displaying fields etc.

I am looking for advice on how best to approach restricting access to images shown and file links included within the blog, so that the URLs to these do not let general site visitors / search engines etc access the files and images.

Ideally, the blog admin could write blog posts in a wyswiyg (wygwam) field including images and file links there. If that's not possible, extra fields for images and file links could be used.

I figure this is a common enough requirement, so I would really appreciate some guidance on how best to approach this. Thanks.

# Answer
First, you'd have to set up your upload directory to be below the web root, so your structure might look like this:

```
public_html/
private/
private/uploads/

```

Make a template for serving up these protected images, say protected/images is your template group / template name. Set your upload directory's URL to this template: /protected/images/

In your template, enable PHP (or convert this to a plugin):

```
<?php
// set this to your real file upload path
$path = '/var/www/private/uploads/';

$this->EE->load->helper('file');

// they're logged in, show 'em the image
if ($this->EE->session->userdata('member_id'))
{
  $filename = $this->EE->uri->segment(3);

  if ( ! $filename || ! file_exists($path.$filename))
  {
    $this->EE->output->set_status_header(404);
  }
  else
  {
    $this->EE->output->set_content_type(get_mime_by_extension($filename));

    echo file_get_contents($path.$filename);
  }
}
else
{
  $this->EE->output->set_status_header(401);
}
?>

```

This is intended to be just a starting point, your mileage may vary.
> 2 votes

# Answer
Consider Protected Links add-on.

It can protect both files to download and images on page. For images, you will need to use 'inline' parameter. It is also advicable to place actual files/images above web root, like Rob Suggested.
> 1 votes

---
Tags: members, login, image, restricted-area
---


title: Forcing DST settings for users

text:
# Question
Title: Forcing DST settings for users
I noticed that my entry dates were being offset by one hour ahead and when I looked into the issue I found the user localization to be the problem. In my config file I have the following line:

```
$config['daylight_savings'] = date('I') ? 'y' : 'n'; // Autodetect DST

```

This was shamelessly lifted from Erik Reagan's Master Config file and it automatically sets the DST under Admin -\> Localization Settings but it does not affect DST under *My Account* -\> Localization Settings. Is there a way to set DST offsets globally for users like I can for the system or is it up to each individual to set this themselves?

# Answer
> 2 votes
I have some pretty extensive experience with this issue as we run a live TV broadcast.

Quick answer to you question is to use `$config['allow_member_localization'] = "n";` in your config.php. This prevents any per user localization despite what is stored in exp\_members AND subsequently what shows up in the member's profile.

Once you set this there's three ways I have confirmed to set the default localization:

1. Under **Members -\> View All -\> (select a member) -\> Member Preferences** you'll see "Use this member's localization settings as the master site default?" which if checked will set the default localization to the same as that user's. The thought behind this is that a "Super Admin" would keep their DST/TZ settings up to date I assume.
2. Under **Admin -\> Localization**. This sets the two configurations variables I will mention in the next bullet in the database but it is **PER SITE** so you'd need to set it for each site.
3. **I HIGHLY RECOMMEND** using a site-wide **config.php** to set these two values. `$config['default_site_dst'] = (date("I")) ? "y" : "n";` and `$config['default_site_timezone'] = "UM6";` Where UM6 is your timezone in EE's weird TZ formatting. Just be sure your server (and php) timezone is set properly (run "date" in the terminal to check).

There are also two other configuration values which I've seen floating around which I tend to ignore:

1. `$config['honor_entry_dst']` doesn't exist anymore as of some EE version before mine (which is 2.4.0).
2. `$config['daylight_savings']` this seems like the end all be all of settings but don't be fooled. My understanding of this variable based on scouring the source code is if you haven't used any of the prior methods to set the DST this is your default. I have NOT tested this as I end up just setting `$config['daylight_savings'] = (date("I")) ? "y" : "n";` as well anyways.

I'd like to make one final note before signing off. I've always had to re-save entries made in a prior DST settings to get them back to the correct time. This is because the only data that is stored in exp\_channel\_data is the timezone not the DST setting which is rather unfortunate.

# Answer
> 3 votes
Per the EE docs on **Date Localization** this setting should work as you have it coded.

> If people browsing your site are not members, or if they have not set a time zone preferences in their personal profile, ***the times will instead be shown according to your master system localization settings found in the Localization Settings area of your Control Panel***.

Has the member you're testing set a time zone preference?

---

Also, it's possible this has been set:

> If you prefer that the localization settings of a particular member be used as the site default this can be specified in the My Account ‣ Administrative Options page.

---
Tags: members, dst, entry-date
---


# Question
Title: Editor ability to attach "events" to a page
I have the need to allow site editors to be able to create groups of "events" and assign a title, body, icon, etc to those events, order them, and place them where they like inside of their "pages".

Currently, I have an "Events" channel set up and each entry in that channel is 1 individual event. The reason for this is that they would like those events to "expire" at a date/time they specify. Each of those entries are assigned one or more categories. From there, I have an embed code similar to this...

```
{embed="embeds/events" category="25"}

```

This code is entered into any page (Structure) they want that category of events to show up in.

This works pretty good but we are in the middle of a major re-design and I am wondering if this is the "best" way to accomplish this.

Thoughts? Would you do it the same way or would you have an easier method?

Some of the downfalls to doing it this way is that you have to have content editors worried about entering the specific embed code. Also, they have to look up the category ID which can be annoying if they are looking to set something up quick.

Thanks for your help!

# Answer
Another option that I have used in the past is with Playa:

1. Create as many channels as you need modules (text, events, video, 1 big image, image gallery, etc.) and enter content
2. Create a "page" channel with a playa field linking to your modules channels. Use conditionals / ifelse / switchee to test on the channel\_short\_name and display module fields:

simplified code in your "page" template

```
{exp:playa:children status="open"}
    {if channel_short_name == "mod_events"}
        ... display code and custom fields for event module ...
    {/if}
    {if channel_short_name == "mod_text"}
        ... display code and custom fields for text module ...
    {/if}
    {if channel_short_name == "mod_video"}
        ... display code and custom fields for video module ...
    {/if}
{/exp:playa:children}

```

Users can now compose their page by creating modules / combining them / ordering them. It's a very flexible system if you need to enable your users to create rich pages. With only a small set of modules, you give them a lot of possible variations and no room for errors.

Possibilties are endless.
> 3 votes

# Answer
I never ask my clients to enter embed code. as the events are channel entries, you can have them selected easily with something like playa, or http://devot-ee.com/add-ons/nsm-entry-select. and for the categories, i guess you could use something like http://devot-ee.com/add-ons/jp-category-select. Than, you can have a template that says: {exp:channel:entries bla bla bla} {embed="\_inc/myembed" theentry=='{my\_entry\_field\_name}' thecategory='{my\_categories}'}

and the embed itself would be something like:

{exp:channel:entries channel='events' entry\_id=='{embed:theentry}' category=='{embed:thecategory}'} bla {title} {/exp:channel:entries}
> 0 votes

---
Tags: categories, embeds, workflow
---


# Question
Title: Restrict access to Member Preferences & Member Fields
What is the best method to restrict a custom Member Group's access to Member Preferences and Member Fields?

I've created a Group that needs to be able to manage member data, but not have access to the other "settings" areas.

# Answer
What you could do kurt is use an addon like Profile:edit or Zoo Visitor and restrict member access to the channel you create which would hold member fields type data.
> 0 votes

# Answer
This isn't possible. The **Can administrate members accounts** setting for a member group is all or nothing.
> 0 votes

---
Tags: members, control-panel
---


# Question
Title: 404 default template returning 503 header
I have to set strict urls to no, because I am using a dynamic segment\_1 with category\_urls. So I have to use the default 404 error template. The 404 errors work but the pages return a 503 header and not a 404 header.

I tried inlcuding a custom 404.php instead of the

```
$this->log_item("404 Page Returned");
$this->EE->output->set_status_header(404);
echo '<html><head><title>404 Page Not Found</title></head><body><h1>Status: 404 Page Not Found</h1></body></html>';

```

But it’s still a 503. Am I missing a setting? What can I do to make it actually 404? I am on EE 2.5.5

Thanks Philip

# Answer
Try setting the 404 status using HTTP Header plugin.

Put following tag in your 404 template: `{exp:http_header status="404"}`
> 2 votes

---
Tags: 404
---


title: fixed_order parameter alteration?

text:
# Question
Title: fixed_order parameter alteration?
I'm working on a site where I utilise a custom field to store a pipe-delimited list of related entries, in order to sort Playa's reverse related entries. This looks something like this:

```
{exp:channel:entries
    channel='deals'
    limit='1'
}
<h1>{title}</h1>
<ul>
    {exp:playa:parents
        channel='products'
        var_prefix='parent'
        fixed_order='{deal_text_product_order}'
    }
        <li>{parent:title}</li>
    {/exp:playa:parents}
</ul>
{/exp:channel:entries}

```

Now this works fine, my client can order their products (I'm doing this in Safecracker, with jQuery UI Sortable) "and all was well with the world". However, if they add a product after the order's been set, the product isn't shown because it's not in the list in the `fixed_order` parameter. Ideally I'd want any products not in the pipe-delimited list to be shown after the products that were in the list... Is there any way to achieve that?

So for example my client sorts the products as `3|1|4|2`, and then publishes new products with ID `5` and `6`, I'd like them to be appended after products 3, 1, 4 and 2, displaying the products in the order 3 1 4 2 5 6. Does that make sense?

Thanks!

# Answer
Low Reorder has this exact functionality you describe. New entries are added to either the beginning or end of a manually ordered list. But this only works thru the control panel.

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

You could possibly write a custom SQL query to update the Low Reorder tables with the External Entries add-on. Low Reorder uses a table called "exp\_low\_reorder\_orders" thats just a list of entry ids. External Entries can be called from any EE template:

> Put the plugin in its own EE template, call the template with jQuery’s .load() and .live() functions for AJAXy goodness, and your web site is now a web app!

http://engaging.net/products/external-entries
> 2 votes

# Answer
You could do this super inefficiently without reorder.

Basically call `{exp:playa:parents}` twice, `fixed_order=""` once for your ordered set, then `entry_id=""` once for the rest WITHOUT the ordered set. Something like:

```
...
{exp:playa:parents
    channel='products'
    var_prefix='parent'
    fixed_order='{deal_text_product_order}'
}
    <li>{parent:title}</li>
{/exp:playa:parents}

{exp:playa:parents
    channel='products'
    var_prefix='parent'
    entry_id='not {deal_text_product_order}'
}
    <li>{parent:title}</li>
{/exp:playa:parents}
...

```
> 1 votes

---
Tags: playa
---


# Question
Title: Editing playa fields inside of a safecracker form
I'm trying to figure out how to update my playa fields (member\_firstname, member\_lastname, etc) when they're inside of a safecracker form. All of the non-playa fields update:

```
{exp:safecracker
limit="1"
channel="business"
return="myfig/dashboard/success"
datepicker="no"
url_title="{segment_2}"
safecracker_head="no"
error_handling="inline"
use_live_url="no"
author_only="yes"
}
<!--Entry Id: {embed:entry_id} -->
<p>
<label for="member_business_name1">Business Name</label>
{title}
</p>
{exp:playa:children field="contact" status="not closed" limit="1" entry_id="{embed:entry_id}"}
<p>

<label for="member_firstname">Primary Contact First Name</label>
<input type="text" name="member_firstname" id="member_firstname" value="{if member_firstname}{member_firstname}{/if}"/>
</p>
<p>
<label for="member_lastname">Primary Contact Last Name</label>
<input type="text" name="member_lastname" id="member_lastname" value="{if member_lastname}{member_lastname}{/if}"/>
</p>

<p>
<label for="member_job_title">Primary Contact Title</label>
<input type="text" name="member_job_title" id="member_job_title" value="{if member_job_title}{member_job_title}{/if}"/>
</p>
{/exp:playa:children}

```

Pastie: http://pastie.org/6405829

Any thoughts?

# Answer
I'm afraid you'll need to build a custom add-on to do this, since you're trying to update more than one channel entry with a single Safecracker submission. (In a single submission you can only create/update a single channel entry's fields - so you could change the related entry that your main entry points to, but not the fields of that related entry itself).

I built Bankcracker to do this for adding new entries, but it currently doesn't handle edits to existing data. However, it might point you in the right direction for creating something yourself. (The key would be to use the safecracker\_submit\_entry\_end extension hook).
> 1 votes

# Answer
Jon, have you tried using {field:contact} in your Safecracker form?
> 0 votes

---
Tags: safecracker, playa
---


# Question
Title: Allow certain members to view certain products in Cartthrob
I'm looking to give members the ability to buy photography specific to them.

I was wondering if there is a way in Cartthrob for me to display certain products to certain members via playa field containing a member? OR (this might be even better) drop files in a P&T Assets directory and assign that directory to a specific Member? The photos (product) will always be the same price across the board.

I guess I'm kind of looking to do both (for 2 different projects) - One with the ability for specific members to buy specific photos and another where specific members can see specific products only.

Any thoughts?

Thanks!

Best,

Jon

# Answer
You can easily assign entries to a specific member by making them the author of the entry then using the author\_id parameter in your channel entries tag. Alternatively you can use a plugin such as VZ Member or VMG Chosen Member to select either a single or multiple members that you could then use a conditional in your template to show only entires which they have been selected. Or there is another add-on called Entry Access that allows you to grant access on a per entry basis. One of the nice things about Entry access is that you can preselect members or member groups that you want to have access to all entries by default (handy for admins to see the entries)
> 1 votes

# Answer
You don't mention whether you're using an addon that stores member profiles as channel entries, but with Profile:Edit and Playa it's relatively trivial to display products related to (presumably?) the currently logged in member. If you tick the box to have Profile:Edit store its data as global variables you can use {profile:entry\_id} as the value for any Playa or channel:entries tag parameters.

Otherwise, setting the member as the author of the entry as Justin suggests would also be a good approach if you only require one member per product.

The Assets approach may be possible but could be a bit limiting in future - probably best to keep everything as channel entries (the products themselves can still use file/assets fields ).
> 0 votes

---
Tags: ee2, assets, playa, cartthrob
---


# Question
Title: How do I disable modules / add-ons manually?
I migrated the site over to a new server and a new domain. Now I'm getting a blank page on the Modules page.

How do I disable each one individually until I identify the culprit?

I tried enabled error reporting but I get nothing.

Edit: I'm on EE 1.6

# Answer
I've experienced this issue frequently and usually find its because one of the configuration paths has not been setup correctly on the new server.

As such I always install Deeploy Helper before migrating. Then, after migrating to the new server, if I get a blank Modules page I'll copy the Deeploy Helper URI from the previous sites CP and paste into the new sites CP. After Deeploy Helper's module page loads I update the paths/URIs and it resolves the issue.

If you're unwilling or unable to use Deeploy Helper in the manner suggested I'd start by concentrating on ensuring all your paths & URIs are correct.
> 1 votes

---
Tags: module, ee1, blank-screen
---


title: Using login_form tag with https

text:
# Question
Title: Using login_form tag with https
Using the login\_form tag, is there a way to specify a secure return address, without entering a full domain name? Only the 'intranet' part of the site should be under https.

For example, I can do this:

```
{exp:member:login_form return="https://www.mywebsite.com/intranet/"}

```

But I can't do something like this:

```
{exp:member:login_form return="intranet/index" secure="yes"}

```

With the first method, it seems a bit naff how you see a 'You are now logged in' page that's http rather than https after logging in. Also, using a full domain name doesn't play nicely with version control and multi-server environments.

# Answer
Is your login form page https? Seems like return="" would keep you on the same protocol with a relative path if your originating form was over https.

You could use a redirect as I described in this thread regarding requiring SSL which would also prevent users from accidentally ending up on http:// as well. Though it'd be unfortunate if you had to do a redirect and I wonder if it opens you up to some sort of session hijacking.
> 1 votes

---
Tags: members, login
---


title: Incorrect MSM system folder path?

text:
# Question
Title: Incorrect MSM system folder path?
I have recently purchased MSM but am having trouble getting it to work. I have followed the docs to a tee but have had no luck.

I have completed the following:

1. Installed and activated the add-on
2. Created a new site (did not copy anything from site 1)
3. Updated URL to root directory in Admin \> General Config
4. Created a new template group and made default for site2
5. Added site 2 to hosting
6. Ensured "open\_basedir" has been turned off
7. Copied admin.php & index.php from site 1
8. Updated system path in admin.php & index.php to absolute URL of site 1 (other variables also updated to reflect site 2 cp url & url).
9. Uploaded admin.php & index.php to site 2
10. Reload the site but get the following message:

> Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

I have tried relative links for system paths but get the same result.

Does the name of site 2's admin.php & system name need to be the same as site 1 (I have changed it as a security precaution) ?

Any help of feedback would be appreciated.

Thanks, Dan

# Answer
The crucial part of MSM is the "$system\_path" variable in index/admin.php which is the (file) system path of site 1's system folder rather than a URL.

> 8) Updated system path in admin.php & index.php to **absolute URL** of site 1 (other variables also updated to reflect site 2 cp url & url).

From what you wrote I'm not sure if you've got that part right - on shared hosting it can be tricky figuring out what that path is?

If you are still getting the error I'd suggest trying a plain old php file system include to check that you have the permissions etc correct.
> 2 votes

---
Tags: multi-site-manager, path
---


title: P&T Switch value

text:
# Question
Title: P&T Switch value
I have a field named {the\_shadow} set up with P&T Switch field type of "yes" and "no" for their values. For some reason it doesn't seem to work:

```
{exp:channel:entries
    channel="portfolio_work"
    orderby="random"
    limit="20"
    disable="member_data|pagination|categories|categories_fields"
}
    {if main_photo}
    <!-- Work -->
        <li class="touchcarousel-item">
            <div class="workPiece">{exp:gwcode_fileinfo:single file="{main_photo}"}<img src="{main_photo}" width="{image_width}" height="505" alt="{title}" />{/exp:gwcode_fileinfo:single}</div>
            {if the_shadow == "yes"}<div class="workShadow"> </div>{/if}

    </li>
        {/if}
{/exp:channel:entries}

```

I am running ee v.2.5.5.

Thanks, -Sam

# Answer
> 1 votes
Try something like this. You'll see that pt\_switch actually outputs 'y' not 'yes'. :) If you're having trouble with conditionals. always echo out your variables so you can see what you need to test against. :)

```
    {exp:channel:entries channel="pt_test_channel"}
<h1>{title}</h1>
    {pt_switch}
    {if pt_switch == 'y'}
    yessirreebob
    {/if}

{/exp:channel:entries}

```

So in your case you need this line:

```
{if the_shadow == "y"}<div class="workShadow"> </div>{/if}

```

---
Tags: pixelandtonic, switch
---


# Question
Title: Can "control" of EE licenses be transferred?
We took over a site from another agency, but they still technically have the only access to the license for the site. Is there any way to have EllisLabs transfer it? Or just enter the license # under our own account as belonging to us now?

I am completely clueless if there's even a way to do this, and didn't see a way to just quick-contact EllisLabs without being charged.

# Answer
This should be a quick email to EllisLab sales department. The previous agency, however, will have to initiate the transfer in the first place as they own it. Ask them to email sales@ellislab.com, tell them what account to transfer it to, and EL usually resolves it in a couple days.

It should NOT incur additional fees as you're just taking over the ownership. That being said, the ownership should probably be best transferred to the CLIENT as they should own it perpetually, NOT the agency. You would get the client to create an EllisLab.com account and then get the previous agency to transfer that license to them. So in the event they change another vendor or whatever, the license is still theirs.
> 9 votes

---
Tags: license
---


# Question
Title: Channel Entries API incredibly slow performance
I am developing on a high performance MediaTemple DV at the moment. The RAM on the server is 16GB and while pages load relatively quickly, it appears that any scripts I write which use the Channel Entries API, or in fact any channel entries loops that I include, whether they be directly embedded in the template, or called via ajax, tend to max out the CPU. For example, calling a couple of hundred channel entries, with each entry consisting of less than 40 fairly standard fields (with the exception of a small few specific items), set the CPU on the server to be over 100%. Has anyone else experienced a similar issue with channels, entries, the API itself, etc? Our system relies very heavily on calling and filtering channel entries so the current performance is definitely unacceptable.

Any input would be greatly appreciated.

# Answer
You need to be aware sometimes that when using the API, you're going to take a whole lot of potential baggage with you - a lot of that baggage may not be from first party. There are several extension hooks being called when you save an entry.

I've been bitten for example by Solspace Tag doing a whole bunch of cleanup/recounts after *ANY* entry is created or updated. So, if you're bulk importing fairly simple entry data, there is potential for a lot of complex things to be happening that you're not immediately aware of.

In my case, each entry was taking several seconds to update and Tag was the culprit.

I ended up placing echo statements throughout the entire 'save' entry process in Api\_channel\_entries which showed me memory usage and time taken to get to various points from submit to save.

There are also some other bulk actions EE can take when saving an entry, like clearing caches and recompiling relationship data (that can be a huge one and thinking now it might be the culprit) but debugging your way through Api\_channel\_entries is the only way to go imo.
> 2 votes

# Answer
In some cases, it is much more efficient to make a direct SQL query instead of calling API. Try making requests that would load only data that you need, instead of trying to get everything via API.

I would also suggest that you post this issue to official EE support forums, as there's a chance there's some EE bug involved here.
> 1 votes

---
Tags: channel-entries, performance, server
---


# Question
Title: Control Panel - weird error after creating user through zoo
I am experiencing some weird bugs over the past day or so. Basically we are using Zoo Visitor to allow some of our team to create users without having access to the Members section of the CP, for obvious security reasons, but each time they create a new account over the past day or so, this error is being thrown:

> ExpressionEngine - An unknown error has occurred when sending email with your server.

This same error comes up when trying to update a user's member group. I've run a few searches and I can't find anything that has changed over the past day, but if I knew what caused this error it may be easier to debug properly.

# Answer
> 1 votes
As error states, the error because of the email settings i.e system couldn't send the email.

You need to check the email settings from CP -\> Admin -\> Email Configuration.

From CP -\> Tool -\> Communicate, test if email/s are being sent properly by system.

---
Tags: members, zoo-visitor, registration, register
---


# Question
Title: Expresso Store - Register as a member during checkout errors
I am having problems registering a member during checkout.

My checkout works fine as long as the user does try to register as a member, the payment is approved, the order appears in the system with the default status applied and the user is correctly returned to the order confirmation screen as specified in the return parameter of the exp:store:checkout tag.

If the user tries to register as a member as they checkout the following happens.

1) The user is returned to the second of our 3 step checkout process - the billing / shipping address screen. This is the page where the 'become member' checkbox and form is.

2) The site shows that they are now logged in. Additionally - The Basket still has their items in. Basket cookies haven't cleared.

2) Checking in the admin, the member has been created

4) The order has been received - marked as 'paid' BUT no status has been applied (and no email sent) & the members account hasn't been assigned to the order.

I originally had my order fields mapping to member fields, but have removed the mapping and the problems remain.

I am using the latest version of Store 1.6.3 and expression engine 2.5.5.

I'm a bit stuck how to debug this as no error codes are appearing on any of the pages.

Thanks in advance for your help!

# Answer
> 4 votes
This turned out to be caused by a conflict with the Twomile Login Redirect extension.

While Store was half way through processing the order, the member account is registered using the standard EE member registration functions (which I believe triggers the `member_member_login_single` hook since the member is logged in automatically). However, at this point the Twomile extension sees the member login and immediately redirects the customer back to the previous page (which results in an incomplete order and the customer's cart not being cleared).

The solution is to disable/uninstall Twomile Login Redirect. You can achieve the same things that extension provides on a per-template basis using FreeMember or any other member management plugins.

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


title: Migrating Assets to S3

text:
# Question
Title: Migrating Assets to S3
Using Assets 2.x in a recent site build. When we initially built the site, we didn't opt for S3 as it wasn't approved by the client. Since then, the site has yet to launch and thinking has changed - S3 is now the preferred option.

Question: Is there any relatively painless way to migrate existing Assets to S3 - mind you we're using WYGWAM, Matrix, Playa on the site. Essentially, looking to know whether or not we can avoid manually accessing each entry and migrating those Assets.

Thanks in advance for your advice!

Cheers, Michael

# Answer
> 5 votes
Backup your database first, of course, but theoretically this should be easy-peasy: Just add your S3 sources in the settings and then, in the Assets File Manager just drag all your files and folders from your EE sources to S3 sources and that's that - no changes in entries should be required at all.

---
Tags: assets
---


# Question
Title: MSM (multi-site manager) site2 instantly redirecting to site 1
Hoping someone can help ... I have installed the latest Multi-site manager for EE2+, set up a site and updated admin.php & index.php files as stated in the instructions.

However, when I go to visit http://site2.com.au I get instantly redirected to http://site1.com.au and I can't work out why?

*Full details of install are outlined below:*

Installed MSN, uploaded files (3) to appropriate folders in site1. Activated/turned on MSN.

Changed sites from site1 to site2 via top right site drop-down. Updated root url to site2.com.au and created default template with temporary text in design\>templates etc.

After adding site2 as a stand alone site (reseller hosting account) without success & speaking in detail with my host e2, they had this to say:

> "It seems that domain2 account cannot access the other account's path since they are separate cpanel accounts. I would suggest you to try creating domain2 as addon domain under the domain1 for creating multisite"

So I deleted the stand alone hosted account for site2 and added it as an 'Add on domain' via site1 cPanel.

This created the following folder structure:

```
/home/
> short_name/
>> public_html/
--- system
--- themes
--- admin.php
--- index.php
>>> site2.com.au
---- admin.php
---- index.php

```

By adding site2 as an add on domain it created a folder in the root directory of site1.

I copied index.php & admin.php from site1 root and edited them with the following info:

**index.php** (full server path)

```
$system_path = '/home/short_name/public_html/system/';

```

Also tried (relative?)

```
$system_path = '../system/';

```

And

```
$assign_to_config['site_name']  = 'site_2';
$assign_to_config['cp_url'] = 'http://site2.com.au/admin.php';
$assign_to_config['site_url'] = 'http://site2.com.au';

```

**admin.php** is pretty much the same apart from the site\_url is not there.

However, when trying to access http://site2.com.au & /admin.php I get instantly redirected to http://site1.com.au & /admin.php

A very odd thing is if I visit http://site1.com.au/site2.com.au I can see the temporary text I added for site2 default template so it would appear that MSM is working but not redirecting/displaying the URL correctly?

I completed all the steps till the end of "Setup Domains and Sub-domains" but didn't go any further than a quick read over as the rest of the steps seemed to refer to shared channels & files etc.

I am hoping it is a smile fix & appreciate any help anyone can offer.

Thanks, Dan

# Answer
It seems to me the issue is more to do with the DNS you have set up for the second subdomain. You have proved the path you have issued http://site1.com.au/site2.com.au works as site 2 should, i would also imagine http://site2.com.au/site2.com.au would also show you the required site2... If so then your DNS for http://site2.com.au is pointing at the standard public\_html folder and not the new sub domain sub folder... i would go back to your host as it looks like your EE MSM set up is working

The reason it wont work in shared hosting is the openbase\_dir is disabled otherwise you would be able to access other websites (not your own) on the same server

Hope that helps
> 2 votes

# Answer
Do you have .htaccess file on site2 domain? I suspect there's some rule there that redirects all requests to site1.
> 0 votes

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


# Question
Title: Matrix and Wygwam / Content Elements plugin conflict
I think I have a plugin conflict. In the CP, I have a channel with the following channel fields:

* Content Elements
* Matrix with just Text
* Matrix with Text and Wygwam

In the last one, when I try to click on the left column (text), everything works fine but then, when I try to edit the other Matrix column (the Wygwam one), nothing happens, it just stays blank. The cursor doesn't even appear.

In the console, I have the following errors:

```
index.php:1SyntaxError: Unexpected token '<'
http://mywebsite.com/themes/third_party/content_elements/elements/wysiwyg/ckeditor/skins/wygwam2/skin.js?t=B8DJ5M3Failed to load resource: the server responded with a status of 404 (Not Found)
ckeditor.js:23TypeError: 'undefined' is not an object (evaluating 'r.init')

```

What can I do to fix this?

EE: 2.4.0
Wygwam: 2.6.3
Content Elements: 1.0.1

**\[Updated\]**

Wygwam: 2.7
Content Elements: 1.1.2

I updated the Wygwam and Content Elements plugins and now have the following error messages:

```
SyntaxError: Unexpected token '<'
http://mywebsite.com/themes/third_party/wygwam/lib/ckeditor/plugins/flickr/plugin.js?t=D09H5XKFailed to load resource: the server responded with a status of 404 (Not Found)
[CKEDITOR.resourceManager.load] Resource name "flickr" was not found at "http://mywebsite.com/themes/third_party/wygwam/lib/ckeditor/plugins/flickr/plugin.js?t=D09H5XK".

```

# Answer
A Flickr extraPlugin were loaded in the Wygwam configuration.
I just created a new configuration removing that element. Plus I deferred the CK Editor initialization.

It seems to be working now.
> 2 votes

---
Tags: matrix, wygwam, pixelandtonic
---


# Question
Title: CartThrob - Price Modifier with additional column
I have a Price Modifier for a product which has the usual option\_value, option\_name and price. I have added an additional column titled 'supplementary'.

This new column is correctly appearing within the Add to Cart form using the {supplementary} tag as follows;

```
{exp:cartthrob:multi_add_to_cart_form entry_id="{entry_id}"}

    {my_option}
    <input type="hidden" name="item_options[{count}][my_option]" value="{option_value}" />
    <input type="hidden" name="item_options[supplementary]" value="supplementary" />
    {option_name} {supplementary} {price}
    {/my_option}

{/exp:cartthrob:multi_add_to_cart_form}

```

However, I need this to also appear in the Basket/Cart with the selected option but it's not appearing with the following code;

```
{exp:cartthrob:item_options entry_id="{entry_id}" row_id="{row_id}"}
{option_label}: {option_value} {supplementary}
{/exp:cartthrob:item_options}

```

I was wondering if someone could tell me what I'm doing wrong? I've also tried using the following but to no avail;

{item\_options:supplementary}

Thank you.

# Answer
Fixed. After further trial and error I resolved my own question. Here's the answer in case anyone else gets stuck with something similar;

```
{exp:cartthrob:multi_add_to_cart_form entry_id="{entry_id}"}

    {my_option}
    <input type="hidden" name="item_options[{count}][my_option]" value="{option_value}" />
    <input type="hidden" name="item_options[{count}][additional_column]" value="{additional_column}" />
    {option_name} {additional_column} {price}
    {/my_option}

{/exp:cartthrob:multi_add_to_cart_form}

```

No need to add the additional column tag to Basket/Cart. It just outputs automatically with the following;

```
{exp:cartthrob:item_options entry_id="{entry_id}" row_id="{row_id}"}
{option_label}: {option_value}
{/exp:cartthrob:item_options}

```
> 1 votes

---
Tags: cartthrob
---


title: CartThrob Product Options Inventory

text:
# Question
Title: CartThrob Product Options Inventory
I am wondering. Is there way to include inventory levels with each product option in CartThrob Pro?

e.g. 10 Smalls, 5 Mediums, 2 Larges.

# Answer
> 2 votes
Yes, as long as you only need to track inventory on one set of product options.

Map 'Product Inventory Field Name' to your product options field in the Cartthrob/Products settings page.

The default Cartthrob fieldtype needs no additional configuration.
If you are using a Matrix field, make sure you have an `{inventory}` column.

If you need to track inventory over multiple product option groups, take a look at their Price Modifiers Configurator Fieldtype.

---
Tags: cartthrob
---


# Question
Title: Is it possible to convert an EE File Upload path to Assets S3?
I currently have 31 native EE file upload paths all pointing to a location within /images.

I'd like to serve all of my image assets from an S3 bucket, so I've created images.domainname.com. I've also copied the entire image structure to this bucket.

Is it possible to run a query on the existing upload paths and convert them to point to the S3 source instead of the native one?

Other than losing the ability to restrict upload directories, is there a reason to not do this?

# Answer
> 1 votes
see Andris' answer here:

Migrating Assets to S3

> Backup your database first, of course, but theoretically this should be easy-peasy: Just add your S3 sources in the settings and then, in the Assets File Manager just drag all your files and folders from your EE sources to S3 sources and that's that - no changes in entries should be required at all.

---
Tags: assets, pixelandtonic, s3
---


# Question
Title: Where can I find a complete EE1 reference for tags and their usage?
I've 'inherited' an EE1 site (1.7.1) and am trying to make some customisations to it. Nothing major, but I have had almost no exposure to EE tags.

The official EE1 documentation is very thin and nearly all of my searches, although returning what potentially look like good results, end up containing broken links to old EE documentation that doesn't seem to exist any more.

Where can I find an exhaustive and well put together reference to EE1 tags?

# Answer
http://ee1docs.com/quick\_reference.html

and you can see top right button "Download EE1 Docs" at http://ellislab.com/expressionengine/user-guide/
> 4 votes

---
Tags: ee1, tags
---


# Question
Title: Allow cropping of image for one usage while retaining original image?
Some of the images on my site will be used in multiple sizes and aspect ratios. I would like for the client to only have to upload one version of each image (the original size) and have the site automatically size and crop the images according to the location requirements. However, one of the aspect ratios is a very wide and short image (let's call it a "banner"). I am able to get CE Image to display the image in the proper dimensions, but it crops off the bottom and top of the image and saves a strip from the middle. Most of the time that's just fine, but some of the images don't lend themselves well to that particular cropping (subject matter is off-center). Right now, I got around this by adding an additional file field for the client to crop the image manually and then upload it for the page banner. Is there a way instead to do this with only one image being uploaded but allowing the client to specify the region of the image to use for the page banner? Something like jCrop? Is there an add-on that with this feature?

I am using Assets and CE Image.

Thanks! Amy

# Answer
Would something like this Image Editor add-on work for what you need?

http://devot-ee.com/add-ons/image-editor

Another solution might be add select fields to allow the client control the crop position parameters for CE Image. For instance, if you had a select dropdown field called `{horizontal_crop}` with the values "left, center, right" and another dropdown field called `{vertical_crop}` with the values "top, center, bottom."

Then your tag would look something like this:

`{exp:ce_img:single src="{my_custom_image}" width="200" height="130" crop="yes|{horizontal_crop},{vertical_crop}"}`

If you also add the ability to preview the image in place in the page with something like NSM Live Look, the client could more easily select an appropriate cropping method.
> 3 votes

# Answer
You can use the Image Manipulation feature of ExpressionEngine : http://ellislab.com/expressionengine/user-guide/cp/content/files/file\_upload\_preferences.html
> 0 votes

---
Tags: image, ce-image
---


# Question
Title: Best practices for using Stash partials with one layout but slightly different content output
I am curious to know if there are any "best practices" for using Stash to deal with "pages" that pull extra/additional channel entries that are pulled into the same wrapper/layout. More specially, do you put your conditionals in the layout itself? Or keep them in the partial?

As a quick example, say you use Structure and manage site with "static" pages that share the exact same layout. The only differencees are some pages have to pull in bios or show a map below the page content.

**Layout/Wrapper:**

```
{!-===========================================================================
FILE: _layouts/.two-column.html
TYPE: Template
DEPENDENCIES: Librar-ee, Stash
DESCRIPTION: Two column wrapper template that holds interior page content
============================================================================ --}
<!DOCTYPE html>
{sn_global_html}
<head>
  {sn_global_head}
</head>
<body id="{exp:stash:body_id}" class="{exp:stash:body_class}">
  {sn_global_header}
  {sn_global_banner}
    <div id="Content">
      <div class="wrapper grid">
        <section id="Content-Primary" class="grid-2-3" role="main">
          <article class="module" role="article">
            {exp:stash:content_primary}
          </article> <!-- /END module -->
        </section> <!-- /END #Content-Primary -->

        <section id="Sidebar" class="grid-1-3" role="complementary">
          {exp:stash:sidebar}
        </section> <!-- /END #Sidebar -->
      </div> <!-- /END wrapper grid -->
    </div> <!-- /END #Content -->
    {sn_global_footer}
  </body>
</html>

```

**Partial:**

```
{!-- ===========================================================================
  FILE: _partials/static-page.html
  TYPE: template partial
  DEPENDENCIES: Librar-ee, Stash, Channel Images
  DESCRIPTION: Services page partial
============================================================================ --}
{!-- Select layout ========================================================= --}
{embed="_layouts/.two-column"}

{!-- Set variables ========================================================= --}
{exp:stash:set name='body_id'}{/exp:stash:set}
{exp:stash:set name='body_class'}subpage two-col{/exp:stash:set}

{!-- Models ================================================================ --}
{!-- Content Primary --}
{exp:stash:set name="content_primary" parse_tags="yes" trim="yes" parse_conditionals="yes" no_results_prefix="page"}
  {exp:channel:entries
    channel="ch_pages"
    limit="1"
    {global:param_disable_default}}
    {if page:no_results}{redirect="404"}{/if}
      {sn_global_edit_this}
      {if cf_page_feature_image}
        <figure id="Featured-Image">
          <img src="{cf_page_feature_image}" width="390" height="305" alt="Test figure" />
        </figure>
      {/if}

      <h1>
        {if cf_page_extended_page_title}
          {cf_page_extended_page_title}
        {if:else}
          {title}
        {/if}
      </h1>

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

{!-- Sidebar --}
{exp:stash:set name="sidebar" parse_tags="yes" trim="yes" parse_conditionals="yes" no_results_prefix="sidebar"}
  {exp:channel:entries
    channel="ch_pages"
    orderby="random"
    limit="1"
    {global:param_disable_default}}
    {if sidebar:no_results}<p>Sidebar content is not available.</p>{/if}

      {reverse_related_entries channel="ch_page_header_images"}

      {if no_reverse_related_entries}
        <img src="/assets/img/site/featured/placeholder-city.png" alt="CAC Real Estate Management Co., Inc." width="390" id="Header-Image" role="img" />
      {/if}

      <img src="{cf_header_image:medium}" alt="{title}" width="390" id="Header-Image" role="img" />
    {/reverse_related_entries}
  {/exp:channel:entries}
{/exp:stash:set}

```

Where would you add the following extra bit of content that goes inside the main content area but below normal page content?

**Additional content (on select pages):**

```
{if last_segment == "project-management"}
  <article class="module" role="article">
    <h3>Project Management Team</h3>
    {exp:low_reorder:entries
      set="lr_cac_pm"
      dynamic="no"
      {global:param_disable_default}}
      <div class="listing">
          {sn_global_edit_this}

          <img src="{cf_bio_photo:headshot_sm}" alt="{title}" />
          <h4 class="bio-heading"><a href="{page_url}">{title}, {cf_bio_position}</a></h4>
          <p>
            {exp:eehive_hacksaw words="100" append="… | <a href='{page_url}'>Read More →</a>"}
               {cf_bio_body}
            {/exp:eehive_hacksaw}
          </p>
      </div> <!-- /END listing -->
    {/exp:low_reorder:entries}
  </article> <!-- /END module -->
{/if}

```

Would you:

* user conditionals and add it to the existing page partial? This way the 4-5 pages with extra content share one partial
* create a new partial for each page with the additional content, use snippets to abstract the shared page content in the above partial, and keep it out of the original partial above?

My gut is to:

* Create snippets for the shared content that is shared for every page
* Create new partials for the unique pages with additional content and use the shared snippets inside these partials
* Then, in the layout, use conditionals to display the extra content as needed.

It seems "dirtier" to have conditionals in the base partial to pull the extra data and then have conditionals to display the content in the layout as needed. Thoughts?

# Answer
> 5 votes
Personally, I tend to use separate templates and then do:

```
{embed="_layouts/.two-column"}

{snippet_common_page_elements}

{!-- Unique page code goes here --}

```

---
Tags: stash
---


# Question
Title: Safecracker and Geofinder. Can't Get Entries Created from Safecracker to Display
I have been working with Safecracker/GeoFinder and the entries created directly from the backend (without safecracker) display perfectly fine in the Geofinder Results, but entries created through the form on my site (with safecracker) won't show up in GeoFinder.

Is there anything I have to do to get entries created through safecracker to display in GeoFinder Results that I may be missing?

**Safecracker 2.1 (Updated):**

```
    {exp:safecracker
channel="personal_trainer_directory"
return="/member/profile"
entry_id=""
safecracker_head="no"
use_live_url="no"
url_title=""
class="geotagger"
}

    <input type="hidden" id="trainer_longitude" name="trainer_longitude" value="{trainer_longitude}">
    <input type="hidden" id="trainer_latitude" name="trainer_latitude" value="{trainer_latitude}">

    <div class="formsection clearfix">
    <label for="title">Name</label>
    <span class="directions">The name to be displayed in your listing.</span>
    <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100">
    </div>

    <div class="formsection clearfix">
    <label for="url_title">URL Title</label>
    <span class="directions">Put a dash between first and last name. example: "john-smith"</span>
    <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">
    </div>

    <div class="formsection trainer-photo clearfix">
        <label for="trainer_photo">Photo</label>
        <span class="directions">The photo to be displayed in your listing.</span>
        <input type="file" name="trainer_photo" id="trainer_photo" value="{trainer_photo}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_email">Email Address</label>
        <span class="directions">The email address to be displayed in your listing.</span>
        <input type="text" name="trainer_email" id="trainer_email" value="{trainer_email}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_rate">Rate</label>
        <span class="directions">The rate to be displayed in your listing.</span>
        <input type="text" name="trainer_rate" id="trainer_rate" value="{trainer_rate}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_phone">Phone Number</label>
        <span class="directions">The phone number to be displayed in your listing.</span>
        <input type="text" name="trainer_phone" id="trainer_phone" value="{trainer_phone}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_address">Street Address</label>
        <span class="directions">This will NOT be displayed in your listing. Only for search Purposes.</span>
        <input type="text" name="trainer_address" id="trainer_address" value="{trainer_address}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_city">City</label>
        <span class="directions">The city to be displayed in your listing.</span>
        <input type="text" name="trainer_city" id="trainer_city" value="{trainer_city}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_state">State</label>
        <span class="directions">The state to be displayed in your listing.</span>
        <select name="trainer_state">
            {options:trainer_state}
                <option value="{option_value}"{selected}>{option_name}</option>
            {/options:trainer_state}
        </select>
    </div>

    <div class="formsection clearfix">
        <label for="trainer_zip">Zip Code</label>
        <span class="directions">The zip code to be displayed in your listing.</span>
        <input type="text" name="trainer_zip" id="trainer_zip" value="{trainer_zip}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_about">Trainer Information</label>
        <span class="directions">Information about the trainer to be displayed in your listing.</span>
        <textarea id="trainer_about" name="trainer_about" dir="{text_direction}" rows="{rows}">{trainer_about}</textarea>
    </div>

    <div class="formsection clearfix">
        <label for="trainer_certifications">Certifications</label>
        <span class="directions">Your certifications to be displayed in your listing. Separate with commas.</span>
        <input type="text" name="trainer_certifications" id="trainer_certifications" value="{trainer_certifications}">
    </div>

    <div class="formsection clearfix">
        <label for="trainer_areas_of_expertise">Areas of Expertise</label>
        <span class="directions">Your areas of expertise to be displayed in your listing. Separate with commas.</span>
        <textarea type="text" name="trainer_areas_of_expertise" dir="{text_direction}" id="trainer_areas_of_expertise">{trainer_areas_of_expertise}</textarea>
    </div>

    <div class="formsection clearfix">
        <label for="trainer_specials">Specials</label>
        <span class="directions">Your specials to be displayed in your listing. Separate with commas.</span>
        <textarea type="text" name="trainer_specials" dir="{text_direction}" id="trainer_specials">{trainer_specials}</textarea>
    </div>

    <div class="formsection clearfix">
        <label for="trainer_gym_affiliates">Gym Affiliates</label>
        <span class="directions">Your gym affiliates to be displayed in your listing. Separate with commas.</span>
        <textarea type="text" name="trainer_gym_affiliates" dir="{text_direction}" id="trainer_gym_affiliates">{trainer_gym_affiliates}</textarea>
    </div>

    {field:trainer_geocode}

    <div id="thankyousave">
        <input type="submit"  class="small red button radius" name="save" value="Save Settings" />
    </div>
{/exp:safecracker}

```

and here is the fields in the backend: http://d.pr/KeOa

# Answer
From what I can tell your hidden input fields for longitude and latitude may not be correctly named.

Try changing to:

```
 <input type="hidden" name="trainer_longitude" value="{trainer_longitude}" />
 <input type="hidden" name="trainer_latitude" value="{trainer_latitude}" />

```
> 1 votes

---
Tags: safecracker, geofinder
---


# Question
Title: Which Twitter plugins are compatible with the new v1.1 API?
As we all know, the Twitter v1 API is being shut down, so any plugins not using the new API will stop working in the near future.

**Which ExpressionEngine Twitter plugins have already been updated, and which will stop working soon?**

Further reading:

**Note:** I'm marking this as community wiki so that anyone with useful information can contribute.

# Answer
This answer is partly based on ExpressionEngine Twitter API v1.1 add-ons. It is a "community wiki" answer, so please feel free to edit it with any extra information available (state sources where possible).

### Already Updated for API v1.1

### Permanently Deprecated / Will Not Be Updated

### Unknown Status

* Tweetline (Free) by David Dexter / Codesly (last updated June 2012 so unlikely)
> 12 votes

# Answer
NSM Twitter has been updated and we are currently preparing an updated release at the moment.

If you want to update in the meantime you can change line 21 of twitteroauth.php to the new Twitter API endpoint - `https://api.twitter.com/1.1/`
> 3 votes

# Answer
This is a non-EE answer but is another option -- We've been relying on a JS solution for our EE projects, that loads the tweets in the page within the browser. The jQuery plugin we've been using is:

http://tweet.seaofclouds.com/

Concerned that the v1.1 update would break that jQuery plugin, yesterday we found and tested this wrapper:

https://github.com/StanScates/Tweet.js-Mod

It's working fine where we've implemented it, and is updated to support v1.1.
> 1 votes

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


# Question
Title: Exp-resso Store Shipping Country being ignored
I have a store that is doing international shipping. In this store I am giving the option to do international shipping but bill to the US. However, when the billing address is set to the US and the Shipping options are set to another country, I am still getting US billing prices.

What must you do to have the Shipping Region choices override the Billing Region choices?

Brad

# Answer
> 1 votes
In the Store \> Settings \> General tab scroll down to Default Shipping Address unless you have modified this it will be set to "Shipping Address Same as Billing Address" which means that until you have submitted both a shipping and billing address Store will only use the value of the billing field. From the sounds of it you would want to use "None"

---
Tags: expresso-store
---