ExpressionEngine phpList addon released!

We are excited to bring this simple yet effective free addon to the ExpressionEngine community. Creating AJAX powered sign up forms for phpList is now a breeze and the addon will generate both the form as well as the JavaScript to handle it.

You can get the addon right here on GitHub.

phpList addon for ExpressionEngine 3

This addon makes it easy to create AJAX phpList signup forms. Two tags are used: {exp:willow_phplist:form} to generate the form and {exp:willow_phplist:script} to generate the JavaScript for the sign up. Requirements: ExpressionEngine 3 and jQuery.

Installing

Just copy the willow_phplist folder to your /user/addons folder and activate it in the CPanel.

Creating the form

{exp:willow_phplist:form}
    <input type="email" name="email">
    <input type="submit" value="Subscribe!">
{/exp:willow_phplist:form}

The only required input is one named email. If your list has more attributes, all you need to do is add the input with the same name value.

Parameters

  • subscribe_page_id Sets up the form to use the chosen subscribe page created on phpList. Defaults to 1.
  • subscribe_page_url This is the base directory of your phplist installation, most commonly used are /list or /lists. Defaults to /lists/
  • list_id The list ID the visitor will be subscribing to.
  • form_id Set the form id for styling (do not include #). Defaults to phplist.

Generating the JavaScript for the form

{exp:willow_phplist:script}

Parameters

  • form_id Must match the form ID used with {exp:willow_phplist:form}. Defaults to phplist.
  • success_message Use this to define the copy displayed when the visitor successfully signs up.
  • failure_message If something goes wrong, this is displayed to let the user know the subscription was not successful.

Styling the form

Use the form’s id to style it with CSS (default is phplist).

Example

#phplist input.email { padding:5px; }
#phplist-success { color:green; }
#phplist-failure { color:red; }

The Switch Conundrum: Closing tags with switch statements in ExpressionEngine

There are times when the {switch} functionality is used to open and close a <div> or a <li>. In such instances (and similar ones), if the switch statement is not reached due to an odd or even number of entries, the code is left without the closing tag.

This method described below could technically be used to entirely bypass using {switch} all together, but I prefer to keep the consistency of using it across all templates.

Here’s a scenario when you are creating a row and two columns in each row (using bootstrap classes):

{exp:channel:entries channel="news"}
{switch='<div class="row">|'}
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{body}
</div>
{switch='|</div'}
{/exp:channel:entries}

In the example above, if you have 4 entries you’ll end up with two properly opened and closed <div> tags for rows. However, if you have 3 or any odd number, the last row will not have a closing tag.

Here’s a simple solution to the problem:

{exp:channel:entries channel="news"}
{switch='<div class="row">|'}
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{body}
</div>
{switch='|</div'}
{!-- If it is the last entry, check to see if it is an odd number --}
{if count == total_results}
{!-- If the remainder of total results divided by 2 is 1, then it is an odd number --}
{if total_results % 2 == 1}</div>{/if}
{/if}
{/exp:channel:entries}

The above code can easily be changed to check for an even number if the example above had 3 columns in each row.

All new website for musician and artist Sara Niemietz

We are honored to have been entrusted with the task of redesigning and developing a brand new website for musician and artist Sara Niemietz. The new website is lightweight, responsive (mobile and tablet friendly), and easy to manage.

Once again we decided to use ExpressionEngine for it’s flexibility, security and ease of use.

Check out Sara’s new website here!

And here’s a great video of Sara performing with Postmodern Jukebox

New Seeds of Independence website is now live

​We are excited to launch Seeds of Independence’s new website! Seeds is a Maine based organization that does some amazing work to help at risk youths in Maine reach their full potential as independent and productive members of society.

The new website is responsive (mobile-friendly) and features photography by us as well. We will continue to update the website with photos and new pages. The Seeds staff is able to fully manage their website from a user-friendly backend powered by ExpressionEngine. On that note we are grateful to EllisLab for their considerate flexibility in licensing for a non-profit which has enabled us to launch this website with ExpressionEngine 3.

Visit the new website!